/* sd.allahabadi.dev — its own design (2026-11-19, round 3). No fm.css underneath.
   World: the learning paperback. Every section is a full-width colour band carrying its heading,
   over a white paper band carrying the content. Decisions and measured contrast: sd/DESIGN.md.

   Token contract (sd-community.css, sd-reqs.css and sd-board.js read these names, keep them):
   --sd-<hue>-fill / -on   band colour and the text on it (same in both themes)
   --sd-<hue>-ink          hue-coloured text on paper            (5.9-9.3:1 light, 9.3-12.7:1 dark)
   --sd-<hue>-bg / -tx     soft tint of the hue and text on it   (15.4:1+ light, 13.1:1+ dark)
   --sd-<hue>-bd           hue stroke on paper (= ink, so >=3:1 by construction)
   [data-hue] maps one hue onto --sd-h-*. Hues: orange blue green rose violet amber teal indigo slate. */

@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-latin-400-normal.woff2") format("woff2"); font-weight: 300 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-latin-700-normal.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-latin-800-normal.woff2") format("woff2"); font-weight: 800 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --font-display: "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* paper and ink */
  --bg: #ffffff; --paper: #ffffff; --paper-2: #f5f6f8; --text: #16181d; --text-muted: #4a505c;
  --border: #dfe2e8; --rule: #c9ced8; --action: #16181d; --action-on: #ffffff; --focus: #2d6ae3;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gut: max(18px, 3.5vw, calc((100vw - 1520px) / 2));

  /* band colours: identical in both themes, so a section keeps its colour when the theme flips */
  --sd-orange-fill: #f26a1b; --sd-orange-on: #16181d;
  --sd-blue-fill:   #2d6ae3; --sd-blue-on:   #ffffff;
  --sd-green-fill:  #14a35a; --sd-green-on:  #16181d;
  --sd-rose-fill:   #d42766; --sd-rose-on:   #ffffff;
  --sd-violet-fill: #7a4fd6; --sd-violet-on: #ffffff;
  --sd-amber-fill:  #f5b313; --sd-amber-on:  #16181d;
  --sd-teal-fill:   #0aa5a0; --sd-teal-on:   #16181d;
  --sd-indigo-fill: #4b4fd8; --sd-indigo-on: #ffffff;
  --sd-slate-fill:  #5d6b85; --sd-slate-on:  #ffffff;

  --sd-orange-ink: #a83c00; --sd-orange-bg: #fff1e8;
  --sd-blue-ink:   #1f4fb3; --sd-blue-bg:   #eaf1ff;
  --sd-green-ink:  #0b6b3a; --sd-green-bg:  #e6f7ee;
  --sd-rose-ink:   #b0124d; --sd-rose-bg:   #ffebf2;
  --sd-violet-ink: #5b2fbf; --sd-violet-bg: #f2ecff;
  --sd-amber-ink:  #8a5a00; --sd-amber-bg:  #fff6dc;
  --sd-teal-ink:   #06706c; --sd-teal-bg:   #e3f7f6;
  --sd-indigo-ink: #3a3cb5; --sd-indigo-bg: #eeeeff;
  --sd-slate-ink:  #3c4760; --sd-slate-bg:  #eef1f6;

  --sd-card: #ffffff; --sd-card-tx: #16181d; --sd-card-muted: #4a505c; --sd-card-bd: #c9ced8;
  --sd-track: #e3e6ec;
  --sd-shadow-a: 0.18; --sd-shadow-c: 0 0 0 0 transparent;
  --float-shadow: 0 1px 2px rgb(16 18 24 / .08), 0 12px 32px -12px rgb(16 18 24 / .28);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14161b; --paper: #14161b; --paper-2: #1c1f26; --text: #eceef3; --text-muted: #a9afbc;
  --border: #2c313b; --rule: #3a404c; --action: #eceef3; --action-on: #14161b; --focus: #9dbcff;
  --sd-orange-ink: #ffad7a; --sd-orange-bg: #2e1a0e;
  --sd-blue-ink:   #9dbcff; --sd-blue-bg:   #132241;
  --sd-green-ink:  #7fe0ab; --sd-green-bg:  #0f2a1d;
  --sd-rose-ink:   #ff9cbf; --sd-rose-bg:   #33121f;
  --sd-violet-ink: #c6adff; --sd-violet-bg: #22183d;
  --sd-amber-ink:  #ffd36b; --sd-amber-bg:  #2e2408;
  --sd-teal-ink:   #6fe0d9; --sd-teal-bg:   #0c2a29;
  --sd-indigo-ink: #b3b6ff; --sd-indigo-bg: #1b1c40;
  --sd-slate-ink:  #bcc6da; --sd-slate-bg:  #1d222c;
  --sd-card: #1c1f26; --sd-card-tx: #eceef3; --sd-card-muted: #a9afbc; --sd-card-bd: #3a404c;
  --sd-track: #2c313b;
  --sd-shadow-a: 0.3; --sd-shadow-c: 0 0 0 1px rgb(255 255 255 / .05);
  --float-shadow: 0 0 0 1px rgb(255 255 255 / .06), 0 16px 40px -12px rgb(0 0 0 / .7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14161b; --paper: #14161b; --paper-2: #1c1f26; --text: #eceef3; --text-muted: #a9afbc;
    --border: #2c313b; --rule: #3a404c; --action: #eceef3; --action-on: #14161b; --focus: #9dbcff;
    --sd-orange-ink: #ffad7a; --sd-orange-bg: #2e1a0e;
    --sd-blue-ink:   #9dbcff; --sd-blue-bg:   #132241;
    --sd-green-ink:  #7fe0ab; --sd-green-bg:  #0f2a1d;
    --sd-rose-ink:   #ff9cbf; --sd-rose-bg:   #33121f;
    --sd-violet-ink: #c6adff; --sd-violet-bg: #22183d;
    --sd-amber-ink:  #ffd36b; --sd-amber-bg:  #2e2408;
    --sd-teal-ink:   #6fe0d9; --sd-teal-bg:   #0c2a29;
    --sd-indigo-ink: #b3b6ff; --sd-indigo-bg: #1b1c40;
    --sd-slate-ink:  #bcc6da; --sd-slate-bg:  #1d222c;
    --sd-card: #1c1f26; --sd-card-tx: #eceef3; --sd-card-muted: #a9afbc; --sd-card-bd: #3a404c;
    --sd-track: #2c313b;
    --sd-shadow-a: 0.3; --sd-shadow-c: 0 0 0 1px rgb(255 255 255 / .05);
    --float-shadow: 0 0 0 1px rgb(255 255 255 / .06), 0 16px 40px -12px rgb(0 0 0 / .7);
  }
}
/* derived names: text on a tint is the page text; a stroke is the ink */
:root, :root[data-theme] {
  --sd-orange-tx: var(--text); --sd-blue-tx: var(--text); --sd-green-tx: var(--text); --sd-rose-tx: var(--text);
  --sd-violet-tx: var(--text); --sd-amber-tx: var(--text); --sd-teal-tx: var(--text); --sd-indigo-tx: var(--text); --sd-slate-tx: var(--text);
  --sd-orange-bd: var(--sd-orange-ink); --sd-blue-bd: var(--sd-blue-ink); --sd-green-bd: var(--sd-green-ink); --sd-rose-bd: var(--sd-rose-ink);
  --sd-violet-bd: var(--sd-violet-ink); --sd-amber-bd: var(--sd-amber-ink); --sd-teal-bd: var(--sd-teal-ink); --sd-indigo-bd: var(--sd-indigo-ink); --sd-slate-bd: var(--sd-slate-ink);
}

