/* =====================================================================================
   Duočka – design system
   White, calm, precise. Orange (Duočka's fur) is reserved for actions and highlights;
   blue = mathematics, raspberry = Czech. One type family (Inter), one spacing scale (4 px).
   ===================================================================================== */
:root {
  --bg: #ffffff;           --surface: #ffffff;      --surface-2: #f6f7f9;    --surface-3: #eef0f4;
  --line: #e6e8ee;         --line-2: #d4d8e1;
  --ink: #111827;          --ink-2: #374151;        --muted: #6b7280;        --faint: #9aa1ae;
  --accent: #e8772a;       --accent-2: #f29a4a;     --accent-ink: #ffffff;
  --accent-soft: #fff3ea;  --accent-line: #f7d4b8;  --accent-dark: #b4560f;
  --math: #2f5bd8;         --math-soft: #edf2ff;
  --czech: #c2366f;        --czech-soft: #fdeef4;
  --ok: #138a52;  --ok-soft: #e6f6ee;  --bad: #d23a2f;  --bad-soft: #fdeeec;  --warn: #9a6200;  --warn-soft: #fff6dc;
  --marker: #ffe27a;       --marker-ink: #3a3000;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --sh-1: 0 1px 2px rgba(17, 24, 39, .05);
  --sh-2: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 18px -8px rgba(17, 24, 39, .12);
  --sh-3: 0 18px 40px -18px rgba(17, 24, 39, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.55 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent-dark); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; color: var(--ink); }
h1 { font-size: 1.75rem; font-weight: 750; letter-spacing: -.022em; }
h2 { font-size: 1.22rem; font-weight: 700; letter-spacing: -.012em; }
h3 { font-size: 1.02rem; font-weight: 650; letter-spacing: -.005em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 720px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
main { padding-block: 26px 110px; display: flex; flex-direction: column; gap: 18px; }

/* ---------------------------------------------------------------- header & navigation */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 14px; min-height: 60px; max-width: 1040px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.12rem; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--sh-1); }
.brand .name { color: var(--ink); }
.top nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.top nav a, .top nav button { text-decoration: none; color: var(--muted); font-weight: 560; font-size: .92rem; padding: 7px 12px; border-radius: 10px;
  background: none; border: 0; cursor: pointer; transition: background .15s, color .15s; }
.top nav a:hover, .top nav button:hover { color: var(--ink); background: var(--surface-2); }
.top nav a.on { color: var(--ink); background: var(--surface-3); }
.top nav a:has(.avatar) { padding: 3px; margin-left: 6px; }
.top .plus-chip { margin-left: auto; }
.top .plus-chip + nav { margin-left: 6px; }

