/* NextStep Education — shared design system (2026-11 redesign).
   One family (Archivo, width + weight axes), the two logo colours, square
   corners. This file owns tokens, base type, controls and the site shell.
   The homepage lives in community-home.css; operational views keep
   components-refresh.css and inherit everything here through tokens. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/assets/fonts/Archivo-Latin-Variable.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Logo colours */
  --navy: #0b2a5b;
  --navy-deep: #061a3d;
  --green: #3a7a21;
  --lime: #8cc63f;
  --lime-soft: #e7f2d6;

  /* Roles */
  --ink: #0b2a5b;
  --ink-soft: #27324a;
  --muted: #56627a;
  --canvas: #ffffff;
  --paper: #ffffff;
  --mist: #eef2f7;
  --paper-warm: var(--mist);
  --line: #d5dce7;
  --line-strong: #9aa7bd;
  --brand: #0b2a5b;
  --brand-strong: #061a3d;
  --brand-soft: #e6ecf5;
  --accent: var(--green);
  --accent-strong: #2b5d17;
  --accent-soft: var(--lime-soft);
  --tint: #d7e9b8;
  --surface-soft: var(--mist);
  --linen: var(--mist);
  --footer-bg: #0b2a5b;
  --footer-ink: #ffffff;
  --footer-muted: #b8c6de;
  --on-brand: #ffffff;
  --focus: #3a7a21;
  --positive: #2b6a1f;
  --positive-soft: #e7f2d6;
  --warning: #7a5410;
  --warning-soft: #fbf0d6;
  --danger: #a3202d;
  --danger-soft: #f9e3e4;
  --primary: var(--navy);
  --primary-light: #34507f;
  --shadow-float: 0 1px 0 var(--line), 0 18px 40px -18px rgb(11 42 91 / 28%);
  --shadow-card: none;
  --shadow-sm: none;
  --shadow: none;
  --control-radius: 0;
  --panel-radius: 0;
  --r-xs: 4px;
  --r-ctl: 6px;
  --r-card: 10px;
  --shell: 78rem;
  --nav-height: 4.5rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --font-sans: "Archivo", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display-stretch: 80%;
}

html { color-scheme: light; background: var(--canvas); }
body {
  background: var(--canvas);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-stretch: 100%;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
html:root body :is(h1, h2, h3, h4, h5, h6) { font-family: var(--font-sans); }
h1, h2, h3 { color: var(--ink); font-weight: 750; font-stretch: var(--display-stretch); }
h4 { color: var(--ink); font-weight: 700; }
.heading-phrase { display: inline-block; }
h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.04; letter-spacing: -.012em; }
h3 { letter-spacing: -.005em; }
html:root body.zh :is(h1, h2, h3, h4) { font-stretch: 100%; letter-spacing: 0; line-height: 1.3; font-weight: 700; }
html:root body.zh :is(p, li, dd) { line-height: 1.85; }
html:root body :is(h1, h2, h3, h4) { overflow-wrap: break-word; }
p { color: var(--ink-soft); }
::selection { color: var(--navy-deep); background: var(--tint); }
button, a, summary, input, select, textarea { -webkit-tap-highlight-color: rgb(11 42 91 / 12%); }
:focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 2px; }
/* After a tap or click the ring is not drawn (js/main.js sets data-input); fields that take typing keep theirs. */
html[data-input="pointer"] :focus-visible:not(input, textarea, select, [contenteditable="true"]) { outline: none !important; }

/* Corners. Older stylesheets set a dozen different radii, so everything is
   reset to square first and the corner system below opts elements back in:
   4px for tags, 6px for anything you press or type in, 10px for cards and
   panels. The staircase, section rules, bars and full-width bands stay
   square, like the logo. */
html:root body *:not(.ns-spinner, .guide-spinner, .guide-load-mark, [class*="spinner"], [class$="-dot"], [class*="-dot "]),
html:root body *:not(.ns-spinner, .guide-spinner, .guide-load-mark, [class*="spinner"], [class$="-dot"], [class*="-dot "])::before,
html:root body *:not(.ns-spinner, .guide-spinner, .guide-load-mark, [class*="spinner"], [class$="-dot"], [class*="-dot "])::after {
  border-radius: 0 !important;
}
html:root:root body :where(button, select, textarea, input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]),
  .btn, .m-btn, .prac-btn, .lang-btn, .skip-link, .reading-option, .tool__examples a,
  .nav-request-link, .nav-account-link, .nav-admin-link, .nav-notification-link, .language-menu-trigger, .nav-cluster > summary,
  .sat-reference > summary, .sat-testnav__all > summary, .subjects-search, .guide-search-field, .form-status, .word-simpler, .guide-link, .nav-popover a, .language-menu-popover a, .nav-mobile a) {
  border-radius: var(--r-ctl) !important;
}
html:root:root:root body :where([class*="badge"], [class*="-tag"], [class*="-chip"], .sat-level, .readings-level, .readings-today, .calendar-event,
  .calendar-day-number, .sched-cal-num, .option-label, .guide-stat-icon, .word-ipa__label, main code, main mark, #toast) {
  border-radius: var(--r-xs) !important;
}
html:root:root:root:root body :where(.subject-card, .community__card, .resource-card, .value-card, .team-card, .level-card, .account-card, .account-summary-card,
  .account-quick-card, .manage-section, .security-actions, .danger-zone, .hours-entry, .hours-summary-card, .hours-empty, .member-profile-note, .pref-option,
  .admin-card, .admin-priority-rail, .admin-priority-card, .admin-tabs, .admin-subtabs, .admin-preview-options, .admin-notice, .guide-stat, .ns-stat, .stat-box,
  .calendar-card, .calendar-details, .sched-cal, .mobile-agenda-day, .request-card, .privacy-box, .interaction-login-prompt, .detail-card, .question-card,
  .wrong-review-banner, .compose-card, .forum-tabs, .auth-tabs, .subject-panel, .about-image, .calc-wrap, .calc-result-card, .formula-box, .honors-note,
  .guide-table-wrap, .guide-cta, .cta-banner-inner, .sat-timed__card, .sat-reference__panel, .nav-popover, .language-menu-popover,
  .ask-panel, .ask-example, .reading-levels, .guide-reader-toc, .guide-reader-cta, .guide-comments-empty, .option-btn, .practice-sat-callout__link, .dash-ask, .dash-sat__section, .tool__today, .readings-preview,
  .readings-alert, .account-avatar, .team-avatar, .subject-icon, .guide-detail-state-icon, .forum-post, .thread-post, .reply-card, .topic-card) {
  border-radius: var(--r-card) !important;
}
/* Boxes with an accent bar on one side round only the far corners. */
html:root:root:root:root:root body :where(.dash-weak, .subject-access-note, .guide-note) { border-radius: 0 var(--r-card) var(--r-card) 0 !important; }
html:root:root:root:root:root body :where(.sat-focus__item) { border-radius: 0 0 var(--r-card) var(--r-card) !important; }
/* Rows that sit edge to edge inside a rounded box stay square; the box clips them. */
html:root:root:root:root:root:root body :where(.reading-level, .ask-mode, .calendar-day, .sched-cal-day, .faq-question) { border-radius: 0 !important; }
html:root:root body :is(.reading-levels, .ask-panel, .sched-cal, .mobile-agenda-day, .account-card) { overflow: hidden; }

/* Forms */
html:root body :is(.form-label, .form-group > label) { line-height: 1.5; margin-bottom: .45rem; color: var(--ink); font-weight: 600; }
html:root body :is(.hint, .form-hint, .form-help, .form-privacy-note, .privacy-note, .privacy-box p, .consent-note, .consent-row label, .nonprofit-login-note) { font-size: .875rem; line-height: 1.65; }
/* The note is the only thing in its box on the sign-in screen (one line per language): no gap above it, so the line sits in the middle. */
html:root body .interaction-login-prompt > .nonprofit-login-note:first-child, html:root body .interaction-login-prompt > .nonprofit-login-note:first-child + .nonprofit-login-note { margin-top: 0; }
html:root body :is(.form-input, .form-select, .form-textarea) { font-size: 1rem; line-height: 1.6; }
html:root body:is([data-page="join"], [data-page="volunteer"], [data-page="account"]) :is(input, textarea, select):not([type="checkbox"], [type="radio"], [type="color"]) { font-size: 1rem; line-height: 1.6; }
html:root body main :is(input, textarea, select):not([type="checkbox"], [type="radio"], [type="color"], [type="range"]) {
  border: 1px solid var(--line-strong);
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
}
@media (hover: hover) { html:root body main :is(input, textarea, select):not([type="checkbox"], [type="radio"], [type="color"], [type="range"]):hover { border-color: var(--ink-soft); } }
html:root body main :is(input, textarea, select):not([type="checkbox"], [type="radio"], [type="color"], [type="range"]):focus {
  border-color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--lime);
  outline: none;
}
html:root body :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--navy); }
/* Safari's native menu face ignores the requested control height. */
html:root body[data-page] main select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  min-height: 2.75rem;
  padding-inline-end: 2.25rem;
  background-image: url('/assets/select-chevron.svg');
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: .75rem .5rem;
}

/* Buttons: flat, square, heavy label. Primary is navy; secondary is an
   outlined navy box. No lift, no glow. */
.btn {
  gap: .65rem;
  min-height: 2.875rem;
  padding: .7rem 1.2rem;
  border: 2px solid var(--brand);
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: .95rem;
  letter-spacing: 0;
  box-shadow: none;
  transform: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
@media (hover: hover) { .btn:hover { transform: none; box-shadow: none; } }
.btn-primary { color: var(--on-brand); box-shadow: none; } @media (hover: hover) { .btn-primary:hover { color: var(--on-brand); box-shadow: none; } }
.btn-primary { background: var(--brand); border-color: var(--brand); }
@media (hover: hover) { .btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); } }
.btn-secondary, .btn-outline { color: var(--brand); background: transparent; border-color: var(--brand); box-shadow: none; }
@media (hover: hover) { .btn-secondary:hover, .btn-outline:hover { color: var(--on-brand); background: var(--brand); border-color: var(--brand); } }
/* Older page styles (the admin page's inline sheet) recolor only the text on
   hover, which left the label the same color as the fill. Keep text and fill
   paired everywhere, and leave disabled buttons unfilled. */
