/* Naskala TryOut: base styles, after the Ajarin design (ajarin-landing:
   src/app/globals.css and the Pulse admin dashboard). Exam screen styles live
   in exam.css. Light only, like the design. */
:root {
  --bg: #fdfdfc;            /* surface */
  --surface: #ffffff;       /* card */
  --navy: #0f172a;
  --navy-line: #2a3f5f;
  --fg: #0f172a;
  --muted: #64748b;         /* secondary text */
  --faint: #94a3b8;         /* muted labels */
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #065f46;         /* emerald: primary actions and links */
  --brand-deep: #064e3b;
  --brand-fg: #ffffff;
  --brand-soft: #ecfdf5;
  --accent: #3b1139;        /* berry: the active item, highlights */
  --accent-soft: #f3e8f3;
  --ok: #064e3b;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --radius: 8px;
  --radius-sm: 6px;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
  font-family: var(--font-body);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; text-wrap: balance; }
h1.display { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; letter-spacing: -.5px; margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
a { color: var(--brand); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.ic { width: 1em; height: 1em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- navy top bar ---- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .5rem 2rem; min-height: 4.5rem;
  padding: .6rem 2rem; background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; letter-spacing: -.5px; color: #fff; text-decoration: none; }
.mark { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 6px; background: var(--brand-deep); color: #ecfdf5; font-family: var(--font-body); font-size: .9rem; }
.brand .tag { font-family: var(--font-body); font-size: .56rem; font-weight: 700; letter-spacing: 1px; padding: .15rem .45rem; border-radius: 6px; background: #1b2a4a; color: #ecfdf5; text-transform: uppercase; }
.topnav { display: flex; gap: 1.5rem; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--faint); font-size: .875rem; font-weight: 500; text-decoration: none; white-space: nowrap; padding: .2rem 0; }
.topnav a:hover, .topnav a[aria-current] { color: #fff; }
.topnav a[aria-current] { font-weight: 600; }
.who { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.lang { display: flex; gap: .15rem; margin-right: .4rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.lang a, .lang span { padding: .25rem .4rem; border-radius: 6px; color: var(--faint); text-decoration: none; }
.lang a:hover { color: #fff; }
.lang span[aria-current] { background: #1b2a4a; color: #fff; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--brand-deep); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.avatar.sq { border-radius: 6px; background: var(--navy); font-size: .65rem; }
.avatar.sq.soon { background: var(--warn); }
.avatar.sq.ended, .avatar.sq.wait { background: var(--line-strong); color: var(--navy); }
.who-text { display: flex; flex-direction: column; line-height: 1.2; }
.who-name { font-size: .82rem; font-weight: 600; color: #fff; }
.who-role { font-size: .7rem; color: var(--faint); }
.who-link { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 8px; border: 1px solid var(--navy-line); background: var(--navy); color: #fff; font-size: 1rem; cursor: pointer; padding: 0; }
.who-link:hover { border-color: var(--faint); }

/* ---- shell: sidebar + content ---- */
.shell { display: flex; min-height: calc(100vh - 4.5rem); }
.side { display: none; }
.shell.with-side .side {
  display: flex; flex-direction: column; gap: .15rem; flex: none; width: 15rem;
  padding: 1.5rem 1rem 1rem; background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 4.5rem; align-self: flex-start; max-height: calc(100vh - 4.5rem); overflow-y: auto;
}
.side-title { padding: .9rem .75rem .35rem; font-size: .62rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); }
.side-title:first-child { padding-top: 0; }
.side-item { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: var(--radius); color: var(--fg); font-size: .82rem; font-weight: 500; text-decoration: none; }
.side-item .ic { color: var(--muted); font-size: 1rem; }
.side-item:hover { background: var(--bg); }
.side-item[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-item[aria-current] .ic { color: var(--accent); }
.side-rule { margin-top: auto; display: flex; flex-direction: column; gap: .4rem; padding: 1rem; border-radius: var(--radius); background: var(--navy); color: #fff; }
.side-rule-title { display: flex; align-items: center; gap: .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #ecfdf5; }
.side-rule-title .ic { color: #34d399; }
.side-rule strong { font-family: var(--font-heading); font-size: .9rem; line-height: 1.3; }
.side-rule span:last-child { font-size: .7rem; line-height: 1.4; color: var(--faint); }
.wrap { flex: 1; min-width: 0; max-width: 80rem; margin: 0 auto; padding: 2rem 2.5rem 3rem; }
.shell.with-side .wrap { margin: 0; max-width: none; }

/* ---- page header ---- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head .lead { margin: .35rem 0 0; font-size: .9rem; color: var(--muted); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 6px; background: #dcfce7; color: #16a34a; font-family: var(--font-body); font-size: .68rem; font-weight: 700; letter-spacing: 0; }
.live i { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }

/* ---- cards, panels, KPI ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.card.narrow { max-width: 26rem; margin-inline: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem 1rem; }
.panel-head h2 { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; margin: 0; }
.panel-head p { margin: .2rem 0 0; font-size: .82rem; color: var(--muted); }
.panel-empty { margin: 0; padding: 0 1.5rem 1.25rem; color: var(--muted); font-size: .9rem; }
.panel-empty.ok { color: var(--ok); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.kpi { display: flex; flex-direction: column; gap: .8rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg); text-decoration: none; }
.kpi:hover { border-color: var(--line-strong); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: .68rem; font-weight: 700; letter-spacing: 1.2px; color: var(--faint); }
.kpi-icon { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px; font-size: 1rem; }
.kpi-icon.emerald { background: var(--brand-soft); color: var(--brand-deep); }
.kpi-icon.berry { background: var(--accent-soft); color: var(--accent); }
.kpi-icon.amber { background: var(--warn-soft); color: var(--warn); }
.kpi-num { display: flex; align-items: flex-end; gap: .5rem; }
.kpi-num b { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 700; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.kpi-num span { margin-bottom: .2rem; font-size: .82rem; font-weight: 500; color: var(--muted); }
.kpi-cap { margin: 0; font-size: .75rem; color: var(--muted); }

/* ---- forms ---- */
label { display: block; font-size: .85rem; font-weight: 600; margin: .75rem 0 .25rem; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=email], input[type=datetime-local], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg); font: inherit;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.check { display: flex; align-items: center; gap: .4rem; font-weight: 400; }
.check input { width: auto; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row > .grow { flex: 1 1 14rem; }
.row label { margin-top: 0; }
.search { margin-bottom: 1rem; }
.search input { max-width: 22rem; }

button { font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; padding: .55rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
button:hover { border-color: var(--line-strong); }
button.primary { background: var(--brand-deep); color: var(--brand-fg); border-color: var(--brand-deep); font-weight: 600; }
button.primary:hover { background: var(--brand); }
button.ghost { background: transparent; }
button.danger { color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .55; cursor: not-allowed; }
form .primary { margin-top: 1rem; }
.row .primary { margin-top: 0; }

.notice { margin: .75rem 0 0; padding: 0; border-radius: var(--radius-sm); }
.notice:not(:empty) { padding: .6rem .8rem; }
.notice.error { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.issued { background: var(--warn-soft); color: var(--fg); border: 1px solid var(--warn); }
.notice.issued dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: .5rem 0; }
.notice.issued dd { margin: 0; }
.notice.issued code { font-size: 1.05rem; user-select: all; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap.plain { border: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); white-space: nowrap; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.empty { text-align: center; color: var(--muted); padding: 1.5rem; }
td.actions { white-space: nowrap; text-align: right; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.rows td { vertical-align: middle; }
.cell-id { display: flex; align-items: center; gap: .75rem; }
.strong { font-weight: 600; color: var(--fg); text-decoration: none; }
a.strong:hover { color: var(--brand); }
.sub { font-size: .75rem; color: var(--muted); font-weight: 400; }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 600; margin-right: .25rem; white-space: nowrap; }
.pill i { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.off { background: var(--line); color: var(--muted); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

/* ---- lists on the dashboard ---- */
.todo { list-style: none; margin: 0; padding: 0 .5rem .5rem; }
.todo li { border: 0; padding: 0; }
.todo a { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-radius: var(--radius-sm); color: var(--fg); text-decoration: none; }
.todo a:hover { background: var(--bg); }
.todo b { display: inline-grid; place-items: center; min-width: 2rem; height: 1.6rem; padding: 0 .5rem; border-radius: 6px; background: var(--warn); color: #fff; font-size: .75rem; font-variant-numeric: tabular-nums; }
.todo span { flex: 1; font-size: .85rem; }
.todo .ic { color: var(--faint); }
.feed { list-style: none; margin: 0; padding: 0 1.5rem 1rem; }
.feed li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.feed li > div { flex: 1; min-width: 0; }
.feed .when { white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; }
.stat { display: flex; flex-direction: column; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--fg); }
.stat b { font-family: var(--font-heading); font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat span { color: var(--muted); font-size: .78rem; }
.stat:hover { border-color: var(--line-strong); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; }
.tabs a { padding: .3rem .8rem; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); }
.tabs a[aria-current=page] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.math, .prompt { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- narrow screens: the sidebar folds into the top bar's scrolling nav ---- */
@media (max-width: 64rem) {
  .shell.with-side .side { display: none; }
  .shell.with-side .wrap { max-width: 80rem; margin: 0 auto; }
  .wrap { padding: 1.5rem 1.25rem 3rem; }
}
@media (min-width: 64.01rem) {
  body:has(.shell.with-side) .topnav { display: none; }
}
@media (max-width: 48rem) {
  .top { flex-wrap: wrap; min-height: 0; padding: .55rem .9rem; gap: .35rem .75rem; }
  .brand { font-size: 1.1rem; }
  .topnav { order: 3; flex-basis: 100%; gap: 1.1rem; font-size: .9rem; padding-bottom: .1rem; -webkit-overflow-scrolling: touch; }
  .who { gap: .4rem; }
  .who-text { display: none; }
  .who-link, .avatar { width: 2rem; height: 2rem; }
  .shell { min-height: 0; }
  .wrap { padding: 1rem .85rem 2.5rem; }
  h1 { font-size: 1.35rem; margin-bottom: .75rem; }
  h1.display { font-size: 1.5rem; }
  .page-head { margin-bottom: 1rem; }
  .card { padding: .9rem; margin-bottom: .9rem; }
  .panel-head { padding: 1rem 1rem .75rem; }
  .panel-empty { padding: 0 1rem 1rem; }
  .feed { padding: 0 1rem .75rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
  .kpi { padding: .9rem; gap: .5rem; }
  .kpi-num b { font-size: 1.9rem; }
  .kpi-label { font-size: .6rem; letter-spacing: .8px; }
  .kpi-cap { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .stat { padding: .6rem .75rem; }
  .stat b { font-size: 1.3rem; }
  th, td { padding: .5rem .6rem; }
  /* A wide row table becomes one card per row, cells labelled. */
  table.rows thead { display: none; }
  table.rows tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
  table.rows tr:last-child { border-bottom: 0; }
  table.rows td { display: block; padding: 0; border: 0; }
  table.rows td.span { grid-column: 1 / -1; }
  table.rows td.num { text-align: left; font-weight: 600; }
  table.rows td[data-label]::before { content: attr(data-label); display: block; font-size: .6rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--faint); }
  .avatar.sq { width: 2rem; height: 2rem; }
  .cell-id .sub, .feed .when { font-size: .72rem; }
}

/* ---- question bank and editor ---- */
.row.between { justify-content: space-between; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: .85rem; font-weight: 500; text-decoration: none; }
.btn:hover { border-color: var(--line-strong); }
.btn.primary, .btn.emerald { background: var(--brand-deep); color: var(--brand-fg); border-color: var(--brand-deep); font-weight: 600; }
.btn.small { padding: .35rem .7rem; font-size: .78rem; white-space: nowrap; }
.small { font-size: .8rem; }
.filters { margin-bottom: 1rem; }
.pager { margin-top: 1rem; }
.qcell { max-width: 28rem; overflow-wrap: anywhere; }
.notice.warn { background: var(--warn-soft); color: var(--fg); border: 1px solid var(--warn); padding: .6rem .8rem; }
.notice ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.notice li { display: list-item; border: 0; padding: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0 0; padding: .5rem .75rem .75rem; }
legend { font-weight: 600; padding: 0 .35rem; }
.optrow { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .5rem; align-items: center; margin-top: .4rem; }
.k { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem; }
.checklist { list-style: none; padding: 0; margin: .5rem 0; }
.checklist li { display: list-item; border: 0; padding: .1rem 0 .1rem 1.4rem; position: relative; color: var(--muted); }
.checklist li::before { content: "○"; position: absolute; left: 0; }
.checklist li.done { color: var(--ok); }
.checklist li.done::before { content: "✓"; }

/* ---- a question as a Student sees it (exam, preview) ---- */
.question { display: grid; gap: 1rem; }
.question .stimulus { padding: .9rem 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.question .prompt { font-size: 1.05rem; }
.qimg { max-width: 100%; height: auto; display: block; margin: .5rem 0; }
.options { display: grid; gap: .5rem; }
.opt { display: flex; align-items: flex-start; gap: .65rem; padding: .6rem .75rem; margin: 0; font-weight: 400; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.opt:hover { border-color: var(--brand); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt input { margin-top: .35rem; }
.stmts th:not(:first-child), .stmts td:not(:first-child) { text-align: center; width: 5rem; }
.stmts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---- packages, assignments ---- */
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.problems { margin: 0; padding-left: 1.2rem; color: var(--bad); }
.problems li { display: list-item; border: 0; padding: .1rem 0; }
.qnum { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .5rem; }
.subject details { margin-top: .75rem; }
.subject summary { cursor: pointer; color: var(--brand); }

/* ---- ops monitor ---- */
.grant { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.grant .mins { width: 3.2rem; text-align: right; }
.grant .why { width: 11rem; }
.lowtime { color: var(--bad); font-weight: 700; }

/* ---- results ---- */
.score { display: inline-block; margin-right: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report { margin-bottom: .75rem; }
.report .prompt { margin: .5rem 0; }
.kv + .notice, .stats + .notice { margin-top: 1rem; }

/* ---- topic picker ---- */
.topic-picker { position: relative; }
.topic-picker label { margin-top: 0; }
.topic-box { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.topic-box:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.topic-box input { flex: 1 1 10rem; width: auto; min-width: 8rem; border: 0; background: transparent; padding: .25rem; outline: none; }
.chips { display: contents; list-style: none; margin: 0; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .2rem .1rem .6rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .85rem; border: 0; }
.chip .chip-x { border: 0; background: transparent; color: inherit; padding: 0 .35rem; font-size: 1rem; line-height: 1.2; border-radius: 999px; }
.chip .chip-x:hover { background: var(--brand); color: var(--brand-fg); }
.topic-list { position: absolute; z-index: 10; left: 0; right: 0; margin: .2rem 0 0; padding: .25rem; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); max-height: 14rem; overflow-y: auto; }
.topic-list[hidden] { display: none; }
.topic-list li { display: block; border: 0; padding: .4rem .6rem; border-radius: 4px; cursor: pointer; }
.topic-list li.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.topic-list li.topic-none { cursor: default; color: var(--muted); }

/* Floating live preview above a textarea (question editor). */
.live-preview { position: fixed; z-index: 30; box-sizing: border-box; overflow-y: auto; padding: .6rem .8rem; background: var(--surface); color: var(--fg); border: 1px solid var(--brand); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); pointer-events: none; }
.live-preview[hidden] { display: none; }
.live-preview-head { margin: 0 0 .3rem; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.live-preview-body { font-size: 1.05rem; }

/* A Student's review of a scored test. */
.review.right { border-left: 4px solid var(--ok); }
.review.wrong { border-left: 4px solid var(--bad); }
.review .opt input { pointer-events: none; }

/* ---- guided tour (tour.js) ---- */
.tour-overlay { position: fixed; inset: 0; z-index: 100; }
.tour-box { position: fixed; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .6), 0 0 0 3px #f2b01e; transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; z-index: 101; width: min(22rem, calc(100vw - 1rem)); padding: 1rem 1.1rem; background: #ffffff; color: #0f172a; border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); font-family: var(--font-body, "Inter", system-ui, sans-serif); }
.tour-card.sheet { left: .5rem !important; right: .5rem; bottom: .5rem; top: auto !important; width: auto; }
.tour-card h3 { margin: 0 0 .3rem; font-family: var(--font-heading, Georgia, serif); font-size: 1.1rem; color: #0f172a; }
.tour-card p { margin: 0 0 .8rem; font-size: .9rem; line-height: 1.5; color: #334155; }
.tour-step { font-size: .68rem; font-weight: 700; letter-spacing: 1px; color: #94a3b8; margin-bottom: .3rem; }
.tour-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.tour-actions .ghost { margin-right: auto; }
.tour-actions button { font: inherit; font-size: .85rem; padding: .45rem .8rem; border-radius: 6px; border: 1px solid #e2e8f0; background: #fff; color: #0f172a; cursor: pointer; }
.tour-actions button.primary { background: #064e3b; border-color: #064e3b; color: #fff; font-weight: 600; }
.tour-actions button.ghost { background: transparent; color: #64748b; }
#tour-btn[hidden] { display: none; }
