/* Used by: Calc, ASVAB (whole file) */
/* twimoon-app.css — the ONE stylesheet for every twimoon tool (themes, text sizes, fonts, menu, questions, metrics, drills).
   Built on twimoon-lsat.css (same tokens and components). Shared file: one owner, test every tool before deploying a change. */
:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}[hidden]{display:none!important}
:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --ink: #1a1d2b;
  --muted: #5d6378;
  --line: #dfe2ea;
  --stim: #eceef5;
  --accent: #4a46a8;
  --accent-ink: #ffffff;
  --accent-soft: #e7e6f7;
  --right: #23805a;
  --right-soft: #e3f3ea;
  --wrong: #b5443a;
  --wrong-soft: #f8e6e3;
  --hl-concl: #ddd9ff;
  --hl-prem: #2d7f8f;
  --hl-sig: #8a5d00;
  --hl-pivot: #b5443a;

  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs: 17px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12131c; --surface: #1a1c28; --ink: #e6e8f0; --muted: #9ba1b5; --line: #2b2e3d; --stim: #222534;
    --accent: #a7a3ff; --accent-ink: #12131c; --accent-soft: #2a2950; --right: #6fcf9f; --right-soft: #183427;
    --wrong: #ef8f86; --wrong-soft: #3a2220; --hl-concl: #3a3870; --hl-prem: #6cc4d4; --hl-sig: #e0b44d; --hl-pivot: #ef8f86;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12131c; --surface: #1a1c28; --ink: #e6e8f0; --muted: #9ba1b5; --line: #2b2e3d; --stim: #222534;
  --accent: #a7a3ff; --accent-ink: #12131c; --accent-soft: #2a2950; --right: #6fcf9f; --right-soft: #183427;
  --wrong: #ef8f86; --wrong-soft: #3a2220; --hl-concl: #3a3870; --hl-prem: #6cc4d4; --hl-sig: #e0b44d; --hl-pivot: #ef8f86;
  color-scheme: dark;
}
:root[data-size="s"] { --fs: 15px; }
:root[data-size="m"] { --fs: 17px; }
:root[data-size="l"] { --fs: 19px; }
:root[data-size="xl"] { --fs: 21px; }
:root[data-font="literata"] { --font-read: "Literata", Georgia, serif; }
:root[data-font="sourceserif"] { --font-read: "Source Serif 4", Georgia, serif; }
:root[data-font="plex"] { --font-read: "IBM Plex Sans", system-ui, sans-serif; }
:root[data-font="atkinson"] { --font-read: "Atkinson Hyperlegible", system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: var(--fs); line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 112px;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg);
  max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding-block: 10px;
}
.brand { font-weight: 600; letter-spacing: 0.01em; font-size: 0.95em; white-space: nowrap; }
.brand span { color: var(--accent); }
.step { flex: 1; min-width: 0; text-align: center; font-size: 0.78em; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; display: grid; place-content: center; gap: 4px; cursor: pointer; }
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

/* Screen */
.screen { max-width: 680px; margin: 0 auto; display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 14px; min-width: 0; }
.ask { margin: 0; font-weight: 600; }
.stim {
  margin: 0; background: var(--stim); border-radius: 10px; padding: 14px 16px;
  font-family: var(--font-read); font-size: 1.04em; line-height: 1.65; font-size-adjust: 0.52;
}
.choices { display: grid; gap: 8px; }
.choice {
  width: 100%; min-height: 52px; padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; line-height: 1.35;
}
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice:disabled { cursor: default; }
.choice.right { border-color: var(--right); background: var(--right-soft); }
.choice.wrong { border-color: var(--wrong); background: var(--wrong-soft); }
/* Right and wrong are never shown by color alone (brand bible): an icon marks each. */
.choice.right::after { content: " ✅"; }
.choice.wrong::after { content: " ❌"; }
.choice.none { color: var(--muted); }

