@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("fonts/space-grotesk-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2?v=1") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Design pass 2026-11-19 «Varaq va siyoh» (paper and ink): neutral paper, white cards, ink text; emerald is the stamp
   (actions and the one deep block per screen), gold is the score. The Material 3 role names (--m-*) stay as the
   vocabulary every component already uses; only what they point at changed, so every screen follows. */
:root {
  --m-primary: #0b6b4f; --m-on-primary: #ffffff; --m-primary-container: #0f3d30; --m-on-primary-container: #f3f8f5;
  --m-secondary-container: #e1efe8; --m-on-secondary-container: #0b3f30;
  --m-tertiary: #7a5c00; --m-tertiary-container: #ffe7a3; --m-on-tertiary-container: #3d2e00;
  --m-surface: #f1f2ef; --m-surface-lowest: #ffffff; --m-surface-low: #ffffff; --m-surface-container: #ffffff;
  --m-surface-high: #eceeea; --m-surface-highest: #e2e5e0; --m-on-surface: #15211c; --m-on-surface-variant: #55615b;
  --m-outline: #87928c; --m-outline-variant: #dde1dc; --m-inverse-surface: #1b2621; --m-inverse-on-surface: #f1f5f2;
  --m-error: #b3261e; --m-error-container: #fbe4e1;
  --bg: var(--m-surface); --card: var(--m-surface-low); --text: var(--m-on-surface); --muted: var(--m-on-surface-variant); --line: var(--m-outline-variant);
  --primary: var(--m-primary); --primary-text: var(--m-on-primary); --primary-soft: var(--m-secondary-container); --primary-ink: var(--m-on-secondary-container);
  --ok: var(--m-primary); --ok-soft: var(--m-secondary-container); --warn: #8b5000; --warn-soft: #ffe8cc; --danger: var(--m-error);
  --danger-soft: var(--m-error-container);
  --ink: var(--m-primary-container); --ink-text: var(--m-on-primary-container); --ink-muted: #a9c7ba; --ink-2: rgba(255, 255, 255, .1);
  --hero-num: #f2c955; --hero-btn: #f3f8f5; --hero-btn-ink: #0f3d30;      /* on the deep block: the number in gold, the action in paper white */
  --gold: var(--m-tertiary-container); --gold-ink: var(--m-on-tertiary-container);
  --radius: 18px; --shadow: 0 1px 2px rgba(21, 33, 28, .04), 0 2px 8px rgba(21, 33, 28, .04);
  --fab-shadow: 0 6px 16px rgba(11, 107, 79, .28);
  --btn: #0b6b4f; --btn-text: #ffffff;       /* the filled action: the same emerald with white in both themes */
  --accent-grad: var(--primary); --skeleton: var(--m-surface-high); --scrim: rgba(0, 0, 0, .32);
  --field: var(--m-surface-lowest); --field-line: var(--m-outline); --seg-on: var(--m-surface-lowest);
  --elev1: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px 1px rgba(0, 0, 0, .15); --elev3: 0 4px 8px 3px rgba(0, 0, 0, .15), 0 1px 3px rgba(0, 0, 0, .3);
  --font-display: "Space Grotesk", Roboto, -apple-system, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --m-primary: #6edbad; --m-on-primary: #003827; --m-primary-container: #0f4535; --m-on-primary-container: #eaf5ef;
    --m-secondary-container: #23382f; --m-on-secondary-container: #cdebdc;
    --m-tertiary: #ecc248; --m-tertiary-container: #594400; --m-on-tertiary-container: #ffdf9a;
    --m-surface: #0e1411; --m-surface-lowest: #151b18; --m-surface-low: #151b18; --m-surface-container: #151b18;
    --m-surface-high: #1f2622; --m-surface-highest: #2a322e; --m-on-surface: #e3e9e4; --m-on-surface-variant: #a9b4ad;
    --m-outline: #7f8a84; --m-outline-variant: #2a332e; --m-inverse-surface: #e3e9e4; --m-inverse-on-surface: #1b2621;
    --m-error: #ffb4ab; --m-error-container: #93000a;
    --warn: #ffb870; --warn-soft: #4f3008; --ink-muted: #a9c7ba; --ink-2: rgba(255, 255, 255, .1);
    --danger-soft: #3a1512; --hero-num: #f2c955; --hero-btn: #eaf5ef; --hero-btn-ink: #0b2f24;
    --shadow: none; --fab-shadow: 0 6px 16px rgba(0, 0, 0, .45); --btn: #1a7f5e; --btn-text: #ffffff;
  }
}
:root[data-theme="dark"] {
  --m-primary: #6edbad; --m-on-primary: #003827; --m-primary-container: #0f4535; --m-on-primary-container: #eaf5ef;
  --m-secondary-container: #23382f; --m-on-secondary-container: #cdebdc;
  --m-tertiary: #ecc248; --m-tertiary-container: #594400; --m-on-tertiary-container: #ffdf9a;
  --m-surface: #0e1411; --m-surface-lowest: #151b18; --m-surface-low: #151b18; --m-surface-container: #151b18;
  --m-surface-high: #1f2622; --m-surface-highest: #2a322e; --m-on-surface: #e3e9e4; --m-on-surface-variant: #a9b4ad;
  --m-outline: #7f8a84; --m-outline-variant: #2a332e; --m-inverse-surface: #e3e9e4; --m-inverse-on-surface: #1b2621;
  --m-error: #ffb4ab; --m-error-container: #93000a;
  --warn: #ffb870; --warn-soft: #4f3008; --ink-muted: #a9c7ba; --ink-2: rgba(255, 255, 255, .1);
  --danger-soft: #3a1512; --hero-num: #f2c955; --hero-btn: #eaf5ef; --hero-btn-ink: #0b2f24;
  --shadow: none; --fab-shadow: 0 6px 16px rgba(0, 0, 0, .45); --btn: #1a7f5e; --btn-text: #ffffff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 17px; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; min-height: 44px; padding: 0 16px;
  color: var(--text); background: var(--primary-soft); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:disabled { opacity: .5; cursor: default; }
button { touch-action: manipulation; }   /* no double-tap zoom delay on answer chips */
button.primary { background: var(--primary); color: var(--primary-text); font-weight: 600; }
button.danger { background: transparent; color: var(--danger); }
button.block { width: 100%; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; }
.badge.open { background: var(--ok-soft); color: var(--ok); }
.badge.closed { background: var(--primary-soft); color: var(--primary); }
.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; padding: 0; min-height: 30px;
  background: var(--line); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 44px; padding: 0; border: 1px solid var(--line); background: var(--card); }
.stepper output { min-width: 36px; text-align: center; font-weight: 600; font-size: 18px; }
.q { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.q b { width: 28px; text-align: right; color: var(--muted); font-weight: 600; }
.chips { display: flex; gap: 6px; flex: 1; }
.chips button { flex: 1; min-height: 40px; padding: 0; background: var(--card); border: 1px solid var(--line); }
.chips button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.code { font: 600 22px/1 ui-monospace, Menlo, monospace; letter-spacing: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.analysis { white-space: pre-wrap; }
.footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line); }
.footer > div { max-width: 640px; margin: 0 auto; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); max-width: 90%;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; }
.empty { text-align: center; padding: 32px 0; color: var(--muted); }

