/* The `hidden` attribute is only a UA-stylesheet `display: none`, so ANY author
   rule that sets display beats it. `.btn { display: inline-flex }` did exactly
   that, which meant every `button.hidden = true` in this frontend still rendered
   — the hypotheses list's "Load more" button sat under a five-row result set
   offering to page past the end. Made non-negotiable here rather than patched
   per-button, because the next hidden element with a display rule would have the
   same silent failure. */
[hidden] { display: none !important; }

/* ============================================================
   Whalur design tokens
   One type scale, 4/8px spacing rhythm, small cohesive palette.
   ============================================================ */
:root {
  /* Color palette — deep-sea dark with signal-teal accent */
  --color-bg: #0b1220;
  --color-bg-raised: #111a2c;
  --color-bg-inset: #0e1626;
  --color-border: #22304a;
  --color-text: #e6ecf5;
  --color-text-muted: #9fb0c8;
  --color-accent: #35d3b7;
  --color-accent-strong: #6ee8d2;
  --color-accent-ink: #06251f;
  --color-sky: #7fd6f7;
  --color-sky-strong: #a8e5fb;
  --color-sky-ink: #062233;
  --color-warn: #f2b84b;
  --color-danger: #f27d72;

  /* Type scale (1.25 modular) */
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas,
    monospace;
  --text-xs: 0.8rem;
  --text-sm: 0.9rem;
  --text-base: 1rem;
  --text-md: 1.25rem;
  --text-lg: 1.563rem;
  --text-xl: 1.953rem;
  --text-2xl: 2.441rem;
  --text-3xl: 3.052rem;
  --leading-tight: 1.15;
  --leading-normal: 1.6;

  /* Spacing rhythm — 4/8px grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Shape & elevation */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-raised: 0 8px 24px rgba(3, 8, 18, 0.45);
  --shadow-focus: 0 0 0 3px rgba(53, 211, 183, 0.45);

  --container: 1120px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(53, 211, 183, 0.09), transparent 60%),
    url("bg-texture.png") center / 768px 768px repeat,
    var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(var(--text-xl), 5vw, var(--text-3xl)); }
h2 { font-size: clamp(var(--text-lg), 3.5vw, var(--text-2xl)); }
h3 { font-size: var(--text-md); }

p { margin: 0 0 var(--space-4); }

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover { color: var(--color-accent-strong); }

img, svg { max-width: 100%; height: auto; }

:focus-visible {
  /* Phase 8 accessibility pass: the focus ring was a box-shadow only, which
     disappears against raised panels and vanishes entirely in forced-colors
     mode. A real outline is always painted, so keyboard users can see where
     they are on every surface; the shadow stays as the soft halo. */
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* Placeholders inherit a UA grey that fails 4.5:1 on the dark canvas. */
::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

/* The skip link moves focus to <main tabindex="-1">; a full-page focus halo
   there is noise, so keep a thin inset outline instead. */
main:focus-visible {
  outline-offset: -4px;
  box-shadow: none;
}

/* Skip to content — first tabbable element on every public page, visible
   only while focused. */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: 100;
  transform: translateY(-200%);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 600;
}
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--color-accent-ink);
}

.container {
  width: min(var(--container), 100% - var(--space-5) * 2);
  margin-inline: auto;
}

.section {
  padding-block: var(--space-9);
}

.section--tint {
  background: var(--color-bg-inset);
  border-block: 1px solid var(--color-border);
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.lede {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  max-width: 60ch;
}

.muted { color: var(--color-text-muted); }

/* ---------------- Header / nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--color-text); }
.brand svg { flex: none; }
/* Sized by height: the brand lockup is 2.94:1, so a fixed width would
   distort it the moment the artwork changes. width:auto keeps the ratio
   and the width/height attributes in the HTML still reserve the box, so
   there is no layout shift while it loads. */
.brand-logo { flex: none; display: block; height: 44px; width: auto; }

.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.nav-desktop a {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-1);
  transition: color 120ms ease;
}
.nav-desktop a:hover { color: var(--color-text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: none;
}
/* Header labels never break mid-phrase ("Log / out", "Whale / moves"). */
.nav-desktop a,
.header-actions > * { white-space: nowrap; }
@media (max-width: 1180px) {
  .nav-desktop { gap: var(--space-3); }
}

/* Hamburger — right-aligned on mobile */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--color-accent); }

.nav-mobile {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 40;
  background: var(--color-bg-raised);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-raised);
  padding: var(--space-3) 0 var(--space-4);
  /* The menu is taller than a phone screen, so it scrolls on its own
     instead of running off the bottom with the page scrolling behind it. */
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.nav-mobile[data-open="true"] { display: block; }
html.nav-open, html.nav-open body { overflow: hidden; }
.nav-mobile a {
  display: block;              /* full-width tap targets */
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { background: var(--color-bg-inset); color: var(--color-accent); }

/* 1000px, not 820: a member's bar (seven links + name + Admin + Log out)
   needs ~960px, so below that everything moves into the menu. */
@media (max-width: 1000px) {
  .nav-desktop, .header-actions { display: none; }
  .nav-toggle { display: inline-flex; }
  .brand-logo { height: 40px; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.btn--primary:hover { background: var(--color-accent-strong); color: var(--color-accent-ink); }

.btn--ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }

.btn--share {
  background: var(--color-sky);
  color: var(--color-sky-ink);
}
.btn--share:hover { background: var(--color-sky-strong); color: var(--color-sky-ink); }

.btn--sm { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--ghost:disabled:hover { border-color: var(--color-border); color: var(--color-text); }
.btn--block { width: 100%; }

/* ---------------- Not found ---------------- */
/* index.html is the nginx try_files fallback; [data-not-found] is set on <html>
   before first paint when the path is not the home page. */
[data-not-found] main > :not(.not-found) { display: none !important; }
.not-found {
  padding-block: var(--space-9);
  background: var(--color-bg) url("hero.jpg") center / cover no-repeat;
  background-image: image-set(url("hero.webp") type("image/webp"), url("hero.jpg") type("image/jpeg"));
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
.not-found::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.88);
}
.not-found .container { position: relative; max-width: 640px; text-align: left; }
.not-found .lede { margin-bottom: var(--space-6); }
.not-found-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding-block: var(--space-9);
  background: var(--color-bg) url("hero.jpg") center / cover no-repeat;
  background-image: image-set(url("hero.webp") type("image/webp"), url("hero.jpg") type("image/jpeg"));
  border-bottom: 1px solid var(--color-border);
}
/* Legibility scrim: copy sits on the left, artwork stays visible on the right */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(11, 18, 32, 0.92) 0%,
    rgba(11, 18, 32, 0.72) 45%,
    rgba(11, 18, 32, 0.25) 100%
  );
}
.hero .container { position: relative; }
.hero-copy { max-width: 640px; }
.hero-copy .lede { margin-bottom: var(--space-5); font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.6rem); line-height: 1.45; }

.hero-benefits {
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.hero-benefits li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--color-text-muted);
}
.hero-benefits svg { flex: none; margin-top: 3px; color: var(--color-accent); }

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
.hero-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

@media (max-width: 900px) {
  .hero { padding-block: var(--space-8); }
  .hero::before { background: rgba(11, 18, 32, 0.78); }
}

/* ---------------- Cards & grids ---------------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.card h3 { margin-bottom: var(--space-3); }
.card p:last-child { margin-bottom: 0; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(53, 211, 183, 0.12);
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

/* ---------------- Stats ---------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-6);
}
@media (max-width: 700px) { .stats { grid-template-columns: 1fr; } }

.stat {
  text-align: center;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
}
.stat strong {
  display: block;
  font-size: var(--text-xl);
  font-family: var(--font-mono);
  color: var(--color-accent);
  letter-spacing: -0.02em;
}
.stat span { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ---------------- Section illustrations ---------------- */
.section-art {
  margin: var(--space-6) 0 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-inset);
  box-shadow: var(--shadow-raised);
}
.section-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Wide banner between a section's lede and its cards */
.section-art--banner {
  margin: var(--space-2) 0 var(--space-6);
  aspect-ratio: 3 / 1;
}
@media (max-width: 700px) {
  .section-art--banner { aspect-ratio: 16 / 10; }
}

/* ---------------- Steps (how it works) ---------------- */
.steps-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-5);
  align-items: stretch;
}
.steps-layout .section-art { margin: 0; }
@media (max-width: 900px) {
  .steps-layout { grid-template-columns: 1fr; }
  .steps-layout .section-art--tall { aspect-ratio: 16 / 10; }
}

.steps {
  counter-reset: step;
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li {
  counter-increment: step;
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  flex: none;
}
.steps h3 { margin-bottom: var(--space-2); }
.steps p { margin: 0; color: var(--color-text-muted); }

/* ---------------- Quote / guarantee ---------------- */
.quote {
  border-left: 3px solid var(--color-accent);
  margin: 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  font-size: var(--text-md);
  color: var(--color-text);
}
.quote footer {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---------------- FAQ ---------------- */
.faq {
  display: grid;
  gap: var(--space-3);
}
.faq details {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.faq summary {
  cursor: pointer;
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--color-accent);
  transition: transform 150ms ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  padding: 0 var(--space-5) var(--space-4);
  margin: 0;
  color: var(--color-text-muted);
}

/* ---------------- Final CTA ---------------- */
.cta-final {
  text-align: center;
}
.cta-final .lede { margin-inline: auto; }
.cta-final .hero-ctas { justify-content: center; margin-top: var(--space-5); }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: center;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-accent); }

