/* Base styles: variables, layout, typography, buttons, inputs. Mobile-first (375px base). */
:root {
  --bg: #f6f5f1; --surface: #ffffff; --surface2: #efede6; --text: #1f1e1b; --text2: #5c5a54; --text3: #8a877f;
  --border: rgba(0,0,0,0.12); --accent: #534AB7; --good: #3B6D11; --goodbg: #EAF3DE; --bad: #A32D2D; --badbg: #FCEBEB;
  --warn: #854F0B; --warnbg: #FAEEDA; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151513; --surface: #1f1f1c; --surface2: #2a2a26; --text: #f1efe8; --text2: #b4b2a9; --text3: #888780;
    --border: rgba(255,255,255,0.14); --goodbg: #1f2e12; --good: #97C459; --badbg: #3a1717; --bad: #F09595; --warnbg: #3a2a10; --warn: #FAC775; }
}
* { 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; line-height: 1.5; }
body { -webkit-text-size-adjust: 100%; }
#app { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 24px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 19px; margin: 24px 0 8px; font-weight: 600; }
h3 { font-size: 16px; margin: 0 0 4px; font-weight: 600; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
.muted { color: var(--text2); font-size: 14px; }
.tiny { color: var(--text3); font-size: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text2); font-size: 14px; padding: 8px 0; min-height: 44px; cursor: pointer; }
button { font: inherit; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 16px; margin-top: 10px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--wc, var(--accent)); border-color: transparent; color: #fff; }
.btn.small { width: auto; min-height: 40px; font-size: 14px; margin-top: 0; padding: 0 14px; }
.btn.danger { color: var(--bad); }
.btn:active { transform: scale(0.99); }
.btn[disabled] { opacity: 0.55; cursor: wait; }
input, textarea, select { font: inherit; font-size: 16px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { outline: 2px solid var(--wc, var(--accent)); outline-offset: 1px; }
.err { color: var(--bad); font-size: 14px; margin-top: 6px; }
.ok { color: var(--good); font-size: 14px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.centre { text-align: center; }
.lesson h3 { margin-top: 20px; }
.lesson ul { padding-left: 20px; margin: 0 0 12px; }
.lesson li { margin-bottom: 4px; }
.lesson p { font-size: 16px; line-height: 1.65; }
@media (min-width: 640px) { #app { padding-top: 32px; } h1 { font-size: 28px; } }
