/* === Gemma-4-E2B Brain Atlas === */
/* Aesthetic: bright pastels on warm cream paper. Dawn-light, not dark. */

:root {
  /* — Surfaces — */
  --bg:        #efe9de;   /* warm sage-cream paper */
  --bg-2:      #f6f1e6;   /* a notch up — main card surface */
  --bg-3:      #fbf6ea;   /* lifted card / well */
  --bg-4:      #ffffff;
  --bg-tint-rose:     #f6e7e2;
  --bg-tint-sage:     #e6efe2;
  --bg-tint-lavender: #ece6f1;
  --bg-tint-amber:    #f6ecd6;

  --hairline:   rgba(74, 58, 68, 0.13);
  --hairline-2: rgba(74, 58, 68, 0.22);

  /* — Ink (warm dark, not black) — */
  --ink:        #3a2a30;
  --ink-2:      #5b454c;
  --ink-3:      #84686c;
  --ink-dim:    #a89090;

  /* — Pastels — brighter than v1 — */
  --lavender:    #c9b8e6;
  --lavender-2:  #9a87cf;
  --rose:        #ecb5be;
  --rose-2:      #cf8d96;
  --sage:        #aacca0;
  --sage-2:      #7da272;
  --coral:       #f5b9a3;
  --coral-2:     #d97f64;
  --cream:       #f4d99e;
  --gold:        #f0c98a;
  --mint:        #c4e3d2;
  --periwinkle:  #b8c7e6;

  /* — Heat ramp (used in plot + bars + chips) — */
  --heat-0: #ece6f1;  /* pale lavender wash */
  --heat-1: #d8c4dc;
  --heat-2: #c9a8c2;
  --heat-3: #d8a3b2;
  --heat-4: #e8aea0;
  --heat-5: #f0c890;
  --heat-6: #f4dfa0;

  --shadow-soft:  0 1px 0 rgba(255,255,255,0.7) inset, 0 2px 6px rgba(74,58,68,0.06);
  --shadow-warm:  0 8px 24px -10px rgba(74,58,68,0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
  --shadow-lift:  0 16px 40px -16px rgba(74,58,68,0.22), 0 1px 0 rgba(255,255,255,0.9) inset;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --serif: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans:  'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-feature-settings: 'ss01', 'cv02', 'cv11';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Soft watercolor glow on the page — warm dawn light */
.atlas-root {
  min-height: 100vh;
  background:
    radial-gradient(1200px 800px at 8% -10%, rgba(201,184,230,0.32), transparent 60%),
    radial-gradient(900px 700px at 100% 8%, rgba(245,185,163,0.26), transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, rgba(170,204,160,0.28), transparent 60%),
    var(--bg);
}

.mono { font-family: var(--mono); font-variant-ligatures: none; }
.muted { color: var(--ink-3); }
.dim   { color: var(--ink-3); }
.strong { color: var(--ink); font-weight: 600; }
.a-right { text-align: right; }
.w-9  { width: 2.25rem; display: inline-block; }
.w-12 { width: 3rem;    display: inline-block; }
.dot  { color: var(--ink-dim); margin: 0 .4em; }

/* === Page chrome === */

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 36px 96px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 14px 22px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 30%, #fff 0%, var(--rose) 30%, var(--lavender) 60%, var(--sage) 100%);
  box-shadow:
    0 0 0 1px rgba(74,58,68,0.10),
    inset 0 0 12px rgba(255,255,255,0.6),
    0 6px 18px rgba(201,184,230,0.40);
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 14px;
  background: radial-gradient(circle at 70% 70%, rgba(255,255,255,0.45), transparent 50%);
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-family: var(--serif); font-weight: 500;
  font-size: 22px; letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
}
.brand-name em { font-style: italic; color: var(--lavender-2); font-weight: 400; }
.brand-sub {
  font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.topbar-meta {
  display: flex; align-items: center; gap: 22px;
  font-size: 12px; color: var(--ink-2);
}
.topbar-meta .k { color: var(--ink-3); margin-right: 6px; }
.topbar-meta .v { color: var(--ink); font-family: var(--mono); }

.credit {
  font-size: 11px; color: var(--ink-3);
}
.credit b { color: var(--ink); font-weight: 500; }

/* === Hero band === */

.hero-band {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
  margin-bottom: 22px;
}

.hero-copy {
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px 30px 30px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.55), rgba(255,255,255,0.25)),
    linear-gradient(160deg, var(--bg-tint-lavender), var(--bg-tint-sage));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-warm);
  position: relative; overflow: hidden;
}
.hero-copy::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(244,217,158,0.45), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--lavender-2); font-weight: 500;
}
.hero-title {
  font-family: var(--serif); font-weight: 400;
  font-size: 40px; line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0; text-wrap: pretty;
  color: var(--ink);
  max-width: 22ch;
}
.hero-title em { font-style: italic; color: var(--rose-2); }
.hero-lede {
  font-size: 14.5px; line-height: 1.55; color: var(--ink-2);
  max-width: 60ch;
}
.hero-lede b { color: var(--ink); font-weight: 600; }
.hero-stats {
  display: flex; gap: 28px; margin-top: 6px;
  flex-wrap: wrap;
}
.hero-stat { display: flex; flex-direction: column; gap: 4px; }
.hero-stat .n {
  font-family: var(--serif); font-size: 24px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.01em;
}
.hero-stat .l {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
}