/* ---- additions: nav, role cards, lists ---- */
main { padding-bottom: 104px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.nav button { flex: 1; flex-direction: column; gap: 2px; border-radius: 0; background: transparent; min-height: 56px;
  font-size: 12px; color: var(--muted); }
.nav button.on { color: var(--primary); font-weight: 600; }
.card.item, button.item { display: flex; align-items: center; gap: 12px; text-align: left; font-weight: 400;
  width: 100%; color: var(--text); background: var(--card); height: auto; padding: 14px; }
.grow { flex: 1; min-width: 0; }
.role-card { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; height: auto;
  background: var(--card); color: var(--text); font-weight: 400; padding: 18px; }
.role-card .icon { width: 30px; height: 30px; color: var(--primary); }
.role-card.current { border-color: var(--primary); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
ul.plain li:first-child { border-top: 0; }
.footer { z-index: 6; }

/* ---- fixes from visual review ---- */
.switch { flex: none; }
.row.lead { justify-content: flex-start; align-items: flex-start; }
.row.lead .icon { margin-top: 2px; }
.q:first-child { border-top: 0; }
.badge { white-space: nowrap; flex: none; }
.row h2 { min-width: 0; overflow-wrap: anywhere; }

/* ---- buying credits ---- */
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.quick button { min-height: 40px; padding: 0 14px; background: var(--card); border: 1px solid var(--line); }
.tier { padding: 6px 8px; border-radius: 8px; font-size: 15px; }
.tier.on { background: var(--primary-soft); color: var(--primary); }
.prov { display: flex; gap: 10px; margin: 8px 0 16px; }
.prov button { flex: 1; flex-direction: column; min-height: 64px; background: var(--card); border: 2px solid var(--line); }
.prov button[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); }

/* test options */
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 14px 0; }
.check input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--primary); }
select { min-height: 44px; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }


/* =====================================================================
   v11 design pass: hierarchy, density, motion
   ===================================================================== */
h1 { font-size: 24px; letter-spacing: -.01em; margin: 6px 0 14px; }
h2 { font-size: 17px; letter-spacing: -.005em; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 4px 8px; font-weight: 600; }
.card { padding: 16px; margin-bottom: 12px; }
main { animation: rise .22s ease-out backwards; }   /* not "both": a kept transform would pin the fixed nav and footer to <main> instead of the screen */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main, .sk { animation: none !important; } button { transition: none !important; } }
button { transition: transform .08s ease, background-color .15s ease, opacity .15s ease; }
button:active:not(:disabled) { transform: scale(.98); }
button.ghost { background: transparent; color: var(--primary); padding: 0 10px; min-height: 36px; font-weight: 600; }
button.small { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
button.icon-btn { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
button.primary { background: var(--primary); box-shadow: none; }
button.primary:disabled { box-shadow: none; }
.footer { box-shadow: 0 -8px 20px rgba(16,24,40,.05); }

/* skeleton loading */
.sk { border-radius: 12px; background: linear-gradient(90deg, var(--skeleton) 0%, color-mix(in srgb, var(--skeleton) 55%, var(--card)) 50%, var(--skeleton) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk.title { height: 28px; width: 55%; margin: 8px 0 18px; }
.sk.block { height: 84px; margin-bottom: 12px; }
.sk.tile { height: 92px; }

/* profile header */
.hero { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; }
.avatar { width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: var(--ink-text); display: grid; place-items: center;
  font-weight: 700; font-size: 18px; flex: none; }
.hero .who { flex: 1; min-width: 0; }
.hero .who b { display: block; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero .who span { font-size: 13px; color: var(--muted); }

/* stat tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tiles.one { grid-template-columns: 1fr; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile .k .icon { width: 16px; height: 16px; }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .v small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile button { margin-top: 8px; align-self: flex-start; }

/* compact setting row (AI switch etc.) */
.setting { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.setting .grow b { display: block; }
.setting .grow span { font-size: 13px; color: var(--muted); }

/* segmented control (replaces plain tabs) */
.seg { display: flex; padding: 4px; gap: 4px; background: var(--primary-soft); border-radius: 14px; margin: 10px 0 14px; }
.seg button { flex: 1; min-height: 38px; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; padding: 0 6px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.12); }

/* section header with action */
.sect-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 0; }
.sect-head h1 { margin: 0; font-size: 21px; }

/* test cards */
.tcard { display: block; width: 100%; text-align: left; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 14px 12px; margin-bottom: 10px; box-shadow: var(--shadow); height: auto; font-weight: 400; }
.tcard .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tcard .name { font-weight: 650; font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; }
.tcard .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft);
  color: var(--primary); font-size: 13px; font-weight: 550; white-space: nowrap; }
.chip.plain { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip .icon { width: 14px; height: 14px; }
.badge { font-weight: 600; padding: 3px 10px; }

/* share hero on test page */
.share { background: var(--ink); color: var(--ink-text); border: 0; border-radius: 20px; padding: 18px; margin-bottom: 12px; }
.share .lbl { font-size: 13px; opacity: .85; }
.share .big { font: 700 34px/1.15 ui-monospace, Menlo, monospace; letter-spacing: 5px; margin: 4px 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.share .big button { background: var(--ink-2); color: var(--ink-text); width: 44px; padding: 0; }
.share p { margin: 6px 0 14px; font-size: 13.5px; opacity: .9; }
.share .acts { display: grid; gap: 8px; }
.share .acts button { background: var(--ink-text); color: var(--ink); font-weight: 650; }
.share .acts button.secondary { background: var(--ink-2); color: var(--ink-text); font-weight: 550; }

/* key/value info list */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 550; overflow-wrap: anywhere; }

/* people list */
.person { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person .avatar { width: 34px; height: 34px; font-size: 14px; background: var(--primary-soft); color: var(--primary); }
.person .nm { font-weight: 550; overflow-wrap: anywhere; }
.person .tm { font-size: 12.5px; color: var(--muted); }

/* collapsible form sections */
details.sect { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); }
details.sect > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; min-height: 56px; }
details.sect > summary::-webkit-details-marker { display: none; }
details.sect .step { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid;
  place-items: center; font-weight: 700; font-size: 14px; flex: none; }
details.sect .t { flex: 1; min-width: 0; }
details.sect .t b { display: block; font-size: 16px; }
details.sect .t span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.sect .chev { transition: transform .15s; color: var(--muted); }
details.sect[open] .chev { transform: rotate(90deg); }
details.sect > .body { padding: 0 16px 16px; }
details.sect > .body > label:first-child { margin-top: 0; }
.field-hint { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }

/* empty states */
.empty { padding: 36px 16px; }
.empty .icon { width: 40px; height: 40px; color: var(--muted); opacity: .7; margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* nav: active pill */
.nav button { position: relative; transition: color .15s; }
.nav button.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }

/* join code input */
.codebox { text-align: center; font: 700 28px/1.2 ui-monospace, Menlo, monospace; letter-spacing: 8px; text-transform: uppercase; padding: 16px 8px; }
.codebox::placeholder { letter-spacing: 8px; opacity: .35; }

/* result list for students */
.result { display: flex; gap: 14px; align-items: center; }
.ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-soft);
  color: var(--primary); font-weight: 750; font-size: 19px; font-variant-numeric: tabular-nums; }

.tile button.ghost { margin-left: -10px; }
.q { padding: 6px 0; }
.chips button { min-height: 38px; }
.person input { flex: none; }
.setting .icon { align-self: flex-start; margin-top: 2px; }

/* students roster: tappable rows, invite confirmation */
button.person { width: 100%; min-height: 0; border-radius: 0; background: transparent; text-align: left; padding: 10px 0;
  justify-content: flex-start; font-weight: normal; }
