/* ============================================================
   WO-GROK-2026-07-31-S — Iteration 4 + real logo values
   Logo-first: light ground, colour as accent.

   Structure and typography from iteration 2 stand.
   Iteration 3 royal full-bleed WITHDRAWN.

   Tokens sampled from Ted's 30A Thoroughbreds mark (1024×1024 PNG).
   --teal renamed --navy: real mark is nearly black-blue, not teal.
   Logo PNG has #F4F3EE baked in — only place on --ground; no key-out.
   ============================================================ */
:root {
  /* Brand tokens — sampled from Ted's 30A Thoroughbreds mark */
  --ground: #F4F3EE;           /* warmer paper-like ground (was #FAFAF7 estimate) */
  --navy: #05233B;             /* nearly black-blue from mark — chrome, structure, headings (was --teal #17495C) */
  --gold: #C89D2C;             /* brand gold — mark only, not body text (was #C9A227) */
  --gold-text: #8B6F14;        /* hero figure text — deepened for WCAG; large-text AA on ground */
  --ink: #1A1F24;              /* body text */
  --ink-mute: #5F6B72;         /* secondary text */
  --rule: #E2E5E4;             /* hairlines */
  --royal: #14307D;            /* silks royal — SPARINGLY, accent/links only. NEVER a background */

  /* Semantic */
  --accent: var(--royal);
  --fail: #C23B3B;
  --fail-bg: rgba(194, 59, 59, 0.08);

  /* Surfaces */
  --paper: var(--ground);
  --bg: var(--ground);
  --card: #FFFFFF;
  --card-border: var(--rule);
  --muted: var(--ink-mute);
  --line: var(--rule);
  --warn: var(--fail);
  --warn-bg: var(--fail-bg);
  --amber: var(--ink-mute);
  --amber-bg: transparent;
  --ok: var(--navy);
  --ok-soft: rgba(5, 35, 59, 0.08);
  --override: var(--ink-mute);
  --override-bg: transparent;

  /* Legacy aliases (withdrawn roles remapped) */
  --sunshine: var(--gold-text);     /* was hero yellow → gold-text */
  --turquoise: var(--navy);         /* structural hairlines/fills */
  --turquoise-text: var(--royal);   /* interactive text → royal accent */
  --teal: var(--navy);              /* deprecated alias — prefer --navy */
  --white: #FFFFFF;
  --data-surface: var(--ground);    /* no longer a special case */
  --data-ink: var(--ink);
  --data-mute: var(--ink-mute);
  --data-rule: var(--rule);
  --data-header: #F0F2F1;
  --baize: var(--navy);

  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-data: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --font: var(--font-body);
  --font-ui: var(--font-body);
  --font-num: var(--font-data);

  --fs-hero: 68px;
  --fs-lot: 28px;
  --fs-section: 13px;
  --fs-body: 16px;
  --fs-data: 15px;
  --fs-caption: 13px;
  --space-block: 4.5rem;

  --horse-cell-w: 154px;
  --horse-cell-h: 106px;
  --horse-cycle: 0.9s;
}


* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* WO-BS-EV EV2: no horizontal scroll at any width (prove at 320px) */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  background: var(--ground);
  color: var(--ink);
  line-height: 1.6;
  /* WO-BS-EV EV2: dvh tracks the visible viewport (iOS Safari 100vh is taller than visible) */
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  max-width: 100%;
  /* Safe areas for notch / home indicator when display-mode standalone or viewport-fit=cover */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 3px;
}

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

/* —— Header —— ground strip (mark has #F4F3EE baked in; must not sit on navy) ——
   i4 used navy full-bleed chrome; real mark forces ground behind the logo.
   Navy remains structure elsewhere: headings, borders, buttons, hero chrome. */
.site-header,
header.site-header,
header {
  background: var(--ground);
  color: var(--ink);
  padding: 0.65rem 1.25rem;
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-height: 44px; /* EV3 touch */
}
.header-logo {
  /* WO-BS-EZ EZ1: shield only (transparent crop) — no wordmark beside it */
  height: clamp(56px, 5.5vw, 96px);
  width: auto;
  max-height: clamp(56px, 5.5vw, 96px);
  display: block;
  object-fit: contain;
  /* Transparent shield crop — never invert, never key out, never on navy. */
}
header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0;
  min-width: 0;
}
header nav a {
  color: var(--ink-mute);
  margin-right: 0.85rem;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  /* EV3: tappable nav ≥ 44×44 pt (short labels like Home need min-width too) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.4rem;
  box-sizing: border-box;
}
header nav a:hover {
  color: var(--turquoise-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
header .brand { font-weight: 600; letter-spacing: 0.02em; color: var(--navy); }
.header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-snap {
  color: var(--ink-mute);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.header-snap .snap-label {
  display: inline;
  font-size: 0.75rem;
  color: var(--ink-mute);
}
.header-snap .snap-when,
.header-snap code {
  font-family: var(--font-body);
  font-size: 0.8rem;
  background: none;
  color: var(--ink);
  white-space: nowrap;
}
.user-chip {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.user-chip-name { font-weight: 500; color: var(--ink); }
.user-chip-role {
  font-size: 0.75rem;
  color: var(--ink-mute);
  text-transform: lowercase;
}
.signout-form { display: inline; margin: 0; }
.signout-btn {
  background: transparent;
  border: none;
  color: var(--turquoise-text) !important;
  padding: 0.5rem 0.35rem;
  border-radius: 0;
  font-size: 0.78rem;
  font-family: var(--font-body);
  cursor: pointer;
  font-weight: 400 !important;
  min-height: 44px; /* EV3 */
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.signout-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; }

/* WO-BS-EV EV4: drawer open control — visible only in phone drawer mode (JS unhides) */
.drawer-open-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}
.drawer-open-btn .drawer-open-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.drawer-open-btn:hover,
.drawer-open-btn:focus-visible {
  border-color: var(--gold);
  color: var(--navy);
}
.drawer-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #c9c4b8;
  border-radius: 4px;
  background: #fff;
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.drawer-backdrop {
  display: none;
}

h1, h2, h3 {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
}
h1 { font-size: 1.65rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.65rem; }
h3 { font-size: 1rem; margin: 1.1rem 0 0.4rem; }

.lede { font-size: 1.05rem; max-width: 40rem; color: var(--ink); }
.muted, .ink-mute { color: var(--ink-mute); }
a { color: var(--turquoise-text); }
strong, b { font-weight: 600; color: var(--ink); }

.num, .hero-num, td.num, th.num {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

/* Black type — catalogue convention ONLY (WO-BS-AP / Handoff §6).
   .black-type may appear only under .page-catalogue (and print of same).
   Other surfaces must not use these classes for horse names. */
.page-catalogue .black-type,
.page-catalogue .black-type-gsw,
.page-catalogue .black-type-sw {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.page-catalogue .black-type-gsw {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.page-catalogue .listed-type {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.page-catalogue .bt-plain {
  font-family: var(--font-display);
  font-weight: 400;
}
.page-catalogue .bt-grade {
  font-family: var(--font-display);
  font-weight: 400;
  white-space: nowrap;
}


/* ============================================================
   LOT — one number (gold), three text links (royal)
   ============================================================ */
.page-lot main,
.page-why main {
  max-width: 36rem;
  padding: 3rem 1.5rem 5rem;
}
.page-lot .provenance-footer,
.page-why .provenance-footer { display: none !important; }
.page-lot .header-snap,
.page-why .header-snap { display: none; }

/* AL2: lot + why carry no global header nav — only brand/user as back-out. */
.page-lot .site-header,
.page-lot header,
.page-why .site-header,
.page-why header {
  background: var(--ground);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 1.5rem;
}
.page-lot .site-header nav,
.page-lot header nav,
.page-why .site-header nav,
.page-why header nav {
  display: none !important;
}
.page-lot header nav a,
.page-why header nav a {
  color: var(--ink-mute);
  font-size: 0.85rem;
}
.page-lot header nav a:hover,
.page-why header nav a:hover { color: var(--turquoise-text); }
.why-report {
  margin: 1.5rem 0 0.5rem;
  text-align: left;
}
.page-lot .user-chip,
.page-why .user-chip { color: var(--ink-mute); }
.page-lot .conn-badge,
.page-why .conn-badge {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none !important;
  color: var(--ink-mute) !important;
}
.page-lot .conn-disconnected,
.page-why .conn-disconnected { color: var(--fail) !important; }

.lot {
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
  padding-top: 2.5rem;
}
.lot-hip {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--ink-mute);
}
.lot-hip-quiet { letter-spacing: 0.06em; text-transform: none; }
.lot-name, .lot-identity {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-mute);
  margin: 0 0 var(--space-block);
}
.lot-ceiling { display: block; margin: 0 0 0.75rem; }
.lot-ceiling-figure {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--gold-text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
/* AZ4: n beside the number — separate element, does not restyle the figure */
.lot-n-beside {
  display: block;
  font-family: var(--font-data);
  font-size: var(--fs-caption);
  color: var(--ink-mute);
  margin: 0.45rem 0 0;
  font-variant-numeric: tabular-nums;
}
.lot-ceiling-none {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 500;
  color: var(--gold-text);
}
.lot-ceiling-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  line-height: 1.4;
  color: var(--ink-mute);
  margin: 0.65rem 0 0;
}
.lot-sentence, .lot-bid-line {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  margin: var(--space-block) 0 0;
}
.lot-sentence-mute, .lot-bid-mute { color: var(--ink-mute); }
.lot-support, .lot-comps {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-mute);
  margin: 0.75rem 0 0;
}
.lot-alert {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--fail);
  margin: var(--space-block) auto 0;
  max-width: 24rem;
  font-weight: 500;
}
.lot-rule {
  display: block;
  border: 0;
  border-top: 1px solid var(--rule);
  height: 0;
  margin: var(--space-block) 0;
  padding: 0;
  background: none;
}
.lot-links, .lot-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem 2rem;
  margin: 0;
}
a.lot-link, .lot-link,
a.lot-action, button.lot-action, .lot-action {
  font-family: var(--font-body) !important;
  font-size: var(--fs-body) !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  color: var(--turquoise-text) !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: none !important;
  display: inline !important;
  width: auto !important;
}
a.lot-link:hover, .lot-link:hover,
a.lot-action:hover, button.lot-action:hover, .lot-action:hover {
  color: var(--navy) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.lot-report-status {
  text-align: center;
  font-size: var(--fs-caption);
  color: var(--ink-mute);
  margin: 1.25rem 0 0;
}
.lot-report-status a {
  color: var(--turquoise-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 560px) {
  .lot-ceiling-figure { font-size: clamp(2.75rem, 15vw, 68px); }
  .page-lot main, .page-why main { padding: 2rem 1.15rem 4rem; }
  .lot-links, .lot-actions { gap: 0.75rem 1.25rem; }
  :root { --space-block: 3.5rem; }
}

/* ============================================================
   WHY THIS NUMBER
   ============================================================ */
.why {
  max-width: 36rem;
  margin: 0 auto;
  padding-top: 1rem;
}
.why-back { margin: 0 0 2.5rem; font-size: var(--fs-caption); }
.why-back a { color: var(--turquoise-text); text-decoration: none; }
.why-back a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.why-back-foot { margin: var(--space-block) 0 0; padding-top: 0.5rem; }
.why-header { margin: 0 0 var(--space-block); }
.why-title {
  font-family: var(--font-display);
  font-size: var(--fs-lot);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
  color: var(--navy);
}
.why-lede {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
  max-width: 32rem;
}
.why-figure {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gold-text);
}
.why-section { margin: 0 0 var(--space-block); padding: 0; }
.why-h {
  font-family: var(--font-body);
  font-size: var(--fs-section);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 1.25rem;
}
.why-h3 {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.4;
  color: var(--navy);
  margin: 0 0 0.65rem;
}
.why-idea { margin: 0 0 2rem; }
.why-p {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 1.15rem;
  max-width: 34rem;
}
.why-p:last-child { margin-bottom: 0; }
.why-quiet { color: var(--ink-mute); }
.why-warn { color: var(--fail); font-weight: 500; }
.why-prose {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  max-width: 34rem;
}
.why-prose p { margin: 0 0 1.15rem; }
.why-table-wrap {
  margin-top: 1.5rem;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: 0;
}
.page-why .comp-table { font-size: 0.875rem; color: var(--ink); }
.page-why .comp-table th {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--data-header);
  border-bottom: 1px solid var(--rule);
}
.page-why .comp-table td {
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.45rem;
  color: var(--ink);
}

