/* Fixa – čtverečkovaný sešit + zvýrazňovač */
:root {
  --paper: #EEF2F6;
  --grid: #DCE4ED;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;
  --ink: #1B2A41;
  --ink-soft: #56657A;
  --line: #CBD5E1;
  --marker: #FFE94D;
  --marker-ink: #1B2A41;
  --red: #D7263D;
  --red-bg: #FDECEE;
  --green: #1F8A4C;
  --green-bg: #E6F5EC;
  --focus: #2F6FED;
  --radius: 14px;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-body);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111A27; --grid: #172334; --surface: #182334; --surface-2: #1E2B3E;
    --ink: #E7EDF5; --ink-soft: #9AA9BD; --line: #2C3B52;
    --marker: #FFE24A; --red: #FF6B7C; --red-bg: #3A1D25; --green: #4CC38A; --green-bg: #173226;
    --focus: #7EA6FF; color-scheme: dark; --brand-hl: 100%;
  }
}
:root[data-theme="dark"] {
  --paper: #111A27; --grid: #172334; --surface: #182334; --surface-2: #1E2B3E;
  --ink: #E7EDF5; --ink-soft: #9AA9BD; --line: #2C3B52;
  --marker: #FFE24A; --red: #FF6B7C; --red-bg: #3A1D25; --green: #4CC38A; --green-bg: #173226;
  --focus: #7EA6FF; color-scheme: dark; --brand-hl: 100%;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.55 var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 .8em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* --- rozvržení --- */
#view {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
  outline: none;
}
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }

/* --- navigace: dole na mobilu, vlevo na počítači --- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-top: 1.5px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav-brand { display: none; }
.nav a:not(.nav-brand) {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; font-size: .78rem; color: var(--ink-soft);
  padding: 6px 2px; border-radius: 10px;
}
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a.active { color: var(--ink); font-weight: 700; }
.nav a.active svg { stroke-width: 2.3; }
.nav a.active span { background: var(--marker); color: var(--marker-ink); padding: 0 5px; border-radius: 3px 6px 3px 7px; }
.nav-badge {
  position: absolute; top: 2px; left: calc(50% + 8px);
  background: var(--red); color: #fff; font-size: .7rem; line-height: 1;
  padding: 3px 6px; border-radius: 99px;
}
@media (min-width: 960px) {
  .nav {
    top: 0; right: auto; width: 200px; border-top: 0; border-right: 1.5px solid var(--line);
    display: flex; flex-direction: column; gap: 4px; padding: 24px 14px;
  }
  .nav-brand { display: block; margin: 0 6px 22px; text-decoration: none; }
  .nav a:not(.nav-brand) { flex-direction: row; gap: 12px; font-size: 1rem; padding: 10px 12px; }
  .nav-badge { position: static; margin-left: auto; }
  #view { padding: 40px 32px 60px; margin-left: max(200px, calc(50vw - 340px)); }
}

/* --- značka --- */
.brand-mark {
  font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; letter-spacing: -0.02em;
  background: linear-gradient(100deg, transparent 2%, var(--marker) 4%, var(--marker) 94%, transparent 97%);
  background-size: 100% var(--brand-hl, 62%); background-position: 0 85%; background-repeat: no-repeat;
  color: var(--marker-ink); padding: 0 6px;
}