button.person .grow { min-width: 0; }
button.person > .icon { color: var(--muted); }
.ring.ok { background: var(--ok-soft); color: var(--ok); }
.ring.ok .icon { width: 30px; height: 30px; stroke-width: 2.2; }
.chips.pick { flex-wrap: wrap; max-height: 132px; overflow-y: auto; margin: 8px 0 0; }
.chips.pick button { flex: none; padding: 0 12px; max-width: 100%; overflow-wrap: anywhere; }

/* closed-test statistics */
.gdist { display: flex; gap: 6px; align-items: flex-end; height: 120px; margin: 8px 0 4px; }
.gcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.gbar { width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px; background: var(--primary); opacity: .85; }
.gn { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.gl { font-size: 12px; color: var(--muted); font-weight: 600; }
.istats { display: grid; gap: 2px; }
.istat { display: grid; grid-template-columns: 34px 1fr 70px 46px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; border-top: 1px solid var(--line); }
.istat:first-child { border-top: 0; }
.istat .in { font-weight: 600; }
.istat .ib { height: 8px; border-radius: 4px; background: var(--primary-soft); overflow: hidden; }
.istat .ib span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.istat .ic, .istat .id { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }

/* answer-sheet reading */
.q.unsure { background: var(--warn-soft); border-radius: 10px; padding: 6px 8px; }
.q .flag { font-size: 12px; color: var(--warn); font-weight: 600; margin-left: 6px; white-space: nowrap; }
.card.unsure { outline: 2px solid var(--warn); }
.sheetpics { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; }
.sheetpics img { height: 120px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; flex: none; }
.sheetpics img.big { position: fixed; inset: 8px; z-index: 30; width: calc(100vw - 16px); height: calc(100vh - 16px); object-fit: contain;
  background: rgba(0,0,0,.85); border: 0; cursor: zoom-out; }

/* owner dashboard */
.dfield { margin-top: 14px; }
.dfield label { margin-top: 0; }
.drow { display: flex; gap: 8px; align-items: center; }
.drow input { flex: 1; min-width: 0; }
.drow button { flex: none; }
.urlrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin-top: 12px; }
.urlrow code { grid-column: 1 / -1; font-size: 12.5px; background: var(--primary-soft); border-radius: 8px; padding: 6px 8px; overflow-wrap: anywhere; user-select: all; }
.card .setting { padding: 10px 0; }

/* manual credit top-up (teacher) and credit grants (owner) */
.topup ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.cardbox { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: var(--primary-soft); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.cardbox .num { font: 700 18px/1.3 ui-monospace, Menlo, monospace; letter-spacing: .5px; user-select: all; white-space: nowrap; }
.cardbox button { flex: none; }
.glist { max-height: 260px; overflow-y: auto; margin-top: 8px; }
.glist .person.on { background: var(--primary-soft); border-radius: 10px; }
.gsel { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
input[type=search] { -webkit-appearance: none; appearance: none; }

/* sheet queue */
.pbar { height: 8px; border-radius: 4px; background: var(--primary-soft); overflow: hidden; margin-top: 6px; }
.pbar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s ease; }
.jobs { max-height: 420px; overflow-y: auto; margin-top: 10px; }
.jobs .person .tm { color: var(--warn); }
.jobs .person button.small { flex: none; }

/* chosen answer photos (student) */
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.thumb { position: relative; width: 96px; height: 96px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.thumb button { position: absolute; top: 4px; right: 4px; width: 36px; min-height: 36px; padding: 0; background: var(--card); box-shadow: var(--shadow); }
/* narrow phones: 7 answer chips (A-F + blank) must still fit */
@media (max-width: 360px) { .chips { gap: 4px; } .q { gap: 6px; } .q b { width: 22px; } }
.switch::before { content: ""; position: absolute; inset: -7px -4px; }   /* 44 px tap area around a 30 px switch */
button.icon-btn.lang { font-size: 13px; font-weight: 700; letter-spacing: .02em; }

/* paper tests: participant rows, written-part ticks */
.note.info { background: var(--primary-soft); color: var(--text); }
.note.info b { display: block; color: var(--primary); margin-bottom: 4px; }
button.rowbtn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: transparent; padding: 0;
  min-height: 44px; text-align: left; justify-content: flex-start; font-weight: normal; color: var(--text); border-radius: 10px; }
.tm.ok { color: var(--ok); }
.tm.warn { color: var(--warn); }
.ticks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
button.tick { min-height: 44px; padding: 0 14px; background: var(--card); border: 1px solid var(--line); font-weight: 600; }
button.tick .icon { width: 20px; height: 20px; }
button.tick.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
/* essay rows: a long name keeps its own line on narrow phones instead of breaking every few letters */
.person.erow { flex-wrap: wrap; }
.person.erow .grow { flex: 1 1 140px; }   /* name on its own line, the score field and its button below */

/* =====================================================================
   v36 redesign: display type, limit hero, time saved, paper-test flow
   ===================================================================== */
h1, .sect-head h1, .tile .v, .code, .codebox, .share .big, .ring, .num-display { font-family: var(--font-display); }
h1 { font-weight: 700; letter-spacing: -.015em; }
.share .big { font-family: var(--font-display); letter-spacing: 4px; }
.share .lbl, .share p { color: var(--ink-muted); opacity: 1; }
.card, .tile, .tcard, details.sect { border-radius: var(--radius); }
.seg { background: color-mix(in srgb, var(--line) 70%, var(--bg)); }
.chip { font-weight: 600; }
.person .avatar { border-radius: 10px; }

/* limit: the one dark surface on the home screen */
.limit-hero { background: var(--ink); color: var(--ink-text); border-radius: 20px; padding: 18px; display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.limit-hero .grow span { display: block; font-size: 13px; color: var(--ink-muted); }
.limit-hero .v { font: 700 40px/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.limit-hero button { background: var(--ink-text); color: var(--ink); font-weight: 650; flex: none; }
.balance-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }

/* time saved */
.saved { padding: 14px; }
.saved .row { margin-bottom: 10px; }
.saved .row b { font-size: 14.5px; }
.saved-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.saved-cell { background: var(--bg); border-radius: 12px; padding: 10px; min-width: 0; }
.saved-cell b { display: block; font: 700 19px/1.2 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-cell span { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.saved-cell.lead { background: var(--primary-soft); }
.saved-cell.lead b { color: var(--primary-ink); }
.saved .field-hint { margin-top: 10px; }
.saved-line { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); color: var(--primary-ink); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; line-height: 1.4; }
.saved-line .icon { flex: none; }

/* test card: progress of a paper test */
.tprog { margin-top: 12px; }
.tprog .row { font-size: 13px; color: var(--muted); }
.tprog .row b { color: var(--text); font-variant-numeric: tabular-nums; }

/* paper test: summary ring + three actions */
.sumcard { display: flex; align-items: center; gap: 14px; }
.pring { width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0); }
.pring span { width: 50px; height: 50px; border-radius: 50%; background: var(--card); display: grid; place-items: center;
  font: 700 15px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.sumcard .grow b { display: block; font-size: 16px; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
.actions button { flex-direction: column; min-height: 76px; gap: 6px; padding: 8px 6px; font-size: 13px; font-weight: 600; line-height: 1.2;
  background: var(--card); border: 1px solid var(--line); text-align: center; }
.actions button.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* answer entry: who and how far, always visible */
.entry-head { position: sticky; top: 0; z-index: 4; background: var(--card); border-bottom: 1px solid var(--line);
  margin: -16px -16px 12px; padding: 12px 16px; display: grid; gap: 8px; }
.entry-head .row span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.entry-head .who { font: 700 20px/1.2 var(--font-display); overflow-wrap: anywhere; }
.entry-head .pbar { margin-top: 0; }
.fast { display: flex; gap: 8px; align-items: center; }
.fast input { font: 600 16px/1 var(--font-display); letter-spacing: 2px; text-transform: lowercase; }
.fast input::placeholder { font: 400 15px/1 -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0; }
.footer .duo { display: flex; gap: 10px; }
.footer .duo button:last-child { flex: 1; }

/* bottom sheet (closing a test) */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out; }
.sheet { background: var(--card); color: var(--text); width: 100%; max-width: 640px; border-radius: 24px 24px 0 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 14px; animation: up .2s ease-out; max-height: 92vh; overflow-y: auto; }
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); justify-self: center; }
.sheet h2 { font: 700 22px/1.2 var(--font-display); margin: 0; }
.sheet .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet .nums div { background: var(--bg); border-radius: 12px; padding: 10px; }
.sheet .nums div.warn { background: var(--warn-soft); color: var(--warn); }
.sheet .nums span { display: block; font-size: 12px; color: inherit; opacity: .85; }
.sheet .nums b { font: 700 20px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.sheet ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.45; }
.sheet li { display: flex; gap: 10px; }
.sheet li .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--primary); }
.sheet li.warn, .sheet li.warn .icon { color: var(--warn); }
.sheet .duo { display: flex; gap: 10px; }
.sheet .duo button:last-child { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .scrim, .sheet { animation: none; } }