[data-hue="orange"] { --sd-h-bg: var(--sd-orange-bg); --sd-h-bd: var(--sd-orange-bd); --sd-h-ink: var(--sd-orange-ink); --sd-h-tx: var(--sd-orange-tx); --sd-h-fill: var(--sd-orange-fill); --sd-h-on: var(--sd-orange-on); }
[data-hue="blue"]   { --sd-h-bg: var(--sd-blue-bg);   --sd-h-bd: var(--sd-blue-bd);   --sd-h-ink: var(--sd-blue-ink);   --sd-h-tx: var(--sd-blue-tx);   --sd-h-fill: var(--sd-blue-fill);   --sd-h-on: var(--sd-blue-on); }
[data-hue="green"]  { --sd-h-bg: var(--sd-green-bg);  --sd-h-bd: var(--sd-green-bd);  --sd-h-ink: var(--sd-green-ink);  --sd-h-tx: var(--sd-green-tx);  --sd-h-fill: var(--sd-green-fill);  --sd-h-on: var(--sd-green-on); }
[data-hue="rose"]   { --sd-h-bg: var(--sd-rose-bg);   --sd-h-bd: var(--sd-rose-bd);   --sd-h-ink: var(--sd-rose-ink);   --sd-h-tx: var(--sd-rose-tx);   --sd-h-fill: var(--sd-rose-fill);   --sd-h-on: var(--sd-rose-on); }
[data-hue="violet"] { --sd-h-bg: var(--sd-violet-bg); --sd-h-bd: var(--sd-violet-bd); --sd-h-ink: var(--sd-violet-ink); --sd-h-tx: var(--sd-violet-tx); --sd-h-fill: var(--sd-violet-fill); --sd-h-on: var(--sd-violet-on); }
[data-hue="amber"]  { --sd-h-bg: var(--sd-amber-bg);  --sd-h-bd: var(--sd-amber-bd);  --sd-h-ink: var(--sd-amber-ink);  --sd-h-tx: var(--sd-amber-tx);  --sd-h-fill: var(--sd-amber-fill);  --sd-h-on: var(--sd-amber-on); }
[data-hue="teal"]   { --sd-h-bg: var(--sd-teal-bg);   --sd-h-bd: var(--sd-teal-bd);   --sd-h-ink: var(--sd-teal-ink);   --sd-h-tx: var(--sd-teal-tx);   --sd-h-fill: var(--sd-teal-fill);   --sd-h-on: var(--sd-teal-on); }
[data-hue="indigo"] { --sd-h-bg: var(--sd-indigo-bg); --sd-h-bd: var(--sd-indigo-bd); --sd-h-ink: var(--sd-indigo-ink); --sd-h-tx: var(--sd-indigo-tx); --sd-h-fill: var(--sd-indigo-fill); --sd-h-on: var(--sd-indigo-on); }
[data-hue="slate"]  { --sd-h-bg: var(--sd-slate-bg);  --sd-h-bd: var(--sd-slate-bd);  --sd-h-ink: var(--sd-slate-ink);  --sd-h-tx: var(--sd-slate-tx);  --sd-h-fill: var(--sd-slate-fill);  --sd-h-on: var(--sd-slate-on); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.25rem/1.5 var(--font-body); font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* headings fill the line (LEARNINGS I.1): `balance` broke a two-line heading at half the width */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; letter-spacing: -0.012em; text-wrap: pretty; }
p { margin: 0 0 12px; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: .08em; }
::selection { background: var(--sd-amber-fill); color: #16181d; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, textarea, select { caret-color: var(--sd-blue-ink); }
code, kbd, samp { font-family: var(--font-mono); font-size: .95em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--action); color: var(--action-on); border-radius: 6px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 10px; }
html { scrollbar-color: var(--rule) transparent; }

.sd { display: flex; flex-direction: column; min-height: 100vh; }
.sd main { flex: 0 0 auto; width: 100%; }
.sd-wrap { padding: 0 0 40px; }
.sd-error { color: var(--sd-rose-ink); font-weight: 700; margin-inline: var(--gut); }
.sd-small { font-size: .95rem; color: var(--text-muted); }

/* ---------- top bar: a translucent material over the page ---------- */
.sd-top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid var(--border);
}
.sd-top-in { display: flex; align-items: center; gap: 8px 20px; min-height: 64px; padding: 0 var(--gut); }
.sd-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 800 1.3rem/1 var(--font-display); letter-spacing: -0.01em; margin-right: auto; min-height: 48px; }
.sd-mark { width: 26px; height: 30px; flex: none; }
.sd-brand-t { white-space: nowrap; }
.sd-nav { display: flex; align-items: center; gap: 4px; }
.sd-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border-radius: 6px;
  text-decoration: none; font-weight: 700; font-size: 1.02rem; color: var(--text-muted);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.sd-nav a:hover { color: var(--text); background: var(--paper-2); }
.sd-nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--sd-orange-fill); border-radius: 6px 6px 0 0; }
.sd-iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; flex: none;
  border: 1.5px solid var(--rule); background: var(--paper); color: var(--text); cursor: pointer;
  transition: transform .1s var(--ease), border-color .15s var(--ease);
}
.sd-iconbtn:hover { border-color: var(--text); }
.sd-iconbtn:active { transform: scale(.94); }
.sd-iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-menu { display: none; }
.sd-theme .sd-i-sun, .sd-nav-theme .sd-i-sun { display: none; }
:root[data-theme="dark"] :is(.sd-theme, .sd-nav-theme) .sd-i-sun { display: block; }
:root[data-theme="dark"] :is(.sd-theme, .sd-nav-theme) .sd-i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.sd-theme, .sd-nav-theme) .sd-i-sun { display: block; }
  :root:not([data-theme="light"]) :is(.sd-theme, .sd-nav-theme) .sd-i-moon { display: none; }
}
@media (max-width: 760px) {
  .sd-menu { display: inline-grid; }
  .sd-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gut) 14px; background: var(--paper); border-bottom: 1px solid var(--border); box-shadow: var(--float-shadow);
    transform-origin: top right; transition: opacity .18s var(--ease), transform .22s var(--ease), visibility 0s .22s;
    opacity: 0; transform: translateY(-6px) scale(.98); visibility: hidden;
  }
  .sd-nav.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity .18s var(--ease), transform .22s var(--ease); }
  /* an open menu sits over the phone's bottom bar and scrolls when it is taller than the screen (a landscape phone) */
  .sd-nav { max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; }
  .sd-top:has(.sd-nav.is-open) { z-index: 60; }
  .sd-nav a { min-height: 52px; font-size: 1.1rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .sd-nav a:last-of-type { border-bottom: 0; }
  .sd-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--sd-orange-fill); padding-left: 18px; }
  .sd-brand { font-size: 1.15rem; }
  /* phones: the theme switch is the menu's last row ("Dark theme" / "Light theme", sd-shell.js), not a bar button */
  .sd-top-in > .sd-theme { display: none; }
  .sd-nav .sd-nav-theme { display: flex; }
}
/* the menu's theme row (built by sd-shell.js; shown only while the bar's theme button is hidden) */
.sd-nav-theme {
  display: none; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 14px; margin-top: 8px;
  border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); cursor: pointer;
  font: 700 1.1rem/1.2 var(--font-body); text-align: left;
}
.sd-nav-theme svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-nav-theme:hover { background: var(--paper-2); }
@media (max-width: 420px) {
  .sd-top-in { gap: 8px 10px; padding-inline: 12px; }
  .sd-brand { gap: 8px; font-size: 1rem; }
}
@media (max-width: 359px) { .sd-brand { font-size: .94rem; } }   /* 15px: the floor for text */
/* a landscape phone: a lower bar, so it takes less of a 390px-high screen */
@media (max-height: 500px) {
  .sd-top-in { min-height: 52px; }
  .sd-brand { min-height: 44px; }
}

