
/* ===== DRAWSOLVE WEB DESIGN TOKENS — BEGIN =========================================
   CANONICAL COPY. This block is pasted byte-identical (delimiters included) into
   every per-surface design target `Web_*_V<n>.html`. A drift between any two copies
   is a bug, not a variant. The newest `Web_*` target holds the canonical copy.

   Conforming to the DrawSolve Technical Design System:
   - Scrolling_Skeleton_Demo_V10.html
   - Perception_GUI_Full_V13.html
   - Intake_Form_V6.html
   ================================================================================= */
/* ===== DRAWSOLVE COLOUR ROLES — BEGIN · generated by scripts/build_theme.py from app/theme/palette.json; never edited by hand ===== */
:root {
  --accent: #1a73e8;
  --accent-hover: #1463ca;
  --accent-pressed: #1153aa;
  --border-accent: #bfd8f9;
  --bg-accent-wash: #edf4fd;
  --overlay-accent-faint: rgba(26,115,232,0.08);
  --focus-ring: rgba(26,115,232,0.15);
  --focus-ring-strong: rgba(26,115,232,0.3);
  --text-ink: #111111;
  --text-strong: #334155;
  --text-body: #64748b;
  --text-faint: #94a3b8;
  --text-dark: #111418;
  --fill-light: #cccccc;
  --bg-dark: #111418;
  --bg-dark-hover: #111418;
  --bg-dark-pressed: #111418;
  --bg-g1: #fafafa;
  --bg-g2: #eceef1;
  --bg-glass: rgba(255,255,255,0.92);
  --border-rest: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-emphasis: #64748b;
  --border-faint: #94a3b8;
  --shadow-hairline: rgba(0,0,0,0.04);
  --shadow-soft: rgba(0,0,0,0.1);
  --shadow-medium: rgba(0,0,0,0.2);
  --overlay-scrim: rgba(15,23,42,0.45);
  --overlay-light-faint: rgba(255,255,255,0.14);
  --overlay-light: rgba(255,255,255,0.22);
  --overlay-light-strong: rgba(255,255,255,0.4);
  --danger: #cc3333;
  --border-danger: #cc3333;
  --danger-hover: #7f1d1d;
  --bg-danger-hover: #fecaca;
  --bg-danger-wash: #fae3e0;
  --overlay-danger: rgba(185,28,28,0.18);
  --warning: #92400e;
  --border-warning: #d97706;
  --border-warning-soft: #fcd34d;
  --bg-warning-wash: #fffbeb;
  --overlay-warning: rgba(146,64,14,0.09);
  --stroke-highlight: #d97706;
  --success: #2a8855;
  --bg-success-wash: #f0fdf4;
  --border-success: #bbf7d0;
  --source-user: #111111;
  --source-statement: #2a8855;
  --source-derived: #1a73e8;
  --source-extracted: #1a73e8;
  --source-variable: #1a73e8;
  --source-soft: #64748b;
  --source-rejection: #cc3333;
  --btn-dark-hover: #334155;
  --btn-dark-pressed-hover: #334155;
  --bg-hover-light: #eceef1;
  --border-hover: #94a3b8;
  --border-disabled: #eceef1;
  --shadow-hover: rgba(0,0,0,0.2);
  --bg-table-head: #f1f5f9;
  --bg-hover-wash: #f1f5f9;
  --footer-bg: #ffffff;
  --state-remove: #cc3333;
  --state-remove-glow: rgba(185,28,28,0.18);
}
/* ===== DRAWSOLVE COLOUR ROLES — END ===== */
:root {
  /* brand & primary (DrawSolve Technical Steel Blue) */
  --primary:        var(--accent);
  --primary-hover:  var(--accent-hover);
  --primary-press:  var(--accent-pressed);
  --primary-wash:   var(--bg-accent-wash);
  --primary-line:   var(--border-accent);

  /* ink & surfaces */
  --ink:            var(--text-ink);
  --ink-2:          var(--text-strong);
  --muted:          var(--text-body);
  --faint:          var(--text-faint);
  --surface:        #ffffff;
  --surface-bg:     var(--bg-g1);
  --surface-card:   #ffffff;
  --surface-muted:  var(--bg-g1);
  --surface-dark:   var(--bg-dark);
  --surface-dim:    var(--bg-g2);
  --wash:           var(--bg-g1);
  --wash-2:         var(--bg-hover-wash);
  --line:           var(--border-rest);
  --line-2:         var(--border-rest);

  /* ------------------------------------------------------------------------
     STATUS PALETTE — conforming to DrawSolve reference specifications
     ------------------------------------------------------------------------ */
  --st-neutral-fg:   var(--text-body);  --st-neutral-bg:   var(--bg-g1);  --st-neutral-bd:   var(--border-strong);
  --st-attention-fg: var(--accent);  --st-attention-bg: var(--bg-accent-wash);  --st-attention-bd: var(--border-accent);
  --st-good-fg:      var(--success);  --st-good-bg:      var(--bg-success-wash);  --st-good-bd:      #bbf7d0;
  --st-problem-fg:   var(--danger);  --st-problem-bg:   var(--bg-danger-wash);  --st-problem-bd:   var(--border-danger);

  /* Role aliases onto the four tiers */
  --st-halted-fg: var(--st-problem-fg);
  --st-halted-bg: var(--st-problem-bg);
  --st-halted-bd: var(--st-problem-bd);
  --st-ready-fg:  var(--st-good-fg);
  --st-ready-bg:  var(--st-good-bg);
  --st-ready-bd:  var(--st-good-bd);
  --st-waiting-fg: var(--st-neutral-fg);
  --st-waiting-bg: var(--st-neutral-bg);
  --st-waiting-bd: var(--st-neutral-bd);

  /* Provenance Hierarchy - Color IS Provenance */
  --prov-user:       var(--source-user);
  --prov-statement:  var(--source-statement);
  --prov-derived:    var(--source-derived);
  --prov-approx:     var(--source-soft);
  --prov-rejection:  var(--source-rejection);

  /* Severity Levels */
  --severity-error-border:   var(--border-danger);
  --severity-error-bg:       var(--bg-danger-wash);
  --severity-error-text:     var(--danger);
  --severity-error-badge:    var(--border-danger);

  --severity-warning-border: var(--border-warning);
  --severity-warning-bg:     var(--bg-warning-wash);
  --severity-warning-text:   var(--warning);
  --severity-warning-badge:  var(--border-warning);

  --severity-info-border:    var(--accent);
  --severity-info-bg:        var(--bg-accent-wash);
  --severity-info-text:      var(--accent);
  --severity-info-badge:     var(--accent);

  /* geometry */
  --r-card:  8px;
  --r-media: 12px;
  --r-input: 4px;
  --r-btn:   4px;
  --r-pill:  999px;
  --gutter:  24px;
  --page-max: 1360px;
  --hdr-h:   64px;

  /* elevation */
  --sh-1: 0 1px 3px var(--shadow-hairline);
  --sh-2: 0 2px 8px var(--shadow-soft);
  --sh-3: 0 10px 30px var(--shadow-soft);
  --sh-pill: 0 1px 3px var(--shadow-soft);

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 15px;
  --fs-xl: 18px; --fs-2xl: 24px; --fs-3xl: 34px;

  --ease: cubic-bezier(.2,.7,.3,1);
}
/* ===== DRAWSOLVE WEB DESIGN TOKENS — END =========================================== */

/* ===== DRAWSOLVE WEB CHROME KIT — BEGIN ============================================
   CANONICAL COPY, like the token block above: the header, the status chip, the
   button family and the model card are the four things every surface shares, so
   they are pasted byte-identical into every `Web_*` target. A drift between two
   copies is a bug, not a variant.
   ================================================================================= */
/* ============================================================================
   BUTTONS (Tactile Mechanical Click Feel)
   ========================================================================= */
.btn-tactile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.12s ease;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}
.btn-tactile:active:not(:disabled) {
  transform: translateY(1.5px) scale(0.97);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: var(--fs-md);
  padding: 8px 16px; border-radius: var(--r-btn);
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s var(--ease), border-color .12s var(--ease),
              transform .1s var(--ease), box-shadow .12s var(--ease), color .12s var(--ease);
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1.5px) scale(0.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--primary); color: #fff; border: 1px solid var(--primary-hover);
  box-shadow: 0 1px 3px var(--focus-ring-strong);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--primary-press); }

.btn-secondary {
  background: var(--bg-g1); color: var(--ink-2); border: 1px solid var(--line);
}
.btn-secondary:hover:not(:disabled) { background: var(--border-rest); color: var(--ink); }
.btn-secondary:active:not(:disabled) { background: var(--border-strong); }

.btn-dark { background: var(--surface-dark); color: #fff; border: 1px solid var(--surface-dark); }
.btn-dark:hover:not(:disabled) { background: var(--btn-dark-hover); }

.btn-outline { border-color: var(--line); color: var(--ink-2); background: var(--surface); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary-line); background: var(--primary-wash); color: var(--primary); }

.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--wash-2); color: var(--ink); }

