/*
 * threads-analytics — Threads-inspired UI.
 *
 * Design: mirror the Threads app itself.
 * Light mode, system font, white cards with large rounded corners on a light
 * gray background, fixed left icon sidebar, black text, minimal color, content
 * is the star. No serifs, no amber brand accents, no editorial flourishes.
 */

:root {
  /* Threads palette — LIGHT mode (default) */
  --bg: #f5f5f5;                 /* page background */
  --surface: #ffffff;            /* cards */
  --surface-hover: #fafafa;
  --surface-sunken: #f0f0f0;
  --border: #e6e6e6;
  --border-strong: #d0d0d0;
  --divider: #efefef;

  --text: #000000;               /* handles, important */
  --text-body: #1c1e21;          /* body copy */
  --text-muted: #65676b;         /* timestamps, metadata */
  --text-faint: #8e8e93;

  /* Minimal color palette */
  --link: #0095f6;               /* IG blue — links only */
  --pos: #1f8a3a;                /* muted green */
  --pos-bg: #ecf6ef;
  --neg: #e0245e;                /* muted pink-red */
  --neg-bg: #fdeaf0;
  --warn: #b47704;               /* amber, used sparingly for the hypothesis tag only */
  --warn-bg: #fff4dc;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);

  /* Type — system stack, matches the Threads app */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;

  /* Layout */
  --sidebar-w: 76px;
  --main-max: 720px;         /* Threads feed width */
  --main-max-wide: 960px;    /* for dashboards with grids */
}

/* DARK mode — follows the Threads app dark theme: pure black page, slightly
   raised cards, warm off-white text. Activates via OS preference by default,
   or by an explicit [data-theme="dark"] override on <html> (manual toggle). */
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #101013;
  --surface-hover: #17171b;
  --surface-sunken: #1a1a1f;
  --border: #242428;
  --border-strong: #33333a;
  --divider: #1e1e22;

  --text: #f5f5f0;
  --text-body: #e4e4e0;
  --text-muted: #8a8a92;
  --text-faint: #5a5a62;

  --pos: #63d17c;
  --pos-bg: rgba(99, 209, 124, 0.10);
  --neg: #ff5f8a;
  --neg-bg: rgba(255, 95, 138, 0.10);
  --warn: #f0b73a;
  --warn-bg: rgba(240, 183, 58, 0.10);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #101013;
    --surface-hover: #17171b;
    --surface-sunken: #1a1a1f;
    --border: #242428;
    --border-strong: #33333a;
    --divider: #1e1e22;

    --text: #f5f5f0;
    --text-body: #e4e4e0;
    --text-muted: #8a8a92;
    --text-faint: #5a5a62;

    --pos: #63d17c;
    --pos-bg: rgba(99, 209, 124, 0.10);
    --neg: #ff5f8a;
    --neg-bg: rgba(255, 95, 138, 0.10);
    --warn: #f0b73a;
    --warn-bg: rgba(240, 183, 58, 0.10);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.6);
  }

  ::selection { background: rgba(0, 149, 246, 0.4); }
  .run-spinner { border-color: var(--border-strong); border-top-color: var(--text); }
  .topbar .run-form button { background: var(--text); color: var(--bg); }
  .topbar .run-form button:hover { background: #ffffff; }
  .sidebar-run { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
  .sidebar-run:hover { background: var(--surface-hover); }
  .profile-pic-fallback { background: var(--surface-sunken); color: var(--text-muted); }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); }
::selection { background: rgba(0, 149, 246, 0.2); }

/* View transitions — subtle cross-fade */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out 120ms ease-out both; }
::view-transition-new(root) { animation: fade-in 200ms ease-out both; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(2px); } }

/* ---------- layout shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- left sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  background: var(--bg);
}
.sidebar-brand {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 10px;
}
.sidebar-brand svg { width: 28px; height: 28px; }

/* Main nav group — flex:1 takes the remaining space, justify-content:center
   vertically centers the nav icons between the brand logo (top) and the
   re-run button (bottom). Home is the first item. */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  color: var(--text-muted);
  transition: background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  position: relative;
}
.sidebar-nav a svg {
  width: 26px;
  height: 26px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}
.sidebar-nav a:hover {
  background: var(--surface-sunken);
  color: var(--text);
  text-decoration: none;
}
.sidebar-nav a:active { transform: scale(0.95); }
.sidebar-nav a.active {
  color: var(--text);
  background: var(--surface-sunken);
}
.sidebar-nav a.active svg { stroke-width: 2.4; }

.sidebar-tooltip {
  position: absolute;
  left: 58px;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
  z-index: 50;
}
.sidebar-nav a:hover .sidebar-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-run, .sidebar-theme {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  position: relative;
}
.sidebar-theme { margin-top: 10px; background: transparent; box-shadow: none; color: var(--text-muted); }
.sidebar-theme:hover { background: var(--surface-sunken); color: var(--text); }
.sidebar-theme:active { transform: scale(0.95); }
.sidebar-theme svg { width: 20px; height: 20px; }
.sidebar-theme .theme-icon-dark { display: none; }
:root[data-theme="dark"] .sidebar-theme .theme-icon-light { display: none; }
:root[data-theme="dark"] .sidebar-theme .theme-icon-dark { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar-theme .theme-icon-light { display: none; }
  :root:not([data-theme="light"]) .sidebar-theme .theme-icon-dark { display: inline-block; }
}
.sidebar-theme:hover .sidebar-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.sidebar-run {
  margin-top: 10px;
}
.sidebar-run:hover .sidebar-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.sidebar-run svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.sidebar-run:hover { background: var(--surface-hover); }
.sidebar-run:active { transform: scale(0.93); }
.sidebar-run:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- main column ---------- */
.main-col {
  display: flex;
  justify-content: center;
  padding: 24px 24px 80px;
}
.main-inner {
  width: 100%;
  max-width: var(--main-max-wide);
}
.main-inner.narrow { max-width: var(--main-max); }

