/* Nityabhyas — one stylesheet. Colours, type and hover follow the "Rising Bars" logo kit:
   Indigo #1E2A5A, Saffron #F2A93B, Cream #FBF6EC, Deep saffron #A8520F, Night #11172E.
   Light + dark (Night) themes; question sheets always stay on paper-light. */
@font-face { font-family: 'Baloo 2'; src: url(../fonts/baloo2-latin.woff2) format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(../fonts/fraunces-latin.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(../fonts/nunito-latin.woff2) format('woff2'); font-weight: 200 1000; font-display: swap; }

:root {
  color-scheme: light;
  /* logo kit */
  --indigo: #1E2A5A; --saffron: #F2A93B; --cream: #FBF6EC; --deep-saffron: #A8520F; --night: #11172E;
  /* surfaces + text */
  --bg: #F4EFE6; --card: #FFFFFF; --soft: #FBF6EC; --field: #FFFFFF; --line: #E6DECF;
  --ink: #1E2A5A; --muted: #5E566B; --label: #6B5A45;
  /* actions */
  --brand: #1E2A5A; --brand-hover: #2C3C7A; --on-brand: #FFFFFF;
  --link: #A8520F; --link-hover: #7A3B0B;
  --c: #1E2A5A; --c-ink: var(--c);
  /* states */
  --good: #1C9258; --good-soft: #DDF3E6; --bad: #D14343; --bad-soft: #FBE3E3; --sun: #F2A93B; --warn: #F2A93B;
  --mid-soft: #FDEBC8; --mid-ink: #8A4B0A; --notice: #FDEBC8; --badge-bg: #E8EBF5; --badge-ink: #1E2A5A;
  --shadow: 0 1px 0 rgba(30,42,90,.05), 0 6px 18px rgba(30,42,90,.08);
  --shadow-hover: 0 12px 28px rgba(30,42,90,.18);
  --r: 20px;
  --display: 'Baloo 2', ui-rounded, 'Nunito', system-ui, sans-serif;
  --brandface: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
/* Night theme: follows the tablet's setting, or the choice in Backup & settings */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11172E; --card: #1A2242; --soft: #222B50; --field: #141B36; --line: #2F3A68;
    --ink: #FBF6EC; --muted: #B8B2C6; --label: #D9C7A6;
    --brand: #F2A93B; --brand-hover: #F6BE63; --on-brand: #11172E;
    --link: #F2A93B; --link-hover: #F6BE63;
    --good: #5BD39A; --good-soft: #163B2C; --bad: #FF8A8A; --bad-soft: #43202B;
    --mid-soft: #3E3016; --mid-ink: #F6C66F; --notice: #3E3016; --badge-bg: #2A3563; --badge-ink: #FBF6EC;
    --shadow: 0 1px 0 rgba(0,0,0,.25), 0 6px 18px rgba(0,0,0,.3);
    --shadow-hover: 0 12px 28px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11172E; --card: #1A2242; --soft: #222B50; --field: #141B36; --line: #2F3A68;
  --ink: #FBF6EC; --muted: #B8B2C6; --label: #D9C7A6;
  --brand: #F2A93B; --brand-hover: #F6BE63; --on-brand: #11172E;
  --link: #F2A93B; --link-hover: #F6BE63;
  --good: #5BD39A; --good-soft: #163B2C; --bad: #FF8A8A; --bad-soft: #43202B;
  --mid-soft: #3E3016; --mid-ink: #F6C66F; --notice: #3E3016; --badge-bg: #2A3563; --badge-ink: #FBF6EC;
  --shadow: 0 1px 0 rgba(0,0,0,.25), 0 6px 18px rgba(0,0,0,.3);
  --shadow-hover: 0 12px 28px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; }
code { background: var(--soft); border-radius: 6px; padding: 1px 5px; font-size: .92em; }
[hidden] { display: none !important; }
/* Set colours are also used for text. Darken them so light colours (like saffron) stay readable. */
@supports (color: color-mix(in srgb, red, blue)) {
  * { --c-ink: color-mix(in srgb, var(--c) 62%, #3a1e00); }
  :root[data-theme="dark"] * { --c-ink: color-mix(in srgb, var(--c) 55%, #FBF6EC); }
}
@media (prefers-color-scheme: dark) { @supports (color: color-mix(in srgb, red, blue)) {
  :root:not([data-theme="light"]) * { --c-ink: color-mix(in srgb, var(--c) 55%, #FBF6EC); }
} }

.wrap { max-width: 980px; margin: 0 auto; padding-inline: 16px; padding-block: 14px 56px; display: flex; flex-direction: column; gap: 16px; }
.wrap.narrow { max-width: 520px; }
.center-page { text-align: center; align-items: center; justify-content: center; min-height: 80vh; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.display { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 5vw, 42px); }
.h1 { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 4vw, 32px); }
.h2 { font-family: var(--display); font-weight: 800; font-size: 22px; }
.lead { font-size: 18px; color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: 14px; }
.err { color: var(--bad); font-weight: 700; min-height: 1.2em; margin: 0; }
.notice { background: #FFF6DB; border-radius: 12px; padding: 10px 14px; margin: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 11px 18px; font-weight: 800; background: var(--brand); color: #fff; text-decoration: none; min-height: 44px; transition: background .12s; }
.btn:not(.ghost):not(.danger):not(:disabled):hover { background: var(--brand-hover); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 14px; border-radius: 11px; }
.btn.big { font-size: 19px; padding: 14px 26px; min-height: 56px; border-radius: 16px; }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
.danger-text { color: var(--bad) !important; }
.icon-btn { border: 0; background: var(--soft); border-radius: 10px; width: 36px; height: 36px; font-weight: 800; }
.icon-btn:disabled { opacity: .35; }

/* ---------- top bar & brand ---------- */
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar > :last-child { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 20px; }
.logo { width: 38px; height: 38px; display: inline-block; flex: 0 0 auto; }
.logo .logo-svg { width: 100%; height: 100%; display: block; }
.logo.big { width: 96px; height: 96px; filter: drop-shadow(0 10px 22px rgba(30,42,90,.2)); }
.tagline { margin: -6px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #A8520F; }
.whoami { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.avatar { font-family: var(--emoji); font-size: 44px; line-height: 1; }
.avatar.sm { font-size: 26px; }

/* ---------- home: children ---------- */
.kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.kids.small { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kid { background: var(--card); border-radius: 24px; padding: 22px 12px; text-align: center; text-decoration: none; box-shadow: var(--shadow); border-bottom: 8px solid var(--c); display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform .12s; }
.kid:hover { transform: translateY(-3px); }
.kid .avatar { font-size: 64px; }
.kid .name { font-family: var(--display); font-weight: 800; font-size: 24px; }

/* ---------- set cards ---------- */
.sets, .parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.set-card, .part-card { background: var(--card); border: 0; border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); border-top: 8px solid var(--c); display: flex; flex-direction: column; gap: 6px; text-align: left; text-decoration: none; transition: transform .12s; min-height: 132px; }
.set-card:hover, .part-card:hover { transform: translateY(-2px); }
.set-title { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--c-ink); line-height: 1.1; }
.set-meta { color: var(--muted); font-weight: 700; font-size: 14px; }
.set-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); font-weight: 700; }
.part-card .go { margin-top: auto; align-self: flex-start; background: var(--brand); color: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 800; }
.part-card.all { --c: var(--ink); border-top-style: dashed; }
.pill { background: var(--soft); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 13px; }
.pill.hi { background: var(--good-soft); color: var(--good); } .pill.mid { background: #FFF1D6; color: #9A5B10; } .pill.lo { background: var(--bad-soft); color: var(--bad); }
.mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; }
.mode-opt:has(input:checked) { box-shadow: inset 0 0 0 3px var(--c); }
.mode-opt input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--c); }
.mode-opt span { display: flex; flex-direction: column; } .mode-opt small { color: var(--muted); font-size: 14px; }

/* ---------- player ---------- */
.play { gap: 12px; }
.sectag { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--c-ink); }
.count { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 5px; }
.dot { flex: 1; min-width: 6px; height: 10px; border-radius: 6px; background: var(--line); }
.dot.cur { background: var(--c); } .dot.ok { background: var(--good); } .dot.no { background: var(--bad); } .dot.done { background: var(--muted); }
.dots.dense { gap: 1px; } .dots.dense .dot { min-width: 0; border-radius: 2px; }
.prompt-card { background: var(--card); border-radius: var(--r); padding: 12px 16px; box-shadow: var(--shadow); }
.part-label { font-weight: 800; color: var(--c-ink); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.prompt-row { display: flex; gap: 12px; align-items: center; }
.prompt { flex: 1; margin: 0; font-size: 20px; font-weight: 700; }
.prompt.sm { font-size: 16px; }
.speak { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 16px; border: 0; background: var(--brand); color: #fff; font-size: 24px; font-family: var(--emoji); }
.sheet { background: #fff; border-radius: 22px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.stim { display: flex; justify-content: center; overflow-x: auto; }
.answer-area { border-top: 3px dashed var(--line); padding-top: 14px; }
.stim:empty + .answer-area, .sheet > .answer-area:first-child { border-top: 0; padding-top: 0; }

.choices { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.choice { position: relative; background: var(--soft); border: 4px solid transparent; border-radius: 20px; padding: 10px 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 124px; min-height: 124px; justify-content: center; transition: transform .1s, border-color .1s; }
.choice:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--line); }
.choice:disabled { cursor: default; }
.choice .pic { min-height: 80px; display: flex; align-items: center; justify-content: center; }
.choice .let { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #6A7593; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #4A5573; }
.choice .mark:empty { display: none; }
.choice .mark { position: absolute; top: -12px; right: -10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; }
.choice.right { border-color: var(--good); background: #E3F5EA; } .choice.right .let { background: var(--good); border-color: var(--good); color: #fff; } .choice.right .mark { background: var(--good); }
.choice.wrong { border-color: var(--bad); background: #FCE6E6; } .choice.wrong .let { background: var(--bad); border-color: var(--bad); color: #fff; } .choice.wrong .mark { background: var(--bad); }
.choice.picked { border-color: var(--ink); } .choice.picked .let { background: var(--ink); color: #fff; border-color: var(--ink); }
.choice.dim { opacity: .45; }

.feedback { border-radius: 20px; padding: 16px 18px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; animation: pop .25s ease-out; }
.feedback.ok { background: var(--good-soft); } .feedback.no { background: var(--bad-soft); } .feedback.neutral { background: var(--card); box-shadow: var(--shadow); }
.feedback .msg { flex: 1 1 260px; }
.feedback h2 { font-family: var(--display); font-weight: 800; font-size: 26px; }
.feedback.ok h2 { color: var(--good); } .feedback.no h2 { color: var(--bad); }
.why { margin: 4px 0 0; font-size: 18px; }
.btn.next { background: var(--brand); }
@keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }

/* number pad */
.numpad-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.numdisplay { min-width: 180px; height: 70px; border-radius: 16px; border: 4px solid var(--line); background: var(--soft); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 44px; font-variant-numeric: tabular-nums; }
.numdisplay .caret { width: 3px; height: 40px; background: var(--c); margin-left: 3px; animation: blink 1s steps(1) infinite; }
.numdisplay.right { border-color: var(--good); background: #E3F5EA; } .numdisplay.wrong { border-color: var(--bad); background: #FCE6E6; } .numdisplay.picked { border-color: var(--ink); }
@keyframes blink { 50% { opacity: 0; } }
.numpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.numpad .key { height: 64px; border: 0; border-radius: 16px; background: var(--soft); font-family: var(--display); font-weight: 800; font-size: 28px; box-shadow: inset 0 -3px 0 var(--line); }
.numpad .key.ok { background: var(--brand); color: #fff; font-size: 22px; box-shadow: none; }
.numpad .key.back { font-size: 22px; }
.numpad .key:disabled { opacity: .4; }
.numpad.pin { grid-template-columns: repeat(3, 72px); }
.pin-dots { display: flex; gap: 14px; justify-content: center; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ink); }
.pin-dots span.on { background: var(--ink); }
.lock { font-size: 48px; font-family: var(--emoji); }

/* results */
.result { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.stars { font-size: 46px; letter-spacing: 6px; color: #D6DCE8; line-height: 1; }
.stars .on { color: var(--sun); }
.score { font-family: var(--display); font-weight: 800; font-size: 64px; color: var(--c-ink); line-height: 1; }
.review { display: flex; flex-direction: column; gap: 10px; }
.rv { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow); }
.rv .ic { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; }
.rv.ok .ic { background: var(--good); } .rv.no .ic { background: var(--bad); }
.rv-part { color: var(--muted); font-size: 13px; font-weight: 800; }
.rv-q { font-weight: 700; } .rv-a { font-size: 15px; }

/* ---------- visuals (question pictures) ---------- */
.vemoji { font-family: var(--emoji); font-size: 56px; line-height: 1; }
.vtext { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.1; text-align: center; }
.vcount { display: grid; grid-template-columns: repeat(var(--cols), auto); gap: 2px; justify-content: center; font-family: var(--emoji); font-size: 24px; line-height: 1.1; }
.vis-svg { width: 84px; height: 84px; display: block; }
.vis-abacus { height: 130px; width: calc(var(--w) * 130px / 150); max-width: 100%; }
.choice .vis-abacus { height: 104px; }
.vimg { max-width: 220px; max-height: 180px; border-radius: 10px; }
.vcell { border: 2px solid var(--line); border-radius: 12px; padding: 4px; min-width: 80px; min-height: 80px; display: flex; align-items: center; justify-content: center; background: #fff; }
.vq { border: 3px dashed var(--bad); border-radius: 12px; color: var(--bad); font-size: 36px; font-weight: 800; font-family: var(--display); width: 80px; height: 80px; display: grid; place-items: center; flex: 0 0 auto; }
.varrow, .vop { font-size: 28px; color: #6A7593; font-weight: 800; }
.vrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.vanalogy { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.vpair { display: flex; align-items: center; gap: 6px; border: 2px solid #9AA5BD; border-radius: 14px; padding: 6px; background: var(--soft); }
.vtogether { border: 2px solid #9AA5BD; border-radius: 14px; padding: 6px 10px; background: var(--soft); text-align: center; }
.vlabel { font-size: 11px; color: #6A7593; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; font-weight: 800; }
.vmatrix { display: grid; grid-template-columns: 96px 96px; gap: 6px; padding: 6px; border: 2px solid #9AA5BD; border-radius: 14px; background: var(--soft); }
.vmatrix .vcell, .vmatrix .vq { width: 96px; height: 92px; }
.vbalance { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.vtray { display: flex; align-items: center; gap: 6px; border: 3px solid #9AA5BD; border-radius: 40px; padding: 8px 16px; background: var(--soft); min-height: 84px; }
.vtray .vq { width: 60px; height: 60px; }
.veq { font-size: 34px; font-weight: 800; } .veq.sm { font-size: 26px; }

/* ---------- grown-up area ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); }
.tab { padding: 10px 14px; font-weight: 800; text-decoration: none; color: var(--muted); border-bottom: 4px solid transparent; margin-bottom: -2px; }
.tab.on { color: var(--ink); border-color: var(--ink); }
.card { background: var(--card); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.card.sec, .card.form { border-left: 6px solid var(--c); }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-left: 6px solid var(--c, var(--line)); }
.li-main { flex: 1 1 220px; min-width: 0; }
.li-title { font-weight: 800; font-size: 17px; }
.li-meta { color: var(--muted); font-size: 14px; }
.li-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; background: #E6EEFB; color: #2D5BA8; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 800; vertical-align: middle; font-family: var(--body); }
.badge.muted { background: var(--soft); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; }
.field small { font-weight: 600; color: var(--muted); }
.inp { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font-weight: 600; font-size: 16px; }
.inp:focus { border-color: var(--c); outline: none; }
.inp:disabled { background: var(--soft); }
.inp.num { max-width: 160px; font-size: 22px; font-weight: 800; }
textarea.inp { resize: vertical; }
.sec-title { max-width: 280px; font-family: var(--display); font-weight: 800; font-size: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--c); }
.checks { display: flex; flex-direction: column; gap: 6px; padding-left: 8px; }
.checks.disabled { opacity: .5; }
.swatches, .avatars { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }
.av { font-family: var(--emoji); font-size: 30px; width: 52px; height: 52px; border-radius: 14px; border: 0; background: var(--soft); }
.av.on { box-shadow: inset 0 0 0 3px var(--ink); background: #fff; }
.add-kid .inp { max-width: 320px; }
.q-list { display: flex; flex-direction: column; gap: 6px; }
.q-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--soft); flex-wrap: wrap; }
.q-num { font-weight: 800; color: var(--muted); width: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.q-main { flex: 1 1 220px; min-width: 0; }
.q-prompt { font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.q-meta { font-size: 13px; color: var(--muted); }
.q-actions { display: flex; gap: 4px; }

.modal-wrap { position: fixed; inset: 0; background: rgba(16,24,41,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border-radius: 20px; padding: 18px; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(980px, 100%); }
.modal p { margin: 0; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-form { display: flex; flex-direction: column; gap: 12px; }
.editor-preview { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 6px; }
.preview-box { background: var(--bg); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; zoom: .8; }
.preview-box .choice { min-width: 100px; min-height: 100px; }
.ed-block { border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.ed-block legend { font-weight: 800; font-size: 14px; padding: 0 4px; }
.ed-choice { display: flex; gap: 8px; align-items: center; }
.ed-pic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; background: var(--soft); border-radius: 12px; padding: 6px 10px; }
.radio { display: flex; align-items: center; gap: 4px; font-weight: 800; }
.radio input { width: 22px; height: 22px; accent-color: var(--good); }
details.tips { font-size: 14px; color: var(--muted); }
details.tips summary { cursor: pointer; font-weight: 800; }
textarea#imp-text { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat b { font-family: var(--display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-weight: 700; font-size: 14px; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td:first-child { white-space: normal; }
.table th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.table td { font-variant-numeric: tabular-nums; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 26px; vertical-align: middle; }
.spark i { width: 7px; border-radius: 2px; background: var(--muted); }
.spark i.hi { background: var(--good); } .spark i.mid { background: var(--warn); } .spark i.lo { background: var(--bad); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border-radius: 999px; padding: 6px 12px; font-weight: 700; background: var(--soft); }
.chip.lo { background: var(--bad-soft); } .chip.mid { background: #FFF1D6; }
.att summary { display: flex; gap: 12px; align-items: center; width: 100%; list-style: none; cursor: pointer; }
.att summary::-webkit-details-marker { display: none; }
.att { display: block; }
.att-detail { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.mini { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.mini.ok { background: var(--good); } .mini.no { background: var(--bad); }
.howto { margin: 0; padding-left: 20px; } .howto li { margin: 4px 0; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .vemoji { font-size: 44px; } .choice { min-width: 96px; min-height: 104px; padding: 8px; } .choices { gap: 10px; }
  .vcell { min-width: 64px; min-height: 64px; } .vis-svg { width: 66px; height: 66px; } .vq { width: 64px; height: 64px; }
  .vmatrix { grid-template-columns: 78px 78px; } .vmatrix .vcell, .vmatrix .vq { width: 78px; height: 74px; }
  .prompt { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


/* ================= Logo-kit polish: hover, buttons, cards, dark mode ================= */
a:not(.btn):not(.tab):not(.kid):not(.set-card):not(.part-card) { color: var(--link); }
a:not(.btn):not(.tab):not(.kid):not(.set-card):not(.part-card):hover { color: var(--link-hover); }

/* Buttons share the cards' shape language: same corner family, cream/indigo, one lift on hover */
.btn { background: var(--brand); color: var(--on-brand); border-radius: 14px; transition: background .15s, box-shadow .15s, transform .15s, color .15s; }
.btn:not(.ghost):not(.danger):not(:disabled):hover { background: var(--brand-hover); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--brand); background: var(--soft); }
.btn.danger { background: var(--bad); color: #fff; }
.icon-btn { background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s; }
.icon-btn:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.speak, .part-card .go, .numpad .key.ok { color: var(--on-brand); }
.speak { transition: background .15s, transform .15s; }
.speak:hover { background: var(--brand-hover); transform: translateY(-1px); }

/* Cards: kit style (white on warm ground, hairline cream border, soft indigo shadow, lift on hover) */
.card, .list-item, .kid, .set-card, .part-card, .prompt-card, .stat, .table-wrap, .rv, .tips, .mode-opt { box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.kid, .set-card, .part-card { transition: transform .15s, box-shadow .15s; }
.kid:hover, .set-card:hover, .part-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover), inset 0 0 0 1px var(--line); }
.part-card:hover .go { background: var(--brand-hover); }
.set-card:focus-visible, .part-card:focus-visible, .kid:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; }

/* Practice / Test mode picker = two small kit cards with a saffron check */
.mode-opt { background: var(--card); border-radius: 16px; transition: box-shadow .15s, background .15s; }
.mode-opt:hover { box-shadow: var(--shadow-hover), inset 0 0 0 1.5px var(--brand); }
.mode-opt:has(input:checked) { background: var(--soft); box-shadow: var(--shadow), inset 0 0 0 2.5px var(--brand); }
.mode-opt input { accent-color: var(--brand); }
.mode-opt b { font-size: 17px; }

/* Brand wordmark in the kit's display serif */
.brand > span:last-child, .center-page .display { font-family: var(--brandface); font-weight: 650; letter-spacing: -.01em; }
.tagline { color: var(--link); }
.tabs .tab:hover { color: var(--ink); }
.tab.on { border-color: var(--saffron); }

/* Token-driven surfaces (were fixed light colours) */
.inp, textarea#imp-text { background: var(--field); color: var(--ink); }
.notice { background: var(--notice); }
.badge { background: var(--badge-bg); color: var(--badge-ink); }
.badge.muted { background: var(--soft); color: var(--muted); }
.pill.mid, .chip.mid { background: var(--mid-soft); color: var(--mid-ink); }
.stars { color: var(--line); }
.swatch { border-color: var(--card); }
.av.on { background: var(--card); }
.part-card.all { --c: var(--ink); }
#toast { background: var(--brand); color: var(--on-brand); }
.feedback.neutral { background: var(--card); }
.modal-wrap { background: rgba(17,23,46,.55); }

/* The question sheet is always "paper": same look in light and dark, so pictures read the same */
.sheet, .preview-box, .ed-pic, .vis-card {
  --ink: #1E2A5A; --soft: #FBF6EC; --line: #E6DECF; --card: #FFFFFF; --field: #FFFFFF;
  --good: #1C9258; --good-soft: #DDF3E6; --bad: #D14343; --bad-soft: #FBE3E3; --brand: #1E2A5A; --on-brand: #FFFFFF; --brand-hover: #2C3C7A;
  color: var(--ink);
}
.sheet { background: #FFFFFF; box-shadow: var(--shadow), inset 0 0 0 1px #E6DECF; }
.preview-box { background: #F4EFE6; }
.choice { background: #FBF6EC; }
.choice:hover:not(:disabled) { border-color: #1E2A5A; box-shadow: 0 10px 22px rgba(30,42,90,.14); }
.vpair, .vtogether, .vmatrix, .vtray { border-color: #CFC4AE; background: #FBF6EC; }

/* Theme picker in settings */
.seg { display: inline-flex; background: var(--soft); border-radius: 14px; padding: 4px; box-shadow: inset 0 0 0 1px var(--line); gap: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 16px; border-radius: 10px; font-weight: 800; color: var(--muted); }
.seg input:checked + span { background: var(--brand); color: var(--on-brand); }
.seg input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 2px; }
.field .seg { align-self: flex-start; }

/* Buttons inside a coloured card take that card's colour (green card → green button, saffron → saffron) */
.part-card .go, .list-item .btn:not(.ghost):not(.danger), .card.sec .btn:not(.ghost):not(.danger), .card.form .btn:not(.ghost):not(.danger) {
  background: var(--c); color: var(--c-on, #fff);
}
.part-card:hover .go, .list-item .btn:not(.ghost):not(.danger):not(:disabled):hover, .card.sec .btn:not(.ghost):not(.danger):not(:disabled):hover, .card.form .btn:not(.ghost):not(.danger):not(:disabled):hover {
  background: var(--c); filter: brightness(.9) saturate(1.1);
}
.part-card.all .go { background: var(--brand); color: var(--on-brand); }

/* ================= 0.2: Subjects → Topics → Levels, and "Make a set for me" ================= */
.crumb { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink); margin-bottom: -8px; }
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.subject-tile { background: var(--card); border-radius: 24px; padding: 20px 18px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line); border-bottom: 8px solid var(--c); transition: transform .15s, box-shadow .15s; min-height: 170px; }
.subject-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover), inset 0 0 0 1px var(--line); }
.subj-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--c); color: var(--c-on, #fff); display: grid; place-items: center; font-size: 34px; font-family: var(--emoji); margin-bottom: 6px; }
.subj-icon.sm { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; margin: 0 0 4px; }
.subject-tile .set-title { font-size: 26px; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.level-card { background: var(--card); border-radius: 20px; padding: 16px 18px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; min-height: 140px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line); border-left: 8px solid var(--c); transition: transform .15s, box-shadow .15s; }
.level-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover), inset 0 0 0 1px var(--line); }
.level-card.next { box-shadow: var(--shadow), inset 0 0 0 2.5px var(--saffron); }
.lvl-num { align-self: flex-start; background: var(--c); color: var(--c-on, #fff); border-radius: 999px; padding: 2px 12px; font-weight: 800; font-size: 13px; }
.mini-stars { font-size: 20px; letter-spacing: 2px; color: var(--line); } .mini-stars .on { color: var(--saffron); } .mini-stars i { font-style: normal; }
.pill.up-next { background: var(--saffron); color: #1E2A5A; }

.chips.filter { gap: 8px; }
.chip-btn { border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 800; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.chip-btn b { margin-left: 4px; color: var(--muted); font-weight: 700; }
.chip-btn:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.chip-btn.on { background: var(--brand); color: var(--on-brand); box-shadow: none; } .chip-btn.on b { color: inherit; opacity: .8; }
.subj-group { display: flex; flex-direction: column; gap: 10px; }
.subj-h { font-family: var(--display); font-size: 24px; display: flex; align-items: center; gap: 8px; border-bottom: 3px solid var(--c); padding-bottom: 4px; }
.subj-h small { font-family: var(--body); font-size: 14px; color: var(--muted); font-weight: 700; margin-left: auto; }
.topic-group { display: flex; flex-direction: column; gap: 8px; }
.topic-h { font-size: 15px; font-weight: 800; color: var(--label); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.lvl-badge { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--c); color: var(--c-on, #fff); display: grid; place-items: center; font-weight: 800; }
.badge.fresh { background: var(--mid-soft); color: var(--mid-ink); }
.check-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.mini-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--label); min-width: 80px; }
.gen-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--soft); border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.subj-stat b { margin-top: 2px; }

.wizard { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .wizard { grid-template-columns: 1fr; } }
.wz-form { display: flex; flex-direction: column; gap: 14px; }
.wz-step { border: 0; margin: 0; padding: 14px 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 10px; }
.wz-step legend { float: left; width: 100%; font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 4px; }
.wz-step legend small { font-weight: 600; color: var(--muted); }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--saffron); color: #1E2A5A; display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.tiles-sm { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.tile-opt, .chip-opt { position: relative; cursor: pointer; }
.tile-opt input, .chip-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tile-opt span { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--soft); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--line); border-left: 6px solid var(--c); }
.tile-opt i { font-style: normal; font-family: var(--emoji); font-size: 22px; }
.tile-opt input:checked + span { background: var(--card); box-shadow: inset 0 0 0 2.5px var(--brand); }
.chip-opt span { display: inline-block; padding: 8px 12px; border-radius: 12px; background: var(--soft); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--line); }
.chip-opt input:checked + span { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.check-chip input:checked + span::before { content: '✓ '; }
.tile-opt input:focus-visible + span, .chip-opt input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 2px; }
.tile-opt:hover span, .chip-opt:hover span { box-shadow: inset 0 0 0 1.5px var(--brand); }
.wz-preview { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 10px); background: var(--card); border-radius: 20px; padding: 16px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 10px; }
.wz-preview p { margin: 0; }
.preview-list { display: flex; flex-direction: column; gap: 12px; }
.pv-q { display: flex; gap: 10px; background: #FFFFFF; color: #1E2A5A; border-radius: 16px; padding: 12px; box-shadow: inset 0 0 0 1px #E6DECF;
  --ink: #1E2A5A; --soft: #FBF6EC; --line: #E6DECF; --card: #FFFFFF; --good: #1C9258; --bad: #D14343; }
.pv-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: #1E2A5A; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.pv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pv-body .choice { min-width: 84px; min-height: 84px; padding: 6px; } .pv-body .choice .pic { min-height: 56px; }
.pv-body .vemoji { font-size: 38px; } .pv-body .vis-svg { width: 60px; height: 60px; } .pv-body .vcell { min-width: 60px; min-height: 60px; }
.pv-body .vq { width: 60px; height: 60px; font-size: 28px; }
.pv-body .vmatrix { grid-template-columns: 70px 70px; } .pv-body .vmatrix .vcell, .pv-body .vmatrix .vq { width: 70px; height: 66px; }
.pv-body .vis-abacus { height: 96px; } .pv-body .choice .vis-abacus { height: 72px; }
.why.sm { font-size: 14px; color: #5E566B; }
.num-ans { background: #FBF6EC; border-radius: 12px; padding: 8px 12px; font-size: 15px; }

/* new pictures */
.vword { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.vword .vw { font-family: var(--display); font-weight: 800; font-size: 18px; color: #1E2A5A; }
.vbase10 { display: flex; align-items: flex-end; gap: 10px; }
.vbase10 .rods { display: flex; gap: 4px; }
.vbase10 .rod { display: flex; flex-direction: column; gap: 1px; background: #1E2A5A; padding: 1px; border-radius: 3px; }
.vbase10 .rod i { width: 14px; height: 9px; background: #F2A93B; display: block; border-radius: 1px; }
.vbase10 .cubes { display: grid; grid-template-columns: repeat(3, 14px); gap: 3px; align-content: end; }
.vbase10 .cube { width: 14px; height: 14px; background: #2D6FD2; border-radius: 2px; display: block; }

/* ================= 0.2.1: Test timer and multi-part tests ================= */
.timer { font-weight: 800; font-variant-numeric: tabular-nums; background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 14px; box-shadow: inset 0 0 0 1.5px var(--line); margin-left: auto; }
.timer + .count { margin-left: 12px; }
.timer.warn { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.timer-tag { font-size: 12px; font-weight: 800; background: var(--mid-soft); color: var(--mid-ink); border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: middle; }
.skip-row { display: flex; justify-content: flex-end; }
.modal.center { text-align: center; align-items: center; }
.big-emoji { font-size: 56px; font-family: var(--emoji); line-height: 1; }
.time-line { margin: 0; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.inp.sm { padding: 6px 10px; font-size: 14px; width: auto; }
.inp.num-sm { width: 70px; }
.part-timer { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); font-size: 14px; }
.timer-row { gap: 10px; }
.parts-table { display: flex; flex-direction: column; gap: 6px; }
.pt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-radius: 12px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.pt-row.on { background: var(--card); box-shadow: inset 0 0 0 2px var(--brand); }
.pt-row .check { flex: 1 1 160px; }
.pt-num { font-size: 12px; font-weight: 800; color: var(--label); text-transform: uppercase; letter-spacing: .06em; }
.pv-part { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #A8520F; }
.pv-summary { font-size: 15px; }
.pv-parts { margin: 0; padding-left: 20px; font-size: 14px; }

.timer.over { background: var(--mid-soft); color: var(--mid-ink); box-shadow: inset 0 0 0 1.5px var(--saffron); }
.time-line.ok { color: var(--good); }
.time-box { background: var(--mid-soft); color: var(--mid-ink); border-radius: 14px; padding: 10px 14px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.late-tag, .over-tag { font-size: 11px; font-weight: 800; background: var(--mid-soft); color: var(--mid-ink); border-radius: 999px; padding: 1px 7px; text-transform: none; letter-spacing: 0; }
.mini.late { outline: 2.5px solid var(--saffron); outline-offset: 1px; }
.time-box { display: block; } .time-box > div { margin-top: 4px; }
.seg { flex-wrap: wrap; max-width: 100%; }
.seg span { white-space: nowrap; }

/* 0.2.3: tests shown apart from the level ladder */
.tests-h { margin-top: 6px; }
.lvl-num.test, .lvl-badge.test { background: var(--ink); color: var(--bg); }
.lvl-badge.test { font-size: 11px; }
.test-card { border-left-style: double; border-left-width: 10px; }

/* ---------- first launch: add a child and start ---------- */
.welcome { gap: 14px; }
.welcome-card { border-left: 0; width: 100%; max-width: 520px; text-align: left; display: flex; flex-direction: column; gap: 14px; }
.welcome-card .h2 { margin: 0; text-align: center; }
.welcome-card .avatars { justify-content: center; }
.welcome-card .field > span { display: block; text-align: center; margin-bottom: 6px; }
.inp.big { font-size: 22px; padding: 14px 16px; text-align: center; }
.lead.small { font-size: 15px; }
.link-btn { font-weight: 800; color: var(--c-ink, #1E2A5A); text-decoration: underline; text-underline-offset: 3px; }
.kid.add { border: 3px dashed var(--line, #d8cfbf); border-bottom-width: 8px; background: transparent; box-shadow: none; cursor: pointer; font: inherit; color: var(--muted); }
.kid.add .avatar { font-family: inherit; font-weight: 800; color: var(--muted); }
.hint.center { text-align: center; margin-top: 18px; }

/* ---------- welcome: PIN link + "Learn more" ---------- */
.gu-pin { font-size: 17px; text-decoration: none; }
.gu-pin u { text-underline-offset: 3px; }
.gu-info { width: 100%; max-width: 520px; text-align: left; }
.gu-info summary { list-style: none; cursor: pointer; text-align: center; padding: 6px; }
.gu-info summary::-webkit-details-marker { display: none; }
.gu-more { font-weight: 800; font-size: 15px; color: var(--muted); }
.gu-more::after { content: ' ▾'; }
.gu-info[open] .gu-more::after { content: ' ▴'; }
.gu-body { margin-top: 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 18px; padding: 6px 18px 16px; }
.gu-body h3 { font-family: var(--display); font-size: 16px; margin: 12px 0 6px; color: var(--c-ink, #1E2A5A); }
.gu-body p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; }
.gu-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.gu-list li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-size: 15px; line-height: 1.45; }
.gu-list li > span { font-family: var(--emoji); font-size: 18px; }
.gu-private { background: var(--card); border-radius: 12px; padding: 10px 12px; margin-top: 10px !important; }
.gu-for { font-weight: 600; }

/* ---------- level shades: Level 1 light → Level 4 deep, same card color ---------- */
.shaded .lvl-badge, .shaded .lvl-num, .list-item.shaded .btn:not(.ghost):not(.danger) {
  background: linear-gradient(135deg, var(--lc2), var(--lc)); color: var(--lc-on);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc) 70%, #1E2A5A 30%);
}
.list-item.shaded .btn:not(.ghost):not(.danger):not(:disabled):hover { background: linear-gradient(135deg, var(--lc), var(--lc)); filter: saturate(1.15) brightness(.95); }
.level-card.shaded { border-left-color: var(--lc); }
.level-card.shaded:hover .lvl-num { filter: saturate(1.15) brightness(.97); }

/* ---------- score by part / sub-test ---------- */
.part-scores { width: 100%; max-width: 460px; margin: 6px auto 4px; text-align: left; display: grid; gap: 6px; }
.ps-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto; gap: 10px; align-items: center; font-size: 15px; }
.ps-bar { height: 10px; border-radius: 999px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.ps-bar i { display: block; height: 100%; border-radius: 999px; background: var(--good, #1C9258); }
.ps-bar i.mid { background: var(--saffron); } .ps-bar i.lo { background: #D14343; }
.qnum { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

/* ---------- start page: continue where you left off, and single sub-tests ---------- */
.resume-card { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--card); border-radius: var(--r, 18px);
  padding: 14px 18px; box-shadow: var(--shadow), inset 0 0 0 2.5px var(--saffron); }
.resume-card > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.resume-card span { color: var(--muted); font-size: 14px; }
.part-wrap { display: flex; flex-direction: column; gap: 8px; }
.part-wrap > .part-card { width: 100%; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sub-chips .mini-label { width: 100%; }
.sub-chip { border: 0; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, var(--line)); }
.sub-chip b { margin-left: 4px; color: var(--muted); }
.sub-chip:hover { background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.vanalogy .vpair + .vpair { margin-top: 6px; }

/* ---------- Sets tab: fold subjects and topics ---------- */
details.subj-group > summary, details.topic-group > summary { list-style: none; cursor: pointer; user-select: none; }
details.subj-group > summary::-webkit-details-marker, details.topic-group > summary::-webkit-details-marker { display: none; }
details.subj-group { background: var(--card); border-radius: var(--r, 18px); padding: 10px 14px; box-shadow: var(--shadow); border-left: 6px solid var(--c); }
details.subj-group > summary.subj-h { border-bottom: 0; padding: 4px 0; }
details.subj-group[open] > summary.subj-h { border-bottom: 3px solid var(--c); margin-bottom: 4px; }
details.topic-group > summary.topic-h { display: flex; align-items: center; gap: 8px; padding: 8px 6px; margin: 0; border-radius: 10px; }
details.topic-group > summary.topic-h:hover, details.subj-group > summary:hover { background: color-mix(in srgb, var(--c) 8%, transparent); }
details.topic-group > summary small { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; margin-left: auto; }
details.topic-group[open] > .list { margin: 2px 0 8px; }
.chev { width: 10px; height: 10px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: 0 0 auto; margin-right: 4px; }
details[open] > summary > .chev { transform: rotate(45deg); }
.fold-all { gap: 8px; justify-content: flex-end; }
details.subj-group > summary.subj-h { font-weight: 800; }