.btn-quiet { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.btn-quiet:hover:not(:disabled) { border-color: var(--primary-line); background: var(--primary-wash); color: var(--primary); }

.btn-danger { background: var(--st-halted-fg); color: #fff; border: 1px solid var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }

/* A button that carries a second line under its label. The label keeps its own
   weight and the line below is a quiet stamp, so the control still reads as one
   button rather than two stacked words. */
.btn-beta { flex-direction: column; gap: 0; line-height: 1.15; }
.btn-beta .btn-sub {
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  opacity: .78; margin-top: 2px;
}
.btn-beta.btn-lg .btn-sub { font-size: 10.5px; }
.btn-beta.btn-sm .btn-sub { font-size: 9px; }

.btn-sm { padding: 6px 12px; font-size: var(--fs-sm); }
.btn-lg { padding: 11px 22px; font-size: var(--fs-lg); }
.btn-block { display: flex; width: 100%; }

/* Delete row button (compact danger hover) */
.btn-delete-row {
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  color: var(--text-body); background: var(--bg-g1); border: 1px solid var(--line-2);
  border-radius: var(--r-input); cursor: pointer; transition: all 0.12s ease;
  white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-family: inherit; user-select: none; -webkit-user-select: none;
}
.btn-delete-row:hover { background: var(--bg-danger-hover); border-color: var(--border-danger); color: var(--danger); }
.btn-delete-row:active { background: var(--bg-danger-hover); transform: translateY(1.5px) scale(0.97); }

/* Circular icon button — row arrows & controls */
.btn-round {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--sh-1); flex: none; display: grid; place-items: center;
  cursor: pointer; transition: all 0.12s ease; user-select: none;
}
.btn-round:hover:not(:disabled) { background: var(--wash-2); border-color: var(--primary-line); color: var(--primary); }
.btn-round:active:not(:disabled) { transform: translateY(1.5px) scale(0.95); }
.btn-round.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-round.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-round.sm { width: 28px; height: 28px; }

.icon { width: 16px; height: 16px; flex: none; stroke-width: 2; }
.icon.sm { width: 14px; height: 14px; }
.icon.lg { width: 20px; height: 20px; }

/* Info ("i") button */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--primary-wash); color: var(--primary);
  border: 1px solid var(--primary-line);
  font-size: 11px; font-weight: 700; font-family: "Georgia", serif; font-style: italic;
  cursor: pointer; line-height: 1; padding: 0; margin-left: 4px;
  transition: all 0.15s ease; vertical-align: middle; user-select: none; outline: none;
}
.info-btn:hover {
  background: var(--primary); color: #ffffff; border-color: var(--primary); transform: scale(1.1);
}
.info-btn:active { transform: scale(0.95); }

/* ============================================================================
   CHIPS, BADGES, PILLS
   ========================================================================= */
.chip, .chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 5px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--wash-2); color: var(--ink-2);
  white-space: nowrap; cursor: pointer; transition: all 0.12s ease;
}
.chip:hover, .chip-btn:hover { background: var(--border-rest); color: var(--ink); }

.chip-btn:hover {
  border-color: var(--border-hover);
}
.chip.plain { background: var(--surface); font-weight: 500; color: var(--muted); }
.chip.solid, .chip.latched,
.chip-btn.solid, .chip-btn.latched { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-btn.latched:hover { background: var(--primary-hover); color: #fff; }
.chip.selected { background: var(--primary-wash); border-color: var(--primary-line); color: var(--primary); }

.chip.removable { padding-right: 5px; cursor: default; background: var(--surface-dark); color: #fff; border-color: var(--surface-dark); }
.chip.removable button {
  border: none; background: var(--overlay-light); color: #fff; cursor: pointer;
  width: 15px; height: 15px; border-radius: 50%; font-size: 10px; line-height: 1;
  display: grid; place-items: center; padding: 0; font-family: inherit;
}
.chip.removable button:hover { background: var(--overlay-light-strong); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid;
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status.neutral   { color: var(--st-neutral-fg);   background: var(--st-neutral-bg);   border-color: var(--st-neutral-bd); }
.status.attention { color: var(--st-attention-fg); background: var(--st-attention-bg); border-color: var(--st-attention-bd); }
.status.good      { color: var(--st-good-fg);      background: var(--st-good-bg);      border-color: var(--st-good-bd); }
.status.problem   { color: var(--st-problem-fg);   background: var(--st-problem-bg);   border-color: var(--st-problem-bd); }

.status.live::before { animation: pulse-dot 1.6s var(--ease) infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.badge-count {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: var(--r-pill);
  background: var(--st-halted-fg); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
}

.tag-req, .tag-opt {
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-pill);
  border: 1px solid; line-height: 1.3;
}
.tag-req { color: var(--st-halted-fg); background: var(--st-halted-bg); border-color: var(--st-halted-bd); }
.tag-opt { color: var(--muted); background: var(--wash-2); border-color: var(--line); }

/* ============================================================================
   HEADER — Clean Technical Bar with Retained Pill Badges
   ========================================================================= */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px var(--shadow-hairline);
}
.hdr-in {
  max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--hdr-h); display: flex; align-items: center; gap: 12px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  color: var(--primary); cursor: pointer; flex: none; background: none; border: none;
  font-family: inherit; padding: 4px; margin-left: -4px; border-radius: var(--r-input);
}
.logo:hover { color: var(--primary-hover); }
.logo-mark { width: 24px; height: 24px; flex: none; color: var(--primary); }

.hdr-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.hdr-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 600; font-size: var(--fs-sm); padding: 6px 12px;
  border-radius: var(--r-pill); cursor: pointer; background: none; border: 1px solid transparent;
  font-family: inherit; color: var(--ink-2); white-space: nowrap; transition: all 0.12s ease;
}
.hdr-link:hover { background: var(--wash-2); color: var(--ink); border-color: var(--line-2); }

.bell {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--ink-2); flex: none;
  transition: all 0.12s ease;
}
.bell:hover { background: var(--wash-2); border-color: var(--line); color: var(--ink); }
.bell .badge-count { position: absolute; top: 1px; right: 1px; }

/* The account pill */
.acct-pill {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 4px 6px 4px 12px; background: var(--surface); cursor: pointer;
  font-family: inherit; font-size: var(--fs-sm); color: var(--ink);
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.acct-pill:hover { box-shadow: var(--sh-pill); border-color: var(--primary-line); }
.acct-bal { font-weight: 700; color: var(--primary); font-family: var(--mono); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--surface-dark); color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.avatar.admin { background: var(--primary); }

/* Dropdown menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70;
  min-width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--sh-3); padding: 6px 0;
  animation: menu-in .13s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 16px; font-size: var(--fs-sm); font-family: inherit; color: var(--ink);
  background: none; border: none; cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--bg-hover-wash); color: var(--primary); }
.menu-item.strong { font-weight: 600; }
.menu-sep { height: 1px; background: var(--line-2); margin: 6px 0; }
.menu-head { padding: 6px 16px 8px; font-weight: 600; font-size: var(--fs-sm); color: var(--muted); }

/* Attention menu — a derived list of the studies needing you. No read state
   exists to keep: the rows ARE the open checkpoints, and they leave the list
   when the study moves on. */
.menu.notif { min-width: 340px; max-width: 92vw; padding-bottom: 0; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  padding: 10px 16px; border-top: 1px solid var(--line-2); cursor: pointer;
  background: none; border-left: none; border-right: none; border-bottom: none;
  font-family: inherit; text-align: left; font-size: var(--fs-sm); color: var(--ink);
}
.notif-item:hover { background: var(--bg-hover-wash); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st-attention-fg); margin-top: 5px; flex: none; }

/* ============================================================================
   MODEL CARD — Engineering Model Cards
   ========================================================================= */
.card {
  display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  background: none; border: none; padding: 0; font: inherit; text-align: left;
  color: inherit; border-radius: var(--r-card);
  transition: transform .18s var(--ease);
}
.card:hover { transform: translateY(-2px); }
.card .card-media { position: relative; border-radius: var(--r-media); overflow: hidden; }
.card .media { --ar: 75%; box-shadow: var(--sh-1); border-radius: var(--r-media); }
.card:hover .media { box-shadow: var(--sh-2); }
.card-title { font-weight: 600; font-size: var(--fs-md); line-height: 1.35; color: var(--ink); }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-status { position: absolute; left: 8px; top: 8px; z-index: 4; box-shadow: var(--sh-1); }
.card-lock {
  position: absolute; right: 8px; top: 8px; z-index: 4;
  background: var(--bg-glass); border-radius: var(--r-pill);
  padding: 3px 8px; font-size: 10.5px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 4px; box-shadow: var(--sh-1); border: 1px solid var(--line);
}
.card.sel .media { box-shadow: 0 0 0 2px var(--primary), var(--sh-2); border-color: var(--primary); }
.card.sel .card-title { color: var(--primary); }
.card .media-name { font-size: 11px; padding: 3px 7px; }

/* ===== DRAWSOLVE WEB CHROME KIT — END ============================================== */

/* ===== SURFACE STYLES ==============================================================
   Lifted whole from the demo rather than sliced per surface: a missing rule is how a
   target quietly stops matching the thing it is meant to hold to.
   ================================================================================= */



