/* =============================================================================
   BLACK SIGNAL — css/components/modal.css
   THE MODAL — one overlay, one panel, for every dialog in the app.

     .bsm-overlay                 fixed scrim; .bsm-is-open / .bsm-is-closing drive the wipe
       .bsm-modal                 the panel: --sm (confirmations), --md (default), --wide (docs)
         .bsm-header              the band (css/components/band.css): .bsm-kicker + .bsm-title
         .bsm-close               a black cell with the accent ✕; the sweep fills it
         .bsm-body                black, ruled sections; .bsm-section-label eyebrows
         .bsm-actions             right-aligned ruled keys (sweep, primary/secondary)
         .bsm-footer              the mono status line (`… // ESC TO CLOSE`)

   The settings panel (#bs-settings-panel) and the auth panel reuse the same
   parts without the overlay. Families that migrated here keep their own ids
   and internal classes; only the shell and header speak this language.
   ============================================================================= */
@layer components {

/* ── Scrim ─────────────────────────────────────────────────────────────── */
.bsm-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-standard);
}
.bsm-overlay.bsm-is-open { opacity: 1; pointer-events: auto; }
.bsm-overlay.bsm-is-closing { opacity: 0; pointer-events: none; }
/* The menu's scrim shares the look; its own .is-open drives it. */
.bs-settings-backdrop { position: fixed; inset: 0; z-index: calc(var(--z-menu) - 1); background: rgba(0, 0, 0, 0.72); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease-standard); }
.bs-settings-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ── Panel ─────────────────────────────────────────────────────────────── */
.bsm-modal {
  position: relative;
  top: auto; left: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  /* Width is set by the size variants below. Legacy sheets also capped
     max-width per breakpoint (520px on tablets, 480px on phones), which
     shrank even the wide docs panels — reset it here so only width rules. */
  max-width: 100%;
  max-height: min(88vh, 100%);
  margin: 0;
  padding: 0;
  background: var(--sig-black);
  color: var(--sig-ink);
  border: 1px solid var(--sig-rule-strong);
  border-radius: 0;
  box-shadow: none;
  clip-path: none;
  overflow: hidden;
}
.bsm-modal--sm   { width: min(440px, 100%); }
.bsm-modal--md   { width: min(640px, 100%); }
.bsm-modal--wide { width: min(960px, 100%); }
/* Two panes: a ruled index column beside the page (the handbook, docs). */
.bsm-modal--split {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: min(1080px, 100%);
  height: min(760px, 92vh);
  max-height: none;
}
.bsm-modal--split > aside { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--sig-rule); }
.bsm-modal--split > section { display: flex; flex-direction: column; min-height: 0; min-width: 0; }

/* The menu panel: the same panel, fixed and centered, its own .is-open. */
.bs-settings-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  width: min(900px, 96vw);
  max-height: 90vh;
  padding: 0;
  background: var(--sig-black);
  color: var(--sig-ink);
  border: 1px solid var(--sig-rule-strong);
  border-radius: 0;
  box-shadow: none;
  clip-path: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease-standard), transform var(--dur) var(--ease-sharp);
}
.bs-settings-panel.is-open { opacity: 1; pointer-events: auto; }
/* Closed: out of the tab order and the accessibility tree, not just invisible. */
.bs-settings-panel:not(.is-open):not(.is-closing) { visibility: hidden; }
.bs-settings-panel.is-closing { opacity: 0; transform: translate(-50%, -50%) translateY(-6px); pointer-events: none; }
.bs-settings-panel > .stt-header { clip-path: none; }

/* The modal's open/close wipe (left → right in, up out) */
.bsm-overlay .bsm-modal {
  clip-path: inset(0 100% 0 0);
  opacity: 0;
  transform: translateY(8px);
  transition:
    clip-path var(--dur-slow) var(--thf-ease-wipe),
    transform var(--dur-slow) var(--ease-sharp),
    opacity var(--dur) var(--ease-standard);
  pointer-events: none;
}
.bsm-overlay.bsm-is-open .bsm-modal { clip-path: inset(0 0 0 0); opacity: 1; transform: none; pointer-events: auto; }
.bsm-overlay.bsm-is-closing .bsm-modal { clip-path: inset(0 0 100% 0); opacity: 0; transform: translateY(-6px); pointer-events: none; }

/* The handoff panel (app/02-welcome.js, app/08-auth-input.js): the same
   panel, revealed by its own left→right wipe while the lines type in. */
