/* ─────────────────────────────────────────────────────────────────────────────
   Decode by Bridge Forward — design tokens + base styles
   Brand Kit 2 · Direction C · Navy + Gold institutional identity
   (Internally the navy family is still named --indigo-* and the gold family
    --teal-* so the rest of the stylesheet keeps working unchanged.)
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Navy (primary — structure, nav, buttons, headings) */
  --indigo-light: #E8ECF3;
  --indigo-soft:  #B8C4D6;
  --indigo:       #1E3250;
  --indigo-deep:  #16263D;
  --indigo-dark:  #0F1B2D;

  /* Gold (accent — bridge arc, highlights, CTA on dark) */
  --teal-light: #FBEFD4;
  --teal-soft:  #F7D89A;
  --teal:       #F0BE64;
  --teal-deep:  #D9A648;
  --teal-dark:  #A6791F;

  /* Link-only action blue (per brand: hyperlinks, never buttons) */
  --link: #2563EB;

  /* Neutrals */
  --ink:      #1E3250;
  --ink-2:    #2C3E50;
  --ink-3:    #44566A;
  --muted:    #6B7A8D;
  --hairline: #ECEFF4;
  --border:   #E2E6ED;
  --border-strong: #C9D1DD;

  --bg:      #F7F8FA;
  --bg-2:    #EDF0F5;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(30,50,80,.05), 0 1px 1px rgba(30,50,80,.04);
  --shadow-md: 0 2px 6px rgba(30,50,80,.06), 0 10px 24px -8px rgba(30,50,80,.12);
  --shadow-lg: 0 8px 24px -6px rgba(30,50,80,.10), 0 24px 48px -12px rgba(30,50,80,.16);
  --shadow-indigo: 0 10px 30px -10px rgba(30,50,80,.45), 0 4px 10px -2px rgba(30,50,80,.25);

  /* Density (overridden by tweaks) */
  --pad: 36px;
  --gap: 20px;

  /* Type — Plus Jakarta Sans (brand) */
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

/* ── Reset / base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button { font-family: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }

/* ── App shell ───────────────────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

/* Mesh background — soft aurora blobs, color shifts with mode */
.mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}
.mesh-layer {
  position: absolute; inset: 0;
  transition: opacity .9s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.mesh-layer::before, .mesh-layer::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

/* SIM layer — gold dominant (warm / exploratory) */
.mesh-sim::before {
  width: 820px; height: 820px;
  left: -160px; top: -260px;
  background: radial-gradient(circle, var(--teal) 0%, transparent 65%);
  opacity: .30;
}
.mesh-sim::after {
  width: 720px; height: 720px;
  right: -140px; bottom: -240px;
  background: radial-gradient(circle, var(--teal-soft) 0%, transparent 65%);
  opacity: .38;
}

/* LIVE layer — navy dominant (cool / focused) */
.mesh-live::before {
  width: 820px; height: 820px;
  left: -160px; top: -260px;
  background: radial-gradient(circle, var(--indigo-soft) 0%, transparent 65%);
  opacity: .42;
}
.mesh-live::after {
  width: 720px; height: 720px;
  right: -140px; bottom: -240px;
  background: radial-gradient(circle, var(--teal-soft) 0%, transparent 65%);
  opacity: .30;
}

.app[data-mode="sim"]  .mesh-sim  { opacity: 1; }
.app[data-mode="sim"]  .mesh-live { opacity: 0; }
.app[data-mode="live"] .mesh-sim  { opacity: 0; }
.app[data-mode="live"] .mesh-live { opacity: 1; }
.mesh-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(30,50,80,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30,50,80,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 90%);
  pointer-events: none;
}

/* Background variants (controlled by Tweaks) */
.app[data-bg="solid"]  .mesh-layer,
.app[data-bg="solid"]  .mesh-grid { display: none; }

