:root { --green: #0b6b45; --lime: #e4f6e8; --gold: #ffc928; --orange: #c2530a; --red: #b3261e; --ink: #17231d; --muted: #526158; --bg: #fffaf0; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: 76px; overflow-wrap: break-word; }
header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--green); border-bottom: 5px solid var(--gold); }
.brand { color: #fff; font-weight: 800; font-size: 1.3rem; text-decoration: none; }
.chip { border: 0; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 700; background: #ddd; color: var(--ink); }
.chip.on { background: #c9f7d3; color: #064b2f; }
.chip.off { background: #ffe0dc; color: #8a1c15; }
main { max-width: 520px; margin: 0 auto; padding: 14px; }
h1 { font-size: 1.4rem; line-height: 1.2; margin: 8px 0 12px; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
a { color: var(--green); }
.hero { background: linear-gradient(135deg, var(--gold), #ff9d3c); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.hero h1 { margin-top: 0; }
.hero p { margin: 0; }
.tile { display: flex; gap: 14px; align-items: center; padding: 14px; margin: 10px 0; border-radius: 16px; color: #fff; text-decoration: none; }
.tile.green { background: var(--green); }
.tile.orange { background: var(--orange); }
.tile.red { background: var(--red); }
.tile-icon { font-size: 2rem; }
.tile strong, .tile small { display: block; }
.tile strong { font-size: 1.1rem; }
.card { display: block; background: #fff; border: 2px solid #eadfc6; border-radius: 14px; padding: 12px 14px; margin: 10px 0; color: var(--ink); text-decoration: none; }
.card p { margin: 8px 0; }
.row { display: flex; justify-content: space-between; gap: 8px; }
.summary small, .summary strong, .summary span, .breakeven small, .breakeven strong, .breakeven span { display: block; }
.breakeven { background: var(--gold); border-color: #e0ad10; text-align: center; }
.breakeven strong { font-size: 1.6rem; }
.ai { border-color: var(--green); background: var(--lime); }
.tag { font-weight: 700; color: var(--green); text-transform: uppercase; font-size: .75rem; }
.grid, .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; font: inherit; font-weight: 700; background: #fff; border: 2px solid var(--green); border-radius: 14px; color: var(--ink); }
.pick span { font-size: 2rem; }
.stat { background: #fff; border: 2px solid #eadfc6; border-radius: 12px; padding: 8px 10px; min-width: 0; }
.stat small { display: block; color: var(--muted); }
.stat strong { font-size: 1.15rem; }
.stat.good { border-color: var(--green); background: var(--lime); }
.stat.bad { border-color: var(--red); background: #ffe9e6; }
label { display: block; margin: 10px 0; font-weight: 600; }
label span { display: block; margin-bottom: 4px; }
input, select, textarea { width: 100%; min-width: 0; font: inherit; padding: 11px 12px; border: 2px solid #cbbf9f; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
fieldset { border: 2px dashed #cbbf9f; border-radius: 12px; padding: 10px; margin: 12px 0; min-width: 0; }
legend { font-weight: 700; padding: 0 4px; }
.cost { display: grid; grid-template-columns: minmax(0, 1fr) 84px 38px; gap: 6px; margin-bottom: 6px; }
.icon-btn { border: 0; border-radius: 10px; background: #f1e9d6; font: inherit; }
.btn { display: block; width: 100%; margin: 10px 0; padding: 13px; border: 0; border-radius: 12px; background: var(--green); color: #fff; font: inherit; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
.btn.alt { background: #fff; color: var(--green); border: 2px solid var(--green); }
.btn.orange { background: var(--orange); }
.btn.red { background: var(--red); }
.btn:disabled { opacity: .55; }
.link { background: none; border: 0; padding: 10px 0; font: inherit; font-weight: 700; color: var(--green); text-decoration: underline; cursor: pointer; }
.link.danger { color: var(--red); }
.back { display: inline-block; padding: 4px 0; font-weight: 700; text-decoration: none; }
.notice { padding: 10px 12px; border-radius: 10px; background: #e8f0ff; border-left: 5px solid #3563c9; }
.notice.good { background: var(--lime); border-color: var(--green); }
.notice.warn { background: #fff0c9; border-color: #c98a00; }
.notice.bad { background: #ffe9e6; border-color: var(--red); }
.muted { color: var(--muted); display: block; }
.ask { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 6px; align-items: center; }
.loading { display: flex; gap: 10px; align-items: center; padding: 10px 0; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 3px solid #cfe6d6; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 8px 12px; border-radius: 16px; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble small { display: block; font-weight: 700; opacity: .75; }
.bubble.character { align-self: flex-start; background: #fff; border: 2px solid #eadfc6; border-bottom-left-radius: 4px; }
.bubble.pupil { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.referee { border-radius: 12px; padding: 8px 12px; font-size: .93rem; border: 2px dashed; }
.referee p { margin: 4px 0 0; }
.referee.smart { background: var(--lime); border-color: var(--green); }
.referee.okay { background: #fff5d6; border-color: #c98a00; }
.referee.risky { background: #ffe9e6; border-color: var(--red); }
.composer { margin-top: 12px; }
.composer textarea { resize: vertical; }
.lesson h2 { text-align: center; color: var(--orange); font-size: 1.8rem; margin-top: 0; }
.lesson.danger { border-color: var(--red); }
.lesson li { margin-bottom: 6px; }
.stars { color: var(--gold); font-weight: 700; }
nav { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 2px solid #eadfc6; z-index: 5; }
nav a { display: flex; flex-direction: column; align-items: center; padding: 8px 2px 10px; font-size: .78rem; font-weight: 700; text-decoration: none; color: var(--muted); }
nav a span { font-size: 1.3rem; }
nav a[aria-current] { color: var(--green); background: var(--lime); }
.bubble, .referee, .lesson, #results { scroll-margin: 70px 0 90px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } .spinner { animation-duration: 2s; } }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; }
th, td { border: 1px solid #eadfc6; padding: 6px 4px; text-align: right; }
tr.minus td { background: #ffe9e6; }
.tools { display: flex; gap: 8px; align-items: center; }
.gear { text-decoration: none; font-size: 1.35rem; }
#switcher { display: flex; gap: 8px; align-items: center; max-width: 520px; margin: 0 auto; padding: 8px 14px 0; font-weight: 700; }
#switcher[hidden] { display: none; }
#switcher select { flex: 1; padding: 7px 10px; }
.goal strong, .goal span { display: block; }
.goal strong { font-size: 1.3rem; }
.bar { height: 14px; margin: 6px 0; border-radius: 99px; background: #eadfc6; overflow: hidden; }
.bar span { height: 100%; background: var(--green); }
.goal.practice .bar span { background: #3563c9; }
.phone { display: block; background: #fff; border: 3px dashed #3563c9; border-radius: 18px; padding: 14px; margin: 12px 0; }
.sim { display: block; text-align: center; background: #3563c9; color: #fff; border-radius: 8px; padding: 6px; }
.tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.tick input { width: 22px; height: 22px; flex: none; }
.tick small { display: block; color: var(--muted); margin: 0; }
details summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.row { align-items: center; }
.more .stats { margin-bottom: 10px; }