/* ---------- run banner ---------- */
.run-banner {
  position: sticky;
  top: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  animation: banner-in 260ms var(--ease);
  font-size: 14px;
}
@keyframes banner-in { from { opacity: 0; transform: translateY(-6px); } }
.run-banner[hidden] { display: none !important; }
.run-banner-text { display: flex; flex-direction: column; gap: 2px; }
.run-banner-text strong { color: var(--text); font-weight: 600; }
.run-banner-text span { color: var(--text-muted); font-size: 12px; }
.run-banner-timer {
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12px;
}
.run-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: run-spin 700ms linear infinite;
}
@keyframes run-spin { to { transform: rotate(360deg); } }
.run-progress {
  width: 160px;
  height: 4px;
  background: var(--surface-sunken);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.run-progress-fill {
  height: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: width 300ms var(--ease);
}

/* ---------- card primitive ---------- */
.card {
  background: var(--surface);
  border: 0;
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 14px;
  transition: background var(--dur-fast) var(--ease);
}

h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }

/* Card section labels — small, uppercase, color-coded per semantic category.
   Applied to h2 inside non-hero cards to establish clear visual hierarchy:
       LABEL (11px, uppercase, colored)
       Body / values (normal size, text color)
       Meta (small, muted)
   Hero cards have their own label styles and are exempt. */
.card:not(.card-hero) > h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--card-label, var(--text-muted));
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card:not(.card-hero) > h2::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* Semantic label colors — each card opts in via a category class */
.perception-like      { --card-label: var(--pos); }
.perception-dislike   { --card-label: var(--neg); }
.perception-overall   { --card-label: var(--warn); }
.you-protect          { --card-label: var(--pos); }
.you-double           { --card-label: var(--text); }
.you-risks            { --card-label: var(--neg); }
.bigfive-card         { --card-label: var(--text); }
.algo-weights-card    { --card-label: var(--text); }
.signal-carousel-card { --card-label: var(--text); }
.leverage-fix-card    { --card-label: var(--pos); }  /* green-hero but the h2 is still visible */
.signal-quality-card  { --card-label: var(--warn); }
.algo-narrative-card  { --card-label: var(--warn); }
.noteworthy-list .card { --card-label: var(--text-muted); }
.sugg-section         { --card-label: var(--warn); }