/* ============================================================================
   RESET & BASE (Dense Engineering Baseline)
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.4;
  color: var(--text-strong);
  background: var(--surface-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p  { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
a.link { text-decoration: underline; text-underline-offset: 2px; }
a.link:hover { color: var(--primary); }

ul, ol { margin: 0 0 10px; padding-left: 20px; }
li { margin: 3px 0; color: var(--ink-2); font-size: 12.5px; }

img, svg { max-width: 100%; display: block; }

hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

code, .mono { font-family: var(--mono); font-size: 0.92em; }

/* Focus: always visible, never suppressed (spec §5.6). */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute; 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: 200;
  background: var(--surface-dark); color: #fff; padding: 8px 14px;
  border-radius: var(--r-input); font-weight: 600; font-size: 12px; transition: top .15s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ============================================================================
   LAYOUT PRIMITIVES
   ========================================================================= */
.page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.page.narrow { max-width: 760px; }
.page.mid    { max-width: 1040px; }

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.row.top { align-items: flex-start; }
.wrap    { flex-wrap: wrap; }
.grow    { flex: 1 1 auto; min-width: 0; }
.spacer  { flex: 1 1 auto; }

.g4  { gap: 4px; }  .g6 { gap: 6px; }  .g8 { gap: 8px; }
.g12 { gap: 12px; } .g16 { gap: 16px; } .g24 { gap: 24px; } .g32 { gap: 32px; }

.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; }  .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; } .mt48 { margin-top: 48px; }
.mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.mb24 { margin-bottom: 24px; } .mb32 { margin-bottom: 32px; } .mb48 { margin-bottom: 48px; }

.section-pad { padding: 44px 0; }

/* ============================================================================
   TEXT UTILITIES
   ========================================================================= */
.muted   { color: var(--muted); }
.ink     { color: var(--ink); }
.faint   { color: var(--faint); }
.small   { font-size: var(--fs-sm); }
.xs      { font-size: var(--fs-xs); }
.lg      { font-size: var(--fs-lg); }
.bold    { font-weight: 600; }
.center  { text-align: center; }
.right   { text-align: right; }
.nowrap  { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.lead { font-size: 15px; color: var(--ink-2); line-height: 1.6; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary);
}

/* ============================================================================
   BUTTONS (Tactile Mechanical Click Feel)
   ========================================================================= */
.btn-tactile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.12s ease;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}
.btn-tactile:active:not(:disabled) {
  transform: translateY(1.5px) scale(0.97);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: var(--fs-md);
  padding: 8px 16px; border-radius: var(--r-btn);
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s var(--ease), border-color .12s var(--ease),
              transform .1s var(--ease), box-shadow .12s var(--ease), color .12s var(--ease);
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1.5px) scale(0.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--primary); color: #fff; border: 1px solid var(--primary-hover);
  box-shadow: 0 1px 3px var(--focus-ring-strong);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--primary-press); }

.btn-secondary {
  background: var(--bg-g1); color: var(--ink-2); border: 1px solid var(--line);
}
.btn-secondary:hover:not(:disabled) { background: var(--border-rest); color: var(--ink); }
.btn-secondary:active:not(:disabled) { background: var(--border-strong); }

.btn-dark { background: var(--surface-dark); color: #fff; border: 1px solid var(--surface-dark); }
.btn-dark:hover:not(:disabled) { background: var(--btn-dark-hover); }

.btn-outline { border-color: var(--line); color: var(--ink-2); background: var(--surface); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary-line); background: var(--primary-wash); color: var(--primary); }

.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--wash-2); color: var(--ink); }

.btn-quiet { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.btn-quiet:hover:not(:disabled) { border-color: var(--primary-line); background: var(--primary-wash); color: var(--primary); }

.btn-danger { background: var(--st-halted-fg); color: #fff; border: 1px solid var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }

/* A button that carries a second line under its label. The label keeps its own
   weight and the line below is a quiet stamp, so the control still reads as one
   button rather than two stacked words. */
.btn-beta { flex-direction: column; gap: 0; line-height: 1.15; }
.btn-beta .btn-sub {
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  opacity: .78; margin-top: 2px;
}
.btn-beta.btn-lg .btn-sub { font-size: 10.5px; }
.btn-beta.btn-sm .btn-sub { font-size: 9px; }

.btn-sm { padding: 6px 12px; font-size: var(--fs-sm); }
.btn-lg { padding: 11px 22px; font-size: var(--fs-lg); }
.btn-block { display: flex; width: 100%; }

/* Delete row button (compact danger hover) */
.btn-delete-row {
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  color: var(--text-body); background: var(--bg-g1); border: 1px solid var(--line-2);
  border-radius: var(--r-input); cursor: pointer; transition: all 0.12s ease;
  white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-family: inherit; user-select: none; -webkit-user-select: none;
}
.btn-delete-row:hover { background: var(--bg-danger-hover); border-color: var(--border-danger); color: var(--danger); }
.btn-delete-row:active { background: var(--bg-danger-hover); transform: translateY(1.5px) scale(0.97); }

/* Circular icon button — row arrows & controls */
.btn-round {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--sh-1); flex: none; display: grid; place-items: center;
  cursor: pointer; transition: all 0.12s ease; user-select: none;
}
.btn-round:hover:not(:disabled) { background: var(--wash-2); border-color: var(--primary-line); color: var(--primary); }
.btn-round:active:not(:disabled) { transform: translateY(1.5px) scale(0.95); }
.btn-round.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-round.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-round.sm { width: 28px; height: 28px; }

.icon { width: 16px; height: 16px; flex: none; stroke-width: 2; }
.icon.sm { width: 14px; height: 14px; }
.icon.lg { width: 20px; height: 20px; }

/* Info ("i") button */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--primary-wash); color: var(--primary);
  border: 1px solid var(--primary-line);
  font-size: 11px; font-weight: 700; font-family: "Georgia", serif; font-style: italic;
  cursor: pointer; line-height: 1; padding: 0; margin-left: 4px;
  transition: all 0.15s ease; vertical-align: middle; user-select: none; outline: none;
}
.info-btn:hover {
  background: var(--primary); color: #ffffff; border-color: var(--primary); transform: scale(1.1);
}
.info-btn:active { transform: scale(0.95); }

/* ============================================================================
   FORM CONTROLS
   ========================================================================= */
.field { display: block; margin-bottom: 14px; }
.field > .label {
  display: block; font-size: var(--fs-sm); font-weight: 600;
  margin-bottom: 5px; color: var(--ink);
}
.field > .hint { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 5px; }

.input, .textarea, .select {
  width: 100%; font: inherit; font-size: var(--fs-md); color: var(--ink);
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--surface); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--faint); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--focus-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input.sm, .select.sm { padding: 6px 9px; font-size: var(--fs-sm); }
.select.sm { padding-right: 26px; background-position: right 8px center; }

.input.err, .textarea.err, .select.err { border-color: var(--st-halted-fg); }
.input.err:focus, .textarea.err:focus { box-shadow: 0 0 0 2px var(--overlay-danger); }
.err-msg {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--fs-xs); color: var(--st-halted-fg); margin-top: 4px; font-weight: 600;
}

.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: var(--fs-sm); }
.check input { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--primary); flex: none; cursor: pointer; }

/* Radio card — the visibility selector & options */
.radio-card {
  flex: 1 1 0; min-width: 200px; position: relative; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px 16px; background: var(--surface);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.radio-card:hover { border-color: var(--primary-line); background: var(--bg-hover-wash); }
.radio-card.on {
  border-color: var(--primary); background: var(--primary-wash);
  box-shadow: 0 0 0 1px var(--primary);
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card .rc-title { font-weight: 600; display: flex; align-items: baseline; gap: 8px; color: var(--ink); font-size: var(--fs-md); }
.radio-card .rc-sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; line-height: 1.4; }
.radio-card .rc-price { margin-left: auto; font-weight: 700; color: var(--primary); font-family: var(--mono); }

/* ============================================================================
   CHIPS, BADGES, PILLS
   ========================================================================= */
.chip, .chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 5px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--wash-2); color: var(--ink-2);
  white-space: nowrap; cursor: pointer; transition: all 0.12s ease;
}
.chip:hover, .chip-btn:hover { background: var(--border-rest); color: var(--ink); }