.tabs { display: none; }
@media (max-width: 720px) {
  .top nav.kid { display: none; }
  .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)); }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 5px; font-size: .7rem; font-weight: 600;
    color: var(--faint); text-decoration: none; border-radius: 12px; }
  .tabs a svg { width: 23px; height: 23px; }
  .tabs a.on { color: var(--accent-dark); }
  .tabs a.on svg { stroke-width: 2.1; }
  .tabs a.on .avatar { box-shadow: 0 0 0 2px var(--accent); }
}
.tabs svg, .ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.main { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line), var(--sh-2);
  background: linear-gradient(180deg, #fffaf6 0%, #fff 60%); }
.card.quiet { background: var(--surface-2); box-shadow: none; }
a.card { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-1px); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.section-title h2 { font-size: 1.05rem; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.big { font-size: 2.7rem; font-weight: 800; line-height: 1; color: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.hello h1 { font-size: 1.9rem; }
.countdown { text-align: right; line-height: 1.05; }
.countdown b { display: block; font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .78rem; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.kpi b { display: block; font-size: 1.4rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .76rem; color: var(--muted); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 18px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 620; font-size: .95rem; cursor: pointer;
  text-decoration: none; text-align: center; box-shadow: var(--sh-1); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: var(--faint); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: #d96c1f; color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 16px -8px rgba(232, 119, 42, .9); }
.btn.primary:hover { background: linear-gradient(180deg, #f5a55a, #e06f22); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: #f1c3be; background: #fff; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: .86rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 650; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap; letter-spacing: .01em; }
.chip.m { color: var(--math); background: var(--math-soft); }
.chip.c { color: var(--czech); background: var(--czech-soft); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.mark { background: var(--marker); color: var(--marker-ink); }

.flash { border-radius: var(--r); padding: 12px 16px; font-size: .92rem; border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe6d1; }
.flash.error { background: var(--bad-soft); color: var(--bad); border-color: #f4c7c2; }
.flash.info { background: var(--surface-2); border-color: var(--line); }
.note { background: var(--warn-soft); color: var(--warn); border-radius: var(--r); padding: 12px 16px; font-size: .92rem; }

/* ---------------------------------------------------------------- progress, topics */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar i.lo { background: #e5654c; } .bar i.mid { background: #e9a23b; } .bar i.hi { background: #22a565; }
.topic { display: grid; grid-template-columns: 1fr 52px auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.topic:first-of-type { border-top: 0; }
.topic .nm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.topic .pc { text-align: right; font-variant-numeric: tabular-nums; font-size: .92rem; font-weight: 600; }
.subj { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.dot.m { background: var(--math); } .dot.c { background: var(--czech); }
.untried { color: var(--faint); font-size: .8rem; }

.week .d { display: grid; grid-template-columns: 78px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.week .d:first-child { border-top: 0; }
.week .d .dt { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.week .d.today .dt { color: var(--accent-dark); font-weight: 700; }

/* ---------------------------------------------------------------- theory, tasks */
.theory { position: relative; padding-left: 24px; }
.theory::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.theory ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.sbar { display: flex; align-items: center; gap: 12px; }
.prog { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 99px; transition: width .35s; }
.meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.diff { display: inline-flex; gap: 2px; }
.diff i { width: 7px; height: 7px; border-radius: 2px; background: var(--line-2); }
.diff i.on { background: var(--ink-2); }
.q { font-size: 1.14rem; font-weight: 520; line-height: 1.5; letter-spacing: -.005em; }
.ctx { background: var(--surface-2); border-left: 3px solid var(--czech); border-radius: 0 var(--r) var(--r) 0; padding: 14px 16px; font-size: .96rem; line-height: 1.6; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { position: relative; display: flex; gap: 11px; align-items: center; border: 1.5px solid var(--line-2); background: var(--surface);
  border-radius: var(--r); padding: 11px 13px; cursor: pointer; min-width: 0; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--faint); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .k { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:checked) .k { background: var(--accent); color: #fff; border-color: var(--accent); }
.opt:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.locked .opt { cursor: default; }
.yn { display: flex; flex-direction: column; gap: 8px; }
.yn .s { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.yn .p { display: flex; gap: 6px; }
.yn .opt { padding: 6px 14px; }
.match { display: flex; flex-direction: column; gap: 10px; }
.match .m { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: center; }
.match .m.right select { border-color: var(--ok); } .match .m.wrong select { border-color: var(--bad); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r); padding: 10px 13px; min-width: 0;
  box-shadow: var(--sh-1); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
textarea { resize: vertical; line-height: 1.5; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.answer { display: flex; gap: 10px; align-items: center; }
.answer input { font-size: 1.1rem; font-variant-numeric: tabular-nums; max-width: 280px; }
.answer .u { color: var(--muted); font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }
.fb { border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; }
.fb.ok { background: var(--ok-soft); border-color: #c6ead6; }
.fb.bad { background: var(--bad-soft); border-color: #f5cdc8; }
.fb .h { font-weight: 800; font-size: 1.15rem; display: flex; gap: 8px; align-items: center; letter-spacing: -.01em; }
.fb.ok .h { color: var(--ok); } .fb.bad .h { color: var(--bad); }
.mark-ok { color: var(--ok); font-weight: 800; } .mark-bad { color: var(--bad); font-weight: 800; }
details.report summary { cursor: pointer; color: var(--faint); font-size: .82rem; list-style: none; }
details.report summary::-webkit-details-marker { display: none; }
details.report form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* math notation */
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .92em; line-height: 1.1; margin: 0 2px; }
.fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 3px; }
.fr > span:last-child { padding: 0 3px; }
.ov { border-top: 1.5px solid currentColor; padding: 0 2px; }
table.data { border-collapse: collapse; margin-top: 10px; font-size: .95rem; }
table.data th, table.data td { border: 1px solid var(--line-2); padding: 5px 14px; text-align: center; font-variant-numeric: tabular-nums; }
table.data th { background: var(--surface-2); font-weight: 600; }

/* ---------------------------------------------------------------- timed tests */
.mockbar { position: sticky; top: 60px; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); padding-block: 12px;
  display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.25rem; padding: 6px 14px; border-radius: 10px; background: var(--surface-2);
  letter-spacing: .02em; }
.timer.low { background: var(--bad-soft); color: var(--bad); }
.grid-n { display: flex; flex-wrap: wrap; gap: 6px; }
.grid-n a { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; text-decoration: none; color: var(--ink); position: relative; }
.grid-n a.done { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid-n a.cur { box-shadow: 0 0 0 3px var(--accent); }
.grid-n a.flag::after { content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--marker); border: 2px solid #fff; }
.js .mock-task { display: none; }
.js .mock-task.cur { display: flex; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); max-width: 420px; padding: 22px; box-shadow: var(--sh-3); }
dialog::backdrop { background: rgba(17, 24, 39, .4); backdrop-filter: blur(2px); }

/* ---------------------------------------------------------------- CERMAT tests tab */
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; border: 1px solid var(--line); }
.seg a { flex: 1; text-align: center; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 620; font-size: .95rem; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: var(--sh-2); }
.seg a.on.m { color: var(--math); } .seg a.on.c { color: var(--czech); }
.year { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.year > h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 0 6px; }
.trow { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.trow:first-of-type { border-top: 0; }
.trow .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trow .t b { font-weight: 620; }
.trow .links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.score-pill { font-weight: 750; font-variant-numeric: tabular-nums; padding: 3px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); font-size: .82rem; }
.sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.sheet .cell { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; }
.sheet .cell .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.sheet .cell input { min-height: 38px; padding: 7px 10px; }
.sheet.check .cell { grid-template-columns: 34px 1fr 74px; }
.sheet.check .cell .given { font-size: .9rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet.check .cell input { text-align: center; }
.sum-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); }
.sum-bar b { font-size: 1.5rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pdf-frame { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); height: min(78vh, 900px); }
.pdf-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.pdf-frame[hidden], .pdf-fallback[hidden] { display: none; }
.pdf-fallback { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px; border-radius: var(--r); background: var(--surface-2); }
@media (min-width: 1100px) { main.wrap:has(.test-paper) { max-width: 980px; } }
@media (max-width: 520px) { .sheet { grid-template-columns: 1fr; } .trow { grid-template-columns: 1fr; } .trow .links { justify-content: flex-start; } }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 9px; font-family: var(--font); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .dash { stroke-dasharray: 3 3; }
.chart .th { stroke: var(--bad); stroke-width: 1.2; stroke-dasharray: 4 3; }
.chart .thl { fill: var(--bad); }
.chart .bar { fill: color-mix(in srgb, var(--accent) 40%, transparent); }
.chart .bar.now { fill: var(--accent); }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--muted); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--ink-2); }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.danger-zone { border-color: #f4c7c2; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-card { position: relative; border: 1.5px solid var(--line-2); border-radius: var(--r); padding: 13px 15px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: border-color .12s, background .12s; }
.choice-card:hover { border-color: var(--faint); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card b { font-size: 1rem; font-weight: 650; }
.choice-card span { font-size: .82rem; color: var(--muted); }
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-card:has(input:checked)::after { content: "✓"; position: absolute; top: 10px; right: 12px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: .72rem; display: grid; place-items: center; font-weight: 800; }
.choice-card:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.switch { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 6px 0; }
.switch input { width: 46px; height: 26px; appearance: none; background: var(--line-2); border-radius: 99px; position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 23px; }
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.settings-nav a { font-size: .85rem; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); text-decoration: none; color: var(--ink-2); font-weight: 560; }
.settings-nav a:hover { background: var(--surface-3); }

/* ---------------------------------------------------------------- lists, results */
.list .li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); align-items: center; }
.list .li:first-child { border-top: 0; }
.res { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .92rem; align-items: start; }
details.sol { border-top: 1px solid var(--line); padding: 11px 0; }
details.sol summary { cursor: pointer; display: flex; gap: 10px; align-items: center; }
details.sol .body { padding: 8px 0 0 30px; display: flex; flex-direction: column; gap: 6px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px 6px; text-align: center; font-size: .76rem; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 7px; }
.badge .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); }
.badge.on { border-style: solid; border-color: var(--line); color: var(--ink-2); box-shadow: var(--sh-1); }
.badge.on .ic { background: linear-gradient(135deg, #ffd27a, var(--accent-2)); color: #fff; }

/* ---------------------------------------------------------------- avatars */
.avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; color: #fff; flex: none; }
img.avatar { object-fit: cover; display: block; }
.avatar.xs { width: 32px; height: 32px; border-radius: 10px; font-size: .85rem; }
.avatar.tab { width: 24px; height: 24px; border-radius: 8px; font-size: .7rem; }
.avatar.sm { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 12px; }
.avatar.lg { width: 76px; height: 76px; border-radius: 22px; font-size: 2rem; box-shadow: var(--sh-2); }
.avs { display: flex; gap: 10px; flex-wrap: wrap; }
.mail { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: .92rem; }

/* ---------------------------------------------------------------- Duočka */
.doucka { display: flex; gap: 12px; align-items: flex-end; }
.doucka-cat { flex: none; }
.doucka-cat .cat { display: block; }
.bubble { position: relative; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 18px 18px 18px 6px; padding: 12px 16px;
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bubble .who { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--accent-dark); }
.bubble p { margin: 0; color: var(--ink-2); }
.doucka.warn .bubble { background: var(--warn-soft); border-color: #f2d58c; }
.helper { border: 1px solid var(--accent-line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: #fffaf6; }
.helper .row { flex-wrap: nowrap; align-items: flex-start; }
.helper ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.helper li { background: #fff; border: 1px solid var(--accent-line); border-radius: var(--r); padding: 9px 13px; }
.helper li[hidden] { display: none; }
.helper li .lead { display: block; font-size: .74rem; font-weight: 700; color: var(--accent-dark); margin-bottom: 2px; }

/* the companion in the corner */
.buddy { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 15;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.buddy > * { pointer-events: auto; }
.buddy-cat { background: #fff; border: 1px solid var(--line); border-radius: 50%; width: 64px; height: 64px; padding: 3px; cursor: pointer;
  box-shadow: var(--sh-3); display: grid; place-items: center; transition: transform .2s; }
.buddy-cat:hover { transform: translateY(-2px) rotate(-3deg); }
.buddy-cat.hop { animation: hop .6s ease-out; }
.buddy-cat.wiggle { animation: wiggle .7s ease-in-out; }
.buddy-bubble { position: relative; max-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 6px 16px;
  padding: 12px 34px 12px 14px; font-size: .92rem; font-weight: 520; color: var(--ink-2); box-shadow: var(--sh-3); animation: pop .22s cubic-bezier(.2,.9,.3,1.3); }
.buddy-bubble .who { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--accent-dark); font-weight: 700; margin-bottom: 2px; }
.buddy-x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 1.1rem; color: var(--faint); cursor: pointer; line-height: 1; }
.buddy-next { margin-top: 6px; border: 0; background: none; color: var(--accent-dark); font-size: .8rem; font-weight: 650; cursor: pointer; padding: 0; }
@keyframes pop { from { transform: translateY(8px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-14px); } 55% { transform: translateY(0); } 75% { transform: translateY(-5px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 50% { transform: rotate(7deg); } 75% { transform: rotate(-4deg); } }
@media (max-width: 720px) { .buddy { bottom: calc(80px + env(safe-area-inset-bottom)); } .buddy-cat { width: 54px; height: 54px; } .buddy-cat svg { width: 46px; height: 46px; }
  /* on a phone the corner cat would cover the answer field – tips come right below each answer instead */
  body.task-page .buddy { display: none; } }

/* ---------------------------------------------------------------- Plus */
.plus-chip { display: inline-flex; align-items: center; gap: 4px; background: linear-gradient(135deg, #ffb25e, var(--accent)); color: #fff; border: 0;
  text-decoration: none; font-size: .74rem; font-weight: 750; letter-spacing: .02em; padding: 5px 11px; border-radius: 99px; box-shadow: 0 4px 12px -6px rgba(232,119,42,.8); }
.plus-chip.off { background: var(--accent-soft); color: var(--accent-dark); box-shadow: none; }
.upsell { background: linear-gradient(120deg, #fff6ee, #fff 70%); border-color: var(--accent-line); }
.plus-hero { display: flex; gap: 18px; align-items: center; }
.price-card { display: flex; flex-direction: column; gap: 14px; }
.price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.price small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.compare { display: grid; grid-template-columns: 1fr auto auto; gap: 0 18px; align-items: center; }
.compare > * { padding: 10px 0; border-top: 1px solid var(--line); }
.compare > .h { border-top: 0; padding-top: 0; }
.compare .plus-col { color: var(--accent-dark); font-weight: 700; text-align: right; }
.compare .free-col { color: var(--muted); font-size: .9rem; text-align: right; }

/* ---------------------------------------------------------------- school suggestions */
.school-pick { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 74px; z-index: 30; margin: 0; padding: 6px; list-style: none; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-3); max-height: 320px; overflow: auto; }
.suggest li { padding: 9px 11px; border-radius: 9px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.suggest li b { font-weight: 600; font-size: .92rem; }
.suggest li span { font-size: .78rem; color: var(--muted); }
.suggest li:hover, .suggest li.on { background: var(--accent-soft); }
.suggest li.none { color: var(--muted); cursor: default; font-size: .88rem; }

/* ---------------------------------------------------------------- drawing, notes */
.drawpad { display: flex; flex-direction: column; gap: 8px; }
.drawpad canvas { width: 100%; border: 1px solid var(--line); border-radius: var(--r); cursor: crosshair; background-color: #fff;
  background-image: linear-gradient(#eff1f5 1px, transparent 1px), linear-gradient(90deg, #eff1f5 1px, transparent 1px); background-size: 20px 20px; }
.draw-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tool { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 4px 9px; font-size: .8rem; cursor: pointer; min-height: 32px; color: var(--ink-2); }
.tool:hover { background: var(--surface-2); }
.tool i { display: block; width: 16px; height: 16px; border-radius: 50%; }
.tool.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
details.scratch { border-top: 1px solid var(--line); padding-top: 10px; }
details.scratch > summary { cursor: pointer; color: var(--accent-dark); font-weight: 650; font-size: .92rem; margin-bottom: 8px; }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note-card { text-decoration: none; color: inherit; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.big-ico { width: 36px; height: 36px; color: var(--accent-dark); flex: none; }
ol.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------------------------------------------------------------- landing */
.hero { padding-block: 28px 8px; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-size: 2.4rem; letter-spacing: -.03em; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 34em; }
.hero-cat { display: flex; gap: 22px; align-items: center; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------------------------------------------------------- scratch paper right at the task, help on request */
.scratch-inline { display: flex; flex-direction: column; gap: 6px; }
.scratch-label { font-size: .8rem; font-weight: 650; color: var(--accent-dark); margin: 0; }
.scratch-inline .draw-tools .tool { min-height: 30px; padding: 3px 8px; }
details.help-ask > summary { list-style: none; cursor: pointer; color: var(--muted); font-size: .9rem; font-weight: 600; padding: 6px 0; }
details.help-ask > summary::-webkit-details-marker { display: none; }
details.help-ask > summary::before { content: "?"; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px;
  border-radius: 50%; border: 1.5px solid currentColor; font-size: .75rem; }
details.help-ask[open] > summary { color: var(--accent-dark); }
.test-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .test-layout.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .test-layout.two .sticky-paper { position: sticky; top: 140px; } }

.legal { gap: 10px; max-width: 70ch; }
.legal h2 { margin-top: 10px; font-size: 1.05rem; }
.legal ul, .legal ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.site-foot { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: .78rem; color: var(--faint); padding-top: 8px; }
.site-foot a { color: var(--muted); }

.prog.master i { background: var(--ok); }

/* ---------------------------------------------------------------- forecast (home) */
.forecast { gap: 12px; border-left: 5px solid var(--muted); }
.forecast.fc-ok { border-left-color: var(--ok); } .forecast.fc-warn { border-left-color: #e0a106; } .forecast.fc-bad { border-left-color: var(--bad); }
.fc-track { position: relative; height: 12px; margin: 34px 6px 4px; background: var(--surface-3); border-radius: 99px; }
.fc-track .fc-now { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.fc-track .flag { position: absolute; bottom: -2px; width: 2px; height: 34px; transform: translateX(-1px); }
.fc-track .flag b { position: absolute; bottom: 18px; left: 3px; font-size: .82rem; padding: 0 4px 0 12px; white-space: nowrap; line-height: 16px; }
.fc-track .flag b::before { content: ""; position: absolute; left: 0; top: 1px; width: 0; height: 0; border-left: 10px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.fc-track .flag.r b { left: auto; right: 3px; padding: 0 12px 0 4px; }
.fc-track .flag.r b::before { left: auto; right: 0; border-left: 0; border-right: 10px solid currentColor; }
.fc-track .flag.need { background: var(--ink); color: var(--ink); }
.fc-track .flag.pace { background: var(--muted); color: var(--muted); }
.fc-track .flag.goal { background: #2f5bd8; color: #2f5bd8; }
.fc-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; font-size: .84rem; font-weight: 650; }
.fc-legend .l-now { color: var(--accent); } .fc-legend .l-pace { color: var(--muted); } .fc-legend .l-goal { color: #2f5bd8; }
.goal-row { border-top: 1px solid var(--line); padding-top: 10px; }
.goal-btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.goal-btn:disabled { cursor: default; }
.goal-btn > span[aria-hidden] { font-size: 1.6rem; color: var(--muted); }
.goal-n { font-size: 1.35rem; }
@media (max-width: 420px) { .fc-legend { grid-template-columns: 1fr; } }

.trial-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); align-items: flex-start; }

/* ---------------------------------------------------------------- profile */
.me-hero { align-items: center; text-align: center; gap: 10px; }
.me-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; width: 100%; }
.cal-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.cal-head a { text-decoration: none; font-size: 1.4rem; color: var(--ink-2); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-w { font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-d { aspect-ratio: 1; max-width: 44px; width: 100%; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: var(--surface-2); color: var(--muted); }
.cal-d.on { background: var(--accent); color: #fff; font-size: 1rem; }
.cal-d.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-d.future { opacity: .45; }
#testy-reset summary { cursor: pointer; list-style: none; }
.list a.li { text-decoration: none; color: inherit; }
.list a.li:hover b { color: var(--accent-dark); }

/* ---------------------------------------------------------------- invitations */
.invite-hero { align-items: center; text-align: center; gap: 4px; }
.inv-big { font-size: 2.8rem; font-weight: 850; line-height: 1; margin: 6px 0 0; }
.inv-progress { display: flex; flex-direction: column; gap: 2px; border-top: 1px dashed var(--line-2); padding-top: 10px; margin-top: 8px; width: 100%; }
.inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inv-grid summary { cursor: pointer; font-weight: 700; }
.inv-qr .qr svg { width: 100%; max-width: 220px; height: auto; display: block; margin: 8px auto; }
.code-tiles { display: flex; gap: 5px; flex-wrap: wrap; }
.code-tiles i { font-style: normal; font-weight: 800; font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; width: 32px; height: 40px;
  display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); }
@media (max-width: 520px) { .inv-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- practice path */
.path-head { gap: 8px; }
.topic-pick summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; }
.topic-pick summary::-webkit-details-marker { display: none; }
.topic-pick summary::after { content: "⌄"; font-size: 1.4rem; color: var(--muted); margin-left: 4px; }
.topic-pick[open] summary::after { content: "⌃"; }
.topic-pick .list { margin-top: 8px; }
.topic-pick .li { text-decoration: none; color: inherit; }
.pp-t { font-size: 1.25rem; }
.path { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 18px 0 6px; }
.pnode-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.pnode-wrap.w1 { transform: translateX(46px); } .pnode-wrap.w2 { transform: translateX(70px); } .pnode-wrap.w3 { transform: translateX(30px); }
.pnode { width: 78px; height: 72px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 1.7rem; font-weight: 800;
  background: var(--surface-3); color: var(--faint); box-shadow: 0 7px 0 var(--line-2); cursor: pointer; }
.pnode .ico { width: 28px; height: 28px; }
.pnode.locked { cursor: default; }
.pnode.current { background: var(--accent); color: #fff; box-shadow: 0 7px 0 var(--accent-dark), 0 0 0 9px var(--accent-soft); }
.pnode.done { background: var(--ok); color: #fff; box-shadow: 0 7px 0 #0d6b3e; }
.pnode.trophy { border-radius: 22px; }
.pnode.trophy.won { background: #f5c518; box-shadow: 0 7px 0 #b88f00; }
.pnode:not(.locked):active { transform: translateY(4px); box-shadow: 0 3px 0 var(--line-2); }
.pbubble { display: flex; flex-direction: column; align-items: center; padding: 6px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow, 0 2px 10px rgba(0,0,0,.08)); margin-bottom: 4px; white-space: nowrap; }
.pbubble b { color: var(--accent-dark); }
.pname { max-width: 140px; text-align: center; }

/* ---------------------------------------------------------------- no accidental selection / zoom on phones
   Double-tapping text or a button selected it (blue) and opened the copy/paste menu. Text stays selectable only where
   the student types (fields), and taps don't zoom. */
button, .btn, .chip, .tchip, .opt, .key, label, summary, .tabs a, nav a, .pnode, .card a, .seg a {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.task-page main { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.task-page main input, body.task-page main textarea, body.task-page main select, body.task-page main [contenteditable],
.ai-msg { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
canvas { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
body.task-page { touch-action: manipulation; }

/* ---------------------------------------------------------------- reviews */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { font-size: 2.1rem; line-height: 1; color: var(--line-2); cursor: pointer; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #f5b301; }
.kind-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-pick .chip { cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); padding: 6px 12px; }
.kind-pick .chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.kind-pick input { accent-color: var(--accent); }
.star-y { color: #e0a100; }
pre.diff { max-height: 420px; overflow: auto; font-size: .74rem; line-height: 1.35; background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 10px; white-space: pre; }
.navrh summary { cursor: pointer; }
code.copied { background: var(--ok-soft) !important; color: var(--ok) !important; }
code.copied::after { content: " ✓ zkopírováno"; font-family: inherit; }

/* ---------------------------------------------------------------- maths keypad + writing by hand */
.ans-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ans-tools .chip { cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); font-weight: 650; }
.ans-tools .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; max-width: 420px; }
.key { height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: 1.2rem; font-weight: 700;
  color: var(--ink); box-shadow: 0 2px 0 var(--line-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.key:active { transform: translateY(2px); box-shadow: none; background: var(--surface-2); }
.key.del { background: var(--surface-2); }
.hand-box { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.hand-canvas { width: 100%; height: 130px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: #fff; display: block; }
details.hand { margin-top: 4px; }
details.hand summary { cursor: pointer; font-weight: 650; font-size: .9rem; color: var(--accent-dark); padding: 4px 0; }
.hand-thumb { display: block; max-width: 160px; max-height: 60px; border: 1px solid var(--line); border-radius: 6px; background: #fff; margin-bottom: 2px; }

/* ---------------------------------------------------------------- AI helper */
.ai-box { display: flex; flex-direction: column; gap: 8px; }
.ai-open { border: 1.5px dashed var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.ai-panel { gap: 10px; border-color: var(--accent-line); }
.ai-x { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.ai-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.ai-msg { padding: 9px 12px; border-radius: 14px; max-width: 90%; white-space: pre-wrap; line-height: 1.45; font-size: .95rem; }
.ai-msg.assistant { background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg.user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg.wait { color: var(--muted); font-style: italic; }
.ai-msg.err { background: var(--warn-soft); color: var(--warn); }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-chips .chip { cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); }
.ai-form { display: flex; flex-direction: column; gap: 6px; }
.ai-form textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1.5px solid var(--line-2); border-radius: 12px; resize: vertical; }
.ai-consent { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* CERMAT PDF on phones (Google's viewer of the official file) */
.pdf-frame.mobile-pdf { height: 78vh; }
.pdf-frame.mobile-pdf iframe { height: 100%; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-dark); text-decoration: underline; font: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- CERMAT test task by task */
[hidden] { display: none !important; }
.tnav { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.tchip { flex: none; min-width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid transparent; background: var(--surface-3);
  font-weight: 750; font-size: .9rem; cursor: pointer; color: var(--ink-2); position: relative; font-variant-numeric: tabular-nums; }
.tchip.has-a::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #2f5bd8; }
.tchip.s-ok { background: var(--ok); color: #fff; }
.tchip.s-zero { background: var(--bad); color: #fff; }
.tchip.on { border-color: #2f5bd8; box-shadow: 0 0 0 2px #2f5bd833; }
.tstat { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.dig { display: flex; align-items: center; gap: 6px; }
.dig-v { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.25rem; padding: 6px 14px; border-radius: 10px; background: var(--ink); color: #fff; letter-spacing: .04em; min-width: 92px; text-align: center; }
.dig-v.timer.low { background: var(--bad); color: #fff; }
.dig.hidden-v .dig-v { color: transparent; text-shadow: none; background: var(--surface-3); }
.dig.hidden-v .dig-v::after { content: "skryto"; color: var(--muted); font-size: .8rem; position: absolute; }
.dig .dig-v { position: relative; }
.dig.hidden-v .dig-v::after { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.eye { border: 0; background: none; color: var(--muted); font-size: 1.15rem; cursor: pointer; padding: 4px; }
.task-panel textarea { width: 100%; font: inherit; font-size: 1.05rem; padding: 10px 12px; border: 1.5px solid var(--line-2); border-radius: 12px; resize: vertical; }
.score-in { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.tactions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: sticky; bottom: 10px; z-index: 5; }
@media (max-width: 760px) { .tactions { bottom: calc(74px + env(safe-area-inset-bottom)); } }

/* ---------------------------------------------------------------- CERMAT test cards, score ring */
.ring { flex: none; }
.ring-v { font-size: 26px; font-weight: 800; fill: var(--ink); }
.ring-f { font-size: 12px; font-weight: 600; fill: var(--muted); }
.past-card { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.pc-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.pc-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pc-err { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.bub { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; background: var(--muted); }
.bub.bad { background: var(--bad); } .bub.ok { background: var(--ok); } .bub.part { background: linear-gradient(90deg, var(--bad) 50%, var(--ok) 50%); }

/* ---------------------------------------------------------------- plan picker (month / year) */
.plan-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); }
.plan-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.plan-opt input { margin-top: 4px; accent-color: var(--accent); }
.plan-opt > span { display: flex; flex-direction: column; gap: 2px; }
.plan-opt .price { font-size: 1.5rem; margin: 0; }
.plan-opt em { font-style: normal; font-size: .7rem; margin-left: 4px; vertical-align: 2px; }
@media (max-width: 520px) { .plan-pick { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- coins, friends, shop */
.coin { display: inline-block; vertical-align: -3px; }
.coin-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 99px; background: #fff8dc; color: #8a6400;
  font-weight: 750; font-size: .85rem; text-decoration: none; border: 1px solid #f3dd8a; font-variant-numeric: tabular-nums; }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.board li { display: grid; grid-template-columns: 30px 40px 1fr auto 64px; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board li.me { background: var(--accent-soft); border-radius: 10px; }
.board .rk { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-3); }
.board .rk1 { background: #f5c518; color: #5a4300; } .board .rk2 { background: #d8dde6; } .board .rk3 { background: #e9b48a; color: #5a2e0b; }
.board .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board b { font-size: 1.05rem; }
.board .prize { font-size: .78rem; color: #8a6400; font-weight: 700; text-align: right; white-space: nowrap; }
.group-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; font-weight: 800; letter-spacing: .18em; padding: 6px 14px; border-radius: 10px; background: var(--surface-2); }
.shop-hero { align-items: center; text-align: center; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-item { align-items: center; text-align: center; gap: 8px; padding: 14px; }
.shop-item.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.shop-prev { height: 96px; display: grid; place-items: center; }
@media (max-width: 420px) { .board li { grid-template-columns: 26px 34px 1fr auto 52px; gap: 6px; } .shop-grid { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- last year's admission results */
.admit { border: 1px solid var(--accent-line); background: #fffaf6; border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.admit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.admit-grid div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; min-width: 0; }
.admit-grid b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.admit-grid span { font-size: .74rem; color: var(--muted); }
.goal-line { display: flex; flex-direction: column; gap: 6px; }
.goal-track { position: relative; height: 12px; border-radius: 99px; background: var(--surface-3); }
.goal-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.goal-track .mk { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.goal-track .mk.min { background: var(--faint); }
.goal-legend { display: flex; justify-content: space-between; gap: 8px; font-size: .74rem; color: var(--muted); flex-wrap: wrap; }
@media (max-width: 420px) { .admit-grid b { font-size: 1.2rem; } }

/* ---------------------------------------------------------------- payment methods, QR */
.pay-methods { display: flex; flex-direction: column; gap: 10px; }
.pay-method { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: #fff; cursor: pointer; box-shadow: var(--sh-1);
  transition: border-color .15s, box-shadow .15s, transform .05s; }
.pay-method:hover:not([disabled]) { border-color: var(--accent); box-shadow: var(--sh-2); }
.pay-method:active:not([disabled]) { transform: translateY(1px); }
.pay-method[disabled] { opacity: .55; cursor: not-allowed; }
.pm-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; }
.pm-ico svg { width: 24px; height: 24px; }
.pm-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-t span { font-size: .84rem; color: var(--muted); }
.pm-go { font-weight: 700; color: var(--accent-dark); font-size: .9rem; }
.qr-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 22px; }
.qr { width: 220px; height: 220px; padding: 10px; background: #fff; border-radius: var(--r); border: 1px solid var(--line); flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.pay-details { flex: 1; min-width: 220px; }
.li-kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.li-kv:first-child { border-top: 0; }
.li-kv span { color: var(--muted); }

/* ---------------------------------------------------------------- social sign-in */
.social { display: flex; flex-direction: column; gap: 8px; }
.social-btn { justify-content: center; gap: 10px; font-weight: 620; }
.social-btn.apple { background: #000; color: #fff; border-color: #000; }
.social-btn.apple:hover { background: #222; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------------------------------------------------------- owner page */
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-pill { font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.mode-pill.test { background: var(--warn-soft); color: var(--warn); }
.mode-pill.live { background: var(--ok-soft); color: var(--ok); }
code.k { font-size: .85rem; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

@media (max-width: 520px) {
  h1 { font-size: 1.5rem; } .hello h1 { font-size: 1.6rem; } .hero h1 { font-size: 1.85rem; }
  .opts, .fgrid, .features, .choice-cards, .notes-grid, .admin-stats { grid-template-columns: 1fr; }
  .match .m { grid-template-columns: 1fr; }
  .kpis { gap: 8px; } .kpi { padding: 10px; } .kpi b { font-size: 1.18rem; }
  .card { padding: 16px; } .countdown b { font-size: 1.9rem; }
  .hero-cat, .plus-hero { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