p { margin: 0 0 8px; color: var(--text-body); }
p:last-child { margin-bottom: 0; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

.section-head {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 10px;
}

/* ---------- profile hero ---------- */
.profile-hero {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 24px;
  margin-bottom: 14px;
}
.profile-pic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.profile-pic-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-sunken);
}
.profile-info { flex: 1; min-width: 0; }
.profile-handle {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.profile-bio {
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 14px;
}
.experiment-callout {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.experiment-callout strong {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

/* ---------- buttons ---------- */
.cta, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  text-decoration: none !important;
}
.cta:hover, .btn:hover { background: var(--surface-sunken); text-decoration: none !important; }
.cta:active, .btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.btn-primary:hover { background: #1c1c1c; }

/* ---------- verdict headline ---------- */
.verdict-headline {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  padding: 18px 22px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 0;
  border-radius: 20px;
  line-height: 1.4;
}

/* ---------- metric grid (Ground Truth) ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metric-card {
  padding: 18px 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: default;
  transition: background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.metric-card:hover {
  background: var(--surface-hover);
}
.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.metric-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.metric-base-and-delta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
}
.metric-base { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.metric-delta {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.delta-pos { color: var(--pos); background: var(--pos-bg); }
.delta-neg { color: var(--neg); background: var(--neg-bg); }
.delta-flat { color: var(--text-muted); background: var(--surface-sunken); }
.metric-spark { width: 100%; max-height: 40px; margin-top: 4px; }
.metric-description {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}
.metric-n {
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--divider); }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; }
td { color: var(--text-body); }
td.pos, .pos { color: var(--pos); }
td.neg, .neg { color: var(--neg); }
.status-complete { color: var(--pos); }
.status-failed { color: var(--neg); }
.status-running { color: var(--text); }

/* ---------- experiments ---------- */
.experiments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.experiments-header h1 { margin: 0; }

.track-table { font-size: 13px; }
.track-table td { font-variant-numeric: tabular-nums; }

.exp-list { display: flex; flex-direction: column; gap: 12px; }
.exp-card {
  padding: 18px 22px;
  margin: 0;
  transition: background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.exp-card:hover { background: var(--surface-hover); }
/* Borderless experiment cards — status is conveyed by the verdict pill in the
   head row, not by left accents. */
.exp-active,
.exp-completed,
.exp-proposed { border: 0; }
.exp-abandoned { border: 0; opacity: 0.45; }

.exp-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.exp-category {
  background: var(--surface-sunken);
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.exp-metric, .exp-source { color: var(--text-muted); }
.exp-verdict {
  margin-left: auto;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.verdict-win { background: var(--pos-bg); color: var(--pos); }
.verdict-loss { background: var(--neg-bg); color: var(--neg); }
.verdict-null, .verdict-insufficient_data {
  background: var(--surface-sunken); color: var(--text-muted);
}
.exp-title {
  font-size: 17px;
  font-weight: 700;
  margin: 4px 0 6px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.exp-title a { color: var(--text); }
.exp-title a:hover { text-decoration: none; color: var(--text); }
.exp-hypothesis { color: var(--text-body); font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.page-grid .span-3 .exp-hypothesis,
.page-grid .span-3 .exp-reasoning {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.exp-meta {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}
.exp-meta strong { color: var(--text); font-weight: 700; }
.exp-verdict-summary {
  font-size: 13px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  color: var(--text-body);
}
.exp-verdict-summary strong { color: var(--text); }

/* Experiment detail */
.exp-head-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.back-link { color: var(--text-muted); font-size: 13px; }
.back-link:hover { color: var(--text); }
.exp-status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.08em;
}
.status-active { background: var(--surface-sunken); color: var(--text); }
.status-completed { background: var(--pos-bg); color: var(--pos); }
.status-proposed { background: var(--surface-sunken); color: var(--text-muted); }
.status-abandoned { background: var(--neg-bg); color: var(--neg); }

.exp-category-line { margin: -4px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-block;
  background: var(--surface-sunken);
  color: var(--text-body);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.predicate-spec {
  background: var(--surface-sunken);
  padding: 12px 14px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  color: var(--text);
  border: 1px solid var(--border);
}

.timeline-table { font-size: 14px; }
.timeline-table td:first-child { color: var(--text-muted); width: 160px; }
.timeline-table td { font-variant-numeric: tabular-nums; }

.action-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.action-row button, .exp-form button {
  background: var(--text);
  color: var(--surface);
  border: 0;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.action-row button:hover, .exp-form button:hover { background: #1c1c1c; }
.action-row button:active { transform: scale(0.97); }
.action-row button.danger {
  background: transparent;
  color: var(--neg);
  border: 1px solid var(--neg);
}
.action-row button.danger:hover { background: var(--neg); color: white; }

/* Verdict card */
.verdict-card { padding: 22px 24px; }
.verdict-card h2 { display: flex; gap: 10px; align-items: center; }
.verdict-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text);
}
.verdict-card.verdict-win .verdict-label { background: var(--pos-bg); color: var(--pos); }
.verdict-card.verdict-loss .verdict-label { background: var(--neg-bg); color: var(--neg); }

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.verdict-stat {
  padding: 12px 14px;
  background: var(--surface-sunken);
  border-radius: 12px;
}
.verdict-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.verdict-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.verdict-interp {
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  color: var(--text-body);
  font-family: var(--font-mono);
}

.class-table { font-size: 13px; }
.class-table tr.bucket-variant { background: var(--surface-sunken); }

/* ---------- experiment form ---------- */
.exp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}
.exp-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.exp-form input[type="text"], .exp-form input[type="number"], .exp-form textarea, .exp-form select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 11px 14px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.exp-form textarea { font-family: var(--font-mono); font-size: 13px; }
.exp-form input:focus, .exp-form textarea:focus, .exp-form select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.15);
}
.exp-form .form-help {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.65;
  font-weight: 400;
}
.exp-form .form-help code {
  background: var(--surface-sunken);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.exp-form label.checkbox { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--text-body); font-size: 14px; }

/* ---------- noteworthy posts ---------- */
.noteworthy-list { display: flex; flex-direction: column; gap: 14px; }
.noteworthy-card {
  padding: 18px 22px;
  margin: 0;
  cursor: pointer;
  position: relative;
  transition:
    background var(--dur-fast) var(--ease),
    padding var(--dur-base) var(--ease),
    border-radius var(--dur-base) var(--ease),
    border-color var(--dur-base) var(--ease);
}
.noteworthy-card:not(.nw-hero):hover { background: var(--surface-hover); }
.nw-feature-hint {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  z-index: 5;
  letter-spacing: 0.02em;
}
.noteworthy-card:not(.nw-hero) .nw-feature-hint::before { content: "✦ feature this"; }
.noteworthy-card:not(.nw-hero):hover .nw-feature-hint { opacity: 1; transform: translateY(0); }
.noteworthy-card.nw-hero .nw-feature-hint {
  background: rgba(13, 13, 15, 0.12);
  color: inherit;
  opacity: 0.75;
  transform: translateY(0);
}
.noteworthy-card.nw-hero .nw-feature-hint::before { content: "✓ featured"; }
.nw-head {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.nw-category {
  background: var(--surface-sunken);
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.nw-ratio { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.nw-date { margin-left: auto; color: var(--text-muted); }
.nw-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-body);
  margin: 8px 0 10px;
  padding: 0;
  background: transparent;
  border: 0;
}
.nw-stats {
  display: flex;
  gap: 18px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.nw-commentary, .nw-algo { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }
.nw-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nw-commentary p, .nw-algo p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-body);
}
.nw-algo { background: transparent; padding-top: 12px; }

/* ---------- perception v3 (Big Five + lens model) ---------- */

/* Signal quality summary card */
.signal-quality-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.sq-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; }
.sq-rating { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.sq-strong { color: var(--pos); }
.sq-mixed { color: var(--warn); }
.sq-weak { color: var(--neg); }
.sq-summary { font-size: 13px; line-height: 1.55; color: var(--text-muted); margin: 0; }

/* Big Five grid */
.bigfive-card { padding: 22px 24px; }
.bigfive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
.bigfive-row {
  padding: 12px 16px;
  background: var(--surface-sunken);
  border-radius: 12px;
  border-left: 3px solid var(--border-strong);
}
.bigfive-row-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.bigfive-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 140px;
}
.bigfive-rating {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
}
.rating-high { background: var(--pos-bg); color: var(--pos); }
.rating-low { background: var(--neg-bg); color: var(--neg); }
.rating-medium { background: var(--surface); color: var(--text-muted); }
.bigfive-confidence {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.bigfive-cues {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bigfive-cues li {
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}
.bigfive-cues li::before {
  content: "·";
  position: absolute;
  left: 4px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Cue clarity chips */
.clarity-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-pos { background: var(--pos-bg); color: var(--pos); border-color: rgba(31,138,58,0.25); }
.chip-warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(180,119,4,0.25); }

/* Leverage fix card — green hero variant */
.leverage-fix-card { padding: 22px 24px; }
.leverage-fix-card h2 { font-family: var(--font); font-size: 16px; margin: 4px 0 8px; line-height: 1.3; color: inherit; }
.leverage-fix-card p { color: inherit; opacity: 0.92; font-size: 13px; line-height: 1.55; margin: 0 0 6px; }
.leverage-fix-card .roi-tag { color: inherit; opacity: 0.75; font-size: 10px; }

/* Misread risks list */
.misread-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; }
.misread-list li {
  padding: 10px 14px;
  background: var(--surface-sunken);
  border-radius: 10px;
  border-left: 2px solid var(--warn);
}
.misread-cue { font-size: 13px; color: var(--text); margin-bottom: 2px; }
.misread-wrong { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ---------- perception ---------- */
.perception-banner {
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.perception-banner-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.perception-banner-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.perception-card h2 {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 8px;
}
.perception-text { font-size: 14px; line-height: 1.6; color: var(--text-body); margin: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

.trigger-list { list-style: none; padding: 0; margin: 0; }
.trigger-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-body);
}
.trigger-list li:last-child { border-bottom: 0; }
.growth-blocker-list { padding-left: 20px; margin: 0; }
.growth-blocker-list li { padding: 8px 0; line-height: 1.55; color: var(--text-body); font-size: 14px; }
.growth-blocker-list li::marker { color: var(--text); font-weight: 700; }

/* ---------- algorithm ---------- */
.algo-narrative-card {
  padding: 20px 22px;
}
.algo-narrative-card .algo-narrative-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.algo-narrative-card p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-body);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Signal carousel — one card with slides per ranking signal */
.signal-carousel-card { padding: 20px 24px; }
.signal-carousel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.signal-carousel-head h2 { margin: 0; }
.signal-dots {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  background: var(--border-strong);
  cursor: pointer;
  padding: 0;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.signal-dot:hover { transform: scale(1.2); }
.signal-dot.active { background: var(--text); transform: scale(1.3); }
.signal-controls { display: flex; gap: 6px; }
.signal-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.signal-arrow:hover { background: var(--surface-sunken); }
.signal-arrow:active { transform: scale(0.94); }
.signal-arrow svg { width: 14px; height: 14px; }

.signal-carousel {
  position: relative;
  min-height: 170px;
}
.signal-slide {
  display: none;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--surface-sunken);
  border-left: 3px solid var(--text-muted);
}
.signal-slide.active { display: block; animation: slide-in 300ms var(--ease); }
@keyframes slide-in { from { opacity: 0; transform: translateY(4px); } }
.signal-slide.signal-penalized { border-left-color: var(--neg); background: var(--neg-bg); }
.signal-slide.signal-boosted { border-left-color: var(--pos); background: var(--pos-bg); }
.signal-slide-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.signal-slide-label { font-size: 15px; font-weight: 700; color: var(--text); }
.signal-slide-rating {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
}
.signal-slide.signal-penalized .signal-slide-rating { color: var(--neg); }
.signal-slide.signal-boosted .signal-slide-rating { color: var(--pos); }
.signal-slide-evidence {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 8px;
}
.signal-slide-impact {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.55;
}

/* Promote weights chart — make it feel like the main visual */
.algo-weights-card { padding: 22px 26px; }
.algo-weights-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.algo-weights-head h2 { margin: 0; font-size: 18px; }

/* Signal tiles — one card per ranking signal, sits in the page grid */
.signal-tile { padding: 18px 20px; position: relative; }
.signal-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.signal-tile-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
}
.signal-tile-rating {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-muted);
  flex-shrink: 0;
}
.signal-tile.signal-penalized .signal-tile-rating { background: var(--neg-bg); color: var(--neg); }
.signal-tile.signal-boosted .signal-tile-rating { background: var(--pos-bg); color: var(--pos); }
.signal-tile.signal-penalized { border-left: 2px solid var(--neg); }
.signal-tile.signal-boosted { border-left: 2px solid var(--pos); }
.signal-tile-evidence {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--surface-sunken);
  border-radius: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.signal-tile-impact {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.algo-narrative {
  padding: 18px 22px;
}
.algo-narrative-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
.algo-narrative p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  color: var(--text-body);
}

/* Signal rows — condensed alternative to the old grid */
.signal-rows {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.signal-row {
  padding: 14px 0;
  border-top: 1px solid var(--divider);
}
.signal-row:first-child { border-top: 0; padding-top: 4px; }
.signal-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.signal-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.signal-row-rating {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-muted);
}
.signal-row.signal-penalized .signal-row-rating { background: var(--neg-bg); color: var(--neg); }
.signal-row.signal-boosted .signal-row-rating { background: var(--pos-bg); color: var(--pos); }
.signal-row-evidence {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 4px;
}
.signal-row-impact {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.weights-list { display: flex; flex-direction: column; gap: 10px; }
.weight-row { display: flex; align-items: center; gap: 14px; }
.weight-label {
  width: 200px;
  color: var(--text-body);
  font-size: 13px;
  text-transform: capitalize;
  font-weight: 500;
}
.weight-bar {
  flex: 1;
  background: var(--surface-sunken);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.weight-fill {
  height: 100%;
  background: var(--text);
  border-radius: 999px;
  transition: width 1s var(--ease);
  animation: weight-fill-in 1s var(--ease);
}
@keyframes weight-fill-in { from { transform: scaleX(0); transform-origin: left; } }
.weight-value {
  width: 48px;
  text-align: right;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.highest-roi-card { padding: 22px 26px; border: 0; }
.highest-roi-card h2 { font-size: 18px; margin: 8px 0 10px; }
.roi-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.highest-roi-card .cites {
  color: var(--text-muted);
  font-size: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  margin-top: 14px;
}

.legacy-details summary { cursor: pointer; color: var(--text-muted); font-size: 13px; margin: 18px 0 10px; }
.legacy-details summary:hover { color: var(--text); }

/* ---------- You ---------- */
.you-identity { padding: 22px 26px; }
.you-identity h2 { font-size: 12px; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }
.you-identity-text { font-size: 16px; line-height: 1.55; color: var(--text-body); margin: 0; }
.you-list { list-style: none; padding: 0; margin: 6px 0 0; }
.you-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-body);
}
.you-list li:last-child { border-bottom: 0; }

.voice-list, .crossover-list, .signature-list, .risk-list { list-style: none; padding: 0; margin: 0; }
.voice-list li, .crossover-list li, .risk-list li { padding: 12px 0; border-bottom: 1px solid var(--divider); }
.voice-list li:last-child, .crossover-list li:last-child, .risk-list li:last-child { border-bottom: 0; }
.voice-trait, .crossover-topic, .risk-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.voice-evidence, .crossover-why { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.5; }
.voice-example, .crossover-example {
  background: var(--surface-sunken);
  padding: 10px 14px;
  border-radius: 12px;
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-body);
  font-style: italic;
  line-height: 1.5;
}
.signature-list li { padding: 8px 0; font-size: 14px; color: var(--text-body); border-bottom: 1px solid var(--divider); }
.signature-list li:last-child { border-bottom: 0; }
.signature-list li strong { color: var(--text); font-weight: 700; }

.quintessential-list { display: flex; flex-direction: column; gap: 10px; }
.quintessential-quote {
  margin: 0;
  padding: 14px 18px;
  background: var(--surface-sunken);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
}
.quintessential-item blockquote {
  margin: 0 0 6px;
  padding: 14px 18px;
  background: var(--surface-sunken);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
}
.risk-loss { font-size: 13px; font-style: italic; color: var(--text-muted); }

/* Chip row — for stylistic signatures and small tag lists */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: default;
  line-height: 1.2;
}

/* Compact risk list */
.risk-list-compact {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.risk-list-compact li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-body);
  padding: 10px 14px;
  background: var(--surface-sunken);
  border-radius: 10px;
}
.risk-list-compact li strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; }
.risk-list-compact li .muted { font-size: 13px; }

/* ---------- suggestions ---------- */
.predicate-details summary { cursor: pointer; color: var(--text-muted); font-size: 13px; margin: 8px 0; }
.predicate-details summary:hover { color: var(--text); }
.predicate-details pre {
  background: var(--surface-sunken);
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 12px;
  color: var(--text);
  font-family: var(--font-mono);
  border: 1px solid var(--border);
}
.exp-reasoning { font-size: 13px; line-height: 1.55; margin-top: 8px; color: var(--text-body); }
.exp-reasoning strong { color: var(--text); }

/* ---------- banners ---------- */
.banner {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.55;
  background: var(--surface);
  border: 1px solid var(--border);
}
.banner-locked {
  background: var(--neg-bg);
  border: 1px solid rgba(224, 36, 94, 0.15);
  color: var(--text-body);
}
.banner code { background: var(--surface-sunken); padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono); }