/* the top bar hides while scrolling down and comes back on scrolling up (sd-shell.js) */
.sd-top { transition: transform .28s var(--ease); }
.sd-top.is-away { transform: translateY(-100%); }

/* global actions in the top bar, each in its own tint so the eye finds them (LEARNINGS I.3) */
.sd-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.sd-act, .sd-acts .sdc-open {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 6px; cursor: pointer;
  font: 700 1rem/1.2 var(--font-body); white-space: nowrap; text-decoration: none; border: 1.5px solid;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), transform .1s var(--ease);
}
.sd-act:active, .sd-acts .sdc-open:active { transform: scale(.97); }
.sd-act-reset { background: var(--sd-rose-bg); color: var(--sd-rose-ink); border-color: color-mix(in srgb, var(--sd-rose-ink) 45%, var(--sd-rose-bg)); }
.sd-act-reset:hover { border-color: var(--sd-rose-ink); }
.sd-acts .sdc-open { background: var(--sd-indigo-bg); color: var(--sd-indigo-ink); border-color: color-mix(in srgb, var(--sd-indigo-ink) 45%, var(--sd-indigo-bg)); }
.sd-acts .sdc-open:hover { border-color: var(--sd-indigo-ink); }
.sd-act-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sd-act-s, .sd-acts .sdc-open-s { display: none; }

/* with the actions in the bar, the page links go into the menu earlier (up to 1300: from 1210 to 1280 the three
   links plus the full action labels ran 60px past the right edge) */
@media (max-width: 1300px) {
  .sd-top.has-acts .sd-menu { display: inline-grid; }
  .sd-top.has-acts .sd-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gut) 14px; background: var(--paper); border-bottom: 1px solid var(--border); box-shadow: var(--float-shadow);
    transform-origin: top right; transition: opacity .18s var(--ease), transform .22s var(--ease), visibility 0s .22s;
    opacity: 0; transform: translateY(-6px) scale(.98); visibility: hidden;
  }
  .sd-top.has-acts .sd-nav.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity .18s var(--ease), transform .22s var(--ease); }
  .sd-top.has-acts .sd-nav { max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; }
  .sd-top.has-acts:has(.sd-nav.is-open) { z-index: 60; }
  .sd-top.has-acts .sd-nav a { min-height: 52px; font-size: 1.1rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .sd-top.has-acts .sd-nav a:last-of-type { border-bottom: 0; }
  .sd-top.has-acts .sd-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--sd-orange-fill); padding-left: 18px; }
}
/* short labels in the bar; the full label stays the button's name. Up to 1100px wide (a landscape phone, a small
   tablet) the full labels pushed the menu button off the screen (854-898 on an 844px phone) */
@media (max-width: 1100px) {
  .sd-top-in > .sd-acts .sd-act-t, .sd-top-in > .sd-acts .sdc-open-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sd-top-in > .sd-acts .sd-act-s, .sd-top-in > .sd-acts .sdc-open-s { display: inline; }
}
/* phones: the actions are rows at the end of the menu (sd-shell.js moves the slot) */
.sd-nav > .sd-acts { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 12px; }
.sd-nav > .sd-acts .sd-act, .sd-nav > .sd-acts .sdc-open { min-height: 52px; justify-content: flex-start; white-space: normal; }

/* a toast after a global action */
.sd-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; margin: 0; max-width: calc(100vw - 32px); padding: 14px 22px; border-radius: 8px;
  background: var(--action); color: var(--action-on); font-weight: 700; box-shadow: var(--float-shadow); pointer-events: none;
  opacity: 0; transform: translate(-50%, 16px); transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.sd-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.sd-toast:empty { display: none; }
@media (max-width: 600px) { body.sd:has(.sd-cv-mbar:not([hidden])) .sd-toast { bottom: 92px; } }
/* phones: while the bottom bar shows, anything scrolled into view (a focused field, "Start answering", a jump to
   a level) stops above it, not under it */
@media (max-width: 600px) { html:has(.sd-cv-mbar:not([hidden])) { scroll-padding-bottom: calc(var(--sd-mbar-h, 69px) + 12px); } }
/* narrow phones: the sheet's top row is one line (it wrapped to 119px at 320 and 360): the two tabs share the row
   equally and Close is a 44x44 x on its right */