.chip-btn:hover {
  border-color: var(--border-hover);
}
.chip.plain { background: var(--surface); font-weight: 500; color: var(--muted); }
.chip.solid, .chip.latched,
.chip-btn.solid, .chip-btn.latched { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-btn.latched:hover { background: var(--primary-hover); color: #fff; }
.chip.selected { background: var(--primary-wash); border-color: var(--primary-line); color: var(--primary); }

.chip.removable { padding-right: 5px; cursor: default; background: var(--surface-dark); color: #fff; border-color: var(--surface-dark); }
.chip.removable button {
  border: none; background: var(--overlay-light); color: #fff; cursor: pointer;
  width: 15px; height: 15px; border-radius: 50%; font-size: 10px; line-height: 1;
  display: grid; place-items: center; padding: 0; font-family: inherit;
}
.chip.removable button:hover { background: var(--overlay-light-strong); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid;
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status.neutral   { color: var(--st-neutral-fg);   background: var(--st-neutral-bg);   border-color: var(--st-neutral-bd); }
.status.attention { color: var(--st-attention-fg); background: var(--st-attention-bg); border-color: var(--st-attention-bd); }
.status.good      { color: var(--st-good-fg);      background: var(--st-good-bg);      border-color: var(--st-good-bd); }
.status.problem   { color: var(--st-problem-fg);   background: var(--st-problem-bg);   border-color: var(--st-problem-bd); }

.status.live::before { animation: pulse-dot 1.6s var(--ease) infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.badge-count {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: var(--r-pill);
  background: var(--st-halted-fg); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
}

.tag-req, .tag-opt {
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-pill);
  border: 1px solid; line-height: 1.3;
}
.tag-req { color: var(--st-halted-fg); background: var(--st-halted-bg); border-color: var(--st-halted-bd); }
.tag-opt { color: var(--muted); background: var(--wash-2); border-color: var(--line); }

/* ============================================================================
   PANELS, BADGE BARS & SECTION CARDS
   ========================================================================= */
.badge-bar {
  background: var(--text-body); color: #fff; padding: 12px 24px; font-size: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.1px; border-radius: var(--r-card);
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 8px var(--shadow-soft); margin-bottom: 16px;
}
.badge-title-group { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.badge-main-title { font-size: 16px; font-weight: 700; letter-spacing: 1.1px; }
.badge-policy-text { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: normal; color: var(--bg-glass); }
.badge-bar-sub { font-size: 11px; font-weight: 700; background: var(--overlay-light); padding: 3px 8px; border-radius: 4px; letter-spacing: 0.8px; white-space: nowrap; }

.section-card, .fblock {
  background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 16px 20px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px; position: relative; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.fblock:focus-within { border-color: var(--primary-line); box-shadow: var(--sh-2); }
.fblock.invalid { border-color: var(--st-halted-bd); background: var(--bg-g1); }
.section-header, .fblock-hd {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line-2); padding-bottom: 8px; margin-bottom: 4px;
}
.section-title, .fblock-hd .ft {
  font-size: 13.5px; font-weight: 700; color: var(--text-ink); letter-spacing: 0.3px;
  display: inline-flex; align-items: center; gap: 6px;
}

.panel {
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); padding: 16px 18px;
}
.panel.wash { background: var(--wash); }
.panel.tight { padding: 12px 14px; }
.panel-hd {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line-2);
}

.stmt-primary {
  background: var(--surface-muted); border-left: 4px solid var(--primary);
  border-radius: var(--r-card); padding: 12px 16px; font-size: 13px; line-height: 1.55; color: var(--ink-2);
}

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-left: 3px solid var(--muted);
  background: var(--surface-muted); border-radius: 0 var(--r-input) var(--r-input) 0;
  padding: 11px 14px; font-size: var(--fs-sm);
}
.notice .n-title { font-weight: 600; color: var(--ink); }
.notice.info    { border-left-color: var(--primary);        background: var(--primary-wash);   border-color: var(--primary-line); }
.notice.warn    { border-left-color: var(--severity-warning-border); background: var(--severity-warning-bg); border-color: var(--border-warning-soft); }
.notice.error   { border-left-color: var(--st-halted-fg);   background: var(--st-halted-bg);   border-color: var(--st-halted-bd); }
.notice.success { border-left-color: var(--st-ready-fg);    background: var(--st-ready-bg);    border-color: var(--st-ready-bd); }

/* ============================================================================
   TABLES
   ========================================================================= */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-scroll > .tbl { min-width: 520px; }

.tbl {
  width: 100%; border-collapse: collapse; font-size: var(--fs-sm);
  border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: #fff;
}
.tbl th, .tbl td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl th {
  background: var(--surface-muted); color: var(--text-body); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-strong);
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover, .tbl tbody tr:hover td { background: var(--bg-hover-wash); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.k { font-weight: 600; color: var(--text-ink); white-space: nowrap; }
.tbl td.v { color: var(--primary); font-family: var(--mono); font-weight: 600; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; color: var(--ink); }

.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* Empty state */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty h3 { color: var(--ink); }

/* Loading skeleton shimmer */
.skel {
  background: linear-gradient(90deg, var(--wash-2) 25%, var(--border-rest) 37%, var(--wash-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.spinner {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
.spinner.lg { width: 26px; height: 26px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
   HEADER — Clean Technical Bar with Retained Pill Badges
   ========================================================================= */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px var(--shadow-hairline);
}
.hdr-in {
  max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--hdr-h); display: flex; align-items: center; gap: 12px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  color: var(--primary); cursor: pointer; flex: none; background: none; border: none;
  font-family: inherit; padding: 4px; margin-left: -4px; border-radius: var(--r-input);
}
.logo:hover { color: var(--primary-hover); }
.logo-mark { width: 24px; height: 24px; flex: none; color: var(--primary); }

.hdr-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.hdr-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 600; font-size: var(--fs-sm); padding: 6px 12px;
  border-radius: var(--r-pill); cursor: pointer; background: none; border: 1px solid transparent;
  font-family: inherit; color: var(--ink-2); white-space: nowrap; transition: all 0.12s ease;
}
.hdr-link:hover { background: var(--wash-2); color: var(--ink); border-color: var(--line-2); }

.bell {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--ink-2); flex: none;
  transition: all 0.12s ease;
}
.bell:hover { background: var(--wash-2); border-color: var(--line); color: var(--ink); }
.bell .badge-count { position: absolute; top: 1px; right: 1px; }

/* The account pill */
.acct-pill {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 4px 6px 4px 12px; background: var(--surface); cursor: pointer;
  font-family: inherit; font-size: var(--fs-sm); color: var(--ink);
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.acct-pill:hover { box-shadow: var(--sh-pill); border-color: var(--primary-line); }
.acct-bal { font-weight: 700; color: var(--primary); font-family: var(--mono); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--surface-dark); color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.avatar.admin { background: var(--primary); }

/* Dropdown menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70;
  min-width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--sh-3); padding: 6px 0;
  animation: menu-in .13s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 16px; font-size: var(--fs-sm); font-family: inherit; color: var(--ink);
  background: none; border: none; cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--bg-hover-wash); color: var(--primary); }
.menu-item.strong { font-weight: 600; }
.menu-sep { height: 1px; background: var(--line-2); margin: 6px 0; }
.menu-head { padding: 6px 16px 8px; font-weight: 600; font-size: var(--fs-sm); color: var(--muted); }

/* Attention menu — a derived list of the studies needing you. No read state
   exists to keep: the rows ARE the open checkpoints, and they leave the list
   when the study moves on. */
.menu.notif { min-width: 340px; max-width: 92vw; padding-bottom: 0; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  padding: 10px 16px; border-top: 1px solid var(--line-2); cursor: pointer;
  background: none; border-left: none; border-right: none; border-bottom: none;
  font-family: inherit; text-align: left; font-size: var(--fs-sm); color: var(--ink);
}
.notif-item:hover { background: var(--bg-hover-wash); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st-attention-fg); margin-top: 5px; flex: none; }

/* ============================================================================
   FOOTER
   ========================================================================= */
.ftr { border-top: 1px solid var(--line); background: var(--footer-bg); margin-top: 60px; }
.ftr-in {
  max-width: var(--page-max); margin: 0 auto; padding: 28px var(--gutter);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  font-size: var(--fs-sm); color: var(--muted);
}
.ftr-links { display: flex; gap: 18px; flex-wrap: wrap; }
.ftr-links button {
  background: none; border: none; font: inherit; color: var(--muted);
  cursor: pointer; padding: 2px;
}
.ftr-links button:hover { color: var(--ink); text-decoration: underline; }

/* ============================================================================
   ds-media — THE PLACEHOLDER MEDIA COMPONENT (Soft 12px corners)
   ========================================================================= */
.media {
  position: relative; overflow: hidden; border-radius: var(--r-media);
  background: var(--wash-2); isolation: isolate;
}
.media::after { content: ""; display: block; padding-top: var(--ar, 75%); }
.media-frames { position: absolute; inset: 0; }
.media-frame {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .6s var(--ease);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px 14px;
}
.media-frame.on { opacity: 1; }
.media-name {
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: var(--bg-glass); backdrop-filter: blur(3px);
  padding: 4px 9px; border-radius: 8px; align-self: flex-start;
  border: 1px solid var(--shadow-soft); line-height: 1.3;
  max-width: calc(100% - 70px);
}
.media.dark .media-name { background: var(--overlay-scrim); color: #fff; border-color: var(--overlay-light-faint); }

.media-ctl {
  position: absolute; right: 8px; bottom: 8px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-glass); backdrop-filter: blur(3px);
  border: 1px solid var(--shadow-soft); border-radius: var(--r-pill); padding: 3px 7px;
}
.media.dark .media-ctl { background: var(--overlay-scrim); border-color: var(--overlay-light-faint); }
.media-dots { display: flex; gap: 3px; }
.media-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); transition: background .3s; }
.media-dot.on { background: var(--primary); }
.media.dark .media-dot { background: var(--overlay-light-strong); }
.media.dark .media-dot.on { background: #fff; }
.media-play {
  border: none; background: none; cursor: pointer; padding: 0; color: var(--ink-2);
  width: 14px; height: 14px; display: grid; place-items: center;
}
.media.dark .media-play { color: #fff; }

.media.hover-only .media-ctl {
  opacity: 0; transition: opacity .18s var(--ease); pointer-events: none;
}
.media.hover-only:hover .media-ctl,
.card:focus-visible .media.hover-only .media-ctl { opacity: 1; }

.media-slot {
  position: absolute; left: 8px; top: 8px; z-index: 3; display: none;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: var(--surface-dark); color: #fff; padding: 2px 6px; border-radius: 3px;
}
body.annot .media-slot { display: block; }

/* CSS-drawn motifs (DrawSolve technical palette) */
.motif { position: absolute; inset: 0; overflow: hidden; }
.motif svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mo-sketch, .mo-section, .mo-intake {
  background: linear-gradient(160deg, var(--bg-g1) 0%, var(--bg-g2) 100%);
}
.mo-solve, .mo-chart, .mo-slider {
  background: linear-gradient(160deg, var(--bg-g1) 0%, var(--bg-accent-wash) 100%);
}
.mo-dark { background: linear-gradient(150deg, var(--text-ink) 0%, var(--text-ink) 100%); }

@media (prefers-reduced-motion: reduce) {
  .media-frame { transition: none; }
}

/* ============================================================================
   MODEL CARD — Engineering Model Cards
   ========================================================================= */
.card {
  display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  background: none; border: none; padding: 0; font: inherit; text-align: left;
  color: inherit; border-radius: var(--r-card);
  transition: transform .18s var(--ease);
}
.card:hover { transform: translateY(-2px); }
.card .card-media { position: relative; border-radius: var(--r-media); overflow: hidden; }
.card .media { --ar: 75%; box-shadow: var(--sh-1); border-radius: var(--r-media); }
.card:hover .media { box-shadow: var(--sh-2); }
.card-title { font-weight: 600; font-size: var(--fs-md); line-height: 1.35; color: var(--ink); }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-status { position: absolute; left: 8px; top: 8px; z-index: 4; box-shadow: var(--sh-1); }
.card-lock {
  position: absolute; right: 8px; top: 8px; z-index: 4;
  background: var(--bg-glass); border-radius: var(--r-pill);
  padding: 3px 8px; font-size: 10.5px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 4px; box-shadow: var(--sh-1); border: 1px solid var(--line);
}
.card.sel .media { box-shadow: 0 0 0 2px var(--primary), var(--sh-2); border-color: var(--primary); }
.card.sel .card-title { color: var(--primary); }
.card .media-name { font-size: 11px; padding: 3px 7px; }

/* ============================================================================
   CATEGORY ROW
   ========================================================================= */
.cat-row { margin-bottom: 38px; }
.cat-hd {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.cat-hd h2 { font-size: 16px; font-weight: 700; color: var(--text-ink); letter-spacing: 0.3px; }
.cat-arrow {
  display: flex; align-items: center; gap: 4px; margin-left: 4px;
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted);
  padding: 5px 9px; border-radius: var(--r-pill); transition: all 0.12s ease;
}
.cat-arrow:hover { color: var(--primary); background: var(--primary-wash); }
.cat-scroll-btns { margin-left: auto; display: flex; gap: 6px; }
.row-attn {
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
}
.row-attn::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}

.cat-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: 224px; gap: 16px;
  overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x proximity;
  padding: 4px 2px 8px; margin: -4px -2px -8px;
  scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-scroll > * { scroll-snap-align: start; }

/* ============================================================================
   SEARCH BAR — Segmented Pill Silhouette
   ========================================================================= */
.searchbar {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--sh-pill);
  padding: 4px 5px 4px 0; transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.searchbar:focus-within { box-shadow: 0 0 0 2px var(--focus-ring); border-color: var(--primary); }
.sb-seg {
  display: flex; flex-direction: column; gap: 1px; padding: 4px 16px;
  position: relative; min-width: 0;
}
.sb-seg + .sb-seg::before {
  content: ""; position: absolute; left: 0; top: 20%; height: 60%; width: 1px; background: var(--line);
}
.sb-seg.grow { flex: 1 1 auto; }
.sb-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.sb-seg input, .sb-seg select {
  border: none; background: none; font: inherit; font-size: var(--fs-sm);
  color: var(--ink); padding: 0; width: 100%; outline: none; cursor: pointer;
}
.sb-seg input { cursor: text; }
.sb-seg input::placeholder, .sb-seg select.none { color: var(--muted); }
.sb-seg select { appearance: none; }
.sb-go { margin-left: 6px; }

.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.try-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.try-chip { cursor: pointer; font-family: inherit; background: var(--surface); }
.try-chip:hover { border-color: var(--primary-line); color: var(--primary); background: var(--primary-wash); }
.try-chip .icon { width: 12px; height: 12px; opacity: .6; }

/* ============================================================================
   DIALOGS / MODALS
   ========================================================================= */
.backdrop {
  position: fixed; inset: 0; z-index: 100; background: var(--overlay-scrim);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fade-in .15s var(--ease); overflow-y: auto;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 500px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--sh-3); animation: modal-in .18s var(--ease);
  max-height: calc(100vh - 48px); display: flex; flex-direction: column; margin: auto;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal.wide { max-width: 700px; }
.modal.narrow { max-width: 420px; }
.modal-hd {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line-2); flex: none;
}
.modal-hd h3 { flex: 1; font-size: 15px; color: var(--text-ink); }
.modal-bd { padding: 18px; overflow-y: auto; flex: 1 1 auto; line-height: 1.55; }
.modal-ft {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  padding: 12px 18px; border-top: 1px solid var(--line-2); flex: none;
}
.modal-x {
  width: 28px; height: 28px; border-radius: 4px; border: none; background: none;
  cursor: pointer; display: grid; place-items: center; color: var(--muted); flex: none;
  transition: all 0.12s ease;
}
.modal-x:hover { background: var(--wash-2); color: var(--ink); }

/* toast */
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 130; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--surface-dark); color: #fff; padding: 10px 18px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--sh-3);
  animation: toast-in .2s var(--ease); max-width: 90vw;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ============================================================================
   LANDING — Marketing with Hybrid Density
   ========================================================================= */
.hero { padding: 60px 0 38px; text-align: center; }
.hero h1 {
  font-size: var(--fs-3xl); line-height: 1.15; letter-spacing: -0.02em;
  max-width: 28ch; margin: 0 auto 16px; color: var(--ink); font-weight: 700;
}
.hero .lead {
  max-width: 58ch; margin: 0 auto 24px; font-size: 15px; color: var(--ink-2); line-height: 1.6;
}
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.price-tag {
  margin: 16px auto 0; font-size: var(--fs-sm); color: var(--ink-2);
  display: inline-flex; align-items: baseline; gap: 5px; flex-wrap: wrap;
  justify-content: center; padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
}
/* Sits under the two priced options, not inside either — it is a statement
   about both prices, and repeating it on each card would read as two offers. */
.beta-price-note {
  margin: 10px 0 0; text-align: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary);
}