/* ---------- epistemic tags ---------- */
.hypothesis-tag, .fact-tag {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 6px;
  font-family: var(--font);
}
.hypothesis-tag {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid rgba(180, 119, 4, 0.2);
}
.fact-tag {
  background: var(--pos-bg);
  color: var(--pos);
  border: 1px solid rgba(31, 138, 58, 0.2);
}

.epistemic-legend {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  align-items: center;
}
.epistemic-legend strong {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 999px;
  margin-right: 6px;
  text-transform: uppercase;
}
.epistemic-legend span:first-child strong { background: var(--pos-bg); color: var(--pos); border: 1px solid rgba(31, 138, 58, 0.2); }
.epistemic-legend span:last-child strong { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(180, 119, 4, 0.2); }

/* ---------- topic grid (legacy page) ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.topic-card p { color: var(--text-body); font-size: 13px; line-height: 1.5; }
.creator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.creator-card .score { color: var(--text); font-weight: 700; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.creator-posts { list-style: none; padding: 0; margin: 8px 0 0; }
.creator-posts li { padding: 8px 0; border-top: 1px solid var(--divider); font-size: 13px; color: var(--text-body); }

/* ---------- misc ---------- */
.post-list, .rec-list, .rec-full-list { list-style: none; padding: 0; margin: 0; }
.post-list li, .rec-list li { padding: 10px 0; border-bottom: 1px solid var(--divider); }
.post-list li:last-child, .rec-list li:last-child { border-bottom: 0; }
.post-meta { color: var(--text-muted); font-size: 12px; margin-bottom: 4px; }
.post-text { color: var(--text-body); font-size: 14px; line-height: 1.5; }

