/* ElevenPlus Engine - one hand-written stylesheet (no build step needed on shared hosting). */

:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --ink: #1b2033;
  --muted: #5a6278;
  --line: #dde1ec;
  --brand: #4451c9;
  --brand-hover: #3843ad;
  --brand-ink: #ffffff;
  --brand-soft: #e7e9fb;
  --accent: #f0a63a;
  --ok: #1d7f47;
  --ok-soft: #e1f3e8;
  --bad: #b8352a;
  --bad-soft: #fbe6e3;
  --warn: #9a5b00;
  --warn-soft: #fff0d4;
  --paper: #ffffff;
  --d-grey: #bdbdbd;
  --d-light: #e6e6e6;
  --d-accent: #9cc3e6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 6px 18px rgba(20, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12141c; --surface: #1b1e29; --surface-2: #242838; --ink: #e8eaf2; --muted: #a3a9bd; --line: #333849;
    --brand: #8d97ff; --brand-hover: #a5adff; --brand-ink: #10131d; --brand-soft: #262b4a; --accent: #f4b860;
    --ok: #59c98a; --ok-soft: #173325; --bad: #ff7f72; --bad-soft: #3a1f1d; --warn: #f2bd5b; --warn-soft: #3a2e14;
    --paper: #1b1e29; --d-grey: #5d6275; --d-light: #2e3243; --d-accent: #34507a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12141c; --surface: #1b1e29; --surface-2: #242838; --ink: #e8eaf2; --muted: #a3a9bd; --line: #333849;
  --brand: #8d97ff; --brand-hover: #a5adff; --brand-ink: #10131d; --brand-soft: #262b4a; --accent: #f4b860;
  --ok: #59c98a; --ok-soft: #173325; --bad: #ff7f72; --bad-soft: #3a1f1d; --warn: #f2bd5b; --warn-soft: #3a2e14;
  --paper: #1b1e29; --d-grey: #5d6275; --d-light: #2e3243; --d-accent: #34507a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