.catalogue-block {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: 36rem;
}
.cat-cross { margin: 0 0 1rem; font-size: 1.15rem; line-height: 1.45; }
.cat-dam-h {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0.85rem 0 0.25rem;
  padding-left: calc(var(--indent, 0) * 1.25rem);
}
.cat-produce, .cat-line {
  margin: 0.15rem 0;
  padding-left: calc(var(--indent, 1) * 1.25rem);
}
.cat-note {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--ink-mute);
  margin: 0.5rem 0 0;
  font-style: italic;
}
.catalogue-block .num {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

/* —— Cards —— */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(26, 31, 36, 0.04);
}
.banner-high {
  background: var(--fail-bg);
  border: 1px solid var(--fail);
  color: var(--fail);
  padding: 0.85rem 1rem;
  margin: 0.85rem 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.98rem;
  border-radius: 4px;
}
.banner-amber {
  background: transparent;
  border-left: 3px solid var(--navy);
  color: var(--ink-mute);
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.pill {
  display: inline-block;
  background: rgba(20, 48, 125, 0.08);
  color: var(--royal);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
  font-family: var(--font-ui);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.pill.warn { background: var(--fail-bg); color: var(--fail); }
.pill.hyp { background: transparent; color: var(--ink-mute); border: 1px solid var(--rule); }
.pill.flag-db {
  background: var(--fail-bg);
  color: var(--fail);
  border: 1px solid var(--fail);
}
.priority-banner {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  background: var(--ok-soft);
  border-left: 3px solid var(--navy);
  padding: 0.65rem 0.9rem;
  margin: 0 0 1rem;
  color: var(--ink);
}
.physical-panel { border-left: 3px solid var(--navy); }
.show-count-box {
  background: var(--ok-soft);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 0.85rem;
}
.show-count-box .stat-label { color: var(--ink-mute); text-transform: none; }
.show-count-box .stat { color: var(--gold-text); font-size: 2rem; }
.show-count-field {
  background: rgba(200, 157, 44, 0.1) !important;
  border: 1px solid var(--navy);
  border-radius: 4px;
  padding: 0.5rem 0.35rem;
}
.row-field {
  display: flex;
  border-bottom: 1px solid var(--rule);
  padding: 0.45rem 0;
  align-items: flex-start;
  gap: 0.75rem;
}
.row-field.experimental { background: rgba(5, 35, 59, 0.03); padding-left: 0.4rem; }
.row-field .lbl { width: 280px; flex: none; color: var(--ink); }
.row-field .help { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.row-field .w { flex: 1; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.rule-block {
  border-top: 2px solid var(--navy);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.55rem 0 0.25rem;
  margin-top: 0.5rem;
  color: var(--ink-mute);
  text-transform: none;
}
.pill-input { position: relative; display: inline-block; }
.pill-input input { position: absolute; opacity: 0; }
.pill-input span {
  display: inline-block;
  border: 1px solid var(--navy);
  border-radius: 16px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  user-select: none;
  color: var(--turquoise-text);
}
.pill-input input:checked + span {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.db-row { background: rgba(232, 93, 93, 0.08); }
.stat-label { font-size: 0.8rem; color: var(--muted); font-family: var(--font-ui); }
.stat { font-size: 1.8rem; font-weight: 600; font-family: var(--font-ui); color: var(--ink); }
.stat-sm { font-size: 1.05rem; font-family: var(--font-ui); }
.meta { font-size: 0.9rem; color: var(--muted); font-family: var(--font-ui); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink);
}
th {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
}
.override {
  border-left: 3px solid var(--navy);
  padding: 0.4rem 0.75rem;
  margin: 0.25rem 0;
  font-family: var(--font-ui);
  font-size: 0.92rem;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
@media (max-width: 800px) {
  .grid-2, .grid-3, .answer-panels, .home-grid { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-bottom: 0.2rem;
  font-family: var(--font-ui);
}
input, select, textarea {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 1rem;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font);
}
.field { margin-bottom: 0.75rem; }
.default-hint { font-size: 0.78rem; color: var(--ink-mute); }
/* WO-BS-AM: registry-driven field teaching text on /analyze */
.field-help {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.35;
  max-width: 36rem;
}
/* WO-BS-AZ AZ2: small i — hover/focus reveals registry text (same AM3 data) */
.field-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  vertical-align: middle;
  cursor: help;
}
.field-info-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-style: italic;
  font-weight: 600;
  color: var(--ink-mute);
  line-height: 1;
  background: #fff;
}
.field-info:hover .field-info-mark,
.field-info:focus .field-info-mark,
.field-info:focus-within .field-info-mark {
  color: var(--turquoise-text);
  border-color: var(--turquoise-text);
}
.field-info-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
  min-width: 14rem;
  max-width: 22rem;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(20, 40, 50, 0.08);
  font-size: 0.8rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.4;
  color: var(--ink);
  white-space: normal;
}
.field-info:hover .field-info-tip,
.field-info:focus .field-info-tip,
.field-info:focus-within .field-info-tip {
  display: block;
}
/* EV3: on a phone the small "i" must still be a 44×44 hit target; tip opens on focus/tap (tabindex on markup) */
@media (max-width: 720px) {
  .field-info {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    margin-left: 0.15rem;
  }
  .field-info-mark {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 0.95rem;
  }
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.dollar-home { max-width: 40rem; margin: 0 auto 1.5rem; }
.dollar-home-head { margin-bottom: 1.25rem; }
.dollar-home-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
}
.dollar-controls { margin-bottom: 1rem; }
.dollar-form .field-span-2 { grid-column: 1 / -1; }
.price-range-row {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.price-range-row .field-inline { flex: 1 1 8rem; margin-bottom: 0; }
.price-range-sep {
  color: var(--ink-mute);
  padding-bottom: 0.55rem;
}
.sublabel {
  font-size: 0.75rem;
  color: var(--ink-mute);
  display: block;
  margin-bottom: 0.2rem;
}
.dollar-result-on-home {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.page-home-result main { max-width: 40rem; }

/* WO-BS-BS — source selector + promoted parameters (do not restyle lot-ceiling-figure) */
.field-source select { font-weight: 500; }
.source-transition {
  color: var(--navy);
  font-weight: 500;
  margin-top: 0.4rem;
}
.promoted-params {
  margin-bottom: 1rem;
  border-left: 3px solid var(--navy);
}
.promoted-params h2 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
  color: var(--navy);
}
.promoted-source-tag {
  font-family: var(--font-data);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.param-list { display: flex; flex-direction: column; gap: 0.75rem; margin: 0.75rem 0; }
.param-row {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper, #fff);
}
.param-row-price {
  border-color: #c4a35a;
  background: #fbf8f0;
}
.param-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-bottom: 0.35rem;
}
.param-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}
.param-label-text { color: var(--navy); }
.param-badge {
  font-family: var(--font-data);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--rule);
  color: var(--ink-mute);
  white-space: nowrap;
}
.param-badge-confirmed {
  border-color: #2f6b4f;
  color: #2f6b4f;
  background: #eef6f1;
}
.param-badge-price {
  border-color: #a67c2a;
  color: #6b4e12;
  background: #f7edd4;
}
.param-badge-scope {
  border-color: var(--navy);
  color: var(--navy);
}
.param-remove {
  margin-left: auto;
  font-size: 0.78rem;
  padding: 0.15rem 0.5rem;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-mute);
  cursor: pointer;
  border-radius: 3px;
}
.param-remove:hover { color: var(--navy); border-color: var(--navy); }
.param-row-body input[type="text"],
.param-row-body input[type="number"] {
  width: 100%;
  max-width: 100%;
}
.param-row-removed { opacity: 0.4; }
.price-channel-panel,
.add-param-panel {
  margin-top: 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 1px dashed #c4a35a;
  border-radius: 4px;
}
.add-param-panel { border-color: var(--rule); }
.price-channel-panel > summary,
.add-param-panel > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--navy);
  list-style-position: outside;
}
.price-channel-flag {
  font-family: var(--font-data);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b4e12;
}
.price-channel-count {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-left: 0.4rem;
}
.add-param-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.add-param-row input { flex: 1 1 12rem; }
.added-param-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--ink-mute);
}