.secondary-link { color: var(--text-muted) !important; font-size: 13px; margin-left: 8px; }
.secondary-link:hover { color: var(--text) !important; }

/* Responsive: collapse sidebar to bottom on narrow screens */
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 0 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    z-index: 30;
  }
  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; gap: 2px; flex: 1; justify-content: space-around; }
  .sidebar-run { margin-top: 0; }
  .sidebar-tooltip { display: none; }
  .main-col { padding: 16px 14px 100px; }
}

/* ============================================================
 * HERO CARD SYSTEM
 *
 * Keep the Threads base (white, clean) — but specific punch cards
 * use vibrant editorial backgrounds, display typography, and
 * huge bold numbers/statements. Inspired by Avio / Forma brand
 * systems: pick ONE card per page to carry the punchline.
 * ============================================================ */

:root {
  /* Editorial hero palette (applied only to .card-hero-* variants) */
  --hero-yellow: #ffd84d;       /* mustard */
  --hero-yellow-ink: #0d0d0f;
  --hero-green: #4cb77e;        /* emerald */
  --hero-green-ink: #0d0d0f;
  --hero-coral: #f26b3a;        /* coral orange */
  --hero-coral-ink: #ffffff;
  --hero-pink: #f4a8c8;         /* soft pink */
  --hero-pink-ink: #0d0d0f;
  --hero-blue: #8bc7e8;          /* sky blue */
  --hero-blue-ink: #0d0d0f;
  --hero-royal: #2c4cdb;         /* royal blue */
  --hero-royal-ink: #ffffff;
  --hero-black: #0d0d0f;
  --hero-black-ink: #ffffff;

  --font-display: "Space Grotesk", -apple-system, "SF Pro Display", sans-serif;
}

