/* The question header and the requirement bands (markup from sd-reqs.js).
   Uses the tokens and [data-hue] mapping in sd.css; defines no tokens. */

/* The rupee sign. Mukta's latin files have no U+20B9, so "₹" fell back to system-ui in another face.
   These files hold that one glyph, cut from Mukta's devanagari files; a page without ₹ never loads them. */
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-rupee-400-normal.woff2") format("woff2"); font-weight: 300 500; font-style: normal; font-display: swap; unicode-range: U+20B9; }
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-rupee-700-normal.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; unicode-range: U+20B9; }
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-rupee-800-normal.woff2") format("woff2"); font-weight: 800 900; font-style: normal; font-display: swap; unicode-range: U+20B9; }

/* ---------- small action buttons: the header slot and the list-page hero ---------- */
.sd-rq-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.sd-rq-actions[hidden] { display: none; }
.sd-rq-reset { display: contents; }
.sd-rq-btn, [data-sd-actions] .sd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  font: 700 1rem/1.2 var(--font-body); border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1.5px solid var(--rule); background: var(--paper); color: var(--text);
  transition: border-color .15s var(--ease), background-color .15s var(--ease), transform .1s var(--ease);
}
.sd-rq-btn:hover, [data-sd-actions] .sd-btn:hover { border-color: var(--text); }
.sd-rq-btn:active, [data-sd-actions] .sd-btn:active { transform: scale(.97); }
.sd-rq-btn-danger { color: var(--sd-rose-ink); border-color: color-mix(in srgb, var(--sd-rose-ink) 55%, var(--paper)); }
.sd-rq-btn-danger:hover { border-color: var(--sd-rose-ink); background: var(--sd-rose-bg); }
.sd-rq-btn-danger-solid { background: var(--sd-rose-fill); color: var(--sd-rose-on); border-color: var(--sd-rose-fill); }
.sd-rq-btn-danger-solid:hover { border-color: var(--sd-rose-fill); }
.sd-rq-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; animation: sd-fade .2s linear; }
.sd-rq-confirm-q { font-weight: 700; }
.sd-rq-flash:empty { display: none; }
.sd-rq-flash { margin: 12px 0 0; font-weight: 700; }

/* ---------- the question header: the title only; the actions are in the top bar ---------- */
/* Round 5, point 7 (2026-11-20): the title was 76.8px under a 44px gap at 1440. It is a page title, not a poster:
   40px at 1440, 28px on phones, and the gap above it is ~20px. It stays bigger than the level prompt (sd.css). */
.sd-rq-head { padding: clamp(14px, 1.4vw, 20px) var(--gut) clamp(16px, 1.8vw, 24px); }
.sd-rq-head h1 { margin: 0; font-size: clamp(1.75rem, 2.8vw, 2.5rem); line-height: 1.1; letter-spacing: -0.02em; }
/* "Not part of this question: A · B · C", small and quiet under the title (the frontend hero's line) */
.sd-rq-head.has-out { padding-bottom: clamp(14px, 1.6vw, 22px); }
.sd-rq-outline { margin: 12px 0 0; color: var(--text-muted); font-size: 1.05rem; line-height: 1.5; }
.sd-rq-outline-l { font-weight: 700; color: var(--sd-rose-ink); margin-right: .2em; }

/* ---------- requirement sections: each one a colour band, then paper ---------- */
.sd-rq-sec { padding-bottom: 34px; }
.sd-rq-sec > :not(.sd-rq-h) { margin-inline: var(--gut); }
.sd-rq-h {
  margin: 0 0 22px; padding: 20px var(--gut) 18px; background: var(--sd-h-fill); color: var(--sd-h-on);
  font-size: clamp(2rem, 2.8vw, 2.5rem); line-height: 1.08;
}
/* THE TYPE SCALE HOLDS ITS RATIOS AT EVERY WIDTH (review 2026-11-19). The old vw clamps bottomed out at
   different widths, so at 1024 the group heading (20.8px), headline (20px) and detail (18px) were nearly
   one size. Floors are now set from the detail upward: headline >= 1.2x detail, group heading >= 1.25x
   headline, intro headline >= 1.3x its detail. Measured 1440 / 1024 / 390:
   group 29.6 / 28 / 24, headline 23.04 / 22 / 19.2, detail 18 / 18 / 16. */
