/* Turnstile — see DESIGN.md for the token rationale. */
:root {
  --bg: oklch(1 0 0);
  --bg-2: oklch(0.975 0.004 38);
  --surface: oklch(0.985 0.003 38);
  --ink: oklch(0.21 0.01 38);
  --ink-2: oklch(0.45 0.012 38);
  --line: oklch(0.90 0.006 38);
  --line-2: oklch(0.84 0.008 38);
  --accent: oklch(0.56 0.155 38);
  --accent-hover: oklch(0.50 0.155 38);
  --accent-ink: oklch(0.50 0.155 38);
  --accent-soft: oklch(0.955 0.03 38);
  --on-accent: #fff;
  --good: oklch(0.52 0.14 150);
  --good-soft: oklch(0.955 0.04 150);
  --bad: oklch(0.50 0.20 12);
  --bad-soft: oklch(0.955 0.03 12);
  --shadow: 0 1px 2px oklch(0 0 0 / .05), 0 6px 20px oklch(0 0 0 / .05);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "STIX Two Text", "Times New Roman", Georgia, serif;
  --r: 10px;
  --z-sticky: 10; --z-scrim: 20; --z-side: 30;
  --dur: 180ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.14 0 0);
    --bg-2: oklch(0.175 0.003 38);
    --surface: oklch(0.20 0.004 38);
    --ink: oklch(0.93 0.005 38);
    --ink-2: oklch(0.73 0.008 38);
    --line: oklch(0.29 0.005 38);
    --line-2: oklch(0.36 0.006 38);
    --accent: oklch(0.76 0.13 38);
    --accent-hover: oklch(0.82 0.12 38);
    --accent-ink: oklch(0.80 0.12 38);
    --accent-soft: oklch(0.26 0.05 38);
    --on-accent: oklch(0.14 0 0);
    --good: oklch(0.78 0.15 150);
    --good-soft: oklch(0.25 0.05 150);
    --bad: oklch(0.76 0.16 15);
    --bad-soft: oklch(0.27 0.06 15);
    --shadow: 0 1px 2px oklch(0 0 0 / .4), 0 6px 20px oklch(0 0 0 / .3);
  }
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 0.9375rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.375rem; font-weight: 600; margin-top: 1.75rem; }
h3 { font-size: 1.125rem; font-weight: 600; margin-top: 1.25rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin: .3rem 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: .5rem .8rem; border-radius: 6px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* formulas */
.f { font-family: var(--serif); font-style: normal; letter-spacing: .01em; white-space: nowrap; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: .75rem;
  height: 56px; padding: 0 1rem;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.menu {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; background: none; border-radius: 8px; cursor: pointer; margin-left: -.5rem;
}
.menu:hover { background: var(--bg-2); }
.brand { display: flex; align-items: baseline; gap: .5rem; color: inherit; text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.brand:hover { color: inherit; }
.brand .mark { font-family: var(--serif); color: var(--accent); font-size: 1.5rem; line-height: 1; transform: translateY(2px); }
.brand .sub { color: var(--ink-2); font-weight: 400; font-size: .85rem; }
@media (max-width: 480px) { .brand .sub { display: none; } }
.topnav { margin-left: auto; display: flex; gap: .25rem; }
.topnav a { color: var(--ink); text-decoration: none; padding: .4rem .7rem; border-radius: 8px; font-weight: 500; font-size: .9rem; }
.topnav a:hover { background: var(--bg-2); }
.topnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 56px); }
.side {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 88vw); z-index: var(--z-side);
  background: var(--bg-2); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 1rem .75rem 2rem;
  transform: translateX(-100%); transition: transform var(--dur) var(--ease);
}
body.nav-open .side { transform: none; box-shadow: var(--shadow); }
.scrim { position: fixed; inset: 0; z-index: var(--z-scrim); background: oklch(0 0 0 / .35); }
.main { padding: 1.5rem 1.25rem 4rem; max-width: 76ch; width: 100%; margin: 0 auto; }
.foot { max-width: 76ch; margin: 0 auto; padding: 0 1.25rem 3rem; color: var(--ink-2); font-size: .8125rem; }
@media (min-width: 960px) {
  .shell { grid-template-columns: 288px minmax(0, 1fr); }
  .side { position: sticky; top: 56px; height: calc(100vh - 56px); transform: none; width: auto; box-shadow: none; }
  .scrim { display: none !important; }
  .menu { display: none; }
  .main { padding: 2rem 2.5rem 5rem; }
  .foot { padding-left: calc(288px + 2.5rem); max-width: none; }
  .foot > span { display: block; max-width: 76ch; }
}

