/* ==========================================================================
   InterExe — styles on top of theme.css (SAT Practice's design system).
   1. The CSCA exam screen — laid out like the CSCA online exam, sealed in the .cx-engine
      scope: own tokens and cx- class names, so nothing in theme.css reaches it.
   2. App pages (paper intro, result review, account) in SAT Practice's language.
   ========================================================================== */

/* Chinese CONTENT (questions, subject names, HSK words): the device's own Chinese sans —
   the face students see when they type (PingFang / Microsoft YaHei / Noto Sans). It used to
   be a Song (serif) face; students read its brush-shaped stroke ends as handwriting, and its
   webfont (Noto Serif SC) came from Google Fonts, which mainland China blocks. Latin letters
   and digits inside a Chinese question stay in Inter.
   🔴 Matched by [lang="zh"] exactly, never :lang(zh) — with the site in 中文 the <html>
   itself is lang="zh-CN", and :lang(zh) would catch the whole interface. */
:root { --font-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif; }
[lang="zh"], .zh { font-family: "Inter", var(--font-zh); }

/* Site language 中文: the interface keeps SAT Practice's faces and falls back to the same
   Chinese sans for the characters, headings included. */
html[lang="zh-CN"] {
  --font-ui: "Inter", var(--font-zh);
  --font-display: "Fraunces", var(--font-zh);
}

/* ==========================================================================
   1. EXAM SCREEN (.cx-engine) + its confirm dialog + toast
   Laid out like the CSCA online exam (the owner's reference, 2026-10-14): a blue bar,
   a left panel with the candidate card and a numbered question grid (grey =
   unanswered, green = answered, orange = marked), and the question area with
   ★ · Question N (№ id) · Previous / Next · A+ A- · options with radio circles.
   Its own tokens and cx- class names, so nothing in theme.css reaches it.
   ========================================================================== */
.cx-engine, dialog.dlg, .cx-toast {
  --cx-blue: #2d76d0;          /* 4.55:1 behind white text */
  --cx-blue-hover: #2468bf;
  --cx-blue-soft: #a9cbf2;     /* a disabled Previous / Next */
  --cx-green: #25863f;         /* SUBMIT + answered — 4.6:1 */
  --cx-green-hover: #1f7335;
  --cx-orange: #c2540d;        /* marked — 4.6:1 */
  --cx-tile: #71767d;          /* unanswered — white numbers at 4.6:1 */
  --cx-tile-dot: #c3c7cd;
  --cx-star: #f0a020;
  --cx-bg: #ffffff;
  --cx-ink: #1f2328;
  --cx-ink-2: #444b55;
  --cx-muted: #6b7280;
  --cx-line: #e3e6ea;
  --cx-radio: #9aa1ab;
  --cx-font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--cx-font);
  color: var(--cx-ink);
}
[data-theme="dark"] .cx-engine, [data-theme="dark"] dialog.dlg, [data-theme="dark"] .cx-toast {
  --cx-blue-soft: #2c4a70;
  --cx-tile: #5b626c;
  --cx-tile-dot: #4a5059;
  --cx-bg: #15181d;
  --cx-ink: #e6e8eb;
  --cx-ink-2: #bcc2ca;
  --cx-muted: #9aa2ad;
  --cx-line: #2c3139;
  --cx-radio: #6c7480;
}
.cx-engine :focus-visible, dialog.dlg :focus-visible { outline: 2px solid var(--cx-blue); outline-offset: 2px; box-shadow: none; }
.cx-engine .zh, .cx-engine [lang="zh"] { font-family: "Inter", var(--font-zh); }
.cx-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cx-engine {
  position: fixed; inset: 0; height: 100dvh; z-index: 90;
  display: grid; grid-template-columns: 330px minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr);
  grid-template-areas: "top top" "side main";
  background: var(--cx-bg); font-size: 15px; line-height: 1.55;
}

