/* NHL Học viên: the landing's world (soot / paper / stone, Hanken Grotesk) with its petal motif
   (a rectangle with two opposite corners rounded) at four scales: pips, buttons and tiles, panels, the greeting block. */
:root {
  --soot: #141414; --soot-2: #2a2a28; --paper: #f5f5f3; --card: #fcfcfb; --stone: #e6e5e2; --line: #d9d8d4;
  --ink: #141414; --muted: #5a5a58; --on-soot: #f5f5f3; --muted-on-soot: #b0b0ad;
  --ok: #2f5d3a; --ok-bg: #e2ebe3; --bad: #8a2f2a; --bad-bg: #f2e3e0;
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --petal-xs: 8px 0; --petal-s: 16px 0; --petal-m: 28px 0; --petal-l: 56px 0;
  --step-small: 0.875rem; --step-body: 1.0625rem; --step-read: 1.125rem; --step-lead: 1.25rem;
  --step-head: clamp(1.875rem, 1.45rem + 2vw, 2.75rem);
  --m: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0; min-height: 100svh; background: var(--paper); color: var(--ink);
  font: 400 var(--step-body)/1.5 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}
body.guard { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.guard input, body.guard textarea { -webkit-user-select: text; user-select: text; }
::selection { background: var(--soot); color: var(--paper); }
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; -webkit-touch-callout: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
/* two-tone ring stays visible on both paper and soot grounds */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 4px var(--paper); }
h1, h2, h3 { font-weight: 500; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-head); line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0; text-wrap: pretty; }
.icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

b, strong { font-weight: 500; }
.wrap { width: 100%; max-width: 42rem; margin: 0 auto; padding-inline: var(--m); }
.narrow { max-width: 30rem; }

/* ---- app bar: soot, carries the status-bar safe area (iOS black-translucent) ---- */
.appbar {
  position: sticky; top: 0; z-index: 20; background: var(--soot); color: var(--on-soot);
  padding-top: env(safe-area-inset-top);
}
.appbar__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.appbar__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.appbar__brand img { height: 14px; width: auto; }
.appbar__brand span { font-size: var(--step-small); color: var(--muted-on-soot); }
.appbar__back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -6px; padding-right: 8px; text-decoration: none; font-weight: 500; }
.appbar__meta { font-size: var(--step-small); color: var(--muted-on-soot); font-variant-numeric: tabular-nums; }

/* ---- greeting block: the motif at its largest, soot running down from the app bar ---- */
.hello { background: var(--soot); color: var(--on-soot); border-radius: 0 0 var(--petal-l); padding: 12px 0 36px; }
.hello .wrap { display: grid; gap: 14px; }
.hello p { color: var(--muted-on-soot); }
.hello .button { margin-top: 10px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--petal-xs); font-size: var(--step-small); font-weight: 500; background: var(--stone); color: var(--ink); vertical-align: 1px; }
.pill--warn { background: var(--paper); color: var(--ink); }

/* progress: one small petal per lesson */
.pips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; max-width: 26rem; }
.pip { height: 10px; border-radius: 4px 0; background: var(--soot-2); }
.pip.on { background: var(--paper); }
.progress-label { font-size: var(--step-small); }
.progress-label b { font-weight: 500; color: var(--on-soot); }