.ingest-card {
  padding: 22px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.7), rgba(255,255,255,0.4)),
    linear-gradient(160deg, var(--bg-tint-rose), var(--bg-tint-amber));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 14px;
}
.ingest-card .bf-eyebrow { color: var(--coral-2); }
.ingest-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--ink-2);
}
.ingest-row .k { color: var(--ink-3); }
.ingest-row .v { font-family: var(--mono); color: var(--ink); }
.ingest-progress {
  height: 6px; border-radius: 999px;
  background: rgba(74,58,68,0.08);
  overflow: hidden; position: relative;
}
.ingest-progress > span {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--rose), var(--coral), var(--gold));
  border-radius: 999px;
  width: 50%;
  box-shadow: 0 0 12px rgba(245,185,163,0.5);
}
.ingest-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }

/* === Section card === */

.card {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
}

/* === Section headings shared === */
.bf-eyebrow {
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--lavender-2); font-weight: 600;
}
.bf-sub {
  font-family: var(--serif); font-style: italic;
  font-size: 16px; color: var(--ink-2); margin-top: 4px;
}

/* === Main grid: heatmap (hero) + side panel === */

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  margin-bottom: 22px;
}

.hm-card {
  padding: 22px 24px 16px;
  display: flex; flex-direction: column;
  min-height: 720px;
}
.hm-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px;
}
.hm-legend {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--ink-3);
}
.hm-legend-bar {
  width: 160px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg,
    var(--heat-0) 0%, var(--heat-1) 18%, var(--heat-2) 36%, var(--heat-3) 56%, var(--heat-4) 74%, var(--heat-5) 88%, var(--heat-6) 100%);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

/* === Heatmap component === */

.atlas-heatmap-shell { position: relative; flex: 1; min-height: 600px; }
.atlas-heatmap-plot  { width: 100%; height: 100%; }
.atlas-heatmap-marker {
  position: absolute;
  width: 28px; height: 16px; transform: translate(-50%, -50%);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85), 0 0 18px rgba(201,184,230,0.6);
  pointer-events: none;
  animation: cell-pulse 1.6s ease-in-out infinite;
}
@keyframes cell-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.06); }
}
.atlas-heatmap-readout {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2);
  padding: 10px 6px 0;
  border-top: 1px dashed var(--hairline);
  margin-top: 8px;
}
.atlas-heatmap-readout b { color: var(--ink); font-weight: 600; }

.hm-axes {
  display: flex; gap: 26px; font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.04em;
}
.hm-axes b { color: var(--ink); font-weight: 500; }

/* === Behavior finder === */

.bf { display: flex; flex-direction: column; gap: 14px; min-height: 720px; }
.bf-head {}
.bf-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.bf-pill {
  appearance: none; background: rgba(255,255,255,0.5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 11px 12px 10px;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr; grid-template-rows: auto auto auto;
  gap: 2px 10px;
  cursor: pointer;
  transition: all 160ms ease;
  color: var(--ink-2);
  font-family: var(--sans);
}
.bf-pill:hover {
  background: rgba(201,184,230,0.18);
  border-color: var(--lavender);
  transform: translateY(-1px);
}
.bf-pill.is-active {
  background: linear-gradient(160deg, rgba(201,184,230,0.45), rgba(236,181,190,0.30));
  border-color: var(--lavender-2);
  box-shadow: 0 0 0 1px rgba(154,135,207,0.25), 0 8px 24px rgba(201,184,230,0.35);
  color: var(--ink);
}
.bf-glyph {
  grid-row: 1 / span 2;
  font-family: var(--serif); font-size: 22px;
  color: var(--lavender-2); line-height: 1;
  align-self: center;
  width: 28px; text-align: center;
}
.bf-pill.is-active .bf-glyph { color: var(--rose-2); }
.bf-label {
  font-size: 13px; font-weight: 600;
  color: var(--ink);
}
.bf-peak {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3);
}
.bf-curve {
  grid-column: 1 / -1;
  width: 100%; height: 22px;
  margin-top: 4px;
}
.bf-curve-line { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.bf-curve-line.is-active { stroke: var(--rose-2); stroke-width: 1.5; }
.bf-curve-fill { fill: rgba(154,135,207,0.10); }
.bf-curve-fill.is-active { fill: rgba(207,141,150,0.30); }

.bf-foot {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; padding-top: 8px;
  border-top: 1px dashed var(--hairline);
  color: var(--ink-2);
}
.bf-foot b { color: var(--ink); }
.link-btn {
  background: none; border: none; color: var(--lavender-2);
  font-family: var(--sans); font-size: 12px;
  cursor: pointer; padding: 4px 0;
  border-bottom: 1px dotted var(--lavender);
  font-weight: 500;
}
.link-btn:hover { color: var(--rose-2); border-color: var(--rose); }

/* === Surgical targets table === */

.st { display: flex; flex-direction: column; gap: 14px; }
.st-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap;
}
.st-search {
  appearance: none; background: var(--bg-4);
  border: 1px solid var(--hairline-2);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--sans); font-size: 12.5px;
  color: var(--ink); width: 320px;
  outline: none; transition: all 160ms ease;
}
.st-search:focus { border-color: var(--lavender-2); box-shadow: 0 0 0 3px rgba(201,184,230,0.30); }