@media (max-width: 420px) {
  .sd-sheet-top { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; padding-inline: 12px; }
  .sd-sheet-top .sd-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .sd-sheet-top .sd-tab { min-height: 44px; font-size: 1rem; padding: 8px 6px; }
  .sd-sheet-close { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .sd-sheet-close-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* the on-screen keyboard is open (sd-shell.js): the bottom bars step aside */
body.is-kb .sd-cv-mbar, body.is-kb .sd-jump { display: none !important; }


/* ---------- a section: the colour band with its heading, then paper ---------- */
.sd-sec { margin: 0 0 40px; background: var(--paper); color: var(--text); }
.sd-sec > :not(.sd-sec-h) { margin-inline: var(--gut); }
.sd-sec-h {
  margin: 0 0 24px; padding: 22px var(--gut) 20px; background: var(--sd-h-fill); color: var(--sd-h-on);
  font-size: clamp(1.7rem, 3vw, 2.75rem); line-height: 1.08;
}
.sd-sec-h:focus { outline: none; }
.sd-sec-h:focus-visible { outline: 3px solid var(--focus); outline-offset: -6px; }
.sd-sub-h { font-size: clamp(1.35rem, 2vw, 1.8rem); color: var(--sd-h-ink, var(--text)); margin: 32px 0 14px; }
.sd-lead { font-size: 1.2em; line-height: 1.55; }

/* rows: one item per line, divided by hairlines, never side by side */
.sd-rows { list-style: none; margin: 0; padding: 0; }
.sd-rows > li { padding: 14px 0; border-top: 1px solid var(--border); line-height: 1.55; }
.sd-rows > li:last-child { border-bottom: 1px solid var(--border); }
ol.sd-rows { counter-reset: r; }
ol.sd-rows > li { counter-increment: r; display: grid; grid-template-columns: 2.4em 1fr; }
ol.sd-rows > li::before { content: counter(r); font: 800 1.25em/1.2 var(--font-display); color: var(--sd-h-ink, var(--text)); }

/* ---------- buttons: one action colour (ink), used only for what can be pressed ---------- */
.sd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 24px;
  font: 700 1.05rem/1.2 var(--font-body); border-radius: 6px; cursor: pointer; text-decoration: none;
  border: 1.5px solid transparent; transition: transform .1s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.sd-btn:active { transform: scale(.97); }
.sd-btn-go { background: var(--action); color: var(--action-on); border-color: var(--action); }
.sd-btn-go:hover { box-shadow: 0 8px 20px -10px rgb(16 18 24 / .6); }
.sd-btn-plain { background: var(--paper); color: var(--text); border-color: var(--rule); }
.sd-btn-plain:hover { border-color: var(--text); }
.sd-btn-danger { background: var(--paper); color: var(--sd-rose-ink); border-color: color-mix(in srgb, var(--sd-rose-ink) 55%, var(--paper)); }
.sd-btn-danger:hover { border-color: var(--sd-rose-ink); background: var(--sd-rose-bg); }
.sd-btn-danger-solid, .sd-btn.is-armed { background: var(--sd-rose-fill); color: var(--sd-rose-on); border-color: var(--sd-rose-fill); }
.sd-btn:disabled { background: transparent; color: var(--text-muted); border: 1.5px dashed var(--rule); cursor: default; box-shadow: none; transform: none; }
.sd-btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.sd-flash:empty { display: none; }

/* ---------- home and the path lists ---------- */
.sd-hero { padding: clamp(24px, 3.4vw, 44px) var(--gut) clamp(20px, 3vw, 36px); }
.sd-hero h1 { font-size: clamp(2.4rem, 5.6vw, 5rem); line-height: 1.02; letter-spacing: -0.025em; margin: 0; }
.sd-paths, .sd-qlist { list-style: none; margin: 0; padding: 0; }
.sd-path-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 32px;
  padding: clamp(28px, 4vw, 56px) var(--gut); text-decoration: none;
  background: var(--sd-h-fill); color: var(--sd-h-on); overflow: hidden;
}
.sd-path-card h2 { grid-column: 1; margin: 0; font-size: clamp(2.6rem, 7vw, 6.2rem); line-height: .95; letter-spacing: -0.03em; }
.sd-path-card p { grid-column: 1; margin: 6px 0 0; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.5; }
.sd-count { grid-column: 2; grid-row: 1 / span 2; align-self: end; font: 800 1.25rem/1.2 var(--font-display); white-space: nowrap; }
.sd-path-card .sd-arw { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; width: 48px; height: 48px;
  transition: transform .35s var(--ease); fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sd-path-card:hover .sd-arw, .sd-path-card:focus-visible .sd-arw { transform: translateX(8px); }
.sd-path-card:focus-visible { outline: 4px solid var(--text); outline-offset: -8px; }
@media (max-width: 600px) {
  .sd-path-card { grid-template-columns: 1fr; }
  .sd-count { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 12px; }
  .sd-path-card .sd-arw { display: none; }
}


/* each question is its own colour band, like a paperback on a shelf */
.sd-q-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: center;
  padding: clamp(24px, 3.4vw, 44px) var(--gut); text-decoration: none; background: var(--sd-h-fill); color: var(--sd-h-on);
}
.sd-q-card > :not(.sd-arw) { grid-column: 1; }
.sd-q-card:focus-visible { outline: 4px solid var(--text); outline-offset: -8px; }
.sd-q-card h2 { margin: 0 0 8px; font-size: clamp(2rem, 4.4vw, 3.8rem); line-height: 1; letter-spacing: -0.02em; }
.sd-q-card p { margin: 0; font-size: 1.2rem; }
.sd-q-card .sd-arw { grid-column: 2; grid-row: 1 / span 3; width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.sd-q-card:hover .sd-arw, .sd-q-card:focus-visible .sd-arw { transform: translateX(8px); }
.sd-qprog { margin-top: 10px; font-weight: 800; }
/* "1,204 developers attempted · 312 finished": filled by sd-pro.js after load. The line is always there and
   one line tall, so the text arriving shifts nothing; it stays empty while loading or if the request fails. */
.sd-qcount { display: block; min-height: 1.5em; line-height: 1.5; }
.sd-qcount-f::before { content: "· " / ""; }
.sd-q-card .sd-qcount { margin-top: 10px; font-size: 1.1rem; }
/* a phone cannot fit "1,204 developers attempted · 312 finished" on one line: two lines, both reserved */
@media (max-width: 600px) {
  .sd-q-card .sd-qcount { min-height: 3em; }
  .sd-q-card .sd-qcount > span { display: block; }
  .sd-q-card .sd-qcount-f::before { content: none; }
}
.sd-qprog[hidden] { display: none; }
.sd-empty { margin: 0 0 40px; padding: 26px var(--gut); font-size: 1.25rem; background: var(--sd-h-bg); color: var(--sd-h-tx); }

/* the Pro band */
.sd-pro { margin: 48px 0 0; }
.sd-pro > p { font-size: 1.15rem; }
.sd-pro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.sd-pro-status:empty { display: none; }
.sd-pro-status { margin: 14px 0 0 !important; font-weight: 700; }

/* dialogs: a lifted sheet of paper over a dimmed page */
.sd-dialog {
  border: 0; border-radius: 10px; background: var(--paper); color: var(--text); padding: 0;
  width: min(520px, calc(100vw - 32px)); box-shadow: var(--float-shadow); overflow: hidden;
}
.sd-dialog form { padding: 0 24px 24px; }
.sd-dialog h3 { margin: 0 -24px 18px; padding: 18px 24px; background: var(--sd-amber-fill); color: var(--sd-amber-on); font-size: 1.5rem; }
.sd-dialog label { display: block; font-weight: 700; margin-bottom: 6px; }
.sd-dialog input { width: 100%; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--text); }
.sd-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.sd-dialog-in { padding: 0 24px 24px; }
.sd-confirm h2 { margin: 0 -24px 18px; padding: 18px 24px; background: var(--sd-rose-fill); color: var(--sd-rose-on); font-size: 1.5rem; }
.sd-confirm p { margin: 0 0 18px; }
.sd-dialog::backdrop, .sd-sheet::backdrop { background: rgb(10 12 16 / .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sd-dialog[open] { animation: sd-lift .32s var(--ease); }

/* ---------- footer ---------- */
.sd-foot { flex: 1 0 auto; padding: 28px var(--gut); border-top: 1px solid var(--border); background: var(--paper-2); color: var(--text-muted); font-size: 1rem; }
.sd-foot p { margin: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.sd-foot a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--text-muted); }
.sd-foot a:hover { color: var(--text); }
/* A question page paints its <main> empty (only <noscript>) until sd.js renders it in one go. The footer
   would paint just under the nav and then be pushed down (CLS 0.9). Keep it hidden, still in place, until
   the player has content; with scripting off it shows as normal. */
@media (scripting: enabled) {
  .sd-player:not(:has(> :not(noscript))) ~ .sd-foot { visibility: hidden; }
}

/* ---------- the question page ---------- */
.sd-player { padding-bottom: 24px; }

/* requirements: one collapsible block; each part inside is a band (sd-reqs.css) */
.sd-reqs { margin: 0 0 8px; }
.sd-reqs > summary {
  display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 18px var(--gut);
  cursor: pointer; list-style: none; border-top: 1px solid var(--border);
}
.sd-reqs > summary::-webkit-details-marker { display: none; }
.sd-reqs > summary::after {
  content: ""; margin-left: auto; width: 14px; height: 14px; flex: none;
  border-right: 3px solid currentColor; border-bottom: 3px solid currentColor;
  transform: rotate(45deg) translate(-3px, -3px); transition: transform .3s var(--ease);
}
.sd-reqs:not([open]) > summary::after { transform: rotate(-45deg); }
.sd-reqs > summary:hover { background: var(--paper-2); }
.sd-reqs > summary:focus-visible { outline-offset: -4px; }
.sd-reqs-h { margin: 0; font-size: clamp(2rem, 3.6vw, 3.2rem); letter-spacing: -0.02em; }
.sd-reqs > summary .sd-reqs-hint { color: var(--text-muted); font-weight: 700; font-size: 1rem; white-space: nowrap; }
.sd-reqs-body { padding-bottom: 8px; }

/* backend: the tabbed requirements panel (sd-reqs.js renderRequirementTabs; LEARNINGS Q).
   Tablets (601-899): above Level 1, full width, its body capped so Level 1 starts near the fold.
   Wide (>= 900): beside the conversation, the frontend hero's side-by-side: requirements left, the levels
   right. The panel is sticky, so the requirements stay beside every later level; it moves down with the
   top bar when the bar comes back. Phones: under Level 1 until it is answered, then in the sheet. */
.sd-bk-reqs { padding: 0 var(--gut); margin-bottom: 18px; }
.sd-bk-reqs .sd-rqt-body { --cap: clamp(260px, calc(100dvh - 470px), 560px); }
.sd-gb .sd-gb-req { display: none; }
@media (min-width: 601px) and (max-width: 899px) {
  .sd-player-bk .sd-gb .sd-gb-req { display: inline-flex; margin-left: auto; min-height: 32px; padding-block: 0; color: inherit; font-size: 1rem; }
}
@media (min-width: 900px) {
  .sd-player-bk {
    --rqt-top: 14px;
    display: grid; align-items: start;
    grid-template-columns: [full-start] var(--gut) [req-start] minmax(0, 1fr) [req-end] clamp(28px, 2.8vw, 44px) [cv-start] minmax(0, 1.3fr) [cv-end] var(--gut) [full-end];
  }
  body:has(.sd-top:not(.is-away)) .sd-player-bk { --rqt-top: 78px; }
  .sd-player-bk > * { grid-column: full; }
  .sd-player-bk > .sd-rq-head { grid-row: 1; }
  /* the wrapper fills row 2 and the panel sticks inside it, so it stops at the end of the conversation
     and never rides over the results below (sticky is bounded by its parent, and the grid is the whole page) */
  .sd-player-bk > .sd-bk-reqs { grid-column: req; grid-row: 2; align-self: stretch; padding: 0 0 24px; margin: 0; }
  .sd-player-bk > .sd-bk-reqs > .sd-rqt { position: sticky; top: var(--rqt-top); transition: top .28s var(--ease); }
  /* as tall as the window allows once it sticks (top bar shown: 78px + tabs 56px + 14px under it), so the
     left column has no empty band beside a long conversation; at first its bottom runs past the fold */
  .sd-player-bk .sd-bk-reqs .sd-rqt-body { --cap: max(360px, calc(100dvh - 148px)); }
  /* the conversation column: the column IS the edge (--gut 0), so the band, the answer box and every control
     share the column's left and right edges, and the right edge is the page gutter like the title's */
  .sd-player-bk > .sd-cv { grid-column: cv; grid-row: 2; --gut: 0px; padding-top: 0; min-width: 0; container: sdcv / inline-size; }
}

/* the Requirements dialog (backend, tablet widths): a fixed height, so switching tabs never resizes it */
.sd-req-dlg { width: min(900px, calc(100vw - 32px)); height: min(86vh, 920px); }
.sd-req-dlg[open] { display: flex; flex-direction: column; }
.sd-req-dlg-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px 12px 24px; border-bottom: 1px solid var(--border); }
.sd-req-dlg-top h2 { margin: 0; font-size: 1.75rem; line-height: 1.1; }
.sd-req-dlg-in { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 24px 0; }
.sd-req-dlg-in .sd-rqt { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sd-req-dlg-in .sd-rqt-body { flex: 1; min-height: 0; height: auto; }
.sd-req-dlg .sd-rq-gh { margin: 0 0 6px; padding: 0; background: none; color: var(--sd-h-ink); }

/* ---------- the conversation ----------
   Every level is the guide's band (its reply to the last answer, if any, then the question), then the
   player's answer. The level being answered is the lit band: solid guide blue, the biggest question
   on the page, the answer box directly under it (LEARNINGS I.8). Answered levels are the blue tint. */
.sd-cv { padding-top: 8px; }
.sd-cv-rows { list-style: none; margin: 0; padding: 0; }
.sd-cv-row { padding: 0 0 28px; }
.sd-cv-row p { margin: 0; line-height: 1.5; }

.sd-gb { padding: 18px var(--gut) 20px; background: var(--sd-blue-bg); color: var(--sd-blue-tx); scroll-margin-top: 16px; }
.sd-gb:focus { outline: none; }
.sd-gb:focus-visible { outline: 3px solid var(--focus); outline-offset: -5px; }
.sd-gb p { margin: 0; }
.sd-gb-top { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 6px !important; font-weight: 800; font-size: 1rem; }
.sd-gb-n { color: var(--sd-blue-ink); }
.sd-gb-who { color: var(--text-muted); }
.sd-gb-say { font-size: 1.08em; line-height: 1.55; margin-bottom: 10px !important; white-space: pre-line; overflow-wrap: anywhere; }
.sd-gb-q { margin: 0; font: 700 clamp(1.2rem, 1.7vw, 1.45rem)/1.3 var(--font-display); letter-spacing: 0; overflow-wrap: anywhere; }
.sd-gb.is-current { background: var(--sd-blue-fill); color: var(--sd-blue-on); padding-block: 24px 28px; }
.sd-gb.is-current .sd-gb-n, .sd-gb.is-current .sd-gb-who { color: var(--sd-blue-on); }
.sd-gb.is-current .sd-gb-who { opacity: 1; font-weight: 700; }
.sd-gb.is-current .sd-gb-say { font-size: 1.15em; margin-bottom: 14px !important; }
/* Round 5, point 7: was 38.9px at 1440, the size of a page title. Now 26px at 1440 and 22px from 1024 down:
   below the title (40 / 28px), above the guide's own words (~21px) and past levels' questions (19-23px). */
.sd-gb.is-current .sd-gb-q { font: 800 clamp(1.375rem, 1.8vw, 1.625rem)/1.25 var(--font-display); letter-spacing: 0; }
.sd-gb.is-current :focus-visible { outline-color: #ffffff; }
.sd-gb.is-current:focus-visible { outline-color: #ffffff; }
/* One edge for the whole level (Rahul, 2026-11-20: "the blue box's starting and ending are not the same as the
   text field's"). On the question page the band is a box on the gutter, like the answer box, the "You" block and
   every control under them, and its text sits 18px inside it: the textarea's 2px border + 16px padding, and the
   "You" block's padding, so the question, the answer and the typed text start on one line too. */
.sd-cv .sd-gb { margin-inline: var(--gut); padding-inline: 18px; border-radius: 6px; }
.sd-gb-act { margin-top: 12px !important; }
/* "I disagree" is a real button on the band (Rahul, 2026-11-20, round 5 point 11: the underlined link "is not that
   clearly visible"). The band is --sd-blue-fill #2d6ae3 in BOTH themes, so one set of colours serves light and dark:
   white text and a 2px white border on the blue (4.90:1), and on hover/press the button fills white with
   #1f4fb3 text (the light theme's --sd-blue-ink, written out because the dark theme's is pale). Focus is a white ring outside the border, clear of the fill. */
.sd-gb .sd-gb-dis {
  min-height: 44px; padding: 0 18px; border: 2px solid var(--sd-blue-on); border-radius: 6px; background: transparent;
  color: var(--sd-blue-on); text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease);
}
@media (hover: hover) { .sd-gb .sd-gb-dis:hover { background: var(--sd-blue-on); color: #1f4fb3; } }
.sd-gb .sd-gb-dis:active { background: var(--sd-blue-on); color: #1f4fb3; }
.sd-gb .sd-gb-dis:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }

.sd-cv-you { margin: 14px var(--gut) 0; padding: 14px 18px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.sd-cv-who { font-weight: 800; font-size: .95rem; margin-bottom: 4px !important; color: var(--text-muted); }
.sd-cv-a { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.08em; }
.sd-cv-why, .sd-cv-act { margin-top: 6px !important; color: var(--text-muted); overflow-wrap: anywhere; }
.sd-cv-act { font-weight: 700; }

/* the guide is answering / could not answer: keeps the room the next level will take */
.sd-cv-pending { padding: 4px var(--gut) 24px; }
.sd-cv-wait { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; border-radius: 6px; background: var(--paper-2); font-weight: 700; scroll-margin-bottom: 120px; }
.sd-cv-wait p { flex: 1 1 260px; margin: 0; }
.sd-cv-wait.is-error { background: var(--sd-rose-bg); color: var(--sd-rose-tx); flex-direction: column; align-items: flex-start; border: 1.5px solid var(--sd-rose-ink); }
.sd-cv-wait.is-error p { flex: none; }
.sd-cv-pad { margin-top: 16px; }
.sd-cv-dots { display: inline-flex; gap: 6px; flex: none; }
.sd-cv-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--sd-blue-fill); animation: sd-cv-dot 1.1s ease-in-out infinite; }
.sd-cv-dots span:nth-child(2) { animation-delay: .15s; }
.sd-cv-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes sd-cv-dot { 0%, 80%, 100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: none; } }

/* the level being answered */
.sd-cv-cur { margin: 0; }
.sd-cv-work { padding: 22px var(--gut) 34px; }
.sd-cv-cur.is-arriving .sd-gb { animation: sd-arrive .5s var(--ease) both; }
.sd-cv-cur.is-arriving .sd-cv-work { animation: sd-rise .5s var(--ease) .25s both; }
.sd-cv-hint, .sd-cv-lbl { display: block; font-weight: 700; margin: 0 0 10px !important; }
.sd-options { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sd-option {
  display: flex; gap: 14px; align-items: flex-start; min-height: 60px; padding: 16px 18px; cursor: pointer;
  border: 1.5px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--text); font-size: 1.1em; line-height: 1.5;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), transform .1s var(--ease);
}
.sd-option:hover { border-color: var(--sd-blue-ink); }
.sd-option:active { transform: scale(.995); }
.sd-option:has(input:checked) { border-color: var(--sd-blue-ink); background: var(--sd-blue-bg); box-shadow: inset 0 0 0 1.5px var(--sd-blue-ink); font-weight: 700; }
.sd-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.sd-option input { margin: .2em 0 0; accent-color: var(--sd-blue-ink); width: 1.3em; height: 1.3em; flex: none; }
.sd-cv-yesno { flex-direction: row; flex-wrap: wrap; }
.sd-cv-yesno .sd-option { flex: 1 1 180px; }
.sd-number label, .sd-why label { display: block; font-weight: 700; margin: 6px 0 8px; }
.sd-number-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sd-number input { font: 600 1.5rem/1.2 var(--font-mono); width: 16ch; max-width: 100%; min-height: 60px; padding: 10px 14px; font-variant-numeric: tabular-nums; }
.sd-step textarea, .sd-number input {
  border: 2px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.sd-step textarea { display: block; width: 100%; padding: 14px 16px; resize: vertical; font-size: 1.15em; line-height: 1.55; min-height: 8.5em; }
.sd-step textarea:hover, .sd-number input:hover { border-color: var(--text-muted); }
.sd-step textarea:focus-visible, .sd-number input:focus-visible { outline: none; border-color: var(--sd-blue-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sd-blue-fill) 40%, transparent); }
/* The hint in an empty answer box (LEARNINGS U, point 2): --text-muted on --paper, opacity pinned because Firefox
   fades placeholders to .54 by default, which would drop it under 4.5:1. */
.sd-step textarea::placeholder { color: var(--text-muted); opacity: 1; }
.sd-why { margin-top: 12px; }

/* Enter to send: the player's choice, always shown under the box (LEARNINGS I.6) */
.sd-enter { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 8px; cursor: pointer; font-size: 1rem; font-weight: 700; color: var(--text-muted); }
.sd-enter input { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; margin: 0; border-radius: 12px; border: 2px solid var(--text-muted); background: var(--paper); position: relative; cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.sd-enter input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform .18s var(--ease), background-color .15s var(--ease); }
.sd-enter input:checked { background: var(--action); border-color: var(--action); }
.sd-enter input:checked::after { transform: translateX(18px); background: var(--action-on); }
.sd-enter input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sd-enter:has(input:checked) { color: var(--text); }

/* Give up and I'm done on the left, the main action on the right (LEARNINGS I.5) */
.sd-step-actions { margin-top: 16px; }
.sd-cv-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sd-cv-end, .sd-cv-send { display: flex; flex-wrap: wrap; gap: 12px; }
.sd-cv-send { margin-left: auto; }
.sd-form-msg { margin: 14px 0 0 !important; padding: 12px 16px; border-radius: 6px; background: var(--sd-rose-bg); color: var(--sd-rose-tx); border: 1.5px solid var(--sd-rose-ink); font-weight: 700; }
.sd-form-msg:empty { display: none; }
/* The capture notice under the answer box (LEARNINGS S): one muted line, a fact, not a box. */
.sd-cv-privacy { margin: 14px 0 0 !important; color: var(--text-muted); line-height: 1.5; }

/* help controls: quiet text buttons, not a toolbar */
.sd-tbtn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 2px; border: 0; background: none; cursor: pointer;
  font: 700 1.02rem/1.2 var(--font-body); color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: .22em; text-decoration-thickness: .08em; -webkit-tap-highlight-color: transparent;
}
.sd-tbtn:hover { text-decoration-color: currentColor; }
.sd-help { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--border); }
.sd-help-toggle { display: none; }
.sd-help-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; }
.sd-help-list > .sd-tbtn { color: var(--text-muted); }
.sd-help-list > .sd-tbtn:hover { color: var(--text); }
.sd-workon { flex: 1 1 100%; padding: 8px 0 4px; }
.sd-workon label { display: block; font-weight: 700; margin-bottom: 2px; }
.sd-workon-hint { margin: 0 0 8px; color: var(--text-muted); line-height: 1.45; }
.sd-workon-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.sd-workon-row input { flex: 1 1 280px; min-width: 0; min-height: 48px; padding: 8px 12px; border: 2px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--text); }
.sd-btn-sm { min-height: 48px; padding: 8px 18px; }