.price-tag.inline {
  margin: 0; padding: 0; background: none; border: none; font-size: var(--fs-xs);
}
.hero-media { max-width: 960px; margin: 38px auto 0; }
.hero-media .media { --ar: 56.25%; box-shadow: var(--sh-3); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature { display: flex; flex-direction: column; gap: 8px; }
.feature .fi {
  width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: var(--primary-wash); color: var(--primary); flex: none;
}
.feature h3 { font-size: 15px; color: var(--text-ink); }

.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step { counter-increment: s; position: relative; padding-left: 42px; }
.step::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: var(--fs-sm);
}

/* ============================================================================
   AUTH (spec §4.2)
   ========================================================================= */
.auth-wrap { display: grid; place-items: center; padding: 48px 20px 64px; }
.auth-card {
  width: 100%; max-width: 420px; border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--sh-2); padding: 26px 24px; background: var(--surface);
}
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 20px; color: var(--ink); }
.auth-alt { text-align: center; font-size: var(--fs-sm); color: var(--muted); margin-top: 16px; }
.auth-alt button {
  background: none; border: none; font: inherit; color: var(--primary);
  font-weight: 600; cursor: pointer; padding: 2px;
}
.auth-alt button:hover { text-decoration: underline; }

/* ============================================================================
   LIBRARY — Split View (spec §4.4)
   ========================================================================= */
.lib-toolbar {
  position: sticky; top: var(--hdr-h); z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
/* A filter yields a plain grid of the same cards the browse rows use. */
.lib-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 26px 18px;
}
.preview-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--surface); z-index: 4;
}

/* ============================================================================
   ARTIFACT VIEW (spec §4.5)
   ========================================================================= */
.artifact-shell { position: relative; height: calc(100vh - var(--hdr-h)); display: flex; flex-direction: column; }
.artifact-strip {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 8px 18px; border-bottom: 1px solid var(--line);
  background: var(--surface-muted); font-size: var(--fs-sm);
}
.artifact-frame { flex: 1 1 auto; position: relative; background: #fff; }
.artifact-frame iframe { width: 100%; height: 100%; border: none; display: block; }
.artifact-back {
  position: absolute; left: 16px; top: 16px; z-index: 20;
  box-shadow: var(--sh-3); background: var(--surface);
}
.artifact-loading {
  position: absolute; inset: 0; display: grid; place-items: center; background: var(--surface);
  z-index: 10; gap: 10px;
}

/* Mock one-pager */
.mock-op { padding: 22px 26px 48px; max-width: 960px; margin: 0 auto; font-size: 13px; line-height: 1.5; }
.mock-op h1 { font-size: 22px; margin-bottom: 4px; }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.mock-out {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 14px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: #fff;
}
.mock-out .ov { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--primary); }
.mock-slider { margin-bottom: 14px; }
.mock-slider input[type=range] { width: 100%; accent-color: var(--primary); }
.mock-slider .ms-hd { display: flex; justify-content: space-between; font-size: var(--fs-sm); margin-bottom: 3px; }