/* Aurora — bigger, richer, more saturated */
.app[data-bg="aurora"] .mesh-sim::before {
  width: 1100px; height: 1100px;
  left: 20%; top: -360px;
  background: conic-gradient(from 220deg,
    var(--teal) 0deg, var(--teal-soft) 80deg,
    var(--indigo-soft) 180deg, var(--teal) 280deg, var(--teal) 360deg);
  opacity: .42;
  filter: blur(110px);
}
.app[data-bg="aurora"] .mesh-sim::after {
  width: 600px; height: 600px;
  left: -120px; bottom: -180px;
  background: radial-gradient(circle, var(--teal-light) 0%, transparent 70%);
  opacity: .55;
}
.app[data-bg="aurora"] .mesh-live::before {
  width: 1100px; height: 1100px;
  left: 20%; top: -360px;
  background: conic-gradient(from 220deg,
    var(--indigo) 0deg, var(--indigo-soft) 80deg,
    var(--teal-soft) 180deg, var(--indigo) 280deg, var(--indigo) 360deg);
  opacity: .38;
  filter: blur(110px);
}
.app[data-bg="aurora"] .mesh-live::after {
  width: 600px; height: 600px;
  right: -120px; bottom: -180px;
  background: radial-gradient(circle, var(--indigo-light) 0%, transparent 70%);
  opacity: .6;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(246, 247, 251, 0.72);
  border-bottom: 1px solid var(--hairline);
}
.nav-left { display: flex; align-items: center; gap: 14px; }
.brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  color: var(--ink);
}
.brand-word {
  display: flex; flex-direction: column; line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 15px;
}
.brand-attr {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--teal-dark);
  margin-top: 3px;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--indigo);
  display: grid; place-items: center;
  color: var(--teal);
  box-shadow: 0 2px 6px -1px rgba(30,50,80,.4), inset 0 1px 0 rgba(255,255,255,.12);
}
/* Actual brand bridge mark in the nav */
.brand-logo {
  display: inline-flex;
  align-items: center;
  color: var(--indigo);
}
.logo-mark {
  height: 30px;
  width: auto;
  display: block;
}
.brand-version {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-2);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mode-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px 0 10px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  color: var(--teal-dark);
  background: var(--teal-light);
  border: 1px solid color-mix(in oklab, var(--teal) 30%, transparent);
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s ease;
}
.mode-pill[data-live="true"] {
  color: var(--indigo-dark);
  background: var(--indigo-light);
  border-color: color-mix(in oklab, var(--indigo) 30%, transparent);
}
.mode-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.mode-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 22%, transparent);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 22%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in oklab, currentColor  6%, transparent); }
}

.nav-right { display: flex; align-items: center; gap: 8px; }
.btn-ghost {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 13.5px; font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); }

/* ── Stage ───────────────────────────────────────────────────────────────── */
.stage {
  flex: 1;
  display: grid;
  place-items: start center;
  padding: 64px 24px 32px;
}
.stage-inner {
  width: 100%;
  max-width: 720px;
  position: relative;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--pad);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.7) 0%, transparent 30%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Type helpers ────────────────────────────────────────────────────────── */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal-dark);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: currentColor;
  opacity: .55;
}
.headline {
  font-size: clamp(32px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 800;
  margin: 14px 0 0;
  color: var(--ink);
  text-wrap: pretty;
}
.headline .accent {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.025em;
  background: linear-gradient(95deg, var(--indigo) 0%, var(--indigo-deep) 35%, var(--teal-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline;
}
.sub {
  margin-top: 16px;
  font-size: 16px;
  color: var(--ink-3);
  max-width: 56ch;
  text-wrap: pretty;
}
.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.helper {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
  text-wrap: pretty;
}

/* ── Mode selector ───────────────────────────────────────────────────────── */
.mode-block { margin-top: 32px; }
.mode-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 6px;
}
.mode-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  margin-top: 14px;
  isolation: isolate;
}
.mode-toggle-pill {
  position: absolute;
  top: 5px; bottom: 5px;
  width: calc(50% - 5px);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
  transition: transform .35s cubic-bezier(.5,.1,.25,1.1);
  z-index: 0;
}
.mode-toggle[data-active="live"] .mode-toggle-pill { transform: translateX(100%); }
.mode-toggle button {
  appearance: none; border: 0; background: transparent;
  position: relative; z-index: 1;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  font-size: 14px; font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .2s ease;
  border-radius: 10px;
}
.mode-toggle button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.mode-toggle button .swatch {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted);
  transition: background .2s ease;
}
.mode-toggle button[aria-selected="true"][data-mode="sim"]  .swatch { background: var(--teal); }
.mode-toggle button[aria-selected="true"][data-mode="live"] .swatch { background: var(--indigo); }

.mode-desc {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: start;
}
.mode-desc .icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 16px;
}
.mode-desc[data-mode="live"] .icon { background: var(--indigo-light); color: var(--indigo-dark); }
.mode-desc h4 {
  margin: 0;
  font-size: 14.5px; font-weight: 600;
  color: var(--ink);
}
.mode-desc p {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
  text-wrap: pretty;
}
.mode-desc .badge {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px;
  white-space: nowrap;
  color: var(--teal-dark);
  background: white;
  border: 1px solid color-mix(in oklab, var(--teal) 30%, transparent);
}
.mode-desc[data-mode="live"] .badge {
  color: var(--indigo-dark);
  border-color: color-mix(in oklab, var(--indigo) 30%, transparent);
}

