/* ==========================================================================
   CardiSim's own pages: the landing (pages/landing.html), the tour
   (pages/tour.html), a learner's home (pages/home.html), and the account
   pages (pages/auth.html: sign in, create an account, forgot and reset a
   password; pages/account.html), the policies (pages/legal.html) and the
   admin page (pages/admin.html).

   The same instrument as MediSim, a different front panel. MediSim leads
   with a call; CardiSim leads with the strip: a 6-second recorder on the
   landing, a board of rhythm meters on the home. Everything inside the
   study modes (the monitor, the quiz, the Field Guide, the trainers, the
   Heart Lab) is MediSim's own and styled by its own sheets.

   Theme-neutral: this sheet passes through every site theme unchanged
   (src/web/theme-render.ts), so it is drawn from the tokens all three
   themes define, with a fallback wherever a token is faceplate-only. The
   voices differ where the themes differ (the original's uppercase mark,
   the run sheet's ruled rows), selected on data-theme, never by
   forking a rule into a theme's own sheet.

   Nothing here selects into #monitorOverlay: the monitor's computed styles
   stay at their baseline.
   ========================================================================== */

/* CardiSim's pilot lamp (over the mark's ı; drawn as a beating heart by
   mark.css) is red: MediSim's is amber. Red is CardiSim's accent. */
:root[data-product="CardiSim"] { --pilot: var(--led-red); }
body.cardisim { background: var(--chassis); color: var(--ink); }
.csPage {
  --gutter: 32px; --page-gap: 40px;
  width: min(1240px, 100% - 2 * var(--gutter)); margin: 0 auto;
  padding: 28px 0 40px;
  display: flex; flex-direction: column; gap: var(--page-gap);
}
@media (max-width: 720px) { .csPage { --gutter: 16px; --page-gap: 32px; padding-top: 14px; } }

.csMain { display: flex; flex-direction: column; gap: 44px; min-width: 0; }
@media (max-width: 720px) { .csMain { gap: 36px; } }

/* ── Legend voice, shared by every small engraved label here ─────────── */
.csIdx, .csCal, .csTrackCount, .csFamName, .csCellAbbr, .csCellPct, .csTally,
.csReadouts dt, .csPricePer, .csContinueKicker, .csPaperCap,
.csLabel, .csPwShow, .csOr, .csSentKicker, .csFacts dt, .csTag,
.csPlanLineKicker {
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ── Section heads: index, title, an engraved rule, a note at the end ── */
.csSecHead {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; min-width: 0;
}
.csIdx { color: var(--ink-3); }
.csSecTitle {
  margin: 0; white-space: nowrap;
  font: 700 var(--fs-head)/var(--lh-head, 28px) var(--font-ui); letter-spacing: -.01em; color: var(--ink);
}
.csSecRule { flex: 1 1 24px; height: 1px; align-self: center; background: var(--rule-2); min-width: 24px; }
.csCal { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .csSecHead { flex-wrap: wrap; row-gap: 4px; }
  .csSecTitle { font-size: 21px; }
}

/* ==========================================================================
   LANDING
   ========================================================================== */

/* Masthead: the mark, the pitch, the two doors, all seated on one rule. */
.csMast {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand pitch keys";
  align-items: end; gap: 14px 36px;
  padding: 0 0 18px; border-bottom: 2px solid var(--ink);
}
.csMast h1.brand { grid-area: brand; margin: 0; }
.csMast .brand {
  font: 800 clamp(64px, 8.2vw, 116px)/.8 var(--font-ui); letter-spacing: -.04em; color: var(--ink);
}
.csPitch { grid-area: pitch; min-width: 0; padding-bottom: 2px; }
.csLead {
  margin: 0 0 6px; max-width: 20ch; text-wrap: balance;
  font: 700 clamp(22px, 2.1vw, 28px)/1.12 var(--font-ui); letter-spacing: -.015em; color: var(--ink);
}
.csSub { margin: 0; max-width: 40ch; font: 400 var(--fs-body)/1.45 var(--font-ui); color: var(--ink-2); }
.csMastKeys { grid-area: keys; display: flex; gap: 8px; padding-bottom: 4px; }
.csMastKeys .key { min-height: 38px; }

@media (max-width: 1100px) {
  .csMast {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand keys" "pitch pitch";
  }
  .csMastKeys { align-self: start; padding: 4px 0 0; }
  .csLead { max-width: none; }
}
@media (max-width: 720px) {
  .csMast {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "keys" "brand" "pitch";
    gap: 12px; padding-bottom: 14px;
  }
  .csMast .brand { font-size: clamp(52px, 17vw, 76px); }
  .csMastKeys { justify-content: flex-end; padding: 0; }
  .csMastKeys .key { min-height: 34px; padding: 0 12px; font-size: var(--fs-small); }
  .csLead { font-size: 22px; }
}

/* ── 01 The recorder ──────────────────────────────────────────────────── */
.csRecorder { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
/* The recorder's own head: its lamp (amber while printing), the
   calibration it prints at, and this visit's tally. */
.csRecHead { display: flex; align-items: center; gap: 10px; min-height: 20px; }
.csRecHead .csCal { flex: 1 1 auto; min-width: 0; }
.csPaperBox { position: relative; }
/* One 6-second row, 32 mm tall, at every width (landing.js sets the exact
   height; the ratio holds the space until it does). */
.csPaper { display: block; width: 100%; height: auto; aspect-ratio: 150 / 32; }
.csPaperCap {
  position: absolute; left: 10px; bottom: 8px; right: 10px;
  display: flex; align-items: center; gap: 8px; pointer-events: none; line-height: 18px;
}
.csPaperLead {
  padding: 0 5px; border-radius: var(--r-sm);
  background: var(--strip-trace); color: var(--strip-paper);
}
.csPaperName {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 6px; border-radius: var(--r-sm);
  background: color-mix(in oklab, var(--strip-paper) 86%, transparent); color: var(--ink-2);
}
/* Named: the answer prints in ink, sentence case, on an amber flag (the
   same flag the quiz tile's strip raises). */
.csPaperName.is-named {
  background: var(--amber-wash); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--amber-edge);
  font: 600 var(--fs-small)/18px var(--font-ui); letter-spacing: 0; text-transform: none;
  animation: csNamed var(--m-seat, 180ms) var(--e-seat, ease-out);
}
@keyframes csNamed { from { opacity: 0; transform: translateY(-3px); } }

/* Four answers, one row; a phone takes them two by two. */
.csAnswers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-height: 52px; }
.csAnswer.key {
  justify-content: flex-start; gap: 10px; min-height: 52px; padding: 8px 14px;
  white-space: normal; text-align: left; line-height: 1.2;
}
.csAnswer .led:not(.is-green, .is-red) { box-shadow: var(--lens-off); background: transparent; }
.csAnswer.is-answer { --key-bg: var(--green-wash); --key-edge: var(--green-edge); }
.csAnswer.is-miss { --key-bg: var(--red-wash); --key-edge: var(--red-edge); }
/* Graded keys stay readable: only the two that carry the verdict stay full
   strength; the other two step back. */
.csAnswer.key:disabled { opacity: .5; cursor: default; }
.csAnswer.key:is(.is-answer, .is-miss):disabled { opacity: 1; box-shadow: var(--key-shadow); }
.csAnswer.key[aria-pressed="true"]:disabled { box-shadow: var(--key-shadow-press); transform: translateY(2px); }
/* Typed (the answer switch): one box across the row, its names under it. */
.csAnswers.is-typed { grid-template-columns: minmax(0, 1fr); }
.csAnswerMode { flex: none; }
.csRecorder[data-state="tour"] .csAnswerMode { display: none; }
@media (max-width: 720px) {
  .csRecorder { padding: 12px; gap: 12px; }
  /* A phone's strip is too short to print the caption on: it moves to the
     paper's margin, under the grid, the way a recorder prints its notes. */
  .csPaperBox .csPaperCap {
    position: static; padding: 6px 8px 7px;
    background: var(--strip-paper); border: 1px solid var(--strip-major); border-top: 0;
  }
  .csAnswers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .csAnswer.key { min-height: 56px; padding: 8px 10px; font-size: var(--fs-small); }
}

.csTryFoot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px 24px;
  min-height: 58px; padding-top: 12px; border-top: 1px solid var(--rule);
}
.csVerdict { min-width: 0; }
.csVerdict p { margin: 0; }
.csVerdictHint { color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small, 20px); }
.csVerdictHead { font-size: var(--fs-body); }
.csVerdictHead.is-right b { color: var(--green-ink); }
.csVerdictHead.is-wrong b { color: var(--red-ink); }
.csVerdictWhy { margin-top: 3px !important; max-width: 82ch; color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small, 20px); }
.csVerdictMore { margin-top: 8px !important; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink); }
.csTally { display: flex; align-items: center; gap: 8px; color: var(--ink-2); white-space: nowrap; }
.csTally[hidden] { display: none; }
.csTallyLeds { display: flex; gap: 4px; }
/* A round is three strips: three lamps, lit as each is answered. */
.csTallyLeds .led:not(.is-green, .is-red) { box-shadow: var(--lens-off); background: transparent; }
.csTryNext, .csTryMore { min-width: 128px; }
@media (max-width: 720px) {
  .csTryFoot { grid-template-columns: minmax(0, 1fr); }
  .csTryNext, .csTryMore { justify-self: stretch; }
  .csRecHead { flex-wrap: wrap; row-gap: 8px; }
  /* The switch takes its own line under the calibration, the tally beside it. */
  .csRecHead .csCal { flex-basis: calc(100% - 24px); }
  .csRecHead .answerModeLegend { display: none; }
  .csRecHead .csTally { margin-left: auto; }
  .csAnswers.is-typed { grid-template-columns: minmax(0, 1fr); }
}

/* The round's end (landing.js): the strips tear off the top with a ragged
   edge, the answer row folds away, and the pen prints a calibration pulse
   on fresh paper with the key seated inside it. Centred without a
   transform, so the key's own press (translateY) still works. */
.csTear {
  position: absolute; left: 0; top: 0; width: 100%; pointer-events: none;
  transform-origin: 100% 0; animation: csTear 560ms var(--e-leave, ease-in) forwards;
}
/* A pull, then the strip comes away from the left and lifts off. */
@keyframes csTear {
  35% { transform: translateY(-6px) rotate(-.5deg); opacity: 1; }
  to { transform: translateY(-46px) rotate(-2.6deg); opacity: 0; }
}
.csAnswers.is-folding {
  min-height: 0; overflow: hidden; opacity: 0; margin-top: -12px; pointer-events: none;
  transition: height 280ms var(--e-settle, ease-out), margin-top 280ms var(--e-settle, ease-out), opacity 140ms linear;
}
.csRecorder[data-state="tour"] .csPaperCap { display: none; }
.csTryTour {
  position: absolute; top: 0; left: 0; right: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 48px);
  min-height: 56px; padding: 0 26px; font-size: 17px;
}
.csTryTour:not(.is-seated) { visibility: hidden; }
.csTryTour.is-seated { animation: csSeat 300ms var(--e-spring, ease-out) both; }
@keyframes csSeat { from { opacity: 0; translate: 0 -12px; } }
.csVerdictHead.is-fresh { animation: csNamed var(--m-seat, 180ms) var(--e-seat, ease-out); }