/* ---------- sidebar ---------- */
.side-head { padding: .25rem .5rem .75rem; }
.side-head .pct { display: flex; justify-content: space-between; font-size: .8125rem; color: var(--ink-2); margin-bottom: .35rem; }
.side-head .pct b { color: var(--ink); }
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.unit { margin-top: .75rem; }
.unit-title { display: flex; align-items: baseline; gap: .5rem; padding: .3rem .5rem; font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.unit-title .cnt { margin-left: auto; font-weight: 400; }
.side a.lesson {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem;
  padding: .45rem .5rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .875rem; line-height: 1.3;
}
.side a.lesson:hover { background: var(--bg); color: var(--ink); }
.side a.lesson[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.side a.lesson .num { color: var(--ink-2); font-variant-numeric: tabular-nums; margin-right: .35rem; }
.meter { display: inline-grid; grid-template-columns: repeat(4, 8px); gap: 2px; }
.meter i { display: block; height: 8px; border-radius: 2px; background: var(--line-2); }
.meter i.on { background: var(--accent); }
.meter.m4 i.on { background: var(--good); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 42px; padding: .55rem 1.05rem; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink);
  font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.btn:hover { background: var(--bg-2); border-color: var(--ink-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn.ghost { border-color: transparent; background: none; color: var(--accent-ink); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.big { min-height: 50px; font-size: 1rem; padding: .7rem 1.4rem; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); border-color: transparent; background: none; font-size: .8125rem; min-height: 32px; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0; }
.back { display: inline-flex; gap: .3rem; align-items: center; margin-bottom: 1rem; text-decoration: none; font-weight: 500; font-size: .875rem; }
.muted { color: var(--ink-2); }
.small { font-size: .8125rem; }
.label { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }

/* ---------- home ---------- */
.continue {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem;
  padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin: 1.25rem 0;
}
.continue .label { margin-bottom: .2rem; }
.continue h2 { margin: 0; font-size: 1.125rem; }
.continue h2 a { color: inherit; text-decoration: none; }
.continue h2 a:hover { color: var(--accent-ink); }
.continue p { margin: .2rem 0 0; color: var(--ink-2); font-size: .875rem; }
@media (max-width: 560px) { .continue { grid-template-columns: 1fr; } .continue .btn { width: 100%; } }
.stats { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; margin: 1rem 0 1.5rem; color: var(--ink-2); font-size: .875rem; }
.stats b { color: var(--ink); font-size: 1.05rem; font-weight: 600; margin-right: .3rem; font-variant-numeric: tabular-nums; }
.map { list-style: none; padding: 0; margin: 0; }
.map > li { margin-top: 1.75rem; }
.map .unit-head { display: flex; align-items: baseline; gap: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.map .unit-head h2 { margin: 0; font-size: 1.125rem; }
.map .unit-head .cnt { margin-left: auto; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.map .unit-head .adv { font-size: .75rem; color: var(--ink-2); border: 1px solid var(--line-2); padding: 0 .4rem; border-radius: 999px; }
.map ol { list-style: none; padding: 0; margin: 0; }
.map .row {
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .75rem;
  padding: .7rem .5rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 6px;
}
.map .row:hover { background: var(--bg-2); color: inherit; }
.map .row .num { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: .875rem; }
.map .row .t { font-weight: 500; }
.map .row .b { display: block; color: var(--ink-2); font-size: .8125rem; margin-top: .1rem; }
.map .row .right { display: flex; align-items: center; gap: .75rem; font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.map .row .state { min-width: 5.5rem; text-align: right; }
.map .row.m4 .state { color: var(--good); font-weight: 500; }
@media (max-width: 560px) { .map .row .right > span:first-child, .map .row .b { display: none; } .map .row .state { min-width: 0; } }

/* ---------- lesson ---------- */
.crumbs { font-size: .8125rem; color: var(--ink-2); margin-bottom: .5rem; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }
.lesson-head { margin-bottom: 1.25rem; }
.lesson-head h1 { font-size: 1.85rem; font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--ink-2); font-size: .8125rem; margin-top: .4rem; }
.objectives { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem .5rem; margin: 1.25rem 0 1.75rem; background: var(--surface); }
.objectives .label { margin-bottom: .35rem; }
.objectives ul { margin: 0 0 .4rem; padding-left: 1.2rem; }
.objectives li { margin: .2rem 0; font-size: .9375rem; }
.prose { font-family: var(--serif); font-size: 1.125rem; line-height: 1.6; max-width: 70ch; text-wrap: pretty; }
.prose h2 { font-family: var(--serif); font-size: 1.5rem; margin-top: 2.25rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.1rem; }
.prose strong { font-weight: 600; }
.prose li::marker { color: var(--accent); }
.prose ol { padding-left: 1.6rem; }
.callout { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; margin: 1.35rem 0; background: var(--surface); }
.callout > .label { margin-bottom: .3rem; }
.callout p:last-child { margin-bottom: 0; }
.callout .term { font-weight: 600; }
.def { border-color: var(--line-2); }
.tip { background: var(--accent-soft); border-color: transparent; }
.tip .label { color: var(--accent-ink); }
.rule { background: var(--bg); border-color: var(--line-2); }
.rule-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.rule-head b { font-size: 1.1rem; }
.chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .95rem; }
.schema { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line-2); font-size: 1.1rem; }

/* proofs */
.proof { margin: 1.35rem 0; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow-x: auto; }
.proof figcaption { font-size: 1.1rem; margin-bottom: .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.proof-grid { display: grid; grid-template-columns: max-content max-content minmax(8ch, max-content) max-content; justify-content: start; column-gap: 1.5rem; row-gap: .2rem; align-items: baseline; font-size: 1.1rem; font-family: var(--serif); }
.proof-grid > span { white-space: nowrap; }
.proof-grid .d { color: var(--ink-2); font-size: .95rem; min-width: 1.5ch; }
.proof-grid .n { color: var(--ink-2); }
.proof-grid .j { color: var(--ink-2); font-family: var(--sans); font-size: .9rem; }
.proof-grid .j .f { color: var(--ink); }
.proof .note { margin: .7rem 0 0; font-size: 1rem; color: var(--ink-2); }
.proof-grid select { font: 500 .875rem var(--sans); padding: .25rem .4rem; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); min-width: 6.5rem; }
.proof-grid .j.ok select { border-color: var(--good); background: var(--good-soft); }
.proof-grid .j.no select { border-color: var(--bad); background: var(--bad-soft); }
.proof-grid .j .ans { margin-left: .4rem; color: var(--good); font-weight: 500; }

/* truth tables */
.tt-wrap { overflow-x: auto; margin: 1.35rem 0; }
table.tt { border-collapse: collapse; font-family: var(--serif); font-size: 1.05rem; margin: 0 auto; width: max-content; max-width: 100%; }
table.tt caption { caption-side: top; text-align: left; font-family: var(--sans); font-size: .8125rem; color: var(--ink-2); padding-bottom: .4rem; }
table.tt th, table.tt td { padding: .3rem .7rem; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.tt th { font-weight: 400; border-bottom: 2px solid var(--line-2); }
table.tt th.sep, table.tt td.sep { border-left: 2px solid var(--line-2); }
table.tt .main { background: var(--accent-soft); font-weight: 600; }
table.tt tr:last-child td { border-bottom: 0; }
table.tt button.cell {
  width: 2.4rem; height: 2.1rem; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); cursor: pointer; font: inherit; font-size: 1.05rem;
}
table.tt button.cell:hover { border-color: var(--accent); }
table.tt button.cell.ok { background: var(--good-soft); border-color: var(--good); }
table.tt button.cell.no { background: var(--bad-soft); border-color: var(--bad); }

/* inline checks */
.check { border: 1px solid var(--line-2); border-radius: 12px; padding: .9rem 1.1rem; margin: 1.5rem 0; background: var(--surface); font-family: var(--sans); font-size: .9375rem; }
.check .label { margin-bottom: .4rem; }
.check .q { font-family: var(--serif); font-size: 1.1rem; margin-bottom: .6rem; }
.choices { display: grid; gap: .5rem; }
.choice {
  display: grid; grid-template-columns: 1.75rem 1fr; align-items: center; gap: .6rem; text-align: left;
  padding: .6rem .75rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); cursor: pointer;
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.4; transition: background var(--dur), border-color var(--dur);
}
.choice .letter { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 6px; background: var(--bg-2); font: 600 .8rem var(--sans); color: var(--ink-2); }
.choice:hover:not(:disabled) { background: var(--bg-2); border-color: var(--ink-2); }
.choice:disabled { cursor: default; }
.choice.correct { border-color: var(--good); background: var(--good-soft); }
.choice.correct .letter { background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.wrong .letter { background: var(--bad); color: #fff; }
.feedback { margin-top: .75rem; padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); animation: rise var(--dur) var(--ease); }
.feedback.ok { border-color: var(--good); }
.feedback.no { border-color: var(--bad); }
.feedback b { display: block; margin-bottom: .25rem; }
.feedback.ok b { color: var(--good); }
.feedback.no b { color: var(--bad); }
.feedback p { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 .6rem; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.cta { margin: 2.5rem 0 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.cta p { margin: 0 0 .8rem; color: var(--ink-2); }
.exercises { margin: 1rem 0 0 !important; font-size: .875rem; }
.prevnext { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .875rem; }
.prevnext a { text-decoration: none; max-width: 48%; }
.prevnext .label { display: block; }

/* ---------- quiz ---------- */
.quiz .kicker { font-size: .8125rem; color: var(--ink-2); font-weight: 500; }
.progress { display: flex; justify-content: space-between; font-size: .8125rem; color: var(--ink-2); margin: .5rem 0 .35rem; font-variant-numeric: tabular-nums; }
.question { font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; margin: 1.25rem 0 1rem; text-wrap: pretty; }
.hint { color: var(--ink-2); font-size: .8125rem; margin-top: .8rem; }
kbd { font: 500 .75rem var(--sans); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; background: var(--bg-2); }

.result { text-align: center; margin: 1.5rem 0; }
.result .score { font-size: 3rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.result .score.pass { color: var(--good); }
.result .score.fail { color: var(--bad); }
.result .verdict { margin-top: .5rem; color: var(--ink-2); }
.missed { list-style: none; padding: 0; margin: 0; }
.missed li { padding: .9rem 0; border-top: 1px solid var(--line); }
.missed .q { font-family: var(--serif); font-size: 1.05rem; }
.missed .ans { color: var(--good); font-family: var(--serif); margin: .2rem 0; }
.missed .why { color: var(--ink-2); font-family: var(--serif); font-size: 1rem; margin: 0; }
table.plain { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .9375rem; }
table.plain td, table.plain th { padding: .5rem .4rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.plain td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.plain th { font-size: .75rem; color: var(--ink-2); font-weight: 600; }

/* ---------- practice ---------- */
.tools { display: grid; gap: .75rem; margin-top: 1rem; }
@media (min-width: 640px) { .tools { grid-template-columns: 1fr 1fr; } }
.tool { display: block; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; }
.tool:hover { border-color: var(--accent); color: inherit; }
.tool h2 { margin: 0 0 .25rem; font-size: 1.05rem; }
.tool p { margin: 0; color: var(--ink-2); font-size: .875rem; }
.tool .glyph { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); line-height: 1; margin-bottom: .4rem; }
.tool .stat { display: block; margin-top: .6rem; font-size: .8125rem; color: var(--ink-2); }
.formula-big { font-family: var(--serif); font-size: 1.6rem; text-align: center; margin: 1rem 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--bg); padding: .35rem .8rem; cursor: pointer; font-size: .875rem; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .5rem 0 1rem; }
.classify { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.verdict-line { margin: .75rem 0; font-weight: 500; }
.verdict-line.ok { color: var(--good); }
.verdict-line.no { color: var(--bad); }

/* ---------- reference ---------- */
.ref h2 { margin-top: 2rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.rules { display: grid; gap: .75rem; }
@media (min-width: 700px) { .rules { grid-template-columns: 1fr 1fr; } }
.rules .rule { margin: 0; }
.rules .from-to { font-family: var(--serif); font-size: 1.05rem; margin-top: .4rem; }
.rules .from-to .arr { color: var(--ink-2); margin: 0 .5rem; font-family: var(--sans); font-size: .8rem; }
.rules .cond { font-size: .8125rem; color: var(--ink-2); margin-top: .35rem; }
table.forms { width: 100%; border-collapse: collapse; margin: .75rem 0 1rem; font-size: .9375rem; }
table.forms td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.forms td:first-child { color: var(--ink-2); font-size: .875rem; white-space: nowrap; }
table.forms td.f { font-size: 1.05rem; white-space: normal; }
table.forms td.arr { color: var(--ink-2); text-align: center; width: 2rem; }
.gloss dt { font-weight: 600; margin-top: .8rem; }
.gloss dd { margin: .15rem 0 0; font-family: var(--serif); font-size: 1.05rem; }
.symbols { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .4rem .75rem; margin: .75rem 0; }
.symbols div { display: flex; gap: .6rem; align-items: baseline; font-size: .875rem; color: var(--ink-2); }
.symbols .f { font-size: 1.25rem; color: var(--ink); min-width: 1.5rem; flex: 0 0 auto; }
.search { width: 100%; padding: .6rem .8rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; margin: .5rem 0 1rem; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-2); }
.empty h1 { color: var(--ink); }
.option { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.15rem; margin: 1rem 0; background: var(--surface); }
.option h3 { margin: 0 0 .25rem; }
.option p { color: var(--ink-2); margin: 0 0 .8rem; font-size: .9rem; }

/* small screens: keep the top bar on one line */
@media (max-width: 600px) {
  .top { padding: 0 .75rem; gap: .5rem; }
  .brand { font-size: 1rem; gap: .35rem; }
  .brand .mark { font-size: 1.3rem; }
  .topnav { gap: 0; }
  .topnav a { padding: .4rem .45rem; font-size: .8125rem; }
  .main { padding: 1.25rem 1rem 3.5rem; }
  .prose { font-size: 1.0625rem; }
  .lesson-head h1 { font-size: 1.55rem; }
  .question { font-size: 1.15rem; }
}

sup { font-size: .72em; line-height: 0; vertical-align: super; }