.methods-hard h2 { letter-spacing: -0.01em; }

/* AM1/AM2: Standard vs Advanced surfaces; prefilled default notes */
.surface-switch {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.95rem;
}
.surface-switch a { font-weight: 500; }
.field-note {
  font-size: 0.78rem;
  margin-top: 0.3rem;
  line-height: 1.35;
  max-width: 36rem;
  color: var(--ink-mute);
}
.field-note-recommendation { color: var(--muted); }
.field-note-arbitrary {
  color: var(--muted);
  font-style: italic;
}
.field-note-input { color: var(--ink-mute); }
.card-quiet { opacity: 0.98; }
.fixed-defaults {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.field-primary input { font-size: 1.15rem; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem 1.25rem;
}

button, .btn, a.btn {
  display: inline-block;
  background: transparent;
  color: var(--turquoise-text) !important;
  border: none;
  padding: 0.35rem 0;
  border-radius: 0;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: var(--font-ui);
  text-decoration: none !important;
  font-weight: 500;
}
button:hover, .btn:hover, a.btn:hover {
  color: var(--navy) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
button.secondary, .btn.secondary, a.btn.secondary, a.secondary {
  background: transparent;
  color: var(--turquoise-text) !important;
}
.btn-primary, a.btn-primary { background: transparent; color: var(--turquoise-text) !important; }
.btn-lg { font-size: 1.05rem; padding: 0.5rem 0; }
button[type="submit"] {
  color: var(--turquoise-text) !important;
  border-bottom: 1px solid var(--turquoise);
  padding: 0.35rem 0.15rem;
}
button[type="submit"]:hover { border-bottom-color: var(--navy); }

.provenance-footer {
  border-top: 1px solid var(--rule);
  margin-top: 2.5rem;
  padding: 0.85rem 1.25rem 1.75rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-align: center;
}
.provenance-line { margin: 0; color: var(--ink-mute); }
.provenance-line a { color: var(--turquoise-text); font-weight: 500; }
.provenance-footer.provenance-fail {
  background: var(--fail-bg);
  border-top: 2px solid var(--fail);
  text-align: left;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.provenance-alert {
  color: var(--fail);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0;
}
.provenance-alert a { color: var(--fail); text-decoration: underline; }
.integrity-ok { border-left: 3px solid var(--navy); }
.row-alarm { background: rgba(232, 93, 93, 0.08); }

.conn-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.conn-connected {
  background: rgba(5, 35, 59, 0.1);
  color: var(--navy);
  border-color: rgba(5, 35, 59, 0.28);
}
.conn-disconnected {
  background: var(--fail-bg);
  color: var(--fail);
  border-color: var(--fail);
}
.conn-reconnecting, .conn-degraded {
  background: rgba(200, 157, 44, 0.12);
  color: var(--ink-mute);
  border-color: rgba(200, 157, 44, 0.35);
}
.conn-unknown {
  background: rgba(5, 35, 59, 0.06);
  color: var(--ink-mute);
  border-color: var(--rule);
}
.conn-banner {
  background: #FFF5F5;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--fail);
}

/* Header is ground — use default (light) conn badge treatment; no dark-chrome overrides. */

.conn-banner[hidden] { display: none !important; }

/* —— Login (WO-BS-BV + WO-BS-BY) — one idea per screen, dollar-result rhythm ——
   Palette unchanged. Deliberate button exception to AL text-link house style:
   login is a single unambiguous action, not a thread of analytical links.
   BY: full-bleed treated 30A photograph behind an opaque ground panel so
   panel text contrast is always the palette WCAG figures, independent of
   which of the seven images is shown. */
.login-page {
  /* Fallback before the chosen photograph arrives — dark mid-tone, not ground,
     so there is no flash of near-white under a delayed image. Layout does not
     depend on the photograph (panel + mark are positioned without it). */
  background-color: #1a2836;
  background-image: var(--login-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  min-height: 100dvh; /* EV2: visible viewport, not under Safari bar */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 3.5rem;
  padding-top: max(2.5rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(3.5rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}
/* BY4: no cross-fade between photographs on this page — each login is a full
   document load of a still. prefers-reduced-motion is therefore a no-op for
   background transitions (there are none). If a fade is added later, it must
   be gated with @media (prefers-reduced-motion: no-preference). */
.login-card {
  /* Opaque --ground panel: text contrast is constant across all seven photos. */
  max-width: min(28rem, 94vw);
  width: 100%;
  margin: 0 auto;
  padding: 2.25rem 1.75rem 2rem;
  background: var(--ground);
  border: none;
  border-radius: 6px;
  box-shadow: 0 14px 42px rgba(5, 35, 59, 0.38), 0 2px 8px rgba(5, 35, 59, 0.18);
  text-align: center;
  position: relative;
  z-index: 1;
}
.login-logo {
  /* BW1: lede removed — single deliberate gap mark → field (was mark→lede→field). */
  text-align: center;
  margin: 0 0 2rem;
}
.login-logo img,
.login-logo .login-mark,
.login-logo .logo-mark {
  /* BY1: double BV1 sizing; still floor + ceiling + viewport scale.
     Before (BV): clamp(180px, 22vw, 300px)
     After  (BY): clamp(360px, 44vw, 600px) */
  width: clamp(360px, 44vw, 600px);
  height: auto;
  max-width: 100%;
  margin: 0 auto;
  display: block;
}
.login-card h1 {
  display: none; /* logo carries the identity */
}
/* WO-BS-BW: .login-lede removed — field label is enough; no replacement copy. */
.login-card form {
  text-align: left;
  max-width: 20rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.login-card label {
  display: block;
  color: var(--ink-mute);
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 0.45rem;
}
.login-card input[name="token"],
.login-card input[type="password"] {
  width: 100%;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  /* EV3: ≥16px on inputs or iOS zooms the page on focus */
  font-size: 16px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: #FFFFFF;
  color: var(--ink);
  text-align: left;
  min-height: 44px;
}
.login-card input[name="token"]:focus,
.login-card input[type="password"]:focus {
  border-color: var(--navy);
  outline: 2px solid rgba(5, 35, 59, 0.2);
  outline-offset: 1px;
}
/* BV3: real button, centred under the field — exception to AL text links. */
.login-card button[type="submit"],
.login-card .login-submit {
  display: block;
  width: 100%;
  max-width: 12rem;
  margin: 1.75rem auto 0;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ground) !important;
  background: var(--navy);
  border: none;
  border-radius: 4px;
  border-bottom: none;
  cursor: pointer;
  text-align: center;
  min-height: 44px; /* EV3 */
}
.login-card button[type="submit"]:hover,
.login-card .login-submit:hover {
  background: var(--royal);
  color: var(--ground) !important;
  border-bottom: none;
}
.login-card button[type="submit"]:disabled,
.login-card .login-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}
.login-card .login-alert,
.login-card .banner-high {
  text-align: center;
  max-width: 20rem;
  margin: 0 auto 1.5rem;
  font-weight: 500;
}
.login-card .horse-loader {
  margin: 1.5rem auto 0;
  padding: 1.25rem 0.5rem;
}
.login-note {
  line-height: 1.55;
  color: var(--ink-mute);
  font-size: 0.85rem;
  margin: 3rem auto 0;
  text-align: center;
  max-width: 20rem;
}

.home-hero { margin-bottom: 1.75rem; }
.home-hero h1 { font-family: var(--font-display); font-weight: 600; color: var(--navy); }
.home-cta { margin-top: 1.25rem; }
.home-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1rem;
}
.home-card h2 { margin-top: 0; color: var(--navy); }
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.recent-list a {
  font-family: var(--font-num);
  font-size: 0.92rem;
  color: var(--turquoise-text);
}

/* SHORTLIST — table sits on light ground (no data-surface special case) */
.page-shortlist main { max-width: 1200px; }
.shortlist-hero { margin-bottom: 1.25rem; }
.shortlist-hero h1 { color: var(--navy); }
.shortlist-hero .shortlist-count {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 600;
  color: var(--gold-text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 0.25rem 0 0.35rem;
}
.shortlist-hero .shortlist-count-label {
  color: var(--ink-mute);
  font-size: var(--fs-caption);
}
.shortlist-table-wrap {
  margin-bottom: 1rem;
  overflow-x: auto;
}
.shortlist-table-wrap h2 {
  color: var(--navy);
  margin-bottom: 0.75rem;
}
.page-shortlist table th {
  color: var(--ink-mute);
  background: var(--data-header);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 1;
}
.page-shortlist table td {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.page-shortlist table tr:hover td { background: rgba(5, 35, 59, 0.04); }
.page-shortlist .db-row { background: #FDE8E8; }
.page-shortlist .warn-row { background: #FFF8EC; }
.page-shortlist code {
  background: rgba(5, 35, 59, 0.06);
  color: var(--ink);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-family: var(--font-data);
  font-size: 0.85em;
}

/* .data-surface retained as no-op alias so old markup degrades cleanly */
.data-surface {
  background: transparent;
  color: var(--ink);
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 1rem;
  overflow-x: auto;
}
.data-surface h2, .data-surface h3 { color: var(--navy); }
.data-surface .muted { color: var(--ink-mute); }
.data-surface a { color: var(--royal); }
.data-surface th {
  color: var(--ink-mute);
  background: var(--data-header);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-surface td {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.data-surface tr:hover td { background: rgba(5, 35, 59, 0.04); }


/* Legacy result panels */
.result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.result-title { margin: 0; }
.result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.report-links { margin: -0.5rem 0 1rem; font-family: var(--font-ui); font-size: 0.9rem; }
.layer { margin-bottom: 1.25rem; }
.layer-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.45rem;
  font-weight: 600;
}
.answer-panels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem;
}
.answer-panel { margin-bottom: 0; min-height: 10rem; }
.answer-panel h2 {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  color: var(--ink-mute);
  font-weight: 600;
}
.panel-num {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(20, 48, 125, 0.08);
  color: var(--royal);
  font-size: 0.8rem;
}
.hero-num {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  margin: 0.15rem 0 0.5rem;
  color: var(--gold-text);
  word-break: break-word;
  font-family: var(--font-display);
}
.hero-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-ui);
  margin-left: 0.25rem;
}
.panel-sub { font-size: 0.92rem; margin: 0.25rem 0; color: var(--ink); }
.caution-line {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ink-mute);
  margin: 0.5rem 0 0;
  font-weight: 500;
}
.answer-panel-cap { border-top: 2px solid var(--navy); }
.explain-prose {
  white-space: pre-wrap;
  font-family: var(--font);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink);
}
.details-card { padding: 0; overflow: hidden; }
.details-summary {
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  color: var(--turquoise-text);
}
.details-summary::-webkit-details-marker { display: none; }
.details-summary::before { content: "▸ "; display: inline-block; }
details[open] > .details-summary::before { content: "▾ "; }
.details-body { padding: 0 1.25rem 1.25rem; border-top: 1px solid var(--rule); }
.interval-note {
  background: var(--ok-soft);
  border-left: 3px solid var(--navy);
  padding: 0.75rem 1rem;
  margin: 0.85rem 0 1.25rem;
  font-size: 0.95rem;
}
.table-scroll {
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
  margin-top: 0.5rem;
}
.comp-table th { position: sticky; top: 0; background: var(--data-header); z-index: 1; }

/* Drivers */
.run-counter {
  background: var(--ok-soft);
  color: var(--ink);
  border: 1px solid var(--rule);
}
.run-counter p { margin: 0.35rem 0; }
.run-counter-lead {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold-text);
}
.run-counter .meta { color: var(--ink-mute); font-size: 0.85rem; }
.run-counter code { color: var(--ink); }
.drivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem 1rem;
}
.drivers-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-mute);
}
.drivers-form select,
.drivers-form input[type="number"],
.drivers-form input[type="text"] {
  font-family: var(--font-ui);
  font-weight: 400;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #FFFFFF;
  color: var(--ink);
}
.danger-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.5rem 0;
  color: var(--fail);
  font-weight: 500;
}
.asof-refused { border-color: var(--fail); background: var(--fail-bg); }
.price-control-note {
  border-left: 3px solid var(--navy);
  padding: 0.5rem 0.85rem;
  background: var(--ok-soft);
  margin-top: 0.75rem;
}
.form-actions { margin-top: 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.chart-card .chart-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #FFFFFF;
}
.chart-svg { display: block; max-width: 100%; height: auto; }