.st-table-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-4);
}
.st-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.st-table thead th {
  position: sticky; top: 0;
  background: var(--bg-2);
  color: var(--ink-3);
  font-weight: 600;
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  user-select: none;
  text-align: left;
}
.st-table thead th.a-right { text-align: right; }
.st-th:hover { color: var(--ink); }
.st-arrow { color: var(--lavender-2); margin-left: 4px; }

.st-table tbody tr {
  border-top: 1px solid var(--hairline);
  transition: background 100ms ease;
  cursor: pointer;
}
.st-table tbody tr:hover {
  background: rgba(201,184,230,0.10);
}
.st-table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--ink-2);
}
.st-desc { color: var(--ink); max-width: 360px; }
.st-bar {
  display: inline-block;
  width: 50px; height: 5px; border-radius: 3px;
  background: rgba(74,58,68,0.08);
  margin-right: 8px;
  vertical-align: middle;
  position: relative; overflow: hidden;
}
.st-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--v) * 100%);
}
.st-bar.tone-sage .st-bar-fill { background: var(--sage); }
.st-bar.tone-rose .st-bar-fill { background: var(--rose); }

.st-go { color: var(--lavender-2); font-size: 11px; opacity: 0; transition: opacity 100ms ease; font-weight: 500; }
.st-table tbody tr:hover .st-go { opacity: 1; }
.st-foot { font-size: 11.5px; color: var(--ink-3); }

/* === Layer deep-dive === */

.ld { display: flex; flex-direction: column; gap: 18px; }
.ld-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.ld-title {
  font-family: var(--serif); font-weight: 400;
  font-size: 28px; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 10px;
  margin-top: 4px;
}
.ld-title .lg { font-size: 30px; color: var(--rose-2); }
.ld-title .ld-sep { color: var(--ink-dim); font-family: var(--sans); }
.ld-title .ld-comp { color: var(--ink); font-style: italic; font-family: var(--mono); font-size: 22px; }
.ld-meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.ld-meta b { color: var(--ink); }
.ld-close {
  background: none; border: 1px solid var(--hairline-2);
  width: 30px; height: 30px; border-radius: 50%;
  color: var(--ink-3); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 140ms ease;
}
.ld-close:hover { color: var(--ink); border-color: var(--rose-2); background: rgba(207,141,150,0.10); }

.ld-eyebrow {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--lavender-2); margin-bottom: 10px; font-weight: 600;
}

.ld-section + .ld-section { margin-top: 4px; }

.ld-comps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.ld-comp-chip {
  appearance: none; background: rgba(255,255,255,0.5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 10px;
  transition: all 140ms ease;
  color: var(--ink-2);
}
.ld-comp-chip:hover { border-color: var(--lavender-2); background: rgba(201,184,230,0.14); }
.ld-comp-chip.is-active {
  border-color: var(--rose-2);
  background: linear-gradient(160deg, rgba(236,181,190,0.34), rgba(245,185,163,0.18));
  box-shadow: 0 0 0 1px rgba(207,141,150,0.30);
}
.ld-chip-name { font-size: 11.5px; color: var(--ink); }
.ld-chip-v    { font-size: 11px; color: var(--ink-3); }
.ld-chip-bar  {
  grid-column: 1 / -1;
  height: 4px; border-radius: 2px;
  background: rgba(74,58,68,0.08); overflow: hidden;
}
.ld-chip-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--lavender), var(--rose)); }
.ld-comp-chip.is-empty { opacity: 0.55; }

.ld-cols {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px;
}