/* Two levels in every band (REQUIREMENTS-DESIGN 1, 3): a headline sentence a reader can stop on, then a
   quieter detail. No width cap on any of this text (LEARNINGS I.1). */
.sd-rq-intro-detail { margin: 0; font-size: clamp(1.125rem, 1.4vw, 1.3rem); line-height: 1.5; color: var(--text); text-wrap: pretty; }
.sd-rq-clarify {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; align-items: start;
  margin: 0 0 8px; font-size: 1.125rem; line-height: 1.5; font-weight: 400; color: var(--text-muted); text-wrap: pretty;
}
.sd-rq-clarify-ic { width: 24px; height: 24px; margin-top: calc((1.125rem * 1.5 - 24px) / 2); color: var(--sd-h-ink); }
.sd-rq-clarify strong { font-weight: 700; color: var(--text); }

/* groups: the clarifying question you would ask, as a real heading */
.sd-rq-grp { margin-top: 36px; }
.sd-rq-clarify + .sd-rq-grp, .sd-rq-h + .sd-rq-grp { margin-top: 28px; }
.sd-rq-gh { margin: 0 0 6px; font: 800 clamp(1.75rem, 2.1vw, 1.85rem)/1.2 var(--font-body); color: var(--sd-h-ink); text-wrap: pretty; }

/* rows: one point per row, hairlines between rows and one under the band's last row */
.sd-rq-rows { list-style: none; margin: 0; padding: 0; }
.sd-rq-rows > li + li { border-top: 1px solid var(--border); }
.sd-rq-sec > .sd-rq-rows > li:last-child, .sd-rq-sec > .sd-rq-grp:last-child > .sd-rq-rows > li:last-child { border-bottom: 1px solid var(--border); }
.sd-rq-pt {
  --disc: 40px; --pt-lh: calc(clamp(1.375rem, 1.6vw, 1.44rem) * 1.3);
  display: grid; grid-template-columns: var(--disc) minmax(0, 1fr); column-gap: 18px; align-items: start; padding: 18px 0;
}
.sd-rq-pt.is-legacy { --pt-lh: calc(1.125rem * 1.55); }
.sd-rq-pt.no-ic { grid-template-columns: minmax(0, 1fr); }
.sd-rq-pt-body { min-width: 0; }
.sd-rq-pt-body > p { margin: 0; }
/* the disc sits on the headline's first line, not on the middle of the row */
.sd-rq-ic {
  display: grid; place-items: center; width: var(--disc); height: var(--disc); border-radius: 50%;
  margin-top: calc((var(--pt-lh) - var(--disc)) / 2); background: var(--sd-h-fill); color: var(--sd-h-on);
}
.sd-rq-ic-svg { width: 22px; height: 22px; }
.sd-rq-pt-head { font-size: clamp(1.375rem, 1.6vw, 1.44rem); line-height: 1.3; font-weight: 700; color: var(--text); text-wrap: pretty; overflow-wrap: break-word; }
.sd-rq-out-head { font-size: 1.2rem; line-height: 1.35; font-weight: 700; color: var(--text); text-wrap: pretty; }
/* On a question whose other bands are still legacy paragraphs (400), out-of-scope stays at 400 too:
   the least important band must never be the loudest. */
.sd-rq-out-head.is-plain { font-size: 1.125rem; line-height: 1.55; font-weight: 400; }
/* its detail one step down, so the out-of-scope headline (1.2rem) is still 1.2x its detail */
.sd-rq-out-head + .sd-rq-pt-detail { font-size: 1rem; line-height: 1.5; }
.sd-rq-pt-detail { margin-top: 6px !important; font-size: 1.125rem; line-height: 1.55; color: var(--text-muted); text-wrap: pretty; }
/* Proportional figures: tabular ones align nothing in a one-line sentence and open a gap after "₹" and
   around "1". Weight 400: there is no 500 file, so 500 rendered as Regular anyway. */