/* Base hero card: kills border, tightens typography, adds overflow container */
.card-hero {
  border: 0;
  padding: 32px 36px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease);
}
.card-hero:hover { transform: translateY(-2px); }

.card-hero-yellow { background: var(--hero-yellow); color: var(--hero-yellow-ink); }
.card-hero-green  { background: var(--hero-green);  color: var(--hero-green-ink); }
.card-hero-coral  { background: var(--hero-coral);  color: var(--hero-coral-ink); }
.card-hero-pink   { background: var(--hero-pink);   color: var(--hero-pink-ink); }
.card-hero-blue   { background: var(--hero-blue);   color: var(--hero-blue-ink); }
.card-hero-royal  { background: var(--hero-royal);  color: var(--hero-royal-ink); }
.card-hero-black  { background: var(--hero-black);  color: var(--hero-black-ink); }

/* Coerce everything inside a hero card to ink-color */
.card-hero h1, .card-hero h2, .card-hero h3, .card-hero h4,
.card-hero p, .card-hero strong, .card-hero em, .card-hero li,
.card-hero blockquote {
  color: inherit;
}

/* Display typography inside heroes — Space Grotesk, tight */
.hero-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
  color: inherit;
}
.hero-display-sm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
  color: inherit;
}
.hero-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(64px, 9vw, 140px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.hero-label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  opacity: 0.82;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 14px;
  color: inherit;
}
.hero-label::after { content: "*"; font-weight: 700; opacity: 0.6; }

.hero-caption {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.88;
  max-width: 52ch;
  margin: 14px 0 0;
  color: inherit;
}

/* Corner arrow glyph on interactive hero cards */
.hero-arrow {
  position: absolute;
  top: 24px;
  right: 26px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
}
.card-hero:hover .hero-arrow { transform: translate(3px, -3px); opacity: 1; }
.hero-arrow::before {
  content: "↗";
  font-size: 22px;
  font-weight: 600;
  color: inherit;
}

/* Hero-footer — small caption at the bottom of a hero card.
   In-flow so flex parents (justify-content: space-between) lay it out
   correctly without overlapping the headline. */
.hero-footer {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  color: inherit;
  margin-top: auto;
}