/* ── Mode CARDS variant (Tweak) ─────────────────────────────────────────── */
.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.mode-card {
  appearance: none;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
}
.mode-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.mode-card[aria-selected="true"][data-mode="sim"]  {
  border-color: var(--teal);
  background: color-mix(in oklab, var(--teal-light) 50%, white);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--teal) 12%, transparent);
}
.mode-card[aria-selected="true"][data-mode="live"] {
  border-color: var(--indigo);
  background: color-mix(in oklab, var(--indigo-light) 40%, white);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--indigo) 12%, transparent);
}
.mode-card h4 {
  margin: 10px 0 4px;
  font-size: 15px; font-weight: 600;
  color: var(--ink);
}
.mode-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
  text-wrap: pretty;
}
.mode-card .icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
}
.mode-card[data-mode="sim"]  .icon { background: var(--teal-light);   color: var(--teal-dark); }
.mode-card[data-mode="live"] .icon { background: var(--indigo-light); color: var(--indigo-dark); }
.mode-card .radio {
  position: absolute; top: 14px; right: 14px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: white;
  display: grid; place-items: center;
}
.mode-card[aria-selected="true"][data-mode="sim"]  .radio { border-color: var(--teal); }
.mode-card[aria-selected="true"][data-mode="live"] .radio { border-color: var(--indigo); }
.mode-card[aria-selected="true"] .radio::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.mode-card[aria-selected="true"][data-mode="sim"]  .radio { color: var(--teal); }
.mode-card[aria-selected="true"][data-mode="live"] .radio { color: var(--indigo); }

/* ── Actions row ─────────────────────────────────────────────────────────── */
.actions {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.actions .left { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }

/* Primary button */
.btn {
  appearance: none;
  border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  font-size: 14.5px; font-weight: 600;
  border-radius: 12px;
  color: white;
  background: var(--indigo);
  background-image: linear-gradient(180deg, color-mix(in oklab, var(--indigo) 90%, white) 0%, var(--indigo) 60%, var(--indigo-deep) 100%);
  box-shadow: var(--shadow-indigo), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .12s ease, box-shadow .18s ease, filter .15s ease;
  letter-spacing: -.005em;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); filter: brightness(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.3); }
.btn .arrow { display: inline-block; transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-secondary {
  background: transparent;
  background-image: none;
  color: var(--ink-2);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 500;
}
.btn-secondary:hover { background: var(--surface); border-color: var(--border-strong); }

/* ── Progress ────────────────────────────────────────────────────────────── */
.progress-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
  font-size: 12.5px; color: var(--muted); letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.progress-bar {
  position: relative;
  height: 4px; border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
  flex: 1;
  margin: 0 14px;
}
.progress-fill {
  position: absolute; inset: 0;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, var(--indigo) 0%, var(--teal) 100%);
  border-radius: inherit;
  transition: width .5s cubic-bezier(.4,.0,.2,1);
  box-shadow: 0 0 8px rgba(91,108,255,.45);
}
.progress-count {
  font-weight: 600; color: var(--ink-2); min-width: 32px; text-align: right;
}

/* ── Question screens ────────────────────────────────────────────────────── */
.q-title {
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 600;
  color: var(--ink);
  margin: 4px 0 0;
  text-wrap: balance;
}
.q-sub { margin-top: 10px; color: var(--ink-3); font-size: 15px; }

.options {
  margin-top: 28px;
  display: grid;
  gap: 10px;
}
.options[data-cols="2"] { grid-template-columns: 1fr 1fr; }
.options[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }

.option {
  appearance: none;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  font-size: 14.5px; color: var(--ink);
  transition: all .15s ease;
  position: relative;
}
.option:hover { border-color: var(--indigo-soft); background: color-mix(in oklab, var(--indigo-light) 25%, white); }
.option .glyph {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--bg-2);
  color: var(--ink-3);
  font-size: 17px;
  flex-shrink: 0;
  transition: all .18s ease;
}
.option .opt-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.option .opt-title { font-weight: 500; }
.option .opt-meta  { font-size: 12.5px; color: var(--muted); }
.option .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: grid; place-items: center;
  background: white;
  transition: all .15s ease;
}
.option[aria-selected="true"] {
  border-color: var(--indigo);
  background: color-mix(in oklab, var(--indigo-light) 40%, white);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--indigo) 10%, transparent);
}
.option[aria-selected="true"] .glyph {
  background: var(--indigo);
  color: white;
}
.option[aria-selected="true"] .check {
  border-color: var(--indigo);
  background: var(--indigo);
}
.option[aria-selected="true"] .check::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid white; border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Urgency scale (q2) */
.scale {
  margin-top: 28px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.scale-btn {
  appearance: none;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 8px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: all .15s ease;
}
.scale-btn .big {
  font-family: var(--font-display);
  font-size: 26px; line-height: 1; color: var(--ink); font-weight: 500; letter-spacing: -.02em;
}
.scale-btn[aria-selected="true"] {
  border-color: var(--indigo);
  background: color-mix(in oklab, var(--indigo-light) 50%, white);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--indigo) 10%, transparent);
}
.scale-btn[aria-selected="true"] .big {
  background: linear-gradient(95deg, var(--indigo) 0%, var(--teal) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.scale-btn:hover { border-color: var(--indigo-soft); }

/* Multi-chip */
.chips { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13.5px; color: var(--ink-2);
  transition: all .15s ease;
}
.chip:hover { border-color: var(--indigo-soft); }
.chip[aria-selected="true"] {
  background: var(--indigo);
  border-color: var(--indigo);
  color: white;
  box-shadow: 0 4px 10px -4px rgba(91,108,255,.55);
}
.chip .x { font-size: 11px; opacity: .8; }

/* ── Textarea ────────────────────────────────────────────────────────────── */
.textarea-wrap {
  margin-top: 22px;
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: all .18s ease;
}
.textarea-wrap:focus-within {
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--indigo) 12%, transparent);
}
.textarea-wrap textarea {
  width: 100%;
  border: 0; outline: none;
  resize: vertical;
  min-height: 180px;
  padding: 18px 18px 40px;
  background: transparent;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  border-radius: inherit;
}
.textarea-wrap textarea::placeholder { color: var(--muted); }
.textarea-meta {
  position: absolute; left: 18px; right: 18px; bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  pointer-events: none;
}
.prompt-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.prompt-hints button {
  appearance: none; cursor: pointer;
  padding: 6px 10px; border-radius: 999px;
  border: 1px dashed var(--border);
  background: transparent;
  font-size: 12px; color: var(--ink-3);
  transition: all .14s ease;
}
.prompt-hints button:hover { background: var(--surface-2); border-style: solid; border-color: var(--indigo-soft); color: var(--indigo-dark); }

/* ── Analyzing screen ────────────────────────────────────────────────────── */
.analyzing {
  text-align: center;
  padding: 28px 0 8px;
}
.analyzing .orb {
  width: 96px; height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--indigo), var(--teal), var(--indigo-soft), var(--indigo));
  filter: blur(.5px);
  position: relative;
  animation: spin 2.6s linear infinite;
  box-shadow: 0 0 60px -10px rgba(91,108,255,.6);
}
.analyzing .orb::after {
  content: "";
  position: absolute; inset: 8px;
  background: white;
  border-radius: 50%;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analyzing-steps {
  margin-top: 24px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13.5px; color: var(--ink-3);
  align-items: center;
}
.analyzing-step {
  display: inline-flex; align-items: center; gap: 10px;
  opacity: 0;
  transform: translateY(6px);
  transition: all .4s ease;
}
.analyzing-step.on { opacity: 1; transform: translateY(0); }
.analyzing-step .dot-check {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--teal);
  display: grid; place-items: center;
  color: white; font-size: 10px;
}