.sd-rq-pt-sum { margin-top: 6px !important; font-size: 1.05rem; line-height: 1.5; font-weight: 400; color: var(--text-muted); }
.sd-rq-txt { font-size: 1.125rem; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }

/* the highlight mark: weight first, a low bar in the band's hue second; text stays --text.
   The padding is the same in both themes and takes real room (no negative margin), so a headline wraps at
   the same word in light and dark (SHARED-ISSUES S22: light had -.12em of margin and dark .14em of padding,
   and the frontend hero was 956px tall in light and 981px in dark). */
.sd-k {
  font-weight: 800; color: var(--text); white-space: nowrap; padding-inline: .12em; margin-inline: 0; border-radius: 3px;
  --mark: color-mix(in srgb, var(--mark-fill, var(--sd-h-fill)) 36%, var(--paper));
  background: linear-gradient(transparent 55%, var(--mark) 55%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* Dark: any mix of amber or violet into the near-black paper is brown or aubergine. A highlighter on a
   dark page is the band's light ink behind dark text, full height (9.3:1 violet to 12.7:1 amber at 90%).
   The chip keeps the light mark's padding and margin, so it never touches a full stop or closes the space
   before it, and takes the same room as in light. Inside the quieter lines (detail, working line) a full chip would be as loud as the
   headline's, so there the mark is weight only. */
:root[data-theme="dark"] .sd-k:not(.sd-rq-clarify *) {
  color: var(--paper); background: color-mix(in srgb, var(--mark-ink, var(--sd-h-ink)) 90%, var(--paper));
}
:root[data-theme="dark"] :is(.sd-rq-pt-detail, .sd-rq-pt-sum) .sd-k { color: var(--text); background: none; padding: 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sd-k:not(.sd-rq-clarify *) {
    color: var(--paper); background: color-mix(in srgb, var(--mark-ink, var(--sd-h-ink)) 90%, var(--paper));
  }
  :root:not([data-theme="light"]) :is(.sd-rq-pt-detail, .sd-rq-pt-sum) .sd-k { color: var(--text); background: none; padding: 0; }
}
.sd-rq-pt.is-risk { --mark-fill: var(--sd-rose-fill); --mark-ink: var(--sd-rose-ink); }
.sd-rq-pt.is-risk > .sd-rq-ic { background: var(--sd-rose-fill); color: var(--sd-rose-on); }
.sd-rq-clarify .sd-k { background: none; padding: 0; margin: 0; font-weight: 700; white-space: normal; }

/* pictures, only where a number is a comparison (REQUIREMENTS-DESIGN 3.5); aria-hidden, the text says it all */
.sd-rq-viz { grid-column: 2; margin: 16px 0 0; min-width: 0; }
.sd-rq-viz-row + .sd-rq-viz-row { margin-top: 12px; }
.sd-rq-viz-lbl { margin: 0 0 4px; font-size: 1rem; line-height: 1.4; color: var(--text-muted); }
.sd-rq-viz-lbl b { font-weight: 800; color: var(--text); }
.sd-rq-viz-bar { height: 14px; border-radius: 3px; }
/* lighter than the peak bar, so the peak is the strongest shape; still 3:1 against paper */
.sd-rq-viz-bar.is-avg { background: color-mix(in srgb, var(--text-muted) 64%, var(--paper)); }
.sd-rq-viz-bar.is-peak { background: var(--sd-h-fill); box-shadow: inset 0 0 0 2px var(--sd-h-ink); }
.sd-rq-viz-ctx { display: inline; }
/* "1 in N" (review 2026-11-19): a fixed 10px square, so 1,000 is a 500 x 200px block, not a 1,280px field
   with one 9px dot in it. The coloured square has a ring of its own ink. The caption comes first, led by a
   key square drawn the same way and standing straight above it, so swatch, words and square read as one. */
.sd-rq-viz-ratio { container-type: inline-size; }
.sd-rq-viz-rg { display: flex; flex-direction: column; gap: 8px; }
.sd-rq-viz-grid { display: block; max-width: 100%; height: auto; flex: none; }
/* the empty squares recede (about 1.25:1); the ringed coloured square is the first thing the eye finds */
.sd-rq-viz-grid .e { fill: color-mix(in srgb, var(--text-muted) 14%, var(--paper)); }
.sd-rq-viz-grid .h { fill: var(--sd-h-ink); }
.sd-rq-viz-grid .r { fill: none; stroke: var(--sd-h-ink); stroke-width: 2; }
.sd-rq-pt.is-risk .sd-rq-viz-grid .h { fill: var(--sd-rose-ink); }
.sd-rq-pt.is-risk .sd-rq-viz-grid .r { stroke: var(--sd-rose-ink); }
.sd-rq-viz-ratio figcaption {
  order: -1; display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px; align-items: start;
  font-size: 1rem; line-height: 1.4; color: var(--text-muted); text-wrap: pretty;
}
.sd-rq-viz-key {
  width: 14px; height: 14px; margin: calc((1.4em - 14px) / 2) 0 0 3px; border-radius: 2px; background: var(--sd-h-ink);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--sd-h-ink);
}
.sd-rq-pt.is-risk .sd-rq-viz-key { background: var(--sd-rose-ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--sd-rose-ink); }
@media (forced-colors: active) {
  .sd-k { background: none; text-decoration: underline 2px; }
  .sd-rq-viz-bar { forced-color-adjust: none; background: CanvasText; }
  .sd-rq-viz-bar.is-peak { background: Highlight; }
  .sd-rq-viz-grid .h, .sd-rq-pt.is-risk .sd-rq-viz-grid .h { fill: Highlight; }
  .sd-rq-viz-grid .e { fill: GrayText; }
  .sd-rq-viz-grid .r { stroke: Highlight; }
  .sd-rq-viz-key { forced-color-adjust: none; background: Highlight; box-shadow: none; }
}

/* ---------- input -> our system -> output ---------- */
.sd-rq-flow { margin: 26px 0 0; }
.sd-rq-flow-track { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.sd-rq-flow-box { border-radius: 6px; padding: 16px 20px; min-width: 0; }
.sd-rq-flow-box p { margin: 0; }
.sd-rq-flow-in, .sd-rq-flow-out { background: var(--paper); color: var(--text); border: 1.5px solid var(--rule); }
.sd-rq-flow-out { border: 2px solid var(--sd-green-ink); }
.sd-rq-flow-proc { background: var(--sd-violet-fill); color: var(--sd-violet-on); font: 800 1.35rem/1.15 var(--font-display); text-align: center; display: flex; align-items: center; justify-content: center; }
.sd-rq-flow-label { font-weight: 800; margin-bottom: 6px !important; color: var(--text-muted); }
.sd-rq-flow-out .sd-rq-flow-label { color: var(--sd-green-ink); }
/* input and output values are the same size: the input is half of the example, not a footnote. A URL
   breaks at the <wbr> the renderer puts after / - ? & = (never mid-word); anywhere is the last resort. */
.sd-rq-flow-val { font: 700 1.3rem/1.4 var(--font-mono); overflow-wrap: anywhere; font-variant-ligatures: none; }  /* no code ligatures: JetBrains Mono drew "://" with a gap */
/* proportional figures, like the working line: tabular ones left a gap after "₹" */
.sd-rq-flow-val.is-text { font-family: var(--font-body); word-break: normal; overflow-wrap: break-word; }
.sd-rq-flow-arrow { width: 44px; height: 30px; color: var(--text-muted); align-self: center; transform: rotate(90deg); flex: none; }
.sd-rq-flow figcaption { margin-top: 14px; font-size: 1.06rem; line-height: 1.5; font-weight: 400; color: var(--text-muted); text-wrap: pretty; }
@media (min-width: 900px) {
  .sd-rq-flow-track { flex-direction: row; align-items: center; gap: 14px; }
  .sd-rq-flow-in { flex: 2.2 1 0; }
  .sd-rq-flow-proc { flex: 1 1 0; align-self: stretch; }
  .sd-rq-flow-out { flex: 1.6 1 0; }
  .sd-rq-flow-arrow { transform: none; width: 52px; }
}

/* ---------- live demo (frontend questions): "Try it" opens the demo below its row, full width ---------- */
.sd-rq-pt.sd-rq-has-demo { grid-template-columns: var(--disc) minmax(0, 1fr) auto; row-gap: 12px; }
.sd-rq-has-demo > .sd-rq-try { grid-column: 3; grid-row: 1; align-self: start; margin-top: min(0px, calc((var(--pt-lh) - 44px) / 2)); }
.sd-rq-try { flex: none; min-height: 44px; padding: 8px 14px; }
.sd-rq-try[aria-expanded="true"] { background: var(--action); color: var(--action-on); border-color: var(--action); }
.sd-rq-try-ic { width: 16px; height: 16px; fill: currentColor; }
.sd-rq-try-ic path { fill: currentColor; stroke-width: 1.5; }
.sd-rq-demo { margin: 0; }
.sd-rq-demo-row { grid-column: 1 / -1; min-width: 0; }
.sd-rq-demo-whole { margin-top: 26px; }
.sd-rq-demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.sd-rq-demo-cap { margin: 0; font-weight: 700; line-height: 1.45; color: var(--sd-h-ink); min-width: 0; overflow-wrap: anywhere; }
.sd-rq-demo-whole > .sd-rq-demo-cap { margin-bottom: 10px; }
.sd-rq-demo-acts { display: flex; gap: 8px; flex: none; }
.sd-rq-demo-act { min-height: 40px; padding: 6px 14px; font-size: .95rem; }
.sd-rq-demo-frame {
  display: block; width: 100%; height: var(--h, 480px); border: 1.5px solid var(--rule); border-radius: 6px;
  background: var(--paper); color-scheme: normal;
}
.sd-rq-demo-frame:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
@media (max-width: 600px) { .sd-rq-demo-frame { height: var(--hp, var(--h, 480px)); } }

/* ---------- the tabbed requirements panel (backend; LEARNINGS Q, REQUIREMENTS-DESIGN 9) ----------
   Tabs in their section colours: each tab a tint of its hue with a hue rule under it; the selected tab is
   the full band colour and joins a 4px rule of the same colour over the body, so the panel reads as that
   band. The body is as tall as the tallest tab (--tall, measured by sd-reqs.js), capped by --cap, and
   scrolls inside, so switching tabs never moves anything. Phones: natural height. */
.sd-rqt { min-width: 0; container: rqtabs / inline-size; }
/* Every label stays on one line (SHARED-ISSUES S18: at 1024 "What to build" and "What it must do" wrapped
   while "Numbers" and "Rules" did not). Each tab is as wide as its label plus an equal share of what is left,
   and the label size follows the bar's width: the four labels in Mukta 700 measure 317px at 1.02rem, so
   5.1cqi - 3.2px keeps them plus padding and gaps inside the bar down to a 340px bar (a phone). */
.sd-rqt-tabs { display: flex; gap: 4px; }
.sd-rqt-tab {
  flex: 1 1 auto; min-width: 0;
  min-height: 52px; padding: 8px 6px; margin: 0; border: 0; border-radius: 6px 6px 0 0; cursor: pointer;
  background: var(--sd-h-bg); color: var(--sd-h-tx, var(--text)); box-shadow: inset 0 -3px 0 var(--sd-h-ink);
  font: 700 clamp(.86rem, calc(5.1cqi - 3.2px), 1.02rem)/1.15 var(--font-body); text-align: center; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; transition: background-color .15s var(--ease), color .15s var(--ease);
}
@media (hover: hover) { .sd-rqt-tab:hover { background: color-mix(in srgb, var(--sd-h-fill) 24%, var(--paper)); } }
.sd-rqt-tab[aria-selected="true"] { background: var(--sd-h-fill); color: var(--sd-h-on); box-shadow: none; font-weight: 800; }
.sd-rqt-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; position: relative; z-index: 1; }
.sd-rqt-body {
  --cap: 100vh; height: min(var(--tall, var(--cap)), var(--cap)); overflow: auto;
  border-top: 4px solid var(--sd-h-fill); padding: 6px 2px 0; scrollbar-gutter: stable;
  /* scroll shadows: a soft edge shows only where there is more to scroll (paper covers it at either end) */
  --sh: color-mix(in srgb, var(--text) 26%, transparent);
  background:
    linear-gradient(var(--paper) 40%, transparent) top / 100% 36px no-repeat local,
    linear-gradient(transparent, var(--paper) 60%) bottom / 100% 36px no-repeat local,
    radial-gradient(farthest-side at 50% 0, var(--sh), transparent) top / 100% 12px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, var(--sh), transparent) bottom / 100% 12px no-repeat scroll,
    var(--paper);
}
.sd-rqt-pane { container: rqt / inline-size; padding-bottom: 18px; }
.sd-rqt-pane:focus { outline: none; }
.sd-rqt-pane:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.sd-rqt-pane > .sd-rq-intro-detail { margin-top: 16px; }
.sd-rqt-pane > .sd-rq-clarify { margin-top: 14px; }
.sd-rqt-pane > .sd-rq-rows > li:last-child, .sd-rqt-pane > .sd-rq-grp:last-child > .sd-rq-rows > li:last-child { border-bottom: 0; }
/* a compact panel: the requirement type steps down one notch, as in the Interview insights dialog
   (headline 20px over detail 16px, group heading 25.6px over the headline) */