/* ---- the blue bar ---- */
.cx-top { grid-area: top; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: linear-gradient(90deg, #2a6fd0, #3176c3); color: #fff; }
.cx-top-l, .cx-top-r { display: flex; align-items: center; gap: 14px; min-width: 0; position: relative; z-index: 1; }
.cx-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; background: none; border: 0; color: #fff; font: 600 .9rem var(--cx-font); cursor: pointer; }
.cx-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.cx-back .cx-ico { width: 16px; height: 16px; }
.cx-paper { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 20vw; }
.cx-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; font: 700 1.12rem var(--cx-font); letter-spacing: .02em; white-space: nowrap; color: #fff; }
.cx-time-label { font-size: .86rem; font-weight: 500; }
.cx-timer { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 4px; background: rgba(255, 255, 255, .2); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cx-timer.is-low { background: var(--cx-orange); }
.cx-submit { padding: 8px 26px; border: 0; border-radius: 4px; background: var(--cx-green); color: #fff; font: 700 .95rem var(--cx-font); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.cx-submit:hover { background: var(--cx-green-hover); }
.cx-fs { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer; }
.cx-fs:hover { background: rgba(255, 255, 255, .3); }
.cx-fs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-sheet-btn { display: none; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer; }

/* ---- ownership watermark: InterExe tiled + faint centre logo (SAT Practice's, same geometry).
   It owns the MAIN grid cell only, so the left candidate panel stays clean. Pointer-events off, so
   selection and every button still work; it sits beside <main> (not inside), so it doesn't scroll away. ---- */
.cx-wm {
  grid-area: main; position: relative; z-index: 2; pointer-events: none; overflow: hidden;
  background-repeat: repeat; background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='344'%3E%3Cg fill='%23151519' fill-opacity='0.07' font-family='Segoe%20UI,system-ui,Arial,sans-serif' font-size='20' letter-spacing='0.5' text-anchor='middle'%3E%3Ctext x='150' y='95' transform='rotate(-28 150 90)'%3EInterExe%3C/text%3E%3Ctext x='450' y='95' transform='rotate(-28 450 90)'%3EInterExe%3C/text%3E%3Ctext x='150' y='267' transform='rotate(-28 150 262)'%3EInterExe%3C/text%3E%3Ctext x='450' y='267' transform='rotate(-28 450 262)'%3EInterExe%3C/text%3E%3C/g%3E%3C/svg%3E");
}
[data-theme="dark"] .cx-wm { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='344'%3E%3Cg fill='%23ffffff' fill-opacity='0.04' font-family='Segoe%20UI,system-ui,Arial,sans-serif' font-size='20' letter-spacing='0.5' text-anchor='middle'%3E%3Ctext x='150' y='95' transform='rotate(-28 150 90)'%3EInterExe%3C/text%3E%3Ctext x='450' y='95' transform='rotate(-28 450 90)'%3EInterExe%3C/text%3E%3Ctext x='150' y='267' transform='rotate(-28 150 262)'%3EInterExe%3C/text%3E%3Ctext x='450' y='267' transform='rotate(-28 450 262)'%3EInterExe%3C/text%3E%3C/g%3E%3C/svg%3E"); }
.cx-wm-logo { position: absolute; top: 50%; left: 50%; width: min(42vw, 460px); height: auto; transform: translate(-50%, -50%); opacity: .10; user-select: none; -webkit-user-drag: none; }
[data-theme="dark"] .cx-wm-logo { opacity: .04; filter: grayscale(.55); }

/* ---- left panel: candidate card, totals, legend, question grid ---- */
.cx-side { grid-area: side; overflow-y: auto; border-right: 1px solid var(--cx-line); background: var(--cx-bg); }
.cx-close { display: none; }
.cx-cand { display: flex; align-items: center; gap: 14px; padding: 20px 16px 16px; border-bottom: 1px solid var(--cx-line); }
.cx-photo { flex: none; width: 46px; height: 46px; border-radius: 3px; background: var(--cx-tile-dot); }
.cx-photo.has-photo { overflow: hidden; background: none; }
.cx-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cx-cand-info { margin: 0; display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--cx-ink-2); min-width: 0; }
.cx-cand-info div { display: flex; gap: 4px; flex-wrap: wrap; }
.cx-cand-info dt { font-weight: 700; color: var(--cx-ink); }
.cx-cand-info dd { margin: 0; overflow-wrap: anywhere; }
.cx-stats { padding: 12px 16px 14px; border-bottom: 1px solid var(--cx-line); }
.cx-stats-row { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; color: var(--cx-ink-2); }
.cx-stats-row b { color: var(--cx-ink); font-weight: 600; }
.cx-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .76rem; color: var(--cx-muted); }
.cx-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cx-dot { width: 10px; height: 10px; border-radius: 2px; background: var(--cx-tile-dot); }
.cx-dot.is-ans { background: var(--cx-green); }
.cx-dot.is-mark { background: var(--cx-orange); }
.cx-grid { display: grid; grid-template-columns: repeat(5, 48px); gap: 9px 12px; padding: 20px 16px; }
.cx-num { height: 33px; padding: 0; border: 0; border-radius: 2px; background: var(--cx-tile); color: #fff; font: 600 .9rem var(--cx-font); cursor: pointer; transition: filter .12s; }
.cx-num:hover { filter: brightness(1.1); }
.cx-num.is-ans { background: var(--cx-green); }
.cx-num.is-mark { background: var(--cx-orange); }
.cx-num.is-cur { box-shadow: 0 0 0 2px var(--cx-bg), 0 0 0 4px var(--cx-blue); }
.cx-scrim { display: none; }

/* ---- question area ---- */
.cx-main { grid-area: main; overflow-y: auto; padding: 26px 28px 48px; }
.cx-qbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; padding: 10px 20px; border: 1px solid var(--cx-line); border-radius: 4px; }
.cx-star { display: grid; place-items: center; padding: 2px; border: 0; background: none; color: var(--cx-star); cursor: pointer; }
.cx-star .cx-ico { width: 22px; height: 22px; stroke-width: 1.6; }
.cx-star[aria-pressed="true"] .cx-ico { fill: var(--cx-star); }
.cx-qtitle { font-size: 1.12rem; color: var(--cx-ink); white-space: nowrap; }
.cx-nav { display: flex; gap: 12px; }
.cx-btn { min-height: 36px; padding: 6px 20px; border: 0; border-radius: 3px; background: var(--cx-blue); color: #fff; font: 600 .95rem var(--cx-font); cursor: pointer; }
.cx-btn:hover { background: var(--cx-blue-hover); }
.cx-btn:disabled { background: var(--cx-blue-soft); cursor: not-allowed; }
.cx-font { display: flex; gap: 14px; }
.cx-fbtn { padding: 2px 4px; border: 0; background: none; color: var(--cx-blue); font: 700 1.2rem var(--cx-font); line-height: 1; cursor: pointer; }
.cx-fbtn sup { font-size: .55em; }
.cx-fbtn:disabled { opacity: .35; cursor: not-allowed; }
.cx-lang { margin-left: auto; display: inline-flex; border: 1px solid var(--cx-line); border-radius: 4px; overflow: hidden; }
.cx-lang button { padding: 5px 12px; border: 0; background: none; color: var(--cx-muted); font: 600 .84rem var(--cx-font); cursor: pointer; }
.cx-lang button[aria-pressed="true"] { background: var(--cx-blue); color: #fff; }
.cx-q { margin-top: 22px; }
.cx-stem { margin-bottom: 26px; font-size: calc(15.5px * var(--cx-fs, 1)); line-height: 1.65; color: var(--cx-ink); }
.cx-stem.zh { line-height: 1.85; }
.cx-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 40px; }
.cx-opts.is-wide { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cx-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 4px; border: 0; border-radius: 4px; background: none; color: var(--cx-ink); font: 400 calc(15.5px * var(--cx-fs, 1)) / 1.5 var(--cx-font); text-align: left; cursor: pointer; }
.cx-opt:hover .cx-radio { border-color: var(--cx-blue); }
.cx-radio { position: relative; flex: none; width: 16px; height: 16px; border: 1.5px solid var(--cx-radio); border-radius: 50%; background: var(--cx-bg); }
.cx-opt[aria-checked="true"] .cx-radio { border-color: var(--cx-blue); }
.cx-opt[aria-checked="true"] .cx-radio::after { content: ""; position: absolute; inset: 2.5px; border-radius: 50%; background: var(--cx-blue); }
.cx-letter { flex: none; min-width: 2.2em; color: var(--cx-ink-2); font-size: .92em; }
.cx-opt-text { flex: 1; min-width: 0; }

/* ---- math in question text (built by EX.m in papers/index.js; also used on the result page) ---- */
.mf { display: inline-flex; flex-direction: column; vertical-align: middle; margin: 0 .1em; font-size: .9em; line-height: 1.25; text-align: center; }
.mf > span { padding: 0 .18em; }
.mf > span:first-child { border-bottom: 1px solid currentColor; }
.mr { border-top: 1px solid currentColor; padding: .06em .08em 0 .04em; }
.mv { position: relative; display: inline-block; }
.mv::after { content: ""; position: absolute; left: .05em; right: 0; top: -.08em; border-top: 1px solid currentColor; }
.mv::before { content: ""; position: absolute; right: -.02em; top: calc(-.08em - 3px); border: 3.5px solid transparent; border-right: 0; border-left: 6px solid currentColor; }
.mp { display: inline-block; vertical-align: middle; font-size: 1.6em; line-height: 1; transform: scaleX(.7); }
.mo { display: inline-flex; flex-direction: column; vertical-align: middle; margin: 0 .15em; line-height: 1; text-align: center; }
.mo > span:first-child { font-size: .72em; }
.mfig { display: inline-block; max-width: 100%; vertical-align: middle; line-height: 0; }
.mfig svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.cx-stem .mfig { display: block; margin: 12px 0; }
.mtab { display: block; max-width: 100%; overflow-x: auto; margin: 12px 0; border-collapse: collapse; font-size: .95em; }
.mtab th, .mtab td { padding: 5px 12px; border: 1px solid currentColor; text-align: center; font-weight: 400; white-space: nowrap; }
.mtab th:first-child, .mtab td:first-child { text-align: left; }

/* ---- confirm dialog + toast (shown over the exam, so they share its look) ---- */
dialog.dlg { width: calc(100% - 40px); max-width: 430px; padding: 24px; border: 1px solid var(--cx-line); border-radius: 6px; background: var(--cx-bg); color: var(--cx-ink); box-shadow: 0 18px 40px rgba(0, 0, 0, .22); }
dialog.dlg::backdrop { background: rgba(10, 14, 20, .45); }
.dlg-title { margin: 0 0 8px; font: 700 1.2rem var(--cx-font); color: var(--cx-ink); }
.dlg p { margin: 0; color: var(--cx-ink-2); font-size: .95rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.cbtn { min-height: 38px; padding: 0 18px; border: 1px solid var(--cx-line); border-radius: 4px; background: var(--cx-bg); color: var(--cx-ink); font: 600 .92rem var(--cx-font); cursor: pointer; }
.cbtn:hover { border-color: var(--cx-radio); }
.cbtn-primary { border-color: var(--cx-green); background: var(--cx-green); color: #fff; }
.cbtn-primary:hover { border-color: var(--cx-green-hover); background: var(--cx-green-hover); }
.cx-toast { position: fixed; left: 50%; bottom: 24px; z-index: 260; max-width: calc(100% - 40px); padding: 11px 18px; border-radius: 6px; background: #1f2328; color: #fff; font: 500 .92rem var(--cx-font); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); opacity: 0; transform: translate(-50%, 20px); transition: opacity .2s, transform .2s; pointer-events: none; }
.cx-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- narrow screens: the left panel becomes a drawer ---- */
@media (max-width: 900px) {
  .cx-engine { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .cx-side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 95; width: min(330px, 88vw); transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  .cx-side.open { transform: none; visibility: visible; transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  .cx-close { display: grid; place-items: center; position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 4px; background: none; color: var(--cx-ink-2); cursor: pointer; }
  .cx-scrim.show { display: block; position: fixed; inset: 0; z-index: 94; background: rgba(10, 14, 20, .45); }
  .cx-sheet-btn { display: inline-grid; }
  .cx-paper, .cx-time-label { display: none; }
  .cx-title { position: static; transform: none; flex: 1; min-width: 0; font-size: .95rem; text-align: center; overflow: hidden; text-overflow: ellipsis; }
  .cx-main { padding: 18px 16px 40px; }
  .cx-opts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 560px) {
  .cx-top { padding: 0 10px; gap: 8px; }
  .cx-top-l, .cx-top-r { gap: 8px; }
  .cx-back span { display: none; }
  .cx-title { font-size: .85rem; }
  .cx-timer { padding: 4px 8px; font-size: .95rem; gap: 5px; }
  .cx-timer .cx-ico { display: none; }
  .cx-submit { padding: 8px 12px; font-size: .82rem; }
  .cx-qbar { padding: 10px 12px; gap: 10px 14px; }
  .cx-lang { margin-left: 0; }
}
/* Touch screens: every exam control reaches 44px. */
@media (pointer: coarse) {
  .cx-btn, .cx-submit, .cbtn { min-height: 44px; }
  .cx-num { height: 40px; }
  .cx-fbtn, .cx-star { min-width: 44px; min-height: 44px; }
  .cx-opt { min-height: 44px; }
}

/* ==========================================================================
   2. APP PAGES — SAT Practice's language (tokens and components from theme.css)
   ========================================================================== */
.app-loading { display: grid; place-items: center; min-height: 60vh; }

/* Subject page: the paper cards reuse .test-card; this is the line of exam facts. */
.subj-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--muted); font-size: .92rem; }
.subj-facts b { color: var(--ink); font-weight: 600; }
.subj-zh { font-family: var(--font-zh); color: var(--brand-600); font-weight: 600; font-size: 1.1rem; margin-left: 4px; }

.app-main kbd { font-family: ui-monospace, monospace; font-size: .8em; padding: 1px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink); }

/* Language switch on app pages — SAT Practice's .seg (it lives beside its score-sheet
   styles, which theme.css leaves out), with aria-pressed as the state. */
.seg { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: var(--r-chip); border: 1px solid var(--border); }
.seg button { padding: 7px 16px; border-radius: var(--r-chip); font-weight: 600; font-size: .86rem; color: var(--muted); transition: all var(--t-fast); }
.seg button.active, .seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-xs); }

/* Result page */
.res-head { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; }
.res-head .ring { --size: 140px; }
.res-stats { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 12px 0 0; padding: 0; }
.res-stats li { color: var(--muted); }
.res-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Landing: the two ways in — CSCA and HSK — under the slogan. */
.path-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 10px; }
.path-btns .btn { min-width: 180px; }
.path-soon { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted-2); }

/* HSK level number in the sidebar, in place of an icon: the 21px icon box, drawn like the
   line icons around it (a rounded square in the current colour) so it reads as one set. */
.side-num { display: inline-grid; place-items: center; flex-shrink: 0; width: 21px; height: 21px; box-sizing: border-box;
  border: 1.75px solid currentColor; border-radius: 6px; font: 700 .76rem/1 var(--font-ui); font-variant-numeric: tabular-nums; }

/* Sidebar language row: English | 中文, split like Appearance | Full screen. */
.side-lang .lang-opt { font-weight: 700; font-size: .84rem; letter-spacing: .01em; line-height: 1; }
.side-lang .side-item[aria-pressed="true"] { color: var(--brand-600); background: var(--brand-50); }
.side-lang .side-item[lang="zh-CN"] .lang-opt { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }

/* Account page */
.acct-card { max-width: 560px; display: flex; flex-direction: column; gap: 18px; }
.acct-who { display: flex; align-items: center; gap: 14px; }
.acct-who .avatar { width: 56px; height: 56px; font-size: 1.2rem; }

@media (max-width: 640px) {
}


/* Scoring levels (Easy / Medium / Hard) — one colour each, used by the result table, the
   per-question tag and the Account page XP rates. */
.rg-easy { --rg: var(--ok); --rg-bg: var(--ok-bg); }
.rg-medium { --rg: var(--warn); --rg-bg: var(--warn-bg); }
.rg-hard { --rg: var(--bad); --rg-bg: var(--bad-bg); }
.res-groups { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.res-groups th { text-align: left; font-size: .76rem; font-weight: 600; color: var(--muted-2); padding: 0 10px 8px 0; border-bottom: 1px solid var(--border); }
.res-groups td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--border); }
.res-groups tr:last-child td { border-bottom: 0; }
.res-groups td:first-child { font-weight: 600; white-space: nowrap; }
.rg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rg); margin-right: 8px; vertical-align: 1px; }
@media (max-width: 560px) { .res-groups th:nth-child(3), .res-groups td:nth-child(3) { display: none; } }
.xp-panel .streak-panel-flame { color: var(--muted-2); }
.xp-panel.lit .streak-panel-flame { color: var(--brand-link, var(--brand-600)); }

