/* Perspective — P3 D1 web UI. Editorial light theme; the reading view is the
   star, so type and measure are tuned for reading, not dashboard density. */
:root {
  --bg: #faf9f7;
  --panel: #ffffff;
  --ink: #1c1a17;
  --ink-soft: #55504a;
  --ink-faint: #8a847c;
  --line: #e7e3dc;
  --line-strong: #d6d0c6;
  --accent: #7a5cff;          /* Perspective violet */
  --accent-soft: #efeaff;
  --builds: #2f7d5b;          /* builds-on green */
  --contests: #c0392b;        /* contests red */
  --echoes: #9a8f80;          /* echoes faint */
  --fringe: #b07d2b;
  --mid: #3f7cac;
  --mainstream: #6b4bb0;
  --radius: 10px;
  --measure: 46rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- masthead ---- */
.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.masthead-inner {
  max-width: 68rem; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: baseline; gap: 14px;
}
.brand {
  font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
  color: var(--ink);
}
.brand .dot { color: var(--accent); }
.brand-sub { color: var(--ink-faint); font-size: 13px; }
.masthead-inner .spacer { flex: 1; }
.masthead a.back { font-size: 14px; }

/* ---- layout ---- */
main { max-width: 68rem; margin: 0 auto; padding: 28px 24px 80px; }
main.reading { max-width: 52rem; }
h1.page-title { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 4px; }
.section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-faint); margin: 34px 0 12px; font-weight: 700;
}
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.loading, .empty { color: var(--ink-faint); padding: 40px 0; text-align: center; }
.error { color: var(--contests); }

/* ---- pills / tags ---- */
.pill {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-soft); background: var(--panel);
  vertical-align: middle;
}
.pill.priority { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pill.rising { border-color: var(--builds); color: var(--builds); }
.pill.tier-fringe { border-color: var(--fringe); color: var(--fringe); }
.pill.tier-mid { border-color: var(--mid); color: var(--mid); }
.pill.tier-mainstream { border-color: var(--mainstream); color: var(--mainstream); }
.pill.tone { border-color: var(--line-strong); color: var(--ink-soft); background: #f4f1ec; text-transform: capitalize; }

/* ---- avatars ---- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  color: #fff; font-weight: 700; font-size: 9px; letter-spacing: 0.02em;
  line-height: 1; user-select: none;
}

/* ---- D2: alert block + loose signals ---- */
.section-note { font-size: 13px; margin: -6px 0 8px; }
.section-title.alert-title { color: var(--accent); margin-top: 14px; }
/* A tinted rail rather than a filled panel: the cards inside already carry the
   colour, and a filled block turned the top of the page into a banner. */
.alert-block {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 60%);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 12px 12px 14px;
}
.alert-block .cards { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 10px; }
.card.compact { padding: 11px 13px; gap: 5px; }
.card.compact h3 { font-size: 15px; }
.card.compact .meta-stat { font-size: 12px; }
.card.compact .actions { margin-top: 2px; padding-top: 6px; }

details.loose {
  margin: 34px 0 8px; border-top: 1px solid var(--line); padding-top: 14px;
}
details.loose > summary {
  cursor: pointer; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-faint); font-weight: 700; list-style: none; padding: 4px 0;
}
details.loose > summary::-webkit-details-marker { display: none; }
details.loose > summary::before { content: "▸ "; color: var(--ink-faint); }
details[open].loose > summary::before { content: "▾ "; }
details.loose > summary:hover { color: var(--ink); }
.loose-list { list-style: none; margin: 8px 0 0; padding: 0; }
.loose-list li {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.loose-list li:last-child { border-bottom: none; }
.loose-list .date {
  color: var(--ink-faint); font-variant-numeric: tabular-nums; font-size: 13px;
  flex: 0 0 5.5rem;
}
.loose-list a { flex: 1 1 18rem; }
.loose-list .src { color: var(--ink-faint); font-size: 12px; }

/* ---- D2 follow-up: filter bar + legend ---- */
/* One compact row. The fold budget (alert block within ~720px) is load-bearing,
   so the bar stays a single line on desktop and the legend collapses to one. */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px;
}
.filter-bar select, .filter-bar input[type="search"] {
  font: inherit; font-size: 13px; color: var(--ink-soft);
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 7px; padding: 4px 8px;
}
.filter-bar select:hover, .filter-bar input[type="search"]:hover { border-color: var(--ink-faint); }
.filter-bar select:focus, .filter-bar input[type="search"]:focus { outline: none; border-color: var(--accent); }
.filter-bar .f-toggle {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px;
  color: var(--ink-soft); cursor: pointer; user-select: none;
}
.filter-bar .f-toggle input { margin: 0; accent-color: var(--accent); }
.filter-bar .f-search { flex: 1 1 8rem; min-width: 7rem; display: flex; }
.filter-bar .f-search input { width: 100%; }
.filter-bar button.ghost { font-size: 13px; padding: 4px 12px; }

