:root{--bg: #f4f5f8;--surface: #ffffff;--surface-2: #eceef3;--text: #15171c;--muted: #5d6474;--border: #d9dce4;--accent: #e5484d;--accent-text: #ffffff;--right: #1f8a4c;--right-bg: #d7f5e3;--wrong: #c62f34;--wrong-bg: #fde2e2;--warn-bg: #fff1c2;--warn-text: #6b4e00;--gold: #e8a500;--radius: 14px;--shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 14px rgb(0 0 0 / 6%);color-scheme:light}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: #14161c;--surface: #1e2129;--surface-2: #292d37;--text: #eef0f4;--muted: #a0a7b6;--border: #353a46;--right: #4cc38a;--right-bg: #173a29;--wrong: #ff6b70;--wrong-bg: #42191b;--warn-bg: #3d3210;--warn-text: #ffd866;--shadow: none;color-scheme:dark}}:root[data-theme=dark]{--bg: #14161c;--surface: #1e2129;--surface-2: #292d37;--text: #eef0f4;--muted: #a0a7b6;--border: #353a46;--right: #4cc38a;--right-bg: #173a29;--wrong: #ff6b70;--wrong-bg: #42191b;--warn-bg: #3d3210;--warn-text: #ffd866;--shadow: none;color-scheme:dark}*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:16px;line-height:1.45;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}button,input{font:inherit;color:inherit}h1{font-size:1.4rem;margin:0}h2{font-size:1.1rem;margin:0 0 .5rem}.screen{max-width:480px;margin:0 auto;padding:max(16px,env(safe-area-inset-top)) 16px max(24px,env(safe-area-inset-bottom));min-height:100dvh;display:flex;flex-direction:column;gap:16px}.center{justify-content:center;align-items:center;text-align:center}.center-text{text-align:center}.stack{display:flex;flex-direction:column;gap:12px}.muted{color:var(--muted)}.small{font-size:.875rem}.error{color:var(--wrong);margin:0}.right{color:var(--right);margin:0;font-weight:600}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.button{min-height:48px;padding:0 20px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);cursor:pointer;font-weight:600}.button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.button.big{min-height:56px;font-size:1.1rem}.button.small{min-height:48px;padding:0 14px;align-self:flex-start}.button:disabled{opacity:.5;cursor:default}.icon-button{width:48px;height:48px;border-radius:50%;border:none;background:var(--surface-2);font-size:1.25rem;cursor:pointer;flex:none}.share-button{display:grid;place-items:center;padding:0}.toast{position:fixed;left:50%;bottom:max(32px,calc(env(safe-area-inset-bottom) + 32px));transform:translate(-50%);z-index:20;margin:0;max-width:min(440px,calc(100vw - 32px));padding:10px 16px;border-radius:999px;background:var(--text);color:var(--bg);font-weight:600;text-align:center}.link{background:none;border:none;color:var(--accent);font-weight:600;cursor:pointer;min-height:48px;padding:0 4px}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}.field{display:flex;flex-direction:column;gap:6px;font-weight:600}.field input{min-height:52px;padding:0 14px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);font-size:1.1rem;font-weight:400}.banner{margin:0;padding:12px 14px;border-radius:var(--radius);background:var(--surface-2)}.banner-warn{background:var(--warn-bg);color:var(--warn-text);font-weight:600}.login-banner{display:flex;flex-direction:column;align-items:flex-start;gap:10px}a.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}.consent{position:fixed;left:0;right:0;bottom:0;z-index:10;max-width:480px;margin:0 auto;padding:16px 16px max(16px,env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -4px 20px #00000026}.consent p{margin:0 0 12px;font-size:.9rem}.consent a{color:var(--accent)}.consent-actions{display:flex;gap:8px}.consent-actions .button{flex:1}.topbar{display:flex;align-items:center;gap:12px}.topbar h1{flex:1}.onboarding{justify-content:center}.logo{font-size:4rem;text-align:center}.portal-link{align-self:flex-start;display:inline-flex;align-items:center;min-height:44px;margin:-8px 0;font-weight:800;letter-spacing:.02em;color:var(--text);text-decoration:none}.portal-link span{color:var(--accent)}.home-header{display:flex;align-items:center;gap:12px}.home-streak{flex:1;display:flex;flex-direction:column}.flame{font-size:2.5rem;filter:grayscale(1);opacity:.5}.flame-on{filter:none;opacity:1;animation:flicker 1.6s ease-in-out infinite alternate}@keyframes flicker{0%{transform:scale(1) rotate(-2deg)}to{transform:scale(1.08) rotate(2deg)}}.xp{display:flex;flex-direction:column;gap:6px}.xp-labels{display:flex;justify-content:space-between;font-size:.9rem}.xp-track{height:10px;border-radius:5px;background:var(--surface-2);overflow:hidden}.xp-fill{height:100%;background:var(--gold);border-radius:5px;transition:width .6s ease}.cards{display:flex;flex-direction:column;gap:12px}.card{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:16px;min-height:84px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);box-shadow:var(--shadow);text-align:left;cursor:pointer}.card:disabled{opacity:.55;cursor:default}.card-title{font-size:1.15rem;font-weight:700}.card-sub{font-size:.9rem}.card-done{background:var(--surface-2);cursor:default}.badge-new{padding:2px 8px;border-radius:999px;background:var(--accent);color:var(--accent-text);font-size:.75rem;font-weight:700;flex:none}.card-review{border-left:6px solid var(--gold)}.card-learn{border-left:6px solid var(--right)}.section-head{display:flex;justify-content:space-between;align-items:center}.task{border-radius:var(--radius);background:var(--surface);padding:12px 16px;text-align:center;border:3px solid transparent}.task-prompt{font-size:clamp(2.2rem,11vw,3.2rem);font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:.02em}.task-input{font-size:2rem;font-variant-numeric:tabular-nums;min-height:1.5em;border-top:1px dashed var(--border);margin-top:4px}.flash-right{animation:flash-right .35s ease-out}.flash-wrong{animation:flash-wrong .45s ease-out}@keyframes flash-right{0%{border-color:var(--right);background:var(--right-bg)}}@keyframes flash-wrong{0%{border-color:var(--wrong);background:var(--wrong-bg)}}.numpad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:auto;touch-action:manipulation;user-select:none}.numpad-key{min-height:60px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);font-size:1.6rem;font-weight:600;cursor:pointer;box-shadow:var(--shadow)}.numpad-key:active{background:var(--surface-2)}.numpad-submit{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}@media(max-height:720px){.task{padding:4px 12px}.task-prompt{font-size:2.1rem}.task-input{font-size:1.5rem}.numpad{gap:6px}.numpad-key{min-height:52px}}.result-line,.result-rank,.result-xp,.near-miss{margin:0;text-align:center}.result-xp{color:var(--gold);font-weight:800}.celebrate{margin:0;padding:12px;border-radius:var(--radius);background:var(--warn-bg);color:var(--warn-text);text-align:center;font-weight:700;animation:pop .5s ease-out}@keyframes pop{0%{transform:scale(.8);opacity:0}}.steps{margin:8px 0 0;padding-left:1.4em;display:flex;flex-direction:column;gap:4px}.step-expr{font-variant-numeric:tabular-nums}.step-note{margin-left:8px;color:var(--muted);font-size:.85rem}.path{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.path-step{width:100%;display:flex;align-items:center;gap:12px;padding:14px;min-height:72px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);text-align:left;cursor:pointer}.path-step.mastered .path-index{background:var(--right-bg);color:var(--right)}.boxes{display:inline-flex;gap:3px;flex:none}.box{width:8px;height:8px;border-radius:2px;background:var(--border)}.box-on{background:var(--right)}.mastered-banner{display:flex;align-items:center;gap:8px;color:var(--right);font-weight:700}.review-results{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.review-results li{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:10px;background:var(--surface)}.path-step.locked{opacity:.55;cursor:default}.path-index{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--surface-2);font-weight:800;flex:none}.path-text{flex:1;display:flex;flex-direction:column}.explanation{font-size:1.1rem;margin:0}.example{padding:14px;border-radius:var(--radius);background:var(--surface);border-left:6px solid var(--right)}.example p{margin:4px 0 0;font-size:1.15rem;font-weight:600}.segmented{border:none;margin:0;padding:0;display:flex;gap:6px;flex-wrap:wrap}.segmented legend{font-weight:600;margin-bottom:6px;padding:0}.segmented button{flex:1;min-height:48px;border-radius:10px;border:1px solid var(--border);background:var(--surface);cursor:pointer}.segmented button[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:var(--accent-text);font-weight:700}.danger{padding-top:8px;border-top:1px solid var(--border)}.danger p{margin:0}.danger-button{border-color:var(--wrong);color:var(--wrong)}.legal{display:flex;flex-wrap:wrap;justify-content:center;column-gap:24px}.legal a{color:var(--muted);min-height:48px;display:inline-flex;align-items:center}@media(prefers-reduced-motion:reduce){.flame-on,.celebrate{animation:none}.xp-fill{transition:none}}