/* ---- "Your data" (#/results), SAT Practice's #/data page ---- */
/* Level colours for the score bars, legend and tooltips — the same three as the result page. */
:root { --lv-easy: #059669; --lv-medium: #d97706; --lv-hard: #e11d48; }
:root[data-theme="dark"] { --lv-easy: #34d399; --lv-medium: #fbbf24; --lv-hard: #fb7185; }
.tr-bar-easy { fill: var(--lv-easy); }
.tr-bar-medium { fill: var(--lv-medium); }
.tr-bar-hard { fill: var(--lv-hard); }
.tt-dot.tr-dot-easy { background: var(--lv-easy); }
.tt-dot.tr-dot-medium { background: var(--lv-medium); }
.tt-dot.tr-dot-hard { background: var(--lv-hard); }
/* Five across: score · papers · accuracy · time · XP. */
.stat-strip-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* Five cells never leave a hole: three over two on a laptop (a 6-track grid, spans 2 and 3),
   two over two over one full-width on a phone. */
@media (max-width: 1180px) { .stat-strip-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stat-strip-5 > :nth-child(-n+3) { grid-column: span 2; } .stat-strip-5 > :nth-child(n+4) { grid-column: span 3; } }
@media (max-width: 640px)  { .stat-strip-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip-5 > :nth-child(n) { grid-column: auto; } .stat-strip-5 > :last-child { grid-column: 1 / -1; } }
.acc-col-h svg { margin-right: 6px; vertical-align: -2px; color: var(--muted-2); }
/* Ranked rows (SAT Practice's .qbf-*), two columns filled COLUMN-first — a ranking is read down. */
.qbf-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column;
  grid-template-rows: repeat(var(--qbf-rows, 5), auto); gap: 1px; background: var(--border); overflow: hidden; }
@media (max-width: 860px) { .qbf-list { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-template-rows: none; } .qbf-fill { display: none; } }
.qbf-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(56px, 22%) 42px; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface); min-width: 0; }
.qbf-rank { font-size: .76rem; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.qbf-text { min-width: 0; }
.qbf-skill { font-weight: 650; color: var(--ink); font-size: .92rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbf-meta { font-size: .74rem; color: var(--muted-2); margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.35; }
.qbf-bar { height: 7px; border-radius: 99px; background: rgba(127, 127, 127, .16); overflow: hidden; }
.qbf-bar i { display: block; height: 100%; border-radius: 99px; transition: width .5s ease; }
.qbf-pct { font-weight: 800; font-size: .92rem; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
@media (max-width: 480px) { .qbf-row { grid-template-columns: 16px minmax(0, 1fr) 42px; } .qbf-bar { grid-column: 2 / 4; grid-row: 2; } }
.cbtn-danger { border-color: #c0392b; background: #c0392b; color: #fff; }
.cbtn-danger:hover { border-color: #a5301f; background: #a5301f; }
.cbtn:disabled { opacity: .55; cursor: not-allowed; }
/* Account → Clear my data: the period picker inside the confirm dialog. */
.dlg .clr-range { margin-top: 14px; }
.dlg .clr-ration { margin: 10px 0 0; }
.dlg .clr-ration.is-blocked { color: #c0392b; font-weight: 600; }
.clr-fill { background: var(--surface-2, var(--surface)); }

/* A segmented control can be hidden (the Leaderboard period on the Streak board) — display:inline-flex would win over [hidden]. */
.pill-seg[hidden] { display: none !important; }

/* The day-streak row is pressable now (it opens its "how it works" window), like the XP row —
   the same reset, its own class so the XP repaint (".xp-row") never picks it up. */
.streak-btn { width: 100%; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
  border-radius: 10px; transition: background var(--t); }
.side-win-streak .streak-btn:hover, .side-win-streak .streak-btn:focus-visible { background: var(--surface-2); }

/* Sidebar logo (2026-10-20): the logo window keeps its ORIGINAL size and stays at the
   top; on a short screen the windows under it scroll instead of everything being squeezed.
   Two things used to shrink it: flex-shrink (the sidebar is a flex column, so every window
   gave up height and the logo's overflow:hidden clipped it), and theme.css's vh clamps on
   the logo height/padding for short screens. Both are undone for the logo only. */
.sidebar > .side-win { flex-shrink: 0; }
.sidebar > .side-win-logo { position: sticky; top: 0; z-index: 3; }
@media (min-width: 901px) {
  .side-win-logo { padding-block: 12px; }
  .side-logo .brand-logo { height: 60px; }
}

/* Sidebar logo, centred (2026-10-20 — "like SAT Practice's, symmetric, exactly in the
   middle"). Same face as SAT Practice (Inter 800, -.02em), but "InterExe" is two letters
   longer than "SAT Practice": at SAT Practice's 60px card + 12px gap + 1.42rem it needed 197px in a
   186px window, so it overflowed to the right and sat off-centre. Card, gap and type are
   scaled down TOGETHER so the pair fits with equal space either side. */
.side-logo { justify-content: center; gap: 10px; }
.side-logo .brand-name { font-size: 1.28rem; white-space: nowrap; }
@media (min-width: 901px) { .side-logo .brand-logo { height: 56px; } }
.side-logo .brand-logo { height: 56px; }

/* Sidebar scrollbar — ALWAYS visible, its space ALWAYS reserved (2026-10-20, both
   SAT Practice and InterExe). It used to show only on hover, so on a laptop short enough to
   make the sidebar scroll, nothing said there was more below. scrollbar-gutter: stable keeps
   the bar's width reserved even when the sidebar fits, so the sidebar is the same width on
   every screen and on both sites (a bar that appears only when needed made the windows a few
   px narrower on some screens than on others). Standard properties only: with scrollbar-color
   set, Chrome ignores the ::-webkit-scrollbar rules, so those are not used any more. */
.sidebar { scrollbar-gutter: stable; scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted-2) 55%, transparent) transparent; }
.sidebar:hover { scrollbar-color: var(--muted-2) transparent; }

/* Sidebar logo window: pinned at the top and SOLID (2026-10-20, both sites). Every
   .side-win is frosted glass (72% + blur), which is right at rest — but once the logo sticks,
   the windows scrolling under it showed through and it looked washed out. The fill is the
   glass colour already mixed with the page background, so at rest it looks exactly as before;
   it just stops being see-through. */
.sidebar > .side-win-logo { position: sticky; top: 0; z-index: 3; flex-shrink: 0;
  background: color-mix(in srgb, #ffffff 72%, var(--bg));
  backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="dark"] .sidebar > .side-win-logo { background: color-mix(in srgb, rgb(22 28 38) 72%, var(--bg)); }

/* Report a problem (as on SAT Practice): the flag next to A+ / A- in the paper and Question Bank bar,
   in the result page's question popup, and the "where it came from" pill on #/reports. */
.cx-report svg { width: 17px; height: 17px; }
.rep-pin { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; max-width: 100%; padding: 4px 11px;
  font-size: .8rem; font-weight: 600; color: var(--brand-600); background: rgba(0, 122, 160, .08);
  border: 1px solid rgba(0, 122, 160, .22); border-radius: 999px; }
.rep-pin svg { width: 14px; height: 14px; flex: none; }
.rep-pin span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Show me the free papers" (the part-of-Pro window): the open cards glow once so the eye finds them. */
@keyframes tcFlash { 0% { box-shadow: 0 0 0 0 rgba(0, 122, 160, 0); } 30% { box-shadow: 0 0 0 4px rgba(0, 122, 160, .35); } 100% { box-shadow: 0 0 0 0 rgba(0, 122, 160, 0); } }
.tc-flash { animation: tcFlash 1.4s ease-out 2; }
@media (prefers-reduced-motion: reduce) { .tc-flash { animation: none; outline: 2px solid var(--brand-600); } }
.test-card-locked { cursor: pointer; }

/* ---------- Result page: answer key + question popup (SAT Practice's score report, v39) ----------
   Numbered tiles — green right, red wrong, grey blank — one group per scoring level; a tile
   opens the question in .modal-review (the .rv-* styles in theme.css). */
.sr-akey { padding: 22px 26px; margin-bottom: 28px; }
.sr-akey-sec { margin-top: 18px; }
.sr-akey-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
/* Own line under the legend: the head is a wrapping space-between row. */
.sr-ak-hint { flex-basis: 100%; order: 3; margin: 2px 0 0; }
.sr-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.sr-leg { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.sr-leg svg { width: 14px; height: 14px; }
.sr-leg.ok { color: var(--ok); }
.sr-leg.bad { color: var(--bad); }
.sr-leg .leg-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: var(--faint); }
.sr-akey-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; font-size: 1rem; font-weight: 800; }
.sr-akey-time { font-size: .8rem; font-weight: 600; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.sr-akey-grid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
@media (max-width: 1200px) { .sr-akey-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .sr-akey-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .sr-akey-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .sr-akey { padding: 18px 16px; } }
.sr-ak { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px 7px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t-fast); }
.sr-ak:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.sr-ak:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.sr-ak-n { font-size: .72rem; font-weight: 700; color: var(--muted-2); }
.sr-ak-ans { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.sr-ak.ok { border-color: var(--ok); background: var(--ok-bg); }
.sr-ak.ok .sr-ak-ans { color: var(--ok); }
.sr-ak.bad { border-color: var(--bad); background: var(--bad-bg); }
.sr-ak.bad .sr-ak-ans { color: var(--bad); }
.sr-ak.skip { border-color: var(--faint); background: var(--surface-2); }
.sr-ak.skip .sr-ak-n { color: var(--faint); }
.sr-ak.skip .sr-ak-ans { color: var(--muted-2); }

/* Your data: period + dataset sit in the title row's corner; the subject bar gets its own row
   under it (SAT Practice's Transitions header: Rarity up top, Groups on a row below). */
.data-subj-row { display: flex; min-width: 0; margin: -8px 0 22px; }
.data-subj-row .pill-seg { min-width: 0; }

/* The exam bar has a light/dark button now (2026-10-21), so the right-hand group is ~60px wider and the
   centred title met the "Time remaining:" word below ~1140px (57px overlap at 1024). The word goes on
   narrower screens; the clock beside it stays. (<=900px already hid it.) */
@media (max-width: 1160px) { .cx-time-label { display: none; } }

/* "What's new" window (app.js whatsNew): the newest changelog.html entry, in the
   "How XP works" frame (.xp-info scrolls, .xp-h headings). */
.wn-tag { display: flex; align-items: center; gap: 10px; }
.wn-pill { font-size: .78rem; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--brand-600); border-radius: 999px; padding: 3px 11px; }
.wn-date { font-size: .82rem; font-weight: 600; color: var(--muted); }
.wn-sub { margin: 12px 0 0; color: var(--ink-2); }
.wn-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.wn-list li { position: relative; padding-left: 20px; color: var(--ink-2); line-height: 1.5; font-size: .95rem; }
.wn-list li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 6px; height: 6px; border-radius: 2px; background: var(--brand-400); }
.wn-list b { color: var(--ink); font-weight: 700; }

/* Account → My reports (SAT Practice's): status · what was reported · when, one hairline row each. */
.myrep-sum { margin: 0 0 4px; }
.myrep-list { margin: 0; padding: 0; list-style: none; }
.myrep-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 11px 0; border-top: 1px solid var(--border); }
.myrep-row:first-child { border-top: 0; }
.myrep-row[hidden] { display: none; }
.myrep-status { display: flex; flex-wrap: wrap; gap: 5px; }
.myrep-status .badge { padding: 3px 9px; white-space: nowrap; }
.myrep-where { font-size: .8rem; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.myrep-msg { line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.myrep-row.is-fixed .myrep-msg { color: var(--muted); }
.myrep-when { text-align: right; white-space: nowrap; line-height: 1.5; }
.myrep-more { margin-top: 6px; }
@media (max-width: 560px) {
  .myrep-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .myrep-when { text-align: left; }
}