/* "Your design so far": a box right under the answer box it is fed from, quieter than the lit band so the
   question and the answer stay the most prominent things (phones: in the sheet) */
.sd-spec { margin: 20px 0 0; border: 1.5px solid var(--sd-h-bd); border-radius: 6px; background: var(--paper); overflow: clip; }
.sd-spec > summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; min-height: 52px; padding: 10px 16px;
  background: var(--sd-h-bg); color: var(--sd-h-tx); cursor: pointer; list-style: none;
}
.sd-spec > summary::-webkit-details-marker { display: none; }
.sd-spec > summary::after {
  content: ""; margin-left: auto; width: 10px; height: 10px; flex: none; border-right: 3px solid var(--sd-h-ink); border-bottom: 3px solid var(--sd-h-ink);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform .3s var(--ease);
}
.sd-spec:not([open]) > summary::after { transform: rotate(-45deg); }
.sd-spec > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -4px; }
.sd-spec-h { margin: 0; font-size: clamp(1.15rem, 1.5vw, 1.35rem); color: var(--sd-h-ink); }
.sd-spec-n { font-weight: 700; }
.sd-spec-body { padding: 0 16px 16px; }
.sd-spec-why { margin: 12px 0 0; color: var(--text-muted); line-height: 1.5; }
.sd-spec-list > li { overflow-wrap: anywhere; }
.sd-spec-empty { margin: 10px 0 0; color: var(--text-muted); font-weight: 700; }
.sd-spec-board { margin: 14px 0 0 !important; }