/* --- zvýrazňovač: jediný výrazný prvek --- */
.hl {
  background: linear-gradient(100deg, transparent 1%, var(--marker) 2.5%, var(--marker) 96%, transparent 99%);
  background-size: 100% var(--brand-hl, 70%); background-position: 0 80%; background-repeat: no-repeat;
  color: var(--marker-ink); padding: 0 .12em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.meter { height: 12px; background: var(--surface-2); border-radius: 3px 8px 4px 9px; overflow: hidden; border: 1px solid var(--line); }
.meter > i {
  display: block; height: 100%; width: 0;
  background: var(--marker);
  border-radius: 2px 10px 3px 12px;
  transform: skewX(-8deg); transform-origin: left;
  transition: width .5s ease;
}
.meter.low > i { background: #FFB4BE; }
.meter.mid > i { background: var(--marker); }
.meter.high > i { background: #9BE3B8; }

/* --- karty a prvky --- */
.card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.card.flat { background: var(--surface-2); }
.card.callout { border-color: var(--ink); border-width: 2px; }
.card h2 { margin-bottom: .3em; }
.chip {
  display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 9px;
  border-radius: 99px; border: 1.5px solid var(--line); color: var(--ink-soft); background: var(--surface);
}
.level-chip { border-color: var(--ink); color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .08s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-marker { background: var(--marker); color: var(--marker-ink); border-color: var(--marker-ink); }
.btn-ghost { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; padding: 6px 8px; }
.btn-block { width: 100%; }
.btn-small { min-height: 38px; padding: 6px 12px; font-size: .92rem; border-radius: 10px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; flex: none;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

label.field { display: block; font-weight: 700; margin: 0 0 6px; }
.input, select.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
}
.input:focus { border-color: var(--ink); outline: none; }
.hint { font-size: .88rem; color: var(--ink-soft); margin-top: 6px; }
form .field-wrap + .field-wrap { margin-top: 14px; }

/* --- přihlášení --- */
.auth { max-width: 420px; margin: 6vh auto 0; }
.auth .brand-mark { font-size: 3rem; }
.tabs { display: flex; gap: 6px; margin: 18px 0; }
.tabs button { flex: 1; min-height: 44px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* --- domovská stránka --- */
.greet { margin-bottom: 4px; }
.level-big { font-family: var(--font-display); font-weight: 800; font-size: 4.2rem; line-height: 1; letter-spacing: -0.03em; }
.stat-line { display: flex; gap: 18px; flex-wrap: wrap; }
.stat-line div { min-width: 90px; }
.stat-line strong { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; }
.topic-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; color: var(--ink);
}
.topic-btn:hover { border-color: var(--ink); }
.topic-btn .t-main { flex: 1; min-width: 0; }
.topic-btn .t-name { font-weight: 700; display: block; }
.topic-btn .meter { margin-top: 6px; height: 9px; }
.topic-list > * + * { margin-top: 8px; }
.level-group h3 { margin: 22px 0 10px; display: flex; align-items: baseline; gap: 10px; }

/* --- test a cvičení --- */
.progress-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.progress-top .meter { flex: 1; }
.passage {
  background: var(--surface-2); border-left: 4px solid var(--marker); border-radius: 4px 12px 12px 4px;
  padding: 14px 16px; font-size: 1.02rem;
}
.q-text { font-size: 1.3rem; font-weight: 700; line-height: 1.4; margin: 6px 0 18px; }
.gap { display: inline-block; min-width: 3.2em; border-bottom: 2.5px solid var(--ink); margin: 0 3px; }
.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 56px; padding: 12px 16px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.05rem; color: var(--ink);
}
.opt .key { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 1.5px solid var(--line); font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.opt:hover { border-color: var(--ink-soft); }
.opt[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt[aria-pressed="true"] .key { background: var(--marker); border-color: var(--marker-ink); color: var(--marker-ink); }
.opt.is-right { border-color: var(--green); background: var(--green-bg); }
.opt.is-wrong { border-color: var(--red); background: var(--red-bg); }
.opt:disabled { cursor: default; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.actions .btn { flex: 1; }

.answer-input { font-size: 1.15rem; }
.word-bank, .word-line { display: flex; flex-wrap: wrap; gap: 8px; }
.word-line { min-height: 60px; padding: 10px; border-radius: 12px; border: 2px dashed var(--line); margin-bottom: 14px; align-items: center; }
.word {
  padding: 8px 12px; border-radius: 10px; border: 2px solid var(--ink); background: var(--surface);
  cursor: pointer; font-size: 1.05rem; font-weight: 700; color: var(--ink);
}
.word:disabled { opacity: .25; cursor: default; }
.word-line .word { background: var(--marker); color: var(--marker-ink); border-color: var(--marker-ink); }

/* --- zpětná vazba: zelená = správně, červená fixa učitele = chyba --- */
.feedback { margin-top: 18px; border-radius: var(--radius); padding: 16px; border: 2px solid; }
.feedback.good { border-color: var(--green); background: var(--green-bg); }
.feedback.bad { border-color: var(--red); background: var(--red-bg); }
.feedback h3 { margin: 0 0 6px; }
.feedback.good h3 { color: var(--green); }
.feedback.bad h3 { color: var(--red); }
.struck { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2.5px; color: var(--ink-soft); }
.right-ans { font-weight: 700; border-bottom: 2.5px solid var(--green); }
.feedback .row { margin-top: 12px; }

.md p:last-child { margin-bottom: 0; }
.md ul { margin: .2em 0 .8em; padding-left: 1.2em; }
.md li { margin: .2em 0; }
.md strong { font-weight: 700; }
.md code { background: var(--surface-2); padding: 0 4px; border-radius: 4px; }

/* --- výsledky --- */
.result-hero { text-align: left; }
.skill-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.skill-row + .skill-row { margin-top: 14px; }
.skill-row .meter { grid-column: 1 / -1; }
.mistake { border-top: 1.5px solid var(--line); padding: 14px 0; }
.mistake:first-child { border-top: 0; }
details summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 640px) { .two-col { grid-template-columns: 1fr 1fr; } }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- slovíčka --- */
.flash { text-align: center; padding: 28px 18px; }
.flash .big-word { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1.1; word-break: break-word; }
.flash .example { font-style: italic; margin-top: 12px; }
.vocab-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1.5px solid var(--line); }
.vocab-row:first-child { border-top: 0; }
.vocab-row .w { flex: 1; min-width: 0; }
.vocab-row .w strong { display: block; }
.new-words { display: grid; gap: 10px; }

/* --- chat / vysvětlení --- */
.sheet {
  width: min(680px, 100%); max-height: 88vh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column;
}
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(10, 18, 30, .55); }
@media (min-width: 720px) { .sheet { margin: auto; border-radius: 20px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.sheet-head h2 { margin: 0; }
.sheet-body { overflow-y: auto; padding: 4px 18px 12px; flex: 1; }
.sheet-ask { display: flex; gap: 8px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--line); }
.sheet-ask input { flex: 1; min-width: 0; min-height: 46px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); }
.bubble { padding: 12px 14px; border-radius: 14px; margin: 10px 0; }
.bubble.ai { background: var(--surface-2); border: 1.5px solid var(--line); }
.bubble.me { background: var(--ink); color: var(--paper); margin-left: 15%; }

/* --- načítání, toast --- */
.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 50px 10px; text-align: center; }
.scribble { width: 84px; height: 14px; border-radius: 3px 9px 4px 10px; background: var(--marker); transform-origin: left; animation: scribble 1.1s ease-in-out infinite; }
@keyframes scribble { 0% { transform: scaleX(.1) skewX(-8deg); } 50% { transform: scaleX(1) skewX(-8deg); } 100% { transform: scaleX(.1) skewX(-8deg); transform-origin: right; } }
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%);
  z-index: 50; max-width: min(92vw, 520px); padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--paper); font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.toast.err { background: var(--red); color: #fff; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 10px 0; }
.steps li { counter-increment: s; position: relative; padding-left: 38px; margin: 10px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--marker); color: var(--marker-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }

/* ---------- fáze 2: motivace, plán, pokrok ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.streak {
  display: inline-flex; align-items: center; gap: 4px; flex: none; text-decoration: none;
  padding: 6px 12px 6px 8px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font-family: var(--font-display); font-size: 1.25rem;
}
.streak svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.streak.on { border-color: var(--marker-ink); background: var(--marker); color: var(--marker-ink); }
.streak.on svg { fill: #FF8A3D; stroke: var(--marker-ink); }
.goal-card .meter { height: 16px; margin-top: 12px; }
.goal-meter.high > i, .goal-meter > i { background: var(--marker); }
.xp-chip { font-weight: 700; font-size: .85rem; padding: 2px 8px; border-radius: 99px; background: var(--marker); color: var(--marker-ink); }

.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1.5px solid var(--line); }
.tasks li:first-child { border-top: 0; padding-top: 4px; }
.tasks .t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tasks .check { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; }
.tasks li.done .check { background: var(--green); border-color: var(--green); color: #fff; }
.tasks li.done strong { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink-soft); }

.plan-card { display: block; text-decoration: none; color: var(--ink); border-width: 2px; border-color: var(--ink); }
.plan-card:hover { background: var(--surface-2); }
.link-more { display: inline-block; margin-top: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.weeks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.week.current { border-color: var(--ink); border-width: 2px; }
.week.past { opacity: .7; }

.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 720px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.tile strong { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.tile .meter { height: 8px; margin: 4px 0 2px; }

/* sloupcový graf (HTML, ať se text neškáluje) */
.bars { position: relative; height: 170px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; align-items: end; border-bottom: 1.5px solid var(--line); margin-top: 14px; }
.bar-col { height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline-offset: 0; }
.bar { width: min(70%, 26px); background: var(--ink); border-radius: 4px 4px 0 0; }
.bar-col.hover .bar, .bar-col:focus-visible .bar { background: var(--marker); box-shadow: inset 0 0 0 2px var(--marker-ink); }
.goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink-soft); pointer-events: none; z-index: 1; }
.goal-line span { position: absolute; right: 0; top: -20px; font-size: .75rem; color: var(--ink-soft); background: var(--surface); padding: 0 4px; }
.bar-labels { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; font-size: .75rem; color: var(--ink-soft); text-align: center; margin-top: 4px; }
.table-toggle { margin-top: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
table.data th, table.data td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--ink-soft); font-weight: 700; }