/* ============================================================================
   INTAKE FORM

   Structure mirrors the intake design target (Intake_Form_V6.html), which is the
   authority for this page and for the form app.gui actually generates. What is
   below is the flow reference's stand-in: the same section roster, in the same
   order, with the same controls — enough to walk the journey, and never a
   substitute for the target.
   ========================================================================= */
.intake { max-width: 1040px; margin: 0 auto; padding: 20px 0 64px; }

.price-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--r-card); background: var(--surface-muted);
  border: 1px solid var(--line); font-size: var(--fs-sm);
}
.price-line .amt { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary); }

.seed-entry-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-muted);
}
.seed-entry-note { font-size: var(--fs-sm); color: var(--muted); }
.seed-entry-row.seeded { border-color: var(--primary-line); background: var(--primary-wash); }
.seed-entry-row.seeded > .icon { color: var(--primary); flex: none; }

.section-title-wrap { display: inline-flex; align-items: baseline; gap: 7px; }
.section-subtitle { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.char-counter {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  background: var(--wash-2); border: 1px solid var(--line-2);
  padding: 2px 7px; border-radius: var(--r-pill); white-space: nowrap;
}

.problem-type-row { display: flex; gap: 8px; flex-wrap: wrap; }

.text-input-field {
  width: 100%; font: inherit; font-size: var(--fs-md); color: var(--ink);
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--surface);
}
.text-input-field:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--focus-ring);
}
.textarea-box {
  width: 100%; min-height: 92px; font: inherit; font-size: var(--fs-md); color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--surface); resize: vertical; line-height: 1.5;
}
.textarea-box:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--focus-ring);
}
.textarea-optional { color: var(--faint); font-style: italic; }

/* The sketch viewport — the target's sticky card, unpinned here. */
.canvas-viewport-panel {
  position: relative; border: 2px dashed var(--primary-line); border-radius: var(--r-card);
  background: var(--surface-muted); min-height: 210px;
  display: grid; place-items: center; overflow: hidden; cursor: pointer;
}
.canvas-viewport-panel:hover { border-color: var(--primary); background: var(--primary-wash); }
.canvas-viewport-panel img { max-height: 260px; width: auto; }
.canvas-center-badge { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.canvas-dim-indicator {
  position: absolute; right: 8px; bottom: 8px;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  background: var(--bg-glass); border: 1px solid var(--line); padding: 2px 6px; border-radius: 3px;
}
.sketch-controls-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 10px;
}
.file-info-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em;
  color: var(--muted); background: var(--wash-2);
  border: 1px solid var(--line-2); padding: 2px 7px; border-radius: 3px;
}

/* The target's editable tables. */
.dim-table-container { overflow-x: auto; }
.dim-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 560px; }
.dim-table th {
  text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); padding: 0 8px 6px;
}
.dim-table td { padding: 5px 8px 5px 0; vertical-align: middle; }
.dim-table td:last-child, .dim-table th:last-child { padding-right: 0; text-align: center; }
.dim-table .input { padding: 6px 9px; font-size: var(--fs-sm); }
.tbl-add-row { margin-top: 8px; }

.warning-limit-banner {
  font-size: var(--fs-sm); color: var(--severity-warning-text);
  background: var(--severity-warning-bg); border: 1px solid var(--border-warning-soft);
  border-radius: var(--r-input); padding: 7px 11px; margin-bottom: 10px;
}

/* "Before we start" — the clarification sweep. */
.sweep-panel { border-color: var(--primary-line); }
.sweep-row {
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 12px 14px; margin-bottom: 8px; background: var(--surface);
}
.sweep-row.answered { border-color: var(--st-good-bd); background: var(--st-good-bg); }
.sweep-gap { font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.sweep-why { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 7px; }
.sweep-proposal {
  font-size: var(--fs-sm); color: var(--ink); background: var(--surface-muted);
  border-left: 3px solid var(--primary); border-radius: var(--r-input);
  padding: 7px 11px; margin-bottom: 8px;
}
.sweep-basis {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 2px;
}
.sweep-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sweep-footer {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--line-2); margin-top: 4px;
}
.sweep-progress { font-family: var(--mono); font-size: var(--fs-xs); color: var(--primary); font-weight: 700; }
.sweep-note { font-size: var(--fs-xs); color: var(--muted); }

/* The action bar. */
.form-bottom-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-top: 18px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  box-shadow: var(--sh-1);
}
.form-status-indicator {
  display: flex; align-items: center; gap: 7px; margin-right: auto;
  font-size: var(--fs-sm); color: var(--muted);
}
.form-status-indicator .status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--st-good-fg); flex: none;
}
.form-bottom-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================================
   TUTORIAL (/tutorial)
   ========================================================================= */
.tut-opts { margin: 0; padding-left: 20px; }
.tut-opts li { font-size: var(--fs-md); color: var(--ink-2); margin: 5px 0; line-height: 1.5; }
.tut-opts li b { color: var(--ink); font-weight: 600; }

.tut-group { margin-top: 14px; }
.tut-group:first-child { margin-top: 0; }
.tut-group-hd {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}

/* Study type: a button per row, its description beside it. */
.type-rows { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.type-row { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; width: 100%; }
.type-row .chip-btn { justify-content: center; padding: 8px 12px; font-size: var(--fs-md); }
.type-row-desc { font-size: var(--fs-md); color: var(--ink-2); line-height: 1.5; }

/* Drawing on the left, words on the right. */
.tut-split { display: grid; grid-template-columns: 340px 1fr; gap: 26px; align-items: start; }
.tut-split .media { border: 1px solid var(--line); }

.tut-sub { margin: 4px 0 0; padding-left: 18px; list-style: circle; }
.tut-sub li { font-size: var(--fs-sm); color: var(--muted); margin: 2px 0; }

.tut-shots { display: flex; flex-direction: column; gap: 14px; }
.tut-shot { margin: 0; }

/* Two bold titles in one section, set in from the drawing beside them. */
.tut-para { margin: 0 0 14px; max-width: 72ch; color: var(--ink-2); line-height: 1.55; }
.tut-para:last-child { margin-bottom: 0; }
.tut-para b { color: var(--ink); }

.tut-gate { padding-top: 26px; margin-top: 26px; border-top: 1px solid var(--line-2); }
.tut-gate h2 { font-size: 17px; }
.page h2 + .tut-opts, .page h2 + .type-rows { margin-top: 0; }

/* The landing's hero clip; the tutorial's clips, tips and notes; the feature request page. */
.hero-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-video .hero-replay { display: none; font-size: 11.5px; font-weight: 600; color: var(--ink-2); gap: 5px; }
.hero-video.ended { cursor: pointer; }
.hero-video.ended .hero-replay { display: flex; }
.tut-split.vid { grid-template-columns: 420px 1fr; }
.tut-video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-media); overflow: hidden;
  border: 1px solid var(--line); background: #ffffff; }
.tut-video video { display: block; width: 100%; height: 100%; object-fit: contain; background: #ffffff; }
.tut-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border: 0; padding: 0; background: var(--shadow-hairline); cursor: pointer; }
.tut-play .ring { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px var(--shadow-medium);
  transition: transform .15s var(--ease), background .15s var(--ease); }
.tut-play .ring svg { width: 22px; height: 22px; margin-left: 3px; }
.tut-play:hover .ring { background: var(--primary-hover); transform: scale(1.06); }
.tut-dur { position: absolute; right: 8px; bottom: 8px; font: 600 11px ui-monospace, monospace; color: #fff;
  background: var(--overlay-scrim); border-radius: 999px; padding: 2px 8px; pointer-events: none; }
.tut-video.started .tut-play, .tut-video.started .tut-dur { display: none; }
.tut-quick { margin: 0 0 32px; }
.tut-quick .tut-video { box-shadow: 0 2px 10px var(--shadow-soft); }
.tut-video.big .ring { width: 76px; height: 76px; }
.tut-video.big .ring svg { width: 32px; height: 32px; }
.tut-tip { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; font-size: var(--fs-sm); line-height: 1.5;
  color: var(--ink-2); background: var(--primary-wash); border: 1px solid var(--primary-line); }
.tut-tip b:first-child { color: var(--primary); }
.tut-tip.care { background: var(--bg-warning-wash); border-color: var(--border-warning-soft); }
.tut-tip.care b:first-child { color: var(--warning); }
.tut-opts li.tut-grey, .tut-opts li.tut-grey b { color: var(--muted); }
.tut-need { margin: 10px 0 0; padding: 6px 10px; border-radius: 8px; font-size: var(--fs-xs);
  color: var(--warning); background: var(--bg-warning-wash); border: 1px dashed var(--border-warning); }
