:root {
  --bg: #f6f7f9; --surface: #fff; --text: #1d2330; --muted: #6b7484; --border: #e3e6eb;
  --primary: #1f9d55; --primary-soft: #e3f6ea; --accent: #2b6cde;
  --warn: #fff4d6; --warn-border: #f2d27a; --warn-text: #8a6100;
  --bad: #d64545; --bad-soft: #fde7e7; --gold: #f5b100; --fix: #8b5cf6;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --surface: #1b2029; --text: #e8ebf0; --muted: #97a0b0; --border: #2c3340;
    --primary: #34c172; --primary-soft: #183526; --accent: #5c93f0;
    --warn: #3a3218; --warn-border: #6b5a22; --warn-text: #f2d27a;
    --bad: #ee6a6a; --bad-soft: #3a1f22; --fix: #a78bfa;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.55rem; margin: .2em 0 .5em; }
h2 { font-size: 1.25rem; margin: .2em 0; }
h3 { font-size: 1.05rem; margin: 0 0 .6em; }
button, select, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.left { text-align: left; justify-content: flex-start; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
code { background: var(--primary-soft); padding: 1px 6px; border-radius: 6px; }
.warn-text { color: var(--warn-text); }

/* tlačítka */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 2px solid transparent; border-radius: 14px; padding: 12px 20px; font-weight: 700; cursor: pointer; background: var(--surface); box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:disabled { background: var(--border); color: var(--muted); box-shadow: none; cursor: default; }
.btn.outline { border-color: var(--border); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { padding: 8px 14px; font-size: .9rem; border-radius: 12px; }
.btn.big { width: 100%; padding: 16px; font-size: 1.1rem; }
.icon-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); padding: 6px 10px; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 10px; font-weight: 600; }

/* rámec */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.lang-btn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
.top-stats { display: flex; gap: 6px; }
.chip { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.chip.fire { border-color: #f59e0b; }
.content { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; padding: 4px 8px; border-radius: 12px; color: var(--muted); min-width: 58px; }
.bottomnav a span { font-size: 1.35rem; }
.bottomnav a small { font-size: .72rem; font-weight: 600; }
.bottomnav a.on { color: var(--primary); background: var(--primary-soft); }

.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.warn { background: var(--warn); border-color: var(--warn-border); }
.card.ai-soon { background: var(--primary-soft); border-color: transparent; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; background: var(--bg); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.status { border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; font-weight: 600; font-size: .92rem; }
.status.ok { background: var(--primary-soft); color: var(--primary); }
.status.warn { background: var(--warn); color: var(--warn-text); }

.progress { height: 12px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress.sm { height: 8px; }
.progress > div { height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }
.progress > div.low { background: var(--gold); }

/* středové stránky (přihlášení, výsledky…) */
.center-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px; max-width: 520px; margin: 0 auto; }
.center-page .card { width: 100%; }
.logo { width: 84px; height: 84px; }
.big-flag { font-size: 4rem; }
.tabs { display: flex; background: var(--border); border-radius: 12px; padding: 4px; margin: 12px 0; width: 100%; }
.tabs button { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--text); }
.auth { text-align: left; }
.form-msg { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .9rem; }
.profile-list, .lang-choices, .welcome-choices { display: grid; gap: 12px; width: 100%; margin: 14px 0; }
.lang-choices { grid-template-columns: 1fr 1fr; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px; cursor: pointer; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); box-shadow: 0 3px 0 var(--border); }
.choice:hover, .choice.on { border-color: var(--primary); }
.choice span { font-size: 2rem; }
.choice small { color: var(--muted); }
.profile-list .choice { flex-direction: row; gap: 12px; justify-content: flex-start; padding: 14px 18px; }
.profile-list .choice span { font-size: 1.5rem; }
.level-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; width: 100%; margin: 16px 0; }
.choice.small b { font-size: 1.4rem; color: var(--primary); }
.result-emoji { font-size: 4rem; }
.result-stats { display: flex; gap: 10px; margin: 16px 0; width: 100%; }
.result-stats > div { flex: 1; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 12px 6px; display: flex; flex-direction: column; }
.result-stats b { font-size: 1.4rem; color: var(--primary); }
.result-stats small { color: var(--muted); font-size: .78rem; }
.result .can { text-align: left; background: var(--primary-soft); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; width: 100%; }
.result .card { text-align: left; }

/* oslavné efekty (vrstva nad vším, neblokuje klikání) */
.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fx-grid .btn { font-size: .85rem; padding: 10px 8px; }

/* Spíka – animace oslav */
.celebrate { position: fixed; left: 50%; top: 34%; transform: translate(-50%, -50%); z-index: 81; pointer-events: none; display: flex; flex-direction: column; align-items: center; animation: cel-in .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.celebrate img { width: min(70vw, 280px); height: auto; filter: drop-shadow(0 8px 16px rgba(0,0,0,.25)); }
.celebrate-text { margin-top: -8px; background: #f59e0b; color: #fff; font-weight: 800; font-size: 1.25rem; padding: 6px 16px; border-radius: 999px; box-shadow: 0 4px 0 rgba(0,0,0,.18); white-space: nowrap; }
.celebrate.out { animation: cel-out .35s ease-in both; }
@keyframes cel-in { from { opacity: 0; transform: translate(-50%, -40%) scale(.6); } }
@keyframes cel-out { to { opacity: 0; transform: translate(-50%, -60%) scale(.8); } }
.tom-anim .tom-img { width: 170px; height: 170px; }

/* Spíka – průvodce */
.tom-img { display: block; object-fit: contain; user-select: none; }
.tom-hero { width: 200px; height: auto; margin-bottom: 4px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.15)); }
.tom-says { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 14px; text-align: left; }
.tom-says .tom-img { flex: none; width: 68px; height: 68px; }
.tom-says.tom-sm .tom-img { width: 48px; height: 54px; }
.tom-says.tom-lg { justify-content: center; }
.tom-says.tom-lg .tom-img { width: 104px; height: 104px; }
.tom-bubble { position: relative; background: var(--surface); border: 2px solid var(--border); border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-size: .95rem; line-height: 1.4; max-width: 520px; margin-bottom: 14px; }
.tom-bubble::before { content: ''; position: absolute; left: -9px; bottom: 10px; width: 14px; height: 14px; background: var(--surface); border-left: 2px solid var(--border); border-bottom: 2px solid var(--border); transform: rotate(45deg); }
.tip-tom { display: flex; gap: 10px; align-items: flex-start; }
.tom-tip { width: 52px; height: 60px; flex: none; }
.fb-row { display: flex; gap: 10px; align-items: flex-start; }
.fb-tom { width: 46px; height: 54px; flex: none; }
.fb-content { min-width: 0; flex: 1; }
.interlude .tom-says { margin-bottom: 6px; }

/* přehled */
.hero { display: flex; gap: 16px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.hero > div:first-child { flex: 1; min-width: 0; }
.hero h1 { margin: 0; font-size: 1.35rem; }
.goal-ring { --p: 0; width: 88px; height: 88px; flex: none; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 360deg), var(--border) 0); display: grid; place-items: center; }
.goal-ring span { width: 70px; height: 70px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem; }
.goal-ring small { font-size: .62rem; color: var(--muted); font-weight: 600; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.mode-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.15); min-height: 140px; }
.mode-card.mc-home { background: linear-gradient(135deg, #1f9d55, #3cc47a); }
.mode-card.mc-car { background: linear-gradient(135deg, #22324d, #3d5a8c); }
.mode-ico { font-size: 2.2rem; }
.mode-card b { font-size: 1.3rem; }
.mode-card small { opacity: .92; }
.row-card { display: flex; align-items: center; gap: 14px; }
.row-ico { font-size: 2rem; }
.mistake-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.mistake-row:last-child { border-bottom: none; }
.week { display: flex; gap: 8px; height: 100px; align-items: flex-end; }
.day { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.dbar { width: 100%; max-width: 32px; background: var(--primary); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.day small { color: var(--muted); font-size: .75rem; }

/* cesta */
.level { margin-bottom: 26px; }
.level.locked .path, .level.locked .level-head { opacity: .6; }
.level-head { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; flex-wrap: wrap; }
.level-badge { width: 54px; height: 54px; border-radius: 14px; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.3rem; display: grid; place-items: center; flex: none; }
.level-badge.big { width: 84px; height: 84px; font-size: 2rem; border-radius: 22px; margin-bottom: 8px; }
.level.locked .level-badge { background: var(--muted); }
.level-info { flex: 1; min-width: 170px; }
.level-info p { margin: 2px 0; }
.path { display: flex; flex-direction: column; align-items: center; padding: 18px 0 4px; gap: 10px; }
.node-wrap { display: flex; flex-direction: column; align-items: center; transform: translateX(calc(var(--off) * 38px)); }
.node { --p: 0; width: 76px; height: 76px; border-radius: 50%; border: none; cursor: pointer; background: conic-gradient(var(--gold) calc(var(--p) * 360deg), var(--border) 0); padding: 6px; }
.node span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; font-size: 1.8rem; background: var(--primary); box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); }
.node.done span { background: var(--gold); }
.node.work span { background: #f59e0b; }
.node.locked span { background: var(--border); filter: grayscale(1); }
.node-label { text-align: center; font-weight: 600; font-size: .85rem; max-width: 170px; margin-top: 4px; }
.node-label small { display: block; color: var(--muted); font-weight: 500; }

/* spodní panel */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); position: relative; }
.sheet-close { position: absolute; top: 10px; right: 10px; }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.sheet-ico { font-size: 2.6rem; }
.tip { background: var(--primary-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.tip p { margin: 6px 0 0; font-size: .92rem; }
.vocab-list { margin-bottom: 14px; }
.vocab-list summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.vocab-list ul { list-style: none; padding: 0; margin: 6px 0; columns: 2; column-gap: 16px; }
.vocab-list li { break-inside: avoid; padding: 3px 0; font-size: .92rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sheet-actions { display: grid; gap: 10px; }

/* lekce */
.lesson { min-height: 100vh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; }
.lesson-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.bar { flex: 1; height: 16px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .35s; }
.bar-fill.fixing { background: var(--fix); }
.round-tag { background: var(--fix); color: #fff; border-radius: 8px; padding: 2px 10px; font-size: .8rem; font-weight: 700; }
.lesson-body { flex: 1; padding: 8px 16px 220px; }
.tags { margin-bottom: 8px; display: flex; gap: 6px; }
.tag { border-radius: 8px; padding: 2px 10px; font-size: .78rem; font-weight: 700; }
.tag.fix { background: var(--fix); color: #fff; }
.tag.review { background: var(--warn); color: var(--warn-text); }
.ex-title { font-size: 1.35rem; margin: 6px 0 18px; }
.prompt-word { font-size: 1.6rem; font-weight: 700; display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.prompt-word.cs { color: var(--primary); }
.prompt-sentence { font-size: 1.25rem; font-weight: 600; padding: 14px 16px; border: 2px solid var(--border); border-radius: 16px; margin-bottom: 18px; background: var(--surface); }
.prompt-target { font-size: 1.4rem; font-weight: 600; margin-bottom: 6px; }
.prompt-hint { color: var(--muted); margin: 4px 0 18px; font-style: italic; }
.blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--primary); margin: 0 4px; color: transparent; }
.picture { font-size: 6rem; text-align: center; margin: 4px 0 18px; line-height: 1.1; }
.bubble { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 18px 18px 18px 4px; background: var(--surface); border: 2px solid var(--border); font-size: 1.15rem; font-weight: 600; }
.speaker { background: var(--accent); color: #fff; border: none; border-radius: 14px; width: 48px; height: 48px; font-size: 1.3rem; cursor: pointer; flex: none; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.speaker.sm { width: 32px; height: 32px; font-size: .9rem; border-radius: 10px; box-shadow: none; }
.speaker.big { width: 96px; height: 96px; font-size: 2.6rem; border-radius: 24px; }
.speaker.slow { width: 64px; height: 64px; font-size: 1.7rem; border-radius: 18px; background: #6b8fd6; }
.audio-row { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 10px 0 24px; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; font-size: 1.1rem; font-weight: 600; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; cursor: pointer; box-shadow: 0 3px 0 var(--border); }
.option .kbd { width: 26px; height: 26px; border: 2px solid var(--border); border-radius: 8px; display: grid; place-items: center; font-size: .8rem; color: var(--muted); flex: none; }
.option.selected { border-color: var(--accent); background: rgba(43,108,222,.08); }
.option.correct { border-color: var(--primary); background: var(--primary-soft); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match .col { display: grid; gap: 10px; }
.tile-m { padding: 14px 10px; font-size: 1.05rem; font-weight: 600; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; cursor: pointer; box-shadow: 0 3px 0 var(--border); min-height: 56px; }
.tile-m.selected { border-color: var(--accent); background: rgba(43,108,222,.1); }
.tile-m.done { opacity: .35; border-color: var(--primary); }
.shake { animation: shake .4s; border-color: var(--bad) !important; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.answer-line { min-height: 64px; border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); padding: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; margin-bottom: 24px; }
.bank, .fix-line { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fix-line { margin: 8px 0 16px; }
.tile { padding: 10px 14px; font-size: 1.05rem; font-weight: 600; background: var(--surface); border: 2px solid var(--border); border-radius: 12px; cursor: pointer; box-shadow: 0 3px 0 var(--border); }
.tile.used { color: transparent; background: var(--border); box-shadow: none; pointer-events: none; }
.tile.selected { border-color: var(--accent); background: rgba(43,108,222,.1); }
.tile.wrong-word { border-color: var(--bad); background: var(--bad-soft); text-decoration: line-through; }
.text-answer { width: 100%; padding: 14px; font-size: 1.15rem; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); resize: vertical; }
.text-answer:focus { outline: none; border-color: var(--accent); }
.say-card { display: flex; gap: 14px; align-items: center; padding: 16px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); margin-bottom: 24px; }
.say-target { font-size: 1.3rem; font-weight: 700; }
.say-cs { color: var(--muted); }
.mic-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 22px; font-size: 1.2rem; font-weight: 700; border-radius: 18px; border: 2px solid var(--accent); color: var(--accent); background: var(--surface); cursor: pointer; box-shadow: 0 4px 0 var(--accent); }
.mic-ico { font-size: 1.8rem; }
.mic-btn.listening { background: var(--accent); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(43,108,222,.2); } }
.heard { min-height: 1.6em; text-align: center; margin: 14px 0; color: var(--muted); font-style: italic; }
.interlude { text-align: center; padding: 40px 10px; }
.interlude-ico { font-size: 4rem; }

.lesson-foot { position: fixed; left: 0; right: 0; bottom: 0; border-top: 2px solid var(--border); background: var(--surface); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.foot-inner { max-width: 720px; margin: 0 auto; }
.foot-row { display: flex; justify-content: space-between; gap: 12px; }
.foot-row .btn.primary { flex: 1; max-width: 320px; margin-left: auto; padding: 14px; font-size: 1.05rem; }
.lesson-foot.ok { background: var(--primary-soft); border-top-color: var(--primary); }
.lesson-foot.bad { background: var(--bad-soft); border-top-color: var(--bad); }
.lesson-foot.bad .btn.primary { background: var(--bad); }
.fb { margin-bottom: 12px; max-height: 40vh; overflow: auto; }
.fb-title { font-weight: 800; font-size: 1.2rem; }
.ok .fb-title { color: var(--primary); }
.bad .fb-title { color: var(--bad); }
.fb-correct { font-size: 1.1rem; font-weight: 700; margin-top: 2px; }
.fb-rule { font-size: .92rem; margin-top: 6px; background: var(--surface); border-radius: 10px; padding: 8px 10px; }
.fb-note { font-size: .9rem; color: var(--muted); margin-top: 4px; }
.combo { font-size: .85rem; color: #f59e0b; margin-left: 6px; }

/* pokrok */
.cefr { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 10px; }
.cefr-step { text-align: center; padding: 10px 2px; border-radius: 12px; background: var(--bg); border: 2px solid var(--border); }
.cefr-step b { display: block; font-size: 1.1rem; }
.cefr-step small { font-size: .62rem; color: var(--muted); display: block; line-height: 1.2; }
.cefr-step.done { background: var(--primary); border-color: var(--primary); color: #fff; }
.cefr-step.done small { color: #e6ffe9; }
.cefr-step.cur { border-color: var(--gold); }
.skill { margin-bottom: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-stat { text-align: center; border-radius: 12px; padding: 10px 4px; background: var(--bg); }
.mini-stat b { display: block; font-size: 1.3rem; }
.mini-stat small { font-size: .75rem; color: var(--muted); }
.st-known b { color: var(--primary); }
.st-forgetting b { color: var(--bad); }
.st-learning b { color: var(--gold); }
.mtable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mtable th, .mtable td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.mtable th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.log { padding-left: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { text-align: center; margin: 0; }
.stat b { display: block; font-size: 1.6rem; color: var(--primary); }
.stat small { color: var(--muted); }
details summary { cursor: pointer; padding: 6px 0; }

/* formuláře */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 600; }
.field.row { flex-direction: row; align-items: center; gap: 10px; }
.field.row input { width: 20px; height: 20px; }
.field select, .field input:not([type=checkbox]):not([type=range]) { padding: 11px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); font-weight: 500; }
.field input[type=range] { accent-color: var(--primary); }
.field small { font-weight: 400; }

/* režim auto */
.car { position: fixed; inset: 0; z-index: 60; background: #0b0f17; color: #f2f5fa; display: flex; flex-direction: column; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.car-top { display: flex; justify-content: space-between; align-items: center; }
.car-stats { display: flex; gap: 16px; font-size: 1.15rem; font-weight: 700; }
.car-score { color: #4ade80; }
.car-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 10px; min-height: 0; }
.car-orb { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; font-size: 4rem; background: #1e2738; transition: background .2s; }
.car-orb.speaking { background: #2563eb; }
.car-orb.listening { background: #dc2626; animation: carpulse 1.1s infinite; }
.car-orb.ok { background: #16a34a; }
.car-orb.bad { background: #d97706; }
.car-orb.paused { background: #475569; }
.car-orb.info { background: #7c3aed; }
.car-orb.thinking { background: #0e7490; animation: think 1.4s ease-in-out infinite; }
@keyframes think { 50% { transform: scale(.94); opacity: .8; } }
.section-title { font-size: 1.1rem; margin: 18px 0 10px; }
.scen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 8px; }
.scen { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; box-shadow: 0 3px 0 var(--border); }
.scen:hover { border-color: var(--primary); }
.scen-ico { font-size: 2rem; }
.scen-txt { display: flex; flex-direction: column; }
.scen-txt small { color: var(--muted); }
@keyframes carpulse { 50% { box-shadow: 0 0 0 26px rgba(220,38,38,.25); } }
.car-label { font-size: 1.5rem; font-weight: 800; }
.car-main { font-size: clamp(1.5rem, 5.5vw, 2.5rem); font-weight: 700; line-height: 1.25; max-width: 900px; }
.car-sub { font-size: 1.25rem; color: #9fb0c8; min-height: 1.5em; max-width: 900px; }
.car-controls { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 12px; }
.car-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #1e2738; color: #fff; border: none; border-radius: 22px; font-size: 2.2rem; padding: 18px 8px; cursor: pointer; min-height: 110px; }
.car-btn small { font-size: 1rem; font-weight: 600; color: #b9c6da; }
.car-btn.huge { background: #2563eb; font-size: 3rem; }
.car-btn.small { min-height: auto; font-size: 1.05rem; padding: 10px 16px; border-radius: 14px; flex-direction: row; }
@media (orientation: landscape) and (max-height: 520px) {
  .car-center { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
  .car-orb { width: 90px; height: 90px; font-size: 2.4rem; }
  .car-btn { min-height: 76px; }
}

@media (max-width: 420px) {
  .lang-btn span, .top-stats .chip:first-child { display: none; }
  .mode-cards { grid-template-columns: 1fr; }
  .mode-card { min-height: 100px; }
  .vocab-list ul { columns: 1; }
  .cefr small { display: none; }
}