/* ── 02 The course map: ruled tracks, a colour tab each ──────────────── */
.csTracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-2); }
.csTrack {
  --tab: var(--rule-2);
  display: grid; align-items: center; gap: 0 28px;
  grid-template-columns: 52px minmax(150px, 190px) minmax(0, 360px) minmax(0, 1fr);
  grid-template-areas: "no head thumb body";
  padding: 20px 0; border-bottom: 1px solid var(--rule);
}
.csTrack[data-tab="blue"] { --tab: var(--blue); }
.csTrack[data-tab="green"] { --tab: var(--green); }
.csTrack[data-tab="red"] { --tab: var(--red); }
.csTrack[data-tab="amber"] { --tab: var(--amber); }
.csTrack[data-tab="ink"] { --tab: var(--ink); }
.csTrackNo {
  grid-area: no; align-self: stretch; padding: 2px 0 0 12px; border-left: 4px solid var(--tab);
  font: 600 var(--fs-small)/1 var(--font-legend, var(--font-mono)); font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.csTrackHead { grid-area: head; min-width: 0; }
.csTrackName { margin: 0; font: 700 var(--fs-title)/var(--lh-title, 24px) var(--font-ui); color: var(--ink); }
.csTrackCount { margin: 6px 0 0; color: var(--ink-2); }
.csTrackCount b {
  display: block; margin-bottom: 2px;
  font: 700 34px/1 var(--font-ui); font-stretch: 125%; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--ink); text-transform: none;
}
.csThumb {
  grid-area: thumb; display: block; width: 100%; height: 86px;
  border-radius: var(--r-sm); box-shadow: 0 0 0 1px var(--strip-major);
}
.csTrackBody { grid-area: body; min-width: 0; }
.csTrackBody p { margin: 0 0 10px; max-width: 58ch; color: var(--ink-2); font-size: var(--fs-body); line-height: 1.45; }
.csChips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.csChips li {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px;
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--cap);
  font-size: var(--fs-small); color: var(--ink-2);
}
@media (max-width: 1100px) {
  .csTrack {
    grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-areas: "no head thumb" "no body body";
    row-gap: 14px;
  }
}
@media (max-width: 720px) {
  .csTrack {
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas: "no head" "no thumb" "no body";
    gap: 12px 12px; padding: 18px 0;
  }
  .csTrackNo { padding-left: 8px; border-left-width: 3px; }
  .csTrackCount { margin: 0; }
  .csTrackHead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .csTrackCount b { display: inline; margin: 0 4px 0 0; font-size: 22px; }
  .csThumb { height: 74px; }
}

/* ── 03 The plan ──────────────────────────────────────────────────────── */
.csPlanFace {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 18px 44px; padding: 26px 28px;
}
.csPrice { margin: 0; display: flex; align-items: flex-start; gap: 2px; color: var(--ink); }
.csPriceCur { font: 700 30px/1 var(--font-ui); margin-top: 6px; }
.csPriceNum { font: 800 96px/.8 var(--font-ui); font-stretch: 125%; letter-spacing: -.05em; }
/* The cents ride high beside the dollars, as on a price tag. */
.csPriceCents { font: 800 38px/1 var(--font-ui); font-stretch: 125%; letter-spacing: -.03em; margin: 2px 0 0 2px; }
.csPricePer { align-self: flex-end; margin: 0 0 4px 8px; color: var(--ink-2); }
.csPriceNote { margin: 12px 0 0; font-size: var(--fs-body); line-height: 1.4; color: var(--ink-2); }
.csPlanList {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px;
}
.csPlanList li { position: relative; padding-left: 18px; font-size: var(--fs-body); line-height: 1.4; color: var(--ink); }
.csPlanList li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%;
  background: var(--led-green); box-shadow: var(--lens);
}
.csPlanKeys { display: flex; flex-direction: column; gap: 8px; }
.csPlanKeys .key { white-space: nowrap; justify-content: center; }
@media (max-width: 1100px) {
  .csPlanFace { grid-template-columns: auto minmax(0, 1fr); }
  .csPlanKeys { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-self: start; }
}
@media (max-width: 720px) {
  .csPlanFace { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; gap: 16px; }
  .csPlanList { grid-template-columns: minmax(0, 1fr); }
  .csPriceNum { font-size: 76px; }
  .csPriceCents { font-size: 30px; }
  .csPlanKeys { flex-direction: column; justify-self: stretch; }
}

/* ── Footer, both pages ──────────────────────────────────────────────── */
.csFoot {
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--rule-2);
}
.csFoot .brand { font: 800 22px/1 var(--font-ui); letter-spacing: -.03em; color: var(--ink); }
.csFootNote { margin: 0; max-width: 72ch; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); }
/* The policies and the contact address, at the footer's far end. */
.csFootLinks { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.csFootLinks a {
  font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px;
}
.csFootLinks a:hover { color: var(--ink); text-decoration-color: currentColor; }
@media (max-width: 720px) { .csFootLinks { margin-left: 0; flex-basis: 100%; } }

/* ==========================================================================
   HOME
   ========================================================================== */

.csBar {
  display: flex; align-items: baseline; gap: 16px;
  padding: 0 0 12px; border-bottom: 2px solid var(--ink);
}
.csBar .brand { font: 800 36px/.85 var(--font-ui); letter-spacing: -.035em; color: var(--ink); }
/* The byline is five words, so it is set as text, not as a caps legend. */
.csBarTag { font: 500 var(--fs-small)/1.2 var(--font-ui); color: var(--ink-2); }

/* ── 01 The rhythm board ──────────────────────────────────────────────── */
.csReadouts { display: flex; gap: 22px; margin: 0; }
.csReadouts div { display: flex; align-items: baseline; gap: 7px; }
.csReadouts dt { color: var(--ink-2); }
.csReadouts dd {
  margin: 0; font: 700 var(--fs-title)/1 var(--font-ui); font-stretch: 112%;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
@media (max-width: 720px) {
  .csBoardSec .csSecHead .csReadouts { flex-basis: 100%; order: 9; justify-content: space-between; gap: 10px; }
}

.csBoard { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 16px; }

/* The rhythm console: the heart, the paper it makes, the ladder under it.
   The board's keys below pick what it plays (home.js). */
.csConsole { display: grid; grid-template-columns: minmax(180px, 248px) minmax(0, 1fr); gap: 16px 20px; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.csConsole[hidden] { display: none; }
.csConsoleHeart { background: var(--cap); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 10px 14px 12px; display: grid; gap: 6px; }
.csConsoleHeart .hpSay { text-align: center; font-size: 12.5px; line-height: 1.4; min-height: 4.2em; }
.csConsoleBench { min-width: 0; display: grid; gap: 10px; align-content: start; }
.csConsoleHead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; }
.csConsoleTitle { flex: 1 1 260px; min-width: 0; display: grid; gap: 2px; }
.csConsoleName { margin: 0; font: 800 clamp(1.15rem, .7rem + 1.15vw, var(--fs-head))/1.15 var(--font-display, var(--font-ui)); letter-spacing: var(--tr-display, -.02em); color: var(--ink); text-wrap: balance; }
.csConsoleCal { font: 600 var(--fs-legend)/1.4 var(--font-code, monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.csConsoleKeys { margin-left: auto; display: inline-flex; gap: 8px; }
.csConsoleKeys .key { gap: 8px; }
.csConsoleStrip { min-width: 0; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--strip-paper, var(--cap)); }
.csConsolePaper { --fg-paper-max: 168px; }
.csConsoleKey { padding-top: 2px; }
.csCell[aria-pressed="true"] { background: var(--cap); box-shadow: inset 0 0 0 1px var(--rule-2), 0 2px 0 0 var(--ink); }
.csCell[aria-pressed="true"] .csCellAbbr { color: var(--ink); font-weight: 700; }
@media (max-width: 760px) {
  .csConsole { grid-template-columns: minmax(0, 1fr); }
  .csConsoleHeart { grid-template-columns: minmax(96px, 132px) minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 12px; }
  .csConsoleHeart .hpTag, .csConsoleHeart .hpLabel { display: none; }
  .csConsoleHeart .hpSay { text-align: left; min-height: 0; }
  .csConsoleName { font-size: var(--fs-title); }
  .csConsoleKeys { margin-left: 0; flex-basis: 100%; }
  .csConsoleKeys .key { flex: 1 1 0; justify-content: center; }
  .csConsoleCal { display: none; }
}
.csBoardGrid { display: flex; gap: 14px; min-width: 0; }
.csFam { flex: var(--n, 1) 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.csFamName {
  padding-bottom: 5px; border-bottom: 1px solid var(--rule-2);
  color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.csFamCells { display: flex; gap: 4px; }
.csCell {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  margin: 0; padding: 6px 2px 4px; border: 0; border-radius: var(--r);
  background: transparent; color: inherit; font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .csCell:hover { background: var(--cap); box-shadow: inset 0 0 0 1px var(--rule); }
  .csCell:hover .csCellAbbr { text-decoration: underline; text-underline-offset: 3px; }
}
.csCell:active .csMeter { transform: translateY(1px); }
.csCell:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* The meter: a recessed well with a scale engraved at quarters. It fills
   with accuracy once three answers are in; below that, a dot per answer. */
.csMeter {
  position: relative; display: block; width: 100%; max-width: 30px; height: 64px; overflow: hidden;
  border-radius: var(--r-sm); background: var(--chassis-2); box-shadow: var(--well-shadow);
}
.csMeter::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, transparent calc(25% - .5px), var(--rule) calc(25% - .5px), var(--rule) calc(25% + .5px), transparent calc(25% + .5px)),
    linear-gradient(to top, transparent calc(50% - .5px), var(--rule-2) calc(50% - .5px), var(--rule-2) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to top, transparent calc(75% - .5px), var(--rule) calc(75% - .5px), var(--rule) calc(75% + .5px), transparent calc(75% + .5px));
  opacity: .9;
}
.csMeterFill {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--acc, 0) * 100%);
  background: var(--blue); box-shadow: inset 0 1px 0 var(--blue-edge);
  transition: height var(--m-seat, 180ms) var(--e-seat, ease-out);
}
.csDots {
  position: absolute; left: 0; right: 0; bottom: 6px;
  display: flex; flex-direction: column-reverse; align-items: center; gap: 4px;
}
.csDots i { display: block; width: 7px; height: 7px; border-radius: 50%; box-shadow: var(--lens-off); }
.csCell[data-answers="1"] .csDots i:nth-child(-n+1),
.csCell[data-answers="2"] .csDots i:nth-child(-n+2) { background: var(--led-amber); box-shadow: var(--lens); }
.csCell[data-state="scored"] .csDots { display: none; }
.csCellAbbr { color: var(--ink); white-space: nowrap; letter-spacing: .02em; }
.csCellPct { color: var(--ink-3); font-size: 10px; line-height: 12px; }
.csCell[data-state="none"] .csCellAbbr { color: var(--ink-2); }

/* Keeps missing: a row per rhythm, its lesson beside Drill. */
.csMiss { display: flex; align-items: flex-start; gap: 10px 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.csMiss[hidden] { display: none; }
.csMissHead { margin: 0; flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; }
.csMissTitle {
  font: 600 var(--fs-legend)/1 var(--font-legend, var(--font-mono)); letter-spacing: var(--tr-legend, .06em);
  text-transform: uppercase; color: var(--ink-2);
}
.csMissList { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.csMissItem { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
.csMissName { font: 650 var(--fs-body)/1.2 var(--font-ui); color: var(--ink); }
.csMissTally { font-size: var(--fs-small); color: var(--red-ink, var(--ink-2)); font-variant-numeric: tabular-nums; }
.csMissKeys { display: inline-flex; gap: 6px; }
.csCell[data-miss] .csCellAbbr { color: var(--red-ink, var(--ink)); }
.csBoardFoot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 28px;
  padding-top: 16px; border-top: 1px solid var(--rule);
}
.csBoardNote { margin: 0; max-width: 62ch; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); }
.csContinue.key { min-width: 340px; max-width: 100%; justify-content: space-between; gap: 18px; padding: 8px 20px; white-space: normal; }
.csContinueText { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; text-align: left; }
.csContinueKicker { color: color-mix(in oklab, var(--ink) 72%, var(--blue-ink)); }
.csContinueName { font: 600 var(--fs-body)/1.2 var(--font-ui); }
.csContinue .nf { font-size: 20px; }

/* A phone stacks the families two rows deep, the bars a little shorter. */
@media (max-width: 860px) {
  .csBoardGrid { flex-wrap: wrap; row-gap: 14px; }
  .csFam:nth-child(-n+3) { flex-basis: calc((100% - 28px) * var(--n) / 10); }
  .csFam:nth-child(n+4) { flex-basis: calc((100% - 28px) * var(--n) / 9); }
}
@media (max-width: 720px) {
  .csBoard { padding: 12px 10px 14px; }
  .csBoardGrid { gap: 10px; }
  .csFamCells { gap: 2px; }
  .csMeter { height: 52px; }
  .csCellAbbr { font-size: 10px; letter-spacing: -.02em; }
  .csBoardFoot { flex-direction: column; align-items: stretch; }
  .csContinue.key { min-width: 0; width: 100%; }
  .csMiss { flex-direction: column; gap: 8px; }
  .csMissHead { min-height: 0; }
}

/* ── 02 Practice, 03 Learn: the shared tiles on CardiSim's face ──────── */
.csPracticeGrid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 14px; align-items: stretch; }
.csLearnGrid { display: flex; flex-direction: column; gap: 14px; }
.csTrainers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .csPracticeGrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .csTrainers { grid-template-columns: minmax(0, 1fr); } }

.csHome .studyTile { display: flex; flex-direction: column; min-width: 0; }
/* A tile is a bone key set into the chassis, with a state lamp: a ring when
   nothing is here yet, amber while in progress, green when done. */