/* Guide */
.guide-toc ol { margin: 0.25rem 0; }
.guide-toc li { margin: 0.2rem 0; }
.guide-section h3 { margin-top: 1.4rem; color: var(--navy); }
.example-block {
  border-top: 1px solid var(--rule);
  padding: 0.85rem 0;
  margin-top: 0.5rem;
}
.conn-demo { background: var(--fail-bg); color: var(--fail); }
pre.muted, .section pre {
  white-space: pre-wrap;
  font-family: var(--font-data);
  background: #FFFFFF;
  border: 1px solid var(--rule);
  padding: 0.75rem;
  border-radius: 4px;
  color: var(--ink-mute);
  font-size: 0.85rem;
}
code {
  font-family: var(--font-data);
  font-size: 0.9em;
  color: var(--ink-mute);
}

/* ============================================================
   LOADING — Muybridge navy silhouette on light ground
   ============================================================ */
.horse-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  text-align: center;
}
.horse-loader.is-visible { display: flex; }
.horse-loader.is-hidden { display: none !important; }
.horse-loader-status {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--ink-mute);
  margin: 0;
  max-width: 28rem;
  line-height: 1.5;
}
.horse-inplace {
  position: relative;
  width: var(--horse-cell-w);
  height: calc(var(--horse-cell-h) + 12px);
}
.horse-inplace .progress-line {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--royal);
  overflow: hidden;
}
.horse-inplace .progress-line::after {
  content: "";
  position: absolute;
  left: -40%; top: 0;
  height: 100%; width: 40%;
  background: var(--navy);
  opacity: 0.55;
  animation: progress-sweep 1.6s ease-in-out infinite;
}
@keyframes progress-sweep {
  0% { left: -40%; }
  100% { left: 100%; }
}
.horse-sprite {
  width: var(--horse-cell-w);
  height: var(--horse-cell-h);
  background-image: url("/static/loading/muybridge_sprite.png");
  background-repeat: no-repeat;
  background-size: calc(var(--horse-cell-w) * 12) var(--horse-cell-h);
  background-position: 0 0;
  animation: horse-gallop var(--horse-cycle) steps(12) infinite;
  margin: 0 auto;
}
@keyframes horse-gallop {
  from { background-position: 0 0; }
  to { background-position: calc(var(--horse-cell-w) * -12) 0; }
}
.horse-oval {
  position: relative;
  width: 220px;
  height: 120px;
  margin: 0 auto;
}
.horse-oval .oval-track {
  position: absolute;
  inset: 8px 4px;
  border: 1px solid var(--royal);
  border-radius: 50%;
  opacity: 0.75;
}
.horse-oval .horse-runner {
  position: absolute;
  width: 72px;
  height: 48px;
  left: 50%;
  top: 50%;
  margin-left: -36px;
  margin-top: -24px;
  offset-path: path("M 110,12 A 98,48 0 1 1 109.9,12");
  offset-rotate: auto;
  animation: horse-orbit 4.5s linear infinite;
}
.horse-oval .horse-runner .horse-sprite {
  width: 72px;
  height: 48px;
  background-size: calc(72px * 12) 48px;
  animation: horse-gallop var(--horse-cycle) steps(12) infinite;
}
@keyframes horse-orbit {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}
@supports not (offset-path: path("M 0 0")) {
  .horse-oval .horse-runner {
    animation: horse-shuttle 3.2s ease-in-out infinite;
    left: 0;
    top: 50%;
    margin-top: -24px;
    margin-left: 0;
  }
  @keyframes horse-shuttle {
    0% { transform: translate(8px, -50%); }
    50% { transform: translate(140px, -50%); }
    100% { transform: translate(8px, -50%); }
  }
}
.loader-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
@media (max-width: 700px) {
  .loader-demo-grid { grid-template-columns: 1fr; }
}
.loader-demo-card {
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.5rem 1rem;
  text-align: center;
}
.loader-demo-card h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-mute);
  margin: 0 0 1.25rem;
}
.loader-demo-card .horse-loader { display: flex; }