.thf-overlay .bsm-modal { clip-path: inset(0 100% 0 0); transition: clip-path var(--thf-overlay-dur) var(--thf-ease-sharp); }
.thf-overlay.thf-overlay--visible .bsm-modal { clip-path: inset(0 0 0 0); }
.thf-overlay .bsm-modal::before { content: none; }
.thf-overlay .bsm-body { min-height: 180px; }
.thf-overlay .bsm-footer { gap: 16px; }
.thf-overlay .thf-footer-bar { flex: 1 1 auto; height: 1px; background: var(--sig-rule); opacity: 1; }

/* ── Header: the band, with the close key at the right ─────────────────── */
.bsm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 18px;
  flex-shrink: 0;
}
.bsm-header-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bsm-close {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1;
  clip-path: none;
  --sweep-fill: var(--orange);
  --sweep-ink: var(--accent-on-accent);
  background-color: var(--orange);
  color: var(--accent-on-accent);
  border: 1px solid var(--orange);
}
/* The cell is the active theme color with a black ✕, and stays that way on hover
   (the fill and ink match the rest colors, so nothing changes color). The band
   makes every header sweep fill dark (.bsm-header .bs-sweep, 0,2,0), so these are
   re-set at matching specificity here and win by load order. The only hover
   effect is the spin: the ✕ turns one smooth full turn and lands back where it
   started. */
.bsm-close.bs-sweep {
  background-color: var(--orange);
  color: var(--accent-on-accent);
  border-color: var(--orange);
  --sweep-fill: var(--orange);
  --sweep-ink: var(--accent-on-accent);
}
@keyframes bsm-x-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .bsm-close:not(:disabled):not([aria-disabled="true"]):hover { animation: bsm-x-spin 0.55s var(--ease-sharp, ease-in-out); }
}
@media (prefers-reduced-motion: reduce) {
  .bsm-close:hover { animation: none; }
}

/* ── One behavior for every close (✕) button ───────────────────────────────
   Earlier sheets gave some close buttons a visible border (a hairline, a black
   edge, or a 40%-orange outline on .shm-close/.bsh-close/.bs-lvl-overlay-close)
   and only .bsm-close ever span on hover. Unify the whole family: no visible
   border, and one hover rule — the ✕ makes a single smooth 360° turn and lands
   back where it started. border-color:transparent (not border:0) keeps the box
   the same size, so nothing shifts. */
.bsm-close, .shm-close, .bsh-close, .bs-lvl-overlay-close,
.bs-plan-close, .bs-vm-close, .bs-lab-tut-close {
  border-color: transparent !important;
}
@media (hover: hover) and (pointer: fine) {
  :is(.bsm-close, .shm-close, .bsh-close, .bs-lvl-overlay-close,
      .bs-plan-close, .bs-vm-close, .bs-lab-tut-close):not(:disabled):not([aria-disabled="true"]):hover {
    animation: bsm-x-spin 0.55s var(--ease-sharp, ease-in-out);
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(.bsm-close, .shm-close, .bsh-close, .bs-lvl-overlay-close,
      .bs-plan-close, .bs-vm-close, .bs-lab-tut-close):hover { animation: none; }
}

/* ── Body ──────────────────────────────────────────────────────────────── */
.bsm-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px 22px;
  background: var(--sig-black);
}
.bsm-body--docs { padding: 0; gap: 0; }
.bsm-section { display: flex; flex-direction: column; gap: 10px; }
.bsm-section-label {
  font-family: var(--sig-mono);
  font-weight: 500;
  font-size: var(--sig-eyebrow-size);
  letter-spacing: var(--sig-eyebrow-track);
  text-transform: uppercase;
  color: var(--orange);
  opacity: 1;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sig-rule);
}
.bsm-divider { height: 0; border-top: 1px solid var(--sig-rule); opacity: 1; }
.bsm-copy, .bsm-body p { font-family: var(--font-body); font-size: var(--sig-body-size); line-height: 1.55; color: var(--sig-ink); max-width: var(--sig-measure); margin: 0; }
.bsm-note { font-family: var(--sig-mono); font-size: 12px; line-height: 1.6; color: var(--sig-ink-dim); }

/* Ruled key groups inside a modal (menu navigation, confirmations) */
.bsm-nav-group, .bsm-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--sig-rule);
  border-left: 1px solid var(--sig-rule);
}
.bsm-actions { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); justify-content: end; }
.bsm-nav-btn, .bsm-actions .bs-key, .bsm-actions > button {
  height: 44px;
  padding: 0 14px;
  border-width: 0 1px 1px 0;
  clip-path: none;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--orange);
}
/* A nav button holds a label and sometimes a trailing value (e.g. the current
   language). Lay them out so neither can bleed outside the button: the button
   grows vertically if a long label needs to wrap, and the trailing value
   truncates with an ellipsis instead of overflowing. */