/* the board, opened from the design panel */
.sd-board-dlg { width: min(1400px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
.sd-board-dlg-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--paper); border-bottom: 1px solid var(--border); }
.sd-board-dlg-top h2 { margin: 0; font-size: 1.6rem; }
.sd-board-dlg-in { padding: 16px 20px 20px; }

.sd-cv-mbar { display: none; }
.sd-sheet { display: none; }

/* ---------- after the end: the way back to the results (the view itself is sd-results.css) ---------- */
.sd-rx-slot[hidden] { display: none; }
.sd-cv-seeres { margin: 4px var(--gut) 8px; }

/* ---------- motion ---------- */
@keyframes sd-arrive { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } }
@keyframes sd-rise { from { opacity: 0; transform: translateY(32px); } }
@keyframes sd-lift { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes sd-sheet-in { from { transform: translateY(100%); } }

/* ---------- phones: the current step is the screen ---------- */
@media (max-width: 600px) {
  body { font-size: 1.125rem; }
  .sd-sec { margin-bottom: 32px; }
  .sd-sec-h { padding-block: 18px 16px; margin-bottom: 20px; }
  .sd-btn { padding: 10px 18px; }
  .sd-cv-row { padding-bottom: 22px; }
  .sd-cv-you { padding: 12px 18px; }
  .sd-cv-wait { padding: 12px 14px; }
  .sd-gb.is-current { padding-block: 20px 22px; }
  .sd-cv-work { padding-top: 18px; }
  .sd-cv-actions { gap: 10px; }
  .sd-cv-end, .sd-cv-send { gap: 8px; }
  .sd-cv-actions .sd-btn { padding-inline: 12px; }
  .sd-help-toggle { display: inline-flex; }
  .sd-help-list { flex-direction: column; align-items: flex-start; }
  .sd-help:not(.is-open) .sd-help-list { display: none; }
  .sd-cv .sd-spec { display: none; }

  /* conversation first; before step 1 is answered the requirements sit under it, after that in the sheet */
  .sd-player.is-playing { display: flex; flex-direction: column; }
  .sd-player.is-playing > .sd-rq-head { order: 0; }
  .sd-player.is-playing > .sd-cv { order: 1; }
  .sd-player.is-playing > .sd-cv-reqs { order: 2; }
  .sd-player.is-playing > .sd-cv-mbar { order: 3; }
  .sd-player.is-started > .sd-reqs { display: none; }
  .sd-player.is-playing { padding-bottom: 0; }
  body.sd:has(.sd-cv-mbar:not([hidden])) { padding-bottom: 76px; }

  .sd-cv-mbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--paper) 84%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
    border-top: 1px solid var(--border);
  }
  .sd-cv-mbar[hidden] { display: none; }
  .sd-cv-mbar-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sd-cv-mbar-btns .sd-btn { min-height: 48px; padding: 8px 6px; font-size: .98rem; min-width: 0; line-height: 1.15; }

  .sd-sheet[open] {
    display: block; position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none;
    max-height: 90dvh; overflow: auto; padding: 0 0 24px; border: 0; border-radius: 14px 14px 0 0;
    background: var(--paper); color: var(--text); box-shadow: var(--float-shadow); animation: sd-sheet-in .38s var(--ease);
  }
  .sd-sheet-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--gut); background: var(--paper); border-bottom: 1px solid var(--border); }
  .sd-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .sd-tab { min-height: 44px; padding: 8px 14px; border-radius: 6px; border: 1.5px solid var(--rule); background: var(--paper); color: var(--text); font: 700 1rem/1.2 var(--font-body); cursor: pointer; }
  .sd-tab[aria-pressed="true"] { background: var(--action); color: var(--action-on); border-color: var(--action); }
  .sd-sheet-close { gap: 8px; }
  .sd-sheet-close-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
  .sd-sheet-design { padding: 16px var(--gut) 0; }
  .sd-sheet-h { margin: 0 0 8px; font-size: 1.6rem; color: var(--sd-indigo-ink); }
  .sd-mbar-n { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .4em; border-radius: 999px; background: var(--sd-indigo-fill); color: var(--sd-indigo-on); font-size: .9rem; }
  .sd-sheet-top .sd-btn { min-height: 44px; }
  /* the requirements tabs in the sheet: on the gutter, the tab row held under the sheet's own top row */
  .sd-sheet .sd-rqt { padding: 12px var(--gut) 0; }
  .sd-sheet .sd-rqt-tabs { position: sticky; top: 69px; z-index: 1; background: var(--paper); padding-top: 4px; margin-top: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .sd-cv-cur.is-arriving .sd-gb, .sd-cv-cur.is-arriving .sd-cv-work, .sd-dialog[open], .sd-sheet[open], .sd-toast { animation: sd-fade .2s linear both; }
  .sd-cv-cur.is-arriving .sd-cv-work { animation-delay: 0s; }
  .sd-top { transition: none !important; }
  .sd-cv-dots span { animation: none; opacity: 1; }
  .sd-btn:active, .sd-iconbtn:active, .sd-option:active { transform: none; }
  .sd-nav { transform: none !important; }
}
@keyframes sd-fade { from { opacity: 0; } }
@media (prefers-reduced-transparency: reduce) {
  .sd-top, .sd-cv-mbar { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.sd-board-start { margin: 12px 0 0 !important; }

/* ---------- account: "Sign in with Google" / the signed-in menu (sd-auth.js) ---------- */
.sd-account { position: relative; flex: none; display: flex; align-items: center; }
.sd-account:empty { display: none; }
.sd-signin {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border-radius: 6px; cursor: pointer;
  font: 700 1rem/1.2 var(--font-body); white-space: nowrap; background: var(--paper); color: var(--text); border: 1.5px solid var(--rule);
  transition: border-color .15s var(--ease), transform .1s var(--ease);
}
.sd-signin:hover { border-color: var(--text); }
.sd-signin:active { transform: scale(.97); }
.sd-g { width: 20px; height: 20px; flex: none; }
.sd-signin-s { display: none; }
.sd-acct > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px 4px 4px; border-radius: 22px; cursor: pointer;
  list-style: none; border: 1.5px solid var(--rule); background: var(--paper); color: var(--text); font: 700 1rem/1.2 var(--font-body);
}
.sd-acct > summary::-webkit-details-marker { display: none; }
.sd-acct > summary:hover, .sd-acct[open] > summary { border-color: var(--text); }
.sd-acct-av {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--sd-indigo-bg); color: var(--sd-indigo-ink); font-weight: 800;
}
.sd-acct-n { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-acct-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(320px, calc(100vw - 32px)); padding: 16px;
  border-radius: 8px; background: var(--paper); color: var(--text); border: 1px solid var(--border); box-shadow: var(--float-shadow);
}
.sd-acct-pop p { margin: 0 0 12px; color: var(--text-muted); line-height: 1.45; }
.sd-acct-pop .sd-acct-who { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
/* "Sign in with Google" is shortened to "Sign in" up to 1400px: between 1210 and 1370 the full label pushed the
   theme button past the right edge on question pages */
@media (max-width: 1400px) {
  .sd-signin-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sd-signin-s { display: inline; }
  .sd-acct-n { display: none; }
  .sd-acct > summary { padding: 4px; }
}
/* a narrow phone: only the Google mark (the button's name stays "Sign in"), so the bar fits 320-460px */
@media (max-width: 420px) {
  .sd-signin { padding: 8px 11px; }
}
@media (max-width: 480px) {
  .sd-signin-s { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- "Write your answer": a bar fixed to the bottom while the level being answered is below the screen
   (round 5, point 9; markup and the show/hide test in sd.js jumpBar/updateJump). The current band's blue with
   white text (4.90:1 in both themes, the band never changes colour); the button is white with the light theme's
   blue ink #1f4fb3 (7.43:1), written out because the dark theme's --sd-blue-ink is pale. Fixed, so showing and
   hiding it moves nothing on the page. */
.sd-jump {
  position: fixed; z-index: 45; left: var(--gut); right: var(--gut); bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px 20px; margin: 0; padding: 10px 10px 10px 18px; border-radius: 6px;
  background: var(--sd-blue-fill); color: var(--sd-blue-on); box-shadow: var(--float-shadow);
  transition: transform .32s var(--ease), visibility 0s;
}
.sd-jump.is-away { transform: translateY(calc(100% + 48px)); visibility: hidden; transition: transform .24s var(--ease), visibility 0s .24s; }
.sd-jump-t { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1.1rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-jump-n { font-weight: 800; }
.sd-jump-go {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 18px; margin: 0;
  border: 2px solid #ffffff; border-radius: 6px; background: #ffffff; color: #1f4fb3; cursor: pointer;
  font: 700 1.05rem/1.2 var(--font-body); white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform .1s var(--ease);
}
.sd-jump-go:active { transform: scale(.97); }
.sd-jump-go:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
.sd-jump-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sd-jump-s { display: none; }
/* the reset toast scrolls the page to the top, where the bar shows: keep the toast above it */
body.sd:has(.sd-jump:not(.is-away)) .sd-toast { bottom: 100px; }
@media (max-width: 600px) {
  /* on top of the bottom bar (Requirements / Your design), the question on up to two lines */
  .sd-jump { bottom: calc(var(--sd-mbar-h, 0px) + 8px); padding: 8px 8px 8px 14px; gap: 12px; }
  .sd-jump-t { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 1rem; }
  .sd-jump-l { display: none; }
  .sd-jump-s { display: inline; }
  .sd-jump-go { padding: 0 12px 0 14px; }
  body.sd:has(.sd-jump:not(.is-away)) .sd-toast { bottom: calc(var(--sd-mbar-h, 0px) + 84px); }
}
@media (prefers-reduced-motion: reduce) {
  .sd-jump, .sd-jump.is-away { transition: none; }
  .sd-jump-go:active { transform: none; }
}

/* phones: a dialog is the screen's width less 12px each side, its buttons full width and stacked, the main one last
   (at the bottom, under the thumb) */
@media (max-width: 600px) {
  .sd-dialog:not(.sd-board-dlg) { width: calc(100vw - 24px); }
  .sd-dialog .sd-dialog-actions { flex-direction: column; align-items: stretch; }
  .sd-dialog .sd-dialog-actions .sd-btn { width: 100%; justify-content: center; }
}

/* ---------- diagram pictures: attach, preview, the interviewer's marked copy (IMAGE-REVIEW-SPEC 2, 7) ---------- */
.sd-cv-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; margin-top: 8px; }
.sd-cv-tools .sd-enter { margin-top: 0; }
.sd-attach { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; color: var(--text); }
.sd-attach:disabled { color: var(--text-muted); text-decoration: none; cursor: progress; }
.sd-attach-ic { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-attach-box { display: grid; gap: 8px; }
.sd-attach-box:has(.sd-attach-pv), .sd-attach-box:has(.sd-attach-err:not(:empty)) { margin-top: 10px; }
.sd-attach-pv { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; }
.sd-attach-img, .sd-cv-pic-img { display: block; width: auto; height: auto; max-width: min(100%, 360px); max-height: 160px; border: 1px solid var(--rule); border-radius: 6px; background: #ffffff; }
.sd-attach-rm { min-height: 44px; color: var(--sd-rose-ink); }
.sd-attach-err { margin: 0; color: var(--sd-rose-ink); font-weight: 700; }
.sd-attach-err:empty { display: none; }
.sd-drop-hint { display: none; }
.sd-cv-form { position: relative; }
.sd-cv-form.is-dropping { outline: 3px dashed var(--sd-blue-ink); outline-offset: 6px; border-radius: 6px; }
.sd-cv-form.is-dropping .sd-drop-hint {
  display: grid; place-items: center; position: absolute; inset: 0; margin: 0; z-index: 2; border-radius: 6px;
  background: color-mix(in srgb, var(--paper) 90%, transparent); color: var(--text); font: 800 1.25rem/1.3 var(--font-display); pointer-events: none;
}
.sd-cv-pic { margin: 8px 0 0 !important; font-weight: 700; }
/* the interviewer's copy sits on a paper card inside the guide's band, so the board and its words keep their own colours */
.sd-gb-read { margin: 4px 0 14px; padding: 14px 16px 12px; border-radius: 8px; background: var(--paper); color: var(--text); }
.sd-gb-read .sdb { margin: 0; }
.sd-gb-read summary { cursor: pointer; font-weight: 800; min-height: 32px; }
.sd-gb-read[open] summary { margin-bottom: 8px; }
.sd-gb-read-act { margin: 10px 0 0 !important; }
@media (max-width: 600px) { .sd-gb-read { padding: 12px 10px 10px; margin-inline: calc(var(--gut) * -0.5); } }

/* "Show my diagram with the fix" (Rahul, 2026-11-20): prominent, amber on the interviewer's blue band */
.sd-gb-reveal { margin: 6px 0 14px; }
.sd-btn.sd-fix-show { background: var(--sd-amber-fill); color: var(--sd-amber-on); border: 2px solid var(--sd-amber-fill); font-weight: 800; min-height: 48px; padding: 10px 20px; box-shadow: 0 2px 0 rgb(0 0 0 / .18); }
.sd-btn.sd-fix-show:hover { filter: brightness(1.06); }
.sd-btn.sd-fix-show:focus-visible { outline: 3px solid var(--sd-amber-on); outline-offset: 3px; }
@media (max-width: 600px) { .sd-btn.sd-fix-show { width: 100%; } }