@media print {
  header nav, .conn-badge, .signout-form, .signout-btn,
  .user-chip, .conn-banner, button, .btn, .no-print,
  .result-actions, .report-links, .lot-actions, .horse-loader {
    display: none !important;
  }
  body, .page-lot, .page-why, .page-shortlist {
    background: #fff !important;
    color: #000;
  }
  .lot-ceiling-figure, .why-figure, .shortlist-count, .hero-num {
    color: #000 !important;
  }
  a { color: #000 !important; }
}


/* i3 fix: explicit horse dimensions (flex was collapsing height) */
.horse-sprite {
  display: block !important;
  width: 154px !important;
  height: 106px !important;
  min-height: 106px !important;
  flex: 0 0 106px !important;
  background-image: url("/static/loading/muybridge_sprite.png") !important;
  background-repeat: no-repeat !important;
  background-size: 1848px 106px !important;
  animation: horse-gallop 0.9s steps(12) infinite !important;
}
.horse-inplace {
  width: 154px !important;
  min-height: 120px !important;
  height: auto !important;
}
.horse-oval .horse-runner .horse-sprite {
  width: 72px !important;
  height: 48px !important;
  min-height: 48px !important;
  flex: 0 0 48px !important;
  background-size: 864px 48px !important;
}
.horse-gif {
  display: block;
  width: 160px;
  height: auto;
  margin: 0 auto;
  image-rendering: auto;
}


.horse-gif-sm { width: 72px; height: auto; }
.horse-oval {
  position: relative;
  width: 240px;
  height: 130px;
  margin: 0 auto 0.5rem;
}
.horse-oval .oval-track {
  position: absolute;
  left: 10px; right: 10px; top: 18px; bottom: 18px;
  border: 1px solid var(--royal);
  border-radius: 50%;
  opacity: 0.75;
}
.horse-oval .horse-runner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 48px;
  margin: 0;
  /* circular-ish orbit via two nested rotations */
  animation: none;
  offset-path: none;
  transform: translate(-50%, -50%) rotate(0deg) translateX(100px) rotate(0deg);
  animation: horse-orbit-rot 4.5s linear infinite;
}
.horse-oval .horse-runner .horse-gif-sm {
  display: block;
  transform: scaleX(1);
}
@keyframes horse-orbit-rot {
  from { transform: translate(-50%, -50%) rotate(0deg) translateX(100px) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg) translateX(100px) rotate(-360deg); }
}
.horse-inplace {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: auto !important;
  min-height: auto !important;
  position: relative;
  padding-bottom: 1rem;
}
.horse-inplace .progress-line {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 160px;
  height: 1px;
  margin-top: 0.25rem;
}
.horse-inplace .horse-loader-status,
.horse-loader .horse-loader-status {
  order: 3;
}

/* ============================================================
   CATALOGUE PAGE — dense traditional layout (WO-BS-AP)
   Deliberate exception to surface reduction. Laptop width.
   ============================================================ */
.page-catalogue main {
  max-width: 52rem;
  padding: 2rem 1.75rem 4rem;
}
.page-catalogue .provenance-footer { display: none !important; }
.page-catalogue .header-snap { display: none; }

.catalogue {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.5;
  font-size: 1.02rem;
}

.cat-synthetic-banner {
  background: #fde8e8;
  border: 3px solid #8b1e1e;
  color: #8b1e1e;
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
  font-family: var(--font-body);
}
.cat-synthetic-banner strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.cat-synthetic-banner p { margin: 0; font-size: 0.92rem; }

.cat-header-top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
}
.cat-consignor {
  margin: 0;
  font-size: 1.05rem;
  font-style: italic;
}
.cat-barn-hip { text-align: right; }
.cat-barn, .cat-hip {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cat-hip { font-weight: 600; font-size: 1.1rem; margin-top: 0.25rem; }
.cat-barn-missing { color: var(--ink-mute); }

.cat-title-block { margin-top: 1.25rem; text-align: center; }
.cat-horse-name {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}
.cat-horse-unnamed { font-weight: 600; }
.cat-colour-sex {
  margin: 0;
  font-size: 1.05rem;
}
.cat-foaled, .cat-sale-line {
  margin: 0.25rem 0 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink-mute);
}

.cat-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.35rem 0;
}