.fr-votes { display: flex; flex-wrap: wrap; gap: 8px; }
.fr-kinds { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.textarea:disabled { background: var(--wash-2); color: var(--muted); cursor: not-allowed; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 820px) {
  .tut-split, .tut-split.vid { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ============================================================================
   STUDIO (spec §4.7)
   ========================================================================= */
.studio { height: calc(100vh - var(--hdr-h)); display: flex; flex-direction: column; background: var(--surface-bg); }
.studio-hd {
  flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.studio-body { flex: 1 1 auto; position: relative; min-height: 0; padding: 14px 20px 0; }
.runview {
  height: 100%; width: 100%; border: 1px solid var(--line);
  border-radius: var(--r-card) var(--r-card) 0 0; overflow: hidden;
  background: var(--surface); box-shadow: var(--sh-1); position: relative;
}
.runview iframe { width: 100%; height: 100%; border: none; display: block; background: #fff; }
.runview-tag {
  position: absolute; right: 10px; top: 10px; z-index: 5; display: none;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  background: var(--surface-dark); color: #fff; padding: 3px 7px; border-radius: 3px;
}
body.annot .runview-tag { display: block; }

.studio-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
  padding: 32px; background: var(--surface);
}
.studio-strip {
  flex: none; background: var(--surface); border-top: 2px solid var(--line);
  padding: 12px 20px 14px; box-shadow: 0 -4px 12px var(--shadow-hairline);
  max-height: 48vh; overflow-y: auto;
}
.studio-strip.waiting { background: var(--surface-muted); border-top-color: var(--primary-line); }
.strip-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.strip-poll {
  display: flex; align-items: center; gap: 8px; font-family: var(--mono);
  font-size: 11px; color: var(--muted); margin-right: auto;
}

/* Checkpoint choices */
.cp-form { display: flex; flex-direction: column; gap: 12px; }
.cp-choices { display: flex; flex-direction: column; gap: 6px; }

.cp-choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-card); cursor: pointer;
  background: var(--surface); font-size: var(--fs-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.cp-choice:hover { border-color: var(--primary-line); }
.cp-choice.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-wash); }
.cp-choice > input { margin-top: 3px; accent-color: var(--primary); flex: none; }
.cc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.cc-hd { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink); }
.cc-rec {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary); background: var(--surface); border: 1px solid var(--primary-line);
  padding: 2px 6px; border-radius: var(--r-pill);
}
.cc-value {
  font-size: var(--fs-md); font-weight: 600; color: var(--ink);
  padding: 6px 10px; background: var(--surface); border-radius: var(--r-input);
  border-left: 3px solid var(--primary); border: 1px solid var(--line);
}
.cc-why { color: var(--muted); line-height: 1.45; font-size: 12px; }
.cc-why-k {
  display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint); margin-right: 6px;
}
.cc-sub { color: var(--muted); }
.cc-control { display: block; margin-top: 3px; }
.cp-choice:not(.on) .cc-control { opacity: .5; }

.cp-num { display: inline-flex; gap: 6px; align-items: center; }
.cp-num .input { max-width: 140px; }
.cp-unit {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--wash-2); font-size: var(--fs-sm); color: var(--muted); font-weight: 600;
}
.cp-multi { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cp-tick {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); cursor: pointer;
}
.cp-tick input { accent-color: var(--primary); }
.completion-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: var(--r-card);
  background: var(--st-ready-bg); border: 1px solid var(--st-ready-bd);
}

/* ============================================================================
   ACCOUNT (spec §4.8)
   ========================================================================= */
.acct-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--line-2);
}
.acct-row:last-child { border-bottom: none; }
.acct-row .ar-k { flex: 0 0 140px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.acct-row .ar-v { flex: 1 1 220px; min-width: 0; color: var(--ink); }
.acct-row > .btn { flex: none; margin-left: auto; }
.balance-hero {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 20px 22px; border-radius: var(--r-card);
  background: var(--primary-wash); border: 1px solid var(--primary-line);
}
.balance-amt { font-size: var(--fs-3xl); font-weight: 700; color: var(--primary); line-height: 1; font-variant-numeric: tabular-nums; }

@media print {
}

.acct-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.acct-tab {
  position: relative; padding: 9px 14px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--muted);
  border-radius: var(--r-input) var(--r-input) 0 0; transition: all 0.12s ease;
}
.acct-tab:hover { color: var(--ink); background: var(--wash-2); }
.acct-tab.on { color: var(--primary); font-weight: 700; }
.acct-tab.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--primary); border-radius: 2px;
}

.danger-quiet { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.danger-link {
  border: none; background: none; padding: 0; cursor: pointer; font: inherit;
  font-size: var(--fs-sm); color: var(--faint); text-decoration: underline;
  text-underline-offset: 2px;
}
.danger-link:hover { color: var(--muted); }
.danger-note {
  font-size: var(--fs-xs); color: var(--faint); max-width: 68ch; margin: 6px 0 0; line-height: 1.45;
}

.amount-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.amount-chip {
  padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font: inherit; font-weight: 600; font-size: var(--fs-sm);
  transition: all 0.12s ease;
}
.amount-chip:hover { border-color: var(--primary-line); color: var(--primary); background: var(--primary-wash); }
.amount-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.stripe-mock {
  border: 1px solid var(--line); border-radius: var(--r-input); padding: 14px;
  background: var(--surface); display: flex; flex-direction: column; gap: 8px;
}
.stripe-field {
  border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px;
  font-size: var(--fs-sm); color: var(--faint); background: var(--wash-2);
  display: flex; align-items: center; gap: 8px;
}
/* The Stripe Checkout stand-in (/checkout). Deliberately NOT the DrawSolve
   chrome: you have left the site, and the page should look like it. */
.checkout-shell {
  min-height: 100vh; background: var(--bg-g1);
  display: flex; flex-direction: column; align-items: center; padding: 24px var(--gutter) 60px;
}
.checkout-note {
  display: flex; gap: 10px; align-items: flex-start; max-width: 520px; width: 100%;
  font-size: var(--fs-sm); color: var(--ink-2); background: var(--surface);
  border: 1px dashed var(--faint); border-radius: var(--r-card); padding: 11px 14px; margin-bottom: 24px;
}
.checkout-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 10px;
  box-shadow: 0 8px 30px var(--shadow-soft), 0 4px 10px var(--shadow-soft); overflow: hidden;
}
.checkout-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--border-rest);
}
.checkout-brand { font-weight: 700; font-size: 17px; color: #635bff; letter-spacing: -.02em; }
.checkout-body { padding: 24px 22px 26px; }
.checkout-amt {
  font-size: 32px; font-weight: 700; color: #0a2540; line-height: 1.1; margin: 2px 0 4px;
  font-variant-numeric: tabular-nums;
}

.stripe-badge {
  display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted);
  justify-content: center; margin-top: 2px;
}

/* ============================================================================
   ADMIN (spec §4.10)
   ========================================================================= */
.admin-shell { display: flex; min-height: calc(100vh - var(--hdr-h)); }
.admin-nav {
  flex: 0 0 200px; border-right: 1px solid var(--line); background: var(--surface-muted);
  padding: 18px 10px; display: flex; flex-direction: column; gap: 3px;
}
.admin-nav .an-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 8px;
}
.admin-nav button {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: var(--r-input); border: none; background: none; cursor: pointer;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-align: left;
  transition: all 0.12s ease;
}
.admin-nav button:hover { background: var(--wash-2); color: var(--ink); }
.admin-nav button.on { background: var(--primary-wash); color: var(--primary); font-weight: 700; }
.admin-main { flex: 1 1 auto; min-width: 0; padding: 24px 28px 64px; }
.admin-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

/* ============================================================================
   SCREENS INDEX
   ========================================================================= */