.bsm-nav-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: auto; min-height: 44px; padding-top: 7px; padding-bottom: 7px;
  text-align: left; overflow: hidden;
}
/* A nav group is a 4-column grid; a lone button (e.g. "Change language", the
   Command Center preview) must span the full row, or its label is squeezed into
   a quarter-width cell and bleeds out. */
.bsm-nav-group > .bsm-nav-btn:only-child { grid-column: 1 / -1; }
/* Label takes the available width (wrapping only at word boundaries, never
   mid-word); a trailing value shrinks and truncates so nothing bleeds out. */
.bsm-nav-btn > span:first-child { flex: 1 1 auto; min-width: 0; }
.bsm-lang-current {
  flex: 0 1 auto; min-width: 0; max-width: 50%;
  font-family: var(--sig-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.03em; text-transform: none;
  color: var(--orange-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Stacked action list (the tour "core complete" overlay's four choices).
   A single full-width column of ruled keys instead of an uneven 3+1 grid.
   Two classes outrank the .bsm-actions grid rules regardless of source order. */
.bsm-actions.bsh-invite-actions--stack {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  justify-content: stretch;
  margin-top: 22px;
}
.bsm-actions.bsh-invite-actions--stack > .bsh-btn-block {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Pomodoro mode keys: a ruled 3-up grid, not one squeezed row. The OFF key
   spans the full width on its own row as the distinct "stop" action. Overrides
   .bsm-nav-group's single-row column flow (same layer, later source order). */
.pomo-btn-grid {
  grid-auto-flow: row;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}
/* Mode keys hold a single centered label (no trailing value), so override the
   .bsm-nav-btn left-aligned space-between layout and center the text in each. */
.pomo-btn-grid .pomo-mode-btn { height: 56px; font-size: 13.5px; letter-spacing: 0.12em; justify-content: center; text-align: center; }
.pomo-btn-grid .pomo-off-btn { grid-column: 1 / -1; }
/* The Ignore→confirm dialog's two choices (NO / YES) sit side by side, never
   stacked. The default .bsm-actions auto-fit needs 140px per column, which the
   small confirm modal can't give two of, so it collapsed to one column. */
.bsm-actions.pomo-confirm-actions { grid-template-columns: 1fr 1fr; }

/* ── The menu's own parts ──────────────────────────────────────────────── */
/* Theme swatches: black cells with a color chip and the name. The sweep
   fills each one in its own color (--sweep-fill is set inline from the
   theme); the chosen theme is held. */
.bsm-swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--sig-rule);
  border-left: 1px solid var(--sig-rule);
}
.bsm-swatch {
  position: relative;
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  height: 52px; padding: 0 14px;
  border-width: 0 1px 1px 0; border-color: var(--sig-rule);
  color: var(--sig-ink);
  clip-path: none;
  outline-offset: -2px;
  overflow: hidden;
  text-align: left;
}
.bsm-swatch-chip { width: 12px; height: 12px; flex: 0 0 auto; background: var(--sw, var(--orange)); }
.bsm-swatch-name {
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.1;
  text-align: left; text-shadow: none; color: inherit; max-width: none;
}
/* Phone/tablet: four columns clip the longer names ("GHOST PROTOCOL",
   "CLASSIFIED"). Give each swatch more room so the name reads in full. */
@media (max-width: 760px) {
  .bsm-swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .bsm-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bsm-swatch { padding: 0 12px; }
}

/* Level up: the band carries the big 1 → 2 in the accent's ink. */
.bs-levelup-overlay .bs-levelup-panel { clip-path: none; }
.bs-levelup-overlay .bs-levelup-panel::before, .bs-levelup-corner, .bs-levelup-scanlines { display: none; }
.bs-levelup-header .bs-levelup-level-row {
  justify-content: flex-start; gap: 14px; width: auto;
  padding: 6px 0 0; border: 0; clip-path: none; background: transparent; overflow: visible;
}
.bs-levelup-header .bs-levelup-level-row::after { content: none; }
.bs-levelup-header .bs-levelup-num {
  font-family: var(--font-display); font-weight: 900; font-size: 88px; line-height: 0.86; letter-spacing: -0.02em;
  color: var(--accent-on-accent); filter: none;
}
.bs-levelup-header .bs-levelup-num--from { opacity: 0.4; animation: none; }
.bs-levelup-header .bs-levelup-num--to { opacity: 1; }
.bs-levelup-header .bs-levelup-arrow { font-size: 40px; color: var(--accent-on-accent); opacity: 0.6; animation: none; }
.bs-levelup-body { align-items: flex-start; padding: 20px 22px 22px; gap: 12px; }
.bs-levelup-xp-val { font-family: var(--font-display); font-weight: 900; font-size: 34px; color: var(--orange); }
.bs-levelup-xp-label { font-family: var(--sig-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--sig-ink-dim); }
.bs-levelup-msg { font-family: var(--sig-mono); font-size: 12px; letter-spacing: 0.08em; color: var(--sig-ink-dim); }
.bs-levelup-msg::before { color: var(--orange); }
.bs-levelup-footer { border-top: 0; align-self: stretch; }
.bs-levelup-dismiss { opacity: 1; animation: none; }
@media (prefers-reduced-motion: reduce) { .bs-levelup-header .bs-levelup-num--to, .bs-levelup-xp, .bs-levelup-msg { animation: none; opacity: 1; } }

/* Header tools (keys that sit in the band beside the close key) */
.bsm-header { height: auto; min-height: 0; box-shadow: none; }
.bsm-header .bs-band-tools + .bsm-close { margin-left: 8px; }
.bsm-header .bs-band-tools { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 1 auto; }
.mjg-count-badge { background: var(--accent-on-accent); color: var(--orange); clip-path: none; height: 30px; font-family: var(--font-display); font-weight: 900; }
.mjg-header-actions .bs-key { height: 40px; }
@media (max-width: 599px) {
  .bsm-header:has(.bs-band-tools) { flex-wrap: wrap; position: relative; }
  .bsh-foot .bsh-tour-btn--foot, .bsh-foot .bsh-hint { display: none; }
  .bsm-header:has(.bs-band-tools) .bsm-header-left { flex: 1 1 0; }
  .bsm-header .bs-band-tools { order: 3; flex: 1 1 100%; justify-content: flex-start; }
}
/* The split panel on narrow screens: the page and its band first, the index under it. */
@media (max-width: 760px) {
  .bsm-modal--split > section { order: 1; }
  .bsm-modal--split > aside { order: 2; border-bottom: 0; border-top: 1px solid var(--sig-rule); max-height: 30%; }
  .bsm-modal--split { grid-template-rows: minmax(0, 1fr) auto; }
}

/* Graveyard: tally labels as eyebrows; filter/sort keys are tabs (tabs.css) */
.mjg-tally-lbl { font-family: var(--font-display); font-weight: 600; font-size: 10.5px; letter-spacing: var(--sig-eyebrow-track); color: var(--sig-ink-dim); }
.mjg-tally-val { font-family: var(--font-display); font-weight: 900; color: var(--orange); }
.mjg-empty-title { font-family: var(--font-display); font-weight: 900; font-size: 28px; letter-spacing: 0; color: var(--sig-ink); }
.mjg-empty-sub, .mjg-empty-copy { color: var(--sig-ink-dim); }
.mjg-course-tab, .mjg-filter-btn, .mjg-sort-btn { height: 32px; padding: 0 12px; font-size: 11px; color: var(--orange); border: 1px solid var(--sig-rule); clip-path: none; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.bsm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  border-top: 1px solid var(--sig-rule);
  flex-shrink: 0;
  font-family: var(--sig-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sig-ink-dim);
}

/* ── Narrow: the split panel stacks ────────────────────────────────────── */
@media (max-width: 760px) {
  .bsm-modal--split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: min(92vh, 100%); }
  .bsm-modal--split > aside { border-right: 0; border-bottom: 1px solid var(--sig-rule); max-height: 34%; }
}
/* ── Phones ────────────────────────────────────────────────────────────── */
@media (max-width: 599px) {
  .bsm-overlay { padding: 0; align-items: stretch; }
  /* A full-bleed sheet. max-width must be reset too: a legacy phone rule caps
     every modal at min(480px, 100vw - 32px), which left a strip of the page
     showing down both sides. */
  .bsm-modal { width: 100%; max-width: none; max-height: none; border-width: 0; }
  .bsm-modal--split { height: 100%; }
  /* Short dialogs (confirmations) rise from the bottom instead of covering
     the whole screen for two buttons. */
  .bsm-overlay:has(> .bsm-modal--sm) { align-items: flex-end; }
  .bsm-modal--sm { max-height: 88dvh; border-top: 1px solid var(--sig-rule-strong); }
  .bs-settings-panel { width: 100vw; max-height: 100dvh; border-width: 0; }
  /* Clear the notch / status bar and the home indicator. */
  .bsm-header { padding: max(16px, env(safe-area-inset-top, 0px)) 16px 14px; }
  .bsm-modal--sm .bsm-header { padding-top: 16px; }
  .bsm-body { padding: 16px 16px max(18px, env(safe-area-inset-bottom, 0px)); }
  .bsm-footer { padding: 10px 16px max(10px, env(safe-area-inset-bottom, 0px)); }
  /* A footer that is only the status line ("… // ESC TO CLOSE") is noise on a
     touch screen; footers that carry controls stay. */
  .bsm-footer:not(:has(button, a, input, select, [role="button"])) { display: none; }
}
/* Touch screens of any width: "ESC TO CLOSE" means nothing without a keyboard. */
@media (hover: none) and (pointer: coarse) {
  .bsm-footer:not(:has(button, a, input, select, [role="button"])) { display: none; }
}
/* Short screens (a phone turned sideways): the panel uses the full height
   instead of floating as a small inset box. */
@media (max-height: 500px) {
  .bsm-overlay { padding: 0; align-items: stretch; }
  .bsm-modal { max-height: none; border-top-width: 0; border-bottom-width: 0; }
  .bsm-header { padding-top: 12px; padding-bottom: 12px; }
}


/* ── Answer review (quiz feedback): every answer, its verdict, its reason ── */
.sfm-question p { font-size: 18px; line-height: 1.5; color: var(--sig-ink); margin: 0; max-width: 75ch; }
.sfm-answers-note { margin: 0 0 10px; font-size: 15px; color: var(--sig-ink-dim); }
.sfm-answers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sfm-answer {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 14px 0; border-top: 1px solid var(--sig-rule);
}
.sfm-answer:first-child { border-top: 0; padding-top: 4px; }
.sfm-answer-letter {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--sig-rule-strong);
  font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--sig-ink-dim);
}
.sfm-answer-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sfm-answer-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.sfm-answer-text { font-family: var(--font-body); font-weight: 600; font-size: 18px; line-height: 1.4; color: var(--sig-ink); }
.sfm-answer-tag {
  font-family: var(--sig-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 7px; border: 1px solid currentColor; color: var(--sig-ink-dim); white-space: nowrap;
}
.sfm-answer-why { margin: 0; font-family: var(--font-body); font-size: 15.5px; line-height: 1.55; color: var(--sig-ink-dim); max-width: 80ch; }
/* The correct answer: accent letter block and tag. */
.sfm-answer.is-correct .sfm-answer-letter { background: var(--orange); border-color: var(--orange); color: var(--accent-on-accent); }
.sfm-answer.is-correct .sfm-answer-tag { color: var(--orange); }
.sfm-answer.is-correct .sfm-answer-why { color: var(--sig-ink); }
/* Your wrong pick: the alert colors. */
.sfm-answer.is-picked-wrong .sfm-answer-letter { border-color: var(--sig-alert-rule); color: var(--sig-alert-ink); background: var(--sig-alert-bg); }
.sfm-answer.is-picked-wrong .sfm-answer-tag { color: var(--sig-alert-ink); }
@media (max-width: 599px) {
  .sfm-answer { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .sfm-answer-letter { width: 34px; height: 34px; font-size: 19px; }
  .sfm-answer-text, .sfm-question p { font-size: 16px; }
  .sfm-answer-why { font-size: 14.5px; }
}

/* The feedback scrim covers the whole screen at every size (legacy sheets
   sized it to 96vw × 88dvh, which let the page show underneath on phones). */
.sec-feedback-module-overlay.bsm-overlay { width: auto; max-height: none; overflow: hidden; }
.sec-feedback-module-modal { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.sec-feedback-module-modal .sec-feedback-module-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
/* The answer list marks your answer and the correct one, and the title gives
   the result, so the three summary cards would only repeat it. */
.sec-feedback-module-grid { display: none; }
@media (max-width: 599px) {
  .sec-feedback-module-modal { height: 100dvh; max-height: 100dvh; }
  .sec-feedback-module-actions--confidence { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; }
  .sfm-confidence-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .sfm-confidence-btns .sec-feedback-module-btn { width: auto; min-height: 44px; padding: 0 6px; }
  .sec-feedback-module-modal .bsm-footer { display: none; }
}

}