.csHome .quizEntry {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr;
  align-items: center; gap: 4px 12px;
  width: 100%; height: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
  background: var(--cap); color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: var(--r); box-shadow: var(--key-shadow);
  transition: var(--key-transition);
}
@media (hover: hover) and (pointer: fine) {
  .csHome .quizEntry:hover { box-shadow: var(--key-shadow-hover); border-color: var(--ink-2); }
}
.csHome .quizEntry:active { box-shadow: var(--key-shadow-press); transform: translateY(2px); transition-duration: var(--m-press); }
.csHome .quizEntry:focus-visible { outline: 2px solid transparent; box-shadow: var(--key-shadow), var(--focus); }
.csHome .quizEntry::after {
  content: ""; grid-row: 1; grid-column: 2; justify-self: end;
  width: 10px; height: 10px; border-radius: 50%; background: transparent; box-shadow: var(--lens-off);
}
.csHome #quizStart:has(#quizEntryStreak:not([hidden])),
.csHome .trainerTile[data-progress="started"] { --tile-led: var(--led-amber); }
.csHome .trainerTile[data-progress="done"] { --tile-led: var(--led-green); }
.csHome .quizEntry:is(#quizStart:has(#quizEntryStreak:not([hidden])), .trainerTile:is([data-progress="started"], [data-progress="done"]))::after {
  background: var(--tile-led); box-shadow: var(--lens);
}
.csHome .quizEntry .quizEntryTitle { grid-row: 1; grid-column: 1; min-width: 0; font: 600 var(--fs-title)/var(--lh-title, 24px) var(--font-ui); color: var(--ink); }
.csHome .quizEntry .quizEntrySub { grid-row: 2; grid-column: 1 / -1; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); }
.csHome .quizEntry .quizEntryStreak {
  grid-row: 1; grid-column: 2; margin-right: 18px;
  font: 600 var(--fs-legend)/1 var(--font-legend, var(--font-mono)); text-transform: uppercase; letter-spacing: var(--tr-legend, .06em);
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.csHome .quizEntry .quizEntryStreak[hidden] { display: none; }
.csHome .quizEntry .tileMeta {
  grid-row: 3; grid-column: 1 / -1; align-self: end; margin-top: 8px;
  display: flex; align-items: center; gap: 8px;
  font: 600 var(--fs-legend)/1 var(--font-legend, var(--font-mono)); text-transform: uppercase; letter-spacing: var(--tr-legend, .06em);
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.csHome .quizEntry .tileMeter { flex: 1; max-width: 140px; height: 4px; border-radius: 1px; overflow: hidden; background: var(--chassis-2); box-shadow: var(--well-shadow); }
.csHome .quizEntry .tileMeter i { display: block; height: 100%; background: var(--tile-fill, var(--blue)); }

/* A trainer tile with its picture (home-art.js): the picture on a plate
   across the head, then the name, the line and the meter. */
.csHome .trainerTile.has-art { grid-template-rows: auto auto auto 1fr; padding-top: 0; overflow: hidden; }
.csHome .trainerTile .csTileArt {
  grid-row: 1; grid-column: 1 / -1; margin: 0 -16px 8px; height: 152px; box-sizing: border-box; padding: 10px 16px;
  display: grid; place-items: center; overflow: hidden; background: var(--plate); border-bottom: 1px solid var(--rule);
}
.csHome .trainerTile .csTileArt svg { display: block; height: 132px; width: auto; max-width: 100%; }
.csHome .trainerTile.has-art :is(.quizEntryTitle) { grid-row: 2; }
.csHome .trainerTile.has-art::after { grid-row: 2; }
.csHome .trainerTile.has-art .quizEntrySub { grid-row: 3; }
.csHome .trainerTile.has-art .tileMeta { grid-row: 4; }

/* The quiz tile: paper first, then its name; its settings foot welds on. */
.csHome #quizStart {
  --strip-bleed: 16px;
  grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto auto auto;
  grid-template-areas: "strip strip strip" "title streak lamp" "sub sub sub";
  padding-top: 0; overflow: hidden; isolation: isolate;
  border-radius: var(--r) var(--r) 0 0;
}
.csHome #quizStart .studyStrip { grid-area: strip; height: 128px; }
.csHome #quizStart .quizEntryTitle { grid-area: title; }
.csHome #quizStart .quizEntryStreak { grid-area: streak; margin-right: 0; }
.csHome #quizStart .quizEntrySub { grid-area: sub; }
.csHome #quizStart::after { grid-area: lamp; }
.csHome .quizTileFoot {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  padding: 10px 16px 12px; border: 1px solid var(--rule-2); border-top: 0;
  border-radius: 0 0 var(--r) var(--r); background: var(--plate);
}
.csHome .quizTileFoot :is(.quizIdOnly, .quizDrillClear, .quizTrainerLinks) { margin-top: 0; }
.csHome #quizSummaryHost:empty, .csHome #quizTrainerLinks:empty { display: none; }
.csHome .quizTileFoot #quizSummaryHost { flex: 1 1 100%; }
.csHome #quizTrainerLinks .quizLink { color: var(--ink-2); }

/* The Field Guide tile: title, line, and its thumb index at the foot. */
.csHome #fieldGuideStart {
  grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr;
  grid-template-areas: "title lamp" "sub sub" "index index";
}
.csHome #fieldGuideStart .quizEntryTitle { grid-area: title; }
.csHome #fieldGuideStart .quizEntrySub { grid-area: sub; }
.csHome #fieldGuideStart::after { grid-area: lamp; }
.csHome #fieldGuideStart .fgIndex { margin-top: 14px; }
/* Beside the taller quiz tile the index stands up as a grid of large
   numerals, so the tile fills with its contents rather than empty face. */
@media (min-width: 1001px) {
  .csHome #fieldGuideStart .fgIndex { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
  .csHome #fieldGuideStart .fgIndexCell { padding-top: 10px; }
  .csHome #fieldGuideStart .fgIndexCell:nth-child(4n + 1) { border-left: 0; }
  .csHome #fieldGuideStart .fgIndexCell b { font-size: 30px; font-weight: 700; }
}

/* ==========================================================================
   ACCOUNT PAGES
   ========================================================================== */

/* The bar's keys sit at its far end; on a phone the tag gives them room. */
.csBarKeys { margin-left: auto; align-self: center; display: flex; gap: 8px; }
.csBarKeys .keyGlyph { font-size: 10px; }
@media (max-width: 560px) { .csBar:has(.csBarKeys) .csBarTag { display: none; } }
/* The narrowest phones: the mark and the doors both give a little, so the bar never runs off the page. */
@media (max-width: 380px) {
  .csBar:has(.csBarKeys) { gap: 10px; }
  .csBar:has(.csBarKeys) .brand { font-size: 30px; }
  .csBarKeys { gap: 6px; }
  .csBarKeys .key { padding: 0 9px; }
}

/* ── Sign in, create an account, forgot, reset: one card ─────────────── */
.csAuthShell { min-height: 100vh; min-height: 100dvh; }
.csAuthMain {
  flex: 1 0 auto; display: flex; justify-content: center; align-items: flex-start;
  padding-top: clamp(0px, 5vh, 56px);
}
.csAuthCard { width: min(100%, 460px); overflow: hidden; display: flex; flex-direction: column; }

/* The card's head is a strip of paper: the engine's sinus rhythm, printed
   once at 25 mm/s as the page opens (static/auth.js). */
.csAuthStrip { position: relative; background: var(--strip-paper); border-bottom: 1px solid var(--rule); }
.csAuthPaper { display: block; width: 100%; height: 92px; }
.csAuthStrip .csPaperCap { left: 10px; bottom: 7px; right: auto; }

.csAuthBody { padding: 26px 30px 30px; }
.csFace, .csSent { display: flex; flex-direction: column; min-width: 0; }
.csFace[hidden], .csSent[hidden] { display: none; }
.csAuthTitle {
  margin: 0; text-wrap: balance;
  font: 700 28px/1.1 var(--font-ui); letter-spacing: -.02em; color: var(--ink);
}
/* Headings take focus only to move a screen reader to a new panel. */
.csAuthTitle:focus { outline: none; }
.csAuthSub { margin: 8px 0 0; max-width: 46ch; font-size: var(--fs-body); line-height: 1.45; color: var(--ink-2); }
.csAuthSub b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

/* A notice: why the learner is here (a link that ran out, a new password
   saved) or what to do next. A lamp, a line, a wash in its colour. */
.csNotice {
  display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 0; padding: 10px 12px;
  border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--cap);
  font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink);
}
.csNotice[hidden] { display: none; }
.csNotice::before {
  content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%;
  background: var(--led-amber); box-shadow: var(--lens);
}
.csNotice[data-tone="amber"] { background: var(--amber-wash); border-color: var(--amber-edge); }
.csNotice[data-tone="green"] { background: var(--green-wash); border-color: var(--green-edge); }
.csNotice[data-tone="green"]::before { background: var(--led-green); }

/* Google above the form, then a rule with "or" set into it. */
.csGoogle { margin-top: 22px; }
.csGoogle[hidden] { display: none; }
.csGoogleKey.key { width: 100%; gap: 12px; }
.csG { flex: none; display: block; }
.csOr { display: flex; align-items: center; gap: 12px; margin: 20px 0 0; color: var(--ink-2); }
.csOr::before, .csOr::after { content: ""; flex: 1 1 0; height: 1px; background: var(--rule-2); }

/* Fields: an engraved label over a well. 16px type, so a phone never
   zooms the page on focus. */
.csForm { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; min-width: 0; }
.csForm[hidden] { display: none; }
.csField { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.csLabel { color: var(--ink-2); }
.csLabelRow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.csFieldLink {
  font-size: var(--fs-small); line-height: 1; color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px;
}
.csFieldLink:hover { color: var(--ink); text-decoration-color: currentColor; }
.csForm .input { min-height: 46px; font-size: 16px; }
.csForm .input[aria-invalid="true"] {
  border-color: var(--red-edge);
  box-shadow: var(--well-shadow), 0 0 0 3px color-mix(in oklab, var(--red) 34%, transparent);
}

/* The password's Show key, set into the right end of its well. */
.csPw { position: relative; }
.csPw .input { padding-right: 78px; }
.csPw .input::-ms-reveal { display: none; }
.csPwShow {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  min-width: 58px; min-height: 32px; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-2); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .csPwShow:hover { color: var(--ink); background: var(--chassis-2); }
}
.csPwShow[aria-pressed="true"] { color: var(--ink); background: var(--chassis-2); box-shadow: var(--well-shadow); }
.csPwShow:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.csHint { margin: 0; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); }
.csFormError {
  display: flex; align-items: flex-start; gap: 8px; margin: 0;
  font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--red-ink);
}
.csFormError[hidden] { display: none; }
.csFormError::before {
  content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%;
  background: var(--led-red); box-shadow: var(--lens);
}
.csCaptcha[hidden] { display: none; }
.csAuthCard .csSubmit.key { width: 100%; margin-top: 6px; }

/* The follow-up panel: a lit lamp and its word, then what to do. */
.csSentHead { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.csSentHead .led { width: 10px; height: 10px; }
.csSentKicker { color: var(--ink-2); }
.csFine { margin: 12px 0 0; max-width: 46ch; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); }
.csAgree { margin-top: 14px; }
.csAgree a { color: var(--ink); text-underline-offset: 3px; }
/* Under the Google key: a Google sign-in can create the account, so it says what that agrees to. */
.csAgreeGoogle { margin: 10px auto 0; text-align: center; text-wrap: balance; }
.csSentKeys { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.csSentStatus:empty { display: none; }

.csAuthFoot {
  margin: 0; padding: 14px 30px 16px; border-top: 1px solid var(--rule);
  font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2);
}
.csAuthFoot a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

@media (max-width: 520px) {
  .csAuthMain { padding-top: 0; }
  .csAuthBody { padding: 20px 18px 22px; }
  .csAuthFoot { padding: 12px 18px 14px; }
  .csAuthTitle { font-size: 25px; }
}