.screens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.screens-group { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: #fff; }
.screens-group h3 {
  font-size: 12px; padding: 10px 14px; background: var(--surface-muted);
  border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700;
}
.screens-group button {
  display: flex; align-items: baseline; gap: 6px; width: 100%; text-align: left;
  padding: 8px 14px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: var(--fs-sm); border-top: 1px solid var(--line-2); color: var(--ink);
  transition: background 0.12s ease;
}
.screens-group button:first-of-type { border-top: none; }
.screens-group button:hover { background: var(--primary-wash); color: var(--primary); }
.screens-group .sg-ref { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* ============================================================================
   DEMO SCAFFOLDING
   ========================================================================= */
.demo-panel {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 120;
  font-family: var(--mono); font-size: 11px;
  display: flex; align-items: center; gap: 0;
}
.demo-tab {
  display: flex; align-items: center; gap: 8px; order: 2;
  padding: 10px 8px; border-radius: 6px 0 0 6px; cursor: pointer;
  background: var(--bg-dark); color: #fff; border: 1px solid var(--text-body); border-right: none;
  font: inherit; font-weight: 700; letter-spacing: .1em; box-shadow: var(--sh-3);
  writing-mode: vertical-rl;
}
.demo-tab:hover { background: var(--btn-dark-hover); }
.demo-tab .dt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-hover); }
.demo-body {
  width: 280px; max-height: min(80vh, 640px); overflow-y: auto; order: 1;
  background: var(--bg-dark); color: var(--bg-g1); border: 1px solid var(--text-body);
  border-radius: 8px 0 0 8px; padding: 12px; box-shadow: var(--sh-3);
}
.demo-body h4 {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); margin: 12px 0 6px; font-weight: 700;
}
.demo-body h4:first-child { margin-top: 0; }
.demo-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.demo-seg button {
  flex: 1 1 auto; padding: 5px 7px; border-radius: 4px; cursor: pointer;
  background: var(--text-strong); color: var(--border-rest); border: 1px solid var(--text-body);
  font: inherit; font-size: 10px; white-space: nowrap;
}
.demo-seg button:hover { background: var(--text-body); }
.demo-seg button.on { background: var(--accent); border-color: var(--accent-hover); color: #fff; font-weight: 700; }
.demo-body select {
  width: 100%; padding: 5px 7px; border-radius: 4px; background: var(--text-strong);
  color: var(--border-rest); border: 1px solid var(--text-body); font: inherit; font-size: 10px; cursor: pointer;
}
.demo-note { color: var(--text-faint); line-height: 1.45; margin-top: 10px; font-size: 10px; }
.demo-body .dbtn {
  width: 100%; margin-top: 6px; padding: 6px; border-radius: 4px; cursor: pointer;
  background: var(--danger); color: var(--border-danger); border: 1px solid var(--danger-hover); font: inherit; font-size: 10px;
}
.demo-body .dbtn:hover { background: var(--danger-hover); }

.annot-ref {
  display: none; font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: #fff; background: var(--surface-dark); padding: 2px 5px; border-radius: 3px;
  letter-spacing: .03em; vertical-align: middle;
}
body.annot .annot-ref { display: inline-block; }
body.annot .annot-box { outline: 1px dashed var(--focus-ring-strong); outline-offset: 3px; }

.inert-note { font-size: 11px; color: var(--muted); font-style: italic; }

/* The file's own disclaimer. Deliberately styled as scaffolding — dashed, mono,
   unlike anything in the product — so it never reads as a component. */
.ref-banner {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px dashed var(--faint); border-radius: var(--r-card);
  background: var(--surface); padding: 12px 15px; margin: 20px 0 0;
  font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--ink-2);
}
.ref-banner strong { color: var(--ink); }
.ref-banner code { background: var(--wash-2); padding: 1px 5px; border-radius: 3px; }

/* The app-owned banner. Where the reference banner says "this FILE is not a
   target", this one says "this SURFACE is not the website's" — the story, the
   checkpoints and every dialog inside them are built by app.gui and the website
   only serves them. Same scaffolding treatment so neither reads as a component. */
.app-banner {
  display: flex; gap: 9px; align-items: flex-start;
  border: 1px dashed var(--faint); border-left: 3px solid var(--primary);
  background: var(--surface); padding: 9px 13px;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.5; color: var(--ink-2);
  flex: none;
}
.app-banner strong { color: var(--ink); }

/* ============================================================================
   RESPONSIVE (spec §5.2)
   ========================================================================= */
@media (max-width: 1100px) {
  .feature-grid, .steps { grid-template-columns: 1fr; gap: 20px; }
  .mock-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --hdr-h: 60px; --gutter: 16px; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px 14px; }
  .hero h1 { font-size: 28px; }
  .searchbar { flex-wrap: wrap; border-radius: 16px; padding: 6px; }
  .sb-seg { flex: 1 1 45%; }
  .sb-seg + .sb-seg::before { display: none; }
  .admin-shell { display: block; }
  .admin-nav { flex: none; width: 100%; flex-direction: row; overflow-x: auto; border-right: none;
    border-bottom: 1px solid var(--line); padding: 8px; }
  .admin-nav .an-title { display: none; }
  .acct-row .ar-k { flex: 1 1 100%; }
}

@media (max-width: 700px) {
  .hdr-in { gap: 6px; }
  .hdr-link.hide-sm { display: none; }
  .hdr-link { padding: 6px 10px; }
  .acct-pill { padding: 3px; }
  .acct-pill .ap-text { display: none; }
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 24px; }
  .section-pad { padding: 32px 0; }
  .cat-scroll { grid-auto-columns: 170px; gap: 12px; }
  .modal { max-width: none; border-radius: 8px; }
  .dim-table { min-width: 480px; }
  .studio-hd { padding: 8px 14px; }
  .studio-body { padding: 8px 10px 0; }
  .studio-strip { padding: 10px 14px 12px; }
  .strip-actions { flex-wrap: wrap; }
  .strip-poll { flex: 1 1 100%; margin-bottom: 6px; }
  .demo-panel { right: 0; top: auto; bottom: 8px; transform: none; }
  .demo-body { width: min(280px, calc(100vw - 48px)); }
}

@media (max-width: 460px) {
  .logo span { display: none; }
}

@media (max-width: 380px) {
  :root { --gutter: 12px; }
  .lib-grid { grid-template-columns: 1fr; }
}

/* The responsive matrix is ruled (W15): marketing, library and account are
   fully responsive; intake is desktop-first with a soft note; the Studio and
   the admin portal are desktop-only, and say so rather than squeezing. */
.desktop-only-notice { display: none; }
.studio-desktop-only { display: none; }
@media (max-width: 900px) {
  .admin-main .desktop-only-notice { display: flex; }
  .studio-body .desktop-only-notice { display: flex; }
  .studio-body .runview { display: none; }
  .studio .studio-strip { display: none; }
  .studio-desktop-only {
    display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
    padding: 24px 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

@media print {
  .hdr, .ftr, .demo-panel, .toasts { display: none !important; }
}


/* ---- Web_Library_V4 ---- */
/* The target's `html, body { height: 100% }` makes body one screen tall, and the sticky header
   is body's child: it scrolled away with body after ~830 px. Scoped to the library surfaces,
   where the page is taller than the screen. */
body:has(.lib-toolbar) { height: auto; min-height: 100%; }

/* One MP4 on hover over a poster at rest (W11). */
.media-poster, .media-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; background: #fff;
}
.media-poster { -webkit-user-drag: none; }
.media-video { opacity: 0; transition: opacity .22s var(--ease); }
.media.playing .media-video { opacity: 1; }
.card:hover .card-media,
.card:focus-visible .card-media { outline: 2px solid var(--primary); outline-offset: 0; }
.card.pressed .card-media { filter: brightness(.86); }

/* A row is exactly --n cards wide (the script sets --n from the room there is), so a card is
   either wholly in view or not drawn; mandatory snap keeps a resting row on a card edge. The
   2 px scroll padding matches the target's outline gutter. */
.cat-scroll {
  --card-w: 316px; --card-gap: 16px; --n: 4;
  grid-auto-columns: var(--card-w); gap: var(--card-gap);
  width: calc(var(--n) * var(--card-w) + (var(--n) - 1) * var(--card-gap) + 4px);
  max-width: calc(100% + 4px);
  scroll-snap-type: x mandatory; scroll-padding-inline: 2px;
  overscroll-behavior-x: contain;
}
.cat-scroll .card { -webkit-user-select: none; user-select: none; }
.cat-scroll.dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.lib-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 900px) {
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 700px) {
  .cat-scroll { --card-w: 170px; --card-gap: 12px; }
}
[data-lib-hid] { display: none !important; }

/* ---- Web_Library_V15 ---- */
/* Load more: one centred button under the shelves; greyed out (the kit's :disabled) when no
   more groups are left. */
/* V16: two small shelves share a row, each half the width with its own heading. Display only:
   ranking, the 8-then-4 batches and Load more count groups, not rows. */
/* The pair's gap is the cards' own gap, so each half is exactly two cards wide and the second
   shelf starts on the third card column of a full row. */
.cat-pair { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.cat-pair > .cat-row { min-width: 0; }
.notice .notice-cta { margin-left: auto; flex: none; align-self: center; }
.lib-more { display: flex; justify-content: center; margin: 8px 0 24px; }
[data-lib-more] { display: none !important; }
.sb-seg select:disabled { cursor: not-allowed; color: var(--muted); }
/* A placeholder card while the next studies load. */
.card.skeleton { pointer-events: none; }
.card.skeleton .media { background: var(--surface-dim); }
.card.skeleton .sk-line { display: block; height: 12px; width: 80%; margin-top: 4px;
  border-radius: var(--r-pill); background: var(--surface-dim); }
.card.skeleton .sk-chip { display: inline-block; height: 18px; width: 64px; margin-right: 6px;
  border-radius: var(--r-pill); background: var(--surface-dim); }
.card.skeleton .media, .card.skeleton .sk-line, .card.skeleton .sk-chip {
  animation: sk-pulse 1.2s var(--ease) infinite alternate; }
@keyframes sk-pulse { from { opacity: 1; } to { opacity: .45; } }

/* ===== Rules the landing target adds (Web_Landing_V16: tutorial, FAQ) ===== */
.type-row .chip-btn.latched + .type-row-desc { font-weight: 600; color: var(--ink); }
.tut-img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-media); }
.tut-opts.tut-deriv li { font-size: var(--fs-xl); line-height: 1.45; margin: 0 0 10px; }
.tut-deriv-shot { margin-top: 20px; }
.faq-page .tut-para { max-width: none; }