/* student: answers sent */
.done-hero { text-align: center; display: grid; justify-items: center; gap: 12px; padding: 28px 8px 20px; }
.done-hero .ring { width: 88px; height: 88px; }
.done-hero .ring .icon { width: 44px; height: 44px; }
.done-hero h1 { margin: 0; font-size: 26px; }
.done-hero p { margin: 0; color: var(--muted); max-width: 320px; line-height: 1.5; }

/* owner: AI order */
.order { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 4px; }
.order button { min-height: 52px; flex-direction: column; gap: 0; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.order button span { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.order button[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--primary-soft); }
.subhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 2px; }
.subhead b { font-size: 15px; }

/* owner looking at the app as someone else */
.viewas { display: flex; align-items: center; gap: 10px; background: var(--warn-soft); color: var(--warn); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 12px; }
.viewas .grow b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.viewas .grow span { display: block; font-size: 12.5px; }
.viewas button { background: var(--card); color: var(--text); flex: none; }
button.person.plain .icon { color: var(--muted); }

/* v38: the rest of the approved mockup */
.choices { display: grid; gap: 10px; }
button.choice { justify-content: flex-start; align-items: flex-start; gap: 12px; text-align: left; min-height: 0; height: auto; padding: 14px;
  background: var(--card); border: 2px solid var(--line); border-radius: 16px; font-weight: 400; color: var(--text); }
button.choice[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
button.choice b { display: block; font-size: 15.5px; margin-bottom: 2px; }
button.choice .grow span { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.choice-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--bg); color: var(--primary); }
button.choice[aria-pressed="true"] .choice-ic { background: var(--primary); color: var(--primary-text); }

.brand { display: grid; gap: 10px; padding: 18px 4px 22px; }
.brand-mark { width: 60px; height: 60px; border-radius: 18px; background: var(--ink); color: var(--ink-text); display: grid; place-items: center; }
.brand-mark .icon { width: 32px; height: 32px; }
.brand-name { font: 700 30px/1.1 var(--font-display); letter-spacing: -.015em; }
.brand p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }

.join-card { padding: 18px; }
.join-card .codebox { border-width: 2px; }

.ans-head { position: sticky; top: 0; z-index: 4; margin: -16px -16px 12px; padding: 12px 16px; background: var(--ink); color: var(--ink-text);
  display: flex; align-items: center; gap: 12px; }
.ans-head .grow b { display: block; font-size: 15.5px; overflow-wrap: anywhere; }
.ans-head .grow span { display: block; font-size: 12.5px; color: var(--ink-muted); }
.ans-head .clock { display: inline-flex; align-items: center; gap: 6px; background: var(--ink-2); color: var(--ink-text); border-radius: 12px;
  padding: 8px 10px; font: 700 16px/1 var(--font-display); font-variant-numeric: tabular-nums; flex: none; }
.ans-head .clock .icon { width: 18px; height: 18px; }
.qmap { display: flex; gap: 3px; margin-bottom: 10px; }
.qmap span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.qmap span.on { background: var(--primary); }

.rhero { background: var(--ink); color: var(--ink-text); border-radius: 20px; padding: 18px; display: grid; gap: 12px; margin-bottom: 12px; }
.rhero .sub { font-size: 13px; color: var(--ink-muted); }
.rhero .big { font: 700 56px/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rhero .gr { display: inline-block; background: var(--ink-text); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 15px; }
.rstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rstats div { background: var(--ink-2); border-radius: 12px; padding: 8px 10px; }
.rstats span { display: block; font-size: 12px; color: var(--ink-muted); }
.rstats b { font: 700 15px/1.3 var(--font-display); font-variant-numeric: tabular-nums; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; }
.wgrid button { min-height: 34px; padding: 0; border-radius: 8px; font-size: 12px; font-weight: 600; }
.wgrid button.ok { background: var(--ok-soft); color: var(--ok); }
.wgrid button.bad { background: var(--danger); color: #fff; font-weight: 700; }
:root[data-theme="dark"] .wgrid button.bad { color: var(--bg); }

.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-bottom: 4px; }
button.pack { flex-direction: column; align-items: flex-start; gap: 0; height: auto; min-height: 0; padding: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; font-weight: 400; color: var(--text); }
button.pack b { font: 700 24px/1.1 var(--font-display); }
button.pack span { font-size: 12.5px; color: var(--muted); }
button.pack .sum { font-size: 14px; font-weight: 650; color: var(--text); margin-top: 6px; }
button.pack[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--primary-soft); }

/* v40: buy screen bottom half + discount */
.payms { display: grid; gap: 8px; }
button.paym { justify-content: flex-start; gap: 12px; text-align: left; height: auto; min-height: 60px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-weight: 400; color: var(--text); }
button.paym b { display: block; font-size: 15px; }
button.paym .grow span { display: block; font-size: 12.5px; color: var(--muted); }
button.paym .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
button.paym[aria-checked="true"] { border: 2px solid var(--primary); }
button.paym[aria-checked="true"] .radio { border: 6px solid var(--primary); }
.paybar { display: grid; gap: 8px; }
.paybar .muted { display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; color: var(--text); font-size: 14px; }
.tier { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
s.was { color: var(--muted); font-weight: 400; }
.promo { display: inline-block; margin-top: 8px; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 4px 10px;
  font-size: 12.5px; font-weight: 700; }
.promo-card { display: grid; gap: 2px; background: var(--warn-soft); color: var(--warn); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.promo-card b { font: 700 20px/1.2 var(--font-display); }
.promo-card span { font-size: 13.5px; }
.limit-hero .grow .promo { display: inline-block; color: var(--warn); font-size: 12.5px; }
main:has(.paybar) { padding-bottom: 190px; }

/* v41: picking students into a paper test */
.fchips { display: flex; align-items: center; gap: 6px; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px 2px; scrollbar-width: none; }
.fchips::-webkit-scrollbar { display: none; }
button.fchip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
button.fchip[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); border-color: var(--ink); font-weight: 650; }
.searchbox { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; margin-bottom: 8px; color: var(--muted); }
.searchbox .icon { width: 18px; height: 18px; }
.searchbox input { border: 0; padding: 11px 0; background: transparent; }
.searchbox input:focus { outline: none; }
.searchbox:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.pick-count { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--muted); margin: 0 4px 6px; }
.plist { padding: 0 14px; }
label.prow { display: flex; align-items: center; gap: 12px; min-height: 56px; margin: 0; font-weight: 400; border-top: 1px solid var(--line); cursor: pointer; }
label.prow:first-child { border-top: 0; }
label.prow input { width: 22px; height: 22px; flex: none; margin: 0; padding: 0; accent-color: var(--primary); }
label.prow .nm { display: block; font-weight: 550; overflow-wrap: anywhere; }
label.prow .tm { display: block; font-size: 12.5px; color: var(--muted); }
.dash-tabs button { font-size: 14px; }
.limit-hero .v { overflow-wrap: anywhere; }