.cat-section-label,
.cat-dam-h,
.cat-produce-h {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.cat-dam-h {
  margin-top: 1.15rem;
  font-size: 0.78rem;
  color: var(--ink);
}

/* Bracket pedigree */
.cat-bracket {
  border: 1px solid var(--rule);
  padding: 0.75rem 1rem;
  background: #faf9f6;
}
.cat-bracket-subject {
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.cat-bracket-gens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
}
.cat-bracket-col { display: flex; flex-direction: column; gap: 0.45rem; }
.cat-bracket-cell {
  padding: 0.2rem 0;
  border-left: 2px solid var(--rule);
  padding-left: 0.65rem;
}
.cat-sire-line { border-left-color: #3a5a40; }
.cat-dam-line { border-left-color: #6b4c3b; }
.cat-bracket-role {
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.cat-bracket-name {
  font-size: 1.05rem;
}
.cat-yob {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-left: 0.25rem;
}

.cat-byline { margin: 0 0 0.5rem; font-size: 1.1rem; }
.cat-sire-name { font-weight: 600; letter-spacing: 0.02em; }
.cat-sire-race, .cat-sire-earn, .cat-sire-stats {
  margin: 0.25rem 0;
}
.cat-progeny {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
}
.cat-progeny li { margin: 0.2rem 0; }

.cat-dam-line { margin: 0 0 0.35rem; font-size: 1.08rem; }
.cat-dam-race { margin: 0 0 0.5rem; }
.cat-by { font-style: italic; }

.cat-produce-block {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--rule);
  background: rgba(0,0,0,0.015);
}
.cat-produce-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cat-produce-line {
  margin: 0.3rem 0;
  padding-left: 0.25rem;
}
.cat-produce-subject { font-style: italic; }
.cat-year {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  margin-right: 0.4rem;
  color: var(--ink-mute);
}
.cat-sex { margin-right: 0.35rem; font-style: italic; }

/* Gaps — honest missing, never silent omission */
.cat-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  margin: 0.35rem 0;
  padding: 0.35rem 0.55rem;
  background: #f4f1ea;
  border: 1px dashed #b8a88a;
  font-family: var(--font-body);
  font-size: 0.88rem;
}
.cat-gap-label { color: var(--ink-mute); }
.cat-gap-state {
  font-family: var(--font-data);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #6b4c3b;
  font-size: 0.82rem;
}
.cat-gap-note { color: var(--ink-mute); font-size: 0.84rem; }
.cat-gap-inline {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-mute);
  font-style: italic;
}
.cat-gap-produce { border-left: 3px solid #8b1e1e; }

.cat-prov {
  font-family: var(--font-data);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-left: 0.4rem;
  vertical-align: middle;
}
.cat-prov-sale_company { color: #1f4b3a; }
.cat-prov-manual { color: #5a4a1a; }
.cat-prov-derived { color: #2a3a5a; }
.cat-prov-missing { color: #8b1e1e; }
.cat-prov-synthetic_demo { color: #8b1e1e; font-weight: 600; }

.cat-footer { margin-top: 0.5rem; }
.cat-engagements, .cat-foaled-in, .cat-company-code, .cat-published {
  margin: 0.2rem 0;
  font-size: 0.95rem;
}
.cat-source-note {
  margin-top: 1.25rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink-mute);
  font-style: italic;
}
.cat-quiet {
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--ink-mute);
  margin: 0.4rem 0 0;
}

.cat-scoring-attach {
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  background: #f7f6f2;
  font-family: var(--font-body);
  font-size: 0.92rem;
}
.cat-scoring-attach p { margin: 0.4rem 0; }
.cat-attach-spec { font-weight: 600; }
.cat-desk-link { font-weight: 500; }

.cat-nav {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.cat-missing-page {
  font-size: 1.15rem;
  margin: 2rem 0 1rem;
}

@media (max-width: 720px) {
  .page-catalogue main { padding: 1.25rem 1rem 3rem; }
  .cat-header-top { flex-direction: column; }
  .cat-barn-hip { text-align: left; }
  .cat-bracket-gens { grid-template-columns: 1fr; }
}

@media print {
  .page-catalogue, .page-catalogue main {
    max-width: none;
    background: #fff !important;
    color: #000;
  }
  .cat-synthetic-banner { border-width: 2px; }
  .cat-nav, .cat-scoring-attach { display: none !important; }
  .page-catalogue .black-type,
  .page-catalogue .black-type-gsw,
  .page-catalogue .black-type-sw {
    font-weight: 700 !important;
    color: #000 !important;
  }
}

/* ------------------------------------------------------------------ */
/* WO-BS-EJ / WO-BS-EQ — home is a prompt: logo, greeting, ask surface */
/* EQ: viewport-scaled mark + prompt; hero photo; plain ground in chat */
/* ------------------------------------------------------------------ */

/* EQ7 + design judgement: photo only in hero. Conversation = plain ground.
   500px source will soft-upscale ~4× at 1920px — dim + overlay so softness
   is atmosphere, not a fault. Never rely on the photo for text contrast. */
body.page-home-ask.home-hero {
  /* Dark fallback before image arrives — no flash of paper under soft photo */
  background-color: #1a2836;
  background-image:
    /* Vertical wash: darker top for mark, slightly more ground toward form */
    linear-gradient(
      180deg,
      rgba(5, 35, 59, 0.62) 0%,
      rgba(5, 35, 59, 0.48) 42%,
      rgba(244, 243, 238, 0.72) 100%
    ),
    /* Uniform dim so 4× upscale does not read as pixel mush */
    linear-gradient(
      rgba(5, 35, 59, 0.28),
      rgba(5, 35, 59, 0.28)
    ),
    var(--home-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body.page-home-ask.home-conversation {
  /* Legibility beats atmosphere — findings/refusals/figures on plain ground */
  background: #F4F3EE;
  background-image: none;
}
/* Header stays opaque ground so nav never fights the photograph */
body.page-home-ask.home-hero .site-header {
  background: var(--ground);
}
body.page-home-ask.home-hero .provenance-footer {
  background: var(--ground);
}

.page-home-ask main {
  max-width: min(48rem, 94vw);
  margin: 0 auto;
}
.ask-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Tight vertical rhythm so shield + greeting + full prompt sit above the fold */
  padding: clamp(0.25rem, 1.2dvh, 0.75rem) 1rem clamp(0.35rem, 1.4dvh, 0.85rem);
  text-align: center;
  box-sizing: border-box;
}
/* EZ2 — centre mark is the shield alone: no border, panel, card, or cream box */
.ask-home-mark {
  margin-bottom: 0.25rem;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  flex-shrink: 0;
}
/* EZ7 — shield bounded by viewport: min(32dvh, 28vw). Wide monitors cannot inflate it.
   Use dvh, never bare vh. If something must give, the shield gives — prompt is the point. */
.ask-home-logo {
  width: min(32dvh, 28vw);
  height: auto;
  max-width: min(32dvh, 28vw);
  max-height: min(32dvh, 28vw);
  display: block;
  margin: 0 auto;
  background: transparent;
  border: none;
  box-shadow: none;
  /* light drop only on the shield silhouette — not a panel */
  filter: drop-shadow(0 3px 14px rgba(5, 35, 59, 0.28));
}
/* EZ3 + WO-BS-FA — lockup: shield · 30Ai · THOROUGHBREDS (one lockup, not two labels).
   30Ai matches THOROUGHBREDS in size, colour, font, letter-spacing.
   text-transform stays on the wordmark only so "30Ai" is not forced to "30AI". */
.ask-home-product,
.ask-home-wordmark {
  margin: 0.05rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1.65dvh, 0.98rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--navy);
  text-shadow: 0 1px 0 rgba(244, 243, 238, 0.55);
  line-height: 1.15;
}
.ask-home-product {
  margin: 0.25rem 0 0.05rem;
}
.ask-home-wordmark {
  text-transform: uppercase;
}
body.page-home-ask.home-hero .ask-home-product,
body.page-home-ask.home-hero .ask-home-wordmark {
  color: #F4F3EE;
  text-shadow: 0 1px 8px rgba(5, 35, 59, 0.55);
}
/* EZ4 — greeting a little larger; viewport-bounded so the prompt stays above the fold */
.ask-greeting {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, min(4.2dvh, 3.4vw), 2.35rem);
  font-weight: 500;
  color: var(--navy);
  letter-spacing: 0.01em;
  line-height: 1.1;
  flex-shrink: 0;
}
body.page-home-ask.home-hero .ask-greeting {
  color: #F4F3EE;
  text-shadow: 0 1px 10px rgba(5, 35, 59, 0.5);
}
.ask-form {
  width: 100%;
  max-width: min(44rem, 94vw);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
  flex-shrink: 0;
}
/* Prompt is the point of the page — room for a few sentences, not a search field */
.ask-prompt {
  width: 100%;
  min-height: clamp(4.75rem, 10.5dvh, 8.5rem);
  resize: vertical;
  font-family: inherit;
  /* EV3: ≥16px so iOS does not zoom on focus */
  font-size: max(16px, clamp(1.02rem, 1.25vw, 1.15rem));
  line-height: 1.45;
  padding: clamp(0.6rem, 1.1vw, 0.9rem) clamp(0.85rem, 1.5vw, 1.15rem);
  border: 1px solid #c9c4b8;
  border-radius: 4px;
  background: #fff;
  color: #05233B;
  text-align: left;
  box-shadow: 0 4px 18px rgba(5, 35, 59, 0.12);
  box-sizing: border-box;
}
/* Hint is secondary to the fold rule — compact on hero empty state */
body.page-home-ask.home-hero .ask-composer-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
}
/* Keep the two-row principal header from eating the fold on ask home */
body.page-home-ask .site-header {
  padding-top: max(0.55rem, env(safe-area-inset-top, 0px));
  padding-bottom: 0.55rem;
}
.ask-prompt:focus {
  outline: 2px solid #C89D2C;
  outline-offset: 1px;
  border-color: #C89D2C;
}
.ask-composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}
/* EZ6 — New Line control removed from markup; keep inert rule so old caches do not flash blue text links */
.ask-newline {
  display: none !important;
}
.ask-composer-hint {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
}
/* WO-BS-FA — navy fill, gold "Ask" (#C89D2C) on the BASE rule.
   MUST stay outside any @media query. Prior failures put gold only inside
   WO-BS-EV's phone touch-target block (min-height: 48px) so desktop stayed blue.
   Global `button` / `button[type="submit"]` set `color: var(--turquoise-text) !important`
   (royal). Gold needs !important on this later, more-specific selector to win.
   Specificity: button.ask-submit[type="submit"] (0,2,1) + !important beats
   button[type="submit"] (0,1,1) and button:hover (0,1,1). */
button.ask-submit,
button.ask-submit[type="submit"],
.ask-submit {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(8rem, 14vw, 11rem);
  min-height: 44px; /* EV3 */
  padding: 0.65rem 1.6rem;
  font-size: clamp(1.05rem, 1.3vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #05233B !important;
  background-color: #05233B !important;
  color: #C89D2C !important;
  border: none !important;
  border-bottom: none !important;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none !important;
}
button.ask-submit:hover,
button.ask-submit[type="submit"]:hover,
.ask-submit:hover {
  background: #0a3a5c !important;
  background-color: #0a3a5c !important;
  color: #C89D2C !important;
  text-decoration: none !important;
}
button.ask-submit:focus-visible,
button.ask-submit[type="submit"]:focus-visible,
.ask-submit:focus-visible {
  outline: 2px solid #C89D2C;
  outline-offset: 2px;
  color: #C89D2C !important;
}
.ask-plan {
  width: 100%;
  max-width: min(42rem, 92vw);
  margin-top: 2rem;
  text-align: left;
  border-top: 1px solid #d9d4c8;
  padding: 1.25rem 0.35rem 0;
  /* Opaque conversation surface — never over a photograph */
  background: #F4F3EE;
  border-radius: 4px;
}
.ask-plan-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.ask-outcome {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: #05233B;
  color: #F4F3EE;
}
.ask-outcome-answer { background: #1a5c3a; }
.ask-outcome-narrowed { background: #8a6a12; }
.ask-outcome-refused { background: #7a1f1f; }
.ask-answer { margin: 0.5rem 0 1rem; }
.ask-offer { margin: 0.75rem 0; padding: 0.65rem 0.85rem; background: #f0efe8; border-radius: 3px; }
.ask-offer ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.ask-inline-table { margin: 0.75rem 0; overflow-x: auto; }
.ask-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-family: "IBM Plex Mono", monospace;
}
.ask-table th, .ask-table td {
  border: 1px solid #d9d4c8;
  padding: 0.35rem 0.55rem;
  text-align: left;
}
.ask-table th { background: #ece8dc; font-weight: 600; }
.ask-topic-scope { margin-top: 0.75rem; }
.ask-capital {
  font-size: 0.8rem;
  color: #5a5348;
  font-family: "IBM Plex Mono", monospace;
}
.ask-summary { font-size: 1.05rem; margin: 0 0 1rem; }
.ask-block { margin: 1rem 0; }
.ask-block h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a5348;
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.ask-will-not {
  border-left: 3px solid #C89D2C;
  padding-left: 0.85rem;
}
.ask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.ask-actions button {
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid #05233B;
  background: #fff;
  color: #05233B;
  min-height: 44px; /* EV3 */
  min-width: 44px;
}
/* WO-BS-FB — gold "Approve" (#C89D2C) on the BASE rule.
   MUST stay outside any @media query. Same lesson as Ask (WO-BS-FA): colour
   inside the phone touch-target block applies on a phone and never on desktop.
   Cancel and Amend stay as they are — Approve is the affirmative action.
   Specificity: button.ask-approve[type="submit"] (0,2,1) + !important beats
   global button[type="submit"] turquoise. */
button.ask-approve,
button.ask-approve[type="submit"],
.ask-approve {
  background: #05233B !important;
  background-color: #05233B !important;
  color: #C89D2C !important;
  border-color: #05233B !important;
}
button.ask-approve:hover,
button.ask-approve[type="submit"]:hover,
.ask-approve:hover {
  background: #0a3a5c !important;
  background-color: #0a3a5c !important;
  color: #C89D2C !important;
  border-color: #0a3a5c !important;
}
button.ask-approve:focus-visible,
button.ask-approve[type="submit"]:focus-visible,
.ask-approve:focus-visible {
  outline: 2px solid #C89D2C;
  outline-offset: 2px;
  color: #C89D2C !important;
}
.ask-cancel { border-color: #9a9488; color: #5a5348; }
.ask-plan-id { margin-top: 1rem; }
.ask-narrowed p, .ask-refused p { margin: 0.4rem 0; }
.ask-ok {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #e8f0e8;
  border: 1px solid #6a8f6a;
  border-radius: 3px;
}
.ask-error { margin-top: 1rem; width: 100%; max-width: 32rem; text-align: left; }


/* ------------------------------------------------------------------ */
/* WO-BS-ER — private chat history sidebar (pinned + recent)          */
/* WO-BS-FA — viewport centring strategy: EQUAL RESERVED GUTTERS.
   Why: a flex row centres main between the rails, so asymmetric rails
   (one open, one collapsed) drift the hero off the page centre.
   How: always reserve the same gutter on both sides (= open rail width
   when either rail is open; = collapsed strip when both collapsed).
   Phantom spacer columns absorb the asymmetry; rails stay sticky in-flow.
   Hero (shield · 30Ai · THOROUGHBREDS · greeting · prompt) then centres
   on the viewport in all four rail states. */
/* ------------------------------------------------------------------ */
.ask-layout {
  --fa-rail-open: 16.5rem;
  --fa-rail-collapsed: 2.5rem;
  --fa-gutter: var(--fa-rail-open);
  display: block; /* no rails (logged-out): plain flow; hero centres via main max-width */
  width: 100%;
  max-width: none;
  min-height: 50dvh;
  box-sizing: border-box;
}
/* Rails present → equal gutters so the centre track is viewport-centred */
.ask-layout:has(.thread-sidebar),
.ask-layout:has(.reports-sidebar) {
  display: grid;
  grid-template-columns: var(--fa-gutter) minmax(0, 1fr) var(--fa-gutter);
  grid-template-areas: "rail-l main rail-r";
  align-items: start;
  gap: 0;
}
/* Both collapsed → equal narrow gutters */
.ask-layout.sidebar-collapsed.reports-collapsed {
  --fa-gutter: var(--fa-rail-collapsed);
}
/* Backdrop is phone-only; keep it out of the desktop grid tracks */
.ask-layout > .drawer-backdrop {
  grid-column: 1 / -1;
  grid-row: 1;
}
/* Opaque ground panel — readability from the panel, not the photo */
.thread-sidebar {
  grid-area: rail-l;
  justify-self: start;
  width: var(--fa-rail-open);
  max-width: 100%;
  position: sticky;
  top: 0.5rem;
  align-self: flex-start;
  max-height: calc(100dvh - 6rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #F4F3EE;
  background-color: #F4F3EE; /* opaque — never translucent over the photo */
  border: 1px solid #d9d4c8;
  border-right: 1px solid #d9d4c8;
  border-radius: 0 3px 3px 0;
  margin: 0.5rem 0 1rem 0;
  z-index: 2;
  box-shadow: 2px 0 14px rgba(5, 35, 59, 0.1);
  box-sizing: border-box;
}
.thread-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e4dfd2;
}
.thread-sidebar-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.thread-sidebar-toggle {
  border: 1px solid #c9c4b8;
  background: #fff;
  color: var(--navy);
  border-radius: 3px;
  /* EV3: ≥44×44 touch target (was 1.75rem) */
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  line-height: 1;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.thread-sidebar-toggle:hover {
  border-color: #C89D2C;
  color: #C89D2C;
}
.thread-sidebar-body {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 0.35rem 0 0.75rem;
}
.thread-sidebar-empty {
  padding: 0.75rem 0.9rem;
  margin: 0;
  text-align: left;
}
.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.thread-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem 0.55rem 0.45rem;
  border-bottom: 1px solid #eee9dc;
}
.thread-list-item.is-active {
  background: rgba(200, 157, 44, 0.12);
  border-left: 3px solid #C89D2C;
  padding-left: calc(0.55rem - 3px);
}
.thread-list-item.is-pinned .thread-list-title {
  font-weight: 600;
}
.thread-list-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  text-decoration: none;
  color: var(--navy);
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.3;
  /* EV3: full row is tappable */
  min-height: 44px;
  padding: 0.35rem 0.15rem;
}
.thread-list-link:hover .thread-list-title,
.thread-list-link:focus-visible .thread-list-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.thread-list-title {
  flex: 1 1 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.thread-pin-mark {
  font-size: 0.75rem;
  line-height: 1;
}
.thread-list-outcome {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.85;
}
.thread-list-actions {
  display: flex;
  gap: 0.35rem;
  padding-left: 0.1rem;
}
.thread-action-form,
.thread-rename-form,
.thread-delete-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.thread-action-btn {
  font-size: 0.8rem;
  /* EV3: pin / rename / delete ≥ 44×44 */
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.7rem;
  border: 1px solid #c9c4b8;
  background: #fff;
  color: var(--navy);
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.thread-action-btn:hover,
.thread-action-btn:focus-visible {
  border-color: #C89D2C;
}
.thread-delete-btn {
  color: #8a2b2b;
  border-color: #d4a8a8;
}
.thread-delete-confirm {
  font-size: 0.85rem;
  color: #555;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.25rem 0.15rem;
}
.thread-delete-confirm input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  min-height: 1.15rem;
  accent-color: #05233B;
}
/* Collapsed: strip narrow, body hidden — conversation keeps the width */
.ask-layout.sidebar-collapsed .thread-sidebar {
  width: var(--fa-rail-collapsed);
  max-width: var(--fa-rail-collapsed);
}
.ask-layout.sidebar-collapsed .thread-sidebar-body,
.ask-layout.sidebar-collapsed .thread-sidebar-title {
  display: none;
}
.ask-layout.sidebar-collapsed .thread-sidebar-head {
  flex-direction: column;
  padding: 0.4rem 0.25rem;
  border-bottom: none;
}
/* Main sits in the centre grid track — gutters equal ⇒ viewport-centred */
.ask-main {
  grid-area: main;
  width: 100%;
  max-width: min(48rem, 100%);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
  box-sizing: border-box;
}
body.page-home-ask.has-thread-sidebar main,
body.page-home-ask.has-reports-sidebar main,
body.page-home-ask.has-thread-sidebar.has-reports-sidebar main {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
body.page-home-ask.has-thread-sidebar .page-home-ask main,
body.page-home-ask.has-thread-sidebar.page-home-ask main {
  max-width: none;
}
/* WO-BS-FB: title bar removed — keep inert so old caches do not flash chrome */
.thread-open-bar { display: none !important; }
.thread-title-input { display: none !important; }
/* Rename control on the sidebar row */
.thread-rename-details {
  position: relative;
}
.thread-rename-details > summary {
  list-style: none;
  cursor: pointer;
}
.thread-rename-details > summary::-webkit-details-marker { display: none; }
.thread-rename-details[open] .thread-rename-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid #e4dfd2;
  border-radius: 2px;
}
.thread-rename-details:not([open]) .thread-rename-form {
  display: none;
}
.thread-sidebar-rename-input {
  flex: 1 1 8rem;
  min-width: 6rem;
  font: inherit;
  font-size: 16px; /* EV3: no iOS zoom */
  padding: 0.35rem 0.45rem;
  border: 1px solid #c9c4b8;
  border-radius: 2px;
  color: var(--navy);
  min-height: 44px;
  background: #fff;
}
/* Delete at the bottom of the conversation */
.thread-footer-delete {
  width: 100%;
  max-width: min(42rem, 92vw);
  margin: 1.75rem auto 0.5rem;
  padding: 0.85rem 0.75rem;
  border-top: 1px solid #e4dfd2;
  text-align: left;
  /* Opaque ground panel — never thin this to show more photograph */
  background: #F4F3EE;
  background-color: #F4F3EE;
  box-sizing: border-box;
}
.thread-footer-delete .thread-delete-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.thread-turns {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  width: 100%;
  max-width: min(42rem, 92vw);
  text-align: left;
}
.thread-turn {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e4dfd2;
}
.thread-turn-q {
  margin: 0 0 0.35rem;
  color: var(--navy);
  font-size: 0.95rem;
}
.thread-turn-a {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #1a2836;
}
.thread-turn-report {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
}
.thread-turn-report a {
  color: #0a3a5c;
  font-weight: 500;
}
.ask-plan-question {
  margin: 0 0 0.65rem;
}
/* Hero photo: sidebars stay fully opaque so lists stay legible */
body.page-home-ask.home-hero .thread-sidebar,
body.page-home-ask.home-hero .reports-sidebar {
  background: #F4F3EE;
  background-color: #F4F3EE;
  box-shadow: 0 2px 12px rgba(5, 35, 59, 0.12);
}

/* ------------------------------------------------------------------ */
/* WO-BS-EZ / WO-BS-FA — reports rail (right): same hideaway as thread */
/* Opaque ground panel — readability from the panel, not the photo.   */
/* ------------------------------------------------------------------ */
.reports-sidebar {
  grid-area: rail-r;
  justify-self: end;
  width: var(--fa-rail-open);
  max-width: 100%;
  position: sticky;
  top: 0.5rem;
  align-self: flex-start;
  max-height: calc(100dvh - 6rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Opaque ground panel — never a list over a racing photograph */
  background: #F4F3EE;
  background-color: #F4F3EE;
  border: 1px solid #d9d4c8;
  border-radius: 3px 0 0 3px;
  margin: 0.5rem 0 1rem 0;
  z-index: 2;
  box-shadow: -2px 0 14px rgba(5, 35, 59, 0.1);
  box-sizing: border-box;
}
.reports-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e4dfd2;
}
.reports-sidebar-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.reports-sidebar-toggle {
  border: 1px solid #c9c4b8;
  background: #fff;
  color: var(--navy);
  border-radius: 3px;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  line-height: 1;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.reports-sidebar-toggle:hover {
  border-color: #C89D2C;
  color: #C89D2C;
}
.reports-sidebar-body {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 0.35rem 0 0.75rem;
}
.reports-sidebar-empty,
.reports-sidebar-foot {
  padding: 0.75rem 0.9rem;
  margin: 0;
  text-align: left;
}
.report-rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.report-rail-item {
  border-bottom: 1px solid #eee9dc;
}
.report-rail-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--navy);
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.3;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  box-sizing: border-box;
}
.report-rail-link:hover .report-rail-title,
.report-rail-link:focus-visible .report-rail-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.report-rail-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.report-rail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.72rem;
  color: var(--ink-mute);
  font-family: "IBM Plex Mono", monospace;
}
.report-rail-wo {
  letter-spacing: 0.02em;
}
/* WO-BS-FB: collapsible menu on a report row (creator-only delete lives here) */
.report-row-menu {
  margin: 0 0.5rem 0.45rem;
  padding: 0 0.25rem 0.35rem;
}
.report-row-menu-summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--ink-mute);
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d9d4c8;
  border-radius: 2px;
  background: #fff;
  box-sizing: border-box;
}
.report-row-menu-summary::-webkit-details-marker { display: none; }
.report-row-menu[open] .report-row-menu-summary {
  border-color: #C89D2C;
  color: #C89D2C;
}
.report-delete-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.45rem;
  background: #fff;
  border: 1px solid #e4dfd2;
  border-radius: 2px;
}
/* Reports page — plain ground document list (no home-bg photograph) */
body.page-reports {
  background: #F4F3EE;
  background-image: none;
}
body.page-reports .reports-page {
  background: #F4F3EE;
  background-color: #F4F3EE; /* opaque panel — readability from the panel, not a photo */
}
/* Collapsed reports rail: same strip width as thread rail */
.ask-layout.reports-collapsed .reports-sidebar,
.ask-layout.reports-sidebar-collapsed .reports-sidebar {
  width: var(--fa-rail-collapsed);
  max-width: var(--fa-rail-collapsed);
}
.ask-layout.reports-collapsed .reports-sidebar-body,
.ask-layout.reports-collapsed .reports-sidebar-title,
.ask-layout.reports-sidebar-collapsed .reports-sidebar-body,
.ask-layout.reports-sidebar-collapsed .reports-sidebar-title {
  display: none;
}
.ask-layout.reports-collapsed .reports-sidebar-head,
.ask-layout.reports-sidebar-collapsed .reports-sidebar-head {
  flex-direction: column;
  padding: 0.4rem 0.25rem;
  border-bottom: none;
}
.drawer-open-reports-btn {
  /* inherits .drawer-open-btn; shown only in phone drawer mode via JS */
}

/* ------------------------------------------------------------------ */
/* WO-BS-EV — phone: drawer, thumb zone, plain ground, safe areas      */
/* Breakpoint 720px matches prior ER stack; drawer replaces stacked list */
/* ------------------------------------------------------------------ */
@media (max-width: 720px) {
  /* EV6: plain ground on a phone — photo competes with text outdoors */
  body.page-home-ask.home-hero {
    background: #F4F3EE;
    background-image: none;
  }
  body.page-home-ask.home-hero .ask-home-product,
  body.page-home-ask.home-hero .ask-home-wordmark,
  body.page-home-ask.home-hero .ask-greeting {
    color: var(--navy);
    text-shadow: none;
  }

  .site-header,
  header.site-header {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }
  .header-logo {
    height: clamp(44px, 12vw, 64px);
    max-height: clamp(44px, 12vw, 64px);
  }
  header nav a {
    margin-right: 0.55rem;
    font-size: 0.85rem;
  }
  .header-snap { display: none; } /* free header width; title still on /health poll */

  /* EV4: open control visible when JS unhides (has sidebar) */
  .drawer-open-btn:not([hidden]) {
    display: inline-flex;
  }
  .drawer-close-btn {
    display: inline-flex;
  }
  /* Desktop collapse chevrons are drawer-irrelevant on phone */
  .thread-sidebar-toggle,
  .reports-sidebar-toggle {
    display: none;
  }

  /* Phone: abandon equal-gutter grid; drawers are off-canvas */
  .ask-layout {
    display: block;
    grid-template-columns: none;
    grid-template-areas: none;
    position: relative;
    min-height: 0;
    --fa-gutter: 0;
  }
  .ask-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-area: auto;
  }
  .thread-sidebar,
  .reports-sidebar {
    grid-area: auto;
    justify-self: auto;
  }

  /* Off-canvas drawers — chats from the left, reports from the right */
  .thread-sidebar.thread-drawer,
  .thread-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(18.5rem, 86vw);
    max-width: min(18.5rem, 86vw);
    flex-basis: auto;
    max-height: none;
    height: 100dvh;
    margin: 0;
    border-right: 1px solid #d9d4c8;
    border-radius: 0;
    border-bottom: none;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #F4F3EE;
  }
  .ask-layout.drawer-open .thread-sidebar,
  body.drawer-open .thread-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(5, 35, 59, 0.22);
  }
  .ask-layout.sidebar-collapsed .thread-sidebar {
    /* collapse mode is desktop-only; ignore on phone */
    width: min(18.5rem, 86vw);
    max-width: min(18.5rem, 86vw);
    flex-basis: auto;
  }
  .ask-layout.sidebar-collapsed .thread-sidebar-body,
  .ask-layout.sidebar-collapsed .thread-sidebar-title {
    display: block;
  }
  .ask-layout.sidebar-collapsed .thread-sidebar-title {
    display: block;
  }
  .ask-layout.sidebar-collapsed .thread-sidebar-body {
    display: block;
    overflow-y: auto;
  }

  /* Reports rail → right-side drawer on phone */
  .reports-sidebar.reports-drawer,
  .reports-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: min(18.5rem, 86vw);
    max-width: min(18.5rem, 86vw);
    flex-basis: auto;
    max-height: none;
    height: 100dvh;
    margin: 0;
    border-left: 1px solid #d9d4c8;
    border-radius: 0;
    border-bottom: none;
    z-index: 40;
    transform: translateX(105%);
    transition: transform 0.2s ease;
    box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #F4F3EE;
  }
  .ask-layout.reports-drawer-open .reports-sidebar,
  body.reports-drawer-open .reports-sidebar {
    transform: translateX(0);
    box-shadow: -4px 0 24px rgba(5, 35, 59, 0.22);
  }
  .ask-layout.reports-collapsed .reports-sidebar {
    width: min(18.5rem, 86vw);
    max-width: min(18.5rem, 86vw);
    flex-basis: auto;
  }
  .ask-layout.reports-collapsed .reports-sidebar-body,
  .ask-layout.reports-collapsed .reports-sidebar-title {
    display: block;
  }
  .ask-layout.reports-collapsed .reports-sidebar-body {
    display: block;
    overflow-y: auto;
  }

  .drawer-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 35, 59, 0.45);
    z-index: 35;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  body.page-home-ask.has-thread-sidebar main,
  body.page-home-ask.has-reports-sidebar main {
    padding: 0;
  }
  .page-home-ask main {
    max-width: 100%;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  /* Thumb zone: conversation above; composer sticky in lower half */
  .ask-home {
    padding: 1rem 0.5rem 0;
    min-height: calc(100dvh - 8rem);
    display: flex;
    flex-direction: column;
  }
  .ask-home-logo {
    width: min(28dvh, 40vw);
    max-width: min(28dvh, 40vw);
    max-height: min(28dvh, 40vw);
  }
  .ask-greeting {
    font-size: clamp(1.25rem, 5vw, 1.55rem);
    margin-bottom: 0.85rem;
  }
  .ask-form.ask-composer,
  .ask-composer {
    position: sticky;
    bottom: 0;
    bottom: env(safe-area-inset-bottom, 0px);
    margin-top: auto;
    z-index: 10;
    max-width: 100%;
    padding: 0.65rem 0.35rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(244, 243, 238, 0) 0%, #F4F3EE 18%, #F4F3EE 100%);
    box-sizing: border-box;
  }
  .ask-prompt {
    min-height: 5.5rem;
    font-size: 16px;
    max-width: 100%;
  }
  button.ask-submit,
  .ask-submit {
    min-height: 48px;
    min-width: 7.5rem;
    flex: 1 1 auto;
    max-width: 12rem;
    color: #C89D2C !important;
  }
  .ask-composer-actions {
    justify-content: center;
  }
  .ask-plan,
  .thread-turns,
  .thread-footer-delete {
    max-width: 100%;
  }
  .thread-rename-form {
    width: 100%;
    flex-wrap: wrap;
  }
  .thread-sidebar-rename-input {
    width: 100%;
    min-width: 0;
  }
  /* Approve gold reaffirmed on phone touch targets — NOT the sole home of the colour */
  button.ask-approve,
  .ask-approve {
    min-height: 48px;
    color: #C89D2C !important;
  }

  /* Inline tables scroll inside — page itself must not scroll sideways */
  .ask-inline-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .provenance-footer {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  }
}