.feedback { display: grid; gap: 10px; }
.verdict { margin: 0; font-weight: 700; font-size: 1.05em; }
.verdict.right { color: var(--right); }
.verdict.wrong { color: var(--wrong); }
.kv { margin: 0; }
.kv b { font-weight: 600; }
.type-tag { font-size: 0.78em; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Highlights: each uses form as well as color */
.h-concl { background: var(--hl-concl); font-weight: 600; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 0 2px; }
.h-prem { text-decoration: underline; text-decoration-color: var(--hl-prem); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.h-sig { color: var(--hl-sig); font-style: italic; font-weight: 600; }
.h-pivot { color: var(--hl-pivot); font-style: italic; font-weight: 600; text-decoration: underline wavy; text-underline-offset: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8em; color: var(--muted); margin: 0; }
.legend span { white-space: nowrap; }

/* Next bar */
.next-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.primary {
  display: block; width: 100%; max-width: 680px; margin: 0 auto; min-height: 54px; border: none; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 1em; cursor: pointer;
}
/* Next after a question is answered: a ring, plus a short pulse where motion is allowed. Space / Enter work only now. */
.primary.ready { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .primary.ready { animation: nextPulse 900ms ease-out 2; }
  @keyframes nextPulse { 50% { outline-offset: 7px; } }
}

/* Reading comprehension */
.rc-passage p { margin: 0 0 0.85em; }
.rc-passage p:last-child { margin-bottom: 0; }
.rcq { scroll-margin-top: 72px; }
.choice .ltr { font-weight: 600; margin-right: 10px; color: var(--muted); }
.rc-label { font-family: var(--font-ui); font-size: 0.72em !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0.4em 0 0.35em !important; }
.rc-label:first-child { margin-top: 0 !important; }

/* RC lesson highlights: seven roles from twimoon-rc-lessons.json. Each pairs a tint with a form, so none relies on color alone. */
:root {
  --rh-claim: #d7e6ff; --rh-signal: #ece0ff; --rh-evidence: #d9f0dc; --rh-view: #ffe3c7;
  --rh-concession: #e4e5ea; --rh-target: #fff0a3; --rh-trap: #ffd6d2; --rh-trap-line: #b5443a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --rh-claim: #233a63; --rh-signal: #3d2a5e; --rh-evidence: #1f4229; --rh-view: #573a1c;
    --rh-concession: #34374a; --rh-target: #5a4d12; --rh-trap: #5c2420; --rh-trap-line: #ef8f86;
  }
}
:root[data-theme="dark"] {
  --rh-claim: #233a63; --rh-signal: #3d2a5e; --rh-evidence: #1f4229; --rh-view: #573a1c;
  --rh-concession: #34374a; --rh-target: #5a4d12; --rh-trap: #5c2420; --rh-trap-line: #ef8f86;
}
mark.rh { color: inherit; border-radius: 3px; padding: 0 1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.rh-claim { background: var(--rh-claim); font-weight: 600; }
.rh-signal { background: var(--rh-signal); font-style: italic; }
.rh-evidence { background: var(--rh-evidence); text-decoration: underline; text-underline-offset: 3px; }
.rh-view { background: var(--rh-view); text-decoration: underline dotted; text-underline-offset: 3px; }
.rh-concession { background: var(--rh-concession); }
.rh-target { background: var(--rh-target); outline: 1.5px solid currentColor; outline-offset: 0; }
.rh-trap { background: var(--rh-trap); text-decoration: underline wavy var(--rh-trap-line); text-underline-offset: 3px; }
.rc-caps { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.rc-caps mark { font-family: var(--font-read); }
.rc-strat h3 { margin: 0 0 4px; font-size: 1em; }
.rc-strat ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.rc-stem { margin: 0 0 4px; font-style: italic; }

/* Lessons */
.lesson dl { margin: 0; display: grid; gap: 12px; }
.lesson dt { font-size: 0.72em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lesson dd { margin: 3px 0 0; min-width: 0; }
.lesson h2 { margin: 0; font-size: 1.3em; line-height: 1.2; text-wrap: balance; }
.lesson .kicker { margin: 0; font-size: 0.75em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.shape { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; }
.take { font-weight: 600; }
.lesson-read { font-family: var(--font-read); font-size-adjust: 0.52; }

.list { display: grid; gap: 18px; }
.group h3 { margin: 0 0 8px; font-size: 0.78em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.group button {
  width: 100%; text-align: left; min-height: 48px; padding: 10px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.group button .seen { font-size: 0.75em; color: var(--muted); white-space: nowrap; }
.back { justify-self: start; background: none; border: none; color: var(--accent); cursor: pointer; padding: 6px 0; font-weight: 500; min-height: 40px; }

.summary { text-align: center; }
.summary .big { font-size: 2.4em; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }

/* Menu */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.35); z-index: 20; }
.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: min(340px, 88vw); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line);
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 18px;
  display: grid; align-content: start; gap: 18px;
}
.menu-head { display: flex; justify-content: space-between; align-items: center; }
.menu-head h2 { margin: 0; font-size: 1.1em; }
.close { width: 44px; height: 44px; border: none; background: none; font-size: 1.1em; cursor: pointer; }
fieldset { border: none; margin: 0; padding: 0; display: grid; gap: 4px; }
legend { font-size: 0.72em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; padding: 0; }
fieldset > label { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; font-weight: 500; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.f-literata { font-family: "Literata", Georgia, serif; }
.f-sourceserif { font-family: "Source Serif 4", Georgia, serif; }
.f-plex { font-family: "IBM Plex Sans", system-ui, sans-serif; }
.f-atkinson { font-family: "Atkinson Hyperlegible", system-ui, sans-serif; }
.menu-note { margin: 0; font-size: 0.8em; color: var(--muted); }
.app-info { padding-top: 10px; border-top: 1px solid var(--line); }

/* Your progress (metrics).
   Chart colors are their own tokens. By default they follow the theme's colors, so light and dark work with no
   extra rules. A new color scheme can set any of them in its own theme block to tune the charts. */
:root {
  --ch-bar: var(--accent); --ch-bar-soft: var(--accent-soft); --ch-line: var(--right); --ch-warn: var(--wrong);
  --ch-track: var(--stim); --ch-grid: var(--line); --ch-text: var(--ink); --ch-muted: var(--muted); --ch-tile: var(--bg);
}
.metrics-btn { font-size: 1em; font-weight: 600; min-height: 48px; }
.share-text { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--stim); font-size: 0.9em; overflow-wrap: anywhere; }
.share-url { color: var(--accent); font-weight: 600; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* Achievements */
.ach-notice {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 66px);
  width: min(460px, calc(100vw - 32px)); display: flex; gap: 12px; align-items: flex-start; text-align: left;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--accent); background: var(--surface); color: var(--ink);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); font-size: 0.9em; line-height: 1.35; cursor: pointer;
}
.ach-notice .ach-star { color: #d9a300; font-size: 1.5em; line-height: 1; }
@media (prefers-reduced-motion: no-preference) { .ach-notice:not([hidden]) { animation: rise 220ms ease-out; } }
.ach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ach { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.ach.earned { border-color: var(--accent); background: var(--accent-soft); }
.ach-icon { font-size: 1.6em; line-height: 1; color: var(--muted); }
.ach.earned .ach-icon { color: #d9a300; }
.ach-body { min-width: 0; }
.ach-name { margin: 0; font-weight: 700; }
.ach-date { display: block; font-weight: 500; font-size: 0.75em; color: var(--muted); }
.ach-desc { margin: 2px 0 0; font-size: 0.85em; color: var(--muted); }
.ach:not(.earned) .ach-name { color: var(--muted); }
.ach-bar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--ch-track, var(--stim)); vertical-align: middle; margin-top: 6px; overflow: hidden; }
.ach-bar span { display: block; height: 100%; background: var(--accent); }
.ach-prog { font-size: 0.75em; color: var(--muted); margin-left: 8px; vertical-align: middle; }
.ach-share { min-height: 36px; padding: 4px 12px; }
/* Challenges */
.ch-nick { display: grid; gap: 4px; font-size: 0.85em; }
.ch-nick input { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.ch-head { margin: 6px 0 0; font-weight: 700; }
.mtable tr.me td { background: var(--accent-soft); font-weight: 600; }
.mtable td.rank, .mtable td.rank:first-child { min-width: 0; width: 2.2em; text-align: center; font-variant-numeric: tabular-nums; }
.mtable td.rank + td { width: 100%; }
.ch-rev { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.ch-rev summary { cursor: pointer; font-weight: 600; }
.ch-rev[open] { display: grid; gap: 8px; }
.ch-rev .ok { color: var(--right); } .ch-rev .no { color: var(--wrong); }
.ch-rev .sub { display: block; font-size: 0.85em; color: var(--muted); margin-top: 2px; }
.kv.ch-right { border-left: 3px solid var(--right); padding-left: 8px; }
.kv.ch-wrong { border-left: 3px solid var(--wrong); padding-left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.msec h2 { margin: 0; font-size: 1.15em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--ch-tile); }
.tile-big { margin: 0; font-size: 1.6em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile-small { margin: 2px 0 0; font-size: 0.78em; color: var(--muted); }
.m-export { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chart { width: 100%; max-width: 560px; height: auto; display: block; }
.ch-label { fill: var(--ch-text); font: 11.5px var(--font-ui); }
.ch-label.small { font-size: 10px; fill: var(--ch-muted); }
.ch-value { fill: var(--ch-muted); font: 600 11px var(--font-ui); }
.ch-track { fill: var(--ch-track); }
.ch-bar { fill: var(--ch-bar); }
.ch-bar.soft { fill: var(--ch-bar-soft); stroke: var(--ch-bar); stroke-width: 1; }
.ch-bar.warn { fill: var(--ch-warn); }
.ch-grid { stroke: var(--ch-grid); stroke-dasharray: 3 3; }
.ch-line { fill: none; stroke: var(--ch-line); stroke-width: 2.5; }
.ch-dot { fill: var(--ch-line); }
.ch-key { margin: 0; font-size: 0.78em; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.key-bar { display: inline-block; width: 12px; height: 10px; background: var(--ch-bar-soft); border: 1px solid var(--ch-bar); border-radius: 2px; }
.key-line { display: inline-block; width: 16px; height: 3px; background: var(--ch-line); border-radius: 2px; margin-left: 8px; }
.tbl-wrap { overflow-x: auto; }
.mtable { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.mtable th { text-align: left; font-size: 0.8em; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mtable td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mtable td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mtable td:first-child { min-width: 7.5em; }
.mtable td .sub { display: block; font-size: 0.82em; color: var(--muted); }
.mtable th:not(:first-child) { text-align: right; }
.cell-bar { display: inline-block; width: 46px; height: 7px; border-radius: 4px; background: var(--ch-track); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.cell-bar span { display: block; height: 100%; background: var(--ch-bar); }
.debug { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.72em; padding: 8px; border: 1px dashed var(--wrong); border-radius: 8px; overflow-wrap: anywhere; display: grid; gap: 4px; }

/* Progress code: popup and menu section */
.code-scrim { z-index: 30; }
.code-box {
  position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 12px;
}
.code-box h2 { margin: 0; font-size: 1.2em; }
.code-box p { margin: 0; }
.code-big {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.15em; font-weight: 600; text-align: center;
  padding: 12px; border-radius: 10px; background: var(--accent-soft); user-select: all; -webkit-user-select: all; overflow-wrap: anywhere;
}
.code-menu .code-big { font-size: 1em; padding: 10px; }
.code-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ghost {
  display: grid; place-items: center; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--accent); font-weight: 500; text-decoration: none; text-align: center; cursor: pointer; font-size: 0.9em;
}
.code-menu { display: grid; gap: 10px; }
.linkish { background: none; border: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.linkish.small { font-size: 0.8em; justify-self: start; min-height: 32px; }
.menu-note.warn { color: var(--wrong); }
.bk-panel { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.bk-head { margin: 4px 0 0; font-weight: 600; font-size: 0.9em; }
.bk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bk-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 0.85em; }
.code-form { display: grid; gap: 6px; margin: 4px 0 0; }
.code-form label { font-size: 0.85em; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.code-row input {
  min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise 180ms ease-out; }
  @keyframes rise { from { transform: translateY(6px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}

/* Practice tests */
.choice.picked { border-color: var(--accent); background: var(--accent-soft); }
.test-row { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.test-row:first-of-type { border-top: none; }
.ch-nick input[type=date] { max-width: 220px; }
.today-banner { max-width: 680px; margin: 0 auto 12px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-weight: 500; }
.today-banner a { color: var(--accent); font-weight: 600; }
.msec td a { color: var(--accent); font-weight: 600; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* LSAT resources */
.res-item { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.res-item:first-of-type { border-top: none; }
.res-head { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.res-head a { color: var(--accent); font-weight: 600; }
.res-price { font-weight: 600; color: var(--ink); font-size: 0.92em; }
.res-tiers { margin: 6px 0 2px; padding-left: 1.1em; display: grid; gap: 4px; font-size: 0.92em; }
.res-tiers .sub { display: block; color: var(--muted); font-size: 0.92em; }
.res-fine { font-style: italic; }

/* QR codes and study groups */
.qr-box { background: #fff; border-radius: 12px; padding: 8px; width: min(260px, 70vw); margin: 4px auto; }
.qr-box svg { display: block; width: 100%; height: auto; }
.focus-chip { white-space: nowrap; color: var(--accent); }
.school-logo { display: block; max-width: 140px; max-height: 90px; object-fit: contain; border-radius: 8px; }
.school-logo.small { max-width: 64px; max-height: 40px; }
.team-head { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--accent-soft); color: var(--ink); border: none; border-radius: 12px; padding: 10px 12px; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.team-head img { max-width: 56px; max-height: 40px; object-fit: contain; border-radius: 6px; background: #fff; }
/* School groups (LSAT, GMAT, GRE): keep the logo picker and the member table inside the card on a phone. */
.ch-nick { grid-template-columns: minmax(0, 1fr); }
.ch-nick input[type=file] { max-width: 100%; min-height: 0; font-size: 14px; }
.share-url { overflow-wrap: anywhere; }
.share-block { display: grid; gap: 6px; margin-top: 8px; }
.code-big.small { font-size: 1.05em; }
.dev-notice { display: grid; gap: 4px; border-color: var(--wrong); z-index: 16; }
.dev-notice p { margin: 0; }
.sp-label { margin: 0; font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sp-img { display: block; max-width: 100%; max-height: 160px; object-fit: contain; border-radius: 10px; margin: 0 auto; }
p.stim { white-space: pre-line; }   /* keeps the line break between speakers in two-speaker passages */

/* ---------- Additions (first made for ASVAB) ---------- */
.empty { margin: 0; color: var(--muted); }
.know-btn { min-height: 44px; padding: 0 14px; border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 10px; font-weight: 600; font-size: 0.85em; cursor: pointer; white-space: nowrap; }
.level-pop { position: fixed; right: 12px; z-index: 40; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: min(320px, calc(100vw - 24px)); padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.level-pop button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 6px 8px; text-align: center; font: inherit; font-weight: 600; line-height: 1.2; color: var(--ink); background: var(--bg, transparent); border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.level-pop button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.level-pop button:disabled { color: var(--muted); border-style: dashed; cursor: default; font-weight: 500; }
.level-pop small { font-size: 0.72em; font-weight: 500; margin-top: 2px; }
.level-pop .level-sep { grid-column: 1 / -1; height: 1px; margin: 2px 0; background: var(--line); }
.level-pop button:last-child:nth-child(even) { grid-column: 1 / -1; }
.know { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 1.15em; table-layout: fixed; }
.know th { font-size: 0.6em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0 8px 8px; font-weight: 600; }
.know td { padding: 10px 8px; border-top: 1px solid var(--line); font-weight: 600; height: 2.6em; }
.drill-btn { justify-self: start; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent); border-radius: 10px; font-weight: 600; cursor: pointer; }
.drill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.drill-time { margin: 0; font-weight: 700; font-size: 1.15em; font-variant-numeric: tabular-nums; }
.drill-note { margin: 0; color: var(--muted); }
.drill-in { width: 100%; min-width: 0; font: inherit; font-weight: 600; padding: 4px 8px; border: 2px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--ink); }
.drill-results { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drill-results dd { margin: 3px 0 0; font-size: 2.2em; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes glowRight { from { background: var(--right-soft); } to { background: transparent; } }
@keyframes glowWrong { from { background: var(--wrong-soft); } to { background: transparent; } }
.know tr.flash-right td { animation: glowRight 1s ease-out; }
.know tr.flash-wrong td { animation: glowWrong 1.6s ease-out; }
.know tr.slow td { animation-duration: 2.4s; }
.site-foot { max-width: 680px; margin: 24px auto 0; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: 0.75em; color: var(--muted); }
.stim { overflow-wrap: anywhere; }
.choice { font-variant-numeric: tabular-nums; }

/* Parallel Set (twimoon-parallel.js). Colors from the Parallel Set drawing: A pink, B blue, transversal purple. */
:root { --ps-a: #db2777; --ps-b: #0284c7; --ps-t: #7c3aed; --ps-line: #334155; --ps-c: #16a34a; --ps-d: #d97706; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ps-a: #f472b6; --ps-b: #38bdf8; --ps-t: #a78bfa; --ps-line: #cbd5e1; --ps-c: #4ade80; --ps-d: #fbbf24; } }
:root[data-theme="dark"] { --ps-a: #f472b6; --ps-b: #38bdf8; --ps-t: #a78bfa; --ps-line: #cbd5e1; --ps-c: #4ade80; --ps-d: #fbbf24; }
.ps-box { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ps-svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; font-family: var(--font-ui); }
.ps-t { stroke: var(--ps-t); stroke-width: 5; stroke-linecap: round; }
.ps-l { stroke: var(--ps-line); stroke-width: 5; stroke-linecap: round; pointer-events: none; }
.ps-hit { stroke: transparent; stroke-width: 48; stroke-linecap: round; cursor: grab; }
.ps-line.grab .ps-l { stroke-width: 7; }
.ps-line.grab .ps-hit { cursor: grabbing; }
path.ps-a { fill: color-mix(in srgb, var(--ps-a) 22%, transparent); stroke: var(--ps-a); stroke-width: 3; }
path.ps-b { fill: color-mix(in srgb, var(--ps-b) 22%, transparent); stroke: var(--ps-b); stroke-width: 3; }
path.ps-c { fill: color-mix(in srgb, var(--ps-c) 22%, transparent); stroke: var(--ps-c); stroke-width: 3; }
path.ps-d { fill: color-mix(in srgb, var(--ps-d) 22%, transparent); stroke: var(--ps-d); stroke-width: 3; }
.ps-shapes path { stroke-linejoin: round; transition: fill .25s; }
.ps-svg.par .ps-shapes path { animation: psSnap .5s ease-out; }
@keyframes psSnap { from { stroke-width: 7; } }
.ps-k { font-size: 31px; font-weight: 700; text-anchor: middle; pointer-events: none; }
text.ps-a { fill: var(--ps-a); } text.ps-b { fill: var(--ps-b); } text.ps-c { fill: var(--ps-c); } text.ps-d { fill: var(--ps-d); }
.ps-name { font-size: 25px; font-style: italic; fill: var(--ps-line); text-anchor: middle; pointer-events: none; }
.ps-name.t { fill: var(--ps-t); }
.ps-status { margin: 0; text-align: center; font-weight: 700; font-size: 1.15em; }
.ps-rule { margin: 0; text-align: center; font-weight: 600; }
.ps-rule .a { color: var(--ps-a); } .ps-rule .b { color: var(--ps-b); } .ps-rule .c { color: var(--ps-c); } .ps-rule .d { color: var(--ps-d); }
.ps-rule b { font-weight: 700; }

/* Know cold: Pythagorean triples table */
.know-h { margin: 6px 0 0; font-size: 1em; }
.know.tri { table-layout: fixed; font-size: 0.9em; }
.know.tri th { text-align: center; font-size: 0.8em; width: 25%; padding: 0 2px 6px; text-transform: none; letter-spacing: 0; }
.know.tri td { text-align: center; white-space: nowrap; padding: 10px 2px; border-left: 2px solid var(--line); }
.know.tri td:first-child { border-left: 0; }
.know.tri td.base { color: var(--accent); }
.know.tri .dot { margin: 0 1px; color: var(--muted); font-weight: 400; }
.know.tri .drill-form { display: inline; }
.know.tri .drill-in { width: 2.2em; padding: 2px 4px; text-align: center; }
.know td.flash-right { animation: glowRight 1s ease-out; }
.know td.flash-wrong { animation: glowWrong 1.6s ease-out; }
.know td.slow { animation-duration: 2.4s; }

/* Absolute value drill */
.abs-expr { margin: 6px 0; font-size: 2em; font-weight: 700; font-variant-numeric: tabular-nums; }
.typed-in { max-width: 8em; font-size: 1.4em; }
.typed-steps { display: grid; gap: 4px; }
.typed-steps p { margin: 0; font-size: 1.1em; font-weight: 600; font-variant-numeric: tabular-nums; }
.mean-set { margin: 6px 0; font-size: 1.6em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.4; }

/* Median drills */
.med-piles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.med-piles > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--stim); }
.med-h { margin: 0; font-size: .75em; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.med-p { margin: 2px 0 0; font-size: 1.2em; font-weight: 700; font-variant-numeric: tabular-nums; }
.med-now { color: var(--accent); text-decoration: underline; }
.med-done { color: var(--muted); font-weight: 400; }
.med-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.med-btns button { min-height: 52px; font-size: 1.05em; }

/* Count-by drills */
.cb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cb-grid button { min-height: 52px; font-size: 1.2em; font-weight: 700; }
.know.cb td { padding: 6px 8px; height: 2.2em; }
.cb-in { width: 3.2em; padding: 2px 6px; }
.know.cb th { text-transform: none; letter-spacing: 0; font-size: .75em; }
.know tr.cb-now td { background: var(--accent-soft); }
.know.cb-card td { font-size: 1.6em; height: 2em; }

/* Shape drawings (perimeter) */
.shape { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }
.sh-r { fill: var(--accent-soft); stroke: var(--ink); stroke-width: 2.5; }
.sh-t { fill: var(--ink); font: 700 17px var(--font-ui); }
.typed-in.fast-right { border-color: var(--right); background: var(--right-soft); }
.part-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.1em; font-weight: 600; }
.part-in { width: 4.5em; }
.typed-steps p.part-wrong { color: var(--wrong); }

/* Question figures (twimoon-figure-view.js draws them with twimoon-visuals.js/.css). The engine's own light and
   dark palettes are used; the figure background and font follow the app. */
.twa-fig { width: 100%; max-width: 460px; margin: 0 auto; min-width: 0; }
.twa-fig .satv-svg { --satv-bg: var(--surface); --satv-font: var(--font-ui); }
.mistake-note { margin: 0; color: var(--wrong); font-weight: 600; }
.explain-note { margin: 0; color: var(--muted); }

/* History and review */
.hist-filter { margin: 8px 0 4px; grid-template-columns: 1fr 1fr; }
.hist-filter span { white-space: nowrap; padding: 0 10px; }
.hist-list { display: grid; gap: 8px; }
.hist-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.hist-row.miss { border-color: var(--wrong); background: var(--wrong-soft); }
.hist-mark { font-weight: 700; color: var(--right); }
.hist-row.miss .hist-mark { color: var(--wrong); }
.hist-main { display: grid; gap: 2px; min-width: 0; }
.hist-topic { font-size: 0.78em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.hist-q { font-size: 0.92em; overflow-wrap: anywhere; }
.hist-a { font-size: 0.85em; font-weight: 600; }
.hist-when { font-size: 0.75em; color: var(--muted); white-space: nowrap; }
.hist-choice { display: grid; gap: 4px; }
.hist-choice .choice { cursor: default; }
.hist-you { font-size: 0.8em; font-weight: 600; color: var(--wrong); }
.choice.right .hist-you { color: var(--right); }
.hist-why { margin: 0 0 4px 12px; font-size: 0.9em; color: var(--muted); }

/* Topic picker (menu) */
.topic-sel { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.topic-sel:disabled { color: var(--muted); }

/* Drills: skip ahead */
.stage-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.stage-row .ghost { flex: 1 1 auto; }
.skip-row { margin: 12px 0 0; font-size: 0.9em; color: var(--muted); }
.know.cb tr.cb-fading td { animation: cb-fade 0.5s ease-out forwards; }
.know.cb tr.cb-gone td { opacity: 0; }
@keyframes cb-fade { to { opacity: 0; } }

/* Factor pairs and divisibility drills */
.choice.sel { border-color: var(--accent); background: var(--accent-soft); }
.fact-hints { display: grid; gap: 2px; margin: 4px 0 8px; }
.fact-hints p { margin: 0; color: var(--muted); font-size: 0.92em; }
.fact-opts { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.fact-range { display: flex; gap: 12px; flex-wrap: wrap; }
.fact-range input { width: 5.5em; min-height: 40px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.drill-in.list-in { width: 100%; max-width: 100%; text-align: left; }

/* Used by: ASVAB. Quick drills: "Show me a lesson" under a question */
.qd-lesson { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.qd-lesson summary { color: var(--accent); font-weight: 600; cursor: pointer; min-height: 32px; }
.qd-lesson dl { margin: 8px 0 0; display: grid; gap: 10px; }
.qd-lesson dt { font-size: 0.72em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.qd-lesson dd { margin: 2px 0 0; }

/* Used by: all tools (v1.9.0). Header: "twimoon" links home; the test name opens the parts panel. */
.brand-home { color: inherit; text-decoration: none; }
.brand-home:hover, .brand-home:focus-visible { text-decoration: underline; }
.brand-test { font: inherit; font-weight: inherit; color: var(--accent); background: none; border: 0; padding: 4px 2px; margin: -4px 0; cursor: pointer; border-radius: 6px; }
.brand-test:hover { text-decoration: underline; }
.brand-test:focus-visible, .brand-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-caret { font-size: 0.75em; margin-left: 2px; }
.test-panel { position: fixed; z-index: 30; top: max(56px, calc(env(safe-area-inset-top, 0px) + 56px)); left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 72px); overflow-y: auto; padding: 14px 16px 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22); }
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tp-head h2 { margin: 0; font-size: 1.1em; }
.tp-note { margin: 4px 0 12px; color: var(--muted); font-size: 0.9em; }
.tp-part { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tp-sec { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; font-weight: 600; text-align: left;
  color: var(--ink); background: var(--stim); border: 1.5px solid transparent; border-radius: 10px; cursor: pointer; }
.tp-sec small, .tp-topic small { white-space: nowrap; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tp-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-topic { min-height: 36px; padding: 6px 10px; font: inherit; font-size: 0.9em; color: var(--ink); background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.tp-sec[aria-current="true"], .tp-topic[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tp-sec:hover, .tp-topic:hover { border-color: var(--accent); }
.tp-sec:focus-visible, .tp-topic:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Used by: all tools (v1.11.0). The section name is a button; panels: sections with topic thumbnails, about the test, Learn. */
button.step { font: inherit; font-size: 0.78em; background: none; border: 0; padding: 6px 4px; margin: 0; cursor: pointer; color: var(--muted); border-radius: 6px; }
button.step:not(:empty)::after { content: " ▾"; }
button.step:hover { color: var(--ink); }
button.step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-all-sec { display: block; margin: 10px 0 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; cursor: pointer; text-align: left; min-height: 32px; }
.tp-all-sec[aria-current="true"] { text-decoration: underline; }
.tp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 8px; margin-top: 8px; }
.tp-tile { display: grid; grid-template-rows: auto auto auto; gap: 4px; align-content: start; min-width: 0; padding: 8px; font: inherit; text-align: left; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.tp-tile:hover { border-color: var(--accent); }
.tp-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-tile[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tp-tile-name { font-weight: 600; font-size: 0.88em; line-height: 1.25; }
.tp-tile small { color: var(--muted); font-size: 0.78em; }
.tp-thumb { display: flex; align-items: center; justify-content: center; height: 76px; border-radius: 8px; background: var(--surface); overflow: hidden; }
.tp-thumb svg { width: 100%; height: 100%; max-height: 76px; }
.tp-thumb-fig .satv-note, .tp-thumb-fig text.satv-note { display: none; }
.tp-thumb-glyph { font-size: 1.6em; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; }
.tp-group { margin: 0 0 6px; font-size: 0.8em; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tp-know { margin-bottom: 4px; }
.tp-info { margin-top: 12px; }
.tp-info h3 { margin: 0 0 6px; font-size: 1em; }
.tp-info p { margin: 0 0 8px; }
.tp-info dl { margin: 0; display: grid; gap: 8px; }
.tp-info dt { font-weight: 600; }
.tp-info dd { margin: 2px 0 0; color: var(--muted); }
.tp-table { overflow-x: auto; }
.tp-table table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.tp-table th, .tp-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tp-table thead th { color: var(--muted); font-weight: 600; }
.tp-go { margin-top: 16px; }
.tp-info ul { margin: 0 0 8px; padding-left: 1.2em; } .tp-info li { margin: 2px 0; }
.tp-more { border-top: 1px solid var(--line); padding-top: 10px; }
.tp-more summary { font-weight: 700; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.tp-more[open] summary { margin-bottom: 6px; }

/* Used by: all tools (v1.14.0). twimoon-fonts.js puts the font radios inside <details class="font-group">, so they aren't
   direct children of the fieldset: give them the same one-per-line layout as every other menu radio. */
.font-group > label { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