/* ---------------- Auth page ---------------- */
.auth-main {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding-block: var(--space-8);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-raised);
}
.auth-card h1 {
  font-size: var(--text-lg);
  text-align: center;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  margin-bottom: var(--space-5);
}
.auth-tabs button {
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.auth-tabs button[aria-selected="true"] {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

/* Page-level tab bar (notifications.html) — same pill look as .auth-tabs,
   but sized to its content and wrapping on narrow screens. */
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  width: fit-content;
  max-width: 100%;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  margin-bottom: var(--space-5);
}
.page-tabs button {
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.page-tabs button:hover { color: var(--color-text); }
.page-tabs button[aria-selected="true"] {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

/* Every input gets the house look, not just ones inside .field (Brett 10/7:
   "all of our inputs are super skinny" — e.g. the paper-wallet name, the
   referral link, contact's website field rendered at the browser's 21px).
   :where() keeps this at zero specificity, so any input that already has its
   own class or .field styling keeps it. */
:where(
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="color"], [type="file"], [type="image"]),
  select,
  textarea
) {
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
:where(textarea) { min-height: 80px; }
:where(input, select, textarea):focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.field { margin-bottom: var(--space-4); }
.field label,
.field .field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.field textarea { resize: vertical; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.field-hint {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Premium-lock hint (e.g. the trade-data granularity upsell) — warm-toned so
   it reads as a paywall nudge rather than a plain field caption. */
.field-hint--lock { color: var(--color-warn); }
.field-hint--lock a {
  color: var(--color-warn);
  text-decoration: underline;
}

.form-status {
  min-height: 1.5em;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  text-align: center;
  color: var(--color-text-muted);
}
.form-status[data-tone="error"] { color: var(--color-danger); }
.form-status[data-tone="ok"] { color: var(--color-accent); }
/* "It worked, but read this" — a template saved with a delivery caveat, a panel
   with no sender behind it. It was rendering in the muted default, which reads
   as an aside rather than as something to act on. */
.form-status[data-tone="warn"] { color: var(--color-warn); }

.auth-back {
  display: block;
  text-align: center;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

/* ---------------- Hypothesis library ---------------- */
.hyp-page {
  padding-block: var(--space-7) var(--space-9);
}
.hyp-page .lede { margin-bottom: var(--space-6); }

.hyp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.hyp-toolbar--sub { margin-top: calc(-1 * var(--space-3)); align-items: center; }
.hyp-mech-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-accent); border-radius: var(--radius-full);
  font-size: var(--text-sm); color: var(--color-text); text-transform: capitalize;
}
.hyp-mech-chip[hidden] { display: none; }
.hyp-mech-chip button {
  border: 0; background: transparent; color: var(--color-text-muted);
  font-size: 1.1em; line-height: 1; cursor: pointer; padding: 0 2px;
}
a.hyp-badge--mechanism { text-decoration: none; text-transform: capitalize; }
a.hyp-badge--mechanism:hover { outline: 1px solid var(--color-accent); }
.mech-item h3 a { color: inherit; text-decoration: none; text-transform: capitalize; }
.mech-item h3 a:hover { color: var(--color-accent); }
.mech-more { display: inline-block; margin-top: var(--space-3); font-size: var(--text-sm); font-weight: 600; }
.hyp-filter {
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.hyp-filter:hover { border-color: var(--color-accent); color: var(--color-text); }
.hyp-filter[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-ink);
}

.hyp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.hyp-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 10rem;
}
.hyp-control > span {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}
.hyp-control select,
.hyp-control input {
  font-family: inherit;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.hyp-control--search { flex: 1 1 100%; } /* its own full-width row under the selectors (Brett 10/19) */
.hyp-control--search input { width: 100%; }
.hyp-control select:focus-visible,
.hyp-control input:focus-visible {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.hyp-status {
  min-height: 1.5em;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.hyp-status[data-tone="error"] { color: var(--color-danger); }
.hyp-status[data-tone="ok"] { color: var(--color-accent); }
/* A partial result — some of it worked, some of it didn't — is neither, and
   painting it as an error hides the half that landed. */
.hyp-status[data-tone="warn"] { color: var(--color-warn); }

/* "Last monitor scan: …" above the alerts / signals lists. Both feeds open on
   the last 30 days, so an empty list is normal; this line is what tells the
   reader the job ran anyway, and it reads as machine status rather than as
   another sentence of copy. */
.monitor-scan {
  font-family: var(--font-mono, monospace);
  font-size: var(--text-xs, 0.75rem);
  letter-spacing: 0.01em;
  margin: 0 0 var(--space-2);
}

/* On-demand "Run test" panel (hypothesis report page, no completed run yet) */
.report-run-offer,
#report-run-offer { margin-top: var(--space-4); }
.run-offer-text {
  margin: 0 0 var(--space-4);
  max-width: 60ch;
  color: var(--color-text-muted);
  font-size: var(--text-md);
}
.run-offer-status { margin: var(--space-3) 0 0; }
.run-offer-btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
/* Sign-in call to action shown under the status when the run comes back 401. */
.run-offer-prompt { margin-top: var(--space-3); }

/* Per-hypothesis on-demand run panel on the library list + create flow. */
.hyp-run-offer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--color-border);
}
.hyp-run-offer .run-offer-text { font-size: var(--text-sm); }
.run-results { margin-top: var(--space-4); }
.run-results-summary {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.run-results-link { margin-top: var(--space-4); }

/* Post-create "run it now" block on create-hypothesis.html */
.post-create {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.post-create-title { margin: 0 0 var(--space-2); }
.post-create-lede {
  margin: 0 0 var(--space-5);
  max-width: 60ch;
  color: var(--color-text-muted);
}
.post-create-links { margin: var(--space-5) 0 0; }

/* First-run "Get started" checklist on hypotheses.html (signed-in members with
   no hypotheses yet). Same raised-card language as the Whale Watch band. */
.hyp-onboard {
  background: var(--color-bg-raised);
  border: 1px solid rgba(53, 211, 183, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-raised);
}
@media (max-width: 700px) { .hyp-onboard { padding: var(--space-5) var(--space-4); } }
.hyp-onboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.hyp-onboard-head h2 { margin: var(--space-1) 0 0; font-size: var(--text-lg); }
.hyp-onboard-progress {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.hyp-onboard-dismiss {
  flex: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
}
.hyp-onboard-dismiss:hover { color: var(--color-text); border-color: var(--color-accent); }
.hyp-onboard-steps {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.hyp-onboard-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.hyp-onboard-step a { font-weight: 600; }
.hyp-onboard-step p {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.hyp-onboard-tick {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.hyp-onboard-step[data-done="true"] .hyp-onboard-tick {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #0b1a17;
}
.hyp-onboard-step[data-done="true"] a { text-decoration: line-through; color: var(--color-text-muted); }

.hyp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}
.hyp-item {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.hyp-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}
.hyp-item-head h3 { margin: 0; }

.hyp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.hyp-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.hyp-badge[data-status="validated"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.hyp-badge[data-status="testing"] {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}
.hyp-badge[data-status="rejected"] {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
  background: rgba(242, 125, 114, 0.1);
}
/* Retired from the nightly sweep (assets/app.js retiredBadge): muted, dashed. */
.hyp-badge--retired {
  color: var(--color-text-muted);
  border-style: dashed;
  background: transparent;
}
.hyp-badge--retired[data-retired="negative_ev_inverse"] {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
}
.hyp-badge--mechanism {
  color: var(--color-text);
  background: var(--color-bg-inset);
}
/* Dataset/timeframe a hypothesis was backtested against: daily vs intraday. */
.hyp-badge--dataset[data-granularity="daily"] {
  color: var(--color-text-muted);
  border-color: var(--color-border);
  background: var(--color-bg-inset);
}
.hyp-badge--dataset[data-granularity="intraday"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}

.hyp-desc {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
  max-width: 72ch;
}

.hyp-meta {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
}
.hyp-meta li {
  display: grid;
  gap: var(--space-1);
}
.hyp-meta strong {
  font-size: var(--text-base);
  color: var(--color-text);
}
.hyp-meta .hyp-mono {
  font-family: var(--font-mono);
  color: var(--color-accent);
}
.hyp-meta span {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.hyp-more {
  margin-top: var(--space-5);
  text-align: center;
}

.hyp-item-head h3 a {
  color: var(--color-text);
}
.hyp-item-head h3 a:hover { color: var(--color-accent); }

/* ---------------- Variation rankings ---------------- */
.rank-toolbar-sep {
  width: 1px;
  align-self: stretch;
  background: var(--color-border);
  margin-inline: var(--space-2);
}

.rank-table-wrap {
  overflow-x: auto;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.rank-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.rank-table th,
.rank-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-top: 1px solid var(--color-border);
  white-space: nowrap;
}
.rank-table thead th {
  border-top: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-bg-inset);
}
.rank-table .rank-num { text-align: right; }
/* Signed-in vs visitor content on public pages (html.signed-in from assets/app.js). */
.member-only { display: none !important; }
html.signed-in .member-only { display: inline-flex !important; }
html.signed-in .guest-only { display: none !important; }
html.signed-in .site-footer a[href^="auth.html"] { display: none; }
/* Walkthrough 10/6 #5: at 1280px tables ran past their box (Leaderboard's last column,
   the ticker page's Hypothesis column at 806px). Headers may wrap, long names wrap,
   and padding tightens on narrower laptops; the wrap still scrolls if it must. */
.rank-table thead th { white-space: normal; vertical-align: bottom; }
.rank-table td.rank-name { white-space: normal; min-width: 220px; max-width: 460px; }
@media (max-width: 1400px) {
  .rank-table th,
  .rank-table td { padding: var(--space-3) 0.6rem; }
  .rank-table td.rank-name { min-width: 190px; }
}
.rank-table .rank-mono { font-family: var(--font-mono); }
.rank-table tbody tr:hover { background: var(--color-bg-inset); }

.rank-table td[data-sign="pos"] { color: var(--color-accent); }
.rank-table td[data-sign="neg"] { color: var(--color-danger); }

/* Per-run verdict cells (assets/hypothesis-runs.js). Tone, not just colour:
   the verdict is also spelled out in the cell text, so the colour is a second
   channel rather than the only one. */
.rank-table td[data-tone="good"] { color: var(--color-accent); }
.rank-table td[data-tone="bad"] { color: var(--color-danger); }
.rank-table td[data-tone="warn"] { color: var(--color-warn); }
.rank-table td[data-tone="muted"] { color: var(--color-text-muted); font-style: italic; }

.rank-name { white-space: normal; min-width: 220px; }
.rank-name a { color: var(--color-text); font-weight: 600; }
.rank-name a:hover { color: var(--color-accent); }
.rank-name .hyp-badge { margin-left: var(--space-2); }
/* leaderboard.html: how a simulated-broker book fills, under its name. */
.rank-name .rank-fill-note {
  display: block;
  margin-top: var(--space-1);
  white-space: normal;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
/* portfolio.html?id=: the same line above the book card. */
.pt-fill-note { font-size: var(--text-sm); margin: var(--space-2) 0 var(--space-3); }
.pt-aggression-line { font-size: var(--text-sm); margin: var(--space-2) 0 0; color: var(--color-text); }

/* ---------------- Mechanism discovery ---------------- */
.mech-item h3 { text-transform: capitalize; }
.mech-item[data-discovered="false"] .hyp-meta { opacity: 0.55; }

.hyp-badge--discovered {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}

.mech-sectors {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.mech-sectors span {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---- the mechanism charts (mechanisms.html) ----
   Two stacked panels above the cards: pooled EV per trade with 95% whiskers,
   and the hypothesis status mix. Each card then carries its own 26-week EV
   sparkline. All marks wear the page's accent/warn/danger tokens; every label
   is a text token, so the charts stay legible on the deep-sea background. */
.mech-charts {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-5) 0 var(--space-6);
}
.mech-chart {
  margin: 0;
  padding: var(--space-4);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.mech-chart figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.mech-chart-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text);
}
.mech-chart-note { font-size: var(--text-xs); color: var(--color-text-muted); }
.mech-plot-foot,
.mech-plot-empty {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.mech-svg { display: block; width: 100%; height: auto; overflow: visible; }

.mech-row-label {
  fill: var(--color-text);
  font-family: var(--font-sans);
  font-size: 12px;
  text-transform: capitalize;
}
.mech-row-value,
.mech-axis-label {
  fill: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.mech-zero { stroke: var(--color-border); stroke-width: 1; }
.mech-bar[data-sign="pos"] { fill: var(--color-accent); }
.mech-bar[data-sign="neg"] { fill: var(--color-danger); }
.mech-whisker { stroke: var(--color-text-muted); stroke-width: 1.5; }

/* Status colours match the hypothesis badges elsewhere, so a reader who has
   seen the pills recognises the segments without the legend. */
.mech-seg[data-status="validated"] { fill: var(--color-accent); }
.mech-seg[data-status="testing"] { fill: var(--color-warn); }
.mech-seg[data-status="draft"] { fill: #4a5f80; }
.mech-seg[data-status="rejected"] { fill: var(--color-danger); }

.mech-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.mech-legend li { display: flex; align-items: center; gap: var(--space-2); }
.mech-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--color-border);
}
.mech-swatch[data-status="validated"] { background: var(--color-accent); }
.mech-swatch[data-status="testing"] { background: var(--color-warn); }
.mech-swatch[data-status="draft"] { background: #4a5f80; }
.mech-swatch[data-status="rejected"] { background: var(--color-danger); }

/* ---- per-card sparkline ---- */
.mech-spark {
  margin: var(--space-4) 0 0;
  padding: var(--space-3);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.mech-spark-svg { display: block; width: 100%; height: auto; overflow: visible; }
.mech-spark-zero { stroke: var(--color-border); stroke-width: 1; }
.mech-spark-line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.mech-spark-dot { fill: var(--color-accent); }
.mech-spark-last { fill: var(--color-accent-strong); }
.mech-spark-cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---------------- Live signals dashboard ---------------- */
.sig-item h3 {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.hyp-badge[data-status="active"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.hyp-badge[data-status="triggered"] {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}
.hyp-badge--long {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
}
.hyp-badge--short {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
}

.sig-confidence {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.sig-confidence-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.sig-meter {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.sig-meter-fill {
  height: 100%;
  background: var(--color-accent);
}
.sig-confidence-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-accent);
  min-width: 4ch;
  text-align: right;
}
.sig-confidence[data-tier="medium"] .sig-meter-fill { background: var(--color-warn); }
.sig-confidence[data-tier="medium"] .sig-confidence-value { color: var(--color-warn); }
.sig-confidence[data-tier="low"] .sig-meter-fill { background: var(--color-danger); }
.sig-confidence[data-tier="low"] .sig-confidence-value { color: var(--color-danger); }
.sig-confidence[data-tier="none"] .sig-confidence-value {
  color: var(--color-text-muted);
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

.hyp-meta .hyp-mono[data-sign="pos"] { color: var(--color-accent); }
.hyp-meta .hyp-mono[data-band="high"] { color: var(--color-accent); }
.hyp-meta .hyp-mono[data-band="mid"] { color: var(--color-warn); }
.hyp-meta .hyp-mono[data-sign="neg"] { color: var(--color-danger); }

.hyp-meta strong a {
  color: var(--color-text);
  font-weight: 600;
}
.hyp-meta strong a:hover { color: var(--color-accent); }

/* ---------------- Create-hypothesis form ---------------- */
.hyp-new { margin-left: auto; }

.hyp-form {
  max-width: 760px;
  display: grid;
  gap: var(--space-5);
  justify-items: start;
}

.hyp-form-section {
  width: 100%;
  margin: 0;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6) var(--space-6);
}
.hyp-form-section legend {
  font-weight: 700;
  font-size: var(--text-md);
  padding: 0 var(--space-2);
  letter-spacing: -0.01em;
}
.hyp-form-section > .field-hint { margin: 0 0 var(--space-4); }

.hyp-form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.hyp-form-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.hyp-form-rules .field { margin-bottom: 0; }

.cond-list {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.cond-list:empty { margin-bottom: 0; }

.cond-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.cond-row select,
.cond-row input[type="number"] {
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.cond-row select:focus-visible,
.cond-row input:focus-visible {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}
.cond-value { width: 110px; }
.cond-window { width: 130px; }
.cond-operator { font-family: var(--font-mono); }

.cond-buckets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.cond-bucket {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  cursor: pointer;
}
.cond-bucket:has(input:checked) {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.cond-bucket input { accent-color: var(--color-accent); }

.cond-remove {
  margin-left: auto;
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  line-height: 1;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
}
.cond-remove:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.hyp-form-errors {
  width: 100%;
  margin: 0;
  padding: var(--space-4) var(--space-5) var(--space-4) var(--space-6);
  list-style: disc;
  background: rgba(242, 125, 114, 0.08);
  border: 1px solid rgba(242, 125, 114, 0.5);
  border-radius: var(--radius-md);
  color: var(--color-danger);
  font-size: var(--text-sm);
  display: grid;
  gap: var(--space-1);
}

.hyp-form-status { text-align: left; margin-top: 0; }

/* Upgrade panel swapped in when POST /api/hypotheses answers 402. */
.hyp-upgrade-slot:empty { display: none; }
.hyp-upgrade {
  width: 100%;
  padding: var(--space-5);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: rgba(53, 211, 183, 0.08);
  display: grid;
  gap: var(--space-4);
}
.hyp-upgrade-message { margin: 0; font-weight: 600; }
.hyp-upgrade-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}
.hyp-upgrade-plan {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: grid;
  gap: var(--space-1);
}
.hyp-upgrade-plan--suggested { border-color: var(--color-accent); }
.hyp-upgrade-plan-name { font-size: var(--text-lg, 1.125rem); }
.hyp-upgrade-plan-price { font-size: var(--text-sm); opacity: 0.85; }
.hyp-upgrade-plan-blurb { margin: 0; font-size: var(--text-sm); opacity: 0.75; }
.hyp-upgrade-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

@media (max-width: 700px) {
  .hyp-form-pair,
  .hyp-form-rules { grid-template-columns: 1fr; }
  .cond-value,
  .cond-window { flex: 1; }
}

/* ---------------- Hypothesis report ---------------- */
.report-back {
  display: table;
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}
/* back to the page you came from, with the page's own destination beside it (Brett 10/19) */
.report-back--trail { display: inline-block; margin-right: var(--space-4); font-weight: 600; }
.report-back--home { display: inline-block; color: var(--color-text-muted); }

.report-badges {
  margin-bottom: var(--space-4);
}

.report-verdict {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-text-muted);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-5);
}
.report-verdict p {
  margin: var(--space-3) 0 0;
  font-size: var(--text-md);
}
.report-verdict .hyp-badges { margin-top: var(--space-3); }
.report-verdict[data-assessment="positive-ev"] { border-left-color: var(--color-accent); }
.report-verdict[data-assessment="weak-positive-ev"],
.report-verdict[data-assessment="could-be-luck"] { border-left-color: var(--color-warn); }
.report-verdict[data-assessment="negative-ev"] { border-left-color: var(--color-danger); }

.report-verdict-badge { color: var(--color-text); }
.report-verdict[data-assessment="positive-ev"] .report-verdict-badge {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.report-verdict[data-assessment="weak-positive-ev"] .report-verdict-badge,
.report-verdict[data-assessment="could-be-luck"] .report-verdict-badge {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}
.report-verdict[data-assessment="negative-ev"] .report-verdict-badge {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
  background: rgba(242, 125, 114, 0.1);
}

/* Confidence 0-100 chip beside the verdict badge (hypothesis.html) and on
   list cards (hypotheses.html): high / mid / low bands. */
.report-confidence {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 2px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: help;
}
.report-confidence[data-band="high"] { color: var(--color-accent); border-color: rgba(53, 211, 183, 0.5); }
.report-confidence[data-band="mid"] { color: var(--color-warn); border-color: rgba(242, 184, 75, 0.5); }

/* Trade-granularity dataset funnel: a prominent call-out making it obvious a
   small entry count was distilled from a very large scanned dataset. */
.report-funnel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4) var(--space-5);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-5);
}
.report-funnel-step {
  display: grid;
  gap: var(--space-1);
  justify-items: center;
  text-align: center;
}
.report-funnel-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.report-funnel-step:last-child .report-funnel-value { color: var(--color-accent); }
.report-funnel-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.report-funnel-arrow {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  line-height: 1;
}
@media (max-width: 560px) {
  .report-funnel { flex-direction: column; }
  .report-funnel-arrow { transform: rotate(90deg); }
}

.report-run-meta {
  border-top: none;
  border-bottom: 1px solid var(--color-border);
  padding: 0 0 var(--space-5);
  margin: 0 0 var(--space-6);
}
.report-run-meta[hidden] { display: none; }
/* The latest-run strip once it sits under "Last replayed" in Results. */
.report-run-meta--in-results {
  margin: var(--space-2) 0 0;
  padding: 0;
  border-bottom: none;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
@media (max-width: 700px) { .report-stats { grid-template-columns: 1fr; } }

.report-stat {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.report-stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.report-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.report-stat[data-tone="good"] .report-stat-value { color: var(--color-accent); }
.report-stat[data-tone="warn"] .report-stat-value { color: var(--color-warn); }
.report-stat[data-tone="bad"] .report-stat-value { color: var(--color-danger); }
/* Recent edge inside the Results EV box (Brett 10/19) */
.report-stat-recent { display: flex; flex-direction: column; gap: 2px; margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--color-border, rgba(255,255,255,.12)); }
.report-stat-recent-value { font-size: 1.25em; line-height: var(--leading-tight); color: var(--color-text); }
.report-stat-recent[data-tone="good"] .report-stat-recent-value { color: var(--color-accent); }
.report-stat-recent[data-tone="bad"] .report-stat-recent-value { color: var(--color-danger); }
.report-stat-recent[data-lean="up"] .report-stat-recent-value { font-weight: 800; }
/* Recent edge tile when the present beats the overall EV (Brett 10/19, #11283) */
.report-stat[data-highlight="recent"] { box-shadow: inset 0 0 0 2px var(--color-accent); }
.report-stat-detail {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Pooled headline row (four tiles) + the demoted single-run row beneath it. */
.report-stats--pooled { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .report-stats--pooled { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .report-stats--pooled { grid-template-columns: 1fr; } }
/* Found on 2016-2024 vs Confirmed on 2025+ (audit 1005 S2.8), directly above
   the pooled headline row. */
.report-oos { margin-bottom: var(--space-6); }
.report-oos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
@media (max-width: 700px) { .report-oos-grid { grid-template-columns: 1fr; } }
.report-oos-tile {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.report-oos-tile:last-child { border-color: var(--color-accent); }
.report-oos-title { font-size: var(--text-base); margin: 0; }
.report-oos-sub { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0 0 var(--space-3); }
.report-oos-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin: 0; }
.report-oos-metrics dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.report-oos-metrics dd { margin: 0; font-family: var(--font-mono); font-size: var(--text-lg); color: var(--color-text); }
.report-oos-tile[data-tone="good"] .report-oos-metrics dd:first-of-type { color: var(--color-accent); }
.report-oos-tile[data-tone="bad"] .report-oos-metrics dd:first-of-type { color: var(--color-danger); }
.report-oos-verdict { margin: var(--space-3) 0 0; max-width: 80ch; }

.report-stats-heading--noise {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.report-stats-heading {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.report-section {
  margin-bottom: var(--space-6);
}
.report-section h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.report-line {
  margin: 0 0 var(--space-2);
  max-width: 80ch;
}
.report-line--sub {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-left: var(--space-4);
  padding-left: var(--space-4);
  border-left: 2px solid var(--color-border);
}

.report-actions {
  margin-top: var(--space-6);
}

/* ---------------- Signal detail / portfolio intelligence ---------------- */
.rec-action {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-text-muted);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
}
.rec-action p {
  margin: var(--space-3) 0 0;
  font-size: var(--text-md);
  color: var(--color-text-muted);
  max-width: 72ch;
}
.rec-action p:empty { display: none; }

.rec-action-badge { color: var(--color-text); }
.rec-action[data-tone="good"] { border-left-color: var(--color-accent); }
.rec-action[data-tone="good"] .rec-action-badge {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.rec-action[data-tone="warn"] { border-left-color: var(--color-warn); }
.rec-action[data-tone="warn"] .rec-action-badge {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}
.rec-action[data-tone="bad"] { border-left-color: var(--color-danger); }
.rec-action[data-tone="bad"] .rec-action-badge {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
  background: rgba(242, 125, 114, 0.1);
}

.rec-rows {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
.rec-rows .hyp-mono[data-sign="pos"] { color: var(--color-accent); }
.rec-rows .hyp-mono[data-sign="neg"] { color: var(--color-danger); }
.rec-rows .hyp-mono[data-sign="zero"] { color: var(--color-text); }
.report-section .report-line--sub { margin-top: var(--space-3); }

.rec-disclaimer {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- Alerts page ------------------------------------------------------- */

.hyp-badge[data-status="pending"] {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}
.hyp-badge[data-status="delivered"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.hyp-badge[data-status="failed"] {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
  background: rgba(242, 125, 114, 0.1);
}
/* An operator stopped this one on purpose. Muted rather than red: nothing went
   wrong, and it must not read as a failure sitting next to one that did. */
.hyp-badge[data-status="cancelled"] {
  color: var(--color-text-muted);
  background: var(--color-bg-inset);
}
.hyp-badge--priority-high {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
  background: rgba(242, 125, 114, 0.1);
}

.alert-headline {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
}

.alert-toggle {
  margin-top: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.alert-toggle:hover { border-color: var(--color-accent); color: var(--color-text); }
.alert-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}
.alert-toggle[aria-expanded="true"]::after {
  transform: rotate(225deg) translateY(-1px);
}

.alert-detail {
  margin-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.alert-detail .report-section {
  margin-top: var(--space-5);
  padding: 0;
}
.alert-detail .report-section h2 { font-size: var(--text-md); }
.alert-detail .report-line { margin: var(--space-2) 0 0; }
.alert-detail .report-line--indent {
  margin-top: var(--space-1);
  padding-left: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.alert-detail .hyp-status { text-align: left; }
.alert-detail .rec-disclaimer { margin-top: var(--space-5); }

/* --- Trading page ------------------------------------------------------ */

.trading-badges {
  margin-top: var(--space-5);
}

.hyp-badge[data-status="closed"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.hyp-badge[data-status="open"] {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}
.hyp-badge[data-status="not_executed"] {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
  background: rgba(242, 125, 114, 0.1);
}

#execution-line {
  margin-top: var(--space-4);
  max-width: 80ch;
}

#attr-components {
  margin-top: var(--space-4);
}
.attr-components-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

/* ============================================================
   Admin console (admin.html)
   ============================================================ */
.admin-whoami {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-panels {
  margin-top: var(--space-6);
  align-items: start;
}

.admin-field-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.admin-field-row .field {
  flex: 1 1 130px;
  min-width: 130px;
}

.admin-check label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}
/* A checkbox is not a text field — undo .field input's full-width padding box,
   which stretches the control across the row and centres the tick in it. */
.admin-check input {
  accent-color: var(--color-accent);
  flex: none;
  width: auto;
  padding: 0;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.admin-progress { margin-top: var(--space-4); }
.admin-progress-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.admin-progress-fill {
  height: 100%;
  width: 0;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

.admin-log-wrap {
  margin-top: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-raised);
  padding: var(--space-3) var(--space-4);
}
.admin-log-wrap summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.admin-log {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
  font-size: var(--text-sm);
}
.admin-log li {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border);
}
.admin-log li:last-child { border-bottom: none; }
.admin-log li[data-tone="error"] span { color: var(--color-danger); }
.admin-log li[data-tone="warn"] span { color: var(--color-warn); }
.admin-log time {
  flex: none;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

/* Your account — a short credential form reads badly stretched across a wide
   content column, so cap it near the width of the fields themselves. */
.admin-account-card {
  max-width: 460px;
  margin-top: var(--space-5);
}
.admin-account-card h3 { margin-top: 0; }

.admin-review-title { margin-top: var(--space-7); }

.admin-table th { white-space: nowrap; }
/* `.mech-sort` is the same control on the Mechanisms table. It carries its own
   class rather than sharing `.admin-sort` because admin.js binds every
   `.admin-sort` in the document to the hypothesis review table at boot. */
.admin-sort,
.mech-sort {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}
.admin-sort:hover,
.mech-sort:hover { color: var(--color-accent); }
.admin-sort::after,
.mech-sort::after {
  content: "↕";
  margin-left: var(--space-1);
  opacity: 0.4;
}
.admin-sort[data-active="asc"]::after,
.mech-sort[data-active="asc"]::after { content: "↑"; opacity: 1; color: var(--color-accent); }
.admin-sort[data-active="desc"]::after,
.mech-sort[data-active="desc"]::after { content: "↓"; opacity: 1; color: var(--color-accent); }

/* Hypothesis review — per-row status change and delete. Kept on one line so
   the action column stays the width of its controls rather than stretching the
   metric columns, and disabled while a row's PUT/DELETE is in flight. */
.hyp-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}
.hyp-row-status {
  font-family: inherit;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-2);
  color: var(--color-text);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.hyp-row-status:focus-visible {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
  outline: none;
}
.hyp-row-actions select:disabled,
.hyp-row-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hypothesis review — the expanded row that runs the robustness harness and
   the holding-period/cost sweep for one hypothesis. Same treatment as the
   losers detail row: it spans every column rather than fighting them, opts out
   of nowrap, and carries no rule between itself and its own parent row. */
.hyp-detail-row > td {
  white-space: normal;
  background: var(--color-bg-inset);
  border-top: 0;
}
/* Symbol, period and the two run buttons on one line — they are one control,
   and the buttons sit on the inputs' baseline rather than their labels'. */
.hyp-test-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.hyp-test-controls .field { margin-bottom: 0; }
.hyp-test-controls .field input { width: 8rem; text-transform: uppercase; }
.hyp-test-controls .field select { width: auto; }
.hyp-test-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.hyp-test-controls input:disabled,
.hyp-test-controls select:disabled,
.hyp-test-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.hyp-test-status { text-align: left; margin: 0 0 var(--space-3); }
.hyp-test-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-3);
}
.hyp-test-verdict .user-sub { white-space: normal; flex: 1 1 16rem; margin-top: 0; }
.hyp-test-results .au-detail-list { margin-bottom: var(--space-4); }
.hyp-test-table { margin-bottom: var(--space-2); }
.hyp-detail-row .hyp-test-table td.hyp-test-regime-cell {
  white-space: normal;
  min-width: 12rem;
}
.hyp-detail-row .hyp-test-table td.hyp-test-regime-cell .user-sub { white-space: normal; }
/* Which buttons an input feeds, under the input — two of the four tests take
   no symbol at all. Block so it sits below the control rather than beside it,
   and width-capped to the control so it can't stretch the flex row. */
.hyp-test-field-note {
  display: block;
  max-width: 12rem;
  margin-top: var(--space-1);
}
/* A remark about a result — the skipped-symbol roll-call, the caption over a
   table — rather than a number in the facts list. */
.hyp-test-note {
  margin: var(--space-3) 0 var(--space-2);
  white-space: normal;
}
/* The classifier's own words for why it chose the tag it did. */
.hyp-test-rationale {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  white-space: normal;
}
/* The cost column the verdict is actually judged at, and the hypothesis as it
   is defined today — the two rows/columns a reader looks for first. */
.hyp-test-table td[data-reference="true"] { background: rgba(255, 255, 255, 0.04); }
.hyp-test-table tr[data-baseline="true"] td { font-weight: 600; }

/* Movement-day signal inspector */
#mv-form { margin-bottom: var(--space-4); }
.mv-pick {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}
.mv-pick:hover { color: var(--color-accent); }
.mv-row[data-selected="true"] { background: var(--color-bg-inset); }
.mv-row[data-selected="true"] .mv-pick { color: var(--color-accent); }
.mv-trigger { margin-right: var(--space-1); }

.mv-detail { margin-top: var(--space-5); }
.mv-detail h4 { margin: var(--space-5) 0 var(--space-3); }
.mv-detail h4:first-child { margin-top: 0; }
.mv-feature-table { min-width: 0; }
.mv-feature-total th,
.mv-feature-total td { border-top: 2px solid var(--color-border); font-weight: 600; }

.mv-source { margin-bottom: var(--space-4); }
.mv-source h5 {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.mv-signal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mv-signal-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  overflow-wrap: anywhere;
}
.mv-signal-list li:last-child { border-bottom: none; }
.mv-signal-meta {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Collect external signals: the action row and the per-source outcome of a
   run. Five fixed rows, so the source names line up in a column and the eye
   can find the one that failed without reading the sentences. */
.mv-collect-actions { margin-bottom: var(--space-2); }
.mv-collect-results {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
}
.mv-collect-results li {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}
.mv-collect-results li:last-child { border-bottom: none; }
.mv-collect-source {
  flex: none;
  min-width: 5rem;
  font-weight: 600;
}
.mv-collect-outcome {
  flex: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--text-xs);
}
.mv-collect-outcome[data-tone="ok"] { color: var(--color-accent); }
.mv-collect-outcome[data-tone="warn"] { color: var(--color-warn); }
.mv-collect-outcome[data-tone="error"] { color: var(--color-danger); }
.mv-collect-detail {
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* Generate-with-Opus results */
.admin-opus-card { margin-top: var(--space-5); }
.admin-opus-results { margin-top: var(--space-5); }
.admin-opus-results h4 { margin: var(--space-4) 0 var(--space-3); }
.admin-opus-results h4:first-child { margin-top: 0; }
.admin-opus-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-opus-list li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.admin-opus-list li:last-child { border-bottom: none; }
.admin-opus-list .hyp-badge { margin-left: var(--space-2); }
.admin-opus-desc,
.admin-opus-errors {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
}
.admin-opus-desc { color: var(--color-text-muted); }
.admin-opus-list--rejected li { color: var(--color-danger); }
.admin-opus-errors { color: var(--color-danger); }

/* ---------------------------------------------------------------------------
   Admin shell — persistent left panel (>=1024px), off-canvas drawer below it.
   Navigation structure only: the panels inside keep the same cards, tables and
   spacing they had when the portal was one long page under the site header.
   --------------------------------------------------------------------------- */
.admin-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* Everything a not-yet-confirmed admin sees: the gate's status line, on its own,
   while .admin-shell is still hidden. See the head of admin.html. */
.admin-boot {
  padding: var(--space-5) var(--space-4);
}

/* Retry / Sign in again, under the gate's error line. */
.admin-boot__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.admin-boot__actions[hidden] {
  display: none;
}

/* Drawer by default; the media query below turns it into the persistent panel. */
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: min(280px, 84vw);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) 0 var(--space-5);
  /* No scrolling here — the nav in the middle is the scroll region (see
     #admin-nav below) so the brand at the top and the whoami/sign-out at the
     bottom stay put however long the section list gets. */
  overflow: hidden;
  background: var(--color-bg-raised);
  border-right: 1px solid var(--color-border);
  /* visibility, not just transform — a closed drawer must be untabbable. */
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform 160ms ease, visibility 160ms ease;
}
.admin-sidebar[data-open="true"] {
  visibility: visible;
  transform: none;
}

.admin-sidebar-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.admin-drawer-close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
}
.admin-drawer-close:hover { border-color: var(--color-accent); }

.admin-nav {
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-3);
}

/* The scroll region of the sidebar. Addressed by id so these rules win over the
   broad class-level scrollbar block installed in admin.html's <head>, which is
   parsed after this stylesheet.
   min-height:0 so a long section list actually shrinks the nav instead of
   pushing the footer out of the panel; overscroll-behavior:contain so reaching
   the end of the nav doesn't start scrolling the page behind it. */
#admin-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Firefox/standard syntax; the ::-webkit- rules below cover Chrome + Safari.
     Both are needed — neither one covers every browser. */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
#admin-nav::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
#admin-nav::-webkit-scrollbar-track { background: transparent; }
/* The 2px transparent border is the panel showing through: it keeps an 8px hit
   area looking like a 4px hairline. */
#admin-nav::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: var(--radius-full);
}
#admin-nav::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
  background-clip: content-box;
}
#admin-nav::-webkit-scrollbar-button { display: none; }

/* Groups are separated by space, not dividers — a label alone reads as one
   long list with headings in it. */
.admin-nav-group { margin-top: var(--space-3); }

.admin-nav-group-label {
  margin: 0;
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* Whalur green (Brett 10/28) so the headings stand apart from the entries. */
  color: var(--color-accent);
}

/* Flex rather than block so a count badge can sit at the right-hand end of a
   nav entry; with no badge present the single text run lays out identically. */
.admin-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-left: 2px solid transparent;
  transition: color 120ms ease, background 120ms ease;
}
.admin-nav-link:hover {
  color: var(--color-text);
  background: var(--color-bg-inset);
}
.admin-nav-link[aria-current="page"] {
  color: var(--color-accent);
  background: rgba(53, 211, 183, 0.1);
  border-left-color: var(--color-accent);
}
.admin-nav-link--out { color: var(--color-text-muted); }

/* The open-bug count. It is a problem waiting on a human, so it carries the
   danger colour rather than the accent — and it is hidden outright at zero
   (see bgRenderBadge), never rendered as a reassuring "0". */
.admin-nav-badge {
  flex: 0 0 auto;
  min-width: 1.5rem;
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--color-danger);
  color: var(--color-bg);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.5rem;
  text-align: center;
}

.admin-sidebar-foot {
  flex: none;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5) 0;
  border-top: 1px solid var(--color-border);
}
.admin-sidebar-foot .admin-whoami { max-width: 100%; }

.admin-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(3, 8, 18, 0.6);
}

.admin-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.admin-nav-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
}
.admin-nav-toggle:hover { border-color: var(--color-accent); }

.admin-topbar-title {
  font-weight: 600;
  font-size: var(--text-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sweep-in-progress badge: sidebar row on desktop, drawer bar below 1024px. */
.admin-sweep-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 var(--space-5);
  padding: 2px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--color-warn);
  border: 1px solid rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.08);
  border-radius: var(--radius-full);
  text-decoration: none;
  align-self: flex-start;
}
.admin-sweep-badge[hidden] { display: none; }
.admin-sweep-badge:hover { border-color: var(--color-warn); }
.admin-sweep-badge--topbar { margin: 0 0 0 auto; align-self: center; }
.admin-sweep-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: admin-sweep-pulse 1.6s ease-in-out infinite;
}
@keyframes admin-sweep-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .admin-sweep-badge__dot { animation: none; }
}

.admin-main {
  flex: 1 1 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}
.admin-main-inner {
  width: min(var(--container), 100%);
}

.admin-panel-title { font-size: var(--text-xl); }
.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.admin-body .site-footer { margin-top: auto; }

@media (min-width: 1024px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    inset: auto;
    height: 100vh;
    width: 264px;
    flex: none;
    visibility: visible;
    transform: none;
  }
  /* Desktop is the persistent panel: no drawer chrome, no drawer bar. */
  .admin-drawer-close,
  .admin-scrim,
  .admin-topbar { display: none; }
  .admin-main { padding: var(--space-7) var(--space-6) var(--space-8); }
}

/* ---- Overview tiles ---- */
.admin-attention { margin-bottom: var(--space-5); }
.admin-attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.admin-attention-list li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.admin-attention-list li[data-severity="high"] { color: var(--color-danger); }
.admin-attention-list li[data-severity="normal"] { color: var(--color-warn); }
/* Severity carries the colour; the link keeps it and shows itself as a link. */
.admin-attention-list a {
  color: inherit;
  text-decoration: underline;
}

/* ---- Loop status strip (Overview) ----
   Eight steps in dependency order. Colour is the only thing that has to read
   at a glance, so the step carries a left border in its status colour and the
   text stays legible; the detail sentence is a title attribute for the mouse
   and an expanded line under the strip for touch, because a hover-only detail
   is invisible on a phone. */
.admin-loop { margin-bottom: var(--space-5); }
.admin-loop-action {
  margin: var(--space-2) 0 var(--space-3);
  font-weight: 700;
}
.admin-loop-action a { color: inherit; }
.admin-loop-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}
.admin-loop-step { display: block; }
.admin-loop-step button {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-text-muted);
  border-radius: var(--radius-sm);
  background: var(--color-bg-inset);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.admin-loop-step button:hover,
.admin-loop-step button:focus-visible,
.admin-loop-step[data-open="1"] button { border-color: var(--color-accent); }
.admin-loop-step[data-status="ok"] button { border-left-color: var(--color-accent); }
.admin-loop-step[data-status="warn"] button { border-left-color: var(--color-warn); }
.admin-loop-step[data-status="bad"] button { border-left-color: var(--color-danger); }
.admin-loop-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-loop-value {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
}
.admin-loop-step[data-status="warn"] .admin-loop-value { color: var(--color-warn); }
.admin-loop-step[data-status="bad"] .admin-loop-value { color: var(--color-danger); }
.admin-loop-detail {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-3);
  border-left: 3px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Overview count strip: four big numbers above everything else. */
.admin-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
}
.admin-counts[hidden] { display: none; }
.admin-count { margin: 0; padding: var(--space-4); min-width: 0; }
.admin-count dt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.admin-count dd {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.admin-count dd.admin-count-long { font-size: var(--text-lg); }
.admin-count-split {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .admin-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .admin-count { padding: var(--space-3); }
  .admin-count dd.admin-count-long { font-size: 1.25rem; }
}

.admin-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}
.admin-tile { display: block; color: inherit; }
a.admin-tile:hover {
  border-color: var(--color-accent);
  color: inherit;
}
.admin-tile h3 { margin-bottom: var(--space-2); font-size: var(--text-base); }
.admin-tile-value {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.admin-tile-lines {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
/* A named item inside a tile (a completed backlog line). Backlog text runs long
   and a tile is narrow, so clamp to two lines — the full text is on the title. */
.admin-tile-item {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-left: var(--space-3);
  text-indent: calc(-1 * var(--space-2));
}
.admin-tile-when { white-space: nowrap; opacity: 0.75; }
/* A heading inside a tile's line list — the Comms tile groups its numbers under
   Email and SMS. Sits closer to the lines it introduces than to the block above
   it, so the grouping reads without a rule between the two. */
.admin-tile-subhead {
  margin-top: var(--space-2);
  color: var(--color-text);
  font-weight: 600;
}
.admin-tile-lines > .admin-tile-subhead:first-child { margin-top: 0; }
.admin-tile-flag { font-weight: 400; color: var(--color-warn); }

.admin-tile-link {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-accent);
}
.admin-tile-unwired {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-warn);
}
.admin-delta[data-dir="up"] { color: var(--color-accent); }
.admin-delta[data-dir="down"] { color: var(--color-danger); }

/* ---- Overview: recent activity ---- */
.admin-activity { margin-top: var(--space-5); }
.admin-activity h3 { margin-bottom: var(--space-1); }
.admin-activity-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
/* A row is one line on desktop: the label takes the room it needs and the
   relative time stays pinned right, so the column of "2 hours ago" reads as a
   timeline rather than as text scattered mid-sentence. */
.admin-activity-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-border);
}
.admin-activity-item:first-child { border-top: 0; }
.admin-activity-item > a {
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.admin-activity-item > a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}
.admin-activity-when {
  white-space: nowrap;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* On mobile the tiles stack in priority order — never a horizontal scroll. */
@media (max-width: 640px) {
  .admin-tiles { grid-template-columns: 1fr; }
  /* Too narrow for label-and-time on one line; the time drops under the label
     rather than squeezing the label to a few words. */
  .admin-activity-item {
    flex-direction: column;
    gap: var(--space-1);
  }
}

/* ---- Revenue ---- */
.revenue-block { margin-top: var(--space-6); }
.revenue-block > h3 { margin-bottom: var(--space-1); }
.revenue-block .admin-panel-head { margin-bottom: var(--space-1); }
.revenue-block .field-hint { margin-bottom: var(--space-3); }

/* The tier and status breakdowns are 3–4 narrow columns; the rank-table's
   860px floor would force a scrollbar onto tables that already fit. */
.admin-table--compact { min-width: 0; }

.revenue-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-end;
  margin-bottom: var(--space-4);
}
.revenue-toolbar .field {
  margin: 0;
  min-width: 220px;
  flex: 1 1 220px;
}

.revenue-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.revenue-total-row td {
  font-weight: 700;
  border-top-width: 2px;
}
.rank-table tr[data-tone="warn"] td:first-child { color: var(--color-warn); }

/* An inline checkbox sitting in a .revenue-toolbar next to the fields — it has
   no label above it, so it aligns to the bottom of the row like the inputs do. */
.rev-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
}
.rev-check input { width: auto; margin: 0; accent-color: var(--color-accent); cursor: pointer; }

/* Failed-payment recovery: the per-recipient outcome word. Sent is the good
   case, a skip is neutral, a failure has to read as one. */
.rev-outcome { font-weight: 600; }
.rev-outcome[data-tone="ok"] { color: var(--color-accent); }
.rev-outcome[data-tone="warn"] { color: var(--color-warn); }
.rev-outcome[data-tone="error"] { color: var(--color-danger); }
.rev-outcome-detail {
  display: block;
  margin-top: var(--space-1);
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

#revenue-recovery-results { margin-top: var(--space-5); }
#revenue-recovery-results h4 { margin-bottom: var(--space-1); }

/* The result of the last refund, under the billing events table. */
#revenue-refund-result,
#payouts-refund-result { margin-top: var(--space-5); }
#revenue-refund-result h4,
#payouts-refund-result h4 { margin-bottom: var(--space-1); }
#revenue-refund-facts,
#payouts-refund-facts { margin-top: var(--space-2); }
/* The refund's warning sits ABOVE its summary, because it is the line that
   needs a human — a refund that moved money but not the books. */
#payouts-refund-warning { margin: 0 0 var(--space-2); }

/* ---- Payouts ---- */
.payout-check {
  width: 1%;
  white-space: nowrap;
}
.payout-check input { cursor: pointer; }

.payout-handle {
  margin-left: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---- Creators ---- */

/* "May they sell today" is a different question from "is the ACCOUNT active",
   and the two badges sit side by side in the roster — so this one gets its own
   tone rather than borrowing the status colours, which would read as one badge
   contradicting the other. */
.creator-selling[data-selling="yes"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.creator-selling[data-selling="no"] {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}

/* The money columns carry a "paid so far" line under them, and a two-line cell
   needs room for both — without it the sub-line wraps mid-phrase on a laptop. */
#cr-body td.rank-num { min-width: 8rem; }

/* ---- Users ---- */

/* Account status badges. 'active' already reads green from the signals table;
   the rest need their own tone so "suspended" cannot be mistaken for "fine". */
.hyp-badge[data-status="disabled"],
.hyp-badge[data-status="banned"] {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
  background: rgba(242, 125, 114, 0.1);
}
.hyp-badge[data-status="invited"] {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}
.hyp-badge[data-status="deleted"] {
  color: var(--color-text-muted);
  background: var(--color-bg-inset);
}

/* The secondary line under a name or role — email, handle, "this is you". */
.user-sub {
  display: block;
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

.rank-table tr[data-selected="true"] > td {
  background: var(--color-bg-inset);
}

/* Shared by every paged admin list (Users, Alerts, Signals). */
.users-pager,
.alerts-pager,
.signals-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.users-pager .field-hint,
.alerts-pager .field-hint,
.signals-pager .field-hint { margin: 0; }

/* The collapsed "write" form that sits above a list screen — new staff account
   on Users, record an outcome on Outcomes. Collapsed by default so the list
   stays the first thing on the screen: the summary is the affordance, not a
   permanently open form. */
.user-create,
.oc-record { margin-bottom: var(--space-4); }
.user-create > summary,
.oc-record > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text-muted);
}
.user-create > summary:hover,
.oc-record > summary:hover { color: var(--color-text); }
.user-create[open] > summary,
.oc-record[open] > summary { margin-bottom: var(--space-3); }
.user-create .revenue-toolbar,
.oc-record .revenue-toolbar { margin-bottom: var(--space-3); }
.user-create-actions,
.oc-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* The two prices, read back as the return they will be written as. Sits between
   the fields and the button because it is the last thing worth checking before
   ground truth is recorded. */
.oc-rec-preview { margin-bottom: var(--space-3); }
.oc-rec-preview strong { color: var(--color-text); }
/* A field the admin has to fix is marked where the mistake is, not only in the
   status line under the button. */
.oc-record .field[data-invalid="true"] input,
.oc-record .field[data-invalid="true"] select { border-color: var(--color-danger); }

/* Correcting one outcome, inline under the row it corrects — the row is what
   the admin is reading while they type, and a form anywhere else on the screen
   is a form that can be filled in against the wrong trade. Spans every column
   rather than fighting them, and opts out of the table's nowrap. */
.oc-edit-row > td {
  white-space: normal;
  background: var(--color-bg-inset);
  border-top: 0;
}
.oc-edit-form .revenue-toolbar { margin-bottom: var(--space-3); }
.oc-edit-preview { margin-bottom: var(--space-3); }
.oc-edit-preview strong { color: var(--color-text); }
.oc-edit-form .field[data-invalid="true"] input,
.oc-edit-form .field[data-invalid="true"] select { border-color: var(--color-danger); }

.user-detail { margin-top: var(--space-5); }
.user-detail h4 { margin: var(--space-5) 0 var(--space-2); }

.user-facts {
  display: grid;
  grid-template-columns: minmax(140px, max-content) 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}
.user-facts dt {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.user-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The identity fix — name and email on one row, the same shape as the actions
   below it so the card reads as one control surface rather than two. The inputs
   flex wider than an action-row field because an address is long and the whole
   point of this form is that support can see the typo they are correcting. */
.user-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.user-edit .field {
  margin: 0;
  flex: 1 1 220px;
  min-width: 180px;
}
/* The field an admin has to fix is marked where the mistake is, not only in the
   status line under the form. */
.user-edit .field[data-invalid="true"] input { border-color: var(--color-danger); }
/* Outlives the one-line action status above it: a saved email change carries
   what it did to verification and to the outstanding reset links, and a 409
   carries the account already holding the address. */
.user-edit-status {
  max-width: 70ch;
  /* Left, unlike the centred one-liner .form-status is built for: a saved email
     change is several sentences of consequence, and centred prose is read as a
     banner rather than as something to act on. */
  text-align: left;
}
@media (max-width: 640px) {
  .user-edit > * { flex: 1 1 100%; }
}

/* The commission override. Narrower than the identity fields above it — a rate
   is two or three characters, and a box sized for an email address invites the
   admin to read it as one. The fraction the API is actually sent is echoed
   under the field, so the percent/fraction conversion is never silent. */
.user-fee .field {
  flex: 0 1 200px;
  min-width: 150px;
}
.user-fee-preview {
  margin: var(--space-1) 0 0;
  min-height: 1.2em;
}

/* This month's metered counters. Same meter shape as the Backlog screen's
   request allowance — a figure, a bar only where there is a real denominator to
   fill, and the used/limit pair underneath — because they answer the same
   question about two different budgets and should not have to be read twice.
   The Reset button lives inside its own meter: the API is per-feature, so one
   button for the block would have to ask which one, and a wrong guess here
   hands out billable AI builds. */
.user-usage-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4) var(--space-5);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}
.user-usage-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.user-usage-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.user-usage-value {
  font-size: var(--text-base);
  font-weight: 600;
  white-space: nowrap;
}
.user-usage-meter[data-state="unlimited"] .user-usage-value { color: var(--color-accent); }
.user-usage-meter[data-state="over"] .user-usage-value { color: var(--color-warn); }
/* A feature the tier does not include, and a stale counter nothing meters, are
   both "no allowance behind this number" — muted, so neither reads as a budget
   that has been spent. */
.user-usage-meter[data-state="locked"] .user-usage-value,
.user-usage-meter[data-state="stale"] .user-usage-value { color: var(--color-text-muted); }

.user-usage-track {
  display: block;
  height: 6px;
  margin-top: var(--space-2);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.user-usage-fill {
  display: block;
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
}
.user-usage-meter[data-state="over"] .user-usage-fill { background: var(--color-warn); }

.user-usage-sub {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.user-usage-reset { margin-top: var(--space-3); }

/* The actions sit on one row on desktop and wrap to full-width, comfortably
   tappable controls on a phone — these are the buttons that end sessions. */
.user-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.user-actions .field {
  margin: 0;
  min-width: 160px;
}
@media (max-width: 640px) {
  .user-facts { grid-template-columns: 1fr; gap: var(--space-1) 0; }
  .user-facts dd { margin-bottom: var(--space-2); }
  .user-actions > * { flex: 1 1 100%; }
}

/* What the Tier + Subscription pair currently selected would do to this
   member's premium access. It sits under the actions row rather than inside the
   select's own field so a full sentence can be given without stretching the
   control it explains. */
.user-sub-preview {
  margin: var(--space-2) 0 0;
  max-width: 70ch;
}

/* What the last support action returned — a reset's expiry, or the live
   support session and the link that opens it. It outlives the one-line action
   status because an admin reads the expiry back to the member. */
.user-support-result {
  margin: var(--space-3) 0 0;
  max-width: 70ch;
}
.user-support-result[data-tone="ok"] { color: var(--color-accent); }
.user-support-result[data-tone="error"] { color: var(--color-danger); }

/* The per-member activity range control. Borrows the Analytics filter row
   wholesale (same presets, same date inputs, so the two screens' range controls
   are learned once) but tightened: this one sits INSIDE a card rather than above
   a page, so the section rule below it would be a second line beside the card's
   own edge. On a phone the presets wrap instead of scrolling off the card.

   Every selector names .an-filters as well, so these win on specificity rather
   than on position — the Analytics rules they override live further down. */
.an-filters.user-activity-filters {
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: 0;
  border-bottom: 0;
}
.an-filters.user-activity-filters .an-presets { flex-wrap: wrap; }
.an-filters.user-activity-filters .field { min-width: 130px; }

/* Narrow card, four columns: the path and referrer are the two that can run
   long, so they wrap rather than force the table into a horizontal scroll. */
#users-activity-wrap td { overflow-wrap: anywhere; }

/* Impersonation audit — the trail under the accounts list. It is a
   .revenue-block sitting on the panel rather than inside a card, so it inherits
   its spacing and the Analytics filter row needs no tightening here; only the
   two buttons in its header and the wrapping of the emails and the free-text
   reason do. */
.user-imp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.an-filters.user-imp-filters .an-presets { flex-wrap: wrap; }
.an-filters.user-imp-filters .field { min-width: 130px; }
/* A disabled tick still reads as a control that exists — it says the filter is
   waiting for an account to be opened, which is why it is not simply hidden. */
.user-imp-filters .rev-check input:disabled { cursor: not-allowed; }
.user-imp-filters .rev-check:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
/* A session that has not expired yet carries data-tone="warn", which the shared
   .rank-table rule already tints — the row needs nothing of its own here. */
#users-imp-wrap td { overflow-wrap: anywhere; }

/* The support-session bar (assets/app.js). Sits above the sticky header so it
   is the first thing on the page, and is coloured like a warning because that
   is what it is: every click below it lands on somebody else's account. */
.impersonation-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  background: rgba(242, 184, 75, 0.14);
  border-bottom: 1px solid rgba(242, 184, 75, 0.45);
  color: var(--color-warn);
  font-size: var(--text-sm);
  text-align: center;
}
.impersonation-bar[data-ended="true"] {
  background: rgba(242, 125, 114, 0.12);
  border-bottom-color: rgba(242, 125, 114, 0.45);
  color: var(--color-danger);
}
.impersonation-copy { margin: 0; }
.impersonation-bar .btn { flex: none; }

/* Destructive actions read as destructive before they are pressed. */
.btn--danger {
  background: transparent;
  border: 1px solid rgba(242, 125, 114, 0.5);
  color: var(--color-danger);
}
.btn--danger:hover {
  border-color: var(--color-danger);
  background: rgba(242, 125, 114, 0.12);
  color: var(--color-danger);
}
.btn--danger:disabled:hover {
  border-color: rgba(242, 125, 114, 0.5);
  background: transparent;
}

/* Note field, the bulk button, and the running selection total on one line. */
.payout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  margin-bottom: var(--space-4);
}
.payout-actions .field {
  margin: 0;
  min-width: 240px;
  flex: 1 1 240px;
}
.payout-actions .field-hint { margin: 0 0 var(--space-2); }

/* A ledger status is owed money until it isn't — colour it like one. */
.hyp-badge[data-status="accrued"] {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}
.hyp-badge[data-status="paid"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.rank-table td .field-hint {
  display: block;
  margin: var(--space-1) 0 0;
}

/* ---- Signals ---- */

/* A conflict is a judgement about a SET of signals, so it reads as a card with
   its resolution and the signals it implicates, not as a table row. Severity
   is carried by the left rule as well as the badge — the ordering is by
   severity, so the eye should be able to find the high ones without reading. */
.sig-conflicts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.sig-conflict {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
}
.sig-conflict[data-severity="high"] { border-left-color: var(--color-danger); }
.sig-conflict[data-severity="medium"] { border-left-color: var(--color-warn); }
.sig-conflict[data-severity="low"] { border-left-color: var(--color-border); }

.sig-conflict-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
}
.sig-conflict-scope {
  display: inline;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.sig-conflict[data-severity="high"] .sig-conflict-severity {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
  background: rgba(242, 125, 114, 0.1);
}
.sig-conflict[data-severity="medium"] .sig-conflict-severity {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.1);
}

.sig-conflict .muted { margin: var(--space-2) 0 0; }
.sig-conflict-resolution {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
}
.sig-conflict-signals {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 0;
  padding: 0;
  font-size: var(--text-sm);
}
.sig-conflict-signals .user-sub {
  display: inline;
  margin-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* The signal list's Actions column: a Retire button on a live row, and on a row
   this admin has just retired, the reason it was closed with. That reason is a
   sentence, so this is the one cell in the table allowed to wrap — kept on one
   line it would push the metric columns off the side of the scroller. */
#signals-table-wrap td.sg-action-cell { white-space: normal; min-width: 8rem; }
#signals-table-wrap td.sg-action-cell .user-sub { margin-top: 0; }

/* The market monitor's run row: the button and the two override toggles read as
   one control, so they sit on a single centred line. The toggles are .field,
   whose bottom margin would otherwise lift them off the button's baseline. */
#monitor-block .exec-actions .field { margin-bottom: 0; }
#monitor-block .exec-actions .admin-check label { align-items: center; }
#monitor-scan-hint { margin-top: var(--space-2); }
#monitor-block h4 { margin: var(--space-5) 0 var(--space-1); }
#monitor-snapshot-meta { margin-bottom: var(--space-3); }

/* ---- Execution (admin → Signals) ---- */

/* Armed vs dormant is the first thing this screen has to answer, so it is a
   banner rather than a line of prose. Dormant is the DEFAULT and correct
   state — it reads as neutral information, not as a fault; armed is the one
   that gets the warning colour, because that is the state where the platform
   moves money on its own. */
.exec-gate {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
  font-size: var(--text-sm);
}
.exec-gate[data-state="armed"] {
  border-left-color: var(--color-warn);
  color: var(--color-warn);
}

.exec-limits {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.exec-limits strong { color: var(--color-text); }

.exec-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}
.exec-actions .field-hint { margin: 0; flex: 1 1 24rem; }

/* ---- Controller settings (the arming switch + the risk limits) ---- */

/* The gate reuses the backlog auto-runner's switch card — same shape, same
   affordance, and for the same reason: it is a single consequential on/off that
   has to read its state back from the server rather than from the click. */
.exec-arm { margin-bottom: var(--space-5); }
.exec-arm .bk-runner-title { font-size: var(--text-base); }
/* Inverted from the backlog runner's rule, and deliberately: there, OFF is the
   state worth flagging; here it is ARMED — the one where the platform commits
   capital with nobody watching. */
.exec-arm[data-state="armed"] { border-left-color: var(--color-warn); }

/* ---- Alert settings (the two pause switches + the alert knobs) ---- */

/* Same switch card as the execution gate, flagged the other way round: for the
   alert jobs it is PAUSED that is worth noticing — alerts stop reaching people
   quietly, and nothing else on the screen says so. */
.alert-toggle-card { margin-bottom: var(--space-5); }
.alert-toggle-card .bk-runner-title { font-size: var(--text-base); }
.alert-toggle-card[data-state="paused"] { border-left-color: var(--color-warn); }

.exec-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.exec-settings-grid .field { margin-bottom: 0; }

.exec-setting-source {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
}
.exec-setting-source strong { color: var(--color-text); }

/* Inherit is a real state, not an empty box: it says "no stored override, the
   environment is in charge of this one". Ticking it clears the override. */
.exec-inherit {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
}
.exec-inherit input { width: auto; margin: 0; }

.exec-setting[data-invalid="true"] input { border-color: var(--color-danger); }
.exec-setting-error {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  color: var(--color-danger);
}

/* A form's own status belongs with the fields, not centred under them. */
#exec-settings-status,
#exec-settings-meta { text-align: left; }

.exec-settings-errors {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(242, 125, 114, 0.5);
  border-radius: var(--radius-md);
  background: rgba(242, 125, 114, 0.1);
  color: var(--color-danger);
  font-size: var(--text-sm);
  display: grid;
  gap: var(--space-1);
}

.exec-halted {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(242, 125, 114, 0.5);
  border-radius: var(--radius-md);
  background: rgba(242, 125, 114, 0.1);
  color: var(--color-danger);
  font-size: var(--text-sm);
}

/* Skips and errors are a decision each — the signal they were about, then the
   control that stopped it. A table would waste half its width on two short
   columns, so they read as lines. */
.exec-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  font-size: var(--text-sm);
}
.exec-list li {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.exec-list li:last-child { border-bottom: none; }
.exec-list-scope {
  flex: 0 0 auto;
  min-width: 9rem;
  font-size: var(--text-xs);
}
.exec-list-reason {
  flex: 1 1 20rem;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.exec-list--error .exec-list-reason { color: var(--color-danger); }

/* The paper order book's Actions column: a Cancel button on an order that can
   still fill, and on every other row the short sentence saying why it cannot be
   cancelled. `.rank-table td` sets white-space: nowrap, so that sentence is let
   to wrap here — held on one line it would push the metric columns off the
   side of the scroller. */
#exec-orders-wrap td.ex-order-action-cell { white-space: normal; min-width: 8rem; }
#exec-orders-wrap td.ex-order-action-cell .user-sub { margin-top: 0; }
#exec-orders-action-status { text-align: left; }

/* ---- Learning loop (admin → Signals) ---- */

/* The run row reads as one control — the button and its surfacing override on a
   single centred line — the same shape the market monitor's scan row uses.
   .field's bottom margin would otherwise lift the toggle off the baseline. */
#learn-loop-block .exec-actions .field { margin-bottom: 0; }
#learn-loop-block .exec-actions .admin-check label { align-items: center; }
#learn-run-hint { margin-top: var(--space-2); }
#panel-learning h4 { margin: var(--space-5) 0 var(--space-1); }
/* The surfacing lists sit directly under their own hint, so they lose the
   list's leading gap and keep the trailing one. */
#learn-surfaced, #learn-rejected { margin-top: var(--space-2); }

/* ---- Alert generator (admin → Alerts) ---- */

/* The generate row reads as one control — the button and its optional
   confidence floor on a single centred line — the same shape the monitor's scan
   row uses. The floor is one short number, so its input is sized to what it
   holds instead of stretching across the row, and .field's bottom margin would
   otherwise lift it off the button's baseline. */
#alert-gen-block .exec-actions .field { margin-bottom: 0; }
#alert-gen-block .exec-actions .field label { margin-bottom: var(--space-1); }
#alert-gen-block .exec-actions .field input { width: 10rem; }
#alert-gen-run-hint { margin-top: var(--space-2); }
#alert-gen-block h4 { margin: var(--space-5) 0 var(--space-1); }
#alert-gen-snapshot-meta { margin-bottom: var(--space-3); }
/* The skip and error lists sit directly under their own hint line, so they lose
   the list's leading gap and keep the trailing one. */
#alert-gen-skips, #alert-gen-errors { margin-top: var(--space-2); }

/* ---------------------------------------------------------------------------
   Trade-timeline chart (hypothesis.html, rendered by timeline-chart.js)
   --------------------------------------------------------------------------- */
.report-timeline .timeline-caption {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.timeline-empty,
.timeline-loading {
  color: var(--color-text-muted);
}

/* Summary strip above the feed. */
.tl-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-5);
}
.tl-summary-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 88px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
}
.tl-summary-value {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text);
}
.tl-summary-value.is-win { color: var(--color-accent); }
.tl-summary-value.is-loss { color: var(--color-danger); }
.tl-summary-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* The vertical event feed. */
.tl-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tl-event {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: var(--space-3);
  align-items: stretch;
  /* Scroll-reveal start state; .is-visible is added as it enters the viewport. */
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.tl-event.is-visible {
  opacity: 1;
  transform: none;
}

/* Rail column: a continuous vertical line with a node dot per event. */
.tl-rail {
  position: relative;
  display: flex;
  justify-content: center;
}
.tl-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--color-border);
}
/* First event: rail starts at the node; last event: rail stops at the node. */
.tl-event:first-child .tl-rail::before { top: 18px; }
.tl-event:last-child .tl-rail::before { bottom: calc(100% - 18px); }