/* Bigger hero variant — for verdict headlines and pullquotes */
.card-hero-xl {
  padding: 48px 44px 44px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Asterisk glyph utility — for section labels */
.asterisk { color: inherit; }
.asterisk::after { content: "*"; margin-left: 2px; font-weight: 700; }

/* ============================================================
 * PAGE GRID — generic 6-column asymmetric layout
 * Used by every page so the rhythm is consistent across the app.
 * ============================================================ */
.page-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.page-grid > * { margin: 0; }
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.row-2  { grid-row: span 2; }

@media (max-width: 960px) {
  .page-grid { grid-template-columns: repeat(2, 1fr); }
  .span-1, .span-2, .span-3, .span-4, .span-5, .span-6 { grid-column: span 2; }
  .row-2 { grid-row: auto; }
}

/* Legacy aliases for the ground truth page */
.gt-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.gt-verdict-cell   { grid-column: span 4; }
.gt-profile-cell   { grid-column: span 2; }
.gt-metric-cell    { grid-column: span 2; }
.gt-metric-cell-wide { grid-column: span 3; }
.gt-metric-hero    { grid-column: span 2; }

@media (max-width: 960px) {
  .gt-grid { grid-template-columns: repeat(2, 1fr); }
  .gt-verdict-cell, .gt-profile-cell { grid-column: span 2; }
  .gt-metric-cell, .gt-metric-cell-wide, .gt-metric-hero { grid-column: span 1; }
}

/* Card bodies in the grid should have breathable padding + full height */
.page-grid .card,
.page-grid .card-hero {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.page-grid .card h2 {
  margin-bottom: 10px;
}

/* Hero verdict card specifics */
.verdict-hero {
  padding: 32px 34px 28px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
}
.verdict-hero .hero-display {
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  max-width: 32ch;
}
.verdict-hero .hero-label { margin-bottom: 16px; }

/* Hero metric card (dramatic highlight of one metric) */
.metric-hero {
  padding: 28px 30px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  margin: 0;
  position: relative;
  overflow: hidden;
}
.metric-hero .metric-hero-label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
  color: inherit;
  margin-bottom: 8px;
}
.metric-hero .metric-hero-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 7vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: inherit;
  margin: 0;
}
.metric-hero .metric-hero-caption {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 12px;
  color: inherit;
  line-height: 1.5;
  max-width: 36ch;
}

/* Non-hero metric cards inside the gt grid */
.gt-grid .metric-card {
  margin: 0;
}