/* ── The account page: one ruled row per subject ─────────────────────── */
.csAcct { gap: 0; max-width: 980px; }
.csAcctTitle {
  margin: 0 0 26px;
  font: 800 clamp(30px, 3.4vw, 40px)/1 var(--font-ui); letter-spacing: -.03em; color: var(--ink);
}
.csAcctRow {
  display: grid; grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: 14px 40px;
  padding: 26px 0; border-top: 1px solid var(--rule-2);
}
.csAcctSide {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: baseline; align-content: start;
  column-gap: 8px;
}
.csAcctName { grid-column: 2; margin: 0; font: 700 var(--fs-title)/var(--lh-title, 24px) var(--font-ui); color: var(--ink); }
.csAcctNote { grid-column: 2; margin: 6px 0 0; max-width: 34ch; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); }
.csAcctNote[hidden], .csAddPw[hidden] { display: none; }
.csAcctPanel { min-width: 0; max-width: 580px; padding: 20px 22px; }
.csAcctPanel .csForm { margin-top: 0; max-width: 420px; }
.csAcctText { margin: 0; max-width: 56ch; font-size: var(--fs-body); line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.csAcctText b { font-weight: 600; overflow-wrap: anywhere; }
.csAcctText + .csFormKeys { margin-top: 16px; }
.csAcctPanel > .csAcctText + .csAcctText { margin-top: 12px; }

/* Facts: engraved names, plain values, hairlines between. */
/* Both cells of a row share one height (and so one hairline): the name is
   set on the value's 20px line instead of being baseline-shifted. */
.csFacts { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; }
.csFacts div { display: contents; }
.csFacts dt, .csFacts dd { padding: 11px 0; border-top: 1px solid var(--rule); }
.csFacts div:first-child > * { padding-top: 0; border-top: 0; }
.csFacts div:last-child > * { padding-bottom: 0; }
.csFacts dt { padding-right: 28px; line-height: 20px; color: var(--ink-2); }
.csFacts dd {
  margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  font: 600 var(--fs-body)/20px var(--font-ui); color: var(--ink);
}
.csFactEmail { min-width: 0; overflow-wrap: anywhere; }
.csTag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 8px;
  border: 1px solid var(--green-edge); border-radius: var(--r-sm);
  background: var(--green-wash); color: var(--green-ink);
}
.csTag .led { width: 6px; height: 6px; }

.csSwitchRow { display: flex; align-items: center; gap: 12px; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink); cursor: pointer; }
.csFormKeys { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.csDone { margin: 0; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--green-ink); }
.csDone[data-tone="bad"] { color: var(--red-ink); }
.csDone:empty { display: none; }

@media (max-width: 720px) {
  .csAcctTitle { margin-bottom: 18px; }
  .csAcctRow { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 0; }
  .csAcctNote { max-width: none; }
  .csAcctPanel { max-width: none; padding: 16px; }
  .csFacts { grid-template-columns: minmax(0, 1fr); }
  .csFacts dd { padding-top: 2px; border-top: 0; }
  .csFacts div:first-child > dd { padding-top: 2px; }
  .csFacts div:not(:last-child) > dt { padding-bottom: 0; }
  .csFacts div:last-child > dt { padding-bottom: 0; }
}

/* ==========================================================================
   THE PLAN (static/home-plan.js, static/account.js; billing.ts)
   ========================================================================== */

/* ── The status line: tucked under the bar, a plate with a lamp ──────── */
.csPlanLine {
  margin-top: calc(16px - var(--page-gap));
  display: flex; align-items: center; justify-content: space-between; gap: 10px 24px;
  min-height: 56px; padding: 8px 8px 8px 16px;
  background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r-lg);
}
.csPlanLine[hidden] { display: none; }
.csPlanLineSay { margin: 0; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.csPlanLineSay .led { align-self: center; background: var(--led-blue); box-shadow: var(--lens); }
.csPlanLineKicker { color: var(--ink); }
.csPlanLineText { font-size: var(--fs-body); line-height: 1.4; color: var(--ink-2); }
.csPlanLineGo.key { flex: none; min-height: 40px; }
.csPlanLineGo[hidden] { display: none; }
.csPlanLine[data-tone="joined"] { background: var(--green-wash); border-color: var(--green-edge); }
.csPlanLine[data-tone="joined"] .led { background: var(--led-green); }
.csPlanLine[data-tone="due"] { background: var(--amber-wash); border-color: var(--amber-edge); }
.csPlanLine[data-tone="due"] .led { background: var(--led-amber); }
.csPlanLine[data-tone="week"] { border-color: var(--blue-edge); }
.csPlanLine:is([data-tone="joined"], [data-tone="due"]) .csPlanLineText { color: var(--ink); }
@media (max-width: 720px) {
  .csPlanLine { flex-direction: column; align-items: stretch; padding: 12px; }
  .csPlanLineSay { padding: 0 2px; }
  .csPlanLineGo.key { width: 100%; justify-content: center; }
}

/* ── The account page's Plan row ─────────────────────────────────────── */
.csTag[data-tone="blue"] { border-color: var(--blue-edge); background: var(--blue-wash); color: var(--blue-ink); }
.csTag[data-tone="amber"] { border-color: var(--amber-edge); background: var(--amber-wash); color: var(--amber-ink); }
.csTag[data-tone="plain"] { border-color: var(--rule-2); background: var(--cap); color: var(--ink-2); }
.csTag[data-tone="green"] .led { background: var(--led-green); box-shadow: var(--lens); }
.csTag[data-tone="blue"] .led { background: var(--led-blue); box-shadow: var(--lens); }
.csTag[data-tone="amber"] .led { background: var(--led-amber); box-shadow: var(--lens); }
.csTag[data-tone="plain"] .led { background: transparent; box-shadow: var(--lens-off); }
.csPlanFacts + .csAcctText { margin-top: 16px; }
.csAcctPlanKeys { margin-top: 18px; }
.csAcctPlanKeys .key--blue { min-width: 220px; justify-content: space-between; }
@media (max-width: 720px) { .csAcctPlanKeys .key { width: 100%; } .csAcctPlanKeys .key--blue { justify-content: space-between; } }

/* ==========================================================================
   THE TOUR (pages/tour.html, static/tour.js)

   Two plates: the film, and the plan under it. The film is a video of the
   real screens set into a dark bezel like the monitor's, with the site's
   own controls under it (Play, a scrub bar, the clock) and a key per
   scene, lit as the film reaches it. Over the film's last scene the page
   lays the end card: the offer and a key, as real text. Each plate wears
   a channel band along its top edge (the landing's track colours).
   ========================================================================== */

.tourPage { --page-gap: 24px; }
.tourMain { display: flex; flex-direction: column; gap: var(--page-gap); min-width: 0; }

/* ── The film's plate ────────────────────────────────────────────────── */
.tourFilm {
  --tab: var(--red);
  position: relative; overflow: hidden; border-radius: var(--r-xl); min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 40px 44px 28px;
}
.tourFilm::before, .tourSlide::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: var(--tab); box-shadow: inset 0 -1px 0 color-mix(in oklab, var(--ink) 18%, transparent);
}
.tourFilmHead {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "kick kick" "hero text"; align-items: end; gap: 0 56px;
  margin-bottom: 12px;
}
.tourFilmHead .tourKicker { grid-area: kick; }
.tourFilmHead .tourHero { grid-area: hero; }
.tourFilmHead .tourText { grid-area: text; margin: 0 0 6px; }

/* The screen: the film in a bezel, the Play key and the end card over it. */
.tourScreen {
  position: relative; padding: 10px; border-radius: var(--r-lg);
  background: var(--screen); box-shadow: inset 0 0 0 1px #000, 0 1px 0 color-mix(in oklab, var(--cap) 60%, transparent);
}
.tourVideo {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r-sm);
  background: #000; object-fit: contain; cursor: pointer;
}
.tourScreen:fullscreen { display: grid; place-items: center; padding: 0; border-radius: 0; }
.tourScreen:fullscreen .tourVideo { width: 100vw; height: 100vh; border-radius: 0; }
.tourPlay.key {
  /* Centred with `translate`, never `transform`: the key's own press (system.css,
     a transform) then adds to it. Centred with a transform, the press replaced
     it and the key jumped out from under the pointer, so the press never landed. */
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  gap: 12px; padding: 0 22px 0 20px; white-space: nowrap;
  box-shadow: var(--key-shadow), 0 10px 34px rgba(0, 0, 0, .5);
}
.tourPlayLen {
  font: 600 var(--fs-legend)/1 var(--font-legend, var(--font-mono)); letter-spacing: var(--tr-legend, .06em);
  font-variant-numeric: tabular-nums; opacity: .75;
}
.tourPlayLen:empty { display: none; }
/* After the film: a second key in the end card's row, quieter than the offer beside it. */
.tourPlay--again.key {
  position: static; translate: none; box-shadow: var(--key-shadow);
  --key-bg: var(--keygrey); --key-ink: var(--ink); --key-edge: var(--keygrey-edge);
}
.tourPlay--again .tourPlayLen { display: none; }
/* Play is a triangle and Pause two bars, drawn here: no glyph to load. */
.tourIcon {
  display: inline-block; width: 12px; height: 14px; flex: none;
  background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%);
}
[data-playing="1"] > .tourIcon { clip-path: polygon(0 0, 36% 0, 36% 100%, 0 100%, 0 0, 64% 0, 100% 0, 100% 100%, 64% 100%, 64% 0); }

/* The end card sits on the lower half of the film's last scene, which is the page's own grey. */
.tourEnd {
  position: absolute; left: 10px; right: 10px; bottom: 10px; height: 46%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 1.6vw, 20px);
  padding: 0 16px; text-align: center; pointer-events: none;
}
.tourEnd > * { pointer-events: auto; }
.tourEndLine {
  margin: 0; text-wrap: balance;
  /* Under the film's own closing line, so a size down from it. */
  font: 700 clamp(15px, 2.3vw, 28px)/1.1 var(--font-ui); font-stretch: 106%; letter-spacing: -.02em; color: #17191d;
}
.tourEndKeys { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* The desk: Play, where the film is, how long it runs. */
.tourDesk { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tourToggle.key { width: 44px; min-width: 44px; padding: 0; justify-content: center; }
.tourClock {
  font: 600 var(--fs-legend)/1 var(--font-legend, var(--font-mono)); letter-spacing: var(--tr-legend, .06em);
  font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap;
}
.tourSeek {
  --at: 0%;
  flex: 1 1 auto; min-width: 0; height: 28px; margin: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: transparent;
}
.tourSeek::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px; box-shadow: var(--well-shadow);
  background: linear-gradient(90deg, var(--led-red) var(--at), var(--chassis-2) var(--at));
}
.tourSeek::-moz-range-track { height: 8px; border-radius: 4px; background: var(--chassis-2); box-shadow: var(--well-shadow); }
.tourSeek::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--led-red); }
.tourSeek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 24px; margin-top: -8px;
  border: 1px solid var(--rule-2); border-radius: var(--r-sm); background: var(--cap); box-shadow: var(--key-shadow);
}
.tourSeek::-moz-range-thumb {
  width: 14px; height: 24px; border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  background: var(--cap); box-shadow: var(--key-shadow);
}
.tourSeek:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); border-radius: var(--r-sm); }