/* ── Results ─────────────────────────────────────────────────────────────── */
.results-head { display: flex; align-items: flex-start; gap: 14px; }
.results-head .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal-light), var(--indigo-light));
  display: grid; place-items: center;
  color: var(--indigo-dark);
  flex-shrink: 0;
  border: 1px solid var(--hairline);
}
.recs {
  margin-top: 26px;
  display: flex; flex-direction: column; gap: 12px;
}
.rec {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 18px 20px;
  background: var(--surface);
  position: relative;
  transition: all .2s ease;
  overflow: hidden;
}
.rec:hover { box-shadow: var(--shadow-md); border-color: var(--border); transform: translateY(-1px); }
.rec-head {
  display: flex; align-items: flex-start; gap: 14px;
}
.rec-rank {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  color: white;
  background: var(--indigo);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.rec:nth-child(2) .rec-rank { background: var(--teal); }
.rec:nth-child(3) .rec-rank { background: var(--indigo-soft); color: var(--indigo-dark); }
.rec h3 {
  margin: 0 0 4px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
}
.rec .conf {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--teal-dark);
  background: var(--teal-light);
  border-radius: 999px;
  margin-left: 10px;
  vertical-align: middle;
}
.rec p { margin: 8px 0 0; font-size: 14px; color: var(--ink-3); text-wrap: pretty; }
.rec-meta {
  margin-top: 14px;
  display: flex; gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.rec-meta span { display: inline-flex; align-items: center; gap: 6px; }
.rec-meta b { color: var(--ink-2); font-weight: 600; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  padding: 24px 24px 40px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.footer-disclaimer {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 66ch;
  margin: 0 auto 14px;
  text-wrap: pretty;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.footer-meta {
  font-size: 12.5px;
  color: var(--muted);
}
.footer a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

/* ── Step transitions ────────────────────────────────────────────────────── */
/* Animate transform only — NEVER opacity. When the iframe is throttled
   (background tab/blur), document.timeline freezes and the animation gets
   stuck at the FROM keyframe. With opacity in there, the content goes
   invisible until focus returns. Slide-only means worst case is an 8px
   offset — content always readable. */
.fade-in {
  animation: slideIn .38s cubic-bezier(.4,0,.2,1);
}
@keyframes slideIn {
  from { transform: translateY(6px); }
  to   { transform: translateY(0); }
}

/* Density */
.app[data-density="compact"] { --pad: 26px; --gap: 14px; }
.app[data-density="comfy"]   { --pad: 44px; --gap: 24px; }

/* ─────────────────────────────────────────────────────────────────────────
   v2 — Intake-specific components
   ───────────────────────────────────────────────────────────────────────── */

/* Tier badges (STANDARD / CAUTION / HARD BLOCK) */
.tier {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  font-feature-settings: "tnum" on;
}
.tier-standard { background: var(--bg-2);          color: var(--ink-3);     }
.tier-caution  { background: #FFF4DC;              color: #92400E;          border: 1px solid #FCD34D; }
.tier-hardblock{ background: #FEE2E2;              color: #991B1B;          border: 1px solid #FCA5A5; }
.tier-alpha    { background: var(--indigo-light);  color: var(--indigo-dark); border: 1px solid var(--indigo-soft); }
.tier-schema   { background: transparent;          color: var(--muted);     border: 1px dashed var(--border); }
.tier-priority-high   { background: #FEE2E2; color: #991B1B; }
.tier-priority-medium { background: #FFF4DC; color: #92400E; }
.tier-priority-low    { background: var(--teal-light); color: var(--teal-dark); }

/* Status / route option — richer than .option (with subtitle + meta line + tier) */
.status-option {
  appearance: none; text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s ease;
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 14px;
  align-items: center;
}
.status-option .glyph {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--bg-2);
  color: var(--ink-3);
  transition: all .18s ease;
}
.status-option .so-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.status-option .so-title { font-weight: 500; color: var(--ink); font-size: 14.5px; }
.status-option .so-id { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.status-option .so-note { font-size: 12.5px; color: #92400E; margin-top: 4px; text-wrap: pretty; }
.status-option .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: white;
  display: grid; place-items: center;
  transition: all .15s ease;
}
.status-option:hover { border-color: var(--indigo-soft); background: color-mix(in oklab, var(--indigo-light) 18%, white); }
.status-option[data-tier="hardblock"]:hover { border-color: #FCA5A5; background: #FFFAFA; }
.status-option[aria-selected="true"] {
  border-color: var(--indigo);
  background: color-mix(in oklab, var(--indigo-light) 40%, white);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--indigo) 10%, transparent);
}
.status-option[aria-selected="true"] .glyph { background: var(--indigo); color: white; }
.status-option[aria-selected="true"] .check {
  border-color: var(--indigo); background: var(--indigo);
}
.status-option[aria-selected="true"] .check::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid white; border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Caution callout on G1 when selected status has a caution */
.callout {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px;
  text-wrap: pretty;
}
.callout-caution  { background: #FFFBEB; border-color: #FDE68A; color: #78350F; }
.callout-info     { background: var(--surface-2); border-color: var(--hairline); color: var(--ink-3); }
.callout-danger   { background: #FEF2F2; border-color: #FECACA; color: #7F1D1D; }
.callout .icon { flex-shrink: 0; margin-top: 1px; }

/* Province / territory grid */
.province-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.province-card {
  appearance: none; text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: all .15s ease;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 96px;
  position: relative;
}
.province-card .code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
}
.province-card .name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
  text-wrap: balance;
}
.province-card .state {
  margin-top: auto;
}
.province-card[data-state="alpha"] {
  border-color: var(--indigo-soft);
  background: color-mix(in oklab, var(--indigo-light) 25%, white);
}
.province-card[data-state="alpha"]:hover {
  border-color: var(--indigo);
  background: color-mix(in oklab, var(--indigo-light) 45%, white);
}
.province-card[data-state="alpha"][aria-selected="true"] {
  border-color: var(--indigo);
  background: color-mix(in oklab, var(--indigo-light) 55%, white);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--indigo) 10%, transparent);
}
.province-card[data-state="alpha"][aria-selected="true"] .code { color: var(--indigo-dark); }
.province-card[data-state="schema"] {
  cursor: not-allowed;
  opacity: .55;
  background: var(--surface-2);
}
.province-card[data-state="schema"]:hover { opacity: .75; }
.province-card[data-state="schema"] .name { color: var(--ink-3); }
.province-card .schema-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

/* Locked gates strip (shown on ambient & results) */
.gates {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px;
}
.gate-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-2);
  font-feature-settings: "tnum" on;
}
.gate-chip .g-key { color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.gate-chip .lock { color: var(--muted); display: inline-flex; }
.gate-chip[data-tier="caution"]   { background: #FFFBEB; border-color: #FDE68A; }
.gate-chip[data-tier="hardblock"] { background: #FEF2F2; border-color: #FECACA; }

/* Ambient meta row beneath description */
.ambient-howto {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px dashed var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.ambient-howto b { color: var(--ink-2); font-weight: 600; }

/* 90-day timeline */
.timeline {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 38px;
  height: 2px;
  background: linear-gradient(90deg, var(--indigo) 0%, var(--teal) 100%);
  border-radius: 999px;
  opacity: .25;
  z-index: 0;
}
.tl-phase {
  position: relative;
  padding: 0 4px;
  display: flex; flex-direction: column; gap: 8px;
}
.tl-phase .tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--indigo);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--indigo-soft);
  margin: 32px 0 8px;
  align-self: flex-start;
  z-index: 1;
  position: relative;
}
.tl-phase:nth-child(2) .tl-dot { background: var(--indigo-deep); }
.tl-phase:nth-child(3) .tl-dot { background: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.tl-phase:nth-child(4) .tl-dot { background: var(--teal-deep); box-shadow: 0 0 0 2px var(--teal-soft); }
.tl-phase .range {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-mono);
}
.tl-phase .step-ref {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--indigo-dark);
  letter-spacing: .02em;
}
.tl-phase .step-name {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.35;
  text-wrap: pretty;
}

/* Step cards (Mode A / B) */
.steps { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.step-card {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 16px 18px;
  background: var(--surface);
  transition: all .18s ease;
}
.step-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.step-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
}
.step-agency {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg-2);
}
.step-id {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}
.step-card h3 {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.step-card .why  { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-3); text-wrap: pretty; }
.step-card .next {
  margin: 10px 0 0;
  padding: 8px 12px;
  font-size: 12.5px;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex; gap: 8px;
  color: var(--ink-2);
}
.step-card .next b { color: var(--ink); font-weight: 600; }

/* Routing pill */
.routing-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--indigo-light);
  color: var(--indigo-dark);
  border: 1px solid color-mix(in oklab, var(--indigo) 25%, transparent);
}
.routing-pill[data-mode="mode_b"] {
  background: var(--teal-light); color: var(--teal-dark);
  border-color: color-mix(in oklab, var(--teal) 25%, transparent);
}
.routing-pill .arr { font-family: var(--font-mono); opacity: .7; }