.ld-heads { display: flex; flex-direction: column; gap: 4px; }
.ld-head-row {
  display: grid; grid-template-columns: 2.5rem 1fr 1fr 3rem;
  gap: 10px; align-items: center;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--hairline);
}
.ld-head-role { color: var(--ink-2); font-family: var(--mono); font-size: 11.5px; }
.ld-head-bar  { height: 5px; background: rgba(74,58,68,0.08); border-radius: 3px; overflow: hidden; }
.ld-head-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage-2), var(--sage), var(--gold)); }

.ld-feats { display: flex; flex-direction: column; gap: 12px; }
.ld-feat {
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.ld-feat-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--ink-3);
  gap: 12px;
}
.ld-feat-fstat { color: var(--lavender-2); font-weight: 500; }
.ld-feat-dens  { color: var(--sage-2); font-weight: 500; }
.ld-feat-desc {
  font-size: 13px; color: var(--ink); margin-top: 6px; text-wrap: pretty;
  font-family: var(--serif); line-height: 1.4;
}
.ld-feat-fbar {
  height: 3px; border-radius: 2px; margin-top: 8px;
  background: rgba(74,58,68,0.08); overflow: hidden;
}
.ld-feat-fbar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--lavender), var(--rose), var(--coral));
}

.ld-empty {
  padding: 14px 16px;
  background: rgba(255,255,255,0.5);
  border: 1px dashed var(--hairline-2);
  border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
}

/* === SQL box === */

.sql { display: flex; flex-direction: column; gap: 14px; }
.sql-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.sql-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.sql-ex {
  appearance: none; border: 1px solid var(--hairline-2);
  background: rgba(255,255,255,0.5);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--sans); font-size: 11.5px;
  cursor: pointer;
  transition: all 140ms ease;
}
.sql-ex:hover { background: rgba(201,184,230,0.22); color: var(--ink); border-color: var(--lavender-2); }

.sql-editor-wrap {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--bg-4);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.sql-editor {
  display: block; width: 100%;
  min-height: 156px;
  padding: 16px 18px;
  font-family: var(--mono); font-size: 13px; line-height: 1.55;
  background: transparent; color: var(--ink);
  border: none; outline: none; resize: vertical;
  caret-color: var(--rose-2);
}
.sql-editor::selection { background: rgba(201,184,230,0.45); }

.sql-actions {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--hairline);
  background: var(--bg-2);
}
.sql-run {
  appearance: none;
  background: linear-gradient(180deg, var(--lavender) 0%, var(--lavender-2) 100%);
  border: 1px solid var(--lavender-2);
  color: #fff;
  font-family: var(--sans); font-weight: 600; font-size: 12px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(154,135,207,0.30);
  transition: all 140ms ease;
}
.sql-run:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(154,135,207,0.45); }

.sql-error {
  padding: 12px 16px;
  background: rgba(245,185,163,0.20);
  border: 1px solid var(--coral);
  color: var(--coral-2);
  border-radius: var(--radius);
  font-family: var(--mono); font-size: 12.5px;
}

.sql-result { display: flex; flex-direction: column; gap: 10px; }
.sql-stats { font-size: 12px; color: var(--ink-3); }
.sql-table-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: auto; max-height: 360px;
  background: var(--bg-4);
}
.sql-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sql-table thead th {
  position: sticky; top: 0;
  background: var(--bg-2);
  color: var(--ink-3);
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  font-size: 10.5px; letter-spacing: 0.08em;
}
.sql-table tbody td {
  padding: 7px 12px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-2);
  white-space: nowrap;
  max-width: 360px; overflow: hidden; text-overflow: ellipsis;
}
.sql-table tbody tr:hover { background: rgba(201,184,230,0.08); }

/* === Section gaps === */
.section-grid {
  display: grid; grid-template-columns: 1fr; gap: 22px;
  margin-bottom: 22px;
}

/* === Footer === */
.foot {
  margin-top: 36px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--ink-3);
  padding: 18px 22px;
  border-top: 1px solid var(--hairline);
}
.foot b { color: var(--ink-2); font-weight: 600; }
.foot a { color: var(--lavender-2); text-decoration: none; border-bottom: 1px dotted var(--lavender); }

/* === Scrollbars === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(74,58,68,0.15); border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--lavender-2); }

/* === Data source pill === */
.ds { position: relative; }
.ds-pill {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--ink-2);
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.04em;
  transition: all 140ms ease;
}
.ds-pill:hover { background: rgba(201,184,230,0.22); border-color: var(--lavender-2); }
.ds-led {
  width: 7px; height: 7px; border-radius: 50%;
  animation: led-pulse 2.4s ease-in-out infinite;
}
@keyframes led-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1.0;  transform: scale(1.15); }
}
.ds-chev { color: var(--ink-dim); font-size: 9px; }