/* v42: form fields stand out from the card in both themes (dark: an input on a card was nearly invisible) */
input, textarea, select { background: var(--field); border-color: var(--field-line); }
.searchbox { background: var(--field); border-color: var(--field-line); }
.searchbox input { background: transparent; }
.person.erow input { flex: none; }

/* v49: "new test" in the middle of the bottom bar */
.nav { overflow: visible; }
.nav button.nav-add { flex: 0 0 92px; position: relative; color: var(--primary); font-weight: 650; }
.nav-add .add-circle { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: var(--primary-text); display: grid;
  place-items: center; margin-top: -26px; border: 4px solid var(--bg); box-shadow: 0 4px 14px rgba(20, 32, 46, .22); }
.nav-add .add-circle .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.nav button.nav-add:active:not(:disabled) .add-circle { transform: scale(.94); }

/* v50 colour review: every control's edge reaches 3:1 against what is behind it (WCAG 1.4.11) in both themes;
   chosen states keep their own colours (their selectors are more specific). Cards and dividers stay soft on purpose. */
.stepper button, .chips button, .quick button, button.tick, .order button, button.pack, button.paym, button.fchip,
.actions button, button.choice, .share .big button { border-color: var(--field-line); }
button.choice { border-width: 1px; }
button.choice[aria-pressed="true"] { border-width: 2px; }
.switch { background: var(--field-line); }
.switch::after { background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
/* the chosen tab: a lighter surface than the track in both themes (dark used the card colour, darker than the track) */
.seg button.on { background: var(--seg-on); }

/* palette C: the numbers that matter in gold on the deep card, the main action in emerald */
.limit-hero button { background: var(--primary); color: var(--primary-text); }
.limit-hero .grow .promo, .promo { background: var(--gold); color: var(--gold-ink); }
.rhero .gr { background: var(--gold); color: var(--gold-ink); }

/* action tiles: icon to the left of the label, one compact row (owner's request) */
.actions button { flex-direction: row; min-height: 54px; gap: 8px; padding: 0 12px; font-size: 14px; }
.actions button .icon { width: 20px; height: 20px; flex: none; }

/* =====================================================================
   Material 3 components
   ===================================================================== */
body { font-family: Roboto, "Google Sans", -apple-system, "Segoe UI", system-ui, sans-serif; letter-spacing: .1px; }
h1 { font: 400 28px/36px var(--font-display); letter-spacing: 0; }                       /* headline small */
h2 { font: 500 18px/24px var(--font-display); }                                          /* title medium+ */
h3 { font: 500 12px/16px var(--font-display); letter-spacing: .5px; }                    /* label medium */
.tile .v, .limit-hero .v, .rhero .big, .code, .codebox, .share .big, .saved-cell b, .sheet .nums b, .pring span,
.entry-head .who, .brand-name, .sheet h2, .done-hero h1, .rstats b, .fast input { font-family: var(--font-display); }
.limit-hero .v { font-weight: 400; font-size: 45px; line-height: 52px; color: var(--ink-text); }   /* display small */
.rhero .big { font-weight: 400; }
.sect-head h1 { font-size: 24px; line-height: 32px; font-weight: 400; }

/* buttons: full pill, 40px, label large; default = tonal, primary = filled, ghost = text, danger = text in error */
button { border-radius: 999px; min-height: 40px; padding: 0 24px; font-weight: 500; font-size: 14px; letter-spacing: .1px;
  background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
button.primary { background: var(--m-primary); color: var(--m-on-primary); box-shadow: none; }
button.primary:hover:not(:disabled) { box-shadow: var(--elev1); }
button:disabled { opacity: 1; background: color-mix(in srgb, var(--m-on-surface) 12%, transparent); color: color-mix(in srgb, var(--m-on-surface) 38%, transparent); box-shadow: none; }
button.ghost { background: transparent; color: var(--m-primary); padding: 0 12px; }
button.danger { background: transparent; color: var(--m-error); }
button.block { min-height: 48px; }
button.small { min-height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; }
button.icon-btn { width: 40px; min-height: 40px; padding: 0; border-radius: 999px; background: transparent; color: var(--m-on-surface-variant); }
button.icon-btn.lang { background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
button:active:not(:disabled) { transform: none; }
button { transition: background-color .2s, box-shadow .2s, color .2s; }

/* cards: filled (surface container), 12–16px corners, no outline */
.card, .tile, .tcard, details.sect { background: var(--m-surface-low); border: 0; border-radius: 16px; box-shadow: none; }
.tcard:active, button.person:active, button.rowbtn:active { background: color-mix(in srgb, var(--m-on-surface) 8%, var(--m-surface-low)); }
.saved-cell { background: var(--m-surface-container); border-radius: 12px; }
.saved-cell.lead { background: var(--m-primary-container); }
.saved-cell.lead b { color: var(--m-on-primary-container); }
.saved-line { background: var(--m-secondary-container); color: var(--m-on-secondary-container); border-radius: 12px; }
.note { border-radius: 12px; }
.note.info { background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
.note.info b { color: var(--m-on-secondary-container); }

/* tonal hero cards (limit, test code, student result, answer header) */
.limit-hero, .share, .rhero { background: var(--m-primary-container); color: var(--m-on-primary-container); border-radius: 28px; }
.limit-hero .grow span, .share .lbl, .share p, .rhero .sub { color: var(--ink-muted); }
.limit-hero button { background: var(--m-primary); color: var(--m-on-primary); }
.share .acts button { background: var(--m-primary); color: var(--m-on-primary); }
.share .acts button.secondary { background: transparent; color: var(--m-on-primary-container); border: 1px solid var(--m-outline); }
.share .big button { background: transparent; color: var(--m-on-primary-container); }
.rstats div { background: color-mix(in srgb, var(--m-on-primary-container) 10%, transparent); }
.rstats span { color: var(--ink-muted); }
.ans-head { background: var(--m-surface-container); color: var(--m-on-surface); }
.ans-head .grow span { color: var(--m-on-surface-variant); }
.ans-head .clock { background: var(--m-tertiary-container); color: var(--m-on-tertiary-container); border-radius: 8px; }
.avatar { background: var(--m-primary-container); color: var(--m-on-primary-container); border-radius: 50%; }
.person .avatar { background: var(--m-secondary-container); color: var(--m-on-secondary-container); border-radius: 50%; }
.promo, .limit-hero .grow .promo, .rhero .gr { background: var(--m-tertiary-container); color: var(--m-on-tertiary-container); border-radius: 8px; }

/* chips: 8px corners, 32px; status chips tonal, plain = outlined */
.chip, .badge { border-radius: 8px; min-height: 28px; padding: 4px 12px; font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; }
.chip { background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
.chip.plain { background: transparent; border: 1px solid var(--m-outline-variant); color: var(--m-on-surface-variant); }
.chip.warn, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.open, .chip.ok { background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
.badge.closed { background: var(--m-surface-highest); color: var(--m-on-surface-variant); }
button.fchip { border-radius: 8px; min-height: 32px; padding: 0 16px; background: transparent; border: 1px solid var(--m-outline);
  color: var(--m-on-surface-variant); font-weight: 500; }
button.fchip[aria-pressed="true"] { background: var(--m-secondary-container); color: var(--m-on-secondary-container); border-color: transparent; }
button.fchip[aria-pressed="true"]::before { content: "✓"; margin-right: 6px; }

/* segmented buttons */
.seg { background: transparent; border: 1px solid var(--m-outline); border-radius: 999px; padding: 0; gap: 0; overflow: hidden; }
.seg button { border-radius: 0; min-height: 40px; background: transparent; color: var(--m-on-surface); font-weight: 500; font-size: 14px; box-shadow: none; }
.seg button + button { border-left: 1px solid var(--m-outline); }
.seg button.on { background: var(--m-secondary-container); color: var(--m-on-secondary-container); box-shadow: none; }
.seg button.on::before { content: "✓"; margin-right: 6px; }

/* answer chips and option grids: outlined, filled when chosen */
.chips button { border-radius: 8px; background: transparent; border: 1px solid var(--m-outline); color: var(--m-on-surface); padding: 0; }
.chips button[aria-pressed="true"] { background: var(--m-primary); color: var(--m-on-primary); border-color: var(--m-primary); }
button.tick { border-radius: 8px; background: transparent; border: 1px solid var(--m-outline); color: var(--m-on-surface); }
button.tick.on { background: var(--m-secondary-container); color: var(--m-on-secondary-container); border-color: transparent; }
.stepper button { border-radius: 999px; background: transparent; border: 1px solid var(--m-outline); color: var(--m-on-surface); }
.quick button { border-radius: 8px; background: transparent; border: 1px solid var(--m-outline); }
button.choice, button.pack, button.paym, .order button { background: var(--m-surface-low); border: 1px solid var(--m-outline-variant); border-radius: 16px; color: var(--m-on-surface); }
button.choice[aria-pressed="true"], button.pack[aria-pressed="true"], .order button[aria-pressed="true"], button.paym[aria-checked="true"] {
  background: var(--m-secondary-container); border: 2px solid var(--m-primary); color: var(--m-on-secondary-container); }
button.choice[aria-pressed="true"] .choice-ic { background: var(--m-primary); color: var(--m-on-primary); }
.choice-ic { background: var(--m-surface-high); color: var(--m-primary); border-radius: 12px; }
button.paym .radio { border-color: var(--m-on-surface-variant); }
button.paym[aria-checked="true"] .radio { border-color: var(--m-primary); }
.actions button { border-radius: 16px; background: var(--m-surface-low); border: 1px solid var(--m-outline-variant); color: var(--m-on-surface); }
.actions button.primary { background: var(--m-primary-container); color: var(--m-on-primary-container); border-color: transparent; }

/* text fields: outlined, 4px corners, 56px, 2px primary on focus */
input, textarea, select { border-radius: 4px; border: 1px solid var(--m-outline); background: transparent; color: var(--m-on-surface); min-height: 56px; padding: 16px; }
input[type=checkbox] { min-height: 0; accent-color: var(--m-primary); }
input:focus, textarea:focus, select:focus { outline: none; border: 2px solid var(--m-primary); padding: 15px; }
button:focus-visible { outline: 2px solid var(--m-primary); outline-offset: 2px; }
.searchbox { border-radius: 999px; background: var(--m-surface-high); border: 0; min-height: 56px; padding: 0 16px; }
.searchbox input { min-height: 0; border: 0; padding: 12px 0; }
.searchbox input:focus { border: 0; padding: 12px 0; }
.fast input, .codebox { border-radius: 4px; }
.essay-in, .person.erow input { min-height: 48px; }

/* switch: M3 track 52x32, thumb grows when on */
.switch { width: 52px; height: 32px; min-height: 32px; border-radius: 999px; background: var(--m-surface-highest); border: 2px solid var(--m-outline); padding: 0; }
.switch::after { top: 6px; left: 6px; width: 16px; height: 16px; background: var(--m-outline); box-shadow: none; transition: all .2s; }
.switch[aria-checked="true"] { background: var(--m-primary); border-color: var(--m-primary); }
.switch[aria-checked="true"]::after { top: 2px; left: 2px; width: 24px; height: 24px; transform: translateX(20px); background: var(--m-on-primary); }

/* progress: 4px linear, track = secondary container */
.pbar { height: 4px; border-radius: 2px; background: var(--m-secondary-container); }
.pbar span { border-radius: 2px; background: var(--m-primary); }
.pring { background: conic-gradient(var(--m-primary) calc(var(--p) * 1%), var(--m-secondary-container) 0); }
.pring span { background: var(--m-surface-low); }

/* navigation bar: 80px, active indicator pill behind the icon, FAB in the middle */
.nav { background: var(--m-surface-container); border-top: 0; min-height: 80px; }
.nav button { min-height: 80px; gap: 4px; font-size: 12px; font-weight: 500; color: var(--m-on-surface-variant); }
.nav button.on { color: var(--m-on-surface); font-weight: 600; }
.nav button.on::before { display: none; }
.nav .ind { width: 64px; height: 32px; border-radius: 16px; display: grid; place-items: center; }
.nav button.on .ind { background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
.nav button.nav-add { color: var(--m-on-surface-variant); font-weight: 500; }
.nav-add .add-circle { width: 56px; height: 56px; border-radius: 16px; margin-top: -24px; border: 0;
  background: var(--m-primary-container); color: var(--m-on-primary-container); box-shadow: var(--elev3); }
main { padding-bottom: 112px; }

/* bottom sheet, snackbar, footer */
.sheet { background: var(--m-surface-low); border-radius: 28px 28px 0 0; }
.sheet .grip { width: 32px; height: 4px; background: color-mix(in srgb, var(--m-on-surface-variant) 40%, transparent); }
.sheet .nums div { background: var(--m-surface-container); border-radius: 12px; }
.sheet .nums div.warn { background: var(--warn-soft); }
#toast { background: var(--m-inverse-surface); color: var(--m-inverse-on-surface); border-radius: 4px; left: 16px; right: 16px; transform: none;
  max-width: none; bottom: 96px; padding: 14px 16px; font-size: 14px; box-shadow: var(--elev3); }
.footer { background: var(--m-surface-container); border-top: 0; box-shadow: none; }
.viewas { border-radius: 12px; }
.viewas button { background: var(--m-surface-lowest); }

/* lists */
.person { border-top-color: var(--m-outline-variant); }
details.sect > summary .step { background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
.fchips { gap: 8px; }
.wgrid button { border-radius: 8px; }
.wgrid button.ok { background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
.qmap span { background: var(--m-secondary-container); }
.qmap span.on { background: var(--m-primary); }
.nav button { padding: 0 4px; white-space: nowrap; }
.actions button { padding: 0 10px; white-space: nowrap; }
.chips button, .stepper button { padding: 0; }

/* Telegram full screen (Bot API 8.0): the phone's status bar and Telegram's own Close / ⋯ buttons sit over the page.
   telegram-web-app.js publishes their sizes as CSS variables; keep content below and above them. */
:root {
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));
}
main { padding-top: calc(16px + var(--safe-top)); padding-bottom: calc(112px + var(--safe-bottom)); }
main:has(.paybar) { padding-bottom: calc(190px + var(--safe-bottom)); }
.entry-head, .ans-head { top: var(--safe-top); }
.nav { padding-bottom: var(--safe-bottom); }
.footer { padding-bottom: calc(12px + var(--safe-bottom)); }
.sheet { padding-bottom: calc(16px + var(--safe-bottom)); max-height: calc(92vh - var(--safe-top)); }
#toast { bottom: calc(96px + var(--safe-bottom)); }
.sheetpics img.big { top: calc(8px + var(--safe-top)); height: calc(100vh - 16px - var(--safe-top)); }

/* bulk-upload queue rows: name on the first line at full width; status and buttons on a second line under it */
.jobs .person { flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 6px; }
.jobs .person > .grow { flex: 1 1 calc(100% - 64px); min-width: 0; }
.jobs .nm { overflow-wrap: anywhere; }
.jobs .jacts { flex: 1 1 100%; box-sizing: border-box; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jobs .jacts button { flex: none; }
.jobs .jacts button.icon-btn.danger { color: var(--m-error); }

/* =====================================================================
   «Varaq va siyoh» component pass (2026-11-19): one shape scale, cards that stand off the paper, headings with weight,
   the deep block with a ruler edge. Later than the Material 3 layer on purpose: it restates only what changed.
   ===================================================================== */
body { letter-spacing: 0; }
h1 { font: 700 26px/1.15 var(--font-display); letter-spacing: -.02em; margin: 6px 0 14px; }
.sect-head h1 { font: 700 20px/1.2 var(--font-display); letter-spacing: -.01em; }
h2 { font-family: inherit; font-weight: 650; font-size: 17px; line-height: 1.3; }
h3 { font: 600 14px/20px inherit; font-family: inherit; text-transform: none; letter-spacing: 0; color: var(--muted); margin: 22px 4px 8px; }
.brand-name { font-weight: 700; letter-spacing: -.02em; }
.limit-hero .v, .rhero .big { font-weight: 700; letter-spacing: -.02em; }
.sheet h2, .done-hero h1, .entry-head .who { font-family: var(--font-display); font-weight: 700; }

/* shape scale: deep block 22, card 18, control 12, chip 8 */
.card, .tile, .tcard, details.sect { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
button { border-radius: 12px; min-height: 44px; padding: 0 18px; font-weight: 600; font-size: 15px; letter-spacing: 0; }
button.block { min-height: 50px; }
button.small { border-radius: 10px; min-height: 38px; padding: 0 14px; font-size: 14px; }
button.ghost { padding: 0 10px; }
button.icon-btn { border-radius: 12px; }
button:active:not(:disabled) { transform: scale(.985); }
button { transition: background-color .15s, box-shadow .15s, color .15s, transform .08s ease; }
button.choice, button.pack, button.paym, .order button, .actions button { border-radius: 14px; }
.stepper button { border-radius: 12px; }
.chips button, button.tick, .quick button, button.fchip { border-radius: 10px; }
button.fchip { min-height: 36px; }

/* text fields: white, 12px corners, the edge still 3:1 against the card */
input, textarea, select { border-radius: 12px; min-height: 50px; padding: 13px 14px; background: var(--field); }
input:focus, textarea:focus, select:focus { padding: 12px 13px; }
input[type=checkbox] { min-height: 0; padding: 0; }
.searchbox { border-radius: 12px; min-height: 48px; background: var(--field); border: 1px solid var(--line); padding: 0 14px; }
.searchbox input, .searchbox input:focus { min-height: 0; padding: 11px 0; }
.fast input, .codebox { border-radius: 12px; }

/* the deep block (limit, test code, invitation, result): one per screen. Its lower edge is a ruler: this is a
   measuring tool, and the Rasch score is a point on a scale. */
.limit-hero, .share, .rhero { border-radius: 22px; position: relative; overflow: hidden; padding-bottom: 28px; }
.limit-hero::after, .share::after, .rhero::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 10px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--hero-num) 0 1.5px, transparent 1.5px 40px) bottom / auto 10px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .34) 0 1px, transparent 1px 8px) bottom / auto 5px no-repeat; }
.limit-hero .v, .rhero .big, .share .big { color: var(--hero-num); }
.limit-hero button, .share .acts button { background: var(--hero-btn); color: var(--hero-btn-ink); }
.share .acts button.secondary { background: transparent; color: var(--ink-text); border: 1px solid rgba(255, 255, 255, .34); }
.share .big button { color: var(--ink-text); border-color: rgba(255, 255, 255, .34); }
.brand-mark .icon { color: var(--hero-num); }
.saved-cell { background: var(--m-surface); }
.saved-cell.lead { background: var(--m-secondary-container); }
.saved-cell.lead b { color: var(--m-on-secondary-container); }
.sheet .nums div { background: var(--m-surface); }

/* chips and badges: quiet by default, colour only for a state */
.chip { background: var(--m-surface-high); color: var(--text); font-weight: 550; }
.chip.plain { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.chip.ok, .badge.open { background: var(--m-secondary-container); color: var(--m-on-secondary-container); }
.badge { font-weight: 600; }

/* segmented control: a track with the chosen part lifted */
.seg { background: var(--m-surface-high); border: 0; border-radius: 12px; padding: 3px; gap: 3px; overflow: visible; }
.seg button { border-radius: 9px; min-height: 38px; color: var(--muted); font-weight: 600; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 2px rgba(21, 33, 28, .14); }
.seg button.on::before { content: none; }

/* which questions were wrong: marked like a teacher's pen, not a block of red */
.wgrid button.ok { background: var(--m-surface-high); color: var(--muted); }
.wgrid button.bad, :root[data-theme="dark"] .wgrid button.bad { background: var(--danger-soft); color: var(--danger); font-weight: 700;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 40%, transparent); }

/* bars that stay on screen: paper white with a hairline, not a tinted slab */
.nav { background: var(--m-surface-lowest); border-top: 1px solid var(--line); min-height: 72px; }
.nav button { min-height: 72px; }
.nav button.on { color: var(--m-primary); }
.nav-add .add-circle { border-radius: 18px; background: var(--btn); color: var(--btn-text); box-shadow: var(--fab-shadow); }
.footer { background: var(--m-surface-lowest); border-top: 1px solid var(--line); }
.ans-head, .entry-head { background: var(--m-surface-lowest); border-bottom: 1px solid var(--line); }
#toast { border-radius: 12px; }
main { padding-bottom: calc(104px + var(--safe-bottom)); }

/* the filled action keeps one emerald in both themes (in dark the light mint is for text and icons, not for slabs) */
button.primary, .chips button[aria-pressed="true"], button.choice[aria-pressed="true"] .choice-ic { background: var(--btn); color: var(--btn-text); }
.chips button[aria-pressed="true"] { border-color: var(--btn); }
button.primary:disabled { background: color-mix(in srgb, var(--m-on-surface) 12%, transparent); color: color-mix(in srgb, var(--m-on-surface) 38%, transparent); }

/* a card inside a section is only a group: no second frame */
details.sect .body > .card, .card > .card { border: 0; box-shadow: none; background: transparent; padding-left: 0; padding-right: 0; margin-bottom: 0; }
/* a bin on every row: quiet until it is needed */
.person > button.danger { color: var(--muted); }


/* buy screen: six packs in two even rows; a price never breaks in the middle of a number, the old price sits under the new one */
.packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 359px) { .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
button.pack { padding: 12px 10px; }
button.pack span { white-space: nowrap; }
button.pack .sum { display: flex; flex-direction: column; font-size: 13.5px; }
button.pack s.was { font-size: 12.5px; }

/* buy: with one way to pay there is nothing to choose, only a quiet line under the button */
.pay-hint { text-align: center; font-size: 12.5px; color: var(--muted); }
.paybar .muted { align-items: baseline; }
main:has(.pay-hint) { padding-bottom: calc(212px + var(--safe-bottom)); }

/* payment received: one orchestrated moment (the ring pops, the tick is drawn, a burst of paper), then stillness */
.paid { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 8px 18px; }
.paid h1 { margin: 12px 0 0; font-size: 30px; }
.paid-sub { margin: 0; color: var(--muted); font-size: 16px; }
.paid-mark { position: relative; width: 96px; height: 96px; }
.paid-ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--m-primary-container); color: var(--hero-num);
  animation: paid-pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.paid-ring .icon { width: 46px; height: 46px; stroke-width: 2.4; }
.paid-ring .icon path { stroke-dasharray: 21; stroke-dashoffset: 21; animation: paid-draw .4s .28s ease-out forwards; }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i { position: absolute; left: 50%; top: 50%; width: 9px; height: 4px; border-radius: 1px; background: var(--c); opacity: 0;
  animation: paid-fly .95s var(--t) cubic-bezier(.15, .8, .3, 1) forwards; }
@keyframes paid-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes paid-draw { to { stroke-dashoffset: 0; } }
@keyframes paid-fly {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--a)) translateX(34px) scale(.5); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateX(var(--d)) scale(1); } }
@media (prefers-reduced-motion: reduce) { .burst { display: none; } .paid-ring { animation: none; } .paid-ring .icon path { animation: none; stroke-dashoffset: 0; } }
.paid-save { text-align: center; justify-items: center; }
.paid-save .big { font-size: 48px; }
.balance-row b { font-size: 18px; font-variant-numeric: tabular-nums; }