/* ── The scenes: a key each, the one playing lit and named ───────────── */
/* Two rows of five: every scene's name fits its key. */
.tourStops { list-style: none; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tourStops li { min-width: 0; display: grid; }
.tourStop {
  width: 100%; min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 8px;
  cursor: pointer; text-align: left;
  background: var(--cap); color: var(--ink-2);
  border: 1px solid var(--rule-2); border-radius: var(--r);
  box-shadow: var(--key-shadow); transition: var(--key-transition);
  font: 600 13px/1.1 var(--font-ui); -webkit-tap-highlight-color: transparent;
}
.tourStop .led { background: transparent; box-shadow: var(--lens-off); }
.tourStop[data-state="seen"] .led { background: var(--led-green); box-shadow: var(--lens); }
.tourStop[data-state="on"] .led { background: var(--led-blue); box-shadow: var(--lens); }
.tourStop[data-state="on"] {
  color: var(--ink); background: var(--blue-wash); border-color: var(--blue-edge);
  box-shadow: var(--key-shadow-press); transform: translateY(2px);
}
.tourStopNo { color: var(--ink-3); }
.tourStopName { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── The plan's plate ────────────────────────────────────────────────── */
.tourPlanStage { position: relative; overflow: hidden; border-radius: var(--r-xl); min-width: 0; }
.tourSlide {
  --tab: var(--rule-2);
  position: relative; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  align-items: center; gap: 28px 56px;
  padding: 44px 44px 36px;
  scroll-margin-top: 12px;
}
.tourSlide[data-tab="green"] { --tab: var(--green); }

/* ── A plate's words ──────────────────────────────────────────────────── */
.tourCopy { min-width: 0; }
.tourKicker { margin: 0; display: flex; align-items: center; gap: 10px; }
.tourNo, .tourKick, .tourStopNo, .tourReceiptHead, .tourReceiptLines i, .tourReceiptTotal span,
.tourReceiptFine {
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.tourNo {
  padding: 2px 7px; border-radius: var(--r-sm);
  background: var(--tab); color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 16%, transparent);
}
.tourSlide[data-tab="ink"] .tourNo { color: var(--cap); }
.tourKick { color: var(--ink-2); }
.tourTitle {
  margin: 16px 0 0; max-width: 17ch; text-wrap: balance;
  font: 800 clamp(30px, 2.9vw, 42px)/1.04 var(--font-ui); letter-spacing: -.028em; color: var(--ink);
}
.tourText {
  margin: 16px 0 0; max-width: 46ch; text-wrap: pretty;
  font: 400 16px/1.55 var(--font-ui); color: var(--ink-2);
}

.tourSpec { min-width: 0; }

.tourHero {
  margin: 20px 0 0;
  font: 800 clamp(44px, 5.3vw, 78px)/.94 var(--font-ui); letter-spacing: -.045em; color: var(--ink);
}
.tourHero > span { display: block; }
/* The last full stop is CardiSim's lamp: the red dot over the mark's ı. */
.tourHeroDot {
  display: inline-block; width: .17em; height: .17em; margin-left: .05em; border-radius: 50%;
  background: var(--pilot, var(--led-red)); box-shadow: var(--lens); vertical-align: baseline;
}


.tourSay { min-width: 0; }

/* ── The segmented switch: keys set into a well, the chosen one lit ───
   The policies' are links to their pages (aria-current). */
.csSeg {
  display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px;
  border-radius: var(--r); background: var(--chassis-2); box-shadow: var(--well-shadow);
}
.csSegKey {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 0 13px; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--r-sm); background: transparent;
  font: 600 var(--fs-small)/1 var(--font-ui); color: var(--ink-2);
  transition: var(--key-transition); -webkit-tap-highlight-color: transparent;
}

.csSegKey[aria-current="page"] {
  background: var(--cap); color: var(--ink); border-color: var(--rule-2); box-shadow: var(--key-shadow);
}


/* ── The plan ─────────────────────────────────────────────────────── */
.tourPlan .tourTitle { max-width: 13ch; }
.tourPlanKeys { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.tourFine { margin: 12px 0 0; max-width: 46ch; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); }
.tourFine:empty { display: none; }
.tourPlan .csFormError { margin-top: 12px; }

/* The receipt: what the plan prints out, on the recorder's paper, its
   bottom edge torn off the roll. */
.tourReceipt {
  position: relative; width: min(100%, 380px); margin: 0 auto; padding: 22px 24px 34px;
  background: var(--strip-paper); color: var(--ink);
  box-shadow: 0 0 0 1px var(--strip-major);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}
.tourReceiptHead {
  margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 10px; border-bottom: 1px dashed var(--rule-2); color: var(--ink-2);
}
.tourReceiptHead span:first-child { font: 800 20px/1 var(--font-ui); letter-spacing: -.03em; text-transform: none; color: var(--ink); }
.tourReceiptLines { list-style: none; margin: 4px 0 0; padding: 0; }
.tourReceiptLines li {
  display: grid; grid-template-columns: 3ch minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
  padding: 8px 0; border-bottom: 1px dotted var(--rule-2);
}
.tourReceiptLines b { font: 700 18px/1 var(--font-legend, var(--font-mono)); font-variant-numeric: tabular-nums; text-align: right; }
.tourReceiptLines span { font: 500 13px/1.3 var(--font-ui); color: var(--ink); }
.tourReceiptLines i { font-style: normal; color: var(--ink-2); }
.tourReceiptTotal {
  margin: 14px 0 0; display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 12px; border-top: 2px solid var(--ink);
}
.tourReceiptTotal span { color: var(--ink-2); }
.tourReceiptTotal b { font: 800 40px/1 var(--font-ui); font-stretch: 125%; letter-spacing: -.03em; }
.tourReceiptFine { margin: 10px 0 0; text-align: center; color: var(--ink-2); }

/* Key mechanics for this sheet's hand-rolled keys (system.css rule 5). */
@media (hover: hover) and (pointer: fine) {
  .tourStop:not([data-state="on"]):hover { box-shadow: var(--key-shadow-hover); border-color: var(--ink-2); }
  .csSegKey:not([aria-current="page"]):hover { color: var(--ink); background: color-mix(in oklab, var(--cap) 50%, transparent); }
}
.tourStop:active { transform: translateY(2px); box-shadow: var(--key-shadow-press); transition-duration: var(--m-press); }
.csSegKey:active { transform: translateY(1px); }
:is(.tourStop, .csSegKey):focus-visible { outline: 2px solid transparent; box-shadow: var(--key-shadow), var(--focus); }

/* ── Motion: additive only (system.css rule 2) ───────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  /* The receipt feeds out line by line, the way a recorder prints. */
  .tourReceipt.is-printing:not(.is-printed) { clip-path: inset(0 0 100% 0); }
  .tourReceipt.is-printing { transition: clip-path 1.4s steps(18, end) 200ms; }
  .tourEnd:not([hidden]) { animation: tourRise 520ms var(--e-settle, ease-out) both; }
}
@keyframes tourRise { from { opacity: 0; transform: translateY(10px); } }

/* ── Narrower ────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .tourFilm { padding: 34px 28px 24px; }
  .tourFilmHead { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kick" "hero" "text"; gap: 0; }
  .tourFilmHead .tourText { margin: 14px 0 0; max-width: 60ch; }
  .tourSlide { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 36px 28px 28px; align-items: start; }
  .tourTitle { max-width: 22ch; }
  .tourText { max-width: 60ch; }
}
@media (max-width: 720px) {
  .tourFilm { padding: 28px 14px 18px; gap: 12px; }
  .tourScreen { padding: 5px; border-radius: var(--r); }
  .tourEnd { left: 5px; right: 5px; bottom: 5px; }
  .tourEndKeys .key { min-height: 36px; font-size: 13px; padding: 0 12px; gap: 8px; }
  .tourEndKeys { gap: 8px; flex-wrap: nowrap; }
}
@media (max-width: 360px) {
  /* The narrowest phones: both keys still on one row. */
  .tourEnd { padding: 0 6px; gap: 6px; }
  .tourEndLine { font-size: 13px; }
  .tourEndKeys { gap: 6px; }
  .tourEndKeys .key { min-height: 32px; font-size: 11.5px; padding: 0 7px; gap: 5px; }
}
@media (max-width: 720px) {
  .tourSlide { padding: 30px 16px 22px; gap: 20px; }
  .tourTitle { font-size: 29px; }
  .tourHero { font-size: clamp(44px, 14vw, 64px); }
  .tourText { font-size: 15px; }
  .tourDesk { gap: 8px; }
  .tourFull { display: none; }
  /* Five rows of two, so the names still fit. */
  .tourStops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tourPlanKeys .key { width: 100%; justify-content: center; }
  .tourReceipt { padding: 18px 18px 30px; }
}

/* ==========================================================================
   POLICIES: terms and privacy (pages/legal.html)
   ========================================================================== */

/* The bar's switch moves between the three; on a phone it takes its own row. */
.csLegalSwitch .csSegKey { text-decoration: none; }
@media (max-width: 560px) {
  .csBar:has(.csLegalSwitch) { flex-wrap: wrap; row-gap: 12px; }
  .csLegalSwitch { margin-left: 0; width: 100%; display: flex; }
  .csLegalSwitch .csSegKey { flex: 1 1 0; justify-content: center; }
}

/* A document: its name across the top; the sections listed down a rail
   that stays in view; the text set to a reading measure. */
/* Narrow enough that the facts in the head end where the text does. */
.csLegal { max-width: 960px; gap: 0; }
.csDoc {
  display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  grid-template-areas: "head head" "rail body"; column-gap: 56px;
}
.csDocHead {
  grid-area: head; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 40px; padding: 4px 0 22px; margin-bottom: 30px; border-bottom: 1px solid var(--rule-2);
}
.csDocKicker, .csDocFacts dt, .csDocShortHead, .csDocTable th {
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csDocKicker { margin: 0 0 10px; color: var(--ink-3); }
.csDocTitle {
  margin: 0; text-wrap: balance;
  font: 800 clamp(32px, 4vw, 48px)/1 var(--font-ui); letter-spacing: -.03em; color: var(--ink);
}
.csDocFacts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.csDocFacts div { display: flex; flex-direction: column; gap: 3px; }
.csDocFacts dt { color: var(--ink-3); }
.csDocFacts dd { margin: 0; font: 600 var(--fs-small)/var(--lh-small, 20px) var(--font-ui); color: var(--ink); }
.csDocFacts a { color: inherit; text-underline-offset: 3px; overflow-wrap: anywhere; }

.csDocRail { grid-area: rail; }
.csDocToc {
  position: sticky; top: 24px; list-style: none; margin: 0; padding: 0;
  border-bottom: 1px solid var(--rule);
}
.csDocToc a {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--rule);
  font: 500 var(--fs-small)/var(--lh-small, 20px) var(--font-ui); color: var(--ink-2); text-decoration: none;
}
.csDocToc a:hover { color: var(--ink); }
.csDocToc a:hover .csIdx { color: var(--ink-2); }

.csDocBody { grid-area: body; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.csDocShort { padding: 18px 22px 20px; }
.csDocShortHead { margin: 0 0 10px; color: var(--ink-2); }
.csDocShort ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.csDocShort li {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: baseline;
  font: 500 var(--fs-body)/1.45 var(--font-ui); color: var(--ink);
}
.csDocShort li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; transform: translateY(-2px);
  background: var(--pilot, var(--led-red)); box-shadow: var(--lens);
}
.csDocLead { margin: 0; font: 500 var(--fs-body)/1.55 var(--font-ui); color: var(--ink); text-wrap: pretty; }

.csDocSec { scroll-margin-top: 20px; }
.csDocSecHead {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: baseline;
  margin: 0 0 10px; font: 700 var(--fs-title)/var(--lh-title, 24px) var(--font-ui); color: var(--ink);
}
.csDocSecHead .csIdx { color: var(--ink-3); }
.csProse { padding-left: 34px; font: 400 var(--fs-body)/1.6 var(--font-ui); color: var(--ink); }
.csProse > * { margin: 0; }
.csProse > * + * { margin-top: 12px; }
.csProse p, .csProse li { text-wrap: pretty; }
.csProse ul { padding-left: 18px; }
.csProse li + li { margin-top: 6px; }
.csProse li::marker { color: var(--ink-3); }
.csProse b { font-weight: 650; }
.csProse a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* Tables: engraved column names, hairlines between rows. */
.csDocTable { width: 100%; border-collapse: collapse; font-size: var(--fs-small); line-height: var(--lh-small, 20px); }
.csDocTable th { padding: 0 16px 8px 0; text-align: left; color: var(--ink-2); border-bottom: 1px solid var(--rule-2); }
.csDocTable td { padding: 10px 16px 10px 0; vertical-align: top; border-top: 1px solid var(--rule); color: var(--ink); }
.csDocTable tr:first-child td { border-top: 0; }
.csDocTable td:first-child { width: 42%; font-weight: 600; }
.csDocTable--3 td:first-child { width: 22%; }
.csDocTable :is(th, td):last-child { padding-right: 0; }

@media (max-width: 860px) {
  .csDoc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body"; }
  .csDocRail { display: none; }
  .csDocBody { max-width: 72ch; }
}
@media (max-width: 560px) {
  .csDocHead { margin-bottom: 22px; padding-bottom: 18px; }
  .csDocBody { gap: 26px; }
  .csDocShort { padding: 14px 16px 16px; }
  .csDocSecHead { grid-template-columns: 28px minmax(0, 1fr); font-size: 18px; }
  .csProse { padding-left: 0; }
  /* A phone reads a table row as a card: each cell under its column's name. */
  .csDocTable thead { display: none; }
  .csDocTable tr { display: block; padding: 10px 0; border-top: 1px solid var(--rule); }
  .csDocTable tr:first-child { border-top: 0; padding-top: 0; }
  .csDocTable td, .csDocTable tr:first-child td { display: block; width: auto; padding: 2px 0; border: 0; }
  .csDocTable td::before {
    content: attr(data-label); display: block; margin-bottom: 1px; color: var(--ink-3);
    font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
    letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
  }
  .csDocTable td:first-child, .csDocTable--3 td:first-child { width: auto; }
}