.ds-panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 460px; z-index: 50;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--bg-3);
  border: 1px solid var(--hairline-2);
  box-shadow: var(--shadow-lift);
}
.ds-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.ds-repo { font-size: 12.5px; color: var(--ink); margin-top: 4px; }
.ds-eyebrow {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--lavender-2); margin-bottom: 8px; font-weight: 600;
}
.ds-section + .ds-section { padding-top: 12px; border-top: 1px dashed var(--hairline); }
.ds-splits { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow: auto; }
.ds-split {
  padding: 8px 12px;
  background: var(--bg-4);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}
.ds-split-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--ink-2); }
.ds-split-bar {
  margin-top: 6px;
  height: 3px; border-radius: 2px;
  background: rgba(74,58,68,0.08);
  overflow: hidden;
}
.ds-split-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--lavender), var(--rose));
  transition: width 240ms ease;
}
.ds-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
  font-size: 11.5px;
}
.ds-stats > div { display: flex; justify-content: space-between; }
.ds-stats .k { color: var(--ink-3); }
.ds-stats .v { color: var(--ink); }
.ds-error {
  background: rgba(245,185,163,0.20);
  border: 1px solid var(--coral);
  color: var(--coral-2);
  padding: 10px 14px; border-radius: 8px;
  font-size: 11.5px;
}
.ds-note { font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.ds-note b { color: var(--ink); }

/* === Surgical-table extras === */
.st-filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.st-leaning {
  display: inline-flex; gap: 4px;
  padding: 3px; border-radius: 999px;
  background: var(--bg-4);
  border: 1px solid var(--hairline);
}
.st-chip {
  appearance: none; background: transparent; border: none;
  padding: 5px 12px; border-radius: 999px;
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.04em;
  color: var(--ink-3); cursor: pointer;
  transition: all 120ms ease;
  font-weight: 500;
}
.st-chip:hover { color: var(--ink); }
.st-chip.is-active { background: rgba(74,58,68,0.06); color: var(--ink); }
.st-chip.tone-rose.is-active { background: rgba(236,181,190,0.40); color: var(--rose-2); }
.st-chip.tone-sage.is-active { background: rgba(170,204,160,0.40); color: var(--sage-2); }

.st-leaning-tag {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.02em;
  font-weight: 500;
}
.st-leaning-tag.tone-rose { background: rgba(236,181,190,0.36); color: var(--rose-2); }
.st-leaning-tag.tone-sage { background: rgba(170,204,160,0.36); color: var(--sage-2); }
.pos { color: var(--sage-2); }
.neg { color: var(--coral-2); }

/* === Taxonomy strip in deep-dive === */
.ld-tax { display: flex; flex-direction: column; gap: 8px; }
.ld-tax-bar {
  display: flex; height: 8px;
  border-radius: 4px; overflow: hidden;
  background: rgba(74,58,68,0.06);
  border: 1px solid var(--hairline);
}
.ld-tax-seg { transition: width 240ms ease; }
.ld-tax-seg.tone-lavender { background: var(--lavender); }
.ld-tax-seg.tone-rose     { background: var(--rose); }
.ld-tax-seg.tone-gold     { background: var(--gold); }
.ld-tax-seg.tone-sage     { background: var(--sage); }
.ld-tax-legend {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  font-size: 11px;
  color: var(--ink-2);
}
.ld-tax-leg { display: flex; align-items: center; gap: 6px; }
.ld-tax-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.ld-tax-dot.tone-lavender { background: var(--lavender); }
.ld-tax-dot.tone-rose     { background: var(--rose); }
.ld-tax-dot.tone-gold     { background: var(--gold); }
.ld-tax-dot.tone-sage     { background: var(--sage); }

/* === Feature card leaning tags === */
.ld-feat-leaning {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 7px; border-radius: 999px;
  font-weight: 500;
}
.ld-feat-leaning.tone-rose { background: rgba(236,181,190,0.36); color: var(--rose-2); }
.ld-feat-leaning.tone-sage { background: rgba(170,204,160,0.36); color: var(--sage-2); }

/* === LANDING / COVER === */

.landing-root {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1400px 900px at 10% -10%, rgba(201,184,230,0.50), transparent 60%),
    radial-gradient(1100px 800px at 100% 5%, rgba(245,185,163,0.45), transparent 60%),
    radial-gradient(1300px 1000px at 50% 110%, rgba(170,204,160,0.40), transparent 60%),
    radial-gradient(900px 700px at 5% 100%, rgba(244,217,158,0.40), transparent 60%),
    var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px 80px;
  opacity: 0;
  animation: landing-in 800ms ease-out 80ms forwards;
}
@keyframes landing-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.landing-shell {
  max-width: 1180px; width: 100%;
  display: flex; flex-direction: column;
  gap: 44px;
}
.landing-head {
  display: flex; flex-direction: column;
  align-items: center; gap: 22px;
  text-align: center;
}
.landing-mark {
  width: 96px; height: 96px;
  opacity: 0; transform: scale(0.92);
  animation: landing-mark-in 900ms cubic-bezier(.4,0,.2,1) 280ms forwards;
}
@keyframes landing-mark-in {
  to { opacity: 1; transform: scale(1); }
}
.landing-eyebrow {
  font-size: 11.5px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--lavender-2); font-weight: 600;
  opacity: 0;
  animation: rise-in 700ms ease-out 480ms forwards;
}
.landing-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 6vw, 64px); line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0; max-width: 22ch;
  color: var(--ink);
  opacity: 0;
  animation: rise-in 800ms ease-out 580ms forwards;
}
.landing-title em { font-style: italic; color: var(--rose-2); }
.landing-lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px; line-height: 1.5;
  max-width: 60ch;
  color: var(--ink-2);
  opacity: 0;
  animation: rise-in 800ms ease-out 720ms forwards;
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.landing-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  justify-content: center;
  font-size: 12px; color: var(--ink-3);
  opacity: 0;
  animation: rise-in 700ms ease-out 880ms forwards;
}
.landing-meta b { color: var(--ink); font-weight: 600; }