.legend { margin: 0 0 2px; font-size: 13px; }
/* The filter bar + collapsed legend cost two rows above the alert block, and the
   one-screen budget (alert block within the viewport) is load-bearing — so the
   count line and the alert title are pulled tight to buy those rows back. */
#lanes > p.faint:first-child { margin: 6px 0 4px; }
.legend > summary {
  cursor: pointer; color: var(--ink-faint); font-size: 13px;
  list-style: none; padding: 2px 0; width: fit-content;
}
.legend > summary::-webkit-details-marker { display: none; }
.legend > summary::before { content: "▸ "; color: var(--ink-faint); }
.legend[open] > summary::before { content: "▾ "; }
.legend > summary:hover { color: var(--ink); }
.legend .leg-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 3px 24px; margin: 10px 0 0; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.leg-row { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; }
.leg-term { flex: 0 0 8.5rem; font-weight: 600; color: var(--ink); }
.leg-def { color: var(--ink-soft); }
.leg-sub {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-faint); font-weight: 700; margin: 14px 0 6px;
}
.leg-threads {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(23rem, 1fr)); gap: 5px 20px;
}
.leg-threads li { display: flex; align-items: baseline; gap: 8px; padding: 1px 0; }
.leg-threads .leg-gloss { color: var(--ink-soft); font-size: 13px; }