@media (hover: hover) { html:root .btn:is(.btn-secondary, .btn-outline):hover:not(:disabled) { color: var(--on-brand); background: var(--brand); border-color: var(--brand); } }
html:root .btn:is(.btn-secondary, .btn-outline):disabled { color: var(--brand); background: transparent; border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 3.25rem; padding: .85rem 1.5rem; font-size: 1rem; }
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.text-action { color: var(--brand); font-size: .95rem; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
@media (hover: hover) { .text-action:hover { color: var(--brand-strong); text-decoration-thickness: 2px; } }

/* Inner page headers: left-aligned, a thick navy rule above, no decoration. */
.page-hero, .subject-page-hero { background: var(--canvas); background-image: none; text-align: left; }
.page-hero::before, .page-hero::after, .cta-banner::before, .cta-banner::after { display: none; }
html:root .page-hero { padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
html:root .page-hero .page-hero-inner { max-width: 52rem; margin-inline: 0; text-align: left; padding-top: 1.5rem; border-top: 6px solid var(--navy); }
/* The page title says what the page is; the old badge above it repeated it. */
html:root .page-hero .page-hero-inner > .badge { display: none; }
/* About values are not a sequence, so they carry no numbers. */
html:root body[data-page="about"] .value-icon { display: none; }
html:root .page-hero h1 { font-size: clamp(2.4rem, 5vw, 4.25rem); line-height: 1; letter-spacing: -.015em; margin-bottom: 1.1rem; }
html:root body.zh .page-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.25; }
html:root .page-hero p { max-width: 40rem; margin-inline: 0; font-size: 1.125rem; line-height: 1.6; color: var(--ink-soft); }
html:root .section-header.centered { text-align: left; margin-inline: 0; max-width: 48rem; }
html:root .section-header.centered p { margin-inline: 0; }
html:root .divider { width: 3rem; height: 6px; margin: 0 0 1.25rem; background: var(--navy); }
html:root .divider-center { margin-inline: 0; }
html:root :is(.badge, .badge-primary, .badge-gold, .badge-success, .guide-card-badge, .resource-tag) {
  border-radius: 0;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}
html:root .badge { padding: .3rem .6rem; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font-size: .8rem; font-weight: 600; }

/* Cards and panels: hairline box, no shadow; hover only darkens the rule. */
html:root :is(.card, .value-card, .team-card, .request-card, .guide-card, .resource-card, .subject-card, .event-card, .forum-card, .info-card, .stat-card, .panel) {
  box-shadow: none !important;
}
html:root :is(.value-card, .team-card, .request-card, .info-card, .panel) { border: 1px solid var(--line); background: var(--paper); }
html:root .value-icon {
  width: auto; height: auto; margin-bottom: .75rem;
  background: none; color: var(--green);
  font-size: .95rem; font-weight: 750; font-variant-numeric: tabular-nums;
}

/* ─── Navigation ─────────────────────────────────────────────────────── */
/* Nav, footer and homepage share one content edge. */
html:root :is(.nav, .footer) > .container {
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
html:root .nav,
html:root .nav.scrolled {
  height: var(--nav-height);
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.nav-inner { gap: 1.75rem; }
html:root .nav-logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
html:root .nav-logo-icon { width: 2.6rem; height: auto; aspect-ratio: 1024 / 450; border: 0; background: none; color: var(--navy); flex: none; }
html:root .nav-wordmark { display: inline; white-space: nowrap; color: var(--ink); font-size: 1.2rem; font-weight: 800; font-stretch: 78%; letter-spacing: -.01em; line-height: 1; }
html:root .nav-wordmark .highlight { color: var(--ink); font-weight: 450; font-stretch: 78%; }
.nav-links { gap: .25rem; }
html:root .nav-links > a,
html:root .nav-cluster > summary {
  position: relative;
  padding: .55rem .7rem;
  color: var(--ink-soft) !important;
  font-size: .92rem !important;
  font-weight: 560 !important;
  background: transparent !important;
}
html:root .nav-links > a[data-nav-domain].active,
html:root .nav-about-link.active,
html:root .nav-cluster.active > summary,
html:root .nav-cluster[open] > summary {
  color: var(--ink) !important;
  background: transparent !important;
  text-decoration: none;
}
@media (hover: hover) {
html:root .nav-links > a[data-nav-domain]:hover,
html:root .nav-about-link:hover,
html:root .nav-cluster > summary:hover {
  color: var(--ink) !important;
  background: transparent !important;
  text-decoration: none;
}
}
html:root .nav-links > a.active::after,
html:root .nav-cluster.active > summary::before {
  content: "";
  position: absolute;
  left: .7rem; right: .7rem; bottom: -.15rem;
  height: 3px;
  background: var(--lime);
}
html:root .nav :is(.nav-links > a, .nav-cluster > summary, .nav-account-link, .language-menu-trigger, .nav-hamburger),
html:root .nav :is(.nav-links > a, .nav-cluster > summary).active {
  border: 0;
  box-shadow: none;
  text-decoration: none;
}
@media (hover: hover) {
html:root .nav :is(.nav-links > a, .nav-cluster > summary):hover {
  border: 0;
  box-shadow: none;
  text-decoration: none;
}
}
html:root .nav :is(.nav-notification-link, .nav-admin-link) { border: 0; box-shadow: none; }
.nav-actions { gap: .9rem; }
html:root .language-menu-trigger { border: 0; padding-inline: .35rem; background: transparent; color: var(--ink); }
html:root .nav-actions > .nav-account-link { color: var(--ink); font-size: .92rem; font-weight: 560; }
@media (hover: hover) { html:root .nav-actions > .nav-account-link:hover { text-decoration: underline; text-underline-offset: .25em; } }
html:root .nav-actions > .nav-request-link {
  display: inline-flex; align-items: center;
  min-height: 2.6rem;
  padding-inline: 1.1rem;
  border: 0;
  background: var(--brand);
  color: var(--on-brand);
  font-size: .9rem;
  font-weight: 650;
  box-shadow: none;
}
@media (hover: hover) { html:root .nav-actions > .nav-request-link:hover { background: var(--brand-strong); color: var(--on-brand); box-shadow: none; } }
html:root :is(.nav-popover, .language-menu-popover) {
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  background: var(--paper);
  box-shadow: var(--shadow-float);
}
html:root .nav-popover a { color: var(--ink); font-weight: 600; }
html:root .nav-popover a small { color: var(--muted); font-weight: 400; }
html:root .nav-popover a.active { background: var(--mist); color: var(--ink); } @media (hover: hover) { html:root .nav-popover a:hover { background: var(--mist); color: var(--ink); } }
/* The page you are on gets a lime marker, the same colour as the underline in the bar above. */
html:root .nav :is(.nav-popover, .nav-links) .nav-popover a.active { box-shadow: inset 3px 0 0 var(--lime); }
html:root .lang-btn.active { background: var(--mist); color: var(--ink); }
html:root .nav-hamburger { border: 1px solid var(--line-strong); background: transparent; }
html:root .nav-hamburger span { background: var(--ink); }
html:root .nav-mobile { top: var(--nav-height); background: var(--canvas); }
html:root .nav-mobile-head p { color: var(--muted); font-size: .9rem; font-weight: 600; }
html:root .nav-mobile-grid h2 { color: var(--green); font-size: .85rem; font-weight: 700; font-stretch: 100%; letter-spacing: 0; text-transform: none; }
html:root .nav-mobile a { color: var(--ink); }
html:root .nav-mobile a.active { color: var(--ink); background: var(--mist); } @media (hover: hover) { html:root .nav-mobile a:hover { color: var(--ink); background: var(--mist); } }
/* Menu rows keep one text edge whether or not they are highlighted. */
html:root .nav-mobile a:not(.nav-mobile-cta) { margin-inline: -.65rem; padding-inline: .65rem; }
html:root .nav-mobile a.active:not(.nav-mobile-cta) { box-shadow: inset 3px 0 0 var(--lime); }
html:root .nav-mobile-cta { background: var(--brand); color: var(--on-brand) !important; box-shadow: none; font-weight: 650; }
.nav-environment-slot a, .nav-environment-link { box-shadow: none; }

/* ─── Closing invitations on inner pages ─────────────────────────────── */
.cta-banner { padding-block: clamp(3rem, 6vw, 4.5rem); border-top: 0; background: var(--lime); }
.cta-banner-inner { border: 0; background: transparent; box-shadow: none; text-align: left; margin-inline: 0; }
.cta-banner h2 { color: var(--navy-deep); font-size: clamp(1.9rem, 3.4vw, 2.8rem); font-weight: 750; }
.cta-banner p { color: var(--navy-deep); font-size: 1.05rem; }
.cta-banner .btn-primary { color: #fff; border-color: var(--navy); background: var(--navy); }
@media (hover: hover) { .cta-banner .btn-primary:hover { color: #fff; border-color: var(--navy-deep); background: var(--navy-deep); } }
body[data-page] .cta-primary-row [data-cta-kind="volunteer"] { padding-inline: 1.4rem; color: #fff; border-color: var(--navy); background: var(--navy); }
@media (hover: hover) { body[data-page] .cta-primary-row [data-cta-kind="volunteer"]:hover { color: #fff; border-color: var(--navy-deep); background: var(--navy-deep); } }
html:root body[data-page="about"] .cta-primary-row [data-cta-kind="volunteer"] {
  width: fit-content;
  min-height: 3.25rem;
  padding: .85rem 1.5rem;
  gap: .85rem;
  border: 2px solid var(--navy);
  background: var(--navy);
  color: #fff;
  font-size: 1rem;
  line-height: 1.4;
}
@media (hover: hover) { html:root body[data-page="about"] .cta-primary-row [data-cta-kind="volunteer"]:hover { border-color: var(--navy-deep); background: var(--navy-deep); color: #fff; } }
.cta-banner .cta-or-divider, html[data-site-environment="beta"] .cta-or-divider { color: var(--navy-deep); border-color: rgb(6 26 61 / 35%); }
.cta-banner .cta-email { color: var(--navy-deep); font-size: .95rem; font-weight: 600; text-decoration: underline; text-underline-offset: .22em; }
.cta-banner .cta-email:focus-visible { color: var(--navy-deep); text-decoration-thickness: 2px; } @media (hover: hover) { .cta-banner .cta-email:hover { color: var(--navy-deep); text-decoration-thickness: 2px; } }
.cta-banner :focus-visible { outline-color: var(--navy-deep) !important; }

/* ─── Footer: the one solid navy band on every page ──────────────────── */
html:root .footer { border-top: 0; background: var(--footer-bg); color: var(--footer-ink); }
html:root .footer .nav-logo { color: var(--footer-ink); font-size: 1.15rem; font-weight: 750; font-stretch: 80%; }
html:root .footer .nav-logo-icon { color: #fff; }
.footer-grid { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 3rem; padding-block: 3.5rem 3rem; }
html:root .footer-brand p { max-width: 34ch; color: var(--footer-muted); font-size: .9rem; line-height: 1.7; }
html:root .footer-brand .footer-email { color: var(--footer-ink); font-size: .9rem; text-decoration: underline; text-underline-offset: .22em; }
html:root .footer-col h5 { margin-bottom: .9rem; color: var(--lime); font-size: .85rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.footer-col li { padding-block: .3rem; border: 0; }
html:root .footer-col ul li a { color: var(--footer-ink); font-size: .9rem; }
@media (hover: hover) { html:root .footer-col ul li a:hover { color: var(--footer-ink); text-decoration: underline; text-underline-offset: .25rem; } }
html:root .footer-bottom { gap: 1rem; border-color: rgb(255 255 255 / 18%); padding-block: 1.2rem; color: var(--footer-muted); }
html:root .footer-bottom p { color: var(--footer-muted); font-size: .8rem; }
.theme-control { display: inline-flex; align-items: center; gap: .6rem; color: var(--footer-muted); font-size: .8rem; }
html:root .theme-control select { width: auto; min-height: 2.25rem; padding: .35rem 1.6rem .35rem .55rem; border: 1px solid rgb(255 255 255 / 35%); background-color: transparent; color: var(--footer-ink); font-size: .8rem; }
html:root .theme-control select option { color: #0b2a5b; }
html:root .footer :focus-visible { outline-color: var(--lime) !important; }

/* Previously hardcoded accent surfaces now follow the same tokens. */
html:root :is(.badge-primary, .guide-card-badge, .resource-tag) { border-color: var(--line-strong); }
html:root :is(.form-group input, .form-group select, .form-group textarea, input[type="search"]):focus { box-shadow: inset 0 -3px 0 var(--lime); }

html:root :is(.badge-success, .form-status[data-tone="success"]) { border-color: color-mix(in srgb, var(--positive) 35%, transparent); color: var(--positive); }
html:root :is(.badge-announcement, .form-status[data-tone="error"]) { border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
html:root .badge-gold { color: var(--warning); }

/* With the menu folded, "Ask a question" sits beside the menu button at the
   right edge. (Both used to take a share of the free space, which left the
   button stranded in the middle of the bar.) */
@media (max-width: 67.5rem) {
  html:root .nav .nav-actions + .nav-hamburger { margin-left: 0; }
}
@media (max-width: 70rem) {
  .nav-inner { gap: .9rem; }
  html:root .nav-wordmark { font-size: 1.1rem; }
  .nav-actions { gap: .5rem; }
  html:root .nav-actions > .nav-request-link { padding-inline: .85rem; }
  .footer-grid { gap: 2rem; }
}
@media (max-width: 48rem) {
  :root { --nav-height: 4.1rem; }
  html:root .nav .nav-wordmark { display: inline; font-size: 1.1rem; }
  html:root .nav-actions > .nav-request-link { min-height: 2.4rem; padding-inline: .8rem; white-space: nowrap; font-size: .85rem; }
  .nav-mobile-grid h2 { margin-bottom: .5rem; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1rem; padding-block: 2.5rem; }
  .footer-brand { grid-column: 1 / -1; }
  html:root .footer-brand p { max-width: 45ch; }
  .footer-bottom { align-items: start; flex-wrap: wrap; }
}
@media (max-width: 25rem) {
  html:root .nav .nav-wordmark .highlight { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col:last-child { grid-column: 1 / -1; }
}

/* ─── Detail pass ─────────────────────────────────────────────────────── */
/* Labels are sentence case: no tracked-out ALL CAPS anywhere. */
html:root body *:not(abbr, code, kbd, samp) { text-transform: none !important; }
html:root body :is([class*="eyebrow"], [class*="kicker"], [class*="label"], [class*="tag"], .badge, th, dt, small) { letter-spacing: 0 !important; }
html:root body .eyebrow { color: var(--green) !important; font-size: .9rem; font-weight: 700; }
/* Buttons say what they do; the trailing arrow added nothing. Arrows that
   mark external links (↗) are left alone. */
html:root body :is(.btn, .text-action, .nav-mobile-cta) > span[aria-hidden="true"]:last-child:not(:first-child) { display: none; }
/* Hard-coded blues left in page-local styles now follow the palette. */
html:root body[data-page="updates"] .calendar-event { background: var(--brand-soft); color: var(--ink); }
html:root body[data-page="updates"] .calendar-day.today .calendar-day-number { background: var(--brand); color: var(--on-brand); }
html:root body[data-page="updates"] .calendar-day.selected { box-shadow: inset 0 0 0 2px var(--brand); }
html:root body[data-page="updates"] .mobile-agenda-day { border-color: var(--line); }
html:root body[data-page="updates"] .mobile-agenda-day-header { background: var(--mist); }
html:root body[data-page="updates"] .mobile-agenda-day-date { color: var(--ink); }
html:root body[data-page="updates"] .mobile-agenda-today { background: var(--lime); color: #061a3d; }
html:root body :is(.login-prompt, .form-status[data-tone="info"]) { border-color: var(--line); background: var(--mist); color: var(--ink); }
html:root body .post-children { border-left-color: var(--line-strong); }
html:root body[data-page="updates"] .calendar-toolbar-end { display: flex; align-items: center; gap: .5rem; }
html:root body[data-page="updates"] .calendar-today { min-height: 44px; padding: 0 .9rem; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
@media (hover: hover) { html:root body[data-page="updates"] .calendar-today:hover { border-color: var(--ink); background: var(--mist); } }
html:root body[data-page="admin"] .schedule-date-hint { display: block; margin-top: .3rem; color: var(--muted); font-size: .75rem; line-height: 1.4; }
/* Guide byline: who wrote it and when, under the guide title. */
html:root .page-hero .guide-byline { margin-top: 1.25rem; padding-top: .9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; line-height: 1.6; }
html:root .page-hero .guide-byline [data-byline-author] { color: var(--ink); font-weight: 650; }
html:root body[data-page="admin"] .guide-byline-admin { display: grid; gap: 1.25rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 4px solid var(--navy); }
html:root body[data-page="admin"] .guide-byline-form { display: grid; gap: .9rem; justify-items: start; padding: 1.1rem; border: 1px solid var(--line); background: var(--paper); }
html:root body[data-page="admin"] .guide-byline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1rem; width: 100%; }
html:root body[data-page="admin"] .guide-byline-grid input { width: 100%; }
@media (max-width: 48rem) { html:root body[data-page="admin"] .guide-byline-grid { grid-template-columns: 1fr; } }
/* Legacy "gold" accents on working pages (question bank buttons, favourites,
   difficulty chips) become the logo's green. Warning badges keep their own
   semantic colour above. */
:root { --gold: var(--green); --gold-dark: #2b5d17; --gold-bg: var(--lime-soft); --primary-dark: var(--navy-deep); --primary-bg: var(--brand-soft); }
html:root body[data-page="practice"] .diff-badge { border-radius: 0; font-weight: 650; }
html:root body[data-page="practice"] .progress-fill { background: var(--green); }
html:root body[data-page="practice"] .prac-btn { box-shadow: none !important; transform: none !important; font-weight: 650; }
/* Jump links on the support page are a table of contents, not steps. */
html:root body[data-page="programs"] .support-jump a > span:first-child { display: none; }
html:root body[data-page="programs"] .support-jump a { font-weight: 600; }
/* Question lists inside guides */
html:root .guide-faq-list { max-width: 52rem; border-bottom: 1px solid var(--line); }
html:root .guide-faq-list details { border-top: 1px solid var(--line); }
html:root .guide-faq-list details:first-child { border-top: 2px solid var(--navy); }
html:root .guide-faq-list summary { padding-block: 1.1rem; color: var(--ink); font-size: 1.1rem; font-weight: 650; cursor: pointer; }
html:root .guide-faq-list details p { max-width: 62ch; padding-bottom: 1.2rem; margin: 0; line-height: 1.65; }
html:root .guide-faq-source { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
html:root .guide-faq-source a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
/* Numbers that line up read better with fixed-width digits. */
html:root body :is(table, .calendar-day-number, .timeline-date, [data-site-stat]) { font-variant-numeric: tabular-nums; }
/* Long words and URLs in user posts wrap instead of widening the page. */
html:root body :is(.post-body, .thread-body, .forum-post, .reply-body) { overflow-wrap: anywhere; }

/* Team photos fill the round avatar; initials stay underneath as a fallback. */
html:root :is(.team-avatar, .ns-member-avatar).has-photo { position: relative; overflow: hidden; }
html:root :is(.team-avatar, .ns-member-avatar).has-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: inherit; object-fit: cover; display: block;
}

/* Team cards: the main title takes its position color, mixed toward the
   text color (the same mix the chips use) so it stays readable in both themes. */
html:root body[data-page="about"] .team-profile-card.has-role-color .team-profile-name .role {
  color: color-mix(in srgb, var(--team-role-color) 70%, var(--ink));
  font-weight: 600;
}
html:root body[data-page="about"] .team-profile-summary .team-group-list { justify-content: center; gap: .4rem; }
/* Chips mix their color into the page surface, so they also read on the dark theme. */
html:root :is(.team-position-chip, .team-group-chip) {
  border-color: color-mix(in srgb, var(--team-chip-color, #64748B) 40%, var(--paper));
  background: color-mix(in srgb, var(--team-chip-color, #64748B) 12%, var(--paper));
  color: color-mix(in srgb, var(--team-chip-color, #64748B) 70%, var(--ink));
}

/* Empty calendar cells (before the 1st and after the last day) follow the
   theme instead of the old fixed light gray. */
html:root :is(.calendar-blank, .sched-cal-blank) { background: var(--mist); border-color: var(--line); }

/* ─── Daily English reading ─────────────────────────────────────────── */
html:root body[data-page="reading"] .reading-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
html:root body[data-page="reading"] .reading-article { max-width: 40rem; }
/* Level switch: the little bars climb with the difficulty. */
html:root body[data-page="reading"] .reading-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 40rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); border: 1px solid var(--line-strong); }
html:root body[data-page="reading"] .reading-level { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .6rem; align-items: center; padding: .7rem .9rem; border: 0; background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
html:root body[data-page="reading"] .reading-level + .reading-level { border-left: 1px solid var(--line-strong); }
@media (hover: hover) { html:root body[data-page="reading"] .reading-level:hover { background: var(--mist); } }
html:root body[data-page="reading"] .reading-level:focus-visible { position: relative; outline: 3px solid var(--focus); outline-offset: 2px; }
html:root body[data-page="reading"] .reading-level__steps { grid-row: span 2; display: inline-flex; gap: 2px; align-items: flex-end; height: 1.5rem; }
html:root body[data-page="reading"] .reading-level__steps i { width: .4rem; background: var(--line); }
html:root body[data-page="reading"] .reading-level__steps i:nth-child(1) { height: 40%; }
html:root body[data-page="reading"] .reading-level__steps i:nth-child(2) { height: 70%; }
html:root body[data-page="reading"] .reading-level__steps i:nth-child(3) { height: 100%; }
html:root body[data-page="reading"] .reading-level__name { font-size: 1.0625rem; font-weight: 750; line-height: 1.2; }
html:root body[data-page="reading"] .reading-level__for { grid-column: 2; color: var(--muted); font-size: .8125rem; line-height: 1.3; }
html:root body[data-page="reading"] .reading-level[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
html:root body[data-page="reading"] .reading-level[aria-pressed="true"] .reading-level__for { color: inherit; opacity: .85; }
html:root body[data-page="reading"] .reading-level[aria-pressed="true"] .reading-level__steps i { background: color-mix(in srgb, var(--on-brand) 30%, transparent); }
html:root body[data-page="reading"] .reading-level[data-level="easy"] .reading-level__steps i:nth-child(1), html:root body[data-page="reading"] .reading-level[data-level="medium"] .reading-level__steps i:nth-child(-n+2), html:root body[data-page="reading"] .reading-level[data-level="hard"] .reading-level__steps i { background: var(--accent); }
html:root body[data-page="reading"] .reading-level[aria-pressed="true"][data-level="easy"] .reading-level__steps i:nth-child(1), html:root body[data-page="reading"] .reading-level[aria-pressed="true"][data-level="medium"] .reading-level__steps i:nth-child(-n+2), html:root body[data-page="reading"] .reading-level[aria-pressed="true"][data-level="hard"] .reading-level__steps i { background: var(--on-brand); }
@media (max-width: 34rem) {
  html:root body[data-page="reading"] .reading-level { grid-template-columns: 1fr; padding: .6rem .55rem; }
  html:root body[data-page="reading"] .reading-level__steps { grid-row: auto; height: 1rem; }
  html:root body[data-page="reading"] .reading-level__for { grid-column: 1; }
}
html:root body[data-page="reading"] .reading-status { color: var(--muted); font-size: 1.05rem; }
html:root body[data-page="reading"] .reading-meta { margin: 0 0 .6rem; color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="reading"] .reading-title { margin: 0 0 1rem; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -.02em; font-stretch: 88%; }
html:root body[data-page="reading"] .reading-tools { margin-bottom: 1.75rem; }
html:root body[data-page="reading"] .reading-body p { margin: 0 0 1.25em; font-size: 1.1875rem; line-height: 1.75; color: var(--ink); }
html:root body[data-page="reading"] .reading-word {
  color: inherit; text-decoration: underline; text-decoration-color: var(--green);
  text-decoration-thickness: 2px; text-underline-offset: .22em;
}
@media (hover: hover) { html:root body[data-page="reading"] .reading-word:hover { background: var(--accent-soft); } }
html:root body[data-page="reading"] .reading-note { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
html:root body[data-page="reading"] .reading-side { position: sticky; top: 6rem; display: grid; gap: 2.5rem; }
html:root body[data-page="reading"] .reading-side h2 { margin: 0 0 1rem; padding-top: .9rem; border-top: 4px solid var(--brand); font-size: 1.125rem; }
html:root body[data-page="reading"] .reading-vocab-list { margin: 0; }
html:root body[data-page="reading"] .reading-vocab-term { display: flex; gap: .5rem; align-items: baseline; margin-top: 1rem; font-size: 1.05rem; scroll-margin-top: 7rem; }
html:root body[data-page="reading"] .reading-vocab-term:first-child { margin-top: 0; }
html:root body[data-page="reading"] .reading-vocab-term:target { background: var(--accent-soft); }
html:root body[data-page="reading"] .reading-pos { color: var(--muted); font-size: .85rem; font-style: italic; }
html:root body[data-page="reading"] .reading-vocab-detail { display: grid; gap: .2rem; margin: .25rem 0 0; padding-bottom: 1rem; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.5; }
html:root body[data-page="reading"] .reading-zh { color: var(--ink); font-weight: 600; }
html:root body[data-page="reading"] .reading-definition { color: var(--ink-soft, var(--muted)); }
html:root body[data-page="reading"] .reading-example { color: var(--muted); font-style: italic; }
html:root body[data-page="reading"] .reading-archive-list { margin: 0; padding: 0; list-style: none; }
html:root body[data-page="reading"] .reading-archive-list a { display: grid; gap: .1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
@media (hover: hover) { html:root body[data-page="reading"] .reading-archive-list a:hover .reading-archive-title { text-decoration: underline; } }
html:root body[data-page="reading"] .reading-archive-list a[aria-current="page"] { color: var(--brand); font-weight: 650; }
html:root body[data-page="reading"] .reading-archive-date { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="reading"] .reading-questions-section { padding-top: 0; }
html:root body[data-page="reading"] .reading-questions { max-width: 46rem; }
html:root body[data-page="reading"] .reading-questions h2 { margin: 0 0 1.5rem; padding-top: 1rem; border-top: 6px solid var(--brand); }
html:root body[data-page="reading"] .reading-question-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2rem; counter-reset: reading-question; }
html:root body[data-page="reading"] .reading-question { counter-increment: reading-question; }
html:root body[data-page="reading"] .reading-question legend::before { content: counter(reading-question) ". "; color: var(--muted); font-variant-numeric: tabular-nums; }
html:root body[data-page="reading"] .reading-question fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: .5rem; }
html:root body[data-page="reading"] .reading-question legend { margin-bottom: .5rem; font-size: 1.125rem; font-weight: 650; line-height: 1.45; }
html:root body[data-page="reading"] .reading-option { display: flex; gap: .65rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--line); cursor: pointer; line-height: 1.45; }
@media (hover: hover) { html:root body[data-page="reading"] .reading-option:hover { border-color: var(--brand); } }
html:root body[data-page="reading"] .reading-option input { margin-top: .2rem; accent-color: var(--brand); }
html:root body[data-page="reading"] .reading-option.is-answer { border-color: var(--positive); background: var(--positive-soft); }
html:root body[data-page="reading"] .reading-option.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
html:root body[data-page="reading"] .reading-check { justify-self: start; margin-top: .25rem; }
html:root body[data-page="reading"] .reading-result p { margin: .35rem 0 0; line-height: 1.6; }
html:root body[data-page="reading"] .reading-result[data-tone="right"] .reading-verdict { color: var(--positive); font-weight: 650; }
html:root body[data-page="reading"] .reading-result[data-tone="wrong"] .reading-verdict { color: var(--danger); font-weight: 650; }
html:root body[data-page="reading"] .reading-more { padding-top: 0; }
html:root body[data-page="reading"] .reading-more-inner p { margin: 0; color: var(--muted); }
html:root body[data-page="reading"] .reading-more-inner a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 56rem) {
  html:root body[data-page="reading"] .reading-layout { grid-template-columns: 1fr; }
  html:root body[data-page="reading"] .reading-side { position: static; }
  html:root body[data-page="reading"] .reading-body p { font-size: 1.0625rem; }
}

/* ─── AI study helper ─────────────────────────────────────────────────── */
html:root body[data-page="ask"] .ask-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
html:root body[data-page="ask"] .ask-panel { border: 1px solid var(--line-strong); background: var(--paper); min-width: 0; }
html:root body[data-page="ask"] .ask-modes { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-strong); }
html:root body[data-page="ask"] .ask-mode {
  min-height: 3.25rem; padding: .75rem 1rem; border: 0; background: var(--mist); color: var(--ink);
  font: inherit; font-weight: 650; cursor: pointer;
}
html:root body[data-page="ask"] .ask-mode + .ask-mode { border-left: 1px solid var(--line-strong); }
html:root body[data-page="ask"] .ask-mode[aria-selected="true"] { background: var(--brand); color: var(--on-brand); }
html:root body[data-page="ask"] .ask-mode:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
html:root body[data-page="ask"] .ask-transcript { display: grid; gap: 1.25rem; min-height: 16rem; max-height: min(60vh, 38rem); overflow-y: auto; padding: 1.5rem; }
html:root body[data-page="ask"] .ask-empty-lead { margin: 0 0 .9rem; color: var(--muted); }
html:root body[data-page="ask"] .ask-examples { display: grid; gap: .5rem; }
html:root body[data-page="ask"] .ask-example {
  justify-self: start; padding: .6rem .85rem; border: 1px solid var(--line); background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
@media (hover: hover) { html:root body[data-page="ask"] .ask-example:hover { border-color: var(--brand); color: var(--brand); } }
html:root body[data-page="ask"] .ask-message { max-width: 44rem; }
html:root body[data-page="ask"] .ask-message-user { justify-self: end; padding: .75rem 1rem; background: var(--mist); }
html:root body[data-page="ask"] .ask-message-assistant { padding-left: 1rem; border-left: 3px solid var(--green); }
html:root body[data-page="ask"] .ask-who { margin: 0 0 .3rem; color: var(--muted); font-size: .8125rem; font-weight: 650; }
html:root body[data-page="ask"] .ask-user-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
html:root body[data-page="ask"] .ask-message-photo { display: block; max-width: min(100%, 16rem); max-height: 14rem; margin-bottom: .5rem; object-fit: contain; border: 1px solid var(--line); }
html:root body[data-page="ask"] .ask-answer-text { line-height: 1.65; overflow-wrap: anywhere; }
html:root body[data-page="ask"] .ask-answer-text :is(p, ol, ul) { margin: 0 0 .7rem; }
html:root body[data-page="ask"] .ask-answer-text :is(ol, ul) { padding-left: 1.3rem; }
html:root body[data-page="ask"] .ask-answer-text li + li { margin-top: .25rem; }
html:root body[data-page="ask"] .ask-thinking { margin: 0; color: var(--muted); }
html:root body[data-page="ask"] .ask-sources, html:root body[data-page="ask"] .ask-truncated { margin: .25rem 0 0; color: var(--muted); font-size: .875rem; }
html:root body[data-page="ask"] .ask-sources a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
html:root body[data-page="ask"] .ask-gate { display: grid; gap: 1rem; justify-items: start; padding: 0 1.5rem 1.5rem; }
html:root body[data-page="ask"] .ask-gate p { margin: 0; max-width: 34rem; line-height: 1.6; }
html:root body[data-page="ask"] .ask-composer { display: grid; gap: .65rem; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid var(--line); }
html:root body[data-page="ask"] .ask-composer textarea { width: 100%; min-height: 5.5rem; padding: .7rem .85rem; resize: vertical; font: inherit; line-height: 1.5; }
html:root body[data-page="ask"] .ask-photo { display: flex; gap: .75rem; align-items: center; }
html:root body[data-page="ask"] .ask-photo img { width: 4.5rem; height: 4.5rem; object-fit: cover; border: 1px solid var(--line); }
html:root body[data-page="ask"] .ask-photo-remove, html:root body[data-page="ask"] .ask-reset {
  padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: .2em; cursor: pointer;
}
html:root body[data-page="ask"] .ask-composer-bar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; }
html:root body[data-page="ask"] .ask-attach { cursor: pointer; }
html:root body[data-page="ask"] .ask-attach:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
html:root body[data-page="ask"] .ask-remaining { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="ask"] .ask-keys { color: var(--muted); font-size: .8125rem; }
@media not ((hover: hover) and (pointer: fine)) { html:root body[data-page="ask"] .ask-keys { display: none; } }
html:root body[data-page="ask"] .ask-send { margin-left: auto; }
html:root body[data-page="ask"] .ask-composer .form-status:empty { display: none; }
html:root body[data-page="ask"] .ask-notes { display: grid; gap: 1.75rem; }
html:root body[data-page="ask"] .ask-notes h2 { margin: 0 0 .5rem; padding-top: .8rem; border-top: 4px solid var(--brand); font-size: 1.0625rem; }
html:root body[data-page="ask"] .ask-notes p { margin: 0; color: var(--muted); line-height: 1.6; }
html:root body[data-page="ask"] .ask-notes a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 56rem) {
  html:root body[data-page="ask"] .ask-layout { grid-template-columns: 1fr; }
  html:root body[data-page="ask"] .ask-transcript { padding: 1rem; max-height: none; }
  html:root body[data-page="ask"] .ask-composer { padding: 1rem; }
}
html:root body[data-page="join"] .join-ai-note { margin-top: 1rem; font-size: 1rem; }
html:root body[data-page="join"] .join-ai-note a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }

/* ─── Word of the day ─────────────────────────────────────────────────── */
/* The syllable row: the stressed syllable is the raised, dark step. */
html:root body[data-page="word"] .word-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
html:root body[data-page="word"] .word-layout--single { grid-template-columns: minmax(0, 1fr); }
html:root body[data-page="word"] .word-entry { min-width: 0; max-width: 44rem; }
html:root body[data-page="word"] .word-status { color: var(--muted); font-size: 1.05rem; }
html:root body[data-page="word"] .word-meta { margin: 0 0 .75rem; color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="word"] .word-headword { margin: 0; color: var(--ink); font-size: clamp(2.75rem, 9vw, 5.75rem); font-weight: 800; font-stretch: 75%; line-height: .96; letter-spacing: -.03em; overflow-wrap: anywhere; }
html:root body[data-page="word"] .word-headword[data-size="m"] { font-size: clamp(2.25rem, 6.6vw, 4.5rem); }
html:root body[data-page="word"] .word-headword[data-size="s"] { font-size: clamp(1.8rem, 5vw, 3.4rem); }
html:root body[data-page="word"] .word-headword[data-size="xs"] { font-size: clamp(1.45rem, 3.7vw, 2.6rem); line-height: 1.05; letter-spacing: -.02em; }
html:root body[data-page="word"] .word-pos { margin: .7rem 0 0; color: var(--muted); font-size: 1.05rem; font-style: italic; }
html:root body[data-page="word"] .word-block { margin-top: 2.75rem; }
html:root body[data-page="word"] .word-block__title { margin: 0 0 1.1rem; padding-top: .8rem; border-top: 4px solid var(--brand); font-size: 1.125rem; }
html:root body[data-page="word"] .word-block p { max-width: 40rem; }
html:root body[data-page="word"] .word-syllables { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .35rem; margin: 0; padding: 0; list-style: none; }
html:root body[data-page="word"] .word-syllables li { padding: .6rem .8rem; background: var(--mist); border-bottom: 4px solid var(--line-strong); color: var(--ink); font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 650; line-height: 1; }
html:root body[data-page="word"] .word-syllables li.is-stressed { padding-top: 1.3rem; background: var(--brand); border-bottom-color: var(--lime); color: var(--on-brand); font-weight: 800; text-transform: uppercase; }
html:root body[data-page="word"] .word-say__count { margin: .65rem 0 0; color: var(--muted); font-size: .9rem; }
html:root body[data-page="word"] .word-ipa { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: baseline; margin: 1.1rem 0 0; }
html:root body[data-page="word"] .word-ipa__label { padding: .1rem .35rem; border: 1px solid var(--line-strong); color: var(--muted); font-size: .75rem; font-weight: 700; }
html:root body[data-page="word"] .word-ipa__value { font-family: "Charis SIL", "Gentium Plus", "Segoe UI", "Helvetica Neue", "Noto Sans", "DejaVu Sans", Arial, sans-serif; font-size: 1.3rem; overflow-wrap: anywhere; }
html:root body[data-page="word"] .word-listen { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
html:root body[data-page="word"] .word-listen__note { margin: .55rem 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
html:root body[data-page="word"] .word-say__tip { margin: 1.1rem 0 0; line-height: 1.7; }
html:root body[data-page="word"] .word-zh { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.35; }
html:root body[data-page="word"] .word-definition { margin: .45rem 0 0; font-size: 1.1875rem; line-height: 1.55; }
html:root body[data-page="word"] .word-explanation { margin: .9rem 0 0; color: var(--ink-soft); line-height: 1.7; }
html:root body[data-page="word"] .word-simpler { display: inline-block; margin: 1rem 0 0; padding: .55rem .85rem; background: var(--accent-soft); line-height: 1.5; }
html:root body[data-page="word"] .word-simpler__label { font-weight: 650; }
html:root body[data-page="word"] .word-parts { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
html:root body[data-page="word"] .word-part { display: grid; grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr); gap: .25rem 1.25rem; align-items: baseline; padding: .75rem 0; border-bottom: 1px solid var(--line); }
html:root body[data-page="word"] .word-part__piece { color: var(--brand); font-size: 1.25rem; font-weight: 750; overflow-wrap: anywhere; }
html:root body[data-page="word"] .word-part__meaning { line-height: 1.5; }
html:root body[data-page="word"] .word-origin { margin: 1rem 0 0; color: var(--ink-soft); line-height: 1.7; }
html:root body[data-page="word"] .word-examples { display: grid; gap: 1.2rem; margin: 0; padding: 0; list-style: none; }
html:root body[data-page="word"] .word-example { min-width: 0; padding-left: 1rem; border-left: 4px solid var(--lime); }
html:root body[data-page="word"] .word-example__en { margin: 0; font-size: 1.125rem; line-height: 1.6; overflow-wrap: anywhere; }
html:root body[data-page="word"] .word-example__zh { margin: .25rem 0 0; color: var(--muted); line-height: 1.6; }
html:root body[data-page="word"] .word-hit { padding: 0 .15em; background: var(--accent-soft); color: inherit; font-weight: 700; }
html:root body[data-page="word"] .word-memory p { margin: 0; padding: 1rem 1.1rem; background: var(--mist); line-height: 1.65; }
html:root body[data-page="word"] .word-note { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
html:root body[data-page="word"] .word-side { position: sticky; top: 6rem; }
html:root body[data-page="word"] .word-side h2 { margin: 0 0 1rem; padding-top: .9rem; border-top: 4px solid var(--brand); font-size: 1.125rem; }
html:root body[data-page="word"] .word-archive-list { margin: 0; padding: 0; list-style: none; }
html:root body[data-page="word"] .word-archive-list a { display: grid; gap: .1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
@media (hover: hover) { html:root body[data-page="word"] .word-archive-list a:hover .word-archive-word { text-decoration: underline; } }
html:root body[data-page="word"] .word-archive-list a[aria-current="page"] .word-archive-word { color: var(--brand); font-weight: 750; }
html:root body[data-page="word"] .word-archive-date { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="word"] .word-archive-word { font-weight: 650; overflow-wrap: anywhere; }
html:root body[data-page="word"] .word-archive-zh { color: var(--muted); font-size: .875rem; }
html:root body[data-page="word"] .word-more { padding-top: 0; }
html:root body[data-page="word"] .word-more-inner p { margin: 0; color: var(--muted); }
html:root body[data-page="word"] .word-more-inner a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 56rem) {
  html:root body[data-page="word"] .word-layout { grid-template-columns: 1fr; }
  html:root body[data-page="word"] .word-side { position: static; }
  html:root body[data-page="word"] .word-part { grid-template-columns: 1fr; }
}

/* Admin: the word editor reuses the reading list; only its fields differ. */
html:root .readings-subheading { margin: 2.5rem 0 .35rem; padding-top: 1.5rem; border-top: 4px solid var(--brand); }
html:root .readings-subheading + p { margin: 0 0 1.25rem; color: var(--muted); }
html:root .words-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1rem; }
html:root .words-replace label { display: grid; gap: .3rem; font-size: .875rem; font-weight: 600; flex: 1 1 16rem; }
html:root .words-replace input { font: inherit; font-weight: 400; }
html:root .words-preview { padding: 1rem; background: var(--mist); font-size: .9rem; line-height: 1.6; }
html:root .words-preview p { margin: 0 0 .5rem; }
html:root .words-preview p:last-child { margin-bottom: 0; }
html:root .words-replace { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
@media (max-width: 40rem) { html:root .words-fields { grid-template-columns: 1fr; } }

/* ─── Ask AI about one practice question (question bank and SAT) ─────── */
html:root .qai { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
html:root .qai-toggle { display: inline-flex; gap: .6rem; align-items: center; padding: .6rem .95rem; border: 1px solid var(--brand); background: var(--paper); color: var(--brand); font: inherit; font-size: .9375rem; font-weight: 650; cursor: pointer; }
@media (hover: hover) { html:root .qai-toggle:hover { background: var(--mist); } }
html:root .qai-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
html:root .qai-toggle__mark { flex: none; width: .65rem; height: .65rem; background: var(--accent); }
html:root .qai[data-state="wrong"] .qai-toggle { background: var(--brand); color: var(--on-brand); }
@media (hover: hover) { html:root .qai[data-state="wrong"] .qai-toggle:hover { background: var(--brand-strong); } }
html:root .qai[data-state="wrong"] .qai-toggle__mark { background: var(--lime); }
html:root .qai-body { display: grid; gap: .8rem; margin-top: .9rem; padding: 1rem; background: var(--mist); }
html:root .qai-log { display: grid; gap: .8rem; max-height: 28rem; overflow-y: auto; }
html:root .qai-msg--user { justify-self: end; max-width: 85%; padding: .5rem .75rem; border: 1px solid var(--line); background: var(--paper); }
html:root .qai-msg--user p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
html:root .qai-msg--assistant { padding-left: .85rem; border-left: 3px solid var(--accent); }
html:root .qai-answer { line-height: 1.6; overflow-wrap: anywhere; }
html:root .qai-answer :is(p, ol, ul) { margin: 0 0 .6rem; }
html:root .qai-answer :is(p, ol, ul):last-child { margin-bottom: 0; }
html:root .qai-answer :is(ol, ul) { padding-left: 1.3rem; }
html:root .qai-waiting, html:root .qai-note { margin: 0; color: var(--muted); }
/* A reply on its way: three dots that rise in turn. Shared with the study helper page. */
html:root .ai-dots { display: inline-flex; gap: .3rem; align-items: center; height: 1.6rem; }
html:root .ai-dots i { width: .45rem; height: .45rem; background: currentColor; opacity: .4; animation: ai-dot 1.1s ease-in-out infinite; }
html:root .ai-dots i:nth-child(2) { animation-delay: .16s; }
html:root .ai-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes ai-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-.32rem); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html:root .ai-dots i { animation: none; opacity: .75; }
}
html:root .qai-form[hidden] { display: none; }
html:root .qai-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
html:root .qai-chip { padding: .35rem .7rem; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; font-size: .875rem; cursor: pointer; }
@media (hover: hover) { html:root .qai-chip:hover { border-color: var(--brand); color: var(--brand); } }
html:root .qai-chip--main { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
@media (hover: hover) { html:root .qai-chip--main:hover { border-color: var(--brand-strong); background: var(--brand-strong); color: var(--on-brand); } }
html:root .qai-form { display: flex; gap: .5rem; align-items: flex-end; }
html:root .qai-input { flex: 1; min-width: 0; min-height: 2.6rem; padding: .55rem .7rem; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; resize: vertical; }
html:root .qai-meta { margin: 0; color: var(--muted); font-size: .8125rem; }
html:root .qai-meta[data-tone="error"] { color: var(--danger); }

html:root body[data-page="practice"] .practice-sat-callout { margin-top: 1.5rem; margin-bottom: -.5rem; }
html:root body[data-page="practice"] .practice-sat-callout__link { display: grid; gap: .2rem; padding: .9rem 1.1rem; border: 1px solid var(--line-strong); border-left: 6px solid var(--accent); background: var(--paper); color: var(--ink); text-decoration: none; }
@media (hover: hover) { html:root body[data-page="practice"] .practice-sat-callout__link:hover { border-color: var(--brand); background: var(--mist); } }
html:root body[data-page="practice"] .practice-sat-callout__title { font-size: 1.125rem; font-weight: 750; }
html:root body[data-page="practice"] .practice-sat-callout__text { color: var(--muted); font-size: .9375rem; line-height: 1.5; }

/* ─── SAT practice ────────────────────────────────────────────────────── */
html:root body[data-page="sat"] .sat-status { color: var(--muted); font-size: 1.05rem; }
html:root body[data-page="sat"] .sat-muted { max-width: 46rem; color: var(--muted); line-height: 1.6; }
html:root body[data-page="sat"] .sat-note { margin: .5rem 0 0; color: var(--muted); font-size: .875rem; }
html:root body[data-page="sat"] .sat-banner { margin: 0 0 2rem; padding: .8rem 1rem; background: var(--warning-soft); color: var(--warning); }
html:root body[data-page="sat"] .sat-signin { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-bottom: 2rem; padding: 1rem 1.1rem; border-left: 4px solid var(--accent); background: var(--mist); }
html:root body[data-page="sat"] .sat-signin p { flex: 1 1 20rem; margin: 0; line-height: 1.55; }
html:root body[data-page="sat"] .sat-panel { margin-bottom: clamp(2rem, 4vw, 3rem); padding-top: .9rem; border-top: 4px solid var(--brand); }
html:root body[data-page="sat"] .sat-panel > h2, html:root body[data-page="sat"] .sat-map__head h2, html:root body[data-page="sat"] .sat-about h2 { margin: 0 0 .75rem; font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
html:root body[data-page="sat"] .sat-link { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
html:root body[data-page="sat"] .sat-strip { display: inline-flex; flex: none; gap: 2px; align-items: stretch; height: 1rem; }
html:root body[data-page="sat"] .sat-strip__cell { display: block; width: 6px; background: var(--line); }
html:root body[data-page="sat"] .sat-strip__cell.is-right { background: var(--accent); }
html:root body[data-page="sat"] .sat-strip__cell.is-wrong { background: var(--danger); }
html:root body[data-page="sat"] .sat-level { display: inline-block; padding: .1rem .45rem; font-size: .75rem; font-weight: 700; white-space: nowrap; }
html:root body[data-page="sat"] .sat-level--new { background: var(--mist); color: var(--muted); }
html:root body[data-page="sat"] .sat-level--weak { background: var(--danger-soft); color: var(--danger); }
html:root body[data-page="sat"] .sat-level--growing { background: var(--warning-soft); color: var(--warning); }
html:root body[data-page="sat"] .sat-level--strong { background: var(--positive-soft); color: var(--positive); }
html:root body[data-page="sat"] .sat-focus__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
html:root body[data-page="sat"] .sat-focus__item { display: grid; gap: .45rem; align-content: start; padding: 1rem; border-top: 3px solid var(--danger); background: var(--mist); }
html:root body[data-page="sat"] .sat-focus__item p { margin: 0; }
html:root body[data-page="sat"] .sat-focus__where { color: var(--muted); font-size: .8125rem; }
html:root body[data-page="sat"] .sat-focus__skill { font-size: 1.125rem; font-weight: 750; line-height: 1.25; }
html:root body[data-page="sat"] .sat-focus__rate { color: var(--muted); font-size: .875rem; }
html:root body[data-page="sat"] .sat-focus__item .btn { justify-self: start; margin-top: .35rem; }
html:root body[data-page="sat"] .sat-timed__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin-top: 1rem; }
html:root body[data-page="sat"] .sat-timed__card { display: grid; gap: .5rem; align-content: start; padding: 1rem 1.1rem; border: 1px solid var(--line-strong); }
html:root body[data-page="sat"] .sat-timed__card h3 { margin: 0; font-size: 1.125rem; }
html:root body[data-page="sat"] .sat-timed__card .sat-muted { margin: 0; }
html:root body[data-page="sat"] .sat-timed__buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
html:root body[data-page="sat"] .sat-map { margin-bottom: clamp(2rem, 4vw, 3rem); }
html:root body[data-page="sat"] .sat-map__head { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; padding-top: .9rem; border-top: 4px solid var(--brand); }
html:root body[data-page="sat"] .sat-map__head h2 { margin: 0; }
html:root body[data-page="sat"] .sat-map__sum { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
html:root body[data-page="sat"] .sat-map__head .sat-tools { margin-left: auto; }
html:root body[data-page="sat"] .sat-domain { margin-top: 1.5rem; }
html:root body[data-page="sat"] .sat-domain__name { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; margin: 0 0 .25rem; font-size: 1.0625rem; }
html:root body[data-page="sat"] .sat-domain__share { color: var(--muted); font-size: .8125rem; font-weight: 400; }
html:root body[data-page="sat"] .sat-skills { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
html:root body[data-page="sat"] .sat-skill { display: grid; grid-template-columns: minmax(12rem, 1.1fr) minmax(0, 1.5fr) auto; gap: .5rem 1.25rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
html:root body[data-page="sat"] .sat-skill__name { display: grid; gap: .1rem; }
html:root body[data-page="sat"] .sat-skill__title { font-weight: 650; }
html:root body[data-page="sat"] .sat-skill__count { color: var(--muted); font-size: .8125rem; }
html:root body[data-page="sat"] .sat-skill__stat { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; }
html:root body[data-page="sat"] .sat-skill__rate { min-width: 7.5rem; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="sat"] .sat-skill__actions { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: center; justify-content: flex-end; }
html:root body[data-page="sat"] .sat-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
/* The two tool buttons are the same size: the reference sheet matches the calculator link. */
html:root body[data-page="sat"] .sat-tools > .btn,
html:root body[data-page="sat"] .sat-tools .sat-reference > summary { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .4rem .9rem; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font-size: .875rem; font-weight: 650; }
@media (hover: hover) {
html:root body[data-page="sat"] .sat-tools > .btn:hover,
html:root body[data-page="sat"] .sat-tools .sat-reference > summary:hover { border-color: var(--brand); color: var(--brand); background: var(--paper); }
}
html:root body[data-page="sat"] .sat-reference__panel { position: absolute; top: calc(100% + 4px); right: 0; z-index: 6; width: min(28rem, 86vw); padding: 1rem; border: 1px solid var(--line-strong); background: var(--paper); box-shadow: var(--shadow-float); }
html:root body[data-page="sat"] .sat-reference__panel dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
html:root body[data-page="sat"] .sat-reference__panel p { margin: .75rem 0 0; color: var(--muted); font-size: .8125rem; }
html:root body[data-page="sat"] .sat-about { max-width: 46rem; padding-top: .9rem; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.6; }
html:root body[data-page="sat"] .sat-about h2 { color: var(--ink); font-size: 1.125rem; }
html:root body[data-page="sat"] .sat-about a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
html:root body[data-page="sat"] .sat-runbar, html:root body[data-page="sat"] .sat-testbar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
html:root body[data-page="sat"] .sat-back { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 650; cursor: pointer; }
html:root body[data-page="sat"] .sat-runbar__title, html:root body[data-page="sat"] .sat-testbar__title { flex: 1 1 14rem; }
html:root body[data-page="sat"] .sat-runbar__where, html:root body[data-page="sat"] .sat-testbar__title p { margin: 0; color: var(--muted); font-size: .8125rem; }
html:root body[data-page="sat"] .sat-runbar__skill, html:root body[data-page="sat"] .sat-testbar__title h2 { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.2; }
html:root body[data-page="sat"] .sat-runbar__meter { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
html:root body[data-page="sat"] .sat-runbar__label, html:root body[data-page="sat"] .sat-runbar__rate { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="sat"] .sat-testbar__tools { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
html:root body[data-page="sat"] .sat-clock { display: inline-flex; gap: .6rem; align-items: baseline; padding: .35rem .7rem; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
html:root body[data-page="sat"] .sat-clock__time { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
html:root body[data-page="sat"] .sat-clock__toggle { color: var(--muted); font-size: .75rem; }
html:root body[data-page="sat"] .sat-clock.is-hidden .sat-clock__time { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html:root body[data-page="sat"] .sat-clock.is-low { border-color: var(--danger); color: var(--danger); }
html:root body[data-page="sat"] .sat-q { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; }
html:root body[data-page="sat"] .sat-q--math { max-width: 46rem; }
html:root body[data-page="sat"] .sat-q__stimulus { min-width: 0; font-size: 1.0625rem; line-height: 1.75; }
html:root body[data-page="sat"] .sat-passage p { margin: 0 0 .9rem; }
html:root body[data-page="sat"] .sat-passage ul { margin: 0 0 .9rem; padding-left: 1.25rem; list-style: disc; }
html:root body[data-page="sat"] .sat-passage li + li { margin-top: .3rem; }
html:root body[data-page="sat"] .sat-textlabel { margin: 0 0 .3rem; font-size: .875rem; font-weight: 750; }
html:root body[data-page="sat"] .sat-passage + .sat-textlabel { margin-top: 1.25rem; }
html:root body[data-page="sat"] .sat-source { color: var(--muted); font-size: .8125rem; font-style: italic; }
html:root body[data-page="sat"] .sat-table { width: 100%; margin: .5rem 0 1rem; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="sat"] .sat-table caption { margin-bottom: .4rem; font-weight: 650; text-align: left; }
html:root body[data-page="sat"] .sat-table :is(th, html:root body[data-page="sat"] td) { padding: .45rem .6rem; border: 1px solid var(--line-strong); text-align: left; }
html:root body[data-page="sat"] .sat-table th { background: var(--mist); }
html:root body[data-page="sat"] .sat-q__ask { min-width: 0; }
html:root body[data-page="sat"] .sat-q__question { margin: 0 0 1rem; font-size: 1.0625rem; font-weight: 600; line-height: 1.55; }
html:root body[data-page="sat"] .sat-q__question:is(:focus, :focus-visible) { outline: none !important; } /* focused by script to move screen readers, not interactive */
html:root body[data-page="sat"] .sat-options { display: grid; gap: .55rem; }
html:root body[data-page="sat"] .sat-opt { display: flex; gap: .75rem; align-items: flex-start; width: 100%; padding: .7rem .85rem; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { html:root body[data-page="sat"] .sat-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--mist); } }
html:root body[data-page="sat"] .sat-opt:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
html:root body[data-page="sat"] .sat-opt:disabled { cursor: default; }
html:root body[data-page="sat"] .sat-opt__letter { display: grid; flex: none; place-items: center; width: 1.75rem; height: 1.75rem; border: 1px solid currentColor; font-size: .875rem; font-weight: 750; }
html:root body[data-page="sat"] .sat-opt__text { padding-top: .15rem; line-height: 1.5; }
html:root body[data-page="sat"] .sat-opt.is-chosen { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
html:root body[data-page="sat"] .sat-opt.is-chosen .sat-opt__letter { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
html:root body[data-page="sat"] .sat-opt.is-right { border-color: var(--positive); background: var(--positive-soft); }
html:root body[data-page="sat"] .sat-opt.is-right .sat-opt__letter { border-color: var(--positive); background: var(--positive); color: var(--paper); }
html:root body[data-page="sat"] .sat-opt.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
html:root body[data-page="sat"] .sat-opt.is-wrong .sat-opt__letter { border-color: var(--danger); background: var(--danger); color: var(--paper); }
html:root body[data-page="sat"] .sat-spr { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
html:root body[data-page="sat"] .sat-spr label { flex-basis: 100%; font-size: .875rem; font-weight: 650; }
html:root body[data-page="sat"] .sat-spr__input { width: 9rem; padding: .55rem .7rem; border: 2px solid var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="sat"] .sat-spr__input:focus { border-color: var(--brand); outline: none; }
html:root body[data-page="sat"] .sat-spr__hint { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .8125rem; }
html:root body[data-page="sat"] .sat-spr__error { flex-basis: 100%; margin: 0; color: var(--danger); font-size: .875rem; }
html:root body[data-page="sat"] .sat-explain { display: grid; gap: .45rem; margin-top: 1.1rem; padding: .9rem 1rem; border-left: 4px solid var(--positive); background: var(--positive-soft); }
html:root body[data-page="sat"] .sat-explain.is-wrong { border-left-color: var(--danger); background: var(--danger-soft); }
html:root body[data-page="sat"] .sat-explain:is(:focus, :focus-visible) { outline: none !important; }
html:root body[data-page="sat"] .sat-explain p { margin: 0; line-height: 1.6; }
html:root body[data-page="sat"] .sat-explain__verdict { font-weight: 750; }
html:root body[data-page="sat"] .sat-explain.is-right .sat-explain__verdict { color: var(--positive); }
html:root body[data-page="sat"] .sat-explain.is-wrong .sat-explain__verdict { color: var(--danger); }
html:root body[data-page="sat"] .sat-explain__focus { color: var(--muted); font-size: .8125rem; }
html:root body[data-page="sat"] .sat-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; justify-content: flex-end; margin-top: 1rem; }
html:root body[data-page="sat"] .sat-testnav__all { flex: 1 1 14rem; text-align: center; }
html:root body[data-page="sat"] .sat-testnav__all summary { display: inline-block; padding: .55rem .9rem; border: 1px solid var(--line-strong); font-weight: 650; cursor: pointer; list-style: none; }
html:root body[data-page="sat"] .sat-testnav__all summary::-webkit-details-marker { display: none; }
html:root body[data-page="sat"] .sat-testnav__all .sat-grid { justify-content: center; margin-top: .75rem; }
html:root body[data-page="sat"] .sat-testnav__all summary::after { content: " ▾"; color: var(--muted); }
@media (max-width: 40rem) {
  /* Back and Next share one row on a phone; the question list opens underneath. */
  html:root body[data-page="sat"] .sat-testnav__all { grid-column: 1 / -1; order: 3; }
  html:root body[data-page="sat"] .sat-testnav__all summary { display: block; }
}
html:root body[data-page="sat"] .sat-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
html:root body[data-page="sat"] .sat-grid__cell { position: relative; width: 2.4rem; height: 2.4rem; border: 1px dashed var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; }
html:root body[data-page="sat"] .sat-grid__cell.is-answered { border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); }
html:root body[data-page="sat"] .sat-grid__cell.is-current { outline: 3px solid var(--accent); outline-offset: 2px; }
html:root body[data-page="sat"] .sat-grid__cell.is-marked::after { content: ""; position: absolute; top: -1px; right: -1px; border-top: .7rem solid var(--warning); border-left: .7rem solid transparent; }
html:root body[data-page="sat"] .sat-summary__score { margin: 0 0 .5rem; font-size: 1.125rem; }
html:root body[data-page="sat"] .sat-summary__score strong { font-size: 2.5rem; font-weight: 800; font-stretch: 80%; font-variant-numeric: tabular-nums; }
html:root body[data-page="sat"] .sat-summary__list, html:root body[data-page="sat"] .sat-reviewlist__list { margin: 1rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
html:root body[data-page="sat"] .sat-summary__list li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: .75rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line); }
html:root body[data-page="sat"] .sat-summary__mark { font-weight: 800; }
html:root body[data-page="sat"] li.is-right .sat-summary__mark { color: var(--positive); }
html:root body[data-page="sat"] li.is-wrong .sat-summary__mark { color: var(--danger); }
html:root body[data-page="sat"] .sat-summary__diff { color: var(--muted); font-size: .8125rem; }
html:root body[data-page="sat"] .sat-results__modules { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: .5rem 0 1rem; }
html:root body[data-page="sat"] .sat-results__module p { margin: 0; }
html:root body[data-page="sat"] .sat-results__label { color: var(--muted); font-size: .875rem; }
html:root body[data-page="sat"] .sat-results__score { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
html:root body[data-page="sat"] .sat-results__score strong { font-size: 2.5rem; font-weight: 800; font-stretch: 80%; }
html:root body[data-page="sat"] .sat-results__domains { max-width: 32rem; }
html:root body[data-page="sat"] .sat-reviewlist h3 { margin: 1.5rem 0 0; font-size: 1.0625rem; }
html:root body[data-page="sat"] .sat-reviewlist__list li { border-bottom: 1px solid var(--line); }
html:root body[data-page="sat"] .sat-reviewlist__list summary { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: .75rem; align-items: baseline; padding: .6rem 0; cursor: pointer; }
html:root body[data-page="sat"] .sat-reviewlist__answer { color: var(--muted); font-size: .875rem; }
html:root body[data-page="sat"] .sat-reviewlist__list details[open] > .sat-q { padding: .5rem 0 1rem; }
html:root body[data-page="sat"] .sat-break { max-width: 40rem; }
html:root body[data-page="sat"] .sat-break .btn { margin-top: .5rem; }
@media (max-width: 56rem) {
  html:root body[data-page="sat"] .sat-skill { grid-template-columns: minmax(0, 1fr) auto; }
  html:root body[data-page="sat"] .sat-skill__stat { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 34rem) {
  html:root body[data-page="sat"] .sat-strip__cell { width: 4px; }
  html:root body[data-page="sat"] .sat-skill { grid-template-columns: 1fr; }
  html:root body[data-page="sat"] .sat-skill__actions { justify-content: flex-start; }
  /* On phones the formula sheet opens across the full width, under both buttons. */
  html:root body[data-page="sat"] .sat-tools { position: relative; width: 100%; }
  html:root body[data-page="sat"] .sat-reference__panel { left: 0; right: 0; width: auto; }
}

/* ─── Admin: daily reading review ─────────────────────────────────────── */
html:root .readings-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; margin-bottom: 1.25rem; }
html:root .readings-toolbar label { display: grid; gap: .3rem; font-size: .875rem; font-weight: 600; }
html:root .readings-toolbar .form-status { flex-basis: 100%; margin: 0; }
html:root .readings-alert { margin: 0 0 1.25rem; padding: .75rem 1rem; background: var(--warning-soft); color: var(--warning); }
html:root .readings-group + .readings-group { margin-top: 1.75rem; }
html:root .readings-group h4 { margin: 0 0 .5rem; }
html:root .readings-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
html:root .readings-row { border-bottom: 1px solid var(--line); }
html:root .readings-row-head {
  display: grid; grid-template-columns: 10rem 5.5rem minmax(0, 1fr); gap: .75rem; align-items: center;
  width: 100%; padding: .75rem .25rem; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
@media (hover: hover) { html:root .readings-row-head:hover .readings-title { text-decoration: underline; } }
html:root .readings-date { font-variant-numeric: tabular-nums; }
html:root .readings-today { margin-left: .5rem; padding: .05rem .35rem; background: var(--brand); color: var(--on-brand); font-size: .75rem; }
html:root .readings-badge { justify-self: start; padding: .1rem .45rem; border: 1px solid currentColor; font-size: .75rem; font-weight: 650; }
html:root .readings-badge-published { color: var(--positive); }
html:root .readings-badge-draft { color: var(--warning); }
html:root .readings-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:root .readings-level { display: inline-block; min-width: 3.2rem; margin-right: .6rem; padding: .05rem .4rem; background: var(--mist); color: var(--ink); font-size: .75rem; font-weight: 700; text-align: center; }
html:root .readings-level-medium { background: var(--accent-soft); }
html:root .readings-level-hard { background: var(--brand); color: var(--on-brand); }
html:root .readings-editor { display: grid; gap: .85rem; padding: .5rem .25rem 1.5rem; }
html:root .readings-editor label { display: grid; gap: .3rem; font-size: .875rem; font-weight: 600; }
html:root .readings-editor :is(input, textarea) { width: 100%; font: inherit; font-weight: 400; }
html:root .readings-editor textarea { line-height: 1.6; }
html:root .readings-meta { margin: -.4rem 0 0; color: var(--muted); font-size: .8125rem; }
html:root .readings-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: 1rem; background: var(--mist); font-size: .9rem; line-height: 1.5; }
html:root .readings-preview h5 { margin: 0 0 .4rem; font-size: .875rem; }
html:root .readings-preview :is(ul, ol) { margin: 0; padding-left: 1.1rem; }
html:root .readings-preview ol > li + li { margin-top: .6rem; }
html:root .readings-preview ol ul { list-style: none; padding-left: 0; }
html:root .readings-preview .is-answer { color: var(--positive); font-weight: 650; }
html:root .readings-explanation { margin: .2rem 0 0; color: var(--muted); }
html:root .readings-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
html:root .readings-delete { margin-left: auto; color: var(--danger); border-color: var(--danger); }
@media (max-width: 48rem) {
  html:root .readings-row-head { grid-template-columns: 1fr auto; }
  html:root .readings-title { grid-column: 1 / -1; white-space: normal; }
  html:root .readings-preview { grid-template-columns: 1fr; }
}

/* ─── Administrator preview: banner and admin menu ───────────────────── */
html:root .preview-banner {
  flex-wrap: wrap; justify-content: center; gap: .5rem 1rem; padding: .6rem .9rem;
  width: max-content; max-width: calc(100vw - 1.5rem);
  border: 2px solid #dc2626; border-radius: 0; background: #fff5f5; color: #7f1d1d;
  box-shadow: 0 12px 32px rgb(15 23 42 / 22%); font-size: .875rem;
}
html:root .preview-banner-label { display: flex; align-items: center; gap: .5rem; font-weight: 650; }
html:root .preview-banner-select {
  min-height: 2.25rem; padding: .25rem 2rem .25rem .6rem; border: 1px solid #dc2626; background-color: #fff; color: #7f1d1d; font: inherit; font-weight: 600;
}
html:root .preview-banner-note { color: #991b1b; font-size: .8125rem; font-weight: 500; }
html:root body.is-previewing { padding-bottom: 5.5rem; }
@media (max-width: 40rem) {
  html:root .preview-banner { left: .75rem; right: .75rem; bottom: .75rem; transform: none; width: auto; max-width: none; justify-content: flex-start; }
  html:root .preview-banner-note { flex-basis: 100%; order: 3; }
  html:root body.is-previewing { padding-bottom: 9rem; }
}
html:root .admin-preview-menu { position: relative; }
html:root .admin-preview-menu > summary { list-style: none; cursor: pointer; }
html:root .admin-preview-menu > summary::-webkit-details-marker { display: none; }
html:root .admin-preview-options {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 40; display: grid; gap: .25rem;
  width: min(20rem, 85vw); padding: .75rem; border: 1px solid var(--line-strong); background: var(--paper);
  box-shadow: var(--shadow-float);
}
html:root .admin-preview-options p { margin: 0 0 .35rem; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
html:root .admin-preview-options .admin-preview-note { margin: .35rem 0 0; }
html:root .admin-preview-options button {
  display: grid; gap: .1rem; padding: .55rem .65rem; border: 1px solid transparent; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
html:root .admin-preview-options button:focus-visible { border-color: var(--brand); background: var(--brand-soft); } @media (hover: hover) { html:root .admin-preview-options button:hover { border-color: var(--brand); background: var(--brand-soft); } }
html:root .admin-preview-options small { color: var(--muted); font-size: .8125rem; }

/* ─── 404: the numerals are the staircase ─────────────────────────────
   Each digit stands one step higher than the one before, on a tread drawn
   under it: navy, then a dashed gap, then lime, the way the logo climbs. The
   line height equals the font's ascent minus its descent (Archivo: .878 and
   .210), which puts the baseline on the tread so the digits stand on it. The
   middle digit is only an outline: the step that is not there. Everything is
   text and borders sized in em, so it scales as one piece at any width. */
html:root body[data-page="notfound"] .notfound { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--line); background: var(--mist); overflow: hidden; }
html:root body[data-page="notfound"] .notfound-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
html:root body[data-page="notfound"] .notfound-code {
  --rise: .17em; --tread: .05em; --digit: var(--brand);
  margin: 0; padding-top: calc(var(--rise) * 2); color: var(--digit);
  font-size: clamp(8.5rem, 24vw, 21rem); font-weight: 800; font-stretch: 80%; line-height: .668;
  font-variant-numeric: lining-nums; letter-spacing: 0; white-space: nowrap; user-select: none;
}
html:root body[data-page="notfound"] .notfound-digits { display: inline-flex; align-items: flex-end; }
html:root body[data-page="notfound"] .notfound-digit {
  position: relative; display: block; padding: 0 .045em .035em; border-bottom: var(--tread) solid var(--digit);
  transform: translateY(calc(var(--rise) * var(--step, 0) * -1));
}
html:root body[data-page="notfound"] .notfound-digit-missing {
  --step: 1; border-bottom-style: dashed; border-bottom-color: var(--line-strong);
  color: var(--mist); -webkit-text-stroke: .04em var(--line-strong); paint-order: stroke fill;
}
html:root body[data-page="notfound"] .notfound-digit-top { --step: 2; border-bottom-color: var(--lime); }
/* The riser that joins a tread to the one below it. */
html:root body[data-page="notfound"] .notfound-digit + .notfound-digit::before {
  content: ""; position: absolute; left: 0; top: 100%; width: 0; height: var(--rise);
  border-left: var(--tread) solid var(--digit);
}
/* On the dark page the steps are white with a lime top, as in the logo there. */
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body[data-page="notfound"] .notfound-code { --digit: var(--ink); } }
html:root[data-theme="dark"] body[data-page="notfound"] .notfound-code { --digit: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  /* One moment on arrival: the digits start level and climb into place. */
  html:root body[data-page="notfound"] .notfound-digit { animation: notfound-climb .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--step, 0) * 110ms + 80ms); }
  html:root body[data-page="notfound"] .notfound-digit::before { animation: notfound-riser .3s ease-out both; animation-delay: calc(var(--step, 0) * 110ms + 420ms); }
}
@keyframes notfound-climb { from { transform: translateY(0); } }
@keyframes notfound-riser { from { height: 0; } }

html:root body[data-page="notfound"] .notfound h1 { margin: 0 0 .85rem; font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.1; letter-spacing: -.02em; }
html:root body[data-page="notfound"] .notfound-lead { max-width: 34rem; margin: 0 0 1.5rem; color: var(--ink-soft, var(--muted)); font-size: 1.0625rem; line-height: 1.6; }
html:root body[data-page="notfound"] .notfound-lead code { padding: .05rem .35rem; border-radius: var(--r-xs); background: var(--paper); color: var(--ink); font-size: .95em; overflow-wrap: anywhere; }
html:root body[data-page="notfound"] .notfound-suggestion { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; max-width: 32rem; margin: 0 0 1.5rem; padding: .9rem 1.1rem; border-left: 4px solid var(--positive); border-radius: 0 var(--r-card) var(--r-card) 0; background: var(--paper); }
html:root body[data-page="notfound"] .notfound-suggestion p { margin: 0; color: var(--ink); }
html:root body[data-page="notfound"] .notfound-suggestion a { color: var(--brand); font-size: 1.125rem; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
html:root body[data-page="notfound"] .notfound-suggestion a::after { content: " ›"; }
html:root body[data-page="notfound"] .notfound-search { max-width: 32rem; margin: 0 0 1.5rem; }
html:root body[data-page="notfound"] .notfound-search label { display: block; margin-bottom: .4rem; font-size: .9375rem; font-weight: 650; }
html:root body[data-page="notfound"] .notfound-search-row { display: flex; gap: .5rem; }
html:root body[data-page="notfound"] .notfound-search-row input { flex: 1; min-width: 0; min-height: 2.9rem; padding: .55rem .8rem; background: var(--paper); font: inherit; }
html:root body[data-page="notfound"] .notfound-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 0; }
html:root body[data-page="notfound"] .notfound-contact { color: var(--muted); font-size: .9375rem; }
html:root body[data-page="notfound"] .notfound-contact a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
html:root body[data-page="notfound"] .notfound-pages { padding-block: clamp(2.5rem, 5vw, 4rem); }
html:root body[data-page="notfound"] .notfound-pages h2 { margin: 0 0 1.25rem; font-size: 1.25rem; }
html:root body[data-page="notfound"] .notfound-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--brand); }
html:root body[data-page="notfound"] .notfound-links a { display: grid; gap: .3rem; height: 100%; padding: 1.1rem 1rem 1.25rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
html:root body[data-page="notfound"] .notfound-links li + li a { padding-left: 1rem; }
html:root body[data-page="notfound"] .notfound-links li:nth-child(4n + 1) a { padding-left: 0; }
html:root body[data-page="notfound"] .notfound-links strong { color: var(--brand); font-size: 1.0625rem; }
html:root body[data-page="notfound"] .notfound-links a > span { color: var(--muted); font-size: .9rem; line-height: 1.45; }
@media (hover: hover) { html:root body[data-page="notfound"] .notfound-links a:hover strong { text-decoration: underline; text-underline-offset: .2em; } }
@media (max-width: 60rem) {
  /* Stacked: the numerals span the page width above the words. */
  html:root body[data-page="notfound"] .notfound-layout { grid-template-columns: 1fr; gap: clamp(1.5rem, 5vw, 2.5rem); }
  html:root body[data-page="notfound"] .notfound-code { font-size: clamp(6.5rem, 46vw, 19rem); }
  html:root body[data-page="notfound"] .notfound-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:root body[data-page="notfound"] .notfound-links li:nth-child(4n + 1) a { padding-left: 1rem; }
  html:root body[data-page="notfound"] .notfound-links li:nth-child(2n + 1) a { padding-left: 0; }
}
@media (max-width: 30rem) {
  html:root body[data-page="notfound"] .notfound-search-row { flex-wrap: wrap; }
  html:root body[data-page="notfound"] .notfound-links { grid-template-columns: 1fr; }
  html:root body[data-page="notfound"] .notfound-links li a { padding-left: 0 !important; }
}

/* ─── Dark appearance: deep navy, lime actions ───────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef3fb; --ink-soft: #c9d3e3; --muted: #9aa8bf;
    --canvas: #08142b; --paper: #0e1c37; --mist: #12223f; --paper-warm: #12223f;
    --line: #243658; --line-strong: #3d527a;
    --brand: #a8d65a; --brand-strong: #c4e68a; --brand-soft: #1a2c4d;
    --accent: #a8d65a; --accent-strong: #c4e68a; --accent-soft: #1c3320;
    --tint: #2d4a1f; --surface-soft: #12223f; --linen: #12223f;
    --footer-bg: #050e20; --footer-ink: #eef3fb; --footer-muted: #9aa8bf;
    --focus: #a8d65a; --on-brand: #061a3d;
    --positive: #a8d5ad; --positive-soft: #1c3320;
    --warning: #e3c17b; --warning-soft: #3a3020;
    --danger: #f3aaa1; --danger-soft: #45242a;
    --primary: #a8d65a; --primary-light: #c4e68a;
  --gold: #a8d65a; --gold-dark: #c4e68a; --gold-bg: #1c3320; --primary-dark: #c4e68a; --primary-bg: #1a2c4d;
    --shadow-float: 0 18px 40px -18px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .nav-logo-icon { color: #eef3fb; }
}
:root[data-theme="dark"] {
  --ink: #eef3fb; --ink-soft: #c9d3e3; --muted: #9aa8bf;
  --canvas: #08142b; --paper: #0e1c37; --mist: #12223f; --paper-warm: #12223f;
  --line: #243658; --line-strong: #3d527a;
  --brand: #a8d65a; --brand-strong: #c4e68a; --brand-soft: #1a2c4d;
  --accent: #a8d65a; --accent-strong: #c4e68a; --accent-soft: #1c3320;
  --tint: #2d4a1f; --surface-soft: #12223f; --linen: #12223f;
  --footer-bg: #050e20; --footer-ink: #eef3fb; --footer-muted: #9aa8bf;
  --focus: #a8d65a; --on-brand: #061a3d;
  --positive: #a8d5ad; --positive-soft: #1c3320;
  --warning: #e3c17b; --warning-soft: #3a3020;
  --danger: #f3aaa1; --danger-soft: #45242a;
  --primary: #a8d65a; --primary-light: #c4e68a;
  --gold: #a8d65a; --gold-dark: #c4e68a; --gold-bg: #1c3320; --primary-dark: #c4e68a; --primary-bg: #1a2c4d;
  --shadow-float: 0 18px 40px -18px rgb(0 0 0 / 60%);
  color-scheme: dark;
}
:root[data-theme="dark"] .nav-logo-icon { color: #eef3fb; }
:is(:root[data-theme="dark"]) .page-hero .page-hero-inner { border-top-color: var(--lime); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-hero .page-hero-inner { border-top-color: var(--lime); }
  :root:not([data-theme="light"]) .divider { background: var(--lime); }
}
:root[data-theme="dark"] .divider { background: var(--lime); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ─── Color pass for inner pages ─────────────────────────────────────── */
/* Page headers sit on a mist band with the staircase from the homepage, and
   their top rule carries the three logo colors. */
:root { --stripe-a: var(--navy); --stripe-b: var(--green); --pop: var(--lime); --hero-stairs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -14 262 164' fill='none' stroke-width='10'%3E%3Cpath stroke='%230b2a5b' d='M5 150V110H65'/%3E%3Cpath stroke='%233a7a21' d='M65 150V75H125'/%3E%3Cpath stroke='%238cc63f' d='M125 150V40H185'/%3E%3Cpath stroke='%230b2a5b' d='M185 150V5H242'/%3E%3Cpath fill='%230b2a5b' stroke='none' d='M242 -8L258 5L242 18Z'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --stripe-a: #7d9bd6; --stripe-b: #5fa33a; --pop: #eef3fb; --hero-stairs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -14 262 164' fill='none' stroke-width='10'%3E%3Cpath stroke='%237d9bd6' d='M5 150V110H65'/%3E%3Cpath stroke='%235fa33a' d='M65 150V75H125'/%3E%3Cpath stroke='%23a8d65a' d='M125 150V40H185'/%3E%3Cpath stroke='%237d9bd6' d='M185 150V5H242'/%3E%3Cpath fill='%237d9bd6' stroke='none' d='M242 -8L258 5L242 18Z'/%3E%3C/svg%3E"); }
}
:root[data-theme="dark"] { --stripe-a: #7d9bd6; --stripe-b: #5fa33a; --pop: #eef3fb; --hero-stairs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -14 262 164' fill='none' stroke-width='10'%3E%3Cpath stroke='%237d9bd6' d='M5 150V110H65'/%3E%3Cpath stroke='%235fa33a' d='M65 150V75H125'/%3E%3Cpath stroke='%23a8d65a' d='M125 150V40H185'/%3E%3Cpath stroke='%237d9bd6' d='M185 150V5H242'/%3E%3Cpath fill='%237d9bd6' stroke='none' d='M242 -8L258 5L242 18Z'/%3E%3C/svg%3E"); }
html:root body:not([data-page="home"]) .page-hero { background-color: var(--mist); border-bottom: 0; }
html:root .page-hero .page-hero-inner {
  border-image: linear-gradient(90deg, var(--stripe-a) 0 64%, var(--stripe-b) 64% 86%, var(--lime) 86% 100%) 1;
}
@media (min-width: 64rem) {
  html:root body:not([data-page="admin"]):not([data-page="account"]) .page-hero {
    background-image: var(--hero-stairs);
    background-repeat: no-repeat;
    background-position: right max(var(--gutter), calc((100% - var(--shell)) / 2)) bottom;
    background-size: clamp(11rem, 20vw, 16rem) auto;
  }
}
/* Main buttons lift off the page on hover, with a solid offset shadow. */
html:root .btn-primary:not(.btn-sm):not(.btn-xs) { transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .12s ease; }
@media (hover: hover) { html:root .btn-primary:not(.btn-sm):not(.btn-xs):hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--pop); } }
html:root .btn-primary:not(.btn-sm):not(.btn-xs):active:not(:disabled) { transform: none; box-shadow: none; }
html:root .cta-banner { --pop: #fff; }
/* Account > Preferences: each choice is a pair of large, labelled options. */
html:root body[data-page="account"] .pref-section { display: grid; gap: .6rem; }
html:root body[data-page="account"] .pref-heading { margin: 0; font-size: 1.0625rem; }
html:root body[data-page="account"] .pref-note { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
html:root body[data-page="account"] .pref-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: .4rem; }
html:root body[data-page="account"] .pref-option {
  display: grid; gap: .25rem; align-content: start; padding: .9rem 1rem; border: 2px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
html:root body[data-page="account"] .pref-option small { color: var(--muted); font-size: .85rem; line-height: 1.4; }
@media (hover: hover) { html:root body[data-page="account"] .pref-option:hover { border-color: var(--brand); } }
html:root body[data-page="account"] .pref-option[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 6px 0 0 var(--brand); padding-left: 1.4rem; }
html:root body[data-page="account"] .pref-option:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 36rem) { html:root body[data-page="account"] .pref-options { grid-template-columns: 1fr; } }

/* ═══ Polish pass: one content edge, form controls, spacing ═══════════ */

/* Page containers line up with the nav and the footer at every width. */
.container { width: 100%; max-width: calc(var(--shell) + var(--gutter) * 2); }
html:root body[data-page="forum"] .forum-wrap { max-width: none; }
html:root .thread-wrap { margin-inline: 0; }
html:root body[data-page="updates"] .updates-wrap,
html:root body[data-page="account"] .account-wrap { max-width: none; }

/* Condensed page titles were tracked so tightly that words ran together. */
html:root body[data-page]:not([data-page="home"]) main h1 { letter-spacing: -.012em; word-spacing: .02em; }
html:root body.zh[data-page]:not([data-page="home"]) main h1 { letter-spacing: 0; word-spacing: 0; }

/* Every text field gets room around its text unless a component sets its own. */
:where(main) :where(input:not([type="checkbox"], [type="radio"], [type="color"], [type="range"], [type="file"], [type="hidden"], [type="submit"], [type="button"], [type="image"]), select, textarea) { padding: .55rem .8rem; }
:where(main) :where(input, select, textarea)::placeholder { text-overflow: ellipsis; }

/* A search field with an icon is one box: the wrapper draws the border and
   the input inside it stays bare. */
html:root body main :is(.subjects-search, .guide-search-field) {
  display: flex; align-items: center; gap: .6rem;
  min-height: 3rem; padding: 0 .9rem;
  border: 1px solid var(--line-strong); border-radius: 0;
  background: var(--paper); color: var(--muted);
}
@media (hover: hover) { html:root body main :is(.subjects-search, .guide-search-field):hover { border-color: var(--ink-soft); } }
html:root body main :is(.subjects-search, .guide-search-field):focus-within { border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--lime); }
html:root body main :is(.subjects-search, .guide-search-field) > :is(svg, span) { flex: none; }
html:root body[data-page] main :is(.subjects-search, .guide-search-field) input,
html:root body[data-page] main :is(.subjects-search, .guide-search-field) input:focus {
  flex: 1; min-width: 0; min-height: 2.75rem; padding: 0;
  border: 0; outline: 0; background: transparent; box-shadow: none; color: var(--ink); font-size: 1rem;
}
@media (hover: hover) {
html:root body[data-page] main :is(.subjects-search, .guide-search-field) input:hover {
  flex: 1; min-width: 0; min-height: 2.75rem; padding: 0;
  border: 0; outline: 0; background: transparent; box-shadow: none; color: var(--ink); font-size: 1rem;
}
}
html:root body[data-page="practice"] .subjects-controls { align-items: stretch; }

/* Footer appearance menu: same size on every page, text off the edge. */
html:root body[data-page] .theme-control select:not([multiple]) { min-height: 2.25rem; padding: .35rem 1.75rem .35rem .7rem; border: 1px solid rgb(255 255 255 / 35%); background-color: transparent; color: var(--footer-ink); font-size: .8rem; line-height: 1.3; }

/* Resources: the finder is an open form instead of a box around a box. */

html:root body[data-page="resources"] .resource-card .btn { align-self: flex-start; margin-inline: 0; }

/* Volunteer and ask pages: headings clear the rule above and the text below,
   and step numbers stay inside the column. */
html:root body:is([data-page="volunteer"], [data-page="join"]) .volunteer-overview > h3 { margin-bottom: .6rem; }
html:root body:is([data-page="volunteer"], [data-page="join"]) .volunteer-next { margin-top: 2.25rem; }
html:root body:is([data-page="volunteer"], [data-page="join"]) .volunteer-next > h3 { margin-bottom: 1rem; }
html:root body[data-page] main ol.support-list { list-style: none; counter-reset: support-step; padding-left: 0; }
html:root body[data-page] main ol.support-list > li { position: relative; padding-left: 1.75rem; counter-increment: support-step; }
html:root body[data-page] main ol.support-list > li::before { content: counter(support-step); position: absolute; left: 0; color: var(--brand); font-weight: 750; font-variant-numeric: tabular-nums; }

/* About: the timeline starts at the same edge as its heading, cards are as
   tall as their text, and the opening quote uses the site typeface. */
html:root body[data-page="about"] div:has(> .timeline) { max-width: 46rem !important; margin-inline: 0 !important; }
html:root body[data-page="about"] .value-card { min-height: 0; }
html:root body[data-page="about"] .about-image blockquote { font-family: var(--font-sans); font-weight: 760; font-stretch: 82%; letter-spacing: -.01em; }

:where(main) :where(input) { text-overflow: ellipsis; }

/* Question lists open with the same plus mark as the homepage. */
html:root .faq-question .arrow { position: relative; flex: none; width: 1rem; height: 1rem; margin-left: 1rem; font-size: 0; color: var(--ink); transform: none; }
html:root .faq-question .arrow::before,
html:root .faq-question .arrow::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px; background: currentColor; transition: transform .2s ease; }
html:root .faq-question .arrow::after { transform: rotate(90deg); }
html:root .faq-item.open .faq-question .arrow { transform: none; }
html:root .faq-item.open .faq-question .arrow::after { transform: none; }
html:root .readings-toolbar :is(input, select) { height: 2.875rem; min-height: 2.875rem; }

/* Guides read from the same left edge as their title. */
html:root body[data-page] main .guide-article { margin-inline: 0; }
html:root body[data-page] main > .section > .container[style*="max-width"] { margin-left: max(0px, calc((100% - var(--shell) - var(--gutter) * 2) / 2)); margin-right: auto; }

/* Events on a phone: one list of days, not a card inside a card inside a card. */
html:root body[data-page="updates"] .mobile-agenda { padding: 0; border: 0; background: transparent; }
html:root body[data-page="updates"] .mobile-agenda > h2 { margin-bottom: .9rem; }
html:root body[data-page="updates"] .mobile-agenda-day-events { padding: 0; }
html:root body[data-page="updates"] .mobile-agenda-day-events .schedule-item { padding: .8rem .75rem; border: 0; border-top: 1px solid var(--line); }
html:root body[data-page="updates"] .mobile-agenda-day-events .schedule-item:first-child { border-top: 0; }

/* Question bank: the wrong-answer reminder is its own bar, not a card in a card. */
html:root body[data-page="practice"] #wrong-banner-card { padding: 0; border: 0; background: transparent; box-shadow: none; }

/* Admin on a phone: the section menu is a labelled field, not a boxed field. */
html:root body[data-page="admin"] .admin-section-jump { padding: 0; border: 0; background: transparent; }

/* ═══ Theme-safe colours ═══════════════════════════════════════════════
   A few notes, tables and status labels were coloured for a white page
   only. They now use the theme tokens, so the dark appearance stays
   readable. */
html:root body[data-page] main :is(.guide-note, .subject-access-note),
html:root body[data-page] main :is(.guide-note, .subject-access-note) :is(p, span, li, a) { color: var(--ink-soft); }
html:root body[data-page] main :is(.guide-note, .subject-access-note) strong { color: var(--ink); }
html:root body[data-page] main .guide-table-wrap :is(table, thead, tbody, tr, td) { background-color: transparent; }
html:root body[data-page] main .guide-table-wrap th { background: var(--mist); color: var(--ink); }
html:root body[data-page="volunteer-hours"] main .guide-table-wrap th:first-child { background: var(--positive-soft); color: var(--positive); }
html:root body[data-page="volunteer-hours"] main .guide-table-wrap th:last-child { background: var(--danger-soft); color: var(--danger); }
html:root body[data-page] main .guide-link { background: var(--paper); }
html:root body[data-page] main .badge-gold { background: var(--paper); }
html:root body[data-page] main .danger-zone > summary,
html:root body[data-page] main .danger-zone > summary span { color: var(--danger); }
html:root body[data-page] main .hours-status-chip { color: var(--ink); }
html:root body[data-page] .counter-item.correct span { color: var(--positive); }
html:root body[data-page] .counter-item.wrong span { color: var(--danger); }
html:root body[data-page] .wb-badge { background: #b42318; color: #fff; }

/* Closed answers are hidden from the keyboard and screen readers too, not
   just squeezed to zero height. */
html:root .faq-answer { visibility: hidden; transition: max-height .35s ease, visibility 0s linear .35s; }
html:root .faq-item.open .faq-answer { visibility: visible; transition: max-height .35s ease, visibility 0s; }

/* Account sections on a phone: every tab is visible instead of scrolling off the edge. */
@media (max-width: 48rem) {
  html:root body[data-page="account"] .account-menu { flex-wrap: wrap; overflow-x: visible; }
  html:root body[data-page="account"] .account-menu .account-menu-tab { flex: 1 1 auto; justify-content: center; text-align: center; }
}

/* ═══ Guide reader ═════════════════════════════════════════════════════
   The public page for a guide from the guide library (/guides/<slug>). It
   reads from the same left edge as every other page: title band, then the
   text with the section list beside it. */
html:root body[data-page="guide"] .guide-reader-hero { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4vw, 3rem); border-bottom: 0; background: var(--mist); }
html:root body[data-page="guide"] .guide-reader-inner { max-width: 52rem; margin-inline: 0; }
html:root body[data-page="guide"] .guide-reader-hero h1 { margin-block: .9rem .8rem; font-size: clamp(2.2rem, 4.4vw, 3.5rem); line-height: 1.05; }
html:root body.zh[data-page="guide"] .guide-reader-hero h1 { line-height: 1.25; }
html:root body[data-page="guide"] .guide-reader-summary { max-width: 44rem; margin: 0; color: var(--ink-soft); font-size: 1.125rem; line-height: 1.6; }
html:root body[data-page="guide"] .guide-reader-meta { margin-top: 1.25rem; color: var(--muted); font-size: .9rem; }
html:root body[data-page="guide"] .guide-reader-body { padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); }
html:root body[data-page="guide"] .guide-reader-layout { align-items: start; gap: clamp(1.5rem, 4vw, 3.5rem); }
html:root body[data-page="guide"] .guide-reader-article { max-width: 46rem; }
html:root body[data-page="guide"] .guide-reader-section:first-child h2 { margin-top: 0; }
html:root body[data-page="guide"] .guide-reader-section-content { color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.75; overflow-wrap: anywhere; }
html:root body.zh[data-page="guide"] .guide-reader-section-content { line-height: 1.9; }
html:root body[data-page="guide"] :is(.guide-reader-toc, .guide-reader-cta) h2 { margin: 0 0 .75rem; padding: 0; border: 0; font-size: 1.05rem; line-height: 1.3; }
html:root body[data-page="guide"] .guide-reader-toc { padding: 1.1rem 1.1rem 1.2rem; }
html:root body[data-page="guide"] .guide-reader-toc a { line-height: 1.4; }
html:root body[data-page="guide"] .guide-reader-cta { max-width: 46rem; margin-top: clamp(2rem, 4vw, 3rem); padding: 1.5rem 1.75rem; border: 0; background: var(--mist); text-align: left; }
html:root body[data-page="guide"] .guide-reader-cta p { margin: 0 0 1rem; color: var(--ink-soft); }
@media (max-width: 60rem) {
  /* On a phone the section list comes first, as a short index. */
  html:root body[data-page="guide"] .guide-reader-toc { position: static; }
}

html:root body[data-page="guide"] .guide-reader-section { padding-bottom: 1.75rem; border-bottom: 0; }

/* ═══ Help and volunteer forms: visitors ═══════════════════════════════
   A visitor fills in the same form as a member. A short note says what will
   happen, and the code field appears only after the code has been emailed.
   Both carry the lime bar instead of a box, so no field sits inside a frame. */
html:root body .submission-form .form-guest-note { margin: 0 0 1.5rem; padding: .1rem 0 .1rem .9rem; border-left: 3px solid var(--lime); color: var(--ink-soft); font-size: .9rem; line-height: 1.6; }
html:root body .submission-form .form-guest-note a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: .15em; }
html:root body .submission-form .email-code-step { margin-bottom: 1.25rem; padding: .1rem 0 .1rem .9rem; border-left: 3px solid var(--lime); }
html:root body .submission-form .email-code-step input { max-width: 11rem; font-size: 1.125rem; font-variant-numeric: tabular-nums; letter-spacing: .2em; }
html:root body .submission-form .email-code-step input::placeholder { font-size: .9rem; letter-spacing: 0; }
html:root body .submission-form .email-code-step .hint { display: block; margin-top: .4rem; }
html:root body .submission-form .email-code-step .hint strong { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
html:root body .submission-form .email-code-resend { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: .15rem; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: .875rem; font-weight: 700; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
@media (hover: hover) { html:root body .submission-form .email-code-resend:hover { color: var(--positive); } }

/* ═══ Question bank and SAT: the free sample for visitors ══════════════
   A visitor sees one button and one sentence about what an account adds,
   in place of set-up choices they cannot use yet. */
/* A visitor can read what each unit covers; setting up a round is for members. */
html:root body [data-detail-section="start"].is-visitor #practice-settings { display: none; }
html:root body .practice-sample-note { margin-top: .9rem; color: var(--ink-soft); font-size: .875rem; line-height: 1.6; }
html:root body .practice-sample-note p { margin: 0; }
html:root body .practice-sample-note a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: .15em; white-space: nowrap; }
html:root body #completion-actions a.prac-btn { text-decoration: none; }
html:root body[data-page="sat"] .sat-runbar__sample { margin: 0; color: var(--muted); font-size: .8125rem; }
html:root body[data-page="sat"] .sat-summary__next { max-width: 44rem; margin: 1.25rem 0 0; padding-left: .9rem; border-left: 3px solid var(--lime); color: var(--ink-soft); line-height: 1.6; }
html:root body[data-page="sat"] .sat-summary .sat-actions a.btn { text-decoration: none; }

/* ═══ Notes: body text, school marks and comments ══════════════════════ */
/* Note bodies arrive as paragraphs and lists, so the wrapper no longer needs
   to keep the writer's line breaks itself. */
html:root body[data-page="guide"] .guide-reader-section-content { white-space: normal; }
html:root body[data-page="guide"] .guide-reader-section-content p { margin: 0 0 1em; }
html:root body[data-page="guide"] .guide-reader-section-content ul { margin: 0 0 1.1em; padding-left: 1.25em; list-style: disc outside; }
html:root body[data-page="guide"] .guide-reader-section-content li { display: list-item; }
html:root body[data-page="guide"] .guide-reader-section-content li { margin: 0 0 .5em; padding-left: .15em; }
html:root body[data-page="guide"] .guide-reader-section-content li::marker { color: var(--positive); }
html:root body[data-page="guide"] .guide-reader-section-content > :last-child { margin-bottom: 0; }
html:root body[data-page="guide"] .guide-reader-section-content a { color: var(--ink); text-decoration: underline; text-underline-offset: .15em; overflow-wrap: anywhere; }
html:root body .guide-card-badge.school { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); }
html:root body .guide-card-badge.school { display: inline-flex; align-items: center; gap: .4em; }

html:root body .guide-comments { max-width: 46rem; margin: clamp(2rem, 4vw, 2.75rem) 0 0; }
html:root body .guide-comments-head h2 { margin: 0 0 .4rem; font-size: 1.5rem; }
html:root body .guide-comments-count { color: var(--muted); font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
html:root body .guide-comments-head p { margin: 0 0 1.25rem; color: var(--muted); font-size: .9375rem; line-height: 1.6; }
html:root body .guide-comment-form textarea { display: block; width: 100%; min-height: 5.5rem; padding: .7rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink); font: inherit; line-height: 1.6; resize: vertical; }
html:root body .guide-comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; }
html:root body .guide-comment-length { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
html:root body .guide-comment-signin { margin: 0; }
html:root body .guide-comment-signin a { text-decoration: none; }
html:root body .guide-comments-status { min-height: 1.4em; margin: .6rem 0 0; color: var(--muted); font-size: .875rem; }
html:root body .guide-comments-status[data-tone="error"] { color: var(--danger); }
html:root body .guide-comments-status[data-tone="success"] { color: var(--positive); }

html:root body .guide-comment-list { margin: 1rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
html:root body .guide-comment { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
html:root body .guide-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
html:root body .guide-comment-author { color: var(--ink); font-size: .9375rem; }
html:root body .guide-comment-team, html:root body .guide-comment-mine { padding: .05rem .45rem; border-radius: var(--r-xs); background: var(--positive-soft); color: var(--positive); font-size: .75rem; font-weight: 700; }
html:root body .guide-comment-mine { background: var(--mist); color: var(--ink-soft); }
html:root body .guide-comment-date { margin-left: auto; color: var(--muted); font-size: .8125rem; }
html:root body .guide-comment-body { margin: .45rem 0 0; color: var(--ink-soft); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
html:root body .guide-comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; margin-top: .35rem; }
html:root body .guide-comment-ask { color: var(--ink); font-size: .8125rem; }
html:root body .guide-comment-remove { min-height: 2.25rem; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: .8125rem; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
html:root body .guide-comment-remove.is-confirm { color: var(--danger); } @media (hover: hover) { html:root body .guide-comment-remove:hover { color: var(--danger); } }

/* No comments yet: three speech bubbles climb the steps of the logo. The first
   is drawn dashed in lime with a waiting cursor, because it is the reader's;
   the two behind it are the replies that would follow. */
html:root body .guide-comments-empty { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.25rem, 4vw, 2.5rem); align-items: center; margin-top: 1.25rem; padding: clamp(1.25rem, 3vw, 1.75rem); border-radius: var(--r-card); background: var(--mist); }
html:root body .guide-comments-steps { --rise: 1.15rem; display: inline-flex; align-items: flex-end; padding-top: calc(var(--rise) * 2); font-size: 1rem; }
html:root body .guide-comments-step { position: relative; display: block; padding: 0 .3rem .7rem; border-bottom: 4px solid var(--line-strong); transform: translateY(calc(var(--rise) * var(--step, 0) * -1)); }
html:root body .guide-comments-step:nth-child(2) { --step: 1; }
html:root body .guide-comments-step:nth-child(3) { --step: 2; }
html:root body .guide-comments-step + .guide-comments-step::before { content: ""; position: absolute; left: 0; top: 100%; height: var(--rise); border-left: 4px solid var(--line-strong); }
html:root body .guide-comments-step.is-yours { border-bottom-color: var(--lime); }
html:root body .guide-comments-bubble { position: relative; display: flex; flex-direction: column; justify-content: center; gap: .35rem; width: 3.6rem; height: 2.6rem; padding: 0 .6rem; border: 2px solid var(--line-strong); border-radius: 8px; background: var(--paper); }
html:root body .guide-comments-bubble::after { content: ""; position: absolute; left: .7rem; bottom: -.42rem; width: .65rem; height: .65rem; border-right: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); background: var(--paper); transform: rotate(45deg); }
html:root body .guide-comments-bubble b { display: block; height: .3rem; border-radius: 2px; background: var(--line); }
html:root body .guide-comments-bubble b + b { width: 60%; }
html:root body .guide-comments-step.is-yours .guide-comments-bubble { border-style: dashed; border-color: var(--positive); }
html:root body .guide-comments-step.is-yours .guide-comments-bubble::after { border-color: var(--positive); }
html:root body .guide-comments-bubble i { display: block; width: 2px; height: 1.1rem; background: var(--positive); }
@media (prefers-reduced-motion: no-preference) {
  html:root body .guide-comments-bubble i { animation: guide-comment-cursor 1.1s steps(1, end) infinite; }
}
@keyframes guide-comment-cursor { 50% { opacity: 0; } }
html:root body .guide-comments-empty-copy h3 { margin: 0 0 .35rem; font-size: 1.1875rem; }
html:root body .guide-comments-empty-copy p { max-width: 30rem; margin: 0 0 .9rem; color: var(--ink-soft); font-size: .9375rem; line-height: 1.6; }
@media (max-width: 34rem) {
  html:root body .guide-comments-empty { grid-template-columns: 1fr; }
  html:root body .guide-comment-date { margin-left: 0; width: 100%; }
}

/* School mark: a small crest in the school's two colours, beside its name. */
html:root body .school-mark { display: inline-block; flex: none; width: .82em; height: .96em; }
html:root body .school-mark::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--school, var(--ink)) 0 50%, var(--school-accent, var(--school, var(--ink))) 50%);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 50% 100%, 0 58%);
}
html:root body .school-mark + .school-mark { margin-left: -.15em; }
/* Navy and black crests need an edge on a dark page. */
@media (prefers-color-scheme: dark) {
  html:root:not([data-theme="light"]) body .school-mark { filter: drop-shadow(0 0 .75px rgba(255, 255, 255, .95)) drop-shadow(0 0 .75px rgba(255, 255, 255, .6)); }
}
html:root[data-theme="dark"] body .school-mark { filter: drop-shadow(0 0 .75px rgba(255, 255, 255, .95)) drop-shadow(0 0 .75px rgba(255, 255, 255, .6)); }

/* Resource library: search, then one row of schools and one row of topics. */
html:root body[data-page="resources"] .learn-hero { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2rem); border-bottom: 0; }
html:root body[data-page="resources"] .learn-hero-summary { margin-top: .9rem; }
html:root body[data-page="resources"] .resource-library { padding-block: 0 clamp(3.5rem, 6vw, 5rem); background: var(--canvas); }
html:root body .finder { display: grid; gap: .7rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
html:root body .finder-search { position: relative; display: block; max-width: 34rem; margin-bottom: .2rem; }
html:root body .finder-search-icon { position: absolute; left: .85rem; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
html:root body .finder-search input {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem .9rem .5rem 2.6rem;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: .9375rem;
}
html:root body .finder-search input::placeholder { color: var(--muted); }
html:root body .finder-row { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); align-items: start; gap: .5rem; }
html:root body .finder-row[hidden] { display: none; }
html:root body .finder-label { color: var(--muted); font-size: .8125rem; font-weight: 600; line-height: 2.125rem; }
html:root body .finder-chips { display: flex; flex-wrap: wrap; gap: .375rem; min-width: 0; }
html:root body .finder-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.125rem;
  padding: .25rem .7rem;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
@media (hover: hover) { html:root body .finder-chip:hover { border-color: var(--ink-soft); color: var(--ink); } }
html:root body .finder-chip.active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
html:root body .finder-chip:disabled { opacity: .45; cursor: default; }
html:root body .finder-chip-count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
html:root body .finder-chip.active .finder-chip-count { color: inherit; opacity: .75; }
/* The chosen school's chip takes that school's colour. */
html:root body .finder-chip-school.active { border-color: var(--school, var(--ink)); background: var(--school, var(--ink)); color: var(--school-on, var(--paper)); }
html:root body .finder-chip-school.active .school-mark { filter: none; }
html:root body .finder-chip-school.active .school-mark::before {
  background: linear-gradient(90deg, var(--school-on, #fff) 0 50%, var(--school-accent) 50%);
}
html:root body .finder-results { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.75rem; margin: .4rem 0 .6rem; }
html:root body .finder-results p { margin: 0; color: var(--muted); font-size: .875rem; }
html:root body .finder-clear {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}
html:root body .finder-clear.hidden { display: none; }
@media (max-width: 40rem) {
  /* On a phone each row is one line that scrolls sideways. */
  html:root body .finder-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -1rem; padding-right: 1rem; scrollbar-width: none; }
  html:root body .finder-chips::-webkit-scrollbar { display: none; }
  html:root body .finder-chip { flex: none; min-height: 2.5rem; }
  html:root body .finder-label { line-height: 2.5rem; }
}

/* ---------- Dictionary languages (js/i18n.js) ---------- */
/* A page shared by every language waits for its dictionary instead of
   showing English first; js/i18n.js lifts this within 2.5 seconds. */
html.i18n-wait body { visibility: hidden; }
/* Korean breaks lines between words, not inside them. */
html:lang(ko) body {
  font-family: 'Plus Jakarta Sans', 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
}

/* A post shown in the reader's language instead of the one it was written in. */
.auto-translated {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 10px 0 0;
  font-size: .8125rem;
  color: var(--muted, #5b6472);
}
.auto-translated[hidden] { display: none; }
.auto-translated-toggle {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--blue, #1d4ed8);
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (hover: hover) { .auto-translated-toggle:hover { text-decoration-thickness: 2px; } }
.auto-translated-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }

/* Key words of a question, in the reader's language (js/question-glossary.js). */
.key-words { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border, #d9dee7); }
.key-words h5 { margin: 0 0 8px; font-size: .8125rem; font-weight: 700; color: var(--muted, #5b6472); }
.key-words dl { display: grid; gap: 6px; margin: 0; }
.key-words dl > div { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.key-words dt { font-weight: 700; color: var(--dark, #0f172a); }
.key-words dd { margin: 0; color: var(--text, #334155); }

/* The gloss beside an English word is in the reader's own language; the
   English site shows the English definition only (js/word.js, js/reading.js). */
html[lang="en"] [data-gloss] { display: none; }

/* ─── Study streak ───────────────────────────────────────────────────── */
:root { --streak-flame: #e8891c; }
/* Days in a row. The flame is lit once something was studied today. */
html:root body .streak-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem .35rem .5rem; background: var(--mist); color: var(--muted); font-size: .9375rem; line-height: 1.2; white-space: nowrap; }
html:root body .streak-badge[hidden] { display: none; }
html:root body .streak-badge svg { width: 1.15rem; height: 1.15rem; flex: none; }
html:root body .streak-badge svg path { fill: currentColor; }
html:root body .streak-badge strong { color: var(--ink); font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
html:root body .streak-badge.is-lit { background: var(--accent-soft); color: var(--ink-soft); }
html:root body .streak-badge.is-lit svg { color: var(--streak-flame); }
html:root:root:root:root body .streak-badge { border-radius: var(--r-xs) !important; }

html:root .nav-streak { display: inline-flex; align-items: center; gap: .25rem; padding: .3rem .55rem .3rem .4rem; background: var(--mist); color: var(--muted); font-size: .92rem; line-height: 1; text-decoration: none; font-variant-numeric: tabular-nums; }
html:root .nav-streak[hidden] { display: none; }
html:root .nav-streak svg { width: 1.05rem; height: 1.05rem; }
html:root .nav-streak svg path { fill: currentColor; }
html:root .nav-streak strong { color: var(--ink); }
html:root .nav-streak.is-lit { background: var(--accent-soft); }
html:root .nav-streak.is-lit svg { color: var(--streak-flame); }
html:root:root:root:root body .nav-streak { border-radius: var(--r-xs) !important; }
@media (max-width: 68rem) { html:root .nav-streak { display: none; } }