.landing-process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  opacity: 0;
  animation: rise-in 900ms ease-out 1020ms forwards;
}
@media (max-width: 920px) {
  .landing-process { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .landing-process { grid-template-columns: 1fr; }
}
.landing-step {
  padding: 22px 22px 24px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-warm);
  display: flex; flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(6px);
  transition: transform 240ms cubic-bezier(.4,0,.2,1), box-shadow 240ms ease;
}
.landing-step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.landing-step-num {
  font-family: var(--serif); font-style: italic;
  font-size: 13px;
  color: var(--lavender-2);
  letter-spacing: 0.02em;
}
.landing-step-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--hairline);
  margin-bottom: 4px;
}
.landing-step-title {
  font-family: var(--serif); font-size: 20px;
  color: var(--ink); font-weight: 500;
  line-height: 1.15; letter-spacing: -0.01em;
}
.landing-step-body {
  font-size: 13px; line-height: 1.55;
  color: var(--ink-2);
  flex: 1;
}
.landing-step-tag {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3);
  padding-top: 8px;
  border-top: 1px dashed var(--hairline);
}

.landing-foot {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  opacity: 0;
  animation: rise-in 800ms ease-out 1240ms forwards;
}
.landing-enter {
  appearance: none;
  font-family: var(--sans); font-weight: 600;
  font-size: 14px; letter-spacing: 0.01em;
  padding: 14px 32px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--lavender), var(--lavender-2));
  color: #fff;
  border: 1px solid var(--lavender-2);
  box-shadow: 0 10px 28px -8px rgba(154,135,207,0.55), 0 2px 0 rgba(255,255,255,0.5) inset;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  display: inline-flex; align-items: center; gap: 10px;
}
.landing-enter:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px -8px rgba(154,135,207,0.65), 0 2px 0 rgba(255,255,255,0.5) inset;
}
.landing-enter .arr {
  display: inline-block; transition: transform 200ms ease;
}
.landing-enter:hover .arr { transform: translateX(4px); }
.landing-skip {
  font-size: 12px; color: var(--ink-3);
  background: none; border: none;
  border-bottom: 1px dotted var(--hairline-2);
  padding: 2px 6px;
  cursor: pointer;
  font-family: var(--sans);
}
.landing-skip:hover { color: var(--ink); }

/* Subtle floating-petal background motes */
.landing-petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.landing-petal {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  animation: drift 24s ease-in-out infinite;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(20px, -30px); }
}
.landing-shell { position: relative; z-index: 1; }

/* === Reduce motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .landing-root, .landing-eyebrow, .landing-title, .landing-lede,
  .landing-mark, .landing-meta, .landing-process, .landing-foot { opacity: 1; transform: none; }
}

/* === Responsive === */
@media (max-width: 1180px) {
  .hero-band { grid-template-columns: 1fr; }
  .main-grid { grid-template-columns: 1fr; }
  .ld-cols   { grid-template-columns: 1fr; }
  .ld-comps  { grid-template-columns: repeat(2, 1fr); }
  .bf        { min-height: auto; }
  .hm-card   { min-height: 620px; }
}

/* ─── Convergence Valley (3D SAE training trajectory) ─────────────────── */
.cv {
  margin-bottom: 22px;
  padding: 26px 28px 22px;
  display: flex; flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.45), rgba(255,255,255,0.18)),
    linear-gradient(180deg, var(--bg-3), var(--bg-2));
}

.cv::before {
  content: ''; position: absolute;
  top: -120px; right: -120px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,184,230,0.32), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.cv::after {
  content: ''; position: absolute;
  bottom: -160px; left: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,217,158,0.28), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.cv > * { position: relative; z-index: 1; }

/* — header — */

.cv-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}