.dyslexia { --font-read: "OpenDyslexic", "Comic Sans MS", "Lexend", Verdana, sans-serif; }
.dyslexia .q, .dyslexia .passage { letter-spacing: .03em; word-spacing: .12em; line-height: 1.75; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font);
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main, body > .player { flex: 1 0 auto; width: 100%; }
.site-header, .site-footer { flex-shrink: 0; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; color: var(--ink); }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 16px; }
main { padding: 28px 0 56px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.spacer { flex: 1; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: .95rem; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.nav a, .nav button.linklike { padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a.active { background: var(--surface-2); }
.nav form { margin: 0; }
.site-header .menu-toggle { display: none; margin-left: auto; }
@media (max-width: 760px) {
  .site-header .menu-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .site-header .wrap { flex-wrap: wrap; }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card-flat { background: var(--surface-2); border-radius: var(--radius); padding: 16px; }
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); max-width: 18ch; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.notice { border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 16px; border: 1px solid var(--line); background: var(--surface); }
.notice.success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.notice.error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice.info { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 1.6rem; letter-spacing: -.02em; }
.kpi span { color: var(--muted); font-size: .85rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 1rem/1.2 var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); }
.btn-primary .muted { color: inherit; opacity: .8; }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .88rem; border-radius: 9px; }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.1rem; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
button.linklike { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
label { font-weight: 600; display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: .87rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 1rem var(--font);
}
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-soft); }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 2px; }
.inline-form { display: inline; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { padding: 0; }
legend h2 { margin-bottom: 12px; }
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 700; cursor: pointer; }
.choice span small { font-weight: 500; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice input:disabled + span { opacity: .5; cursor: not-allowed; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tr:hover td { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Phones: wide tables become one card per row, each value under its column name (labels added by app.js). */
@media (max-width: 600px) {
  table.stack-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr { display: block; width: 100%; }
  table.stack-sm tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.stack-sm td { display: block; position: relative; border: 0; padding: 3px 0 3px 40%; text-align: left; min-height: 1.7em; overflow-wrap: anywhere; }
  table.stack-sm td::before { content: attr(data-label); position: absolute; left: 0; top: 5px; width: 37%; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
  table.stack-sm td:not([data-label]), table.stack-sm td[data-label=""] { padding-left: 0; }
  table.stack-sm td:empty { display: none; }
  table.stack-sm tr:hover td { background: none; }
}

/* ---------- meters ---------- */
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar.ok > i { background: var(--ok); } .bar.warn > i { background: var(--accent); } .bar.bad > i { background: var(--bad); }
.credit-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; margin-bottom: 12px; }
.credit-row .bar { grid-column: 1 / -1; }

/* ---------- children ---------- */
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.2rem; flex: none; }
.avatar-sm { width: 32px; height: 32px; font-size: .9rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- questions (shared by player, review, print, admin preview) ---------- */
.q { font-family: var(--font-read); font-size: 1.08rem; }
.q-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; color: var(--muted); font-size: .9rem; font-family: var(--font); }
.q-num { font-weight: 800; color: var(--ink); }
.q-stem { font-size: 1.15rem; margin-bottom: 14px; }
.q-fig { margin: 0 0 16px; overflow-x: auto; }
.q-fig svg, .opt svg { display: block; height: auto; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; line-height: 1.05; margin: 0 .12em; }
.frac .num { border-bottom: 1.5px solid currentColor; padding: 0 .15em; }
.frac .den { padding: 0 .15em; }
.blank { display: inline-block; min-width: 4.5em; border-bottom: 2px solid currentColor; }
.segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.segments .seg { padding: 12px 10px; border-right: 2px dashed var(--line); }
.segments .seg:last-child { border-right: 0; }
.segments .seg b { display: block; text-align: center; color: var(--muted); font-size: .85rem; margin-top: 6px; }
@media (max-width: 600px) { .segments { grid-template-columns: 1fr 1fr; } .segments .seg:nth-child(2) { border-right: 0; } }
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* Columns follow the space available (works in the player, the narrow admin preview and on phones). */
.opts-grid, .opts-segments { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.opts-list, .opts-wide { grid-template-columns: 1fr; }
.opts-pictures { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.opt { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.opts-pictures .opt { flex-direction: column; padding: 8px; }
.opt .letter { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 .9rem var(--font); background: var(--surface-2); color: var(--muted); }
.opt .txt { min-width: 0; overflow-wrap: break-word; }
.opt:hover { border-color: var(--brand); }
.opt[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.opt[aria-pressed="true"] .letter { background: var(--brand); color: var(--brand-ink); }
.opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-correct .letter { background: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-wrong .letter { background: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.q-review .opt { cursor: default; }
.explain { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-family: var(--font); font-size: .98rem; }
.explain.ok { background: var(--ok-soft); } .explain.bad { background: var(--bad-soft); }
.passage { font-family: var(--font-read); font-size: 1.05rem; line-height: 1.7; }
.passage h3 { font-family: var(--font); }

/* tables inside diagrams */
table.dt { border-collapse: collapse; margin: 4px 0; font-size: 1rem; background: var(--surface); }
table.dt caption { font-weight: 700; text-align: left; padding: 4px 0 8px; }
table.dt th, table.dt td { border: 1.5px solid var(--ink); padding: 6px 12px; text-align: center; }
table.dt thead th { background: var(--surface-2); }

/* diagram theming (presentation attributes are the fallback) */
.dg { color: var(--ink); }
.dg .pf { fill: var(--paper); }
.dg .gf { fill: var(--d-grey); }
.dg .lf { fill: var(--d-light); }
.dg .af { fill: var(--d-accent); }
.dg .grid { stroke: var(--line); }
.svg-defs .pf { fill: var(--paper); }

/* ---------- player ---------- */
.player { display: flex; flex-direction: column; min-height: calc(100vh - 61px); }
.player-bar { position: sticky; top: 61px; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.player-bar .wrap { display: flex; align-items: center; gap: 10px; min-height: 58px; flex-wrap: wrap; }
.timer { font: 800 1.25rem/1 var(--font); font-variant-numeric: tabular-nums; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.timer.low { background: var(--warn-soft); color: var(--warn); }
.timer.critical { background: var(--bad-soft); color: var(--bad); }
.progress-text { font-weight: 700; }
.player-main { flex: 1; padding: 20px 0 110px; }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.split > *, .grid > * { min-width: 0; }
.split.has-passage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .split.has-passage { grid-template-columns: 1fr; } }
.passage-panel { max-height: 70vh; overflow: auto; position: sticky; top: 140px; }
@media (max-width: 860px) { .passage-panel { position: static; max-height: 40vh; } }
.player-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 15; }
.player-nav .wrap { display: flex; gap: 10px; align-items: center; min-height: 72px; }
.player-nav .btn { min-height: 52px; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.palette button { min-height: 46px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); font: 700 1rem var(--font); color: var(--ink); cursor: pointer; position: relative; }
.palette button.answered { background: var(--brand-soft); border-color: var(--brand); }
.palette button.flagged::after { content: ""; position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.palette button.current { outline: 3px solid var(--accent); }
.flag-on { background: var(--warn-soft) !important; border-color: var(--accent) !important; }
.offline-badge { display: none; }
.offline .offline-badge { display: inline-flex; }
[hidden] { display: none !important; }

/* ---------- paper tests & printing ---------- */
.paper-actions { margin: 12px 0 20px; }
.steps { margin: 0 0 12px; padding-left: 1.3em; }
.steps li { margin-bottom: 4px; }
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.paper-head { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 22px; }
.paper-head h2 { margin: 10px 0 0; }
.paper-fields { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 12px 0 6px; }
.paper-fields i { display: inline-block; width: 10em; max-width: 60vw; border-bottom: 1px solid var(--ink); }
.paper-instr { color: var(--muted); margin: 6px 0 0; }
.paper .q { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px dashed var(--line); }
.paper-passage { margin-bottom: 22px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.q-paper .opts { gap: 8px; }
.q-paper .opts-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.q-paper .opt { min-height: 0; padding: 6px 10px; border-width: 1px; cursor: default; }
.q-paper .opt:hover { border-color: var(--line); }
.answer-sheet { margin-top: 28px; }
.sheet-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px 28px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.sheet-grid li { display: flex; align-items: center; gap: 6px; }
.sheet-n { min-width: 2.2em; font-weight: 800; text-align: right; margin-right: 4px; font-variant-numeric: tabular-nums; }
.bubble { flex: none; width: 26px; height: 26px; border: 1.5px solid var(--ink); border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; }
.key-letter { font-size: 1.15rem; }
.mark-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.mark-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.mark-n { min-width: 2em; font-weight: 800; font-variant-numeric: tabular-nums; }
.mark-opt { position: relative; margin: 0; }
.mark-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.mark-opt span { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--line); border-radius: 50%; font-weight: 800; cursor: pointer; background: var(--surface); }
.mark-opt input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.mark-opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- progress ---------- */
.radar { color: var(--ink); width: 100%; height: auto; max-width: 460px; display: block; margin: 0 auto; }
.radar .ring, .radar .spoke { stroke: var(--line); }
.radar .now { fill: var(--brand); stroke: var(--brand); }
.radar .dot { fill: var(--brand); }
.radar .st-needs { fill: var(--bad); } .radar .st-dev { fill: var(--warn); } .radar .st-secure { fill: var(--brand); }
.radar .st-ready { fill: var(--ok); } .radar .st-none { fill: var(--muted); }
.radar-mini { max-width: 240px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); justify-content: center; }
.legend i { display: inline-block; width: 26px; height: 0; border-top: 3px solid var(--brand); vertical-align: middle; margin-right: 6px; }
.legend i.dash { border-top-style: dashed; border-color: var(--ink); }
.legend i.dot { border-top-style: dotted; border-color: var(--ink); }
.focus-item { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.focus-item:last-child { border-bottom: 0; }
.focus-rank { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.tabs a.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* ---------- admin ---------- */
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.admin-tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.admin-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
@media (max-width: 760px) {
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .admin-tabs a { flex: none; white-space: nowrap; padding: 10px 12px; }
}
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: var(--surface-2); padding: 12px; border-radius: 10px; overflow: auto; white-space: pre-wrap; max-height: 420px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.status-dot.ok { background: var(--ok); } .status-dot.bad { background: var(--bad); }
.preview-frame { border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg); }
.low { color: var(--bad); font-weight: 700; }

/* ---------- contact ---------- */
.contact-email { font-size: 1.3rem; font-weight: 800; overflow-wrap: anywhere; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.stack-list { margin: 0; padding-left: 1.2em; }
.stack-list li + li { margin-top: 8px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; background: var(--surface); }
.site-footer a { color: var(--muted); }

/* ---------- reduced motion & print ---------- */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print {
  /* light colours even when the screen is in dark mode (these selectors outrank the dark-theme ones) */
  :root, :root[data-theme], :root:not([data-theme="light"]) {
    --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --ink: #000; --muted: #333; --line: #999; --paper: #fff;
    --brand: #000; --brand-soft: #eee; --d-grey: #bdbdbd; --d-light: #e6e6e6; --d-accent: #9cc3e6; color-scheme: light;
  }
  .site-header, .site-footer, .no-print, .player-nav, .player-bar { display: none !important; }
  body { font-size: 12pt; display: block; min-height: 0; background: #fff; }
  main { padding: 0; }
  .paper { border: 0; border-radius: 0; padding: 0; }
  .paper .q { border-bottom: 0; }
  .answer-sheet { break-before: page; page-break-before: always; margin-top: 0; }
  table.data tr:hover td { background: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .q { break-inside: avoid; page-break-inside: avoid; margin-bottom: 18pt; }
  .opt { border: 1px solid #999; min-height: 0; }
  a { color: #000; text-decoration: none; }
}