@media (min-width: 601px) {
  .sd-rqt .sd-rq-pt { --pt-lh: calc(1.25rem * 1.3); padding: 14px 0; }
  .sd-rqt .sd-rq-pt-head { font-size: 1.25rem; }
  .sd-rqt :is(.sd-rq-pt-detail, .sd-rq-pt-sum, .sd-rq-clarify) { font-size: 1rem; }
  .sd-rqt .sd-rq-clarify-ic { margin-top: calc((1rem * 1.5 - 24px) / 2); }
  .sd-rqt .sd-rq-gh { font-size: 1.6rem; }
  .sd-rqt .sd-rq-grp { margin-top: 26px; }
  .sd-rqt .sd-rq-clarify + .sd-rq-grp { margin-top: 18px; }
  .sd-rqt .sd-rq-intro-detail { font-size: 1.125rem; }
  .sd-rqt .sd-rq-flow { margin-top: 20px; }
  .sd-rqt .sd-rq-flow-val { font-size: 1.15rem; }
  .sd-rqt .sd-rq-flow-proc { font-size: 1.2rem; }
}
/* the flow diagram follows the panel's width, not the window's: one column in a narrow panel */
.sd-rqt .sd-rq-flow-track { flex-direction: column; align-items: stretch; gap: 6px; }
.sd-rqt .sd-rq-flow-in, .sd-rqt .sd-rq-flow-proc, .sd-rqt .sd-rq-flow-out { flex: none; }
.sd-rqt .sd-rq-flow-proc { padding-block: 12px; }
.sd-rqt .sd-rq-flow-arrow { transform: rotate(90deg); width: 40px; height: 26px; }
@container rqt (min-width: 780px) {
  .sd-rqt .sd-rq-flow-track { flex-direction: row; align-items: center; gap: 14px; }
  .sd-rqt .sd-rq-flow-in { flex: 2.2 1 0; }
  .sd-rqt .sd-rq-flow-proc { flex: 1 1 0; align-self: stretch; }
  .sd-rqt .sd-rq-flow-out { flex: 1.6 1 0; }
  .sd-rqt .sd-rq-flow-arrow { transform: none; width: 52px; }
}
@media (forced-colors: active) {
  .sd-rqt-tab { border: 1px solid CanvasText; }
  .sd-rqt-tab[aria-selected="true"] { border-width: 3px; }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .sd-rq-head { padding-top: 12px; }
  .sd-rq-outline { font-size: 1rem; }
  .sd-rqt-body { height: auto; overflow: visible; scrollbar-gutter: auto; padding-top: 4px; background: none; }
  .sd-rqt-tab { min-height: 52px; padding: 6px 4px; }
  .sd-rq-h { font-size: 1.8rem; }
  .sd-rq-pt { --disc: 32px; --pt-lh: calc(1.2rem * 1.3); column-gap: 12px; padding: 11px 0; }
  /* Phones (review 2026-11-19: payment-system's numbers band was 2,758px, 3.3 screens): the detail and the
     working line take the whole 354px row under the disc instead of 304px beside it, which takes about a
     line off every long detail. The headline keeps its indent, so the disc still marks where a point starts.
     (A disc floated into the headline was tried: it indented two lines, ragged, and saved nothing.) */
  .sd-rq-pt:not(.sd-rq-has-demo) > .sd-rq-pt-body { display: contents; }
  .sd-rq-pt:not(.sd-rq-has-demo) > .sd-rq-ic { grid-row: 1; }
  .sd-rq-pt:not(.sd-rq-has-demo) :is(.sd-rq-pt-detail, .sd-rq-pt-sum) { grid-column: 1 / -1; }
  .sd-rq-pt.is-legacy { --pt-lh: calc(1.06rem * 1.55); }
  .sd-rq-ic-svg { width: 18px; height: 18px; }
  .sd-rq-intro-detail { font-size: 1.125rem; }
  /* balance, not pretty: a nowrap mark near the end left one word alone on the last line */
  .sd-rq-pt-head, .sd-rq-out-head, .sd-rq-gh { font-size: 1.2rem; text-wrap: balance; }
  .sd-rq-out-head { font-size: 1.2rem; }
  .sd-rq-gh { font-size: 1.5rem; }
  .sd-rq-clarify { font-size: 1.06rem; line-height: 1.45; }
  .sd-rq-clarify-ic { width: 20px; height: 20px; margin-top: calc((1.06rem * 1.45 - 20px) / 2); }
  .sd-rq-clarify { grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px; }
  .sd-rq-pt-detail, .sd-rq-out-head + .sd-rq-pt-detail { font-size: 1rem; line-height: 1.45; margin-top: 4px !important; }
  .sd-rq-pt-sum { font-size: 1rem; line-height: 1.45; margin-top: 4px !important; }
  .sd-rq-txt { font-size: 1.06rem; }
  .sd-rq-grp, .sd-rq-clarify + .sd-rq-grp { margin-top: 20px; }
  /* pictures take the whole row under the text */
  .sd-rq-viz { grid-column: 1 / -1; margin-top: 12px; }
  .sd-rq-viz-bar { height: 12px; }
  /* on a phone the "1 in N" grid is a 354px field of 5px squares: the headline already states the ratio */
  .sd-rq-viz-ratio { display: none; }
  /* the peak bars keep their numbers; "on an average day" is in the headline and detail above them */
  .sd-rq-viz-ctx { display: none; }
  .sd-rq-viz-row + .sd-rq-viz-row { margin-top: 8px; }
  /* the short average bar takes its label beside it, on the same zero, so the picture is three lines, not four */
  .sd-rq-viz-row:has(> .is-avg) { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; }
  .sd-rq-viz-row:has(> .is-avg) > .sd-rq-viz-lbl { margin: 0; min-width: 0; }
  .sd-rq-viz-row:has(> .is-avg) > .sd-rq-viz-bar { flex: none; }
  /* the button goes under the text, lined up with it, so the sentence keeps the full width */
  .sd-rq-pt.sd-rq-has-demo { grid-template-columns: var(--disc) minmax(0, 1fr); }
  .sd-rq-has-demo > .sd-rq-try { grid-column: 2; grid-row: 2; justify-self: start; margin-top: 0; }
}

/* narrow phones (320-420): four tabs in one row shrank the labels to 13.8px and "Rules" to 37px wide; a 2x2 grid
   keeps every label at 16px on one line and every tab at least 48px tall (round 5, mobile pass B3) */
@media (max-width: 420px) {
  .sd-rqt-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .sd-rqt-tab { font-size: 1rem; min-height: 48px; }
}