.cv-head-left { display: flex; flex-direction: column; gap: 4px; }
.cv-eyebrow {
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--lavender-2); font-weight: 600;
}

.cv-title {
  font-family: var(--serif); font-weight: 400;
  font-size: 30px; line-height: 1.0;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-top: 2px;
}

.cv-title em { font-style: italic; color: var(--rose-2); }
.cv-sub {
  font-family: var(--serif); font-style: italic;
  font-size: 14px; color: var(--ink-2);
  margin-top: 6px;
  max-width: 56ch;
  line-height: 1.5;
}

.cv-sub b { font-style: normal; font-family: var(--sans); font-weight: 600; color: var(--ink); }
.cv-sub-quiet { color: var(--ink-3); }

.cv-metric-pick {
  display: flex; gap: 6px;
  padding: 4px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.cv-metric-chip {
  appearance: none; background: transparent; border: none;
  padding: 8px 14px 9px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--sans);
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.cv-metric-chip:hover { background: rgba(201,184,230,0.16); }
.cv-metric-chip.is-active {
  background: linear-gradient(170deg, rgba(201,184,230,0.55), rgba(236,181,190,0.30));
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 4px 12px rgba(154,135,207,0.25);
}

.cv-metric-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); letter-spacing: 0.02em;
}

.cv-metric-chip.is-active .cv-metric-label { color: var(--ink); }
.cv-metric-sub {
  font-size: 10px; color: var(--ink-3);
  letter-spacing: 0.02em;
}

.cv-metric-chip.is-active .cv-metric-sub { color: var(--rose-2); }

/* — body grid: 3D stage + ledger sidebar — */

.cv-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
}

.cv-stage {
  position: relative;
  display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(244,217,158,0.20), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.30));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), 0 1px 0 rgba(255,255,255,0.7) inset;
  min-height: 560px;
  overflow: hidden;
}

.cv-plot {
  width: 100%; flex: 1;
  min-height: 500px;
}

.cv-stage-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px 14px;
  border-top: 1px dashed var(--hairline);
  gap: 14px;
  flex-wrap: wrap;
}

.cv-legend {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink-3);
}

.cv-legend-label { font-family: var(--mono); font-size: 10.5px; }
.cv-legend-swatch {
  width: 140px; height: 8px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.cv-legend-metric {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--lavender-2);
  margin-left: 4px;
}

.cv-hint {
  font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--ink-3); font-family: var(--mono);
}

.cv-loading-veil {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.40), rgba(255,255,255,0.10));
  backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 2;
}

.cv-loading-pulse {
  width: 64px; height: 64px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #fff, var(--lavender) 50%, var(--rose) 100%);
  box-shadow: 0 0 40px rgba(201,184,230,0.45);
  animation: cv-pulse 2.2s ease-in-out infinite;
}

.cv-loading-msg {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-2);
  background: rgba(255,255,255,0.7);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
}

.cv-loading-msg b { color: var(--rose-2); font-weight: 600; }

/* — sidebar / per-layer ledger — */

.cv-side {
  display: flex; flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.cv-side-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}

.cv-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer;
  font-size: 11.5px; color: var(--ink-2);
  user-select: none;
}

.cv-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cv-toggle-dot {
  width: 30px; height: 17px;
  border-radius: 999px;
  background: rgba(74,58,68,0.12);
  position: relative;
  transition: background 180ms ease;
}

.cv-toggle-dot::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(74,58,68,0.25);
  transition: transform 180ms cubic-bezier(.4,0,.2,1);
}

.cv-toggle input:checked + .cv-toggle-dot {
  background: linear-gradient(180deg, var(--rose), var(--rose-2));
}

.cv-toggle input:checked + .cv-toggle-dot::after { transform: translateX(13px); }
.cv-toggle-label { font-family: var(--sans); letter-spacing: 0.01em; }

.cv-camera-reset {
  appearance: none;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 11px 6px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-2); letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 140ms ease;
}

.cv-camera-reset:hover {
  background: rgba(201,184,230,0.20);
  border-color: var(--lavender-2);
  color: var(--ink);
}

.cv-side-head { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.cv-side-eyebrow {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--lavender-2); font-weight: 600;
}

.cv-side-sub {
  font-family: var(--serif); font-style: italic;
  font-size: 13px; color: var(--ink-2);
}

.cv-table {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.cv-row {
  display: grid;
  grid-template-columns: 28px 64px 1fr 1fr 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--ink-2);
  border-top: 1px solid var(--hairline);
  transition: background 120ms ease;
}

.cv-row:first-child { border-top: none; }
.cv-row-head {
  background: var(--bg-2);
  color: var(--ink-3);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding-top: 9px; padding-bottom: 9px;
}

.cv-row-empty {
  padding: 14px 12px; color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  grid-template-columns: 1fr;
}