/* ==========================================================================
   WHAT'S NEW: the learner's changelog (pages/whats-new.html, whats-new.ts)
   ========================================================================== */

/* The policies' document, with the log run down a trace: a date at the
   left, a lamp on the line, the entry beside it. The newest lamp is lit. */
.csLog { gap: 40px; }
.csLogToc { max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.csLogTocMonth > span {
  display: block; padding: 16px 0 6px; color: var(--ink-3);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csLogTocMonth:first-child > span { padding-top: 0; }
.csLogTocMonth ol { list-style: none; margin: 0; padding: 0; }
.csLogToc { border-bottom: 0; }
.csLogTocMonth li:last-child a { border-bottom: 1px solid var(--rule); }

.csLogMonth { display: flex; flex-direction: column; }
.csLogMonthHead {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px; color: var(--ink-2);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csLogMonthHead::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--rule-2); }

.csLogEntry {
  --lamp: 11px;
  position: relative; scroll-margin-top: 20px;
  display: grid; grid-template-columns: 46px var(--lamp) minmax(0, 1fr); column-gap: 16px;
  padding-bottom: 30px;
}
/* The trace: from this lamp down to the next one. */
.csLogEntry::before {
  content: ""; position: absolute; top: calc(9px + var(--lamp)); bottom: 9px;
  left: calc(46px + 16px + var(--lamp) / 2 - .5px); width: 1px; background: var(--rule);
}
.csLogMonth:last-child .csLogEntry:last-child { padding-bottom: 0; }
.csLogMonth:last-child .csLogEntry:last-child::before { display: none; }

.csLogDate { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 1px; }
.csLogDay { font: 800 26px/.9 var(--font-ui); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.csLogMon {
  color: var(--ink-3);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csLogLamp {
  width: var(--lamp); height: var(--lamp); margin-top: 7px; border-radius: 50%;
  background: var(--chassis-2); box-shadow: var(--lens-off);
}
.csLogEntry--latest .csLogLamp {
  background: var(--led-green);
  box-shadow: var(--lens), 0 0 0 4px var(--green-wash), 0 0 12px 2px color-mix(in srgb, var(--led-green) 45%, transparent);
}
.csLogText { min-width: 0; }
.csLogTitle {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 8px;
  font: 700 var(--fs-title)/var(--lh-title, 24px) var(--font-ui); color: var(--ink); text-wrap: balance;
}
.csLogNew {
  --tab-bg: var(--green-ink); --tab-ink: #fff;
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csLogText .csProse { padding-left: 0; }

@media (max-width: 560px) {
  .csLog { gap: 32px; }
  .csLogEntry { --lamp: 9px; grid-template-columns: 34px var(--lamp) minmax(0, 1fr); column-gap: 12px; padding-bottom: 26px; }
  .csLogEntry::before { left: calc(34px + 12px + var(--lamp) / 2 - .5px); }
  .csLogDay { font-size: 21px; }
  .csLogTitle { font-size: 18px; }
}

/* ==========================================================================
   ADMIN: every account and its plan, access granted by hand (pages/admin.html)
   ========================================================================== */

.csAdmin { gap: 34px; }
.csAdminHead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.csAdminHead .csAcctTitle { margin: 0; }
.csAdminWho {
  margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2);
}
.csAdminWho:empty { display: none; }
.csAdminWho b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.csAdminOff { margin: 0; padding: 14px 18px; max-width: 72ch; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink); }
.csAdminOff[hidden], .csGrantSec[hidden] { display: none; }

/* The counter bank: dark glass, one cell per state, each cell a key that
   narrows the list to its accounts. A lamp lights when its count isn't 0. */
.csCounters {
  --glass: var(--screen, #151618); --glass-ink: var(--screen-ink, #ededea); --glass-dim: var(--screen-dim, #8f9196);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 6px; background: var(--glass); color: var(--glass-ink);
  border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px #000;
}
.csCounter {
  --lamp: var(--glass-dim);
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-width: 0; padding: 12px 14px 13px; cursor: pointer;
  border: 0; border-radius: var(--r); background: transparent; color: var(--glass-ink);
  font: inherit; text-align: left; -webkit-tap-highlight-color: transparent;
  transition: background-color .12s ease;
}
.csCounter[data-tone="green"] { --lamp: var(--led-green); }
.csCounter[data-tone="blue"] { --lamp: var(--led-blue); }
.csCounter[data-tone="amber"] { --lamp: var(--led-amber); }
.csCounter[data-tone="white"] { --lamp: var(--glass-ink); }
/* Hairlines between cells, drawn on the glass. */
.csCounter + .csCounter::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: rgba(255, 255, 255, .09);
}
.csCounterName {
  display: flex; align-items: center; gap: 7px; max-width: 100%; color: var(--glass-dim);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.csCounterLamp { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #2b2d31; }
.csCounter[data-show="all"] .csCounterLamp { display: none; }
.csCounter[data-lit="true"] .csCounterLamp { background: var(--lamp); box-shadow: 0 0 6px var(--lamp); }
.csCounterNum {
  font: 500 clamp(28px, 3.2vw, 40px)/1 var(--font-legend, var(--font-mono));
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--glass-ink);
}
.csCounter[data-lit="false"] .csCounterNum { color: var(--glass-dim); }
.csCounter:hover { background: rgba(255, 255, 255, .04); }
.csCounter[aria-pressed="true"] { background: rgba(255, 255, 255, .08); box-shadow: inset 0 -2px 0 var(--lamp); }
.csCounter[data-show="all"][aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--glass-ink); }
.csCounter[aria-pressed="true"] .csCounterName { color: var(--glass-ink); }
.csCounter:focus-visible { outline: 2px solid var(--glass-ink); outline-offset: -2px; }
.csCounter[aria-pressed="true"] + .csCounter::before, .csCounter[aria-pressed="true"]::before { opacity: 0; }

/* 01 Grant access: one line of fields and the key. */
.csGrant {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; align-items: end;
  gap: 12px 14px; margin: 0; padding: 18px 20px;
}
.csGrant .input { min-height: 44px; font-size: 16px; }
.csGrant .input[aria-invalid="true"] { border-color: var(--red-ink); }
.csGrantGo.key { min-height: 44px; white-space: nowrap; }
.csGrantFine { grid-column: 1 / -1; margin: 2px 0 0; max-width: 78ch; }
.csGrant .csDone { grid-column: 1 / -1; }
.csLabelSoft {
  margin-left: 4px; font: 500 var(--fs-small)/1 var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--ink-3);
}

/* 02 Everyone: find, then the ruled list. */
.csPeopleTools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 12px; }
.csFind.input { width: min(360px, 100%); min-height: 40px; }
.csPeopleShown {
  margin: 0; color: var(--ink-2);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.csPeople { padding: 2px 20px; }
.csPeopleTable { width: 100%; border-collapse: collapse; }
.csPeopleTable th {
  padding: 12px 18px 10px 0; text-align: left; vertical-align: bottom; color: var(--ink-2);
  border-bottom: 1px solid var(--rule-2); white-space: nowrap;
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csPeopleTable td { padding: 14px 18px 14px 0; vertical-align: top; border-top: 1px solid var(--rule); }
.csPeopleTable tbody tr:first-child td { border-top: 0; }
.csPeopleTable :is(th, td):last-child { padding-right: 0; text-align: right; }
.csPeopleTable th:first-child { width: 42%; }
.csPeopleTable th:nth-child(2) { width: 34%; }
/* Room for the armed key ("Press again to remove"), so arming it moves nothing. */
.csPeopleTable th:last-child { width: 210px; }
.csWhoLine { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.csWhoEmail { min-width: 0; overflow-wrap: anywhere; font: 600 var(--fs-body)/22px var(--font-ui); color: var(--ink); }
.csCellNote { margin: 4px 0 0; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); overflow-wrap: anywhere; }
.csPlanCell .csTag { vertical-align: top; }
.csGrantNoteText { color: var(--ink); }
.csStudied { white-space: nowrap; font-size: var(--fs-small); line-height: 22px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.csAct .key { white-space: nowrap; }
.csPeopleEmpty { margin: 0; padding: 30px 0; text-align: center; font-size: var(--fs-small); color: var(--ink-2); }
.csPeopleEmpty[hidden] { display: none; }
.csPeopleSec > .csDone { margin-top: 10px; }

/* Tags only this page wears: an admin's (CardiSim's red pilot) and access
   granted by hand (a plain cap, its lamp solid ink). */
.csTag[data-tone="admin"] { border-color: var(--red-edge); background: var(--red-wash); color: var(--red-ink); }
.csTag[data-tone="admin"] .led { background: var(--led-red); box-shadow: var(--lens); }
.csTag[data-tone="grant"] { border-color: var(--rule-2); background: var(--cap); color: var(--ink); }
.csTag[data-tone="grant"] .led { background: var(--ink); box-shadow: none; }

@media (max-width: 860px) {
  .csCounters { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 4px; }
  .csCounter:nth-child(3n + 1)::before { display: none; }
}
@media (max-width: 720px) {
  .csAdmin { gap: 28px; }
  .csGrant { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .csGrantGo.key { justify-self: start; }
  .csPeople { padding: 0 16px; }
  /* A phone reads each account as a card: the address across the top, the
     plan and last study under it, the key at the right. */
  .csPeopleTable thead { display: none; }
  .csPeopleTable, .csPeopleTable tbody { display: block; }
  .csPeopleTable tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px;
    padding: 14px 0; border-top: 1px solid var(--rule);
  }
  .csPeopleTable tbody tr:first-child { border-top: 0; }
  .csPeopleTable td, .csPeopleTable tbody tr:first-child td { display: block; padding: 0; border: 0; text-align: left; }
  .csPeopleTable td.csWho { grid-column: 1 / -1; margin-bottom: 10px; }
  .csPeopleTable td.csPlanCell { grid-column: 1; }
  .csPeopleTable td.csStudied { grid-column: 1; margin-top: 4px; line-height: var(--lh-small, 20px); }
  .csStudied::before {
    content: "Last studied"; margin-right: 8px; color: var(--ink-3);
    font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
    letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
  }
  .csPeopleTable td.csAct { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
  .csAct:empty { display: none; }
}
@media (max-width: 480px) {
  .csCounters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .csCounter:nth-child(3n + 1)::before { display: block; }
  .csCounter:nth-child(odd)::before { display: none; }
  .csCounter { padding: 10px 12px 11px; gap: 8px; }
}

/* ==========================================================================
   BUG REPORTS: the learner's form and Report keys (static/bug-report.js),
   the admin's reports (pages/admin-bugs.html, static/admin-bugs.js)
   ========================================================================== */

/* ── The keys that carry the bug glyph (nerd.css draws it) ──────────── */
.csReportKey.key, .csFootReport.key { gap: 6px; }
.csFootReport.key { align-self: center; color: var(--ink-2); }
/* In a study mode's bar on a phone, the key keeps its glyph and drops its word. */
@media (max-width: 640px) {
  .csReportKey.key { padding: 0 10px; }
  .csReportKeyName { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ── The admin key's lamp: reports wait ──────────────────────────────── */
.csAdminKey.key { gap: 8px; }
.csKeyCount {
  display: inline-flex; align-items: center; gap: 5px; color: var(--amber-ink);
  font: 600 var(--fs-legend)/1 var(--font-legend, var(--font-mono)); font-variant-numeric: tabular-nums;
}
.csKeyCount .led { width: 6px; height: 6px; background: var(--led-amber); box-shadow: var(--lens); }

/* ── The form: one card over a scrim ─────────────────────────────────── */
.csBugSheet {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(28, 28, 30, .46);
}
.csBugSheet[hidden] { display: none; }
.csBugCard {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; margin: auto;
  box-shadow: var(--plate-shadow), 0 22px 60px rgba(0, 0, 0, .3);
}
.csBugSheetHead {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 20px 16px; border-bottom: 1px solid var(--rule);
}
.csBugSheetHeadText { min-width: 0; }
.csBugKicker {
  margin: 0 0 8px; display: flex; align-items: center; gap: 8px; color: var(--ink-2);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csBugKicker .led { width: 7px; height: 7px; background: var(--pilot, var(--led-red)); box-shadow: var(--lens); }
.csBugTitle { margin: 0; font: 800 28px/1.05 var(--font-ui); letter-spacing: -.025em; color: var(--ink); outline: none; }
.csBugWhere { margin: 8px 0 0; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); overflow-wrap: anywhere; }
.csBugWhere:empty { display: none; }
.csBugX.key { flex: none; width: 36px; padding: 0; font-size: 14px; }

.csBugForm { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 20px; }
.csBugForm[hidden], .csBugSent[hidden] { display: none; }
.csBugForm .input { font-size: 16px; }
.csBugForm textarea.input { min-height: 0; line-height: 1.45; resize: vertical; }
.csBugForm .input[aria-invalid="true"] { border-color: var(--red-ink); }

/* What kind: four keys with lamps, one lit. */
.csBugKinds { margin: 0; padding: 0; border: 0; min-width: 0; }
.csBugKinds legend { padding: 0; margin: 0 0 8px; }
.csBugKindGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.csBugKind {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--cap); color: var(--ink);
  box-shadow: var(--key-shadow); cursor: pointer; -webkit-tap-highlight-color: transparent;
  font: 600 var(--fs-small)/1.25 var(--font-ui);
  transition: var(--key-transition);
}
.csBugKind input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.csBugKind .led { width: 8px; height: 8px; background: transparent; box-shadow: var(--lens-off); }
.csBugKind:active { transform: translateY(2px); box-shadow: var(--key-shadow-press); }
.csBugKind:has(input:checked) { border-color: var(--blue-edge); background: var(--blue-wash); color: var(--blue-ink); }
.csBugKind:has(input:checked) .led { background: var(--led-blue); box-shadow: var(--lens); }
.csBugKind:has(input:focus-visible) { box-shadow: var(--key-shadow), var(--focus); }
@media (hover: hover) and (pointer: fine) {
  .csBugKind:hover:not(:has(input:checked)) { border-color: var(--ink-2); box-shadow: var(--key-shadow-hover); }
}
.csBugKinds[aria-invalid="true"] .csBugKind { border-color: var(--red-ink); }

/* The monitor picture: a check, its words, and the strip under them. */
.csBugShotPick {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "box say" "pic pic";
  gap: 10px 10px; align-items: start; padding: 12px;
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--chassis-2); cursor: pointer;
}
.csBugShotPick[hidden] { display: none; }
.csBugShotPick input { grid-area: box; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue-ink); cursor: pointer; }
.csBugShotSay { grid-area: say; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.csBugShotName { font: 600 var(--fs-small)/var(--lh-small, 20px) var(--font-ui); color: var(--ink); }
.csBugShotFine { font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); }
.csBugThumb {
  grid-area: pic; display: block; width: 100%; height: auto;
  border-radius: var(--r-sm); background: #06090c; box-shadow: inset 0 0 0 1px #000;
}
.csBugShotPick:has(input:not(:checked)) .csBugThumb { opacity: .3; filter: grayscale(1); }

.csBugSheetFoot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  padding-top: 16px; border-top: 1px solid var(--rule);
}
.csBugSheetFine.csFine { margin: 0; max-width: 34ch; }
.csBugSheetKeys { display: flex; gap: 10px; margin-left: auto; }

.csBugSent { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 26px 20px 22px; }
.csBugSentNo {
  margin: 0; display: flex; align-items: center; gap: 8px; color: var(--green-ink); outline: none;
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csBugSentNo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--led-green); box-shadow: var(--lens); }
.csBugSentSay { margin: 0 0 10px; max-width: 40ch; font-size: 17px; line-height: 1.45; color: var(--ink); }

@media (max-width: 560px) {
  .csBugSheet { padding: 10px; align-items: flex-end; }
  .csBugCard { max-height: calc(100dvh - 20px); }
  .csBugSheetHead { padding: 16px 16px 14px; }
  .csBugTitle { font-size: 24px; }
  .csBugForm { padding: 16px; gap: 16px; }
  .csBugSheetKeys { width: 100%; }
  .csBugSheetKeys .key { flex: 1; }
}
@media (max-width: 360px) { .csBugKindGrid { grid-template-columns: minmax(0, 1fr); } }

/* ── The admin pages' switch: Accounts and Reported bugs ─────────────── */
.csAdminModes {
  align-self: flex-start; margin-top: calc(18px - var(--page-gap));
  display: inline-flex; gap: 3px; padding: 3px; max-width: 100%;
  border-radius: var(--r-lg); background: var(--chassis-2); box-shadow: inset 0 0 0 1px var(--rule);
}
.csAdminMode {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px 0 13px;
  border: 1px solid transparent; border-radius: var(--r); color: var(--ink-2); text-decoration: none; white-space: nowrap;
  font: 600 var(--fs-small)/1 var(--font-ui); -webkit-tap-highlight-color: transparent;
}
.csAdminModeLamp { width: 7px; height: 7px; flex: none; border-radius: 50%; background: transparent; box-shadow: var(--lens-off); }
.csAdminModeGlyph { flex: none; }
.csAdminModeShort { display: none; }
@media (hover: hover) { .csAdminMode:hover { color: var(--ink); } }
.csAdminMode:active:not([aria-current="page"]) { transform: translateY(1px); }
.csAdminMode[aria-current="page"] { background: var(--cap); color: var(--ink); border-color: var(--rule-2); box-shadow: var(--key-shadow); }
.csAdminMode[aria-current="page"] .csAdminModeLamp { background: var(--led-blue); box-shadow: var(--lens); }
.csAdminMode:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); }
.csAdminMode[aria-current="page"]:focus-visible { box-shadow: var(--key-shadow), var(--focus); }
.csAdminModeCount {
  display: inline-flex; align-items: center; gap: 5px; min-height: 20px; padding: 0 6px;
  border: 1px solid var(--amber-edge); border-radius: var(--r-sm); background: var(--amber-wash); color: var(--amber-ink);
  font: 600 var(--fs-legend)/1 var(--font-legend, var(--font-mono)); letter-spacing: var(--tr-legend, .06em);
  text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.csAdminModeCount::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--led-amber); box-shadow: var(--lens); }