/* spojnicový graf */
.line-chart { position: relative; height: 170px; margin: 14px 0 0 40px; }
.line-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.line-chart path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grid-y span { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.grid-y i { position: absolute; left: -42px; top: -9px; width: 36px; text-align: right; font-style: normal; font-size: .72rem; color: var(--ink-soft); }
.dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.dot::after { content: ""; position: absolute; inset: -12px; } /* větší cíl pro prst */
.dot.hover, .dot:focus-visible { background: var(--marker); box-shadow: 0 0 0 2px var(--marker-ink); }
.line-labels { margin-left: 40px; }

/* kalendář */
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; max-width: 520px; }
.heat-label { font-size: .7rem; color: var(--ink-soft); line-height: 1; align-self: center; padding-right: 6px; }
.hc { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.hc.empty { visibility: hidden; }
.hc.l1 { background: color-mix(in srgb, var(--ink) 22%, var(--surface)); border-color: transparent; }
.hc.l2 { background: color-mix(in srgb, var(--ink) 45%, var(--surface)); border-color: transparent; }
.hc.l3 { background: color-mix(in srgb, var(--ink) 72%, var(--surface)); border-color: transparent; }
.hc.l4 { background: var(--ink); border-color: transparent; }
.hc.hover, .hc:focus-visible { outline: 2px solid var(--marker-ink); background-image: linear-gradient(var(--marker), var(--marker)); }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.heat-legend .hc { width: 14px; }

.trend-list { list-style: none; margin: 0; padding: 0; }
.trend-list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1.5px solid var(--line); }
.trend-list li:first-child { border-top: 0; }
.trend-list .t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slope { display: grid; gap: 3px; margin-top: 6px; }
.meter.thin { height: 6px; }
.delta { flex: none; font-weight: 700; font-size: .9rem; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

.tip {
  position: absolute; z-index: 60; pointer-events: none; max-width: 260px;
  background: var(--ink); color: var(--paper); font-size: .85rem; font-weight: 700;
  padding: 6px 10px; border-radius: 8px;
}

/* ---------- fáze 3: učebnice a testy ---------- */
.unit-list { margin-top: 12px; }
.unit-list > * + * { margin-top: 8px; }
a.topic-btn { text-decoration: none; }
.upload-btn { cursor: pointer; }
.upload-list { list-style: none; margin: 0; padding: 0; }
.upload-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1.5px solid var(--line); font-size: .95rem; }
.upload-list li:first-child { border-top: 0; }
.small-scribble { width: 26px; height: 9px; flex: none; }
.ok-mark, .err-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; }
.ok-mark { background: var(--green); }
.err-mark { background: var(--red); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.thumb { margin: 0; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.thumb.error { border-color: var(--red); }
.thumb img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--grid); }
.thumb figcaption { padding: 8px 10px; }
.grammar + .grammar { border-top: 1.5px solid var(--line); margin-top: 14px; padding-top: 14px; }
.examples { margin: 6px 0 10px; padding-left: 1.2em; font-style: italic; }
.unit-pick { border: 0; padding: 0; margin: 8px 0 0; }
.unit-pick legend { padding: 0; margin-bottom: 4px; }
.check-row { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.check-row + .check-row { margin-top: 8px; }
.check-row input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.check-row:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.grade { display: inline-grid; place-items: center; width: 1.4em; border-radius: 12px; border: 3px solid; }
.grade.g1, .grade.g2 { color: var(--green); }
.grade.g3 { color: var(--ink); }
.grade.g4, .grade.g5 { color: var(--red); }
.test-soon .chip { font-size: .85rem; }

/* ---------- fáze 4: poslech, psaní, mluvení ---------- */
.skill-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.skill-cards.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .skill-cards { grid-template-columns: 1fr; } .skill-cards.two { grid-template-columns: 1fr; } }
.skill-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); padding: 14px; }
.skill-card:hover { border-color: var(--ink); }
.skill-card .meter { margin-top: 6px; height: 8px; }
.skill-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--marker); display: grid; place-items: center; margin-bottom: 4px; }
.skill-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--marker-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.audio { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.audio.compact { margin-bottom: 16px; position: sticky; top: 8px; z-index: 5; }
.audio-main { flex: 1; min-width: 0; }
.audio-meter { height: 8px; margin-top: 6px; }
.audio-meter > i { background: var(--marker); }
.play-btn { width: 52px; height: 52px; flex: none; border-radius: 50%; border: 2px solid var(--marker-ink); background: var(--marker); display: grid; place-items: center; cursor: pointer; }
.play-btn svg { width: 24px; height: 24px; fill: var(--marker-ink); }
.transcript p { margin: 0 0 8px; }

.writing-area { min-height: 260px; font-size: 1.05rem; line-height: 1.6; resize: vertical; }
.writing-text { white-space: pre-wrap; margin-top: 10px; line-height: 1.6; }
.ok-text { color: var(--green); font-weight: 700; }
.warn-text { color: var(--red); font-weight: 700; }

.say-text { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; line-height: 1.35; }
.w-good { border-bottom: 3px solid var(--green); }
.w-bad { color: var(--red); text-decoration: underline wavy var(--red); text-underline-offset: 5px; }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 22px 0 6px; text-align: center; }
.mic-btn { width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--ink); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; }
.mic-btn svg { width: 36px; height: 36px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.mic-btn.small { width: 48px; height: 48px; border-width: 2px; }
.mic-btn.small svg { width: 22px; height: 22px; }
.mic-btn.rec { background: var(--red); border-color: var(--red); animation: pulse 1.2s ease-in-out infinite; }
.mic-btn.rec svg { stroke: #fff; }
.mic-btn:disabled { opacity: .4; cursor: not-allowed; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(215, 38, 61, .45); } 50% { box-shadow: 0 0 0 14px rgba(215, 38, 61, 0); } }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.chip-btn { border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 6px 12px; font-weight: 700; cursor: pointer; min-height: 40px; }
.chip-btn.on { border-color: var(--marker-ink); background: var(--marker); color: var(--marker-ink); }
.conv { display: flex; flex-direction: column; gap: 10px; }
.conv-log { min-height: 40vh; }
.conv-note { margin: -4px 0 10px 15%; padding: 8px 12px; border-left: 3px solid var(--green); background: var(--green-bg); border-radius: 4px 10px 10px 4px; }
.conv-input { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; background: var(--paper); padding: 8px 0; }
.conv-input .input { flex: 1; min-width: 0; }
@media (min-width: 960px) { .conv-input { bottom: 0; } }
.speak-inline { border: 0; background: transparent; cursor: pointer; vertical-align: middle; padding: 0 2px; color: inherit; }
.speak-inline svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- matika a přepínač předmětů ---------- */
.subj-switch { display: inline-grid; grid-template-columns: repeat(3, auto); gap: 4px; padding: 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); }
.subj-switch button { min-height: 38px; padding: 6px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font-weight: 700; cursor: pointer; }
.subj-switch button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.nav-subj { display: none; }
@media (min-width: 960px) {
  .nav-subj { display: block; margin: -8px 4px 18px; }
  .nav-subj .subj-switch { width: 100%; }
  .subj-mobile { display: none; }
}
.num-row { display: flex; align-items: center; gap: 10px; }
.num-row .input { flex: 1; min-width: 0; }
.unit { font-weight: 700; font-size: 1.1rem; }
.katex { font-size: 1.08em; }
.q-text .katex { font-size: 1.12em; }
.opt .katex { font-size: 1.1em; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.problem { font-size: 1.15rem; }
.hint-box { border-left: 4px solid var(--marker); background: var(--surface-2); border-radius: 4px 12px 12px 4px; padding: 10px 14px; }
.sol-steps { margin: 0; padding-left: 1.3em; }
.sol-steps li { margin: 0 0 12px; }
.answer-box { border: 2px solid var(--green); background: var(--green-bg); border-radius: 12px; padding: 10px 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- maturita a písemky ---------- */
button.plan-card { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.tf-list { display: grid; gap: 10px; }
.tf-row, .match-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.match-row + .match-row { margin-top: 10px; }
.tf-row.is-right, .match-row.is-right { border-color: var(--green); background: var(--green-bg); }
.tf-row.is-wrong, .match-row.is-wrong { border-color: var(--red); background: var(--red-bg); }
.tf-text { flex: 1 1 220px; min-width: 0; }
.tf-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.tf-btn { min-width: 48px; min-height: 42px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.tf-btn[aria-pressed="true"] { background: var(--marker); border-color: var(--marker-ink); color: var(--marker-ink); }
.tf-btn:disabled { cursor: default; }
.match-opts { display: grid; gap: 6px; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.exam-bar { display: flex; justify-content: space-between; align-items: center; margin: -6px 0 14px; font-weight: 700; color: var(--ink-soft); }
.timer { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); padding: 2px 10px; border-radius: 8px; background: var(--surface); border: 1.5px solid var(--line); font-variant-numeric: tabular-nums; }
.timer.low { color: #fff; background: var(--red); border-color: var(--red); }
.verdict { font-weight: 700; padding: 10px 14px; border-radius: 12px; }
.verdict.ok { background: var(--green-bg); color: var(--green); border: 2px solid var(--green); }
.verdict.bad { background: var(--red-bg); color: var(--red); border: 2px solid var(--red); }
.formula + .formula { border-top: 1.5px solid var(--line); margin-top: 8px; padding-top: 8px; }
.bars.mini { height: 120px; grid-template-columns: repeat(10, 1fr); }
.bar.fail { background: var(--red); }
details.mistake summary { font-weight: 700; }

/* ---------- opakování chyb, kontrola postupu, žebříček ---------- */
.review-card { align-items: center; gap: 12px; }
.work-steps { margin: 0; padding-left: 1.3em; }
.work-steps li { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; border-left: 4px solid var(--green); background: var(--green-bg); }
.work-steps li.bad { border-left-color: var(--red); background: var(--red-bg); }
.leaderboard { list-style: none; margin: 10px 0 0; padding: 0; }
.leaderboard li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.leaderboard li + li { border-top: 1.5px solid var(--line); border-radius: 0; }
.leaderboard li.me { background: var(--marker); color: var(--marker-ink); border-radius: 10px; }
.lb-rank { width: 2em; font-weight: 700; }
.lb-name { flex: 1; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- správa appky --- */
.btn-danger { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.chip-ink { border-color: var(--ink); color: var(--ink); }
.chip-warn { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.admin-link { text-decoration: none; align-items: center; }
.admin-link:hover { border-color: var(--ink); }
.invite-code {
  font: 700 1.05rem/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--marker); color: var(--marker-ink); padding: 4px 10px; border-radius: 8px;
  word-break: break-all; user-select: all;
}
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin: 0; }
.admin-stats div { min-width: 0; }
.admin-stats dt { font-size: .78rem; color: var(--ink-soft); }
.admin-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.callout-note { border: 2px dashed var(--ink); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }

/* --- v8: čeština, motivace, zabezpečení --- */
.nav-subj .subj-switch { grid-template-columns: 1fr; }
.subj-switch button { padding: 6px 12px; }
@media (max-width: 360px) { .subj-switch button { padding: 6px 8px; font-size: .9rem; } }
.freeze { display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-size: .9rem; }
.week-card { border-color: var(--ink); border-width: 2px; }
.week-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.week-stats div { display: flex; flex-direction: column; }
.week-stats strong { font: 800 1.5rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.week-stats span { font-size: .8rem; color: var(--ink-soft); }
.week-stats em { font-style: normal; font-weight: 700; }
.week-stats em.up { color: var(--green); }
.week-stats em.down { color: var(--red); }
@media (max-width: 420px) { .week-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.badge-pop {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, 0); z-index: 70;
  display: flex; gap: 12px; align-items: center; max-width: min(92vw, 420px);
  padding: 12px 16px; border-radius: 14px; background: var(--marker); color: var(--marker-ink);
  border: 2px solid var(--marker-ink); box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: badgeIn .35s cubic-bezier(.2,.9,.3,1.2);
}
.badge-pop.out { opacity: 0; transform: translate(-50%, -12px); transition: opacity .3s, transform .3s; }
@keyframes badgeIn { from { opacity: 0; transform: translate(-50%, -20px) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .badge-pop { animation: none; } .badge-pop.out { transition: none; } }
.badge-ico { font-size: 1.8rem; line-height: 1; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); border: 1.5px dashed var(--line); background: var(--surface); opacity: .55; filter: grayscale(1); }
.badge-card.on { opacity: 1; filter: none; border-style: solid; border-color: var(--ink); }
.badges-link, .admin-link { text-decoration: none; align-items: center; }
.opt.is-hidden { opacity: .25; text-decoration: line-through; }
details.source { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); }
details.source[open] { border-color: var(--ink); }
details.source summary { font-weight: 700; cursor: pointer; }
.source-body { max-height: 55vh; overflow: auto; margin-top: 8px; font-size: .97rem; line-height: 1.6; }
.source-body p { margin: 0 0 .7em; }
.usage { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .92rem; }
.usage strong { font-variant-numeric: tabular-nums; }
.qr-box { display: flex; justify-content: center; }
.qr-box svg { width: 200px; height: 200px; border-radius: 8px; border: 1.5px solid var(--line); }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.backup-codes code { font: 700 1rem ui-monospace, Menlo, Consolas, monospace; padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1.5px solid var(--line); text-align: center; }
.code-input { font: 700 1.6rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .2em; text-align: center; }
.book-row { gap: 8px; }
.chat { display: flex; flex-direction: column; }

/* =====================================================================
   Doučovač v9 – hravý vzhled (výchozí) + nové prvky
   Klidný vzhled = původní sešit (html[data-style="calm"]).
   ===================================================================== */
:root { --accent: #6C4CF5; --accent-ink: #FFFFFF; --accent-soft: #EEE9FF; --subj: var(--accent); --shadow: rgba(35, 32, 74, .14); }
:root[data-subject="en"] { --subj: #2E86F5; --subj-soft: #E4F0FF; }
:root[data-subject="math"] { --subj: #F07A12; --subj-soft: #FFEEDD; }
:root[data-subject="cs"] { --subj: #E63E78; --subj-soft: #FDE6EF; }

:root[data-style="play"] {
  --paper: #F4F1FF; --grid: transparent; --surface: #FFFFFF; --surface-2: #F8F6FF;
  --ink: #23204A; --ink-soft: #625E86; --line: #DFD8FB;
  --marker: #FFD43B; --marker-ink: #23204A;
  --red: #E5304F; --red-bg: #FFE9EE; --green: #18A058; --green-bg: #E3F8EC;
  --focus: #6C4CF5; --radius: 20px; --brand-hl: 62%;
}
@media (prefers-color-scheme: dark) {
  :root[data-style="play"]:not([data-theme="light"]) {
    --paper: #15132B; --grid: transparent; --surface: #1F1C3D; --surface-2: #262249;
    --ink: #EEEBFF; --ink-soft: #ABA6D6; --line: #383370;
    --marker: #FFD43B; --marker-ink: #23204A; --accent: #8F78FF; --accent-soft: #2C2760;
    --red: #FF6B85; --red-bg: #3B1E2C; --green: #4CD38A; --green-bg: #173226; --focus: #A795FF; --shadow: rgba(0, 0, 0, .4);
  }
}
:root[data-style="play"] body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 8% 4%, color-mix(in srgb, var(--accent) 16%, transparent) 0 180px, transparent 181px),
    radial-gradient(circle at 96% 30%, color-mix(in srgb, var(--subj) 13%, transparent) 0 140px, transparent 141px),
    radial-gradient(circle at 20% 92%, color-mix(in srgb, var(--marker) 22%, transparent) 0 120px, transparent 121px);
  background-size: auto; background-attachment: fixed;
}
:root[data-style="play"] h1 { font-size: 2.15rem; }
:root[data-style="play"] .card { border-width: 2px; border-radius: var(--radius); box-shadow: 0 4px 0 var(--line); }
:root[data-style="play"] .card.flat { box-shadow: none; }
:root[data-style="play"] .card.callout { border-color: var(--accent); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 45%, var(--line)); }
:root[data-style="play"] .btn { border-radius: 16px; box-shadow: 0 4px 0 var(--shadow); transition: transform .08s ease, box-shadow .08s ease; }
:root[data-style="play"] .btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
:root[data-style="play"] .btn-ink { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 60%, #000); }
:root[data-style="play"] .btn-marker { box-shadow: 0 4px 0 #C99A00; }
:root[data-style="play"] .btn-ghost { box-shadow: none; }
:root[data-style="play"] .btn-big { min-height: 56px; font-size: 1.1rem; padding: 12px 24px; }
:root[data-style="play"] .opt { border-radius: 16px; box-shadow: 0 3px 0 var(--line); }
:root[data-style="play"] .opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 50%, var(--line)), inset 0 0 0 1px var(--accent); }
:root[data-style="play"] .opt.is-right { animation: pop .35s ease; }
:root[data-style="play"] .opt.is-wrong { animation: shake .35s ease; }
:root[data-style="play"] .topic-btn { border-width: 2px; border-radius: 16px; box-shadow: 0 3px 0 var(--line); border-left: 6px solid var(--subj); }
:root[data-style="play"] .topic-btn:hover { border-color: var(--subj); }
:root[data-style="play"] .input { border-radius: 14px; }
:root[data-style="play"] .input:focus { border-color: var(--accent); }
:root[data-style="play"] .chip.level-chip { border-color: var(--subj); color: var(--subj); }
:root[data-style="play"] .level-big .hl { background: none; color: var(--subj); }
:root[data-style="play"] .nav { border-radius: 22px 22px 0 0; box-shadow: 0 -4px 20px var(--shadow); border-top: 0; }
:root[data-style="play"] .nav a.active { color: var(--accent); }
:root[data-style="play"] .nav a.active span { background: var(--accent-soft); color: var(--accent); padding: 0 8px; border-radius: 99px; }
@media (min-width: 960px) {
  :root[data-style="play"] .nav { border-radius: 0 26px 26px 0; box-shadow: 4px 0 24px var(--shadow); }
  :root[data-style="play"] .nav a.active { background: var(--accent-soft); }
  :root[data-style="play"] .nav a.active span { background: none; padding: 0; }
}
:root[data-style="play"] .meter { border-radius: 99px; height: 14px; }
:root[data-style="play"] .meter > i { border-radius: 99px; transform: none; background: var(--subj); }
:root[data-style="play"] .meter.low > i { background: #FF8DA1; }
:root[data-style="play"] .meter.high > i { background: var(--green); }
:root[data-style="play"] .goal-meter > i { background: linear-gradient(90deg, var(--marker), #FFB020); }
:root[data-style="play"] .feedback { border-radius: var(--radius); }
:root[data-style="play"] .feedback.good { animation: pop .35s ease; }
:root[data-style="play"] .subj-switch button[aria-selected="true"] { background: var(--subj); border-color: var(--subj); color: #fff; }
:root[data-style="play"] .bubble.me { background: var(--accent); color: #fff; }
:root[data-style="play"] .plan-card { border-color: var(--line); }
:root[data-style="play"] .plan-card:hover { border-color: var(--subj); }
:root[data-style="play"] .link-more { color: var(--subj); }
:root[data-style="play"] .streak.on svg { fill: #FF8A3D; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* --- maskot Douček (v klidném vzhledu skrytý) --- */
.mascot { flex: none; display: block; overflow: visible; }
:root[data-style="calm"] .mascot { display: none; }
:root[data-style="play"] .mascot-happy, :root[data-style="play"] .mascot-cheer { animation: bob 3.2s ease-in-out infinite; }
:root[data-style="play"] .loading .mascot { animation: tilt 1.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes tilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .mascot, .opt, .feedback { animation: none !important; } }
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo .mascot { width: 34px; height: 34px; }
.logo .brand-mark { font-size: 1.45rem; }
:root[data-style="play"] .brand-mark { background: none; color: var(--accent); padding: 0; }
:root[data-style="calm"] .logo .mascot { display: none; }
.greet-wrap { display: flex; align-items: center; gap: 12px; }
.auth-head, .auth-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.center-stack { text-align: center; display: flex; flex-direction: column; align-items: center; }
.center-stack > * { max-width: 460px; }
.center-stack .btn-block { width: 100%; }

/* --- vlastní téma --- */
.custom-card { border-color: var(--accent) !important; }
:root[data-style="calm"] .custom-card { border-color: var(--ink) !important; }
.custom-form .input { flex: 1; min-width: 0; }
.chips-row { gap: 8px; }
.chip-btn { cursor: pointer; font-size: .85rem; padding: 6px 12px; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

/* --- AI štítek a nahlášení --- */
.ai-tag { color: var(--ink-soft); margin: 14px 0 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }
.linkish:hover { color: var(--red); }
.report-quote { border-left: 3px solid var(--line); margin: 0; padding: 4px 10px; white-space: pre-wrap; }
.report { border-top: 1.5px solid var(--line); padding-top: 12px; }
.report:first-of-type { border-top: 0; padding-top: 0; }
.help-card { text-align: center; align-items: center; }
.help-card .mascot { margin: 0 auto; }

/* --- vzhled v profilu --- */
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-opt input { position: absolute; opacity: 0; }
.theme-opt > span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border: 2px solid var(--line); border-radius: 16px; cursor: pointer; text-align: center; min-height: 120px; justify-content: center; }
.theme-opt input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-opt small { color: var(--ink-soft); }
:root[data-style="calm"] .theme-opt .mascot { display: block; }
.calm-swatch { width: 40px; height: 40px; border-radius: 8px; border: 1.5px solid #CBD5E1; background-color: #EEF2F6;
  background-image: linear-gradient(#DCE4ED 1px, transparent 1px), linear-gradient(90deg, #DCE4ED 1px, transparent 1px); background-size: 8px 8px; }

/* --- předplatné --- */
.paywall-card { display: block; text-decoration: none; color: inherit; border-color: var(--marker-ink) !important; background: linear-gradient(135deg, color-mix(in srgb, var(--marker) 35%, var(--surface)), var(--surface)); }
.price-hero { display: flex; gap: 16px; align-items: center; }
.price-card { border-color: var(--accent) !important; }
.price { display: flex; align-items: center; gap: 8px; }
.price strong { font-family: var(--font-display); font-weight: 800; font-size: 3.4rem; line-height: 1; color: var(--accent); }
:root[data-style="calm"] .price strong { color: var(--ink); }
.price span { font-weight: 700; line-height: 1.15; color: var(--ink-soft); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ticks li { padding-left: 30px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.check-row.consent { align-items: flex-start; padding: 12px; border: 2px dashed var(--line); border-radius: 14px; }
.check-row.consent input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--accent); }

/* --- úvodní stránka --- */
.welcome { max-width: 1000px; margin: 0 auto; }
#view:has(.welcome) { max-width: 1040px; margin-left: auto !important; }
.w-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.logo-link { text-decoration: none; color: inherit; }
.w-hero { display: grid; gap: 20px; align-items: center; padding: 10px 0 30px; }
@media (min-width: 760px) { .w-hero { grid-template-columns: 1.3fr 1fr; } }
.w-hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; margin: 6px 0 14px; }
.w-kicker { font-weight: 700; color: var(--accent); margin: 0; letter-spacing: .02em; }
.w-lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 34em; }
.w-hero-art { position: relative; display: flex; flex-direction: column; align-items: center; }
.w-hero-art .mascot { width: min(190px, 46vw); height: auto; }
.w-bubble { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; font-weight: 700; box-shadow: 0 4px 0 var(--line); margin-bottom: 8px; max-width: 260px; text-align: center; }
.w-subjects { display: grid; gap: 14px; margin: 10px 0 30px; }
@media (min-width: 700px) { .w-subjects { grid-template-columns: repeat(3, 1fr); } }
.w-subj { border-radius: 20px; padding: 18px; color: #fff; }
.w-subj h3 { margin: 10px 0 4px; font-size: 1.25rem; }
.w-subj p { margin: 0; opacity: .95; }
.w-subj.en { background: #2E86F5; } .w-subj.math { background: #F07A12; } .w-subj.cs { background: #E63E78; }
.w-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .22); font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.w-steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: w; }
@media (min-width: 700px) { .w-steps ol { grid-template-columns: repeat(3, 1fr); } }
.w-steps li { counter-increment: w; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.w-steps li::before { content: counter(w); width: 34px; height: 34px; border-radius: 50%; background: var(--marker); color: var(--marker-ink); display: grid; place-items: center; font-weight: 800; margin-bottom: 4px; }
.w-steps li span { color: var(--ink-soft); font-size: .95rem; }
.w-features { display: grid; gap: 12px; margin: 30px 0; }
@media (min-width: 640px) { .w-features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .w-features { grid-template-columns: repeat(3, 1fr); } }
.w-feat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); border: 1.5px solid var(--line); }
.w-feat span { color: var(--ink-soft); font-size: .95rem; }
.w-price { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; margin: 10px 0 30px; border-color: var(--accent) !important; }
.w-faq details { border-top: 1.5px solid var(--line); padding: 8px 0; }
.w-faq details p { color: var(--ink-soft); margin: 4px 0 8px; }
.w-foot { display: flex; flex-wrap: wrap; gap: 16px; padding: 30px 0 10px; border-top: 1.5px solid var(--line); margin-top: 30px; }
.w-steps h2, .w-faq h2 { margin-top: 10px; }