.cv-row.is-rolling { background: linear-gradient(180deg, rgba(201,184,230,0.10), rgba(201,184,230,0.04)); }
.cv-row.is-highlight {
  background: linear-gradient(180deg, rgba(236,181,190,0.20), rgba(236,181,190,0.08));
  box-shadow: inset 3px 0 0 var(--rose-2);
}

.cv-row:hover:not(.cv-row-head):not(.cv-row-empty) { background: rgba(201,184,230,0.08); }

.cv-layer {
  font-family: var(--serif); font-size: 14px; color: var(--ink);
  font-weight: 500;
}

.cv-src {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-2);
}

.cv-src-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex: 0 0 auto;
}

.cv-src-dot.rolling { background: var(--rose-2); box-shadow: 0 0 0 2px rgba(207,141,150,0.20); }
.cv-src-dot.stable  { background: var(--lavender-2); box-shadow: 0 0 0 2px rgba(154,135,207,0.20); }
.cv-src-name { letter-spacing: 0.04em; }
.cv-num { text-align: right; font-size: 11.5px; color: var(--ink); }
.cv-num.mono { font-size: 11px; }

/* ghost-run info card */
.cv-ghost-card {
  background:
    linear-gradient(160deg, rgba(236,181,190,0.18), rgba(244,217,158,0.10));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 12px 14px 13px;
  display: flex; flex-direction: column; gap: 10px;
}

.cv-ghost-eyebrow {
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--rose-2); font-weight: 600;
}

.cv-ghost-rows { display: flex; flex-direction: column; gap: 6px; }
.cv-ghost-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-2);
}

.cv-ghost-layer {
  font-family: var(--serif); font-size: 12.5px;
  color: var(--ink);
}

.cv-ghost-stats { font-size: 10.5px; color: var(--ink-2); }
.cv-ghost-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 999px;
  font-weight: 500;
}

.cv-ghost-tag.tone-rose  { background: rgba(207,141,150,0.30); color: #8a4756; }
.cv-ghost-tag.tone-amber { background: rgba(240,201,138,0.40); color: #8a6a32; }
.cv-ghost-note {
  font-size: 11px; line-height: 1.55;
  color: var(--ink-3);
  padding-top: 6px;
  border-top: 1px dashed var(--hairline);
}

.cv-ghost-note b { color: var(--ink); font-weight: 600; }

/* — scrubber — */

.cv-scrub {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.30));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.cv-play {
  appearance: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--lavender-2);
  background: linear-gradient(180deg, var(--lavender), var(--lavender-2));
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(154,135,207,0.30), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 120ms ease, box-shadow 140ms ease;
}

.cv-play:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(154,135,207,0.45), inset 0 1px 0 rgba(255,255,255,0.5); }
.cv-play.is-playing { background: linear-gradient(180deg, var(--rose), var(--rose-2)); border-color: var(--rose-2); box-shadow: 0 4px 12px rgba(207,141,150,0.40), inset 0 1px 0 rgba(255,255,255,0.5); }
.cv-play-glyph {
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1;
  margin-left: 2px; /* optical alignment of the play triangle */
}

.cv-play.is-playing .cv-play-glyph { margin-left: 0; font-size: 11px; }

.cv-range-wrap { position: relative; padding: 4px 4px 0; min-width: 0; }
.cv-range-track {
  height: 8px; border-radius: 999px;
  background: rgba(74,58,68,0.08);
  overflow: hidden;
  position: relative;
}

.cv-range-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lavender), var(--rose), var(--coral), var(--gold));
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(245,185,163,0.40);
  transition: width 80ms linear;
}

.cv-range {
  position: absolute; inset: 0;
  appearance: none;
  width: 100%; height: 100%;
  background: transparent;
  margin: 0; padding: 0;
  cursor: pointer;
}

.cv-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--rose-2);
  box-shadow: 0 2px 6px rgba(74,58,68,0.22);
  cursor: grab;
  transition: transform 120ms ease;
}

.cv-range::-webkit-slider-thumb:active { transform: scale(1.12); cursor: grabbing; }
.cv-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--rose-2);
  box-shadow: 0 2px 6px rgba(74,58,68,0.22);
  cursor: grab;
}

.cv-range-ticks {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 9.5px;
  color: var(--ink-3);
  padding: 6px 2px 0;
  letter-spacing: 0.04em;
}

.cv-scrub-readout {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.0;
}

.cv-scrub-num {
  font-family: var(--serif); font-weight: 500;
  font-size: 20px; color: var(--ink);
  letter-spacing: -0.01em;
}

.cv-scrub-label {
  font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 4px;
}

.cv-scrub-reset {
  appearance: none;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 12px 7px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-2);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 140ms ease;
}

.cv-scrub-reset:hover {
  background: rgba(201,184,230,0.18);
  border-color: var(--lavender-2);
  color: var(--ink);
}