/* Alert / refusal card */
.alert-card {
  padding: 22px 24px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  display: flex; gap: 16px;
  align-items: flex-start;
  margin-top: 8px;
}
.alert-card .a-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.alert-card[data-kind="hardblock"] .a-icon { background: #FEE2E2; color: #991B1B; }
.alert-card[data-kind="refusal"]   .a-icon { background: #FFF4DC; color: #92400E; }
.alert-card h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.alert-card p { margin: 6px 0 0; font-size: 14px; color: var(--ink-3); text-wrap: pretty; }
.alert-card code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--ink-2);
}

.referral-list {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
}
.referral-list h4 {
  margin: 0 0 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.referral-list ul { margin: 0; padding-left: 18px; }
.referral-list li { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.referral-list li + li { margin-top: 4px; }

/* Disclaimer */
.disclaimer {
  margin-top: 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--indigo-soft);
  background: var(--surface-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.55;
  text-wrap: pretty;
}
.disclaimer .key {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* Header for results page */
.results-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px;
}
.results-meta .naics-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  font-family: var(--font-mono);
}

/* Mobile */
@media (max-width: 720px) {
  .province-grid { grid-template-columns: repeat(3, 1fr); }
  .timeline { grid-template-columns: 1fr 1fr; }
  .status-option { grid-template-columns: 32px 1fr; }
  .status-option .tier, .status-option .check { grid-column: 2 / -1; justify-self: end; }
}
@media (max-width: 480px) {
  .province-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: 1fr; }
}