/* Hero profile cell — keeps it small, white, contrasts with the hero */
.gt-profile-cell .profile-hero {
  margin: 0;
  padding: 20px 22px;
  min-height: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.gt-profile-cell .profile-pic { width: 56px; height: 56px; }
.gt-profile-cell .profile-handle { font-size: 18px; }
.gt-profile-cell .profile-bio {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.gt-profile-cell .experiment-callout {
  font-size: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.gt-profile-cell .cta { font-size: 12px; padding: 6px 12px; }

/* ============================================================
 * PERCEPTION — oneSentenceCold as pullquote
 * ============================================================ */
.perception-pullquote {
  padding: 28px 32px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.perception-pullquote-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.78;
  color: inherit;
}
.perception-pullquote-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
  color: inherit;
  max-width: 56ch;
}

/* ============================================================
 * ALGORITHM — highestRoiLever card. Tight hero, not a billboard.
 * ============================================================ */
.algo-hero-lever {
  padding: 24px 28px;
  margin-bottom: 0;
}
.algo-hero-lever .roi-tag {
  color: inherit;
  opacity: 0.75;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 11px;
  margin-bottom: 10px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}
.algo-hero-lever h2 {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: inherit;
  max-width: 24ch;
}
.algo-hero-lever p {
  color: inherit;
  opacity: 0.92;
  font-size: 13px;
  line-height: 1.55;
  max-width: 62ch;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.algo-hero-lever .cites {
  color: inherit;
  opacity: 0.6;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid currentColor;
  border-top-color: color-mix(in srgb, currentColor 20%, transparent);
  max-width: 62ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
 * YOU — coreIdentity as a colored feature card (NOT display)
 * Body paragraphs get body size. The blue background carries
 * the "hero" signal; the text stays readable.
 * ============================================================ */
.you-hero-identity {
  padding: 24px 28px;
  margin-bottom: 0;
}
.you-hero-identity h2 {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 12px;
  color: inherit;
}
.you-hero-identity h2::after { content: " *"; opacity: 0.6; }
.you-hero-identity .you-identity-text {
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: inherit;
  margin: 0;
  max-width: 62ch;
}

/* ============================================================
 * NOTEWORTHY — hero variant for #1 outlier
 * ============================================================ */
.nw-hero {
  padding: 36px 38px 32px;
  border-radius: 24px;
  border: 0;
  margin-bottom: 14px;
  position: relative;
}
/* Hero color per category — the color reinforces the lesson type */
.nw-hero.category-breakout              { background: var(--hero-green);  color: var(--hero-green-ink); }
.nw-hero.category-conversation_catalyst { background: var(--hero-green);  color: var(--hero-green-ink); }
.nw-hero.category-quiet_winner          { background: var(--hero-blue);   color: var(--hero-blue-ink); }
.nw-hero.category-served_but_flat       { background: var(--hero-pink);   color: var(--hero-pink-ink); }
.nw-hero.category-reply_magnet          { background: var(--hero-green);  color: var(--hero-green-ink); }
.nw-hero.category-format_win            { background: var(--hero-yellow); color: var(--hero-yellow-ink); }
.nw-hero.category-unexpected_short_hit  { background: var(--hero-yellow); color: var(--hero-yellow-ink); }
.nw-hero.category-high_effort_flop      { background: var(--hero-coral);  color: var(--hero-coral-ink); }

/* Category lesson frame — the small italic sentence explaining what you can learn */
.nw-lesson {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 14px;
  background: var(--surface-sunken);
  border-radius: 10px;
  margin: 8px 0 12px;
}
.nw-hero .nw-lesson {
  background: rgba(13, 13, 15, 0.12);
  color: inherit;
  opacity: 0.9;
}

.nw-hero .nw-head { color: inherit; opacity: 0.82; margin-bottom: 14px; }
.nw-hero .nw-category { background: rgba(13, 13, 15, 0.1); color: inherit; }
.nw-hero .nw-ratio { color: inherit; font-size: 14px; }
.nw-hero .nw-date { color: inherit; opacity: 0.72; }
.nw-hero .nw-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: inherit;
  margin: 4px 0 16px;
}
.nw-hero .nw-stats { color: inherit; opacity: 0.82; }
.nw-hero .nw-commentary, .nw-hero .nw-algo {
  border-top: 1px solid currentColor;
  border-top-color: color-mix(in srgb, currentColor 20%, transparent);
}
.nw-hero .nw-label { color: inherit; opacity: 0.75; }
.nw-hero .nw-commentary p, .nw-hero .nw-algo p { color: inherit; opacity: 0.92; }
.nw-hero .hypothesis-tag { background: rgba(13, 13, 15, 0.12); color: inherit; border-color: transparent; }

/* Hero tag override: on colored backgrounds, use translucent dark chip */
.card-hero .hypothesis-tag,
.card-hero .fact-tag,
.card-hero-xl .hypothesis-tag,
.card-hero-xl .fact-tag {
  background: rgba(13, 13, 15, 0.12);
  color: inherit;
  border-color: transparent;
}

/* When an exp-card is promoted to hero (suggestions page first card),
   inner elements need color adjustments so nothing disappears on color. */
.exp-card.card-hero .exp-title,
.exp-card.card-hero .exp-hypothesis { color: inherit; }
.exp-card.card-hero .exp-metric,
.exp-card.card-hero .exp-source { color: inherit; opacity: 0.7; }
.exp-card.card-hero .exp-category {
  background: rgba(13, 13, 15, 0.1);
  color: inherit;
}
.exp-card.card-hero .exp-reasoning {
  color: inherit;
  opacity: 0.88;
}
.exp-card.card-hero .exp-reasoning strong { color: inherit; }
.exp-card.card-hero .action-row button {
  background: var(--text);
  color: var(--surface);
  border: 0;
}
.exp-card.card-hero .secondary-link { color: inherit !important; opacity: 0.65; }
.exp-card.card-hero .predicate-details summary { color: inherit; opacity: 0.7; }
.exp-card.card-hero .predicate-details pre {
  background: rgba(13, 13, 15, 0.08);
  border-color: transparent;
  color: inherit;
}

/* ============================================================
 * SUGGESTIONS CAROUSEL (on /experiments)
 * ============================================================ */
.sugg-section { margin-bottom: 10px; }
.sugg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.sugg-controls { display: flex; gap: 6px; }
.sugg-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.sugg-arrow:hover { background: var(--surface-sunken); }
.sugg-arrow:active { transform: scale(0.94); }
.sugg-arrow svg { width: 16px; height: 16px; }

.sugg-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.sugg-carousel::-webkit-scrollbar { display: none; }
.sugg-card {
  flex: 0 0 380px;
  scroll-snap-align: start;
  margin: 0;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
}
.sugg-card.card-hero-yellow { flex-basis: 520px; }
.sugg-card .exp-title { margin: 6px 0 6px; font-size: 16px; }
.sugg-card .exp-hypothesis { font-size: 13px; line-height: 1.5; margin-bottom: 8px; }
.sugg-card .exp-reasoning { font-size: 12px; line-height: 1.5; }
.sugg-card .action-row { margin-top: auto; }

/* Delete button on experiment cards */
.exp-delete-form { margin-left: auto; display: inline-flex; }
.exp-delete-btn {
  background: transparent;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.exp-delete-btn svg { width: 14px; height: 14px; }
.exp-card:hover .exp-delete-btn,
.sugg-card:hover .exp-delete-btn { opacity: 0.55; }
.exp-delete-btn:hover { opacity: 1 !important; color: var(--neg); background: var(--neg-bg); }

/* On hero (yellow) cards the trash button needs contrast too */
.card-hero .exp-delete-btn { color: inherit; opacity: 0; }
.card-hero:hover .exp-delete-btn { opacity: 0.55; }
.card-hero .exp-delete-btn:hover { background: rgba(13,13,15,0.12); opacity: 1 !important; }

/* When exp-card sits in the suggestions carousel, the exp-head margin-left:auto
   on delete may collide with exp-verdict; ensure both siblings share the right edge */
.exp-head .exp-verdict + .exp-delete-form { margin-left: 6px; }

/* Line-clamp utilities — cap text height in equal-row grid cells */
.clamp-3, .clamp-4, .clamp-5, .clamp-6, .clamp-8, .clamp-10 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-3  { -webkit-line-clamp: 3; }
.clamp-4  { -webkit-line-clamp: 4; }
.clamp-5  { -webkit-line-clamp: 5; }
.clamp-6  { -webkit-line-clamp: 6; }
.clamp-8  { -webkit-line-clamp: 8; }
.clamp-10 { -webkit-line-clamp: 10; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