/* EV7 — reports list: quick-look readable; open as document */
.reports-page {
  max-width: 40rem;
  margin: 0 auto;
}
.reports-page-head {
  margin-bottom: 1.25rem;
}
.report-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.report-list-item {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.report-list-item-failed {
  background: var(--fail-bg);
}
.report-list-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}
.report-wo {
  color: var(--navy);
  font-size: 1rem;
}
.report-quick-look {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
  /* Phone-first: clamp length visually without horizontal scroll */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.report-fail-msg {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-mute);
  overflow-wrap: anywhere;
}
.report-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.report-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #C89D2C;
  background: #05233B;
  border-radius: 3px;
  text-decoration: none;
}
.report-download-btn:hover,
.report-download-btn:focus-visible {
  background: #0a3a5c;
  color: #C89D2C;
  text-decoration: none;
}

@media (max-width: 720px) {
  .reports-page {
    max-width: 100%;
    padding: 0 0.15rem;
  }
  .report-list-item {
    padding: 0.75rem 0.85rem;
  }
  .login-logo img,
  .login-logo .login-mark {
    /* Phone: mark stays large enough to read, not 600px wide */
    width: clamp(180px, 55vw, 320px);
  }
}

/* Prefer reduced motion: no drawer slide */
@media (prefers-reduced-motion: reduce) {
  .thread-sidebar.thread-drawer,
  .thread-sidebar {
    transition: none;
  }
}

/* Standalone home-screen: slightly tighter chrome */
@media (display-mode: standalone) {
  .site-header {
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
  }
}



/* ---- WO-BS-FY: passkey sign-in on the login card ---- */
/* The passkey button sits above the token field, and the "or" makes it plain
   that the token below is still a way in rather than a leftover. */
.login-or {
  margin: 0.75rem 0 0.25rem;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}
.login-recovery-link {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.85rem;
}
.login-recovery-link a { opacity: 0.75; }
#recovery-form { margin-top: 0.75rem; }
#passkey-signin { margin-bottom: 0; }