/* A phone: three equal keys across the page, the glyph over its name, the
   lamp in the key's corner, and the open count a badge at the glyph's
   shoulder (its word is still read out). Nothing wraps. */
@media (max-width: 720px) {
  .csAdminModes { align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: calc(14px - var(--page-gap)); }
  .csAdminMode { flex-direction: column; justify-content: center; gap: 7px; min-height: 62px; padding: 10px 4px 9px; font-size: 13px; }
  .csAdminModeLamp { position: absolute; top: 7px; left: 8px; width: 6px; height: 6px; }
  .csAdminModeName { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .csAdminModeCount {
    position: absolute; top: 6px; left: calc(50% + 7px); justify-content: center;
    min-width: 18px; min-height: 18px; padding: 0 5px; border-radius: 9px; letter-spacing: 0;
    background: var(--led-amber); border-color: var(--amber-edge); color: var(--ink);
  }
  .csAdminModeCount::before { content: none; }
  .csAdminModeCountWord { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 359px) {
  .csAdminModeLong { display: none; }
  .csAdminModeShort { display: inline; }
}

/* ── The reports ─────────────────────────────────────────────────────── */
.csCounters--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .csCounters--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .csCounters--4 .csCounter:nth-child(3n + 1):not(:first-child)::before { display: block; }
}
@media (max-width: 480px) { .csCounters--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.csBugList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.csBug { margin: 0; padding: 0; overflow: hidden; }
.csBugHead {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(150px, 260px) 30px;
  grid-template-areas: "no main meta caret"; gap: 6px 18px; align-items: start;
  width: 100%; margin: 0; padding: 16px 18px; border: 0; border-radius: 0;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .csBugHead:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); } }
.csBugHead:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.csBugNo {
  grid-area: no; padding-top: 3px; white-space: nowrap; color: var(--ink-3);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.csBugMain { grid-area: main; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.csBugLine { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.csBugHead .csBugWhere { margin: 0; font: 600 var(--fs-body)/22px var(--font-ui); color: var(--ink); overflow-wrap: anywhere; }
/* The page it was filed on (ekgsim/ui/page-slug.js), in the mono the slug is typed in. */
.csBugSlug {
  min-width: 0; max-width: 100%; padding: 1px 6px; border: 1px solid var(--rule); border-radius: 4px;
  font: 500 var(--fs-legend)/var(--lh-legend, 16px) var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere;
}
.csBugPageLink { font-family: var(--font-mono); color: var(--ink); text-underline-offset: 3px; overflow-wrap: anywhere; }
.csBugWhat {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); overflow-wrap: anywhere;
}
.csBugMeta {
  grid-area: meta; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0;
  text-align: right; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2);
}
.csBugKindName { font-weight: 600; color: var(--ink); }
.csBugFrom { max-width: 100%; overflow-wrap: anywhere; }
.csBugExtras { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.csBugHas {
  padding: 2px 6px; border: 1px solid var(--rule-2); border-radius: var(--r-sm); background: var(--cap); color: var(--ink-2);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csBugCaret {
  grid-area: caret; display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--cap); color: var(--ink-2);
  font-size: 12px; line-height: 1; box-shadow: var(--key-shadow);
}
.csBug[data-open="true"] .csBugCaret { transform: rotate(180deg); box-shadow: var(--key-shadow-press); }
.csBug[data-status="closed"] .csBugHead .csBugWhere, .csBug[data-status="fixed"] .csBugHead .csBugWhere { color: var(--ink-2); }

.csBugBody { display: flex; flex-direction: column; gap: 22px; padding: 18px 18px 18px calc(18px + 64px + 18px); border-top: 1px solid var(--rule); }
.csBugCols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 36px; }
.csBugWords { min-width: 0; }
.csBugLabel {
  margin: 0 0 6px; color: var(--ink-2);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono));
  letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csBugText { margin: 0 0 18px; max-width: 70ch; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-body); line-height: 1.5; color: var(--ink); }
.csBugShot { margin: 0; }
.csBugShotLink { display: block; border-radius: var(--r); }
.csBugShotLink:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.csBugShot img { display: block; width: 100%; height: auto; border-radius: var(--r); background: #06090c; box-shadow: inset 0 0 0 1px #000; }
.csBugFacts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); align-content: start; min-width: 0; }
.csBugFacts div { display: contents; }
.csBugFacts dt, .csBugFacts dd { padding: 8px 0; border-top: 1px solid var(--rule); }
.csBugFacts div:first-child > * { padding-top: 0; border-top: 0; }
.csBugFacts dt {
  padding-right: 18px; color: var(--ink-2); white-space: nowrap;
  font: 600 var(--fs-legend)/20px var(--font-legend, var(--font-mono)); letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csBugFacts dd { margin: 0; min-width: 0; font-size: var(--fs-small); line-height: 20px; color: var(--ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.csBugNoteList { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.csBugNote { padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--cap); }
.csBugNoteWho {
  margin: 0 0 4px; color: var(--ink-3);
  font: 600 var(--fs-legend)/var(--lh-legend, 16px) var(--font-legend, var(--font-mono)); letter-spacing: var(--tr-legend, .06em); text-transform: uppercase;
}
.csBugNoteText { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink); }
.csBugNoteForm { display: flex; align-items: flex-end; gap: 10px; }
.csBugNoteForm textarea.input { flex: 1; min-height: 0; resize: vertical; line-height: 1.45; }
.csBugNoteForm .key { flex: none; }
.csBugKeys { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--rule); }
.csBugKeysLead { display: flex; flex-wrap: wrap; gap: 10px; }
.csBugsEmpty.plate { padding: 34px 20px; }
.csBugsSec > .csDone { margin-top: 10px; }

@media (max-width: 720px) {
  .csBugHead {
    grid-template-columns: minmax(0, 1fr) 30px; grid-template-areas: "no caret" "main main" "meta meta";
    gap: 8px 12px; padding: 14px 16px;
  }
  .csBugMeta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 12px; text-align: left; }
  .csBugExtras { margin-top: 0; }
  .csBugBody { padding: 16px; }
  .csBugCols { grid-template-columns: minmax(0, 1fr); }
  .csBugNoteForm { flex-direction: column; align-items: stretch; }
  .csBugNoteForm .key { align-self: flex-start; }
}

/* ── Settings (pages/admin-settings.html): the logo's three cuts ───────
   Each beats in its own window on the page's own grey, so it reads as it
   will on the site; `data-mark` on the window picks the cut (mark.css).
   The keys latch: the chosen one's stays down with its lamp lit. Three
   across on a wide page, one to a row under 900 px. */