/* Mobile-ish */
@media (max-width: 640px) {
  .nav { padding: 14px 16px; }
  .stage { padding: 32px 14px; }
  .options[data-cols="2"], .options[data-cols="3"] { grid-template-columns: 1fr; }
  .scale { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .mode-cards { grid-template-columns: 1fr; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .btn { justify-content: center; }
  .book-band { flex-direction: column; align-items: flex-start; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Brain results — profile context, scenario cards, book band, unique screen
   ───────────────────────────────────────────────────────────────────────── */

/* Coral/gold accent button (Book Afsana) */
.btn-coral {
  color: var(--indigo-dark);
  background: var(--teal);
  background-image: linear-gradient(180deg, color-mix(in oklab, var(--teal) 88%, white) 0%, var(--teal) 60%, var(--teal-deep) 100%);
  box-shadow: 0 10px 28px -10px rgba(240,190,100,.7), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-coral:hover { filter: brightness(1.04); }
.btn-block { width: 100%; justify-content: center; }

/* Routing pill recolor by tier */
.routing-pill.tier-standard  { background: var(--indigo-light); color: var(--indigo-dark); border: 1px solid var(--indigo-soft); }
.routing-pill.tier-caution   { background: #FFF4DC; color: #92400E; border: 1px solid #FCD34D; }
.routing-pill.tier-hardblock { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* Profile context block */
.profile-context {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  border-left: 4px solid var(--indigo);
}
.profile-context.tier-standard  { border-left-color: var(--indigo); }
.profile-context.tier-caution   { border-left-color: var(--teal-deep); background: #FFFCF5; }
.profile-context.tier-hardblock { border-left-color: #DC2626; background: #FFF9F9; }
.pc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pc-profile { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.pc-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

/* Results subhead */
.results-subhead {
  margin: 26px 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}

/* Scenario cards */
.scenarios-list { display: flex; flex-direction: column; gap: 10px; }
.scenario-card {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.scenario-card.open { box-shadow: var(--shadow-sm); border-color: var(--border); }
.scenario-head {
  width: 100%;
  appearance: none; border: 0; background: transparent;
  display: grid; grid-template-columns: 34px 1fr 22px;
  gap: 12px; align-items: center;
  padding: 15px 16px;
  cursor: pointer; text-align: left;
}
.scenario-num {
  font-size: 12px; font-weight: 700; color: white;
  background: var(--indigo);
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.scenario-trigger { font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -.005em; line-height: 1.35; }
.scenario-chev { color: var(--muted); display: grid; place-items: center; transition: transform .2s ease; }
.scenario-card.open .scenario-head .scenario-chev { transform: rotate(180deg); color: var(--indigo); }
.scenario-chev.open { transform: rotate(180deg); }
.scenario-body { padding: 0 16px 16px 16px; }
.scenario-steps { margin: 6px 0 0; padding: 0 0 0 4px; list-style: none; counter-reset: stp; display: flex; flex-direction: column; gap: 8px; }
.scenario-steps .step-line {
  position: relative; padding-left: 26px;
  font-size: 13.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty;
  counter-increment: stp;
}
.scenario-steps .step-line::before {
  content: counter(stp);
  position: absolute; left: 0; top: 1px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--indigo-light); color: var(--indigo-dark);
  font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.scenario-steps .step-line.warn { color: #92400E; font-weight: 500; }
.scenario-steps .step-line.warn::before { background: #FEE2E2; color: #991B1B; content: "!"; }
.scenario-steps .step-subhead {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-top: 8px; padding-left: 0;
}
.scenario-steps .step-subhead:first-child { margin-top: 0; }
.scenario-source {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 14px;
  font-size: 12.5px; font-weight: 500;
  color: var(--link);
  text-decoration: none;
}
.scenario-source:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Common mistakes */
.mistakes { margin-top: 18px; border: 1px solid #FCD34D; border-radius: var(--r-md); background: #FFFCF5; overflow: hidden; }
.mistakes-head {
  width: 100%; appearance: none; border: 0; background: transparent;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #92400E; text-align: left;
}
.mistakes-head .scenario-chev { margin-left: auto; color: #B45309; }
.mistakes-list { margin: 0; padding: 0 18px 16px 38px; display: flex; flex-direction: column; gap: 8px; }
.mistakes-list li { font-size: 13.5px; line-height: 1.5; color: #78350F; text-wrap: pretty; }

/* Book band */
.book-band {
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: var(--indigo);
  background-image: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: white;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  box-shadow: var(--shadow-md);
}
.book-copy h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.book-copy p { margin: 0; font-size: 13.5px; opacity: .82; text-wrap: pretty; }
.book-band .btn { flex-shrink: 0; }

/* Unique / no-match screen */
.unique-hero {
  margin-top: 22px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, color-mix(in oklab, var(--teal-light) 60%, white) 0%, var(--surface) 100%);
  border: 1px solid var(--teal-soft);
}
.advisor-card { display: flex; align-items: center; gap: 14px; }
.advisor-avatar {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--indigo); color: var(--teal);
  display: grid; place-items: center;
  font-size: 24px; font-weight: 800; font-family: var(--font-display);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}
.advisor-meta h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.advisor-meta p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.unique-note { margin: 16px 0 18px; font-size: 14px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

/* ─────────────────────────────────────────────────────────────────────────
   Brand logo (exact supplied SVG) in the nav
   ───────────────────────────────────────────────────────────────────────── */
.brand-logo-img {
  height: 46px;
  width: auto;
  display: block;
}
@media (max-width: 640px) {
  .brand-logo-img { height: 38px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Two-button rows: Chat with Leela (left) + Book Afsana (right)
   ───────────────────────────────────────────────────────────────────────── */
.talk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.unique-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.unique-actions .btn-leela { flex: 0 0 auto; }
.unique-actions .btn-coral { flex: 1 1 auto; }

/* Chat-with-Leela button — light/secondary so Book Afsana (gold) stays primary */
.btn-leela {
  appearance: none;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px;
  font-size: 14.5px; font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  color: var(--indigo);
  background: white;
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .18s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn-leela:hover { transform: translateY(-1px); border-color: var(--indigo); box-shadow: var(--shadow-md); }
.btn-leela svg { flex-shrink: 0; }
/* On the dark book-band, give the Leela button a translucent treatment */
.book-band .btn-leela {
  background: rgba(255,255,255,.12);
  color: white;
  border-color: rgba(255,255,255,.35);
  box-shadow: none;
}
.book-band .btn-leela:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.6); }

/* ─────────────────────────────────────────────────────────────────────────
   Leela chat — floating launcher + docked panel
   ───────────────────────────────────────────────────────────────────────── */
.leela-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 1200;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 16px 11px 12px;
  border: 0; cursor: pointer;
  border-radius: 999px;
  background: var(--indigo);
  color: white;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 28px -8px rgba(30,50,80,.55), 0 2px 6px rgba(30,50,80,.3);
  transition: transform .14s ease, box-shadow .18s ease;
}
.leela-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(30,50,80,.6); }
.leela-fab svg { flex-shrink: 0; }

.leela-panel {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 1300;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: min(640px, calc(100vh - 44px));
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px -12px rgba(30,50,80,.4), 0 8px 24px -8px rgba(30,50,80,.3);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.4,0,.2,1);
}
.leela-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.leela-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: white;
  flex-shrink: 0;
}
.leela-id { display: flex; align-items: center; gap: 11px; }
.leela-badge {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.12);
}
.leela-badge svg { display: block; }
.leela-id b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: block; }
.leela-sub { font-size: 11px; opacity: .72; }
.leela-x {
  appearance: none; border: 0; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.1); color: white;
  font-size: 14px; line-height: 1;
  transition: background .15s ease;
}
.leela-x:hover { background: rgba(255,255,255,.22); }

.leela-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 14px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in oklab, var(--teal-light) 40%, transparent) 0, transparent 40%),
    var(--surface-2);
  scrollbar-width: thin;
}
.leela-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.leela-msg.user { justify-content: flex-end; }
.leela-mini { flex-shrink: 0; margin-bottom: 2px; }
.leela-mini svg { display: block; }
.leela-bubble {
  font-size: 14px; line-height: 1.5;
  padding: 11px 14px;
  border-radius: 16px;
  max-width: 84%;
  text-wrap: pretty;
  white-space: normal;
}
.leela-msg.assistant .leela-bubble {
  background: white;
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-sm);
}
.leela-msg.user .leela-bubble {
  background: var(--indigo);
  color: white;
  border-bottom-right-radius: 5px;
}
.leela-bubble a {
  color: var(--indigo);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.leela-msg.user .leela-bubble a { color: white; }

/* typing dots */
.leela-typing { display: inline-flex; gap: 4px; align-items: center; padding: 14px 16px; }
.leela-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: leelaBlink 1.2s infinite ease-in-out both;
}
.leela-typing span:nth-child(2) { animation-delay: .18s; }
.leela-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes leelaBlink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* quick-reply chips */
.leela-chips { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 2px; }
.leela-chips button {
  appearance: none; cursor: pointer; text-align: left;
  padding: 9px 13px;
  border-radius: 12px;
  border: 1px solid var(--indigo-soft);
  background: white;
  color: var(--indigo);
  font-size: 13px; font-weight: 500;
  line-height: 1.35;
  transition: all .14s ease;
  max-width: 100%;
}
.leela-chips button:hover { background: var(--indigo-light); border-color: var(--indigo); }

.leela-foot {
  flex-shrink: 0;
  padding: 12px 14px 12px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}
.leela-input {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.leela-input:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 4px color-mix(in oklab, var(--indigo) 10%, transparent); }
.leela-input textarea {
  flex: 1;
  border: 0; outline: none; resize: none;
  background: transparent;
  font-family: inherit; font-size: 14px; line-height: 1.5;
  color: var(--ink);
  max-height: 96px;
  padding: 6px 0;
}
.leela-send {
  appearance: none; border: 0; cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--indigo); color: white;
  transition: opacity .15s ease, transform .12s ease, filter .15s ease;
}
.leela-send:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.leela-send:disabled { opacity: .4; cursor: not-allowed; }
.leela-book {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
}
.leela-book:hover { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 560px) {
  .leela-panel {
    right: 0; bottom: 0; top: 0; left: 0;
    width: 100%; max-width: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
  }
  .leela-fab { right: 16px; bottom: 16px; }
}