/* ---- index cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 8px;
}
.card h3 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.card .desc { color: var(--ink-soft); font-size: 14px; margin: 0; }
.card .meta-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card .meta-stat {
  display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; margin-top: 2px;
}
.card .meta-stat .count { color: var(--ink-faint); }
.card .meta-stat .dates { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.card .meta-stat .dates .arrow { color: var(--ink-faint); margin: 0 5px; }
.card .actions { margin-top: 6px; display: flex; gap: 10px; align-items: center; }
.card .actions .soon { color: var(--ink-faint); cursor: default; }

button {
  font: inherit; font-size: 13px; cursor: pointer;
  background: var(--accent); color: #fff; border: none; border-radius: 7px;
  padding: 5px 12px;
}
button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.55; cursor: default; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* ---- reading view ---- */
.reading-head { margin-bottom: 6px; }
.reading-head .desc { color: var(--ink-soft); font-size: 16px; margin: 8px 0 12px; max-width: var(--measure); }
.reading-head .stats { color: var(--ink-faint); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.verify-note {
  font-size: 13px; color: var(--ink-faint); border-left: 3px solid var(--line-strong);
  padding: 4px 12px; margin: 14px 0 0; background: var(--panel);
}

.arc li { margin: 4px 0; }
.arc .kind { font-weight: 700; color: var(--ink); text-transform: capitalize; }

/* lineage forest */
.root { margin: 0 0 26px; }
.root > .root-take { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 20px; border-left: 1px solid var(--line); padding-left: 16px; }
.node { padding: 10px 0; border-bottom: 1px dotted var(--line); }
.node-head { font-size: 15px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.node .rel { font-weight: 700; font-size: 13px; }
.node .rel.builds-on { color: var(--builds); }
.node .rel.contests { color: var(--contests); }
.node .rel.echoes { color: var(--echoes); }
.node .rel.originates { color: var(--accent); }
.node .node-title { font-weight: 600; color: var(--ink); }
.node .node-title:hover { color: var(--accent); }
/* attribution row: author reads first (dark), publication accented, date faint */
.node .attrib { display: flex; align-items: center; gap: 7px; margin: 5px 0 2px; font-size: 13px; }
.node .attrib .author { font-weight: 600; color: var(--ink); }
.node .attrib .pub { color: var(--mid); }
.node .attrib .pub::before { content: ""; }
.node .attrib .date { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.node .attrib .pub + .date::before,
.node .attrib .author + .pub::before { content: "·"; margin-right: 7px; color: var(--line-strong); }
.node .take { margin: 5px 0 2px; color: var(--ink); }
.node .rationale { color: var(--ink-soft); font-size: 13.5px; font-style: italic; margin: 2px 0; }
.node blockquote {
  margin: 6px 0 2px; padding: 4px 0 4px 14px; border-left: 3px solid var(--accent);
  color: var(--ink-soft); font-size: 14.5px;
}
.node blockquote.trunc { border-left-color: var(--line-strong); }
.node blockquote .flag { color: var(--ink-faint); font-size: 12px; font-style: italic; }

/* contested */
.contested-pair {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch;
  margin: 12px 0; padding: 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.contested-pair .side { font-size: 14px; }
.contested-pair .side .who { color: var(--ink-faint); font-size: 12.5px; }
.contested-pair .vs { align-self: center; color: var(--contests); font-weight: 700; font-size: 13px; }
.contested-pair .rationale { grid-column: 1 / -1; color: var(--ink-soft); font-style: italic; font-size: 13.5px; }

/* voices */
.voices { list-style: none; padding: 0; }
.voices li { margin: 8px 0; display: flex; align-items: center; gap: 10px; }
.voices .voice-body { font-size: 14.5px; }
.voices .who { font-weight: 600; }
.voices .cited { color: var(--builds); font-size: 13px; }
.voices .srcs { color: var(--ink-faint); font-size: 13px; }

/* ---- visualization pages (timeline + map) ---- */
.viz-head { margin-bottom: 10px; }
.viz-head-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.viz-head .desc { color: var(--ink-soft); font-size: 15px; margin: 8px 0 10px; max-width: var(--measure); }
.viz-head .stats { color: var(--ink-faint); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 12px; }

.view-nav { display: flex; gap: 2px; background: #efece6; border-radius: 8px; padding: 3px; }
.view-nav .view-tab {
  font-size: 13px; padding: 4px 12px; border-radius: 6px;
  color: var(--ink-soft); text-decoration: none;
}
.view-nav .view-tab:hover { color: var(--ink); text-decoration: none; }
.view-nav .view-tab.active { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.viz-layout { display: grid; grid-template-columns: 1fr 20rem; gap: 22px; align-items: start; margin-top: 14px; }
@media (max-width: 62rem) { .viz-layout { grid-template-columns: 1fr; } }
.chart-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px 10px; overflow: hidden;
}
.side-panel {
  position: sticky; top: 74px; max-height: calc(100vh - 96px); overflow-y: auto;
  border-left: 1px solid var(--line); padding-left: 18px;
}
.side-panel .section-title { margin-top: 0; }
.side-panel .section-title ~ .section-title { margin-top: 26px; }
.panel-hint { color: var(--ink-faint); font-size: 13px; }
.side-panel .rationale { color: var(--ink-soft); font-style: italic; font-size: 13.5px; }
.side-panel button.ghost { margin-top: 16px; }

/* detail card (shared by both viz pages) */
.detail-card { font-size: 14px; }
.detail-card .d-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.detail-card .d-head .rel { font-size: 12px; font-weight: 700; }
.detail-card .d-head .rel.builds-on { color: var(--builds); }
.detail-card .d-head .rel.contests { color: var(--contests); }
.detail-card .d-head .rel.echoes { color: var(--echoes); }
.detail-card .d-head .rel.originates { color: var(--accent); }
.detail-card .d-title { display: block; font-weight: 600; font-size: 15px; color: var(--ink); line-height: 1.35; }
.detail-card .d-title:hover { color: var(--accent); }
.detail-card .attrib { display: flex; align-items: center; gap: 7px; margin: 7px 0 2px; font-size: 12.5px; flex-wrap: wrap; }
.detail-card .attrib .author { font-weight: 600; color: var(--ink); }
.detail-card .attrib .pub { color: var(--mid); }
.detail-card .attrib .date { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.detail-card .attrib .author + .pub::before,
.detail-card .attrib .pub + .date::before { content: "·"; margin-right: 7px; color: var(--line-strong); }
.detail-card .take { margin: 8px 0 4px; color: var(--ink); }
.detail-card blockquote {
  margin: 8px 0 2px; padding: 4px 0 4px 12px; border-left: 3px solid var(--accent);
  color: var(--ink-soft); font-size: 13.5px;
}
.detail-card blockquote.trunc { border-left-color: var(--line-strong); }
.detail-card blockquote .flag { color: var(--ink-faint); font-size: 12px; font-style: italic; }
.detail-card .d-cited { margin-top: 8px; color: var(--builds); font-size: 12.5px; }

/* legends */
.viz-legend {
  display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 4px 2px;
  font-size: 12px; color: var(--ink-faint);
}
.viz-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend .sw { display: inline-block; width: 12px; text-align: center; }
.viz-legend .sw.diamond { width: 9px; height: 9px; background: var(--ink-soft); transform: rotate(45deg); }
.viz-legend .sw.dash { width: 14px; height: 0; border-top: 1px dashed var(--ink-faint); }
.viz-legend .sw.zig { color: var(--ink-soft); font-weight: 700; }

.map-legend { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--ink-soft); }
.map-legend li { display: flex; align-items: center; gap: 9px; margin: 7px 0; }
.map-legend .ed { width: 26px; height: 0; flex: 0 0 auto; }
.map-legend .ed.builds-on { border-top: 2px solid var(--builds); }
.map-legend .ed.contests { border-top: 2px dashed var(--contests); }
.map-legend .ed.echoes { border-top: 1px solid var(--echoes); }
.map-legend .nd { width: 26px; flex: 0 0 auto; text-align: center; color: var(--ink-faint); font-size: 11px; }

/* ---- SVG: shared axis ---- */
.axis-line { stroke: var(--line-strong); stroke-width: 1; }
.tick { stroke: var(--line-strong); stroke-width: 1; }
.tick-label { fill: var(--ink-faint); font-size: 10.5px; text-anchor: middle; font-variant-numeric: tabular-nums; }
.tick-label.major { fill: var(--ink-soft); font-weight: 600; }
/* A break is absence, so it gets no fill — just edges, a zigzag and a duration.
   .break-hit is the invisible hover target for the full-length tooltip. */
.axis-break .break-hit { fill: transparent; }
/* solid, not dashed — inflection rules are the dashed verticals, and two kinds
   of dashed vertical in one chart is a coin-flip for the reader */
.axis-break .break-edge { stroke: var(--line); stroke-width: 1; }
.axis-break:hover .break-edge { stroke: var(--line-strong); }
.axis-break .break-zig { fill: none; stroke: var(--ink-faint); stroke-width: 1.4; }
.axis-break .break-label { fill: var(--ink-faint); font-size: 9.5px; text-anchor: middle; font-style: italic; }

/* ---- SVG: timeline ---- */
.timeline-svg { display: block; }
.timeline-svg .lane-band { fill: transparent; }
.timeline-svg .lane-band.lane-mid { fill: #faf9f7; }
.timeline-svg .lane-rule { stroke: var(--line); stroke-width: 1; }
.timeline-svg .lane-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.timeline-svg .lane-label.tier-fringe { fill: var(--fringe); }
.timeline-svg .lane-label.tier-mid { fill: var(--mid); }
.timeline-svg .lane-label.tier-mainstream { fill: var(--mainstream); }

.timeline-svg .dot { cursor: pointer; }
.timeline-svg .dot circle, .timeline-svg .dot path { stroke: var(--panel); stroke-width: 1.5; }
.timeline-svg .dot.tier-fringe circle, .timeline-svg .dot.tier-fringe path { fill: var(--fringe); }
.timeline-svg .dot.tier-mid circle, .timeline-svg .dot.tier-mid path { fill: var(--mid); }
.timeline-svg .dot.tier-mainstream circle, .timeline-svg .dot.tier-mainstream path { fill: var(--mainstream); }
.timeline-svg .dot:hover circle, .timeline-svg .dot:hover path { stroke: var(--ink); }
.timeline-svg .dot.selected circle, .timeline-svg .dot.selected path { stroke: var(--accent); stroke-width: 2.5; }
/* must follow the tier fills — same specificity, so source order decides */
.timeline-svg .dot circle.hit,
.timeline-svg .dot:hover circle.hit { fill: transparent; stroke: none; }

.timeline-svg .flag line { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 2 3; }
.timeline-svg .flag text { fill: var(--ink-soft); font-size: 10.5px; }
.timeline-svg .flag-tier-crossing line { stroke: var(--accent); }
.timeline-svg .flag-tier-crossing text { fill: var(--accent); font-weight: 600; }

/* ---- SVG: discourse map ---- */
.map-svg { display: block; cursor: grab; }
.map-svg:active { cursor: grabbing; }
.map-svg .edge { fill: none; }
.map-svg .edge.builds-on { stroke: var(--builds); stroke-width: 1.5; opacity: 0.55; }
.map-svg .edge.contests { stroke: var(--contests); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: 0.8; }
.map-svg .edge.echoes { stroke: var(--echoes); stroke-width: 1; opacity: 0.45; }
.map-svg .edge.lit { opacity: 1; stroke-width: 2.5; }
.map-svg .edge.dim { opacity: 0.08; }

.map-svg .mnode { cursor: pointer; }
.map-svg .mnode circle, .map-svg .mnode path { stroke: var(--panel); stroke-width: 1.5; }
.map-svg .mnode.tier-fringe circle, .map-svg .mnode.tier-fringe path { fill: var(--fringe); }
.map-svg .mnode.tier-mid circle, .map-svg .mnode.tier-mid path { fill: var(--mid); }
.map-svg .mnode.tier-mainstream circle, .map-svg .mnode.tier-mainstream path { fill: var(--mainstream); }
.map-svg .mnode.root path { stroke: var(--accent); stroke-width: 2.5; }
.map-svg .mnode:hover circle, .map-svg .mnode:hover path { stroke: var(--ink); }
.map-svg .mnode.selected circle, .map-svg .mnode.selected path { stroke: var(--accent); stroke-width: 3; }
.map-svg .mnode.dim { opacity: 0.18; }
.map-svg .mnode.dragging { cursor: grabbing; }

/* ---- D2 follow-up: compare selection + compare page ---- */
/* card selection toggle — pushed to the right of the actions row */
.cmp-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--ink-soft); cursor: pointer; user-select: none;
}
.cmp-toggle input { margin: 0; accent-color: var(--accent); }
.cmp-toggle input:disabled { cursor: default; }
.card.compact .cmp-toggle { font-size: 11px; }

/* floating compare bar — one pill, slides up from the bottom when trends are picked */
.compare-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 20;
  transform: translateX(-50%) translateY(140%); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 10px 8px 18px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.compare-bar.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.compare-bar .cmp-label { font-weight: 700; font-size: 13px; }
.compare-bar .cmp-count { color: var(--ink-faint); font-size: 13px; }

/* compare columns */
.compare-note { max-width: var(--measure); margin: 6px 0 0; }
.compare-cols {
  display: flex; gap: 18px; align-items: stretch; overflow-x: auto;
  margin-top: 18px; padding-bottom: 8px;
}
.compare-col {
  flex: 1 1 0; min-width: 20rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 9px;
}
.compare-col .cmp-head { display: flex; flex-direction: column; gap: 7px; }
.compare-col .cmp-head h3 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.compare-col .cmp-stat {
  display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--ink-soft);
}
.compare-col .cmp-stat .cmp-span { font-variant-numeric: tabular-nums; }
.compare-col .cmp-stat .arrow { color: var(--ink-faint); margin: 0 5px; }
.cmp-arc {
  display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12.5px;
  color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.cmp-arc .cx.originates { color: var(--accent); font-weight: 600; }
.cmp-arc .cx.none { color: var(--ink-faint); font-style: italic; }
.spark-wrap { margin-top: 2px; }
.cmp-links { display: flex; gap: 14px; font-size: 13px; margin-top: auto; padding-top: 4px; }

/* the mini timeline reuses .timeline-svg; only the label size + cursor change */
.spark-svg { display: block; }
.spark-svg .lane-label { font-size: 9px; }
.spark-svg .dot { cursor: default; }

/* ---- search lens (W1b) ---- */
/* Web items are a neutral slate — deliberately NOT a tier colour, so the eye never
   mistakes a web result for a curated fringe/mid/mainstream item. */
:root { --web: #6b6560; --web-soft: #efece8; }
.pill.tier-web { border-color: var(--web); color: var(--web); background: var(--web-soft); }
.pill.verified { border-color: var(--builds); color: var(--builds); }
.pill.date-only { border-color: var(--line-strong); color: var(--ink-faint); }

.lens-sub { color: var(--ink-faint); font-size: 13px; margin: 0 0 12px; }
.lens-overview { font-size: 17px; color: var(--ink); max-width: var(--measure); margin: 4px 0 8px; }
.lens-flag {
  border-left: 3px solid var(--fringe); background: #fbf6ec;
  color: var(--ink-soft); font-size: 14px; padding: 8px 12px; margin: 8px 0; border-radius: 0 6px 6px 0;
}
.lens-gaps { color: var(--ink-soft); max-width: var(--measure); }

.lens-cite { font-size: 14px; margin: 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.lens-cite .cite-title { font-weight: 600; }
.lens-cite .cite-meta { color: var(--ink-faint); }

.lens-earliest { border-left: 3px solid var(--accent); padding: 6px 0 6px 14px; margin: 4px 0 8px; }
.lens-earliest blockquote, .lens-claim blockquote {
  margin: 6px 0; padding-left: 12px; border-left: 3px solid var(--line-strong);
  color: var(--ink-soft); font-style: italic; max-width: var(--measure);
}
.lens-claim blockquote.trunc { border-left-color: var(--fringe); }
.lens-claim blockquote .flag { color: var(--ink-faint); font-size: 12px; font-style: italic; }

.lens-claim { margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.lens-claim .claim-text { font-size: 16px; margin-bottom: 2px; max-width: var(--measure); }
.lens-claim .meta-note { color: var(--ink-faint); font-size: 13px; font-style: italic; margin: 4px 0; }

.lens-lineage { list-style: none; padding: 0; margin: 0; }
.lens-lineage .lin-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lin-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.lin-head .rel { font-weight: 700; font-size: 13px; }
.lin-head .rel.originates { color: var(--accent); }
.lin-head .rel.builds-on { color: var(--builds); }
.lin-head .rel.contests { color: var(--contests); }
.lin-head .rel.echoes { color: var(--echoes); }
.lin-head .lin-parent { color: var(--ink-faint); font-size: 13px; }
.lin-note { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }

.lens-pool { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0; }
.lens-pool th { text-align: left; color: var(--ink-faint); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line-strong); }
.lens-pool td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lens-pool td:nth-child(3) { white-space: nowrap; }

.lens-build { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 4px; }
.lens-input {
  flex: 1; min-width: 240px; padding: 9px 12px; font-size: 15px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink);
}
.lens-input:focus { outline: none; border-color: var(--accent); }
.lens-build .faint { flex-basis: 100%; margin: 0; }
.lens-list { line-height: 1.9; }

/* lens timeline: adaptive lanes incl. a slate "web" lane */
.timeline-svg.lens-timeline .lane-band.lane-web { fill: var(--web-soft); }
.timeline-svg .lane-label.tier-web { fill: var(--web); }
.timeline-svg .dot.tier-web circle, .timeline-svg .dot.tier-web path { fill: var(--web); }
/* date-only items read as hollow — no full text behind them to quote. The base
   .dot circle stroke is white (a halo over the band); here the ring IS the mark, so
   it takes the lane colour and an empty (panel) fill. */
.timeline-svg .dot.date-only circle.hollow { fill: var(--panel); stroke-width: 1.5; }
.timeline-svg .dot.tier-web.date-only circle.hollow { stroke: var(--web); }
.timeline-svg .dot.tier-fringe.date-only circle.hollow { stroke: var(--fringe); }
.timeline-svg .dot.tier-mid.date-only circle.hollow { stroke: var(--mid); }
.timeline-svg .dot.tier-mainstream.date-only circle.hollow { stroke: var(--mainstream); }
.viz-legend .sw.dot-fill { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-soft); }
.viz-legend .sw.dot-hollow { width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 1.5px solid var(--ink-soft); }

/* ---- Related stories (W2): subordinate to the verified discourse above ---- */
.related { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--line-strong); }
.related .section-title { margin-top: 18px; }
.related .related-list { list-style: none; padding: 0; margin: 0 0 10px; }
.related .related-list li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.related .related-list li:last-child { border-bottom: none; }
.related .related-list .meta { color: var(--ink-faint); }
.related .muted { color: var(--ink-soft); font-size: 14px; margin: 6px 0; }
.related .muted.small { font-size: 12px; color: var(--ink-faint); }
.related .stale { color: var(--accent); }
.related .related-refresh { font-size: 12px; }
.related .related-build { margin-top: 6px; }
.related .related-build.deep-build { margin-top: 2px; }

/* W2.5 deep dive: the same subordinate list, rows now expandable to a mini report. */
.related .related-deep .deep-item { }
.related .related-deep .deep-item > summary {
  list-style: none; cursor: pointer; outline: none;
}
.related .related-deep .deep-item > summary::-webkit-details-marker { display: none; }
.related .related-deep .deep-item > summary::before {
  content: "\25B8 "; color: var(--ink-faint); font-size: 12px;
}
.related .related-deep .deep-item[open] > summary::before { content: "\25BE "; }
.related .related-deep .deep-body {
  padding: 6px 0 4px 16px; margin-top: 2px;
}
.related .related-deep .deep-summary {
  color: var(--ink-soft); font-size: 14px; margin: 0 0 8px; line-height: 1.5;
}
.related .related-deep .deep-quote {
  margin: 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--builds);
  color: var(--ink); font-size: 14px; line-height: 1.5;
}
.related .related-deep .deep-quote .verified {
  color: var(--builds); font-size: 11px; font-weight: 700; white-space: nowrap;
}
.related .related-deep .deep-fallback { margin: 0; font-style: italic; }

/* Public gallery footer (perspective.simontho.com). Inert on localhost — no page
   there renders a .site-footer element; the public index.html / lens.html do. */
.site-footer {
  max-width: var(--measure);
  margin: 48px auto 40px;
  padding: 16px 20px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.6;
}
.site-footer strong { color: var(--ink-soft); font-weight: 600; }
.site-footer a { color: var(--accent); }