/* role cards: text starts at the same edge whatever its length (a short description used to sit centred) */
.role-card { justify-content: flex-start; }

/* payment history: a sheet opened from the receipt button by the title */
.sheet .hist { max-height: 52vh; overflow-y: auto; }
.row > button.icon-btn { flex: none; background: var(--m-surface-high); color: var(--text); }

button[hidden] { display: none; }      /* a button is a flex box here, which would otherwise outrank the hidden attribute */
button.pack.other { align-items: center; justify-content: center; gap: 6px; color: var(--muted); border-style: dashed; text-align: center; }
button.pack.other span { white-space: normal; font-size: 13px; font-weight: 600; color: var(--muted); }

@media (max-width: 380px) { button.pack { padding: 12px 8px; } button.pack .sum { font-size: 12.5px; } button.pack span { font-size: 12px; } }

/* price list: the range on the left, its price on the right, each on one line */
.tier { justify-content: space-between; gap: 4px 10px; font-size: 14px; padding: 7px 8px; }
.tier b, .tier .tp { white-space: nowrap; }
.tier .tp { margin-left: auto; text-align: right; }

/* messages sit above every fixed bar and sheet; where exactly is set when one is shown (see toast()) */
#toast { z-index: 40; }

/* buy: the part the balance pays, on its own line of the summary */
.paybar .muted { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.paybar .muted > :nth-child(even) { text-align: right; }
.paybar .from-bal { color: var(--m-primary); font-weight: 600; }
.pay-hint[hidden] { display: none; }

/* owner's books: the profit figure is money, not a code: no letter-spacing; a loss is marked */
.share .big.money { letter-spacing: 0; font-family: var(--font-display); justify-content: flex-start; }
.share .big.money.minus span { color: var(--hero-num); text-decoration: underline wavy; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.tier.loss b { color: var(--danger); }

/* a student's ball from test to test */
.pchart { display: block; width: 100%; height: auto; margin: 4px 0 2px; color: var(--primary); }
.pchart .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pchart .dot { fill: currentColor; }
.pchart .axis { stroke: var(--line); stroke-width: 1; }
.pchart .val { fill: var(--text); font: 600 12px var(--font-display); font-variant-numeric: tabular-nums; }
.pres { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.pres b { font-variant-numeric: tabular-nums; }

/* Full-width buttons used to touch the button or the card under them (owner's screenshot, 2026-11-19: the PDF and
   AI buttons of a closed test glued together). A gap after every one of them. */
button.block + button.block, button.block + .card, button.block + details.sect, button.block + div:not(.footer) { margin-top: 10px; }

/* ---------- audit 2026-11-19: what did not fit a 360-390 px phone ---------- */
/* a hidden clock stays hidden (its display rule used to win over the attribute) */
.ans-head .clock[hidden] { display: none; }
/* three action tiles: the icon over the label, the label may wrap */
.actions.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.actions.three button { flex-direction: column; min-height: 72px; gap: 6px; padding: 10px 6px; font-size: 13px; line-height: 1.2;
  white-space: normal; text-align: center; overflow-wrap: anywhere; }
/* results: fits without scrolling sideways; the grade sits with the ball */
table.res { font-size: 14px; }
table.res th, table.res td { padding: 8px 4px; }
table.res th:first-child, table.res td:first-child { padding-left: 0; }
table.res td.nm { overflow-wrap: anywhere; }
table.res td.ball { white-space: nowrap; padding-right: 0; }
table.res th:last-child { padding-right: 0; }
table.res td.ball .chip { margin-left: 6px; vertical-align: 1px; }
table.res.essay td.ball .chip { display: block; width: max-content; margin: 3px 0 0 auto; }
.istat { grid-template-columns: 34px 1fr 76px; }
/* a long name keeps its line: the button next to it drops below */
.person.wraps { flex-wrap: wrap; }
.person.wraps .grow { flex: 1 1 150px; }
/* label and value: the label column cannot push the values into three lines */
.kv { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); }
.kv dt { overflow-wrap: anywhere; }
/* a value that does not fit beside its label drops under it on the right, like the ones that fit */
.tier { gap: 4px 12px; }
.tier > b:last-child, .tier > .tp { margin-left: auto; text-align: right; }
/* limit packs: two columns when three do not hold the sums */
@media (max-width: 370px) { .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the discount pill is one line, under the number, across the block */
.limit-hero { flex-wrap: wrap; }
.limit-hero .grow .promo { white-space: nowrap; }
/* a long name takes two lines instead of ending in dots */
.hero .who b { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; line-height: 1.2; }
/* quantity and price of the card-only screen: a row, as in the payment bar */
.buy-sum { margin-top: 8px; }
.buy-sum .muted { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; color: var(--text); font-size: 14px; }
.buy-sum .muted > :nth-child(even) { text-align: right; }
details.topup .body ol { margin-top: 0; }
/* texts that touched what follows them */
.stepper + .muted { margin-top: 8px; }
.actions + .field-hint { margin: -4px 4px 12px; }
.result .ring { font-size: 17px; }
div.person > .avatar + .grow .tm { overflow-wrap: anywhere; }
.chips.stack { display: grid; grid-template-columns: 1fr; }
.saved-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.analysis { overflow-wrap: anywhere; }