.csSettings { max-width: 1180px; }
.csHeartLead { margin: 0 0 18px; max-width: 60ch; font-size: var(--fs-body); line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.csHearts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.csHeart { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.csMarkShow {
  display: flex; align-items: flex-end; justify-content: center; min-width: 0;
  padding: 46px 16px 30px; background: var(--chassis); border-bottom: 1px solid var(--rule);
}
.csMarkShow .brand { font: 800 clamp(48px, 5.1vw, 64px)/.8 var(--font-ui); letter-spacing: -.04em; color: var(--ink); }
.csHeartBody { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; }
.csHeartHead { display: flex; align-items: center; gap: 10px; }
.csHeartLetter {
  display: grid; place-items: center; width: 22px; height: 22px; flex: none;
  border: 1px solid var(--rule-2); border-radius: var(--r-sm); color: var(--ink-2);
  font: 600 var(--fs-legend)/1 var(--font-legend, var(--font-mono));
}
.csHeart[data-on="true"] .csHeartLetter { border-color: var(--ink); background: var(--ink); color: var(--plate); }
.csHeartName { margin: 0; font: 700 var(--fs-title)/var(--lh-title, 24px) var(--font-ui); color: var(--ink); }
.csHeartText { margin: 0; max-width: 46ch; font-size: var(--fs-small); line-height: var(--lh-small, 20px); color: var(--ink-2); text-wrap: pretty; }
.csHeartFoot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 10px; }
.csHeartIcons { display: inline-flex; align-items: center; gap: 12px; }
.csHeartIcon { display: block; }
.csHeartIcon--app { border-radius: 9px; box-shadow: 0 0 0 1px var(--rule); }
.csHeartKey.key { min-height: 44px; }
.csHeartKey[aria-pressed="true"]:not([aria-busy="true"]) { transform: translateY(2px); box-shadow: var(--key-shadow-press); cursor: default; }
.csHeartFine { max-width: 72ch; margin-top: 14px; }
.csHeartSec .csDone { margin-top: 8px; }
@media (max-width: 900px) {
  .csHearts { grid-template-columns: minmax(0, 1fr); }
  .csMarkShow .brand { font-size: clamp(48px, 15vw, 80px); }
}
@media (max-width: 720px) {
  .csMarkShow { padding: 40px 12px 26px; }
  .csMarkShow .brand { font-size: clamp(48px, 15vw, 72px); }
  .csHeartBody { padding: 16px; }
}

/* ==========================================================================
   VOICES
   ========================================================================== */

/* Original: the mark is UPPERCASE and wide; the heart sits on its cap I
   (mark.css). */
:root[data-theme="original"] :is(.csMast, .csBar, .csFoot) .brand {
  text-transform: uppercase; letter-spacing: .01em;
}
:root[data-theme="original"] .csMast .brand { font-size: clamp(52px, 6.6vw, 92px); line-height: .9; }
/* The wide uppercase mark needs a smaller floor on the narrowest phones. */
@media (max-width: 480px) {
  :root[data-theme="original"] .csMast .brand { font-size: min(52px, 12.4vw); }
}
:root[data-theme="original"] .csBar .brand { font-size: 26px; }
:root[data-theme="original"] .csFoot .brand { font-size: 17px; }
:root[data-theme="original"] .csIdx { color: var(--ink-2); }

/* Run sheet: one ruled sheet. A heavy rule under the mark, sections that
   open on an ink rule, square cells, flat keys on the tiles. */
:root[data-theme="runsheet"] .csMast { border-bottom-width: 4px; }
:root[data-theme="runsheet"] .csMast .brand { font-size: clamp(84px, 13vw, 168px); line-height: .76; }
:root[data-theme="runsheet"] .csBar { border-bottom-width: 4px; }
:root[data-theme="runsheet"] .csBar .brand { font-size: 44px; line-height: .8; }
:root[data-theme="runsheet"] .csFoot .brand { font-size: 30px; }
:root[data-theme="runsheet"] .csSecRule { height: 2px; background: var(--ink); }
:root[data-theme="runsheet"] .csSecTitle { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; font-size: 30px; letter-spacing: -.01em; }
:root[data-theme="runsheet"] .csTrackCount b { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; font-size: 44px; }
:root[data-theme="runsheet"] .csPriceNum { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; font-size: 120px; letter-spacing: -.02em; }
:root[data-theme="runsheet"] .csPriceCents { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; font-size: 48px; letter-spacing: 0; }
:root[data-theme="runsheet"] .csLead { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; font-size: clamp(30px, 3vw, 40px); line-height: 1; letter-spacing: 0; }
:root[data-theme="runsheet"] .csHome .quizEntry {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  border-top: 1px solid var(--rule-2); padding-inline: 0;
}
:root[data-theme="runsheet"] .csHome .quizEntry:active { transform: none; background: var(--chassis-2); }
:root[data-theme="runsheet"] .csHome #quizStart { --strip-bleed: 0px; }
:root[data-theme="runsheet"] .csHome .quizTileFoot { border: 0; border-top: 1px solid var(--rule); padding-inline: 0; background: transparent; border-radius: 0; }
/* Trainers share hairlines side by side, like the run sheet's own rows. */
:root[data-theme="runsheet"] .csHome .csTrainers { gap: 0; }
:root[data-theme="runsheet"] .csHome .csTrainers .quizEntry { padding-right: 18px; }
:root[data-theme="runsheet"] .csHome .csTrainers .studyTile + .studyTile .quizEntry { padding-left: 18px; border-left: 1px solid var(--rule-2); }
:root[data-theme="runsheet"] .csHome .hlEntry { background: var(--chassis); border: 0; border-top: 1px solid var(--rule-2); border-radius: 0; box-shadow: none; padding-inline: 0; }
@media (max-width: 860px) {
  :root[data-theme="runsheet"] .csHome .csTrainers .studyTile + .studyTile .quizEntry { padding-left: 0; border-left: 0; }
}
@media (max-width: 720px) {
  :root[data-theme="runsheet"] .csMast .brand { font-size: clamp(64px, 21vw, 96px); }
  :root[data-theme="runsheet"] .csSecTitle { font-size: 26px; }
}

/* The account pages on the run sheet: the card is the sheet itself, under a
   heavy rule; titles set condensed and black, like its section heads. */
:root[data-theme="runsheet"] .csAuthCard {
  background: transparent; border: 0; border-top: 4px solid var(--ink); border-radius: 0; box-shadow: none;
}
:root[data-theme="runsheet"] .csAuthStrip { margin-top: 14px; border: 1px solid var(--strip-major); }
:root[data-theme="runsheet"] .csAuthBody { padding: 22px 0 26px; }
:root[data-theme="runsheet"] .csAuthFoot { padding-inline: 0; border-top: 2px solid var(--ink); }
:root[data-theme="runsheet"] :is(.csAuthTitle, .csAcctTitle) {
  font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; letter-spacing: 0; line-height: .95;
}
:root[data-theme="runsheet"] .csAuthTitle { font-size: 40px; }
:root[data-theme="runsheet"] .csAcctTitle { font-size: clamp(44px, 5vw, 60px); }
:root[data-theme="runsheet"] .csAcctName { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; font-size: 26px; line-height: 1; }
:root[data-theme="runsheet"] .csAcctRow { border-top: 2px solid var(--ink); }
:root[data-theme="runsheet"] .csPeople { background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; box-shadow: none; padding-inline: 0; }
/* The bug reports on the run sheet: ruled rows on the sheet, not cards. */
:root[data-theme="runsheet"] .csBugList { gap: 0; border-top: 2px solid var(--ink); }
:root[data-theme="runsheet"] .csBug { background: transparent; border: 0; border-bottom: 1px solid var(--rule-2); border-radius: 0; box-shadow: none; }
:root[data-theme="runsheet"] .csBugHead { padding-inline: 0; }
:root[data-theme="runsheet"] .csBugBody { padding-right: 0; }
:root[data-theme="runsheet"] .csBugsEmpty.plate { background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; box-shadow: none; }
:root[data-theme="runsheet"] .csBugTitle { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; font-size: 34px; letter-spacing: 0; }
@media (max-width: 720px) { :root[data-theme="runsheet"] .csBugBody { padding-inline: 0; } }
:root[data-theme="runsheet"] .csGrant { background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; box-shadow: none; padding-inline: 0; }
:root[data-theme="runsheet"] .csAcctPanel { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
@media (max-width: 520px) {
  :root[data-theme="runsheet"] .csAuthTitle { font-size: 34px; }
}
/* The plan on the run sheet: the status line is a ruled row. */
:root[data-theme="runsheet"] .csPlanLine {
  background: transparent; border: 0; border-radius: 0; border-bottom: 1px solid var(--rule-2); padding-inline: 0;
}
:root[data-theme="runsheet"] .csPlanLine:is([data-tone="joined"], [data-tone="due"]) { padding-inline: 12px; border: 0; }

/* The tour on the run sheet: its titles condensed and black; the channel
   band thins to an edge. */

:root[data-theme="runsheet"] .tourSlide { padding-inline: 0; }
:root[data-theme="runsheet"] .tourSlide::before { height: 3px; box-shadow: none; }
:root[data-theme="runsheet"] :is(.tourTitle, .tourHero) { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; letter-spacing: 0; }
:root[data-theme="runsheet"] .tourTitle { font-size: clamp(38px, 3.6vw, 54px); line-height: .96; }
:root[data-theme="runsheet"] .tourHero { font-size: clamp(56px, 6.6vw, 98px); line-height: .86; }
:root[data-theme="runsheet"] .tourReceiptTotal b { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; font-size: 52px; }

@media (max-width: 1000px) { :root[data-theme="runsheet"] .tourSlide { padding-inline: 0; } }
@media (max-width: 720px) {
  :root[data-theme="runsheet"] .tourTitle { font-size: 36px; }
  :root[data-theme="runsheet"] .tourHero { font-size: clamp(56px, 18vw, 84px); }
}
/* The policies on the run sheet: one ruled sheet, titles condensed and
   black, the summary a ruled block instead of a plate. */
:root[data-theme="runsheet"] .csDocHead { border-bottom: 4px solid var(--ink); }
:root[data-theme="runsheet"] .csDocTitle { font-family: var(--font-cond, var(--font-ui)); font-stretch: 62%; font-weight: 900; letter-spacing: 0; font-size: clamp(44px, 5vw, 64px); line-height: .95; }
:root[data-theme="runsheet"] .csDocShort { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 12px 0 0; border-top: 2px solid var(--ink); }
:root[data-theme="runsheet"] .csDocSecHead { padding-top: 10px; border-top: 2px solid var(--ink); }
:root[data-theme="runsheet"] .csDocToc a { border-top-color: var(--rule-2); }

/* The original: its index takes the legend's ink, not a coloured cap. */
:root[data-theme="original"] .tourHero { letter-spacing: -.03em; }
:root[data-theme="original"] .tourReceiptHead span:first-child { text-transform: uppercase; letter-spacing: .01em; }

/* ── Accessibility ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .csPaperName.is-named, .csTryTour.is-seated, .csVerdictHead.is-fresh { animation: none; }
  .csTear { display: none; }
  .csMeterFill, .csAnswers.is-folding { transition: none; }
}
@media (forced-colors: active) {
  .csMeterFill { forced-color-adjust: none; background: CanvasText; }
  .csDots i, .csAnswer .led, .csTallyLeds .led { forced-color-adjust: none; box-shadow: inset 0 0 0 1.5px CanvasText; }
  .csTallyLeds .led:is(.is-green, .is-red) { background: CanvasText; }
  .csCell:is([data-answers="1"], [data-answers="2"]) .csDots i:nth-child(1),
  .csCell[data-answers="2"] .csDots i:nth-child(2) { background: CanvasText; }
  .csTrackNo { border-left-color: CanvasText; }
  .csPaperName.is-named { box-shadow: none; border: 1px solid CanvasText; }
  .csHome .quizEntry::after { forced-color-adjust: none; box-shadow: inset 0 0 0 1.5px CanvasText; }
  :is(.csNotice, .csFormError)::before, :is(.csSentHead, .csTag) .led { forced-color-adjust: none; background: CanvasText; box-shadow: none; }
  .csNotice, .csTag, .csPlanLine { border-color: CanvasText; }
  .csPlanLineSay .led { forced-color-adjust: none; box-shadow: inset 0 0 0 1.5px CanvasText; background: transparent; }
  .csPwShow[aria-pressed="true"] { border-color: CanvasText; }
  :is(.tourSlide, .tourFilm)::before, .tourNo { forced-color-adjust: none; background: CanvasText; color: Canvas; }
  .tourStop .led { forced-color-adjust: none; box-shadow: inset 0 0 0 1.5px CanvasText; }
  .tourStop[data-state="on"] .led { background: CanvasText; }
  .tourEndLine { forced-color-adjust: none; }
}