/* ---- buttons: one shape, the petal ---- */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: var(--petal-s);
  background: var(--soot); color: var(--paper); font: 500 var(--step-body)/1.2 var(--font);
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background 180ms ease, transform 140ms ease, opacity 180ms ease;
}
.button:active { transform: scale(0.98); }
.button.button--paper { background: var(--paper); color: var(--ink); }
.button.button--stone { background: var(--stone); color: var(--ink); }
.button--block { width: 100%; }
.button--next { justify-content: space-between; text-align: left; padding: 12px 20px 12px 24px; min-height: 64px; }
.button--next small { display: block; font-size: var(--step-small); font-weight: 400; opacity: 0.7; }
@media (hover: hover) { .button:hover { background: var(--soot-2); } .button.button--paper:hover, .button.button--stone:hover { background: #dcdbd7; } }
.button[disabled] { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .button { flex: 1 1 12rem; }

/* ---- sections and lesson list ---- */
.section { margin-top: 40px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 14px; }
.sec-head span { font-size: var(--step-small); color: var(--muted); }
.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lesson-row {
  display: grid; grid-template-columns: 2.25rem 1fr auto; align-items: center; gap: 12px;
  min-height: 72px; padding: 14px 14px 14px 16px; background: var(--card); border-radius: var(--petal-s);
  text-decoration: none; transition: background 180ms ease, transform 140ms ease;
}
.lesson-row:active { transform: scale(0.99); }
@media (hover: hover) { .lesson-row:hover { background: #fff; } }
.lesson-row__n { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.02em; color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-row__title { display: block; font-weight: 500; line-height: 1.3; }
.lesson-row__meta { display: block; margin-top: 4px; font-size: var(--step-small); color: var(--muted); }
.lesson-row__meta b { font-weight: 500; color: var(--ink); }
.lesson-row .icon { color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 4px 0; border: 1.5px solid var(--muted); }
.dot.on { background: var(--ink); border-color: var(--ink); }
.lesson-row.is-read .lesson-row__n { color: var(--ink); }

.panel { padding: 24px; border-radius: var(--petal-m); background: var(--stone); display: grid; gap: 10px; }
.panel p { color: var(--muted); }
.panel--soot { background: var(--soot); color: var(--on-soot); }
.panel--soot p { color: var(--muted-on-soot); }
.panel .button { margin-top: 8px; justify-self: start; }
main { padding-bottom: 56px; }

/* ---- lesson reading ---- */
.lesson-head { padding: 28px 0 8px; display: grid; gap: 10px; }
.lesson-head p { color: var(--muted); font-size: var(--step-small); }
.prose { font-size: var(--step-read); line-height: 1.68; max-width: 36em; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }
.prose h3 { font-size: 1.175rem; letter-spacing: -0.015em; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul { padding-left: 1.25em; list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -1.05em; top: 0.68em; width: 8px; height: 8px; border-radius: 4px 0; background: var(--ink); }
.prose li + li { margin-top: 0.4em; }
.prose li > ul { margin-top: 0.4em; }
/* numbered steps: the counter sits in a soot petal */
.prose ol { list-style: none; padding: 0; counter-reset: step; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 2.6rem; min-height: 1.9rem; }
.prose ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1em; width: 1.85rem; height: 1.85rem;
  display: grid; place-items: center; border-radius: 10px 0; background: var(--soot); color: var(--paper);
  font-size: 0.875rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1;
}
.prose ol > li + li { margin-top: 0.75em; }
.prose ol > li > ul { margin-top: 0.5em; padding: 12px 14px 12px 2.1em; background: var(--card); border-radius: var(--petal-s); font-size: 1.0625rem; line-height: 1.55; }
.prose blockquote { margin-inline: 0; padding: 16px 20px; background: var(--stone); border-radius: var(--petal-s); font-size: var(--step-body); line-height: 1.6; }
.prose blockquote > * + * { margin-top: 0.6em; }
.prose .figure { display: block; margin-top: 1.4em; }
.prose .figure img { width: 100%; background: #fff; border-radius: var(--petal-s); }
.prose .figure .cap { display: block; margin-top: 8px; font-size: var(--step-small); color: var(--muted); line-height: 1.4; }

.after-lesson { display: grid; gap: 12px; margin-top: 48px; }
.pager-prev { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: var(--step-small); }
.review-panels { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

/* ---- quiz ---- */
.quiz-head { padding: 24px 0 4px; display: grid; gap: 6px; }
.quiz-head p { color: var(--muted); font-size: var(--step-small); }
#quiz { margin-top: 20px; scroll-margin-top: calc(72px + env(safe-area-inset-top)); }
.qpips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-bottom: 20px; }
.qpip { height: 6px; border-radius: 3px 0; background: var(--stone); transition: background 240ms ease; }
.qpip.now { background: var(--muted); }
.qpip.right { background: var(--ok); }
.qpip.wrong { background: var(--bad); }
.qcount { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.question { font-size: 1.375rem; line-height: 1.3; letter-spacing: -0.02em; margin-top: 8px; }
.choices { display: grid; gap: 10px; margin-top: 20px; }
.question:focus { outline: none; }
.choice-btn {
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 12px;
  min-height: 60px; padding: 12px 14px; text-align: left; font: inherit; line-height: 1.35; color: var(--ink);
  background: var(--card); border: 1.5px solid transparent; border-radius: var(--petal-s); cursor: pointer;
  transition: background 240ms var(--ease-out), border-color 240ms ease, opacity 240ms ease, transform 140ms ease;
}
.choice-btn:active:not([disabled]) { transform: scale(0.99); }
@media (hover: hover) { .choice-btn:hover:not([disabled]) { border-color: var(--line); background: #fff; } }
.choice-btn__key { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 10px 0; background: var(--stone); font-size: var(--step-small); font-weight: 500; }
.choice-btn[disabled] { cursor: default; }
.choice-btn.dim { opacity: 0.5; }
.choice-btn.right { background: var(--ok-bg); border-color: var(--ok); }
.choice-btn.right .choice-btn__key { background: var(--ok); color: #fff; }
.choice-btn.wrong { background: var(--bad-bg); border-color: var(--bad); }
.choice-btn.wrong .choice-btn__key { background: var(--bad); color: #fff; }
.choice-btn.right .icon { color: var(--ok); }
.choice-btn.wrong .icon { color: var(--bad); }
.feedback { display: grid; gap: 10px; margin-top: 16px; }
.feedback:empty { margin-top: 0; }
.result__score:focus { outline: none; }
.feedback__box { padding: 18px 20px; border-radius: var(--petal-s); background: var(--stone); display: grid; gap: 8px; animation: rise 280ms var(--ease-out); }
.feedback__verdict { font-weight: 500; }
.feedback__verdict.ok { color: var(--ok); }
.feedback__verdict.bad { color: var(--bad); }
.feedback__src { font-size: var(--step-small); color: var(--muted); }
.feedback__steps { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; font-weight: 500; }
/* ordering question: tap order is shown in the key badge */
.qhint { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
.step-btn.picked:not(.right):not(.wrong) { border-color: var(--ink); background: #fff; }
.step-btn.picked:not(.right):not(.wrong) .choice-btn__key { background: var(--soot); color: var(--paper); }
.choices + .button { margin-top: 14px; }
.result { display: grid; gap: 14px; }
.result__score { font-size: clamp(4.5rem, 3rem + 8vw, 6rem); font-weight: 500; letter-spacing: -0.05em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.result__score span { color: var(--muted); font-size: 0.45em; letter-spacing: -0.02em; }
.review-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.review-list li { padding: 14px 16px; background: var(--card); border-radius: var(--petal-s); display: grid; gap: 4px; }
.review-list li p:last-child { font-size: var(--step-small); color: var(--ok); font-weight: 500; }
.loading { color: var(--muted); padding: 24px 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- forms ---- */
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: var(--step-small); }
label.check { display: flex; align-items: center; gap: 10px; font-size: var(--step-body); font-weight: 400; }
input, textarea {
  font: 400 var(--step-body)/1.4 var(--font); width: 100%; min-height: 52px; padding: 12px 14px; color: var(--ink); caret-color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--petal-xs); transition: border-color 180ms ease;
}
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type="radio"], input[type="checkbox"] { width: 22px; min-height: 22px; height: 22px; flex: none; accent-color: var(--soot); }
input.code-input { font-size: 1.5rem; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
textarea { line-height: 1.55; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--petal-s); background: var(--bad-bg); color: var(--bad); font-weight: 500; }
.notice { padding: 14px 16px; border-radius: var(--petal-s); background: var(--stone); }
.small { font-size: var(--step-small); color: var(--muted); }
/* expiry picker: segmented quick picks, then the native date field */
.date-pick { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.date-pick legend { padding: 0; margin-bottom: 10px; font-weight: 500; font-size: var(--step-small); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--stone); border-radius: 12px 0; }
.seg button { min-height: 44px; border: 0; border-radius: 9px 0; background: transparent; color: var(--ink); font: 500 var(--step-body)/1 var(--font); cursor: pointer; transition: background 180ms ease, color 180ms ease; }
.seg button[aria-pressed="true"] { background: var(--soot); color: var(--paper); }
@media (hover: hover) { .seg button:hover:not([aria-pressed="true"]) { background: #dcdbd7; } }
.date-field { font-weight: 400; color: var(--muted); }
.date-field input { color: var(--ink); font-variant-numeric: tabular-nums; cursor: pointer; }
.date-sum { font-size: var(--step-small); color: var(--ink); min-height: 1.4em; }

/* activation: install guide only while not opened from the home screen */
.install { display: grid; gap: 10px; }
.install__os { padding: 18px 20px; border-radius: var(--petal-s); background: var(--card); display: grid; gap: 8px; }
.install__os h3 { font-size: var(--step-body); }
.install__os ol { margin: 0; padding-left: 1.25em; display: grid; gap: 4px; }
.install__warn { font-size: var(--step-small); color: var(--muted); }
@media (display-mode: standalone) { .install { display: none; } }

/* ---- admin ---- */
body.admin .wrap { max-width: 64rem; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--petal-xs); text-decoration: none; color: var(--muted-on-soot); font-size: var(--step-small); font-weight: 500; }
.tabs a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.admin-head { padding: 28px 0 20px; display: grid; gap: 8px; }
.admin-head p { color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: var(--step-small); }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.person { display: grid; gap: 8px; padding: 16px 18px; background: var(--card); border-radius: var(--petal-s); text-decoration: none; }
.person__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.person__name { font-weight: 500; font-size: var(--step-lead); letter-spacing: -0.02em; }
.person__facts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--step-small); color: var(--muted); }
.status { flex: none; padding: 3px 10px; border-radius: var(--petal-xs); font-size: var(--step-small); font-weight: 500; background: var(--stone); }
.status--ok { background: var(--ok-bg); color: var(--ok); }
.status--bad { background: var(--bad-bg); color: var(--bad); }
.card-form { padding: 22px; background: var(--card); border-radius: var(--petal-m); }
.card-form h2 { margin-bottom: 14px; }
.grid-actions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.inline { display: grid; gap: 12px; align-content: start; padding: 18px; background: var(--card); border-radius: var(--petal-s); }
.inline .button { justify-self: start; }
.code-box { display: grid; gap: 14px; padding: 24px; background: var(--soot); color: var(--on-soot); border-radius: var(--petal-m); }
.code-box p { color: var(--muted-on-soot); }
.code { font: 500 clamp(2rem, 1.5rem + 3vw, 2.75rem)/1 var(--font); letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }
.code-box .code { color: var(--on-soot); }
.choice { display: flex; gap: 10px; align-items: center; }
/* small buttons inside dense admin cards (still 44px tall for touch) */
.button--sm, button.button--sm { min-height: 44px; padding: 0 18px; font-size: var(--step-small); border-radius: 12px 0; white-space: nowrap; }
.actions--sm { gap: 8px; }
.actions--sm .button { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* lessons */
.lesson-admin { display: grid; grid-template-columns: 2.25rem 1fr auto; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--card); border-radius: var(--petal-s); }
.lesson-admin__acts { display: flex; gap: 6px; }
@media (max-width: 520px) { .lesson-admin { grid-template-columns: 2.25rem 1fr; } .lesson-admin__acts { grid-column: 2; } }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 12px 12px 12px 20px; background: var(--soot); color: var(--on-soot); border-radius: var(--petal-s); }

/* questions */
.qcards { display: grid; gap: 12px; }
.qcard { display: grid; gap: 12px; padding: 20px; background: var(--card); border-radius: var(--petal-m); scroll-margin-top: 140px; }
.qcard:target { box-shadow: 0 0 0 2px var(--ink); }
.qcard__head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.qcard__n { font-size: var(--step-lead); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.3; }
.qcard__q, .variant__q { font-weight: 500; font-size: var(--step-body); line-height: 1.4; }
.qcard__exp { color: var(--muted); }
.qcard__stat { display: grid; grid-template-columns: minmax(6rem, 12rem) auto; gap: 12px; align-items: center; font-size: var(--step-small); }
.qchoices { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.qchoices li { display: grid; grid-template-columns: 1.75rem 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px 0; }
.qchoices__key { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 8px 0; background: var(--stone); font-size: var(--step-small); font-weight: 500; }
.qchoices .is-answer { background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.qchoices .is-answer .qchoices__key { background: var(--ok); color: #fff; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 500; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform 180ms ease; flex: none; margin-right: 4px; }
details[open] > summary::before { transform: rotate(45deg); }
details[open] > form, details[open] > .variant { margin-bottom: 12px; }
.variants { border-top: 1px solid var(--stone); padding-top: 4px; }
.variant { display: grid; gap: 10px; padding: 16px; background: var(--paper); border-radius: var(--petal-s); }
.variant + .variant { margin-top: 8px; }
.variant--rejected { opacity: 0.6; }
.variant__top { display: flex; }
.edit > summary { color: var(--muted); font-size: var(--step-small); }
.compare { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; align-items: start; padding: 12px; background: var(--card); border-radius: var(--petal-m); }
.compare + .compare { margin-top: 10px; }
.compare__base { display: grid; gap: 10px; padding: 16px; }
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }

/* charts: SVG bars and columns, coloured by class (CSP allows no style attributes) */
.bar { display: block; width: 100%; height: 8px; border-radius: 4px 0; overflow: hidden; }
.bar__track { fill: var(--stone); }
.bar__fill { fill: var(--ink); }
.bar--bad .bar__fill { fill: var(--bad); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.bars li { display: grid; grid-template-columns: minmax(8rem, 1.2fr) minmax(6rem, 2fr) 7.5rem; gap: 14px; align-items: center; font-size: var(--step-small); }
.bars__val { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.bars__val small { font-weight: 400; color: var(--muted); }
@media (max-width: 600px) { .bars li { grid-template-columns: 1fr auto; gap: 6px 12px; } .bars li .bar { grid-column: 1 / -1; grid-row: 2; } }
.kpis { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.kpis li { display: grid; gap: 4px; align-content: start; padding: 18px; background: var(--card); border-radius: var(--petal-s); }
.kpis li:first-child { background: var(--soot); color: var(--on-soot); }
.kpis li:first-child .kpi__l { color: var(--muted-on-soot); }
.kpis--2 li:first-child { background: var(--card); color: var(--ink); }
.kpis--2 li:first-child .kpi__l { color: var(--muted); }
.kpis--2 .bar { margin-top: 8px; }
.kpi__v { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__l { font-size: var(--step-small); color: var(--muted); }
.cols { display: block; width: 100%; height: 140px; }
.col__views { fill: #c9c8c4; }
.col__quiz { fill: var(--ink); }
.col__base { fill: var(--stone); }
.cols__axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-top: 10px; font-size: var(--step-small); color: var(--muted); }
.legend span { width: 10px; height: 10px; border-radius: 3px 0; }
.legend__quiz { background: var(--ink); }
.legend__views { background: #c9c8c4; margin-left: 10px; }
.progress-row { grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 1.2fr) minmax(8rem, 1.2fr) auto; align-items: center; gap: 10px 20px; }
.progress-row__metric { display: grid; gap: 6px; font-size: var(--step-small); }
@media (max-width: 760px) { .progress-row { grid-template-columns: 1fr 1fr; } .progress-row .person__name, .progress-row > .small { grid-column: 1 / -1; } }
.hard { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hard a { display: grid; gap: 6px; padding: 16px 18px; background: var(--card); border-radius: var(--petal-s); text-decoration: none; }
.hard__q { font-weight: 500; }
.hard__stat { display: grid; grid-template-columns: minmax(6rem, 14rem) auto; gap: 12px; align-items: center; font-size: var(--step-small); }
details.card-form > summary { font-size: var(--step-lead); letter-spacing: -0.02em; }
table { border-collapse: collapse; width: 100%; font-size: var(--step-small); font-variant-numeric: tabular-nums; }
th { font-weight: 500; color: var(--muted); }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--stone); vertical-align: top; }
.scroll { overflow-x: auto; }
body.admin section > h2 { margin-bottom: 12px; }
details[open] > form { padding-bottom: 18px; }
pre { white-space: pre-wrap; background: var(--stone); padding: 12px 14px; border-radius: var(--petal-xs); margin: 0; }

/* watermark: above content, never intercepts taps */
.wm { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
@media print { body.guard { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