.tl-node {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  width: 24px;
  height: 24px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: var(--color-bg);
}
.tl-node-glyph {
  font-size: 11px;
  line-height: 1;
}
.tl-event.is-entry .tl-node {
  border-color: var(--color-text-muted);
}
.tl-event.is-entry .tl-node-glyph { color: var(--color-text-muted); }
.tl-event.is-win .tl-node {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(53, 211, 183, 0.15);
}
.tl-event.is-win .tl-node-glyph { color: var(--color-accent); }
.tl-event.is-loss .tl-node {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(242, 125, 114, 0.15);
}
.tl-event.is-loss .tl-node-glyph { color: var(--color-danger); }

/* Event card. */
.tl-card {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: var(--color-bg-raised);
}
.tl-event.is-entry .tl-card { border-left-color: var(--color-text-muted); }
.tl-event.is-win .tl-card { border-left-color: var(--color-accent); }
.tl-event.is-loss .tl-card { border-left-color: var(--color-danger); }

.tl-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.tl-card-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.tl-trade-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.tl-event-kind {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.tl-return {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-sm);
}
.tl-return.is-win { color: var(--color-accent); }
.tl-return.is-loss { color: var(--color-danger); }

.tl-when {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.tl-dot-sep { color: var(--color-text-muted); }
.tl-price { color: var(--color-text-muted); }

.tl-detail {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

@media (max-width: 700px) {
  .tl-event { grid-template-columns: 28px 1fr; gap: var(--space-2); }
  .tl-summary-stat { flex: 1 1 40%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ============================================================
   Trade views — "Every trade" diverging chart + the view toggle
   (assets/timeline-chart.js). The event-timeline view reuses the
   .tl-* rules above; everything here is the chart view and the
   switcher that sits over both.
   ============================================================ */

.tc-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.tc-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}

.tc-toggle-btn {
  padding: var(--space-2) var(--space-4);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tc-toggle-btn:hover { color: var(--color-text); }

.tc-toggle-btn.is-active {
  color: var(--color-accent-ink);
  background: var(--color-accent);
  font-weight: 600;
}

.tc-toggle-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ---- the chart ---- */

.tc-chart {
  margin-top: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
  overflow: hidden;
}

.tc-head,
.tc-row {
  display: grid;
  grid-template-columns: 108px 1fr 72px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
}

.tc-head {
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tc-head-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tc-head-zero { opacity: 0.7; }

.tc-row + .tc-row { border-top: 1px solid rgba(34, 48, 74, 0.5); }
.tc-row:hover { background: rgba(53, 211, 183, 0.04); }

.tc-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* The track is the full-width plotting area; the centre line is 0%. */
.tc-track {
  position: relative;
  height: 22px;
}

.tc-axis {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}

/* Bars are absolutely positioned from the centre: a winner's left edge sits on
   the axis and grows right, a loser's right edge sits on the axis and grows
   left. JS sets the width and which edge is pinned. */
.tc-bar {
  position: absolute;
  top: 4px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.tc-bar:hover { filter: brightness(1.25); transform: scaleY(1.15); }
.tc-bar:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.tc-row.is-win .tc-bar { background: var(--color-accent); }
.tc-row.is-loss .tc-bar { background: var(--color-danger); }
.tc-row.is-open .tc-bar { background: var(--color-text-muted); }

.tc-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-align: right;
  white-space: nowrap;
}

.tc-row.is-win .tc-value { color: var(--color-accent); }
.tc-row.is-loss .tc-value { color: var(--color-danger); }
.tc-row.is-open .tc-value { color: var(--color-text-muted); }

/* ---- single-trade popup ---- */

.tc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(3, 8, 18, 0.72);
}

.tc-popup {
  width: min(420px, 100%);
  padding: var(--space-5);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-text-muted);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
}

.tc-popup.is-win { border-left-color: var(--color-accent); }
.tc-popup.is-loss { border-left-color: var(--color-danger); }

.tc-popup-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.tc-popup-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  font-size: var(--text-md);
  line-height: 1;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.tc-popup-close:hover { color: var(--color-text); border-color: var(--color-text-muted); }
.tc-popup-close:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.tc-popup-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.tc-popup-row + .tc-popup-row { border-top: 1px solid rgba(34, 48, 74, 0.5); }
.tc-popup-label { color: var(--color-text-muted); }
.tc-popup-value { text-align: right; }

@media (max-width: 640px) {
  .tc-head,
  .tc-row { grid-template-columns: 76px 1fr 60px; gap: var(--space-2); padding: var(--space-2); }
  .tc-head-loss,
  .tc-head-win { font-size: 0.7rem; }
}

/* ---- auth extras: terms checkbox + forgot-password link ---- */

.field--check label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  cursor: pointer;
}

.field--check input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.field--check a { color: var(--color-accent); }

.auth-forgot {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  text-align: center;
}

.auth-forgot a { color: var(--color-text-muted); }
.auth-forgot a:hover { color: var(--color-accent); }

/* ============================================================
   Account / profile / strategy list surfaces
   ============================================================ */

.acct-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.acct-tabs a {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}

.acct-tabs a:hover,
.acct-tabs a.is-active {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.acct-list { margin-top: var(--space-4); }

.acct-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.acct-row + .acct-row { margin-top: var(--space-3); }

.acct-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.acct-row-title { font-weight: 600; }

.acct-row-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.acct-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.acct-empty {
  padding: var(--space-5);
  font-size: var(--text-sm);
  text-align: center;
  background: var(--color-bg-inset);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}

.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.acct-card {
  padding: var(--space-5);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.acct-card h3 { margin-bottom: var(--space-3); }

.acct-card--danger { border-color: var(--color-danger); }
.acct-card--danger h3 { color: var(--color-danger); }

.acct-plan {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-accent);
}

.acct-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.acct-figures div { display: flex; flex-direction: column; }
.acct-figures strong { font-size: var(--text-md); color: var(--color-accent); }
.acct-figures span { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---- pills: visibility / status badges ---- */

.pill {
  display: inline-block;
  padding: 2px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.pill--public { color: var(--color-text-muted); }

.pill--private {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
  background: rgba(242, 184, 75, 0.08);
}

.pill--locked {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
}

.pill--mine {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.08);
}

/* ---- star button ---- */

.star-btn {
  padding: 2px var(--space-2);
  font-size: var(--text-base);
  line-height: 1;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.star-btn:hover { color: var(--color-warn); border-color: var(--color-warn); }
.star-btn.is-on { color: var(--color-warn); border-color: var(--color-warn); }
.star-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ---- locked / paywalled rows ---- */

.is-locked-row { opacity: 0.75; }

.is-locked-row .locked-cell {
  color: var(--color-text-muted);
  font-style: italic;
}

.paywall {
  margin-top: var(--space-5);
  padding: var(--space-5);
  text-align: center;
  background: var(--color-bg-raised);
  border: 1px solid rgba(242, 184, 75, 0.4);
  border-radius: var(--radius-md);
}

.paywall h3 { margin-bottom: var(--space-2); }
.paywall p { color: var(--color-text-muted); font-size: var(--text-sm); }
.paywall .btn { margin-top: var(--space-4); }

.hyp-author {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.hyp-author a { color: var(--color-text-muted); text-decoration: underline; }
.hyp-author a:hover { color: var(--color-accent); }

/* ---- user-defined tests on a hypothesis report ---- */

.test-form {
  margin: var(--space-5) 0;
  padding: var(--space-5);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.test-form-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 1.5fr;
  gap: var(--space-4);
}

.test-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.test-list { margin-top: var(--space-5); }

@media (max-width: 780px) {
  .test-form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .test-form-grid { grid-template-columns: 1fr; }
}

/* ---- Backlog editor (admin → Product docs) ----
   The open items are a form, the finished ones are history. The two read
   differently on purpose: an editable row is a card with controls, a completed
   row is a muted line you cannot put a cursor in. */

/* ---- the auto-runner switch ----
   The one control on this screen that starts and stops the agents, so it sits
   above the queue and reads as a state, not as a button. */

.bk-runner {
  margin-top: var(--space-5);
  border-left: 3px solid var(--color-accent);
}
.bk-runner[data-off="true"] { border-left-color: var(--color-warn); }

.bk-runner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.bk-runner-copy { min-width: 0; }
.bk-runner-title { margin: 0; font-size: var(--text-lg); }
.bk-runner-state {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.bk-runner-state[data-tone="ok"] { color: var(--color-accent); }
.bk-runner-state[data-tone="warn"] { color: var(--color-warn); }
.bk-runner .field-hint {
  margin: var(--space-3) 0 0;
  word-break: break-word;
}
.bk-runner-status { margin: var(--space-2) 0 0; text-align: left; }

.bk-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
}
.bk-switch:hover:not(:disabled) { border-color: var(--color-accent); }
.bk-switch:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.bk-switch:disabled { opacity: 0.55; cursor: default; }

.bk-switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  flex: none;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.bk-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
  transition: transform 0.15s ease, background 0.15s ease;
}
.bk-switch[data-on="true"] .bk-switch-track {
  background: rgba(53, 211, 183, 0.22);
  border-color: var(--color-accent);
}
.bk-switch[data-on="true"] .bk-switch-knob {
  background: var(--color-accent);
  transform: translateX(20px);
}
.bk-switch-text { min-width: 3.5em; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  .bk-switch-track,
  .bk-switch-knob { transition: none; }
}

/* ---- today's request allowance ----
   Sits with the switch inside the runner card: the switch is permission, this
   is budget. Two meters side by side, each with its own state — an exempt
   project shows the WORD, so it gets no track to fill. */

.bk-allowance {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.bk-allowance-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.bk-allowance-title {
  margin: 0;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.bk-allowance-state {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.bk-allowance-state[data-tone="ok"] { color: var(--color-text); }
.bk-allowance-state[data-tone="warn"] { color: var(--color-warn); }
.bk-allowance-state[data-tone="error"] { color: var(--color-danger); }

.bk-allowance-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3) var(--space-5);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}
.bk-allowance-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.bk-allowance-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.bk-allowance-value {
  font-size: var(--text-base);
  font-weight: 600;
  white-space: nowrap;
}
.bk-allowance-meter[data-state="unlimited"] .bk-allowance-value { color: var(--color-accent); }
.bk-allowance-meter[data-state="over"] .bk-allowance-value { color: var(--color-warn); }
.bk-allowance-meter[data-state="unknown"] .bk-allowance-value { color: var(--color-text-muted); }

.bk-allowance-track {
  display: block;
  height: 6px;
  margin-top: var(--space-2);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.bk-allowance-fill {
  display: block;
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
}
.bk-allowance-meter[data-state="over"] .bk-allowance-fill { background: var(--color-warn); }

.bk-allowance-sub {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.bk-allowance-note { margin: var(--space-3) 0 0; }

.bk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.bk-summary { margin: 0; }

.bk-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
}

.bk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.bk-save-status { margin: 0; }

.bk-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.bk-add .field { margin: 0; }
.bk-add .field:first-child { flex: 1 1 420px; }
.bk-add .field:nth-child(2) { flex: 0 1 280px; }
.bk-add textarea { min-height: 64px; }

.bk-group { margin-top: var(--space-6); }
.bk-group > h3 { margin-bottom: var(--space-1); }
.bk-group > .field-hint { margin-bottom: var(--space-3); }

.bk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.bk-item {
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: var(--radius-md);
}
.bk-item[data-state="open"] { border-left-color: var(--color-border); }
.bk-item[data-state="flight"] { border-left-color: var(--color-accent); }
.bk-item[data-state="done"] { border-left-color: var(--color-text-muted); }
.bk-item[data-state="blocked"] { border-left-color: var(--color-warn); }
.bk-item[data-new="true"] { border-left-color: var(--color-accent); }

.bk-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
}

.bk-state-select {
  padding: 2px var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.bk-state-select:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.bk-moves { display: inline-flex; gap: var(--space-1); }
.bk-move {
  min-width: 30px;
  padding: 2px var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.bk-move:hover:not(:disabled) { color: var(--color-accent); border-color: var(--color-accent); }
.bk-move:disabled { opacity: 0.35; cursor: default; }
.bk-move:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.bk-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.bk-text {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  resize: vertical;
  overflow: hidden;
}
.bk-text:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
/* A ticked item is still editable until the save lands, but it should already
   read as finished. */
.bk-item[data-state="done"] .bk-text,
.bk-item[data-state="blocked"] .bk-text { color: var(--color-text-muted); }

/* ---- history: read-only, and it must look it ---- */

.bk-done { margin-top: var(--space-4); }
.bk-done h4 { margin-bottom: var(--space-1); font-size: var(--text-sm); }
.bk-done .field-hint { margin-bottom: var(--space-3); }

.bk-list--done { gap: var(--space-2); }
.bk-item--readonly {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border-color: var(--color-border);
}
.bk-item--readonly[data-state="blocked"] .pill {
  color: var(--color-warn);
  border-color: rgba(242, 184, 75, 0.5);
}
.bk-text-ro {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* ---- the 409 reload prompt ---- */

.bk-conflict {
  margin-bottom: var(--space-5);
  border-color: rgba(242, 184, 75, 0.5);
}
.bk-conflict h3 { color: var(--color-warn); }
.bk-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

@media (max-width: 640px) {
  .bk-add > * { flex: 1 1 100%; }
  .bk-actions > .btn { flex: 1 1 100%; }
}

/* ---- Roadmap editor (admin → Product docs) ----
   Reuses the backlog editor's conflict card, action row and summary bar — the
   file rules are the same, so the two screens should not look like two different
   tools. What differs is the primitive: roadmap.md is prose the owner owns end
   to end, so the whole file is one monospaced box where indentation and list
   markers line up the way they do on disk. Lines still soft-wrap: the roadmap's
   paragraphs are one long line each, and horizontal scrolling to read a sentence
   is worse than a wrapped one. */

.rm-field { margin-top: var(--space-5); }

/* Scoped through .field so it outranks the shared `.field textarea` rules that
   set font-family: inherit — the monospace is the point here. */
.field .rm-editor {
  width: 100%;
  min-height: 60vh;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  tab-size: 2;
}

/* ---- Analytics (admin → Ops) ----------------------------------------------
   Charts are single-series small multiples in ONE hue — the brand accent —
   because these are four measures of the same traffic, not four categories to
   tell apart. A categorical palette here would spend colour on identity the
   reader does not need, and the accent clears 3:1 against the raised surface.
   -------------------------------------------------------------------------- */

/* Filters: one row above everything they scope. */
.an-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.an-filters .field {
  margin: 0;
  min-width: 160px;
}
.an-filters .field input { width: 100%; }

/* Presets before the custom range — nobody fights two date fields for
   "last 30 days". */
.an-presets {
  display: flex;
  gap: var(--space-2);
  padding-bottom: var(--space-1);
}
.an-preset {
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
}
.an-preset:hover { color: var(--color-text); }
.an-preset[aria-pressed="true"] {
  color: var(--color-accent-ink);
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.an-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-bottom: var(--space-2);
}
.an-check input { width: auto; margin: 0; }

/* A refetch holds the previous render at reduced opacity — no layout jump. */
#an-content[data-loading="true"],
#an-day-content[data-loading="true"] {
  opacity: 0.55;
  transition: opacity 120ms ease;
}

/* `.an-notice` is the same treatment for a block whose DATA SOURCE is missing
   rather than empty — an unwired panel and a real zero must not look alike. */
.an-beacon,
.an-notice {
  margin-bottom: var(--space-5);
  border-color: rgba(242, 184, 75, 0.5);
}
.an-beacon h3,
.an-notice h3 { color: var(--color-warn); }
.an-beacon p,
.an-notice p { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.an-notice h3 { margin-bottom: var(--space-2); }
#an-beacon-line { margin-bottom: var(--space-5); }

/* The attribution hint carries the window, the as-of stamp and any caveat about
   the tracker's rolling window, so it is long by nature. Let the heading column
   shrink rather than push the export button onto its own line. */
#an-sources-block > .admin-panel-head > div {
  flex: 1 1 320px;
  min-width: 0;
}

/* The attribution table's summary rows. They restate the window rather than
   naming another source, so they read as a rule under the list, not as more of
   it — and the unattributed row is deliberately quieter than the total. */
.an-sources-total > * {
  border-top: 2px solid var(--color-border);
  font-weight: 600;
  background: var(--color-bg-inset);
}
.an-sources-gap > * {
  color: var(--color-text-muted);
  background: var(--color-bg-inset);
}
.an-sources-foot-note td {
  border-top: 0;
  padding-top: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  white-space: normal;
  background: var(--color-bg-inset);
}

.an-block { margin-top: var(--space-6); }
.an-block > .admin-panel-head { margin-bottom: var(--space-3); }
.an-block .field-hint { margin-bottom: 0; }

/* A second table inside one panel (the channel rollup above the source list).
   The subhead is what stops two adjacent tables reading as one long one, and it
   is deliberately quieter than the panel's own h3 — it names a view of the same
   data, not another section.

   After .an-block's rules, not before: both selectors are two classes deep, so
   the hint spacing below only survives by coming second. */
.an-subblock { margin-bottom: var(--space-5); }
.an-subhead {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.an-subblock > .an-subhead { margin-top: 0; }
.an-block .an-subblock .field-hint { margin-bottom: var(--space-2); }
.an-block .an-channels-note {
  margin-top: var(--space-2);
  margin-bottom: 0;
  white-space: normal;
}

/* ---- funnel & conversion ----
   The step list is the question, so it reads as an ordered list of boxes rather
   than as one comma-separated string: the order is the funnel, and a row you can
   move or drop is the only honest way to show that. Same long-hint treatment as
   attribution above — it carries the window, the as-of stamp and the bots
   caveat. */
#an-funnel-block > .admin-panel-head > div {
  flex: 1 1 320px;
  min-width: 0;
}
.an-funnel-form {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.an-funnel-steps {
  list-style: none;
  counter-reset: an-funnel;
  margin: 0;
  padding: 0;
  /* An event name is a short string; a box the width of the panel invites the
     eye to look for content that isn't there. */
  max-width: 34rem;
}
.an-funnel-step {
  counter-increment: an-funnel;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
/* The number is generated rather than marked up: it is the row's position, and
   a position that can disagree with the list it is in is worse than none. */
.an-funnel-step::before {
  content: counter(an-funnel) ".";
  flex: 0 0 auto;
  min-width: 1.5em;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: right;
}
/* The same box `.field input` gets — these sit in a list rather than in a
   labelled field, so they don't inherit it. One shade lighter than the form
   behind them, or a row of boxes on an inset panel reads as one flat block. */
.an-funnel-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.an-funnel-input:focus-visible {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
  outline: none;
}
.an-funnel-rowbtns {
  display: flex;
  gap: var(--space-1);
}
.an-funnel-iconbtn {
  padding: var(--space-2);
  min-width: 2.25rem;
  line-height: 1;
}
.an-funnel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.an-funnel-actions .form-status { margin: 0; text-align: left; }
/* The whole-funnel line under the steps: a rule under the list, not more of it. */
.an-funnel-total > * {
  border-top: 2px solid var(--color-border);
  font-weight: 600;
  background: var(--color-bg-inset);
}
/* An answer this panel can't draw is a warning, not an error — the call
   succeeded, and the Tracking section will render it verbatim. */
#an-funnel-empty[data-tone="warn"] { color: var(--color-warn); }

/* ---- visitor geography ----
   Same long-hint treatment as the two blocks above: the hint carries the level,
   the window, the as-of stamp and the bots caveat. */
#an-geo-block > .admin-panel-head > div {
  flex: 1 1 320px;
  min-width: 0;
}
/* The level switch borrows the range presets' pills deliberately — it is the
   same kind of control (one of a few, always exactly one chosen) and reading it
   as anything else would suggest the levels combine. */
.an-geo-levels {
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
/* A rule under the list, not more of it — and the note under it is the beacon's
   caveats, which are quieter still. */
.an-geo-total > * {
  border-top: 2px solid var(--color-border);
  font-weight: 600;
  background: var(--color-bg-inset);
}
.an-geo-foot-note td {
  border-top: 0;
  padding-top: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  white-space: normal;
  background: var(--color-bg-inset);
}
#an-geo-empty[data-tone="warn"] { color: var(--color-warn); }

/* ---- the day charts ---- */

/* Four measures in a 2x2 block: small multiples only read as one picture when
   they share a row length, so the columns are fixed rather than auto-fit. */
.an-charts {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}
.an-chart {
  margin: 0;
  padding: var(--space-4);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.an-chart figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.an-chart-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text);
}
.an-chart-peak {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.an-plot { position: relative; }
.an-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}
/* Marks carry the colour; every label on this screen wears a text token. */
.an-col { fill: var(--color-accent); }
.an-line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.an-area { fill: rgba(53, 211, 183, 0.12); }
.an-baseline {
  stroke: var(--color-border);
  stroke-width: 1;
}
/* The hovered day, marked identically on all four charts so they read as one
   crosshair rather than four unrelated plots. */
.an-col-hi {
  fill: rgba(159, 176, 200, 0.14);
  pointer-events: none;
}
.an-plot-note {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.an-chart-axis {
  display: flex;
  justify-content: space-between;
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---- tooltip ---- */

.an-tip {
  position: absolute;
  z-index: 5;
  min-width: 148px;
  padding: var(--space-3);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-raised);
  pointer-events: none;
}
.an-tip-day {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.an-tip-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.an-tip-rows li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
/* Values lead, labels follow — the reader has the day and wants the number. */
.an-tip-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.an-tip-label { color: var(--color-text-muted); }
/* The bar under the pointer is a link; the tooltip has to say so or the
   drill-down is only found by accident. */
.an-tip-hint {
  margin: var(--space-2) 0 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-accent);
}

/* ---- every day is a link ----
   The hit area is the whole band, transparent, so the pointer never has to
   find a two-pixel column. The crosshair rect already marks the hovered day,
   so hover needs no second treatment — only the cursor and a focus ring for
   the keyboard, which the browser will not draw on an SVG anchor by itself. */
.an-hit { cursor: pointer; }
.an-hit:focus { outline: none; }
.an-hit:focus-visible rect {
  fill: rgba(53, 211, 183, 0.16);
  stroke: var(--color-accent);
  stroke-width: 1.5;
}
#an-days-body a {
  color: var(--color-text);
  text-decoration-color: var(--color-border);
}
#an-days-body a:hover { color: var(--color-accent); }

.an-table-details { margin-top: var(--space-4); }
.an-table-details summary {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.an-table-details summary:hover { color: var(--color-text); }
.an-table-details .rank-table-wrap { margin-top: var(--space-3); }

/* ---- top-N tables: a magnitude bar behind the label ---- */

.an-rank-cell {
  position: relative;
  overflow-wrap: anywhere;
}
.an-rank-bar {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  border-radius: var(--radius-sm);
  background: rgba(53, 211, 183, 0.14);
}
.an-rank-label { position: relative; }

/* One per block, under the button that produced it — and taking no room until
   there is something to say. */
.an-export-status {
  min-height: 0;
  margin: 0 0 var(--space-3);
  text-align: left;
}
.an-export-status:empty { margin: 0; }

/* ---- one day (#analytics?day=YYYY-MM-DD) ----------------------------------
   The drill-down behind a bar. It REPLACES the range on the same panel, so it
   opens with the way back rather than burying it under four tables. ---------- */

.an-day-back {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
}
.an-day-head { align-items: flex-start; }
.an-day-head .admin-panel-title { font-size: var(--text-xl); }
.an-day-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
/* The prev/next links are buttons by shape, so they carry the button's own
   centring rather than an anchor's baseline. */
.an-day-nav a.btn { display: inline-flex; }

/* One wide chart rather than the range view's 2x2 block: 24 hours read left to
   right, and half a page of width is what places a spike in the day. */
.an-hours { margin: var(--space-4) 0; }
.an-hours .an-chart { margin: 0; }
.an-hour-hit { cursor: default; }

.an-day-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.an-day-pager .field-hint { margin: 0; }

/* A synthetic visitor id and a real one must not read alike. */
.an-day-muted { color: var(--color-text-muted); }
.an-day-sub {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

@media (max-width: 640px) {
  .an-filters > .field,
  .an-filters > .btn { flex: 1 1 100%; }
  .an-charts { grid-template-columns: 1fr; }
  .an-day-nav { width: 100%; }
  .an-day-nav > * { flex: 1 1 auto; }
}

/* ---- Message templates (admin → Comms) ------------------------------------
   List + editor + rendered preview for the transactional messages the backend
   sends. Shared by the Email templates and SMS templates panels — the two
   screens are deliberate mirrors (admin-portal.md §A.7/§A.8), so the shared
   parts carry both prefixes rather than a second copy of the same rules. The
   email preview is an isolated iframe on purpose: the body is email HTML with
   its own light-mode styling, and it must not inherit the portal's. The SMS
   preview is plain text, because a carrier delivers plain text.
   -------------------------------------------------------------------------- */

.et-summary,
.st-summary { margin: var(--space-4) 0 var(--space-2); }
.et-list-status:empty,
.et-save-status:empty,
.et-test-status:empty,
.st-list-status:empty,
.st-save-status:empty,
.st-test-status:empty { margin: 0; }
.et-list-status,
.st-list-status { margin: 0 0 var(--space-3); text-align: left; }

/* Hints that can turn into a warning (an unsaved preview, a body over the size
   limit) rather than staying neutral. */
.field-hint[data-tone="warn"] { color: var(--color-warn); }
.field-hint[data-tone="error"] { color: var(--color-danger); }
.et-warn,
.st-warn { color: var(--color-warn); }

.et-key,
.st-key {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
/* Unlike the numeric admin tables these carry sentences — a description and a
   subject or body line — so their cells wrap instead of pushing the actions
   columns off the right edge. */
.et-table td,
.st-table td { white-space: normal; }
.et-table .rank-name,
.st-table .rank-name { min-width: 17rem; }
.et-table .et-subject-cell,
.st-table .st-body-cell {
  min-width: 12rem;
  max-width: 22rem;
  color: var(--color-text-muted);
}

.hyp-badge[data-status="edited"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
}
.hyp-badge[data-status="seed"] { color: var(--color-text-muted); }

/* ---- the sending switch (list rows and the editor) ---- */

.et-switch,
.st-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
}
.et-switch:hover:not(:disabled),
.st-switch:hover:not(:disabled) { border-color: var(--color-accent); }
.et-switch:focus-visible,
.st-switch:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.et-switch:disabled,
.st-switch:disabled { opacity: 0.55; cursor: default; }

.et-switch-track,
.st-switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  flex: none;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.et-switch-knob,
.st-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
  transition: transform 0.15s ease, background 0.15s ease;
}
.et-switch[data-on="true"] .et-switch-track,
.st-switch[data-on="true"] .st-switch-track {
  background: rgba(53, 211, 183, 0.22);
  border-color: var(--color-accent);
}
.et-switch[data-on="true"] .et-switch-knob,
.st-switch[data-on="true"] .st-switch-knob {
  background: var(--color-accent);
  transform: translateX(20px);
}
.et-switch-text,
.st-switch-text { min-width: 4.5em; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  .et-switch-track,
  .et-switch-knob,
  .st-switch-track,
  .st-switch-knob { transition: none; }
}

/* ---- the editor ---- */

.et-editor,
.st-editor { margin-top: var(--space-5); }

.et-enable,
.st-enable {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
}
.et-enable[data-on="false"],
.st-enable[data-on="false"] { border-left-color: var(--color-warn); }
.et-enable-copy,
.st-enable-copy { min-width: 0; flex: 1 1 260px; }
.et-enable-title,
.st-enable-title { margin: 0; font-size: var(--text-base); }
.et-enable-state,
.st-enable-state {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.et-enable-state[data-tone="ok"],
.st-enable-state[data-tone="ok"] { color: var(--color-accent); }
.et-enable-state[data-tone="warn"],
.st-enable-state[data-tone="warn"] { color: var(--color-warn); }

.et-html {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  min-height: 260px;
}

.et-actions,
.st-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.et-save-status,
.et-test-status,
.st-save-status,
.st-test-status { margin: 0; text-align: left; }

/* ---- preview + test ---- */

.et-block,
.st-block {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.et-block h4,
.st-block h4 { margin: 0 0 var(--space-2); }

.et-preview-subject {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  word-break: break-word;
}
.et-preview-frame {
  display: block;
  width: 100%;
  height: 520px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.et-samples,
.st-samples { margin-top: var(--space-3); }
.et-samples summary,
.st-samples summary {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.et-samples summary:hover,
.st-samples summary:hover { color: var(--color-text); }
.et-sample-list,
.st-sample-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-4);
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
}
.et-sample-list dt,
.st-sample-list dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
}
.et-sample-list dd,
.st-sample-list dd {
  margin: 0;
  color: var(--color-text-muted);
  word-break: break-word;
}

.et-test .field,
.st-test .field { max-width: 24rem; }

@media (max-width: 640px) {
  .et-preview-frame { height: 380px; }
  .et-sample-list,
  .st-sample-list { grid-template-columns: 1fr; }
  .et-sample-list dd,
  .st-sample-list dd { margin-bottom: var(--space-2); }
}

/* ---- SMS-specific bits ---------------------------------------------------
   A text has no subject and no markup. What it does have is a bill: the
   segment count of the RENDERED body is the number an editor has to see, so
   it sits under the textarea and under the preview rather than in a footnote.
   -------------------------------------------------------------------------- */

/* Nothing in the product sends a text yet (every definition's `sentBy` is
   null). §D — an unwired panel must not look like a working one. */
.st-unwired {
  margin: var(--space-4) 0 0;
  text-align: left;
}

.st-body {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.5;
  min-height: 120px;
}

/* The server's advisory notes on the saved body — a bare link the carrier will
   drop, a body that grew past one segment. Each is a real delivery consequence,
   not a style preference, so they are listed rather than summarised. */
.st-warnings {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-warn);
}
.st-warnings li { margin-bottom: var(--space-1); }

/* The rendered message as the handset shows it: plain text, wrapped, with the
   line breaks the body actually contains. */
.st-preview {
  margin: var(--space-3) 0;
  padding: var(--space-4);
  max-width: 30rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.st-preview:empty { display: none; }

.st-cost { margin: 0; }

/* Segment count in the list — one number per row, so a message that quietly
   became three texts is visible without opening it. */
.st-cost-cell { white-space: nowrap; }
.st-cost-cell[data-tone="warn"] { color: var(--color-warn); }

/* ---- Notifications (admin → Comms) ---- */

/* Eight controls is more than the four the users toolbar carries, so the date
   and enum fields sit narrower rather than each claiming a 220px column. */
.nt-filters .field { min-width: 150px; flex: 1 1 150px; }
.nt-filters .field:first-child { min-width: 240px; flex: 2 1 240px; }
.nt-filters .field input[type="date"] { width: 100%; }

/* Sent / failed / in flight, side by side and never summed. */
.nt-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.nt-chip {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  color: var(--color-text);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.nt-chip:hover { border-color: var(--color-accent); }
.nt-chip[aria-pressed="true"] {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}
.nt-chip-value {
  font-size: var(--text-md);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nt-chip-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.nt-chip[data-tone="bad"] .nt-chip-value { color: var(--color-danger); }

/* Addresses, device tokens and provider error codes are identifiers — they read
   better fixed-width, and a 200-char push token must wrap rather than stretch
   the table. */
.nt-destination,
.nt-error > strong {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  word-break: break-all;
}
.nt-error > strong { color: var(--color-danger); }
.nt-error .user-sub { word-break: break-word; }

/* The delivery log's Actions column: a Resend button on an open email/SMS
   failure, and otherwise a sentence — the retry that already happened, or why
   this row can't be re-sent. Sentences, so this is the one cell in the table
   allowed to wrap; kept on one line it would push the Sent column off the
   scroller. */
#nt-table-wrap td.nt-action-cell { white-space: normal; min-width: 9rem; }
#nt-table-wrap td.nt-action-cell .user-sub { margin-top: 4px; }
#nt-table-wrap td.nt-action-cell .hyp-row-actions + .user-sub { margin-top: 6px; }

/* ---- Content moderation (admin → Ops) ---- */

/* Five controls, and the search box earns the extra width — it is the one an
   admin reaches for when they already know what they are looking for. */
.cm-filters .field { min-width: 160px; flex: 1 1 160px; }
.cm-filters .field:first-child { min-width: 240px; flex: 2 1 240px; }

/* `.rank-table td` sets white-space: nowrap and outranks `.rank-name`, so the
   three cells carrying member-written prose have to opt back into wrapping by
   id. Without a ceiling on the widest of them the description preview claims
   most of the table and pushes the visibility badge and the action button — the
   two columns the screen exists for — off the right edge. */
#cm-content .rank-table td.cm-name,
#cm-content .rank-table td.cm-owner,
#cm-content .rank-table td.cm-vis {
  white-space: normal;
  word-break: break-word;
}
#cm-content .rank-table td.cm-name { max-width: 24rem; }
#cm-content .rank-table td.cm-owner { min-width: 10rem; max-width: 15rem; }
#cm-content .rank-table td.cm-vis { max-width: 13rem; }
#cm-content .rank-table td.cm-action { white-space: nowrap; }

/* ---- Universe (admin → Research) ---- */

/* The tiles name the retired symbols rather than only counting them, and a
   sixty-symbol universe makes that line long — let it wrap inside the tile. */
#uni-tiles .admin-tile-lines li { white-space: normal; word-break: break-word; }

/* `.rank-table td` is nowrap, which is right for the tickers and the badges but
   not for an operator's note or an "inert because…" reason — both are
   sentences, and truncating the reason defeats the point of showing it beside
   the row it explains. */
#uni-content .rank-table td .user-sub { white-space: normal; }
#uni-ov-body td:nth-child(6) { white-space: normal; min-width: 14rem; max-width: 24rem; }
#uni-ov-body td:nth-child(5) { white-space: normal; min-width: 12rem; max-width: 20rem; }

/* The add form is a toolbar of fields, but Symbol and Sector carry hints under
   them, so they need more room than the toolbar's default track. */
#uni-form .revenue-toolbar .field { min-width: 160px; flex: 1 1 160px; }
#uni-form .revenue-toolbar .field .field-hint { margin: var(--space-1) 0 0; }
#uni-note-field { min-width: 220px; flex: 2 1 220px; }
#uni-eff-filters .field:first-child { min-width: 220px; flex: 2 1 220px; }

/* ---- Data coverage (admin → Ops) ---- */

/* Two buttons in the panel head — Export sits before Refresh because it is the
   one an operator reaches for deliberately. */
.dc-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Same warn treatment as `.an-notice`: this block names the symbols a batch run
   would silently do nothing for, so it must not read as an ordinary card. */
.dc-notice {
  margin-bottom: var(--space-5);
  border-color: rgba(242, 184, 75, 0.5);
}
.dc-notice h3 { margin-bottom: var(--space-2); color: var(--color-warn); }
.dc-notice p {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  word-break: break-word;
}

/* The tiles list the missing tickers rather than only counting them, and a
   sixty-symbol universe makes that line long — let it wrap inside the tile. */
#dc-tiles .admin-tile-lines li { white-space: normal; word-break: break-word; }

/* `.rank-table td` is nowrap, which is right for the numbers but not for the
   date span underneath them; a "2 Jan 2020 → 4 Aug 2026" sub-line would
   otherwise widen every column past the screen. */
#dc-content .rank-table td .user-sub { white-space: normal; }
#dc-content .rank-table td.rank-num { min-width: 9rem; }

/* Per-row loaders — one button per market-data column, stacked rather than in a
   row: three side by side ("Load bars", "Load minute bars", "Load trade ticks")
   would be wider than the three count columns they fill. Each button stays on
   one line; the note under them wraps, because a failure reason is a sentence
   and truncating it would defeat the point of putting it next to the row that
   failed. */
.dc-row-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  white-space: nowrap;
}
.dc-row-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#dc-content .rank-table td.dc-load-cell { min-width: 12rem; white-space: normal; }
#dc-content .dc-load-cell .user-sub[data-tone="error"] { color: var(--color-danger); }
.dc-backfill { margin: var(--space-3) 0 var(--space-4); }
.dc-backfill-line { margin-bottom: var(--space-2); }
.dc-backfill-newest[data-stale="true"] { color: var(--color-danger); }
#dc-filters .field { min-width: 160px; flex: 1 1 160px; }
#dc-filters .field:first-child { min-width: 220px; flex: 2 1 220px; }

/* ---- Audit (admin → Ops) ---- */

/* Export before Refresh, the same order Data coverage uses — the deliberate
   action sits before the incidental one. */
.au-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Seven controls in one toolbar, so they sit narrower than the 160px
   `.an-filters` default rather than each claiming a column of its own. */
.au-filters .field { min-width: 140px; flex: 1 1 140px; }
.au-filters .field select { width: 100%; }
.au-filters .field input[type="date"] { width: 100%; }

/* A value that is also the filter for it. It has to read as the cell's text
   with an affordance, not as a button parked inside a table. */
.au-filter-link {
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--color-border);
  padding: 0;
  cursor: pointer;
}
.au-filter-link:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* `.rank-table td` is nowrap, which is right for the timestamps but not for an
   email, a device string or a list of detail keys. */
.au-person .user-sub,
.au-action-cell .user-sub,
.au-detail-summary .user-sub { white-space: normal; word-break: break-word; }
.au-detail-summary { min-width: 12rem; }
.au-detail-toggle { margin-bottom: var(--space-1); }

/* The expanded row is prose and JSON: it spans every column rather than
   fighting them, and opts out of nowrap entirely. */
.au-detail-row > td {
  white-space: normal;
  background: var(--color-bg-inset);
  /* No rule between a row and its own expansion — the border below the next
     row's cells is what separates one action from the next. */
  border-top: 0;
}
.au-detail-list {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  font-size: var(--text-sm);
}
.au-detail-list dt { color: var(--color-text-muted); }
.au-detail-list dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  word-break: break-word;
}

/* Below the table breakpoint the two-column grid squeezes the values to
   nothing — stack the label over its value instead. */
@media (max-width: 640px) {
  .au-detail-list { grid-template-columns: 1fr; gap: 0; }
  .au-detail-list dd { margin-bottom: var(--space-2); }
}

/* ---- Bugs (admin → Ops) ---- */

/* Six controls plus a checkbox in one toolbar, so they sit narrower than the
   `.revenue-toolbar` default rather than each claiming a column. */
.bg-filters .field { min-width: 140px; flex: 1 1 140px; }
.bg-filters .field:nth-child(3) { min-width: 200px; flex: 2 1 200px; }
.bg-filters .field select,
.bg-filters .field input { width: 100%; }

/* Aligns with the fields beside it rather than the labels above them. */
.bg-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-end;
  padding-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* `.rank-table td` is nowrap, which is right for the timestamps and the repeat
   counts but not for an error message or a source list. */
.bg-message-cell { white-space: normal; min-width: 22rem; }
.bg-message-cell .user-sub,
.bg-source-cell .user-sub { white-space: normal; word-break: break-word; }
.bg-source-cell .hyp-badge { white-space: nowrap; }
.bg-action-cell { white-space: nowrap; }

/* The expanded row is a stack trace: it spans every column rather than fighting
   them, and opts out of nowrap entirely. */
.bg-detail-row > td {
  white-space: normal;
  background: var(--color-bg-inset);
  /* No rule between a row and its own expansion — the border under the next
     row's cells is what separates one error from the next. */
  border-top: 0;
}
/* The raw blob. Scrolls inside the panel rather than growing the page, and the
   bar is styled to the surface it sits on — §C of /etc/guud/admin-portal.md
   applies to every scroll region inside a designed panel, not just the nav. */
.bg-detail-blob {
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  max-height: 22rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.bg-detail-blob::-webkit-scrollbar { width: 8px; height: 8px; }
.bg-detail-blob::-webkit-scrollbar-track { background: transparent; }
.bg-detail-blob::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
.bg-detail-blob::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* ---- Leads (admin → People) ---- */

/* Six controls in one toolbar, and the search box earns the extra width — it is
   the one an admin reaches for when they already know who they are looking for. */
#ld-filters .field { min-width: 150px; flex: 1 1 150px; }
#ld-filters .field:first-child { min-width: 260px; flex: 2 1 260px; }
#ld-filters .field select,
#ld-filters .field input { width: 100%; }

/* `.rank-table td` is nowrap, which is right for the status badge and the date
   but not for an enquiry someone typed or for a full page URL. Both get a
   ceiling as well as a wrap: without one the message preview claims most of the
   table and pushes the Detail button off the right edge. */
/* `.rank-table td` sets nowrap at higher specificity, so these carry the table
   class too — without it a long research-prospect line ran over the next
   columns (Brett 10/28). */
.rank-table .ld-message-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 16rem;
  max-width: 26rem;
}
.rank-table .ld-from-cell {
  white-space: normal;
  word-break: break-all;
  min-width: 12rem;
  max-width: 20rem;
}
.ld-from-cell a,
.ld-from-cell .user-sub { display: block; }
.rank-table .ld-from-cell .user-sub { white-space: normal; word-break: break-all; }

/* Source page and referrer are full URLs, so the facts list has to let them
   break rather than widen its own column past the card. */
#ld-facts dd { word-break: break-word; }

/* The message as the sender wrote it — their line breaks, wide enough to read a
   paragraph in. `.st-preview` supplies the pre-wrap and the inset surface. */
.ld-message { max-width: 46rem; }

/* The work-state form. Status, owner and follow-up share one row — `.user-actions`
   already supplies the wrap and the full-width fallback on a phone — with the
   notes box beneath them, because that is the field that actually gets typed in.
   The owner is given more of the row than the two date/select controls: it holds
   an email address, and 160px truncates one mid-domain. */
.ld-work { margin-top: var(--space-3); }
.ld-work-fields { margin-top: 0; align-items: flex-start; }
.ld-work-fields .field { flex: 1 1 180px; }
.ld-work-fields .field:nth-child(2) { flex: 2 1 260px; }
.ld-work-notes { min-height: 6rem; max-width: 46rem; }
.ld-work-notes-field { max-width: 46rem; margin-bottom: 0; }
/* `.form-status` centres itself, which is right under a login form and wrong
   beside the button that caused it. */
.ld-work-status { margin: 0; text-align: left; }

/* Mechanisms (admin → Research) ------------------------------------------- */

/* The name column carries a description under it, so it opts out of the
   table's nowrap the same way the bug message column does. */
.mech-name-cell { white-space: normal; min-width: 18rem; }
.mech-name-cell .user-sub { white-space: normal; }
.mech-sectors-cell .user-sub { white-space: normal; }
.mech-hyp-cell { white-space: nowrap; }

/* The expanded row lists the hypotheses behind one mechanism — same treatment
   as the bugs detail row: spans every column, no rule between it and its own
   parent, and it scrolls inside the panel rather than growing the page. */
.mech-detail-row > td {
  white-space: normal;
  background: var(--color-bg-inset);
  border-top: 0;
}
.mech-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 24rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.mech-detail-list::-webkit-scrollbar { width: 8px; }
.mech-detail-list::-webkit-scrollbar-track { background: transparent; }
.mech-detail-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
.mech-detail-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
.mech-detail-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.mech-detail-list li:last-child { border-bottom: 0; }
.mech-detail-list .mech-detail-metrics {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Rankings (admin → Research) --------------------------------------------- */

/* The variation name carries a mechanism badge beside it, so it opts out of
   `.rank-table td`'s nowrap the way the mechanism name column does. Capped so a
   long hypothesis name cannot push the EV, sample and frequency columns — the
   three the screen exists for — off the right edge. */
#rk-content .rank-table td.rk-name-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 16rem;
  max-width: 26rem;
}
#rk-content .rank-table td.rk-name-cell .user-sub { white-space: normal; }

/* Under-30-trade rows are the failure mode this table is built to expose: a
   headline EV drawn from a handful of trades. Dim the count rather than badge
   it — every row has one, so a badge on half the table is noise. */
#rk-content .rank-table td.rk-sample-cell[data-thin="true"] { color: var(--color-text-muted); }

/* Losers archive (admin → Research) ---------------------------------------- */

/* Ten controls in one toolbar, so they sit narrower than the `.revenue-toolbar`
   default rather than each claiming a column. */
.ls-filters .field { min-width: 150px; flex: 1 1 150px; }
.ls-filters .field:nth-child(2),
.ls-filters .field:nth-child(3) { min-width: 210px; flex: 2 1 210px; }
.ls-filters .field select,
.ls-filters .field input { width: 100%; }
.ls-filters .field .field-hint { margin: var(--space-1) 0 0; white-space: normal; }

/* The three columns that carry a sub-line each opt out of `.rank-table td`'s
   nowrap. The name is capped so a long hypothesis title cannot push the EV,
   power and sample columns — the three the screen exists for — off the edge. */
#ls-content .rank-table td.ls-name-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 15rem;
  max-width: 24rem;
}
#ls-content .rank-table td.ls-miss-cell { white-space: normal; min-width: 13rem; }
#ls-content .rank-table td.ls-name-cell .user-sub,
#ls-content .rank-table td.ls-miss-cell .user-sub,
#ls-content .rank-table td.ls-symbol-cell .user-sub,
#ls-content .rank-table td.ls-ev-cell .user-sub { white-space: normal; }
#ls-content .rank-table td.ls-detail-summary { white-space: nowrap; }

/* Under-power and under-sample rows are the distinction this table is built to
   expose — an unmeasured run reads very differently from a disproven one. Dim
   the figure rather than badge it: every row has both, so a badge on most of
   the table is noise. */
#ls-content .rank-table td[data-thin="true"] { color: var(--color-text-muted); }

/* The expanded row is a nested table plus JSON: it spans every column rather
   than fighting them, and opts out of nowrap entirely. */
.ls-detail-row > td {
  white-space: normal;
  background: var(--color-bg-inset);
  /* No rule between a row and its own expansion — the border under the next
     row's cells is what separates one run from the next. */
  border-top: 0;
}
.ls-criteria-table { margin-bottom: var(--space-4); }
.ls-detail-row .ls-criteria-table td.ls-criterion-cell { white-space: normal; min-width: 14rem; }
.ls-detail-row .ls-criteria-table td.ls-criterion-cell .user-sub { white-space: normal; }

/* ---- Tests (admin → Research) ---------------------------------------- */

/* Eleven controls in one toolbar, so they sit narrower than the
   `.revenue-toolbar` default rather than each claiming a column. */
.ht-filters .field { min-width: 150px; flex: 1 1 150px; }
.ht-filters .field select,
.ht-filters .field input { width: 100%; }
.ht-filters .field .field-hint { margin: var(--space-1) 0 0; white-space: normal; }

/* The columns that carry a sub-line each opt out of `.rank-table td`'s nowrap.
   The test name is capped so a long label cannot push Status, Runtime and EV —
   the three the screen is opened for — off the edge, and the symbol list wraps
   rather than stretching the row to a 60-ticker width. */
#ht-content .rank-table td.ht-name-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 14rem;
  max-width: 22rem;
}
#ht-content .rank-table td.ht-symbols-cell {
  white-space: normal;
  min-width: 10rem;
  max-width: 16rem;
}
#ht-content .rank-table td.ht-name-cell .user-sub,
#ht-content .rank-table td.ht-owner-cell .user-sub,
#ht-content .rank-table td.ht-symbols-cell .user-sub,
#ht-content .rank-table td.ht-status-cell .user-sub,
#ht-content .rank-table td.ht-window-cell .user-sub { white-space: normal; }
#ht-content .rank-table td.ht-owner-cell { white-space: normal; word-break: break-word; }

/* Status carries up to two pills under its badge (stuck, live), so they wrap
   as a group instead of widening the column. */
.ht-flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

/* The owner cell's email is a FILTER, not a link off the page — styled as a
   button so it cannot be mistaken for navigation to a profile. */
.ht-owner-filter {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.ht-owner-filter:hover { color: var(--color-accent); }
.ht-owner-filter:disabled { cursor: default; text-decoration: none; }

/* ============================================================
   Published signal page (signal.html)

   Every signal is a PUBLIC page: it is the acquisition surface, so it has to
   read like a piece of research a stranger landed on, not like a dashboard
   detail view with the middle cut out. The lede carries the whale move in
   words; the gate below the verdict is the only thing a logged-out reader
   can't have.
   ============================================================ */
.sig-summary {
  max-width: 68ch;
  margin-bottom: var(--space-5);
}

.rec-action-tease {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- The signup gate --------------------------------------------------- */
.sig-gate {
  position: relative;
  background: var(--color-bg-raised);
  border: 1px solid rgba(53, 211, 183, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-raised);
}
@media (max-width: 700px) { .sig-gate { padding: var(--space-5) var(--space-4); } }

.sig-gate-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-accent);
  background: rgba(53, 211, 183, 0.12);
  border: 1px solid rgba(53, 211, 183, 0.35);
  margin-bottom: var(--space-4);
}

.sig-gate h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.sig-gate-copy {
  margin: 0;
  max-width: 68ch;
  color: var(--color-text-muted);
}

/* The redacted plan. Labels are real — they mirror the rows this signal's
   plan actually has — so the tease can never promise a level the plan
   doesn't contain. */
.sig-locked {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
@media (max-width: 700px) { .sig-locked { grid-template-columns: 1fr; } }
.sig-locked li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.sig-redacted {
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  opacity: 0.55;
  user-select: none;
}

/* The email-capture row: one field and one button on a line, because a single
   input is what converts an anonymous reader. Below 560px it stacks and the
   button goes full width so the tap target stays comfortable. */
.sig-gate-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.sig-gate-form .field {
  flex: 1 1 16rem;
  margin-bottom: 0;
}
.sig-gate-form .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .sig-gate-form { display: block; }
  .sig-gate-form .field { margin-bottom: var(--space-3); }
  .sig-gate-form .btn { width: 100%; }
}

/* The gate reads as prose, so its status line sits left with the copy rather
   than centred like a standalone form's. */
.sig-gate .form-status {
  text-align: left;
  margin-top: var(--space-2);
}

.sig-gate-alt {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.sig-gate-alt a { color: var(--color-accent); }

.sig-gate-note {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- Recently published signals ---------------------------------------- */
/* The only path a crawler (or a reader who arrived on one signal from search)
   has into the rest of the archive — a static site has nothing else that
   enumerates it. Also used on the home page. */
.sig-more {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.sig-more h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}
.sig-more-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
@media (max-width: 900px) { .sig-more-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .sig-more-list { grid-template-columns: 1fr; } }

.sig-more-card {
  display: grid;
  gap: var(--space-1);
  height: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.sig-more-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.sig-more-card:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.sig-more-symbol {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--color-text);
}
.sig-more-sub {
  font-size: var(--text-sm);
  color: var(--color-accent);
}
.sig-more-foot {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---- LLM SEO (admin → Ops) ---- */

/* The generated file. Same treatment as the bug-detail blob it borrows: it
   scrolls inside the panel rather than growing the page, with a scrollbar
   styled to the surface (§C of /etc/guud/admin-portal.md). Taller than a stack
   trace because this one is meant to be READ. */
.seo-file { max-height: 30rem; }

/* The brief a stored version came from, under the file itself. `business` is a
   paragraph, so the description column wraps rather than being clipped. */
.seo-brief-used { margin-top: var(--space-4); }
.seo-brief-used dd { white-space: pre-wrap; }

/* "· repo default" beside a field's label — a qualifier on the label, not part
   of it, so it steps back to the muted weight. */
.seo-src {
  margin-left: var(--space-2);
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.seo-src:empty { display: none; }

.seo-generate { margin-top: var(--space-5); }
.seo-generate h3 { margin-bottom: var(--space-2); }
/* An over-long field is a refused generation, so its counter turns red before
   the request is made rather than after. */
.seo-generate .field-hint[data-tone="error"] { color: var(--color-danger); }

.seo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.seo-sha { font-family: var(--font-mono); font-size: var(--text-xs); }
.seo-row-actions { white-space: nowrap; }
.seo-row-actions .btn + .btn { margin-left: var(--space-2); }

/* What is live at /llm.txt, above everything else on the panel. Green when the
   newest version is the one crawlers read, amber when a generated version is
   sitting unpublished — the state the Publish buttons exist to resolve. */
#seo-published[data-tone="ok"] { color: var(--color-accent); }

/* ---------------------------------------------------------------------------
   Contact page (contact.html)

   The public lead form — the only thing on the site that writes into the admin
   Leads inbox. A form panel beside a column of "there are other routes to us"
   cards; the aside drops under the form on narrow screens rather than squeezing
   the fields, because the form is what the page is for.
   ------------------------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
  margin-top: var(--space-7);
}
@media (max-width: 900px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.contact-panel {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.contact-panel .form-status { text-align: left; }
.contact-panel > form > .btn { margin-top: var(--space-2); }

.contact-aside {
  display: grid;
  gap: var(--space-4);
}
.contact-aside .card p:last-child { margin-bottom: 0; }

/* The honeypot. Off-screen rather than display:none — a bot that skips hidden
   inputs is a bot that walks past the trap. aria-hidden + tabindex="-1" on the
   markup keep it away from anyone real. */
.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-success h2 { margin-bottom: var(--space-3); }
.contact-success h2:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}
.contact-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: 0;
}

/* ---- Tracking (admin → Ops) ----
   One panel per action of the platform `tracking` service, adapted from the
   generated component in /etc/student-hosting/templates/service-ui-components/.
   The runtime's own stylesheet is deliberately not shipped: nothing in that
   contract reads a class name, so the panels are dressed in this portal's own
   surfaces (cards, .rank-table, .field) instead of a second design system. */
.trk-panels {
  margin-top: var(--space-5);
  display: grid;
  gap: var(--space-3);
}

.trk-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-raised);
  padding: var(--space-4) var(--space-5);
}
.trk-panel[open] { padding-bottom: var(--space-5); }

.trk-paneltitle {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
}
.trk-paneltitle::-webkit-details-marker { color: var(--color-text-muted); }

/* What the panel answers, in business language, beside its name — the action's
   own vocabulary (`conversion_event`, `group_by`) is on the fields below. */
.trk-hint {
  margin-left: var(--space-2);
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.trk-form { margin-top: var(--space-4); }
.trk-form .field-hint { margin-bottom: 0; }

.trk-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
/* A comma-separated funnel is one long value, not three short ones. */
.trk-field--wide { grid-column: 1 / -1; }

.trk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.trk-actions .form-status { text-align: left; margin: 0; }

.trk-out:empty { display: none; }
.trk-out { margin-top: var(--space-4); }
.trk-out .rank-table-wrap { margin-top: var(--space-2); }

/* Stale numbers and refusals are the two things on this screen that must not
   read as ordinary muted captions. */
.trk-stale { color: var(--color-warn); }
.trk-error { color: var(--color-danger); }

/* The raw envelope. Kept, unlike in most adaptations of these components: the
   service's payload shape is undocumented and forwarded verbatim, so this is
   where a field the generic renderer didn't draw can still be read. */
.trk-raw { margin-top: var(--space-3); }
.trk-raw > summary {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.trk-raw > summary:hover { color: var(--color-text); }

/* The rest of a row too wide for the table. */
.trk-rowmore > summary {
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.trk-rowmore .bg-detail-blob { max-height: 18rem; }

/* ---- Blog writer (admin → Comms) ----
   Shares the tracking section's panel furniture (.trk-panel/.trk-form/.trk-out):
   both screens are one form per action of a platform service, and a second set
   of the same rules under a different prefix is a second thing to keep in step.
   What is here is only what a DRAFT needs and a result table does not. */

/* The brief both actions share, above them rather than inside either. */
.bw-brief { margin-top: var(--space-5); }
.bw-brief .field { margin-bottom: 0; }
.bw-brief textarea { min-height: 6rem; }

.bw-panels { margin-top: var(--space-4); }

/* The copy controls sit ABOVE the draft, not under it: a post is long enough
   that a button at its foot is a scroll away from the thing it copies. */
.bw-copyrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.bw-copyrow .field-hint { margin: 0; }

.bw-posttitle {
  margin: var(--space-4) 0 var(--space-3);
  font-size: var(--text-lg);
}

/* The draft reads as prose, not as a payload — .bg-detail-blob is monospace at
   --text-xs, which is right for JSON and wrong for eight hundred words. The
   measure is capped for the same reason the article pages cap theirs. */
.bw-post {
  padding: var(--space-4) var(--space-5);
  max-height: 34rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  max-width: 68ch;
  font-size: var(--text-sm);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.bw-post::-webkit-scrollbar { width: 8px; }
.bw-post::-webkit-scrollbar-track { background: transparent; }
.bw-post::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
.bw-post::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Numbered with a counter rather than a list marker: each row is a flex line
   (idea left, its Copy button right), and `display: flex` on an <li> takes its
   marker with it — while the numbers are the same ones "Copy all" writes, so
   the screen and the clipboard have to agree. */
.bw-ideas {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: bw-idea;
  display: grid;
  gap: var(--space-2);
}
.bw-ideas li::before {
  counter-increment: bw-idea;
  content: counter(bw-idea) ".";
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.bw-ideas li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}
.bw-ideas li:last-child { border-bottom: 0; }
/* The idea takes the width; its Copy button keeps to the end of the row, and
   drops below it on a phone. The basis is small enough that the NUMBER never
   gets a line of its own — a wrapped "3." reads as an empty row. */
.bw-idea-text { flex: 1 1 14rem; }

/* A field whose value is two characters long has no business being as wide as
   the panel — "How many" is the only one on this screen alone in its row. */
.bw-panels .field--narrow input { max-width: 14rem; }

/* ---- Drafts (the read half of the same section) ----
   The list, the one draft it opens, and the stale check. Everything reuses the
   tracking furniture (.trk-form/.trk-out/.rank-table); what is here is only the
   two things a clickable list of drafts needs and a result table does not. */
.bw-drafts { margin-top: var(--space-5); }
.bw-drafts .trk-fields .field--narrow input { max-width: 9rem; }

/* The row IS the control — said with the cursor and a hover, since a table that
   opens things and looks exactly like one that does not is a trap. */
.bw-draft-row { cursor: pointer; }
.bw-draft-row:hover td,
.bw-draft-row:focus-within td { background: rgba(255, 255, 255, 0.04); }

.bw-draft { margin-top: var(--space-4); }

.bw-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 500;
}
.bw-check input { width: auto; margin: 0; }

.bw-stale { margin-top: var(--space-4); }

/* ---- Invoicing (admin → Business) ----
   Shares the tracking section's panel furniture (.trk-panel/.trk-form/.trk-out)
   for the same reason Newsletters below does: one form per action of a platform
   service is the same screen twice, and a second set of the same rules under a
   different prefix is a second thing to keep in step. */

.inv-panels { margin-top: var(--space-4); }

/* Reading the ledger and changing it are two halves of this screen and the
   difference is the whole point — one answers a question, the other issues,
   settles or cancels an invoice. The label is the separator; a rule of dividers
   would be louder than the panels. */
.inv-grouphead {
  margin: var(--space-4) 0 0;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.inv-grouphead:first-child { margin-top: 0; }
.inv-grouphead--write { color: var(--color-warn); }

/* Export and paging sit ABOVE the table, not under it: a twenty-five-row page
   is long enough that a Next button at its foot is a scroll away from the rows
   it moves past. */
.inv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.inv-toolbar .field-hint { margin: 0; }

/* The JSON boxes — invoice lines and metadata. Monospaced because a misplaced
   bracket has to be findable, and tall enough that a two-line invoice does not
   have to be written through a slot. */
.inv-code {
  min-height: 6rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ---- Newsletters (admin → Comms) ----
   Shares the tracking section's panel furniture (.trk-panel/.trk-form/.trk-out)
   for the same reason the blog writer does: one form per action of a platform
   service is the same screen twice, and a second set of the same rules under a
   different prefix is a second thing to keep in step. What is here is only what
   a mailing list needs and a chart does not. */

/* The working list is one control for the whole section, so it gets the filter
   bar's treatment — a row above everything it scopes. */
.nl-listbar { margin-top: var(--space-5); }
.nl-listbar .field select,
.nl-listbar .field input { width: 100%; }
/* The two notes belong to the bar, not to whatever follows it — full-basis so
   they wrap onto their own line inside it, above its rule. */
.nl-listbar-note {
  flex: 1 0 100%;
  margin: 0;
  text-align: left;
}

.nl-panels { margin-top: var(--space-4); }

/* Reads and writes are two halves of this screen and the difference is the
   whole point — one answers a question, the other changes a legal record. The
   label is the separator; a rule of dividers would be louder than the panels. */
.nl-grouphead {
  margin: var(--space-4) 0 0;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.nl-grouphead:first-child { margin-top: 0; }
.nl-grouphead--write { color: var(--color-warn); }

/* Export and paging sit ABOVE the table, not under it: a fifty-row page is
   long enough that a Next button at its foot is a scroll away from the rows it
   moves past. */
.nl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.nl-toolbar .field-hint { margin: 0; }

/* A campaign body is written here, not pasted one line at a time. */
.nl-body {
  min-height: 8rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ---- Campaigns: the composer, its confirm step, and the sends history ----
   The only part of this section that is not the generic per-action furniture,
   because a campaign is the only thing here that gets composed rather than
   filled in and `sends` is the only read whose payload earns named columns. */

/* Both halves of the job open on arrival and sit above the generic panels, so
   they read as the section's subject rather than as two of nine forms. */
.nl-campaign,
.nl-sends { border-color: var(--color-border); }

/* THE CONFIRM STEP. Warm-bordered, not danger-bordered: building a campaign is
   consequential and reversible-ish (idempotent on the ref, mails nobody), which
   is a different weight from the suppression this section's dialogs guard. */
.nl-confirm {
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-warn);
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
}
.nl-confirm-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  color: var(--color-warn);
}
.nl-confirm-lede {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.nl-confirm-lede strong { color: var(--color-text); }

/* What is about to happen, as terms and values. Two columns where there is room
   so the values line up and the card can be scanned, one where there is not —
   a summary that has to be read left-to-right on a phone is not a summary. */
.nl-confirm-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
}
.nl-confirm-list dt {
  color: var(--color-text-muted);
  white-space: nowrap;
}
.nl-confirm-list dd {
  margin: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .nl-confirm-list { grid-template-columns: 1fr; gap: 0; }
  .nl-confirm-list dt { margin-top: var(--space-3); }
}

.nl-confirm-warns {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.nl-confirm-warn {
  margin: 0;
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-warn);
  font-size: var(--text-sm);
  color: var(--color-warn);
}

/* What a build answered, called out above the payload. */
.nl-built { color: var(--color-accent); }

/* ---- The delivery breakdown, in a history cell and on a build's answer ---- */

.nl-delivery { min-width: 11rem; }

/* Proportional to the statuses SHOWN. Segments carry a title, and the numbers
   are underneath in words — the bar is the shape of the answer, never the
   answer itself. */
.nl-bar {
  display: flex;
  height: 6px;
  margin-bottom: var(--space-2);
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-bg-inset);
}
.nl-bar-seg { display: block; min-width: 2px; }
.nl-bar-seg[data-tone="ok"] { background: var(--color-accent); }
.nl-bar-seg[data-tone="bad"] { background: var(--color-danger); }
.nl-bar-seg[data-tone="warn"] { background: var(--color-warn); }
.nl-bar-seg[data-tone="idle"] { background: var(--color-border); }

.nl-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
}
.nl-breakdown li {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
}
.nl-breakdown-key { color: var(--color-text-muted); }
.nl-breakdown-num {
  font-family: var(--font-mono);
  color: var(--color-text);
}
.nl-breakdown li[data-tone="ok"] .nl-breakdown-num { color: var(--color-accent); }
.nl-breakdown li[data-tone="bad"] .nl-breakdown-num { color: var(--color-danger); }
.nl-breakdown li[data-tone="warn"] .nl-breakdown-num { color: var(--color-warn); }
.nl-delivery .field-hint { margin: 0; }

/* "No counts on this row" is a real answer about the payload and must not look
   like the caption under a breakdown that does exist. */
.nl-nocounts { font-style: italic; }

/* ---- The sends history table ---- */

.nl-sendtable td { vertical-align: top; }
.nl-sendtable .nl-sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.nl-sendname strong { color: var(--color-text); }

/* The campaign's own status, as the service words it — no vocabulary is
   assumed, only a tone guessed from the word, so an unknown status still
   renders as itself in the neutral colour. */
.nl-pill {
  display: inline-block;
  padding: 0.1rem var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.nl-pill[data-tone="ok"] { border-color: var(--color-accent); color: var(--color-accent); }
.nl-pill[data-tone="bad"] { border-color: var(--color-danger); color: var(--color-danger); }
.nl-pill[data-tone="warn"] { border-color: var(--color-warn); color: var(--color-warn); }

/* ============================================================
   Whale moves — the auto-published article surface
   (whale-moves.html, whale-moves-week.html, and the article
   furniture on signal.html)

   These pages are written for a stranger who arrived from a
   search result, so they read as ARTICLES: a dateline, a fact
   strip, prose at a comfortable measure, and cards that carry a
   real headline rather than a ticker. Everything below is built
   from the same tokens as the rest of the site — no new colors,
   no new spacing steps.
   ============================================================ */

/* The dateline under an article headline: when it was published,
   and by what. */
.wm-dateline {
  margin: calc(var(--space-4) * -1) 0 var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.wm-dateline time { font-variant-numeric: tabular-nums; }

.wm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

/* --- The fact strip ----------------------------------------------------
   Asset, whale footprint, size of the move, timestamp. A description list
   because that is what it is — the label/value pairing survives a screen
   reader and a crawler, which a grid of <span>s would not. */
.wm-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
  padding: var(--space-5);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
@media (max-width: 860px) { .wm-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .wm-facts { grid-template-columns: 1fr; } }

.wm-fact dt {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.wm-fact dd {
  margin: 0;
  color: var(--color-text);
}
.wm-fact-value {
  font-size: var(--text-md);
  line-height: var(--leading-tight);
}
.wm-fact-detail {
  margin-top: var(--space-1) !important;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.wm-mono { font-family: var(--font-mono); }

/* Inside a card the strip is furniture, not the headline act: no panel of
   its own, tighter, and it never competes with the card's title. */
.wm-facts--compact {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.wm-facts--compact .wm-fact-value { font-size: var(--text-base); }
@media (max-width: 480px) { .wm-facts--compact { grid-template-columns: 1fr; } }

/* --- Prose -------------------------------------------------------------- */
.wm-read {
  margin-bottom: var(--space-6);
}
.wm-read h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.wm-read p { max-width: 68ch; }

/* The honest note about vocabulary (footprint vs wallet, move size vs
   position size). Quieter than the article, never hidden. */
.wm-note {
  max-width: 68ch;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- The archive, grouped by week -------------------------------------- */
.wm-week + .wm-week { margin-top: var(--space-8); }

.wm-week-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-5);
}
.wm-week-head h2 {
  font-size: var(--text-lg);
  margin: 0;
}
.wm-week-roundup { font-size: var(--text-sm); }

.wm-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}
@media (max-width: 900px) { .wm-cards { grid-template-columns: 1fr; } }

.wm-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.wm-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.wm-card-title {
  font-size: var(--text-md);
  margin-bottom: var(--space-3);
}
.wm-card-title a { color: var(--color-text); }
.wm-card-title a:hover { color: var(--color-accent); }

.wm-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.wm-chip {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.wm-chip[data-direction="long"] {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
}
.wm-chip[data-direction="short"] {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.5);
}

.wm-card-read {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
/* Pins the "read the full move" link to the bottom of the card, so a short
   write-up and a long one still line up in the grid. */
.wm-card-more {
  margin: auto 0 0;
  padding-top: var(--space-3);
  font-size: var(--text-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* --- The standout move on the weekly roundup --------------------------- */
.wm-standout {
  padding: var(--space-6);
  margin: var(--space-6) 0;
  background: var(--color-bg-inset);
  border: 1px solid rgba(53, 211, 183, 0.35);
  border-radius: var(--radius-lg);
}
.wm-standout h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.wm-standout p { max-width: 68ch; }
@media (max-width: 700px) { .wm-standout { padding: var(--space-5) var(--space-4); } }

/* --- Paging between archive pages and between weeks -------------------- */
.wm-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.wm-pager-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- The account pitch at the foot of an article surface --------------- */
.wm-cta {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.wm-cta h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.wm-cta p {
  max-width: 68ch;
  color: var(--color-text-muted);
}
@media (max-width: 700px) { .wm-cta { padding: var(--space-5) var(--space-4); } }

/* ============================================================
   Whale Watch — the daily email, on the web
   (whale-watch.html, plus the capture band the content
   surfaces carry)

   The issue page is the email's canonical web version, so it
   reads like an email rather than a dashboard: a ranked list of
   three, each one a numbered block with the call sitting where
   an eye lands after the headline. Same tokens as everything
   else — no new colors, no new spacing steps.
   ============================================================ */

.ww-list {
  list-style: none;
  margin: 0 0 var(--space-7);
  padding: 0;
  display: grid;
  gap: var(--space-6);
}

.ww-card {
  padding: var(--space-6);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
@media (max-width: 700px) { .ww-card { padding: var(--space-5) var(--space-4); } }

/* The rank is the thing that makes three signals read as a countdown rather
   than a list — it is decorative, so the number is hidden from the reading
   order and the <ol> carries the real sequence. */
.ww-card-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.ww-rank {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent);
  background: rgba(53, 211, 183, 0.12);
  border: 1px solid rgba(53, 211, 183, 0.35);
}
.ww-card-headtext { min-width: 0; }
.ww-card-title {
  font-size: var(--text-md);
  margin: 0 0 var(--space-3);
}
.ww-card-title a { color: var(--color-text); }
.ww-card-title a:hover { color: var(--color-accent); }
.ww-card .wm-card-badges { margin-bottom: 0; }
.ww-card .wm-card-read { max-width: 68ch; }

/* The teased call. Same block signal.html renders the verdict in, so a reader
   who clicks through meets the words they were just shown — sized down a step
   because here it sits inside a card rather than carrying a page. */
.ww-call {
  margin: var(--space-5) 0 0;
  padding: var(--space-4) var(--space-5);
}
.ww-call p { font-size: var(--text-base); }
.ww-call .sig-locked { margin-top: var(--space-4); }

/* --- Everything else that fired that day -------------------------------- */
.ww-rest { margin-bottom: var(--space-6); }
.ww-rest h2 {
  font-size: var(--text-md);
  margin-bottom: var(--space-3);
}
.ww-rest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  /* A busy day lists hundreds of moves; scroll inside the box rather than
     pushing the rest of the issue off the page. */
  max-height: 900px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-3);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 -12px 12px -12px rgba(0, 0, 0, 0.5);
}
/* Green thumb on a dark gray track. Chrome/Safari get the rounded
   ::-webkit-scrollbar version; Firefox only understands scrollbar-color
   (and Chrome ignores the webkit rules when scrollbar-color is set, so it is
   kept to browsers without them). */
.ww-rest-list::-webkit-scrollbar { width: 10px; }
.ww-rest-list::-webkit-scrollbar-track {
  background: #3a3f47;
  border-radius: 999px;
  margin: var(--space-2) 0;
}
.ww-rest-list::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 999px;
  border: 2px solid #3a3f47;
  min-height: 48px;
}
.ww-rest-list::-webkit-scrollbar-thumb:hover { background: #5fe3cb; }
@supports not selector(::-webkit-scrollbar) {
  .ww-rest-list { scrollbar-width: thin; scrollbar-color: var(--color-accent) #3a3f47; }
}
.ww-rest-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.ww-rest-list a { color: var(--color-text); }
.ww-rest-list a:hover { color: var(--color-accent); }
.ww-rest-meta {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.ww-rest-filter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.ww-rest-filter input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 280px;
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--color-accent);
}
.ww-rest-filter output {
  min-width: 3.5ch;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.ww-rest-list li[hidden] { display: none; }
.ww-rest-empty { font-size: var(--text-sm); color: var(--color-text-muted); }

/* --- The capture band --------------------------------------------------- */
/* Reuses .sig-gate so the daily-email ask and the unlock-the-call ask look
   like one offer from one product, which is what they are. */
.ww-signup { margin-top: var(--space-7); }
.ww-signup .sig-gate-note a { color: var(--color-accent); }

/* On the content surfaces the band is a section of the page rather than the
   climax of an article, so it drops the gate's lift. Vertical rhythm is left
   to its context: inside a page section (the home page) the section's own
   padding is enough; at the foot of an article .ww-signup adds the gap. */
.ww-band { box-shadow: none; }
.ww-band .eyebrow { display: block; margin-bottom: var(--space-2); }
.ww-band h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.ww-band .form-status { text-align: left; }

.ww-forward .form-status {
  text-align: left;
  margin-top: var(--space-3);
  word-break: break-all;
}

/* --- Batch backtests → Parameter sweep ---------------------------------- */
/* One template, many variations. The template is JSON an operator hand-edits,
   so the box is monospace and tall enough to see a nested condition without
   scrolling; everything else reuses the admin table/field furniture. */
.sweep-card { margin-top: var(--space-5); }
.sweep-title {
  font-size: var(--text-md);
  margin-bottom: var(--space-3);
}
.sweep-card .field textarea.sweep-template {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  min-height: 16rem;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
.sweep-card .field-hint code,
.sweep-card > .muted code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.sweep-card .field-hint .btn { margin-left: var(--space-2); }

/* The expand-grid answer: how many variations, and which axes made them.
   Doubles as the per-path error list when the template is rejected, which is
   why the tone lives on the <li> rather than the container. */
.sweep-preview {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.sweep-count {
  margin: 0;
  font-weight: 600;
}
.sweep-axes,
.sweep-failures {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.sweep-axes li,
.sweep-failures li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.sweep-axes code,
.sweep-failures code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
}
.sweep-axes .user-sub,
.sweep-failures .user-sub {
  margin-top: 0;
  white-space: normal;
  flex: 1 1 14rem;
}
.sweep-axes li[data-tone="error"] { color: var(--color-danger); }

#sweep-results { margin-top: var(--space-5); }
#sweep-results .sweep-count { margin-bottom: var(--space-3); }
.sweep-caption {
  caption-side: top;
  text-align: left;
  padding-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.sweep-subtitle {
  font-size: var(--text-base);
  margin: var(--space-4) 0 0;
}


/* ---------------- Per-run archive table (hypothesis detail) ---------------- */
.report-runs .hyp-controls {
  margin: var(--space-4) 0 var(--space-3);
}
.report-runs .rank-table-wrap {
  margin-top: var(--space-2);
}
.report-runs > button {
  margin-top: var(--space-3);
}

/* ---------------- "In Layman's Terms" ---------------- */
.plain-english {
  margin: var(--space-4) 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--color-plain, #f5b942);
  border-radius: 0 var(--radius-md, 10px) var(--radius-md, 10px) 0;
  background: color-mix(in srgb, var(--color-plain, #f5b942) 12%, var(--color-surface, #101827));
}
.plain-english-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-plain, #f5b942);
}
.plain-english p { margin: 0; font-size: var(--text-md); line-height: 1.6; color: var(--color-text, #e6edf6); }
.hyp-plain {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-plain, #f5b942);
  background: color-mix(in srgb, var(--color-plain, #f5b942) 10%, transparent);
  color: var(--color-text, #e6edf6);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Promo codes (admin → Business) — the inline edit row under a code, same
   treatment as the outcome correction row: spans every column, opts out of
   the table's nowrap. The action cell keeps its two buttons on one line. */
.pc-edit-row > td {
  white-space: normal;
  background: var(--color-bg-inset);
  border-top: 0;
}
.pc-edit-form .revenue-toolbar { margin-bottom: var(--space-3); }
.pc-edit-form .field[data-invalid="true"] input,
.pc-edit-form .field[data-invalid="true"] select { border-color: var(--color-danger); }
.pc-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}
.pc-row-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
#pc-create .field[data-invalid="true"] input { border-color: var(--color-danger); }

/* ---- Changelog (admin → Ops) ---- */
/* A day list rather than a table: a row here is a whole backlog item, which is
   a paragraph, and a table column wide enough for it leaves nothing for the
   rest. §A.14 asks for time · kind · slot · text · churn · commit · deploy
   mark, so the head is a chip line and the body is the sentence under it. */

/* Chips reuse .nt-chip (Notifications) — same job, same shape: a count that is
   also the filter. They are narrower here because there are up to eight. */
.cl-chips { margin-bottom: var(--space-4); }
.cl-chip { flex: 0 1 130px; }

.cl-filters .field { min-width: 180px; flex: 0 1 180px; }
.cl-filters .field:nth-child(2) { min-width: 260px; flex: 1 1 260px; }
.cl-filters .field select,
.cl-filters .field input { width: 100%; }

.cl-day + .cl-day { margin-top: var(--space-6); }
.cl-day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}
.cl-day-title { margin: 0; font-size: var(--text-md); }
.cl-day-summary { margin: 0; font-variant-numeric: tabular-nums; }

.cl-changes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cl-change {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}
.cl-change:last-child { border-bottom: 0; }

.cl-change-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}
.cl-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-text-muted);
}
.cl-slot,
.cl-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.cl-label { font-family: var(--font-mono); }

/* Which pipeline landed it. Colour is a hint, never the only signal — the pill
   always spells the kind out. */
.cl-kind[data-kind="phase10"] { border-color: var(--color-accent); }
.cl-kind[data-kind="bug"] { border-color: var(--color-danger); }

/* live / deploy failed / not deployed — three states, three looks. "Not
   deployed" is deliberately quiet: nothing was attempted, nothing is wrong. */
.cl-deploy { margin-left: auto; }
.cl-deploy[data-deployed="yes"] { border-color: var(--color-accent); }
.cl-deploy[data-deployed="no"] { border-color: var(--color-danger); color: var(--color-danger); }
.cl-deploy[data-deployed="unknown"] { opacity: 0.6; }

/* The full backlog item, wrapped as prose — this is what the reader came for. */
.cl-text {
  margin: var(--space-2) 0 var(--space-2);
  white-space: normal;
  overflow-wrap: anywhere;
}

.cl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.cl-churn {
  display: inline-flex;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
}
.cl-plus { color: var(--color-accent); }
.cl-minus { color: var(--color-danger); }

.cl-files-toggle {
  padding: 0;
  font: inherit;
  color: var(--color-accent);
  background: none;
  border: 0;
  border-bottom: 1px dashed currentColor;
  cursor: pointer;
}
.cl-files-plain { color: var(--color-text-muted); }

.cl-commit {
  font-family: var(--font-mono);
  color: var(--color-accent);
}
.cl-commit-plain { color: var(--color-text-muted); }

/* Paths, one per line and monospace: they are identifiers, and a wrapped path
   read as prose is unrecognisable. */
.cl-files {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  max-height: 16rem;
  overflow: auto;
  overflow-wrap: anywhere;
}
.cl-files li + li { margin-top: var(--space-1); }

/* ---------------- "What this bot does" + example-trade charts ----------------
   assets/example-trades.js. The rules box sits above the stats so a reader
   meets the strategy before the statistics; the charts sit under them so the
   numbers have a picture to land on. Win/loss uses the report's existing
   accent/danger pair, and never colour alone — the markers are ▲ and ▼ and the
   tooltip says the sign in words. */
.what-box {
  margin: var(--space-4) 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md, 10px) var(--radius-md, 10px) 0;
  background: var(--color-bg-inset);
}
.what-box-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.what-box-lead {
  margin: 0 0 var(--space-4);
  font-size: var(--text-md);
  line-height: 1.6;
}
.what-box-rules { margin: 0; }
.what-box-rules dt {
  margin-bottom: var(--space-1);
  font-weight: 700;
  color: var(--color-text);
}
.what-box-rules dd { margin: 0 0 var(--space-3); }
.what-box-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.what-box-list li + li { margin-top: var(--space-1); }
.what-box-note,
.what-box-foot {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.what-box-foot { margin-top: var(--space-4); font-style: italic; }

.ex-panel { position: relative; }
.ex-subhead { margin: var(--space-5) 0 var(--space-2); font-size: 1.05rem; }
.ex-loading { color: var(--color-text-muted); font-size: var(--text-sm); }
.ex-figure {
  margin: var(--space-4) 0 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  background: var(--color-bg-inset);
}
.ex-chart { display: block; width: 100%; height: auto; overflow: visible; }
.ex-caption {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
}

.ex-grid { stroke: var(--color-border); stroke-width: 1; }
.ex-baseline { stroke: var(--color-text-muted); stroke-width: 1; stroke-dasharray: 5 4; }
.ex-gap { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 2 5; }
.ex-axis-label { fill: var(--color-text-muted); font-size: 12px; }
.ex-line { fill: none; stroke: var(--color-text-muted); stroke-width: 1.6; stroke-linejoin: round; }
.ex-equity-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.ex-equity-line[data-tone="win"] { stroke: var(--color-accent); }
.ex-equity-line[data-tone="loss"] { stroke: var(--color-danger); }

.ex-band { fill: var(--color-text-muted); opacity: 0.1; }
.ex-band[data-tone="win"] { fill: var(--color-accent); opacity: 0.16; }
.ex-band[data-tone="loss"] { fill: var(--color-danger); opacity: 0.16; }

.ex-marker { cursor: pointer; }
.ex-hit { fill: transparent; }
.ex-glyph,
.ex-dot { fill: var(--color-text-muted); stroke: var(--color-bg-inset); stroke-width: 1; }
.ex-marker[data-tone="win"] .ex-glyph,
.ex-marker[data-tone="win"] .ex-dot { fill: var(--color-accent); }
.ex-marker[data-tone="loss"] .ex-glyph,
.ex-marker[data-tone="loss"] .ex-dot { fill: var(--color-danger); }
.ex-marker:hover .ex-glyph,
.ex-marker:focus .ex-glyph,
.ex-marker:hover .ex-dot,
.ex-marker:focus .ex-dot { stroke: var(--color-text); stroke-width: 1.5; }
.ex-marker:focus { outline: none; }
.ex-marker:focus-visible .ex-hit { stroke: var(--color-accent-strong); stroke-width: 2; }

.ex-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.ex-legend-item { display: inline-flex; align-items: center; gap: var(--space-2); }
.ex-legend-glyph { color: var(--color-text-muted); letter-spacing: -0.08em; }
.ex-legend-item[data-tone="win"] .ex-legend-glyph { color: var(--color-accent); }
.ex-legend-item[data-tone="loss"] .ex-legend-glyph { color: var(--color-danger); }

.ex-tip {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 30ch;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-text-muted);
  border-radius: var(--radius-md, 10px);
  background: var(--color-bg-raised);
  box-shadow: 0 8px 24px rgb(0 0 0 / 45%);
  font-size: var(--text-sm);
  line-height: 1.45;
  pointer-events: none;
}
.ex-tip[data-tone="win"] { border-left-color: var(--color-accent); }
.ex-tip[data-tone="loss"] { border-left-color: var(--color-danger); }
.ex-tip-strong { font-weight: 700; color: var(--color-text); }
.ex-tip-line { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .ex-figure { padding: var(--space-2); }
  .ex-axis-label { font-size: 16px; }
  .ex-caption { font-size: var(--text-xs); }
}

/* ============================================================
   Ticker page (ticker.html) + the site-wide ticker link
   ============================================================ */

/* A stock symbol, wherever it appears, is a link to its ticker page. It has to
   stay legible inside a monospace table cell and inside a sentence, so it is
   marked by weight and a hover underline rather than by colour alone. */
.ticker-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted var(--color-border);
}
.ticker-link:hover,
.ticker-link:focus-visible {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.tk-page .report-back { display: inline-block; margin-bottom: var(--space-4); }
.tk-page h1 { font-family: var(--font-mono); letter-spacing: 0.02em; margin-bottom: 0.25rem; }
.tk-name { margin: 0 0 1rem; color: var(--color-text-muted); font-size: 1.05rem; }
.tk-name strong { color: var(--color-text); font-weight: 600; }

.tk-quote {
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.tk-quote-last {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-4);
}
.tk-quote-price {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
}
.tk-quote-change {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-muted);
}
.tk-quote-change[data-tone="up"] { color: var(--color-accent); }
.tk-quote-change[data-tone="down"] { color: var(--color-danger); }
.tk-quote-meta { margin-top: var(--space-4); }

.tk-block { margin-top: var(--space-7); }
.tk-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.tk-block-head h2 { margin: 0; font-size: var(--text-md); }
.tk-ranges { margin: 0; }
.tk-block-lede {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.tk-empty {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  padding: var(--space-5);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  margin: 0;
}

.tk-figure { margin: 0; }
.tk-figure[aria-busy="true"] { opacity: 0.5; }
.tk-price-line { stroke: var(--color-accent); }
.tk-print-dot { fill: var(--color-warn); stroke: var(--color-bg-inset); stroke-width: 1; }
.tk-print:hover .tk-print-dot,
.tk-print:focus .tk-print-dot { stroke: var(--color-text); stroke-width: 1.5; }
.ex-legend-item[data-tone="print"] .ex-legend-glyph { color: var(--color-warn); }
.tk-legend { margin-top: var(--space-2); }

/* EV-per-trade bars, one row per hypothesis measured on this symbol. The track
   is split at the centre only when something negative has to be shown; with an
   all-positive set a centre zero would waste half the width. */
.tk-evbars { margin-bottom: var(--space-5); }
.tk-evbar-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.tk-evbar {
  display: grid;
  grid-template-columns: minmax(8rem, 18rem) 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
}
.tk-evbar-label {
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-evbar-label:hover { color: var(--color-accent); }
.tk-evbar-track {
  position: relative;
  height: 14px;
  background: var(--color-bg-inset);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tk-evbar-track[data-zero="center"]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}
.tk-evbar-fill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
}
.tk-evbar-track[data-zero="left"] .tk-evbar-fill { left: 0; }
.tk-evbar-track[data-zero="center"] .tk-evbar-fill { left: 50%; }
.tk-evbar[data-tone="loss"] .tk-evbar-fill {
  background: var(--color-danger);
  left: auto;
  right: 50%;
}
.tk-evbar[data-tone="loss"] .tk-evbar-track[data-zero="left"] .tk-evbar-fill { right: auto; left: 0; }
.tk-evbar-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.tk-evbar[data-tone="win"] .tk-evbar-value { color: var(--color-accent); }
.tk-evbar[data-tone="loss"] .tk-evbar-value { color: var(--color-danger); }

.tk-signals { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.tk-signal {
  padding: var(--space-4);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius-md);
}
.tk-signal[data-status="active"] { border-left-color: var(--color-accent); }
.tk-signal[data-status="triggered"] { border-left-color: var(--color-warn); }
.tk-signal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.tk-signal-title { color: var(--color-text); font-weight: 600; text-decoration: none; }
.tk-signal-title:hover { color: var(--color-accent); }
.tk-signal-meta { margin-top: var(--space-3); }

@media (max-width: 640px) {
  .tk-evbar { grid-template-columns: 1fr auto; }
  .tk-evbar-track { grid-column: 1 / -1; }
}

/* The ticker link as a badge — used where the symbol cannot be the heading
   because the heading is already a link (a signal card, a signal page). */
a.hyp-badge--ticker {
  font-family: var(--font-mono);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-bottom-color: var(--color-border);
  color: var(--color-text);
}
a.hyp-badge--ticker:hover,
a.hyp-badge--ticker:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---- alerts.html subscribe panel ---------------------------------------
   Sits above the public alert feed: what to follow, and what you already
   follow, in one card. Shares the raised-card treatment the onboarding
   checklist uses so the two read as the same kind of "your account" block. */
.sub-panel {
  background: var(--color-bg-raised);
  border: 1px solid rgba(53, 211, 183, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-raised);
}
@media (max-width: 700px) { .sub-panel { padding: var(--space-5) var(--space-4); } }
.sub-panel h2 { margin: 0 0 var(--space-3); font-size: var(--text-lg); }
.sub-out p { margin: 0 0 var(--space-4); color: var(--color-text-muted); }
.sub-out-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.sub-kinds { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.sub-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}
.sub-row .field { margin-bottom: 0; }
.sub-value { min-width: 12rem; flex: 1 1 12rem; }
.sub-delivery { min-width: 11rem; flex: 0 1 11rem; }
.sub-submit { flex: none; }
.sub-form .field-hint { margin-top: var(--space-3); }
.sub-form .hyp-status { margin: var(--space-2) 0 0; }

.sub-list-title {
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--text-base);
}
.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
}
.sub-item-main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.sub-item-name { font-weight: 600; }
.sub-item-meta { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------------- Member paper trading (assets/paper-trading.js) ----------
   trading.html's "Your paper trading" panel and strategy.html's arm button.
   The empty state has to teach and act in the same breath, so the explainer
   box reads like prose and the strategy rows underneath reuse .acct-row — the
   member already knows that row from their account page. Once armed, a book is
   stats, then the curve, then the positions, in that order: the number first,
   the shape of it second, the detail last. */
.pt-explain {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--color-bg-inset);
  max-width: 72ch;
}
.pt-explain-lead {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg, 1.1rem);
  font-weight: 700;
}
.pt-explain-steps {
  margin: 0;
  padding-left: 1.3em;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.pt-explain-steps li + li { margin-top: var(--space-2); }
.pt-explain-foot {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.pt-picker { margin-top: var(--space-5); }
.pt-picker h3 { margin: 0 0 var(--space-2); }
.pt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
}
.pt-inline { margin: 0; max-width: 72ch; }
.pt-empty-line {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
}
.pt-note {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-warn);
  background: var(--color-bg-inset);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  max-width: 72ch;
}
.pt-book {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
}
.pt-book-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.pt-book-head h3 { margin: 0; }
.pt-book-sub {
  margin: var(--space-2) 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.pt-slot { margin-top: var(--space-5); }

/* A strategy card that can hold the Run-as-paper-portfolio form: the row's own
   line keeps its flex layout, the form drops underneath it at full width. */
.acct-row--stack { flex-direction: column; align-items: stretch; }
.acct-row-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.acct-row--stack .pt-slot:empty { margin-top: 0; }

/* The risk envelope the member states before the book is created. Every field
   carries its own hint, because "position size %" means nothing without
   "share of the book each position takes". */
.pt-form {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
}
.pt-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}
.pt-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.pt-field--wide { grid-column: 1 / -1; }
.pt-field input { width: 100%; }
.pt-field-hint {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.pt-form .pt-toggle { margin-top: var(--space-4); }
.pt-form .pt-actions { margin-top: var(--space-4); }

.pt-more { margin-top: var(--space-5); }
.pt-more summary { cursor: pointer; font-weight: 600; }

/* The equity curve. Two lines on one y scale so the GAP is the message: the
   book solid, SPY dashed — shape as well as colour, so it survives a
   colour-blind reader and a black-and-white print. */
.pt-chart { margin: 0; }
.pt-chart svg { display: block; width: 100%; height: auto; }
.pt-chart-grid { stroke: var(--color-border); stroke-width: 1; }
.pt-chart-zero { stroke: var(--color-text-muted); stroke-width: 1; }
.pt-chart-axis {
  fill: var(--color-text-muted);
  font-size: 11px;
  font-family: inherit;
}
.pt-chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pt-chart-line--book { stroke: var(--color-accent); }
.pt-chart-line--spy { stroke: var(--color-text-muted); stroke-dasharray: 5 4; stroke-width: 1.5; }
.pt-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.pt-key::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 0;
  margin-right: 6px;
  vertical-align: middle;
  border-top: 2px solid currentColor;
}
.pt-key--book { color: var(--color-accent); }
.pt-key--spy::before { border-top-style: dashed; }
.pt-key--excess::before { content: none; }
.pt-chart-empty { margin: 0; color: var(--color-text-muted); }

.pt-positions { overflow-x: auto; }
.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.pt-table th,
.pt-table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.pt-table th {
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-xs, 0.75rem);
}
.pt-num { font-variant-numeric: tabular-nums; }
.pt-table td[data-sign="pos"] { color: var(--color-accent); }
.pt-table td[data-sign="neg"] { color: var(--color-danger); }

/* ---- the owner's publish panel on portfolio.html ------------------------
   Sits above the record itself: rename the book, publish it, and take the
   exact profile link to share. The copy row is an input rather than plain
   text so the link is selectable even when the clipboard API is refused. */
.pt-publish {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
}
.pt-publish h3 { margin: 0; }
.pt-publish + .hyp-badges, .pt-publish + .pt-fill-note { margin-top: var(--space-4); }
.pt-publish-lede {
  margin: var(--space-2) 0 var(--space-4);
  max-width: 72ch;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.pt-publish-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.pt-publish-row label { margin: 0; }
.pt-publish-row input[type="text"] { flex: 1 1 260px; min-width: 0; }
.pt-publish-row--toggle { margin-top: var(--space-4); }
.pt-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.pt-toggle input { margin: 0; }
.pt-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.pt-copy-input { flex: 1 1 280px; min-width: 0; }
/* Share panel (published book): link + <iframe> embed, each with a Copy. */
.pt-share { margin-top: var(--space-4); }
.pt-share label { display: block; font-weight: 600; font-size: var(--text-sm); }
.pt-share .pt-share-label { margin-top: var(--space-4); }
.pt-embed-input {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--text-sm);
  resize: vertical;
}
.pt-publish-note {
  margin: var(--space-3) 0 0;
  max-width: 72ch;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.pt-publish .form-status { text-align: left; }

/* Follow a published book (portfolio.html?id=, non-owner): the button, its
   status line, and the sign-up nudge for signed-out readers. */
.pt-follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-4);
}
.pt-follow .form-status { margin: 0; text-align: left; }
.pt-follow-note {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---- portfolio-trade alerts on alerts.html ------------------------------
 * A trade alert is a record of a fill in the member's own paper portfolio,
 * not a scored research detection, so it reads differently in the feed: an
 * accent 'Trade' badge and a tinted left edge mark it at a glance.
 * --------------------------------------------------------------------- */
.hyp-badge--trade {
  color: var(--color-accent);
  border-color: rgba(53, 211, 183, 0.5);
  background: rgba(53, 211, 183, 0.12);
  text-transform: none;
  letter-spacing: 0.02em;
}
.alert-item--trade {
  border-left: 3px solid rgba(53, 211, 183, 0.6);
}
.hyp-filter--trade[aria-pressed="true"] {
  border-color: var(--color-accent);
}

/* Winners chip — the validated + best-evidence + 30-trade view in one control.
   Kept visually ahead of the plain status chips because it is the page's
   default state and the thing a visitor came for. */
.hyp-filter--winners { margin-right: var(--space-2); border-color: var(--color-accent); color: var(--color-text); }
.hyp-winners-hint { margin: calc(-1 * var(--space-2)) 0 var(--space-3); font-size: 0.85rem; color: var(--color-text-muted); }

/* The verdict split under each card's meta row: "P passed / F failed of R runs
   across S symbols". Deliberately quiet — it is context for the headline EV,
   not a second headline. */
.hyp-counts {
  margin: calc(var(--space-2) * -1) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Live status panel (hypothesis.html) — the Live/Not live badge sits on the
   heading baseline rather than under it, so the answer reads in one glance. */
.report-live-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.report-live-head h2 { margin-bottom: 0; }
.report-live .rank-table-wrap { margin-top: var(--space-3); }

/* Logged-out gate on hypothesis.html / hypotheses.html. Reuses the published
   signal page's gate card (.sig-gate) — same promise, same shape — with a row
   of real buttons instead of the signal page's inline email form. */
.hyp-gate { margin-top: var(--space-6); }
.hyp-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* ------------- Runs chart (hypothesis detail, assets/runs-chart.js) -------------
   Same visual language as the trade chart above it (.tc-*): a bordered inset
   panel, one grid row per item, a label column left and a value column right.
   The difference is the axis — here it is a shared EV scale, so the zero line
   moves with the data instead of sitting at 50%. */
.report-runs-chart .hyp-controls {
  margin: var(--space-4) 0 var(--space-3);
}
.hyp-control--check {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  align-self: flex-end;
  padding-bottom: var(--space-2);
}
.hyp-control--check input { padding: 0; }

.rc-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.rc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.rc-legend-swatch {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: var(--color-text-muted);
}
.rc-legend-item.is-passed .rc-legend-swatch { background: var(--color-accent); }
.rc-legend-item.is-failed .rc-legend-swatch { background: var(--color-danger); }
.rc-legend-note { flex: 1 1 14rem; opacity: 0.85; }

.rc-chart {
  margin-top: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
  overflow: hidden;
}

.rc-head,
.rc-row {
  display: grid;
  grid-template-columns: 76px 1fr 64px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
}

.rc-head {
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rc-head-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  text-transform: none;
  letter-spacing: 0;
}
.rc-head-zero { opacity: 0.7; }
.rc-head-trades { text-align: right; }

.rc-row + .rc-row { border-top: 1px solid rgba(34, 48, 74, 0.5); }
.rc-row:hover { background: rgba(53, 211, 183, 0.04); }

.rc-symbol {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The track is the plotting area; the zero line is drawn where 0% falls on the
   shared scale, not at a fixed midpoint. */
.rc-track {
  position: relative;
  height: 20px;
}
.rc-zero {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-text-muted);
  opacity: 0.55;
}
.rc-bar {
  position: absolute;
  top: 6px;
  height: 8px;
  min-width: 2px;
  border-radius: 3px;
  background: var(--color-text-muted);
  opacity: 0.55;
}
.rc-mark {
  position: absolute;
  top: 2px;
  height: 16px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--color-text-muted);
}
.rc-row.is-passed .rc-bar,
.rc-row.is-passed .rc-mark { background: var(--color-accent); }
.rc-row.is-failed .rc-bar,
.rc-row.is-failed .rc-mark { background: var(--color-danger); }
.rc-row.is-passed .rc-mark,
.rc-row.is-failed .rc-mark { opacity: 1; }

.rc-trades {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .rc-head,
  .rc-row { grid-template-columns: 58px 1fr 48px; padding: var(--space-2); }
}

/* ------- Expected vs realized (hypothesis detail, assets/expected-realized.js)
   Reuses the .rc-* chart grid above: the two panels are the same chart family,
   one per run and one per evidence source. Only the label column widens — the
   rows are named "Backtest" and "Realized", not four-letter tickers. */
.report-expected-realized .rc-head,
.report-expected-realized .rc-row { grid-template-columns: 96px 1fr 64px; }
.report-expected-realized .rc-symbol {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.er-empty { margin-top: var(--space-3); }

@media (max-width: 600px) {
  .report-expected-realized .rc-head,
  .report-expected-realized .rc-row { grid-template-columns: 76px 1fr 48px; }
}

/* ---- the shared line chart (assets/line-chart.js) ----
   Used by macro.html (futures, FX, yields, Fed funds + VIX, correlations) and
   by the Market context panel on hypothesis.html, so the shell lives here. */
.lc {
  padding: var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.lc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.lc-title { margin: 0; font-size: var(--text-base); }
.lc-ranges { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; }
.lc-range {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 4px var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.lc-range:hover { border-color: var(--color-accent); }
.lc-range[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-ink);
}
.lc-legend {
  margin: var(--space-3) 0 0;
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.lc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.lc-plot { position: relative; margin: var(--space-3) 0 0; }
.lc-plot svg { display: block; width: 100%; height: 260px; overflow: visible; }
.lc-grid { stroke: var(--color-border); stroke-width: 1; opacity: 0.6; }
.lc-axis-line { stroke: var(--color-border); stroke-width: 1; }
.lc-zero { stroke: var(--color-danger); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.7; }
.lc-axis { fill: var(--color-text-muted); font-size: 11px; font-family: inherit; }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* The inverted-curve fill: the line's own colour, faint enough that the
   gridlines and the other lines still read through it. */
.lc-below-zero { stroke: none; opacity: 0.22; }
.lc-axis--y2 { opacity: 0.85; }
.lc-hover-line { stroke: var(--color-text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.lc-hit { cursor: crosshair; }
.lc-readout {
  position: absolute;
  top: var(--space-2);
  pointer-events: none;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.lc-readout[data-side="right"] { right: auto; left: var(--space-3); }
.lc-readout[data-side="left"] { left: auto; right: var(--space-3); }
.lc-readout[hidden] { display: none; }
.lc-readout-date { display: block; color: var(--color-text-muted); }
.lc-readout-row { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.lc-readout-value { font-weight: 700; }
.lc-readout-swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lc-state { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.lc-state[hidden] { display: none; }
.lc-state[data-tone="error"] { color: var(--color-danger); }

/* Event markers: dated ticks over the series (trade entry dates on the Market
   context panel). Dashed like the hover line but in the accent colour, with a
   solid flag at the baseline so a cluster stays countable. */
.lc-marker { stroke: var(--color-warning, #f2b84b); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.55; }
.lc-marker-flag { fill: var(--color-warning, #f2b84b); opacity: 0.85; }
.lc-legend-marker {
  width: 0; height: 0; display: inline-block;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid var(--color-warning, #f2b84b);
}
.lc-readout-marker { display: block; margin-top: 2px; color: var(--color-warning, #f2b84b); font-weight: 700; }

/* Market context (assets/market-context.js) — the macro series a hypothesis's
   rules gate on, drawn with the shared .lc-* line chart above. */
.report-market-context .market-context-plot { margin-top: var(--space-4); }
.report-market-context .market-context-note,
.report-market-context .market-context-state {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* How it does in different markets (hypothesis detail, assets/regime-breakdown.js)
   One block per macro regime; inside it a wrapping grid of bucket boxes (never
   a wide table, so nothing scrolls sideways on a phone). Best / worst reuse
   the runs-chart accent / danger pair; a thin bucket is muted, not hidden. */
.report-regimes .rg-headline {
  font-weight: 600;
  margin-top: var(--space-3);
}
.rg-empty { color: var(--color-text-muted); }
.rg-list {
  margin-top: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-inset);
  overflow: hidden;
}
.rg-regime { padding: var(--space-3) var(--space-4); }
.rg-regime + .rg-regime { border-top: 1px solid rgba(34, 48, 74, 0.5); }
.rg-regime-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin-bottom: var(--space-2);
}
.rg-regime-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
}
.rg-regime-source {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.rg-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--space-2);
}
.rg-bucket {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-raised);
}
.rg-bucket-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.rg-bucket-value {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}
.rg-bucket-value[data-sign="pos"] { color: var(--color-accent); }
.rg-bucket-value[data-sign="neg"] { color: var(--color-danger); }
.rg-bucket-trades {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.rg-bucket.is-thin { opacity: 0.5; border-style: dashed; }
.rg-bucket.is-thin .rg-bucket-value { color: var(--color-text-muted); font-weight: 400; }
.rg-bucket.is-best {
  border-color: var(--color-accent);
  background: rgba(53, 211, 183, 0.08);
}
.rg-bucket.is-worst {
  border-color: var(--color-danger);
  background: rgba(242, 125, 114, 0.08);
}
/* Its own line above the label (was absolutely positioned, which sat on top
   of longer labels such as "Stressed (above 25)"). */
.rg-bucket-tag {
  order: -1;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rg-bucket.is-best .rg-bucket-tag { color: var(--color-accent); }
.rg-bucket.is-worst .rg-bucket-tag { color: var(--color-danger); }
.rg-regime-summary {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  max-width: 80ch;
}
.rg-regime-note {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
@media (max-width: 600px) {
  .rg-regime { padding: var(--space-3); }
  .rg-buckets { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--space-1); }
  .rg-bucket { padding: var(--space-2); }
  .rg-bucket-value { font-size: var(--text-sm); }
  .rg-bucket-tag { position: static; order: -1; }
}

/* ============================================================
   Account → Settings → Webhooks (list, add form, one-time secret reveal)
   ============================================================ */
.wh-panel { margin-top: var(--space-4); }
.wh-panel code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}
.wh-list { margin-top: var(--space-4); }
.wh-table { min-width: 640px; }
.wh-table .wh-url-cell {
  white-space: normal;
  word-break: break-all;
  max-width: 360px;
}
.wh-table td code + code { margin-left: var(--space-1); }
.wh-form {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  max-width: 560px;
}
.wh-form h4 { margin-bottom: var(--space-3); }
.wh-events {
  margin: 0 0 var(--space-3);
  padding: 0;
  border: 0;
}
.wh-events legend {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}
.wh-events .field { margin-bottom: var(--space-2); }
.wh-reveal {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-warn);
  border-radius: var(--radius-md);
}
.wh-reveal-title { font-weight: 600; color: var(--color-warn); margin: 0 0 var(--space-1); }
.wh-reveal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.wh-secret {
  flex: 1 1 280px;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  word-break: break-all;
  user-select: all;
}
.wh-panel .form-status { text-align: left; }
.wh-panel .form-status:empty { display: none; }

/* Webhooks: per-row actions, Send test feedback, inline edit form */
.wh-table { min-width: 820px; }
.wh-table .wh-url-cell { min-width: 200px; }
.wh-actions-cell { white-space: nowrap; }
.wh-actions-cell .acct-row-actions { gap: var(--space-2); flex-wrap: nowrap; }
.wh-row-status {
  margin: var(--space-2) 0 0;
  max-width: 280px;
  white-space: normal;
  font-size: var(--text-xs);
}
.wh-edit-row > td { background: var(--color-bg-inset); }
.wh-edit {
  max-width: 560px;
  padding: var(--space-3) 0;
  white-space: normal;
}
.wh-edit .acct-row-actions { margin-top: var(--space-2); }
.wh-edit-status { margin-top: var(--space-2); }

/* ============================================================
   api.html — code samples in the API reference
   ============================================================ */
.api-doc code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}
.api-doc pre.api-code {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.5;
}
.api-doc pre.api-code code {
  font-size: var(--text-sm);
  white-space: pre;
}

/* Generate with Opus: emphasis / mechanism toggles (reuse .hyp-filter pills) */
.admin-opus-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
.ai-gen { margin-bottom: var(--space-6); }
.ai-gen h2 { margin-bottom: var(--space-2); }
.ai-gen #ai-gen-options { margin-top: var(--space-3); }
.ai-gen-or { font-size: var(--text-lg); margin: var(--space-5) 0 var(--space-3); }

/* Signed-in account with no plan (assets/app.js showPlanBanner) */
.plan-banner { background: var(--color-surface-2, rgba(45, 212, 191, 0.08)); border-bottom: 1px solid var(--color-border); padding: var(--space-3) 0; font-size: var(--text-sm); }
.plan-banner .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* Home "What's inside" feature cards (index.html #features) */
.feat-grid { margin-top: var(--space-6); }
.feat-card { display: flex; flex-direction: column; gap: var(--space-3); position: relative; }
.feat-card h3 { margin: 0; }
.feat-card p { margin: 0; flex: 1; }
.feat-badge { align-self: flex-start; font-size: var(--text-xs, 0.75rem); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--color-border); color: var(--color-text-muted); }
.feat-badge[data-tone="free"] { color: var(--color-accent); border-color: var(--color-accent); }
.feat-badge[data-tone="wallet"] { color: var(--color-warn, #f5b942); border-color: var(--color-warn, #f5b942); }
.feat-visual { min-height: 84px; display: flex; align-items: center; padding: var(--space-3); border-radius: var(--radius-md, 10px); background: rgba(45, 212, 191, 0.06); border: 1px solid var(--color-border); }
.feat-link { font-weight: 600; font-size: var(--text-sm); }
.feat-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 4px; font-size: var(--text-sm); }
.feat-list li { display: flex; align-items: center; gap: var(--space-2); }
.feat-list i { height: 8px; border-radius: 4px; background: var(--color-accent); opacity: .8; }
.feat-bars { display: flex; align-items: flex-end; gap: 6px; height: 60px; width: 100%; }
.feat-bars i { flex: 1; background: var(--color-border); border-radius: 3px 3px 0 0; }
.feat-bars i[data-on] { background: var(--color-accent); }
.feat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.feat-tiles span { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 6px; border: 1px solid var(--color-border); font-size: var(--text-xs, 0.75rem); color: var(--color-text-muted); }
.feat-tiles small { font-weight: 700; color: var(--color-text); }
.feat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.feat-pill { font-size: var(--text-xs, 0.75rem); font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--color-border); color: var(--color-text-muted); }
.feat-pill[data-on] { background: var(--color-accent); border-color: var(--color-accent); color: #04211d; }
.feat-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); width: 100%; text-align: center; }
.feat-stats b { display: block; font-size: var(--text-lg); color: var(--color-accent); }
.feat-stats small { color: var(--color-text-muted); font-size: var(--text-xs, 0.75rem); }
.feat-spark { width: 100%; height: 60px; color: var(--color-accent); }

/* Free-look ad + meter bar on hypothesis.html (assets/preview-ad.js) */
.preview-ad { margin: var(--space-6) 0; padding: var(--space-6); border-radius: var(--radius-lg); border: 1px solid var(--color-accent); background: linear-gradient(160deg, rgba(45, 212, 191, 0.12), rgba(45, 212, 191, 0.02) 60%); }
.preview-ad[data-tone="locked"] { border-color: var(--color-warn); background: linear-gradient(160deg, rgba(242, 184, 75, 0.12), rgba(242, 184, 75, 0.02) 60%); }
.preview-ad-meter { display: flex; gap: 6px; margin-bottom: var(--space-3); }
.preview-ad-meter span { width: 28px; height: 6px; border-radius: 3px; background: var(--color-border); }
.preview-ad-meter span[data-used] { background: var(--color-accent); }
.preview-ad[data-tone="locked"] .preview-ad-meter span[data-used] { background: var(--color-warn); }
.preview-ad-title { margin: 0 0 var(--space-2); font-size: var(--text-xl, 1.5rem); }
.preview-ad-sub { margin: 0 0 var(--space-3); color: var(--color-text-muted); }
.preview-ad-hook { margin: 0 0 var(--space-2); font-size: 1.15rem; font-weight: 600; color: var(--color-text); }
.preview-ad-proof { margin: 0 0 var(--space-4); color: var(--color-text-muted); }
.preview-ad-list { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; gap: var(--space-2); }
.preview-ad-list li { padding-left: 1.6em; position: relative; }
.preview-ad-list li::before { content: "\2713"; position: absolute; left: 0; color: var(--color-accent); font-weight: 700; }
.preview-ad-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.preview-ad-price { font-size: var(--text-sm); color: var(--color-text-muted); }
.report-section--locked { position: relative; }
.report-section--locked h2::after { content: " \1F512"; font-size: 0.8em; }
.preview-bar { position: fixed; left: 50%; bottom: var(--space-4); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: var(--space-3); max-width: calc(100vw - 32px); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: 999px; border: 1px solid var(--color-accent); background: var(--color-surface, #0f1729); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); font-size: var(--text-sm); }
.preview-bar-close { background: none; border: 0; color: var(--color-text-muted); font-size: 1.3rem; line-height: 1; padding: 0 var(--space-2); cursor: pointer; }
@media (max-width: 560px) {
  .preview-bar { left: 8px; right: 8px; transform: none; max-width: none; bottom: 8px; border-radius: var(--radius-md); gap: var(--space-2); padding: 6px 6px 6px 12px; font-size: var(--text-xs); }
  .preview-bar-text { flex: 1; min-width: 0; }
  .preview-bar .btn { white-space: nowrap; padding: 6px 10px; }
  .preview-bar-close { padding: 0 4px; }
}

/* --- Signed-in dashboard sidebar (html.dash + buildSidebar in app.js) ------ */
:root { --dash-side-w: 232px; }
.dash-side { display: none; }
@media (min-width: 1001px) {
  html.dash .site-header { display: none; }
  html.dash body { padding-left: var(--dash-side-w); }
  html.dash .dash-side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: var(--dash-side-w); padding: var(--space-4) var(--space-3);
    background: var(--color-bg-raised); border-right: 1px solid var(--color-border); overflow-y: auto;
  }
}
/* Sidebar scroll (Brett 10/7): the house scrollbar — green thumb on a dark
   gray track, same recipe as .ww-rest-list. */
.dash-side::-webkit-scrollbar { width: 8px; }
.dash-side::-webkit-scrollbar-track { background: #3a3f47; border-radius: 999px; margin: var(--space-2) 0; }
.dash-side::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 999px;
  border: 2px solid #3a3f47;
  min-height: 48px;
}
.dash-side::-webkit-scrollbar-thumb:hover { background: #5fe3cb; }
@supports not selector(::-webkit-scrollbar) {
  .dash-side { scrollbar-width: thin; scrollbar-color: var(--color-accent) #3a3f47; }
}
.dash-side__brand { display: block; padding: var(--space-2) var(--space-3) var(--space-5); }
.dash-side__brand img { height: 32px; width: auto; display: block; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.dash-nav__link {
  display: block; padding: 8px var(--space-3); border-radius: var(--radius-md);
  color: var(--color-text-muted); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.dash-nav__link:hover { background: var(--color-bg-inset); color: var(--color-text); }
.dash-nav__link[aria-current="page"] { background: rgba(53, 211, 183, 0.12); color: var(--color-accent-strong); font-weight: 600; }
.dash-nav__sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 var(--space-3) var(--space-4); padding-left: var(--space-3); border-left: 1px solid var(--color-border); }
.dash-nav__sub[hidden] { display: none; }
.dash-nav__sublink { display: block; padding: 4px var(--space-3); border-radius: var(--radius-sm); color: var(--color-text-muted); text-decoration: none; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-nav__sublink:hover { background: var(--color-bg-inset); color: var(--color-text); }
.dash-nav__sublink[aria-current="location"] { color: var(--color-accent-strong); font-weight: 600; }
.dash-side__foot { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-5); padding: var(--space-4) var(--space-3) 0; border-top: 1px solid var(--color-border); }
.dash-side__who { color: var(--color-text); font-weight: 600; font-size: 0.9rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-side__foot .dash-nav__link { padding-inline: 0; }
.dash-side__foot .dash-nav__link[hidden] { display: none; }
.dash-side__logout { width: 100%; }

/* ============================================================
   Account → Settings → API keys (list; reuses the webhooks panel shell)
   ============================================================ */
.ak-table { min-width: 720px; }
.ak-table tr.ak-revoked td { color: var(--color-text-muted); }

/* ---------------- Share dialog (assets/share.js) ---------------- */
.report-share-row { margin: var(--space-3) 0 var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.report-share-row #report-paper:empty, .report-share-row .star-toggle[hidden] { display: none; }
.report-share-row .star-toggle.is-on { color: var(--color-warn); border-color: var(--color-warn); }
#report-paper-form:not(:empty) { margin: 0 0 var(--space-4); padding: 1rem 1.15rem; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); }
/* By sector and industry starts small (Brett 10/27): extra rows + long copy fold away. */
#report-sectors .sec-more { display: none; }
#report-sectors.is-open .sec-more { display: revert; }
#report-sectors .sec-toggle { margin-top: .5rem; }
.share-dialog {
  width: min(92vw, 480px);
  padding: var(--space-5);
  background: var(--color-bg-raised);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
}
.share-dialog::backdrop { background: rgba(3, 8, 18, 0.7); }
.share-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.share-dialog-head h2 { font-size: var(--text-md); margin: 0; }
.share-close { background: none; border: 0; color: var(--color-text-muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 var(--space-1); }
.share-close:hover { color: var(--color-text); }
.share-link { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.share-url {
  flex: 1; min-width: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-inset);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
.share-targets { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
.share-target { justify-content: center; }

/* scorecard.html — the fixed "shown even when it's bad" note under the as_of line. */
.sc-note { margin: var(--space-4) 0 var(--space-5); }

/* scorecard.html — expected (backtest, sky) vs realized (paper trades, accent)
   bar pairs per mechanism; whiskers and the zero rule reuse the mech-* marks. */
.sc-bar[data-series="expected"] { fill: var(--color-sky); }
.sc-bar[data-series="realized"] { fill: var(--color-accent); }
.sc-swatch[data-series="expected"] { background: var(--color-sky); }
.sc-swatch[data-series="realized"] { background: var(--color-accent); }
.sc-row-rule { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 2 4; }

/* scorecard.html — validated-hypothesis table and 12-month realized mean bars.
   Thin months (under min_outcomes) are drawn faded so they don't read as a score. */
.sc-block { margin-top: var(--space-6); }
.sc-block h2 { margin-bottom: var(--space-2); }
#sc-hyp-note { display: block; margin: 0 0 var(--space-3); }
.sc-hyp-table { min-width: 760px; }
.sc-mech-cell { text-transform: capitalize; color: var(--color-text-muted); }
.sc-month-bar[data-thin="true"] { opacity: 0.35; }
.sc-swatch[data-sign="pos"] { background: var(--color-accent); }
.sc-swatch[data-sign="neg"] { background: var(--color-danger); }
.sc-swatch[data-thin="true"] { background: var(--color-accent); opacity: 0.35; }

/* Sweep progress bars on the Jobs screen: one track per granularity. */
.sweep-panel { margin: var(--space-4) 0 var(--space-5); }
.sweep-panel[hidden] { display: none; }
.sweep-panel__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.sweep-panel__head h3 { margin: 0; }
.sweep-panel__mode,
.sweep-panel__state {
  padding: 1px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.sweep-panel__mode[data-sweep-mode="forced"] { color: var(--color-warn); border-color: rgba(242, 184, 75, 0.5); }
.sweep-panel__state[data-state="running"] { color: var(--color-accent); border-color: var(--color-accent); }
.sweep-panel__bars { display: grid; gap: var(--space-4); margin-top: var(--space-3); }
.sweep-bar__head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}
.sweep-bar__count { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.sweep-bar--active .admin-progress-fill { background: var(--color-warn); }
.sweep-bar__meta { margin: var(--space-2) 0 0; }

/* Sweep idle / stalled. Idle swaps the bars for the last-finished line; a
   running record the API flags as stalled turns the panel and badge red. */
.sweep-panel__bars[hidden],
.sweep-panel__mode[hidden],
.sweep-panel__alert[hidden] { display: none; }
.sweep-panel__state[data-state="failed"] { color: var(--color-danger); border-color: rgba(242, 125, 114, 0.5); }
.sweep-panel__state[data-state="stalled"] {
  color: #fff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}
.sweep-panel[data-state="stalled"] {
  border-color: var(--color-danger);
  box-shadow: inset 3px 0 0 var(--color-danger);
}
.sweep-panel__alert {
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-danger);
  background: rgba(242, 125, 114, 0.1);
  border: 1px solid rgba(242, 125, 114, 0.4);
  border-radius: var(--radius-sm, 6px);
}
.sweep-panel[data-state="stalled"] .admin-progress-fill { background: var(--color-danger); }
.admin-sweep-badge[data-stalled="true"] {
  color: var(--color-danger);
  border-color: rgba(242, 125, 114, 0.6);
  background: rgba(242, 125, 114, 0.12);
}
.admin-sweep-badge[data-stalled="true"]:hover { border-color: var(--color-danger); }
.admin-sweep-badge[data-stalled="true"] .admin-sweep-badge__dot { animation: none; }

/* ---- ticker page: Chatter panel (assets/chatter-chart.js) ----
   Weekly stacked columns in the trade-timeline chart box (.tc-chart). One
   colour per source, shared by segments, legend, summary and popup. */
[data-source="cnbc"] { --tk-src: var(--color-accent); }
[data-source="reddit"] { --tk-src: var(--color-sky); }
[data-source="x"] { --tk-src: var(--color-warn); }
[data-source="wsj"] { --tk-src: #b9a3f5; }
.tl-summary-value[data-source],
.tc-popup-label[data-source],
.ex-legend-item[data-source] .ex-legend-glyph { color: var(--tk-src); }

.tk-chatter-chart { margin-top: 0; }
.tk-chatter-head {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tk-chatter-plot {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 200px;
  padding: var(--space-3) var(--space-4) 0;
}
.tk-chatter-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--color-border);
}
.tk-chatter-bar {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  background: transparent;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.tk-chatter-bar:disabled { cursor: default; }
.tk-chatter-bar:not(:disabled):hover { filter: brightness(1.25); }
.tk-chatter-bar:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.tk-chatter-seg { display: block; width: 100%; background: var(--tk-src); }
.tk-chatter-axis {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
}
.tk-chatter-note,
.tk-chatter-coverage {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: var(--space-3) 0 0;
}
.tk-chatter-coverage { font-family: var(--font-mono); font-size: var(--text-xs); margin-top: var(--space-1); }
@media (max-width: 640px) {
  .tk-chatter-plot { gap: 1px; height: 160px; padding: var(--space-2) var(--space-2) 0; }
}

/* Surge days: a ring on the week's bar, a diamond above it, a floating
   headline tip on hover/focus and a headline link in the week popup. */
.tk-chatter-col { position: relative; }
/* Headroom so the busiest week's diamond clears the axis head. */
.tk-chatter-plot { padding-top: var(--space-5); }
/* Weekly price range laid over the mention bars (own scale). */
.tk-chatter-wick {
  position: absolute;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--color-accent);
  border-radius: 1px;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 0 0 1px var(--color-bg);
}
.tk-chatter-wick[data-dir="down"] { background: var(--color-danger); }
.tk-chatter-wick-close {
  position: absolute;
  left: 0;
  width: 7px;
  height: 2px;
  margin-bottom: -1px;
  background: inherit;
  box-shadow: 0 0 0 1px var(--color-bg);
}
.tk-chatter-wick-glyph { color: var(--color-accent); }
.tk-chatter-bar { opacity: 0.8; }
.tk-chatter-bar--surge { box-shadow: 0 0 0 1px var(--color-danger); }
.tk-chatter-surge-mark {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  line-height: 1;
  color: var(--color-danger);
  pointer-events: none;
}
.tk-legend-surge .ex-legend-glyph { color: var(--color-danger); }
.tk-chatter-tip {
  position: fixed;
  z-index: 1000;
  max-width: min(320px, calc(100vw - 16px));
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-raised);
  box-shadow: var(--shadow-raised);
  font-size: var(--text-sm);
  pointer-events: none;
}
.tk-chatter-tip[hidden] { display: none; }
.tk-chatter-tip-item + .tk-chatter-tip-item { margin-top: var(--space-2); }
.tk-chatter-tip-meta {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-danger);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tk-chatter-tip-title { display: block; color: var(--color-text); }
.tk-chatter-popup-surge {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}
.tk-chatter-popup-headline { display: block; margin-top: var(--space-1); font-size: var(--text-sm); }

/* Tone strip under the chatter columns + the tone meter in the week popup
   (assets/chatter-chart.js). Red = bad news for the stock, green = good. */
.tk-tone-strip {
  display: flex;
  gap: 2px;
  padding: 3px var(--space-4) 0;
}
.tk-tone-cell {
  flex: 1 1 0;
  min-width: 0;
  height: 12px;
  border-radius: 2px;
  background: transparent;
}
.tk-tone-cell[data-step="0"] { background: color-mix(in srgb, var(--color-text-muted) 30%, transparent); }
.tk-tone-cell[data-step="1"] { background: color-mix(in srgb, var(--color-accent) 50%, transparent); }
.tk-tone-cell[data-step="2"] { background: color-mix(in srgb, var(--color-accent) 80%, transparent); }
.tk-tone-cell[data-step="3"] { background: var(--color-accent); }
.tk-tone-cell[data-step="-1"] { background: color-mix(in srgb, var(--color-danger) 50%, transparent); }
.tk-tone-cell[data-step="-2"] { background: color-mix(in srgb, var(--color-danger) 80%, transparent); }
.tk-tone-cell[data-step="-3"] { background: var(--color-danger); }
.tk-tone-swatch {
  display: inline-block;
  width: 28px;
  height: 8px;
  border-radius: 2px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--color-danger), color-mix(in srgb, var(--color-text-muted) 40%, transparent), var(--color-accent));
}
.tk-tone-popup {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}
.tk-tone-meter {
  position: relative;
  height: 8px;
  margin: var(--space-2) 0 2px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-danger), color-mix(in srgb, var(--color-text-muted) 40%, transparent) 50%, var(--color-accent));
}
.tk-tone-meter-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-text);
  box-shadow: 0 0 0 2px var(--color-bg-raised);
}
.tk-tone-meter-ends {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.tk-tone-headline { margin-top: var(--space-2); font-size: var(--text-sm); }
.tk-tone-headline-dot { margin-right: 4px; font-size: 10px; }
.tk-tone-headline[data-tone="pos"] .tk-tone-headline-dot { color: var(--color-accent); }
.tk-tone-headline[data-tone="neg"] .tk-tone-headline-dot { color: var(--color-danger); }
.tk-tone-headline-meta { color: var(--color-text-muted); font-size: var(--text-xs); }
@media (max-width: 640px) {
  .tk-tone-strip { gap: 1px; padding: 3px var(--space-2) 0; }
}

/* A named marker (housing.html's 2006 peak / 2012 bottom) prints its name at
   the top of its tick. */
.lc-marker-label { fill: var(--color-warning, #f2b84b); font-size: 11px; font-weight: 700; font-family: inherit; }

/* Whalur House paper wallet (trading.html top, assets/house-wallet.js). Tables
   reuse .rank-table inside .rank-table-wrap — the wrap scrolls, never the page. */
.house-wallet .hw-tabs { margin-top: var(--space-5); }
.hw-meta { color: var(--color-text-muted); font-size: var(--text-sm); margin: 0 0 var(--space-4); }
.hw-meta strong { color: var(--color-text); }
.hw-h3 { margin: var(--space-6) 0 var(--space-3); }
.hw-table { min-width: 720px; }
.hw-table td { vertical-align: top; }
.hw-sub { display: block; font-size: var(--text-xs); color: var(--color-text-muted); white-space: normal; }
.hw-table td.hw-symbol a { font-family: var(--font-mono); font-weight: 600; }
.hw-table td.hw-symbol .hw-sub { max-width: 12rem; }
.hw-table td.hw-signal { white-space: normal; min-width: 14rem; max-width: 22rem; }
.hw-table td.hw-result { white-space: normal; min-width: 11rem; }
.hw-table td[data-sign="pos"] .rank-mono { color: var(--color-accent); }
.hw-table td[data-sign="neg"] .rank-mono { color: var(--color-danger); }
.hw-action {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.hw-action[data-kind="exit"] { color: var(--color-text-muted); }
.hw-note { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-2); }
.hw-foot { margin-top: var(--space-5); font-weight: 600; }
.hw-foot .hw-sub { font-weight: 400; margin-top: var(--space-1); }
.hw-tabs[hidden] { display: none; }
.hw-table td.rank-num .hw-sub { white-space: nowrap; }
@media (max-width: 700px) {
  .report-stats.hw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .hw-stats .report-stat { padding: var(--space-3); }
  .hw-stats .report-stat-value { font-size: var(--text-base); letter-spacing: -0.03em; }
}

/* House wallets list (trading.html, 10/7): one card per wallet — name, its
   rule in one line, "View portfolio". No numbers here; details are on
   portfolio.html. */
.hw-grid {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}
.hw-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  min-width: 0;
}
.hw-card-title { margin: 0; font-size: var(--text-md); }
.hw-card-rule { margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); flex: 1 1 auto; }
.hw-card-btn { align-self: flex-start; margin-top: auto; }
/* The Premium + Wallet upsell (trading.html / portfolio.html on a 402). */
.hw-upsell { margin-top: var(--space-5); max-width: 760px; }
.hw-upsell h3 { margin: var(--space-2) 0 var(--space-3); }
.hw-upsell-list { margin: 0 0 var(--space-4); padding-left: 1.2em; }
.hw-upsell-list li { margin-bottom: var(--space-1); }
.hw-upsell .btn { margin-top: var(--space-3); }

/* House wallet: follow row (portfolio.html). */
.hw-follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg-raised);
}
.hw-follow-lede { margin: 0; flex: 1 1 260px; color: var(--color-text-muted); font-size: var(--text-sm); }
.hw-follow .pt-follow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.hw-follow .form-status { margin: 0; }

/* House wallet cards for members below Premium + Wallet: same card, marked. */
.hw-card--locked { position: relative; }
.hw-card-lock {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: var(--space-2);
  padding: 2px 8px;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  color: var(--color-accent);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}

/* Dashboard: Your wallets upgrade card (account.html#wallets). */
.acct-wallet-upsell { max-width: 640px; }
.acct-wallet-upsell h3 { margin: var(--space-2) 0; }
.acct-wallet-upsell .btn { margin-top: var(--space-3); }

/* Housing page: the nightly AI read — four bubbles (assets/housing-brief.js). */
.hb { margin: var(--space-5) 0 var(--space-6); }
.hb-head { margin-bottom: var(--space-4); }
.hb-h2 { margin: 0 0 var(--space-1); }
.hb-meta { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.hb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 760px) { .hb-grid { grid-template-columns: 1fr; } }
.hb-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: 16px;
  min-width: 0;
}
.hb-kicker { color: var(--color-accent); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.hb-title { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.hb-score { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.hb-score-n { font-family: var(--font-mono); font-size: 3rem; font-weight: 700; line-height: 1; }
.hb-score-of { color: var(--color-text-muted); }
.hb-delta { margin-left: auto; font-size: var(--text-sm); color: var(--color-text-muted); }
.hb-delta--up { color: var(--color-danger); }
.hb-delta--down { color: var(--color-accent); }
.hb-gauge { margin: var(--space-1) 0; }
.hb-gauge-track {
  position: relative; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, #2bb673 0%, #d6c84a 30%, #f0a03c 55%, #e5533d 80%, #b3261e 100%);
}
.hb-gauge--split .hb-gauge-track { background: linear-gradient(90deg, #e5533d 0%, #3a3f47 50%, #35d3b7 100%); }
.hb-gauge-mark {
  position: absolute; top: 50%; width: 16px; height: 16px; margin-left: -8px; transform: translateY(-50%);
  border-radius: 50%; background: var(--color-text); border: 3px solid var(--color-bg-raised);
  box-shadow: 0 0 0 1px var(--color-border);
}
.hb-gauge-labels { display: flex; justify-content: space-between; margin-top: 4px; color: var(--color-text-muted); font-size: 11px; }
.hb-label { margin: 0; font-weight: 600; }
.hb-sub { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.hb-text { margin: 0; color: var(--color-text); font-size: var(--text-sm); line-height: 1.55; }
.hb-watch { margin: 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--color-accent); background: var(--color-bg-inset); border-radius: 0 8px 8px 0; font-size: var(--text-sm); line-height: 1.5; }
.hb-more summary { cursor: pointer; color: var(--color-accent); font-size: var(--text-sm); font-weight: 600; }
.hb-more[open] summary { margin-bottom: var(--space-2); }
.hb-drivers, .hb-ideas { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.hb-driver { font-size: var(--text-sm); line-height: 1.45; color: var(--color-text-muted); }
.hb-driver strong { color: var(--color-text); }
.hb-driver--up strong { color: #f0a03c; }
.hb-driver--down strong { color: var(--color-accent); }
.hb-idea { display: grid; gap: 2px; padding: var(--space-2) 0; border-top: 1px solid var(--color-border); font-size: var(--text-sm); line-height: 1.45; }
.hb-idea:first-child { border-top: 0; padding-top: 0; }
.hb-idea-why { color: var(--color-text-muted); }
.hb-idea-risk { color: var(--color-text-muted); }
.hb-idea-risk em { color: #f0a03c; font-style: normal; font-weight: 600; }
.hb > .hb-more { margin-top: var(--space-3); }

/* ======================================================================
   PITCH SECTIONS (assets/pitch-sections.js) — the machine flow, kill-rate
   funnel, idea meters, house wallets and moat cards. Built for the private
   investors.html (Brett 10/7) and written as standalone components so the
   public homepage can reuse them at launch. Investor-page-only rules are
   prefixed .inv-.
   ====================================================================== */

/* -- 5-stage machine: horizontal on desktop, vertical on phone -- */
.pitch-flow {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-5);
  counter-reset: none;
}
.pitch-stage {
  position: relative;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  min-width: 0;
}
.pitch-stage:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 46px;
  right: calc(-1 * var(--space-5) + 4px);
  width: calc(var(--space-5) - 8px);
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
}
.pitch-stage:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 42px;
  right: calc(-1 * var(--space-5) + 2px);
  border: 5px solid transparent;
  border-left-color: var(--color-accent);
}
.pitch-stage__head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pitch-stage__icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(53, 211, 183, 0.12);
  color: var(--color-accent-strong);
}
.pitch-stage__step {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.pitch-stage h3 { width: 100%; margin: var(--space-3) 0 0; font-size: var(--text-md); }
.pitch-stage__big {
  margin: var(--space-4) 0 0;
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--color-accent-strong);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.pitch-stage__biglabel { margin: var(--space-1) 0 var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted); }
.pitch-stage__lines {
  list-style: none;
  margin: 0;
  padding: var(--space-3) 0 0;
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--color-text-muted);
}
.pitch-stage__lines strong { color: var(--color-text); font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) {
  .pitch-flow { grid-template-columns: 1fr; gap: var(--space-6); }
  .pitch-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: var(--space-5); }
  .pitch-stage__head, .pitch-stage__big, .pitch-stage__biglabel { grid-column: 1; }
  .pitch-stage__lines { grid-column: 2; grid-row: 1 / span 3; border-top: 0; border-left: 1px solid var(--color-border); padding: 0 0 0 var(--space-4); align-content: center; font-size: var(--text-sm); }
  .pitch-stage:not(:last-child)::after {
    top: auto; right: auto; left: 50%;
    bottom: calc(-1 * var(--space-6) + 4px);
    width: 2px; height: calc(var(--space-6) - 8px);
    background: linear-gradient(180deg, var(--color-accent), transparent);
  }
  .pitch-stage:not(:last-child)::before { display: none; }
}
@media (max-width: 640px) {
  .pitch-stage { display: block; }
  .pitch-stage__lines { border-left: 0; border-top: 1px solid var(--color-border); padding: var(--space-3) 0 0; font-size: var(--text-xs); }
}

/* -- kill rate funnel -- */
.pitch-kill { margin-top: var(--space-6); }
.pitch-kill__headline { display: flex; align-items: baseline; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-6); }
.pitch-kill__headline p { margin: 0; max-width: 46ch; font-size: var(--text-md); color: var(--color-text-muted); }
.pitch-kill__headline strong { color: var(--color-text); }
.pitch-kill__big {
  font-size: clamp(3.4rem, 9vw, 6rem) !important;
  font-weight: 800;
  line-height: 1 !important;
  color: var(--color-accent) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.pitch-funnel { display: grid; gap: var(--space-4); }
.pitch-funnel__row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 6.5rem; gap: var(--space-4); align-items: center; }
.pitch-funnel__label span { display: block; font-weight: 600; }
.pitch-funnel__label small { display: block; color: var(--color-text-muted); font-size: var(--text-xs); line-height: 1.35; }
.pitch-funnel__track { height: 18px; border-radius: var(--radius-full); background: var(--color-bg-inset); border: 1px solid var(--color-border); overflow: hidden; }
.pitch-funnel__bar { display: block; height: 100%; border-radius: var(--radius-full); background: rgba(159, 176, 200, 0.45); }
.pitch-funnel__row.is-final .pitch-funnel__bar { background: var(--color-accent); box-shadow: 0 0 12px rgba(53, 211, 183, 0.6); }
.pitch-funnel__num { text-align: right; font-size: var(--text-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.pitch-funnel__row.is-final .pitch-funnel__num { color: var(--color-accent-strong); }
.pitch-kill__block { margin: var(--space-5) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.pitch-kill__block strong { color: var(--color-text); }
@media (max-width: 640px) {
  .pitch-funnel__row { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); }
  .pitch-funnel__track { grid-column: 1 / -1; grid-row: 2; }
  .pitch-funnel__num { grid-column: 2; grid-row: 1; }
}

/* -- best ideas with Confidence / Potential meters -- */
.pitch-ideas { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.pitch-idea { background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.pitch-idea__name { margin: 0; font-weight: 600; line-height: 1.4; }
.pitch-tag { align-self: flex-start; font-size: var(--text-xs); padding: 2px var(--space-2); border-radius: var(--radius-full); background: rgba(53, 211, 183, 0.12); color: var(--color-accent-strong); }
.pitch-tag--sky { background: rgba(127, 214, 247, 0.12); color: var(--color-sky-strong); }
.pitch-idea__meters { display: grid; gap: var(--space-2); margin-top: auto; }
.pitch-meter { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 2.2rem; gap: var(--space-3); align-items: center; font-size: var(--text-sm); }
.pitch-meter__label { color: var(--color-text-muted); }
.pitch-meter__track { height: 8px; border-radius: var(--radius-full); background: var(--color-bg-inset); overflow: hidden; }
.pitch-meter__fill { display: block; height: 100%; border-radius: inherit; background: var(--color-accent); }
.pitch-meter[data-kind="p"] .pitch-meter__fill { background: var(--color-sky); }
.pitch-meter__num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* -- house wallets -- */
.pitch-wallets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--space-4); margin-top: var(--space-5); }
.pitch-wallet { background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.pitch-wallet h3 { margin: 0 0 var(--space-1); font-size: var(--text-md); }
.pitch-wallet__desc { font-size: var(--text-sm); color: var(--color-text-muted); min-height: 2.8em; }
.pitch-wallet__nums { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: 0; }
.pitch-wallet__nums dt { font-size: var(--text-xs); color: var(--color-text-muted); }
.pitch-wallet__nums dd { margin: 0; font-size: var(--text-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.pitch-wallet__nums dd[data-tone="up"] { color: var(--color-accent-strong); }
.pitch-wallet__nums dd[data-tone="down"] { color: var(--color-danger); }

/* -- moat -- */
.pitch-moat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--space-4); margin-top: var(--space-5); }
.pitch-moat__card { background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.pitch-moat__n { font-family: var(--font-mono); color: var(--color-accent); font-size: var(--text-sm); }
.pitch-moat__card h3 { margin: var(--space-2) 0 var(--space-3); font-size: var(--text-md); }
.pitch-moat__card p { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.6; }

/* -- investor page only -- */
.inv-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.inv-confidential { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-warn); border: 1px solid rgba(242, 184, 75, 0.4); border-radius: var(--radius-full); padding: 4px var(--space-3); white-space: nowrap; }
.inv-state { padding-block: var(--space-9); min-height: 50vh; }
.inv-hero { padding-block: var(--space-8) var(--space-8); }
.inv-hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.1; max-width: 22ch; letter-spacing: -0.01em; }
.inv-stealth { display: inline-flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 var(--space-6); padding: var(--space-2) var(--space-4); border-radius: var(--radius-full); background: rgba(242, 184, 75, 0.1); border: 1px solid rgba(242, 184, 75, 0.35); color: var(--color-warn); font-weight: 600; font-size: var(--text-sm); }
.inv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-warn); box-shadow: 0 0 0 4px rgba(242, 184, 75, 0.2); flex: none; }
.inv-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); max-width: 820px; }
.inv-hero-stats div { background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.inv-hero-stats strong { display: block; font-size: clamp(1.6rem, 4.5vw, 2.6rem); line-height: 1.1; color: var(--color-accent-strong); font-variant-numeric: tabular-nums; }
.inv-hero-stats span { font-size: var(--text-sm); color: var(--color-text-muted); }
.inv-asof { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }
.inv-note { margin-top: var(--space-5); font-size: var(--text-sm); color: var(--color-text-muted); }
.inv-callout { margin: var(--space-4) 0 0; padding: var(--space-4) var(--space-5); border-left: 3px solid var(--color-warn); background: rgba(242, 184, 75, 0.07); border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--color-text-muted); max-width: 75ch; }
.inv-callout strong { color: var(--color-warn); }
.inv-narrow { max-width: 820px; }
.pitch-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--space-4); margin: var(--space-5) 0 0; }
.pitch-terms div { background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.pitch-terms dt { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); }
.pitch-terms dd { margin: var(--space-1) 0 0; font-size: var(--text-lg); font-weight: 700; overflow-wrap: anywhere; }
.pitch-tiernote { margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: rgba(53, 211, 183, 0.08); border: 1px solid rgba(53, 211, 183, 0.3); color: var(--color-accent-strong); }
.pitch-termcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--space-6); margin-top: var(--space-6); }
.pitch-termlist h3 { font-size: var(--text-base); margin-bottom: var(--space-3); }
.pitch-termlist ul { margin: 0; padding-left: 1.1rem; color: var(--color-text-muted); display: grid; gap: var(--space-2); }
.pitch-team { list-style: none; padding-left: 0 !important; }
.pitch-team strong { display: block; color: var(--color-text); }
.pitch-team span { font-size: var(--text-sm); }
.pitch-ph { color: var(--color-warn); font-style: italic; font-weight: 500; font-size: 0.85em; }
.inv-preview-bar { margin: 0; padding: var(--space-2) var(--space-4); text-align: center; background: rgba(242, 184, 75, 0.15); color: var(--color-warn); font-size: var(--text-sm); }
.inv-cta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7); align-items: start; }
.inv-cta-buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-5) 0 var(--space-3); }
.inv-small { font-size: var(--text-sm); }
.inv-small[data-tone="error"] { color: var(--color-danger); }
.inv-form-card { background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.inv-form-card h3 { margin-top: 0; }
.inv-form-card form { display: grid; gap: var(--space-4); }
.inv-form-card label { display: grid; gap: var(--space-1); font-size: var(--text-sm); font-weight: 600; }
.inv-form-card input, .inv-form-card select, .inv-form-card textarea { width: 100%; font-weight: 400; }
.inv-footer .container { display: block; }
.inv-footer p { max-width: 90ch; }
/* NDA gate (10/8): the agreement in a scroll box, then the signing form. */
.inv-nda { margin-top: var(--space-6); max-width: 860px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-bg-raised); overflow: hidden; }
.inv-nda-head { margin: 0; padding: var(--space-3) var(--space-5); font-size: var(--text-base); border-bottom: 1px solid var(--color-border); background: var(--color-bg-inset); }
.inv-nda-text { max-height: min(60vh, 520px); overflow-y: auto; padding: var(--space-4) var(--space-5); font-size: var(--text-sm); line-height: 1.6; overscroll-behavior: contain; }
.inv-nda-text p { margin: 0 0 var(--space-3); max-width: none; }
.inv-nda-text h3 { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-sm); }
.inv-nda-text:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.inv-nda-hint { margin: 0; padding: var(--space-2) var(--space-5); font-size: var(--text-xs); color: var(--color-warn); border-top: 1px solid var(--color-border); }
.inv-nda-hint[data-done="true"] { color: var(--color-accent-strong); }
.inv-nda-form { max-width: 860px; margin-top: var(--space-6); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); }
.inv-nda-wide { grid-column: 1 / -1; }
.inv-nda-sig { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: var(--text-lg) !important; }
.inv-nda-agree { display: flex; align-items: flex-start; gap: var(--space-2); margin-bottom: var(--space-4); font-weight: 600; font-size: var(--text-sm); }
.inv-nda-agree input { margin-top: 3px; flex: none; }
#inv-nda-status[data-tone="error"] { color: var(--color-danger); }
@media (max-width: 760px) {
  .inv-nda-form { grid-template-columns: 1fr; }
  .inv-nda-text, .inv-nda-head, .inv-nda-hint { padding-inline: var(--space-4); }
  .inv-cta { grid-template-columns: 1fr; gap: var(--space-6); }
  .inv-hero-stats { grid-template-columns: 1fr; }
  .inv-body .section { padding-block: var(--space-8); }
}

/* Investor demo banner (assets/app.js, when the session is the read-only demo account). */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-2) var(--space-4); background: rgba(242, 184, 75, 0.14); border-bottom: 1px solid rgba(242, 184, 75, 0.4); color: var(--color-warn); font-size: var(--text-sm); text-align: center; }
.demo-bar strong { color: var(--color-warn); }
.inv-header { position: static; }

/* Investor kill-rate block leads with what was found (10/7); the 'set aside' share is the sub-line. */
.pitch-kill__headline .pitch-kill__sub { flex-basis: 100%; max-width: 70ch; font-size: var(--text-sm); }

/* Admin menu: 10px above each section heading so groups read as groups (Brett 10/7). */
.admin-nav-group + .admin-nav-group { margin-top: 10px; }

/* "≈ 10× the S&P over the same 5 days" chip beside every per-trade number (Brett 10/8). */
.vs-sp { display: inline-block; margin-left: .4em; padding: .1em .55em; border-radius: 999px; font-size: .82em; font-weight: 600; line-height: 1.5; white-space: nowrap; color: var(--color-accent); background: rgba(53, 211, 183, .12); text-decoration: none; vertical-align: baseline; }
.vs-sp::after { content: " ⓘ"; opacity: .7; font-weight: 400; }
.vs-sp:hover, .vs-sp:focus-visible { background: rgba(53, 211, 183, .22); text-decoration: none; }
.hypothesis-vs-sp { flex-basis: 100%; width: 100%; list-style: none; font-size: .9em; color: var(--color-text-muted, #9fb0c8); }
.report-stat-link { display: block; margin-top: .35rem; font-size: .8rem; color: var(--color-accent); }
/* "What it could earn" — Potential spelled out (Brett 10/8). */
.report-earn { margin: 1.25rem 0 1rem; padding: 1rem 1.15rem; border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent); border-radius: 12px; background: var(--color-bg-raised); }
.report-earn .report-stats-heading { margin-top: 0; }
.report-earn-list { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: .55rem 1rem; margin: 0; }
.report-earn-list dt { font-weight: 600; color: var(--color-text); }
.report-earn-list dd { margin: 0; color: var(--color-text-muted); }
@media (max-width: 640px) { .report-earn-list { grid-template-columns: minmax(0, 1fr); } .report-earn-list dd { margin-bottom: .4rem; } }
.report-earn { scroll-margin-top: 90px; }
.report-stat-detail--alt { display: block; margin-top: .3rem; color: var(--color-text); font-weight: 600; }
.report-stat-detail--warn { display: block; margin-top: .3rem; color: var(--color-warning, #f5b84a); font-weight: 600; }
/* Low band = red (Brett 10/8: "7/100 should be red, but it's green") — the
   high/mid bands had colours, low fell back to the default accent. */
.hyp-meta .hyp-mono[data-band="low"] { color: var(--color-danger); }
.report-confidence[data-band="low"] { color: var(--color-danger); border-color: rgba(255, 107, 107, 0.5); }

/* Orange band 20-39 (Brett 10/8): red <20, orange 20-39, yellow 40-59, green 60+. */
.hyp-meta .hyp-mono[data-band="lowmid"] { color: var(--color-orange, #f5934b); }
.report-confidence[data-band="lowmid"] { color: var(--color-orange, #f5934b); border-color: rgba(245, 147, 75, 0.5); }
/* Collapse meter: how widespread the worsening is across states (Brett 10/8). */
.hb-breadth { margin: .25rem 0 .5rem; padding: .65rem .8rem; border: 1px solid var(--color-border); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.hb-breadth-head { margin: 0 0 .35rem; font-weight: 600; font-size: var(--text-sm); }
.hb-breadth-list { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: 0; padding: 0; list-style: none; font-size: var(--text-xs, .8rem); color: var(--color-text-muted); }
.hb-breadth-list .hb-breadth-bad { color: var(--color-warn); }
.hb-breadth-note { margin: .4rem 0 0; font-size: var(--text-xs, .8rem); color: var(--color-text-muted); }
.hs-lev-trend { margin: .25rem 0 .75rem; padding: .55rem .75rem; border-left: 3px solid var(--color-warn); background: rgba(242, 184, 75, .08); border-radius: 6px; font-size: var(--text-sm); }

/* ---------------- Phone verification (app.js phoneVerifier, Brett 10/8) ----------------
   Inline on auth.html sign-up, and inside .phone-dialog everywhere else. The
   number/code row keeps the button beside the input until the phone is too
   narrow, then stacks it full width. */
.phone-verify label { display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); }
.phone-verify .pv-row { display: flex; gap: var(--space-2); align-items: stretch; }
.phone-verify .pv-row input,
.field .phone-verify .pv-row input { flex: 1 1 auto; width: auto; min-width: 0; }
.phone-verify .pv-row .btn { flex: 0 0 auto; white-space: nowrap; }
.phone-verify .pv-code { font-family: var(--font-mono); font-size: var(--text-md, 1.15rem); letter-spacing: 0.3em; }
.phone-verify .pv-hint,
.phone-verify .pv-links { margin: var(--space-2) 0 0; font-size: var(--text-xs, 0.8rem); color: var(--color-text-muted); }
.phone-verify .pv-link { background: none; border: 0; padding: 0; font: inherit; color: var(--color-accent); cursor: pointer; text-decoration: underline; }
.phone-verify .pv-link:disabled { color: var(--color-text-muted); cursor: default; text-decoration: none; }
.phone-verify .pv-done { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--color-accent); border-radius: var(--radius-md); background: rgba(53, 211, 183, 0.08); font-size: var(--text-sm); }
.phone-verify .pv-check { color: var(--color-accent); font-weight: 700; }
.phone-verify .pv-status { text-align: left; margin-top: var(--space-2); }
.phone-verify .pv-status:empty { display: none; }
.phone-dialog .pv-lede { margin: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted); }
.phone-banner .phone-banner__actions { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; }
.phone-current { font-size: var(--text-sm); margin: var(--space-2) 0 var(--space-3); }
.phone-current[data-verified="true"] { color: var(--color-accent); }
@media (max-width: 420px) {
  .phone-verify .pv-row { flex-direction: column; }
  .phone-verify .pv-row .btn { width: 100%; justify-content: center; }
}

/* WOW unlock box (assets/wow-unlock.js) — blocks.html, hypothesis.html, wows.html. */
.wow-buy { margin: .8rem 0 .2rem; padding: .9rem 1rem; border: 1px solid var(--color-accent); border-radius: 10px; background: rgba(53, 211, 183, .06); color: var(--color-text); }
.wow-buy p { margin: 0 0 .6rem; }
.wow-price { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wow-confirm { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--color-border); }
.wow-confirm label { display: flex; gap: .6rem; align-items: flex-start; line-height: 1.5; cursor: pointer; }
.wow-confirm input { margin-top: .3rem; flex: none; }
.wow-badge { display: inline-block; padding: .1rem .5rem; border: 1px solid var(--color-accent); border-radius: 999px; color: var(--color-accent-strong); background: rgba(53, 211, 183, .12); font-size: var(--text-xs, .75rem); font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
.report-wow { margin: var(--space-4, 1rem) 0; padding: 1rem 1.1rem; border: 1px solid var(--color-accent); border-radius: 12px; background: rgba(53, 211, 183, .05); }
.report-wow p { margin: 0 0 .6rem; }

/* Per-symbol verdict explainer (assets/hypothesis-runs.js, Brett 10/19) */
.verdict-has-pop { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.verdict-has-pop:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.verdict-pop { position: absolute; z-index: 50; padding: var(--space-3) var(--space-4); background: var(--color-bg-inset); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-raised); font-size: var(--text-sm); line-height: 1.5; color: var(--color-text-muted); }
.verdict-pop strong { display: block; margin-bottom: var(--space-1); color: var(--color-text); }
.verdict-pop p { margin: 0; }

/* Run ledger timeline slider (assets/hypothesis-runs.js, Brett 10/19) */
.runs-timeline { margin: 0 0 var(--space-5); max-width: 760px; }
.runs-timeline-head { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-2); }
.runs-timeline-label { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); }
.runs-timeline-text { font-size: var(--text-sm); color: var(--color-text); }
.runs-timeline-reset { margin-left: auto; background: none; border: 0; padding: 0; font-size: var(--text-xs); color: var(--color-accent); cursor: pointer; }
.runs-timeline-track { position: relative; height: 28px; }
.runs-timeline-track::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--color-border); }
.runs-timeline-fill { position: absolute; top: 12px; height: 4px; border-radius: 2px; background: var(--color-accent); }
.runs-timeline-track input[type="range"] { position: absolute; left: 0; top: 0; width: 100%; height: 28px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.runs-timeline-track input[type="range"]::-webkit-slider-runnable-track { background: none; border: 0; }
.runs-timeline-track input[type="range"]::-moz-range-track { background: none; border: 0; }
.runs-timeline-track input[type="range"]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 18px; height: 18px; margin-top: 0; border-radius: 50%; background: var(--color-accent); border: 2px solid var(--color-bg, #0b1220); cursor: grab; }
.runs-timeline-track input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--color-accent); border: 2px solid var(--color-bg, #0b1220); cursor: grab; }
.runs-timeline-track input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--color-text); }
.runs-timeline-scale { position: relative; height: 16px; font-size: var(--text-xs); color: var(--color-text-muted); }
.runs-timeline-scale span { position: absolute; transform: translateX(-50%); }
.runs-timeline-scale span:first-child { transform: none; }
.runs-timeline-summary { margin-top: var(--space-2); }

/* Loading whale (assets/app.js + assets/whale-loader.svg, Brett 10/19) */
.whalur-loading::after { content: ""; display: block; width: min(320px, 100%); aspect-ratio: 5 / 2; margin-top: var(--space-3); background: url("whale-loader.svg") center / contain no-repeat; }
/* centred messages keep the whale centred under them */
[style*="text-align: center"] .whalur-loading::after, .whalur-loading[style*="text-align: center"]::after { margin-left: auto; margin-right: auto; }

/* Wallet P&L (Brett 10/27): the tile's jump to the open positions, and the
   unrealised total in the "What it holds now" heading. */
.pt-tile-link { display: inline-block; margin-top: .35rem; font-size: var(--text-xs); }
.hw-h3-sub { font-weight: 500; font-size: .85em; color: var(--color-text-muted); }
.hw-h3-sub[data-sign="pos"] { color: var(--color-accent); }
.hw-h3-sub[data-sign="neg"] { color: var(--color-danger); }
[id^="wallet-holdings-"] { scroll-margin-top: 90px; }

/* Dashboard "Important for you to know now" + bell (Brett 10/27, assets/briefing.js). */
.now-lede { margin: 0 0 var(--space-4); color: var(--color-text-muted); }
.now-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 1100px) { .now-grid { grid-template-columns: minmax(0, 1fr); } }
/* Market conditions banner + admin panel (Brett 11/6, read-only). */
.now-market { margin: 0 0 var(--space-4); padding: .85rem 1.1rem; border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent); border-radius: 12px; background: var(--color-bg-raised); min-width: 0; }
.now-market[data-level="watch"] { border-left-color: var(--color-warn); }
.now-market[data-level="shock"] { border-left-color: var(--color-danger); }
.now-market__top { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.now-market__badge { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .5rem; border-radius: 999px; background: var(--color-bg-inset); color: var(--color-text-muted); }
.now-market[data-level="watch"] .now-market__badge { color: var(--color-warn); }
.now-market[data-level="shock"] .now-market__badge { color: var(--color-danger); }
.now-market__headline { overflow-wrap: anywhere; }
.now-market__lines { margin: .5rem 0 0; padding-left: 1.1rem; font-size: var(--text-sm); display: grid; gap: .2rem; }
.now-market__lines--wallets { padding-top: .45rem; border-top: 1px solid var(--color-border); }
.now-market__note { margin: .5rem 0 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.now-credit__row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: .5rem; }
.now-credit__fig { display: flex; flex-direction: column; min-width: 0; }
.now-credit__value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.now-credit__unit { font-size: var(--text-xs); color: var(--color-text-muted); }
.now-credit__spark { width: 240px; max-width: 100%; height: 48px; }
.now-credit__line { fill: none; stroke: var(--color-warn); stroke-width: 1.8; stroke-linejoin: round; }
.now-credit__fire { stroke: var(--color-text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.now-credit__dot { fill: var(--color-warn); }
.now-credit__more { margin-top: .6rem; font-size: var(--text-sm); }
.now-credit__more summary { cursor: pointer; color: var(--color-accent); }
.now-credit__para { margin: .45rem 0 0; }
.mc-table-wrap { overflow-x: auto; margin: .5rem 0 1.25rem; }
.mc-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.mc-table th, .mc-table td { text-align: left; padding: .4rem .55rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.mc-table td.num, .mc-table th.num { text-align: right; white-space: nowrap; }
.mc-pill { display: inline-block; font-size: var(--text-xs); font-weight: 600; padding: .05rem .45rem; border-radius: 999px; background: var(--color-bg-inset); }
.mc-pill[data-s="shock"], .mc-pill[data-v="lost"] { color: var(--color-danger); }
.mc-pill[data-s="watch"], .mc-pill[data-v="weaker"] { color: var(--color-warn); }
.mc-pill[data-s="ok"], .mc-pill[data-v="better"], .mc-pill[data-v="held"] { color: var(--color-accent); }
.mc-history { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0 1rem; }
.now-card { padding: 1rem 1.15rem; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); min-width: 0; }
.now-card__title { margin: 0 0 .2rem; font-size: var(--text-lg, 1.1rem); }
.now-card__sub { margin: 0 0 .75rem; font-size: var(--text-xs); color: var(--color-text-muted); }
.now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.now-item { display: grid; gap: .2rem; padding-bottom: .65rem; border-bottom: 1px solid var(--color-border); min-width: 0; }
.now-item:last-child { border-bottom: 0; padding-bottom: 0; }
.now-item__top { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-weight: 600; }
.now-item__conf { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; }
.now-item__yours { font-size: var(--text-xs); color: var(--color-warn); }
.now-item__text { color: var(--color-text); overflow-wrap: anywhere; }
a.now-item__text[data-sign="pos"] { color: var(--color-accent); }
a.now-item__text[data-sign="neg"] { color: var(--color-danger); }
.now-item__body { font-size: var(--text-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }
.now-item__meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.now-item.is-unread { padding-left: .6rem; border-left: 3px solid var(--color-accent); }
.now-empty { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.now-more { display: inline-block; margin-top: .75rem; font-size: var(--text-sm); }
.now-inbox { margin-top: var(--space-4); scroll-margin-top: 90px; }
.now-inbox__head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.dash-bell { display: flex; align-items: center; gap: .5rem; margin: .25rem 12px .75rem; padding: .45rem .75rem; border-radius: 10px; color: var(--color-text); text-decoration: none; border: 1px solid var(--color-border); font-size: var(--text-sm); }
.dash-bell:hover { border-color: var(--color-accent); }
.dash-bell__badge { margin-left: auto; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--color-danger); color: #fff; font-size: var(--text-xs); font-weight: 700; text-align: center; line-height: 1.4rem; }
.dash-bell__badge[hidden] { display: none; }
.mobile-menu__badge { display: inline-block; margin-left: .5rem; vertical-align: middle; }
.mobile-menu__badge[hidden] { display: none; }
/* "Right now" sits straight under the account header's nav pills (Brett
   10/27: two stacked section paddings left a 100px+ gap). */
.acct-head { padding-bottom: var(--space-4); }
.acct-head .form-status:empty { margin: 0; }
#now { padding-top: 0; }
.now-item__link { font-size: var(--text-xs); }
.dash-bell[aria-current="page"] { border-color: var(--color-accent); color: var(--color-accent); }
.nt-foot { margin-top: var(--space-3); }

/* Admin › Research (assets/admin-research.js, 10/27). */
/* Admin › Research = the shared agentic-flow component (guud-aflow-admin, its
   CSS is loaded from the backend package). Whalur only sets its theme tokens. */
#panel-research .gaf {
  --gaf-bg: var(--color-bg); --gaf-raised: var(--color-bg-raised); --gaf-inset: var(--color-bg-inset);
  --gaf-border: var(--color-border); --gaf-text: var(--color-text); --gaf-muted: var(--color-text-muted);
  --gaf-accent: var(--color-accent); --gaf-accent-ink: var(--color-accent-ink); --gaf-info: var(--color-sky);
  --gaf-good: var(--color-accent); --gaf-warn: var(--color-warn); --gaf-bad: var(--color-danger);
  --gaf-radius: var(--radius-md); --gaf-font: var(--font-sans); --gaf-mono: var(--font-mono); --gaf-focus: var(--shadow-focus);
}

/* trading.html House wallets ranked by realised gain (Brett 10/28). One row per
   wallet; the row opens portfolio.html?id=. */
.hw-table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); }
.hw-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.hw-table th, .hw-table td { padding: var(--space-3) var(--space-4); text-align: left; border-top: 1px solid var(--color-border); vertical-align: top; }
.hw-table thead th { border-top: 0; font-size: var(--text-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 600; }
.hw-table .hw-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hw-row { cursor: pointer; }
.hw-row:hover, .hw-row:focus-visible { background: var(--color-bg-inset); outline: none; }
.hw-rank { color: var(--color-text-muted); width: 2.5rem; }
.hw-name a { font-weight: 600; color: var(--color-text); text-decoration: none; }
.hw-row:hover .hw-name a { color: var(--color-accent); }
.hw-rule, .hw-sub { display: block; color: var(--color-text-muted); font-size: var(--text-xs); margin-top: 2px; font-weight: 400; }
.hw-name { min-width: 13rem; }
/* Aggressive-meter pill beside the name (Brett 11/4), calm to hot. Wraps under
   the name rather than widening the column on a phone. */
.hw-name-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.hw-level { font-size: 0.68rem; padding: 1px var(--space-2); line-height: 1.5; white-space: nowrap; cursor: help; }
.hw-level[data-level="careful"] { color: #a9bbd6; border-color: rgba(127, 150, 186, 0.45); background: rgba(127, 150, 186, 0.12); }
.hw-level[data-level="steady"] { color: var(--color-text); border-color: var(--color-border); background: var(--color-bg-inset); }
.hw-level[data-level="bold"] { color: var(--color-warn); border-color: rgba(242, 184, 75, 0.5); background: rgba(242, 184, 75, 0.1); }
.hw-level[data-level="aggressive"] { color: #f7964f; border-color: rgba(247, 150, 79, 0.55); background: rgba(247, 150, 79, 0.12); }
.hw-level[data-level="max"] { color: #ff8a80; border-color: rgba(242, 90, 80, 0.65); background: rgba(242, 90, 80, 0.16); }
.hw-rule { max-width: 20rem; }
.now-market__shock { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm, 4px); background: rgba(242, 125, 114, 0.1); color: var(--color-text); }
.now-market__shock strong { color: var(--color-danger); }
.mc-shock-override { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
/* Shock mode (Brett 11/6): wallet + position pills, the trading.html note. */
.hw-shock, .pt-shock { color: var(--color-danger); border-color: rgba(242, 125, 114, 0.5); background: rgba(242, 125, 114, 0.1); cursor: help; }
.pt-shock { display: inline-block; margin-left: var(--space-2); font-size: 0.66rem; padding: 1px var(--space-2); line-height: 1.5; white-space: nowrap; letter-spacing: 0.04em; }
.hw-shock-note { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border-left: 3px solid var(--color-danger); background: rgba(242, 125, 114, 0.08); border-radius: var(--radius-sm, 4px); font-size: var(--text-sm); }
/* Sub-lines wrap to two short lines inside a fixed-width number column instead
   of one word per line (too narrow) or pushing the table off-screen (nowrap). */
.hw-table td.hw-num { min-width: 7.5rem; max-width: 9.5rem; }
.hw-num .hw-sub { white-space: normal; }
.hw-pnl { font-weight: 700; font-size: var(--text-base); }
:is(.hw-table, .hw-leaders, .hyp-house-pnl) [data-tone="up"] { color: var(--color-accent); }
:is(.hw-table, .hw-leaders, .hyp-house-pnl) [data-tone="down"] { color: var(--color-danger); }

.hw-leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--space-5); margin-top: var(--space-6); }
.hw-leaders-col { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); padding: var(--space-4) var(--space-5); }
.hw-leaders-col h3 { margin: 0 0 var(--space-1); }
.hw-leaders-lede { margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); }
.hw-leaders-list { margin: 0; padding-left: 1.4rem; }
.hw-leaders-list li { display: grid; grid-template-columns: 1fr auto; column-gap: var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--color-border); }
.hw-leaders-list li:first-child { border-top: 0; }
.hw-leaders-list a { color: var(--color-text); text-decoration: none; font-weight: 500; }
.hw-leaders-list a:hover { color: var(--color-accent); }
.hw-leaders-num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hw-leaders-list .hw-sub { grid-column: 1 / -1; }
.hw-leaders-empty { color: var(--color-text-muted); font-size: var(--text-sm); }

/* trading.html member's own paper books: one line each, full card on open. */
.pt-book-row { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); margin-bottom: var(--space-3); }
.pt-book-row > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); cursor: pointer; list-style: none; }
.pt-book-row > summary::-webkit-details-marker { display: none; }
.pt-book-row > summary::before { content: "▸"; color: var(--color-text-muted); }
.pt-book-row[open] > summary::before { content: "▾"; }
.pt-book-row-name { font-weight: 600; }
.pt-book-row-meta { color: var(--color-text-muted); font-size: var(--text-sm); }
.pt-book-row-link { margin-left: auto; font-size: var(--text-sm); }
.pt-book-row > .pt-book { margin: 0 var(--space-3) var(--space-3); }

.pos-details > summary { list-style: none; display: inline-flex; margin: var(--space-3) 0; }
.pos-details > summary::-webkit-details-marker { display: none; }
.pos-details[open] > summary { margin-bottom: var(--space-4); }

/* hypothesis.html: realised P&L of this idea in the House wallets. */
.hyp-house-pnl { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); padding: var(--space-4) var(--space-5); margin: var(--space-5) 0; }
.hyp-house-pnl h3 { margin: 0 0 var(--space-1); font-size: var(--text-md); }
.hyp-house-pnl-total { font-size: var(--text-lg); font-weight: 700; margin: var(--space-2) 0; font-variant-numeric: tabular-nums; }
.hyp-house-pnl ul { margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.hyp-house-pnl li { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); justify-content: space-between; padding: var(--space-2) 0; border-top: 1px solid var(--color-border); font-size: var(--text-sm); }
.hyp-house-pnl .hw-sub { display: inline; }

/* --- Account page: section pills pinned while scrolling (Brett 11/12) ------- */
.acct-tabs-bar {
  --acct-tabs-top: var(--header-h);
  position: sticky;
  top: var(--acct-tabs-top);
  z-index: 40;
  padding-block: var(--space-3);
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.acct-tabs-bar .acct-tabs { margin-top: 0; }
/* Signed-in desktop: no top header, so the pills sit at the very top. */
@media (min-width: 1001px) {
  html.dash .acct-tabs-bar { --acct-tabs-top: 0px; }
  html.dash:has(.acct-tabs-bar) { scroll-padding-top: calc(72px + var(--space-4)); }
}
/* Phones/tablets: one swipeable row instead of three wrapped rows. */
@media (max-width: 1000px) {
  html:has(.acct-tabs-bar) { scroll-padding-top: calc(var(--header-h) + 64px + var(--space-3)); }
  .acct-tabs-bar .acct-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .acct-tabs-bar .acct-tabs::-webkit-scrollbar { display: none; }
  .acct-tabs-bar .acct-tabs a { flex: 0 0 auto; white-space: nowrap; }
}

/* ---- House wallets vs the market (Brett 11/19) ----
   paper-trading.js vsMarket(): badge + plain line + tap-to-open "?" explainer
   (a <details>, so it works on a phone). Green when beating SPY, red when trailing. */
.vm { margin-top: var(--space-2); }
.vm-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.vm-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: var(--text-xs); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; border: 1px solid var(--color-border); color: var(--color-text); white-space: nowrap; }
.vm-badge[data-tone="up"] { color: var(--color-accent); border-color: color-mix(in srgb, var(--color-accent) 55%, transparent); background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.vm-badge[data-tone="down"] { color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 55%, transparent); background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.vm-line { margin: 4px 0 0; font-size: var(--text-xs); color: var(--color-text-muted); white-space: normal; }
.vm-extra { margin: 4px 0 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.vm-help { display: inline-block; position: relative; }
.vm-help > summary { list-style: none; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; user-select: none; }
.vm-help > summary::-webkit-details-marker { display: none; }
.vm-help[open] > summary { color: var(--color-text); border-color: var(--color-text-muted); }
.vm-help-text { margin: var(--space-2) 0 0; padding: var(--space-3); max-width: 28rem; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text); background: var(--color-bg-inset); border: 1px solid var(--color-border); border-radius: var(--radius-sm); white-space: normal; font-weight: 400; }
.vm--detail { margin: var(--space-3) 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); }
.vm--detail .vm-badge { font-size: var(--text-sm); padding: 4px 12px; }
.vm--detail .vm-line { font-size: var(--text-sm); color: var(--color-text); }
.hw-market-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); }
.hw-market-head[data-tone="up"] { border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border)); }
.hw-market-head[data-tone="down"] { border-color: color-mix(in srgb, var(--color-danger) 45%, var(--color-border)); }
.hw-market-line { margin: 0; font-size: var(--text-base, 1rem); }
.hw-market-head[data-tone="up"] .hw-market-line strong { color: var(--color-accent); }
.hw-market-head[data-tone="down"] .hw-market-line strong { color: var(--color-danger); }
.hw-market-head .vm-help-text { flex-basis: 100%; }
.hw-market-note { margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
.hw-name .vm-line { max-width: 20rem; }
.hw-market-head .vm-help[open], .vm-top .vm-help[open] { flex-basis: 100%; }

/* Treasury & cash on macro.html (#treasury, 11/21, assets/treasury-funding.js) */
.tsy-wrap { margin: var(--space-6, 2rem) 0; scroll-margin-top: 80px; }
.tsy-card { padding: .9rem 1.1rem; border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent); border-radius: 12px; background: var(--color-bg-raised); min-width: 0; }
.tsy-card[data-level="elevated"] { border-left-color: var(--color-warn); }
.tsy-card__top { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.tsy-card__headline { overflow-wrap: anywhere; }
.tsy-badge { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .5rem; border-radius: 999px; background: var(--color-bg-inset); color: var(--color-text-muted); }
.tsy-card[data-level="elevated"] .tsy-badge { color: var(--color-warn); }
.tsy-lines { margin: .55rem 0 0; padding-left: 1.1rem; font-size: var(--text-sm); display: grid; gap: .3rem; }
.tsy-checks { list-style: none; margin: .7rem 0 0; padding: .55rem 0 0; border-top: 1px solid var(--color-border); display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: var(--text-xs); color: var(--color-text-muted); }
.tsy-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem; margin: .9rem 0 0; }
.tsy-tile { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .9rem; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-raised); min-width: 0; }
.tsy-tile__label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.tsy-tile__value { font-size: 1.45rem; font-weight: 700; line-height: 1.15; }
.tsy-tile__sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.tsy-spark { width: 100%; height: 44px; margin-top: .3rem; }
.tsy-spark__line { fill: none; stroke: var(--color-accent); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tsy-spark__ref { stroke: var(--color-text-muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.tsy-sub { margin: 1.2rem 0 .2rem; font-size: var(--text-md, 1rem); }
.tsy-table tr.is-unusual td { background: color-mix(in srgb, var(--color-warn) 8%, transparent); }
.tsy-table td .mc-pill { white-space: nowrap; }
.tsy-more { font-size: var(--text-sm); margin-top: .2rem; }
.tsy-more summary { cursor: pointer; font-weight: 600; }
.tsy-more p { margin: .5rem 0; }
.tsy-note { margin: .5rem 0 0; font-size: var(--text-xs); color: var(--color-text-muted); }
