/* Ark Tracker styles. One file; tokens follow design/SPEC.md §8. */
:root {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --ink: #1F2328;
  --muted: #5E6670;
  --rule: #E4DED3;
  --accent: #1F5F8B;
  --focus: #1F5F8B;
  --mark: #FCE8A6;

  --type-claim: #B7791F;
  --type-expedition: #2F855A;
  --type-study: #2B6CB0;
  --type-press: #6B46C1;
  --type-interview: #0E7490;
  --type-rebuttal: #C53030;
  /* Text-safe (>= 4.5:1 on white) variants for type labels */
  --type-claim-text: #8A5A12;
  --type-expedition-text: #276749;
  --type-study-text: #2B6CB0;
  --type-press-text: #6B46C1;
  --type-interview-text: #0E7490;
  --type-rebuttal-text: #B42828;
  --chip-site-bg: #F1ECE2;
  --claim-established-bg: #E8F0F8;

  --status-claimed-bg: transparent;   --status-claimed-fg: #3D444D;   --status-claimed-bd: #8A929B;
  --status-disputed-bg: #FBEFD9;      --status-disputed-fg: #7A4D0B;  --status-disputed-bd: #E5C48A;
  --status-debunked-bg: #FBE3E3;      --status-debunked-fg: #8E2424;  --status-debunked-bd: #EDB2B2;
  --status-supported-bg: #E1F2E7;     --status-supported-fg: #22613F; --status-supported-bd: #A9D8BA;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Source Serif Pro", Georgia, ui-serif, serif;
  --fs-body: 1rem;
  --fs-card: 0.9375rem;
  --fs-small: 0.8125rem;
  --lh: 1.55;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --radius: 10px;
  --radius-pill: 999px;
  --max-width: 1120px;
  --timeline-width: 760px;  /* spine gutter + ~720px cards */
  --panel-width: 480px;
  --spine-x: 20px;
  --shadow: 0 1px 2px rgba(31, 35, 40, .06);
}

/* Dark theme everywhere (Nikhil, 23 Oct 2026); palette from design/SPEC-v2-timeline.md. */
:root { color-scheme: dark; }
@media all {
  :root {
    --bg: #0b0d10; --surface: #12151a; --ink: #e8eaed; --muted: #9aa1ab; --rule: #2a2f38;
    --accent: #8ea2ff; --focus: #8ea2ff; --mark: #4a3f1a;
    --card: #161a20; --dim: #5b616b;
    --st-claimed: #f2b84b; --st-disputed: #8ea2ff; --st-debunked: #ff6b6b; --st-supported: #4fd1a5;
    --status-claimed-fg: #C9CED4; --status-claimed-bd: #6E767F;
    --status-disputed-bg: #3A2E17; --status-disputed-fg: #F2CF8E; --status-disputed-bd: #6B5427;
    --status-debunked-bg: #3B1E1E; --status-debunked-fg: #F3B0B0; --status-debunked-bd: #6E3333;
    --status-supported-bg: #183326; --status-supported-fg: #A6DDBC; --status-supported-bd: #2F5E44;
    --shadow: none;
    --type-claim-text: #E3B266; --type-expedition-text: #7DCB9F; --type-study-text: #8DB8E8;
    --type-press-text: #B9A2EC; --type-interview-text: #6CC4D6; --type-rebuttal-text: #F09090;
    --chip-site-bg: #2A2E33;
    --claim-established-bg: #1B2733;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: var(--fs-body)/var(--lh) var(--font-ui);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); margin: var(--space-6) 0 var(--space-3); }
h2 { font-size: 1.25rem; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: var(--space-2) var(--space-4); z-index: 10; }
.skip:focus { left: var(--space-2); top: var(--space-2); }
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-4); }
[hidden] { display: none !important; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); min-height: 56px; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; gap: var(--space-4); }
.site-nav a { color: var(--muted); text-decoration: none; padding: var(--space-2) 0; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.site-search { flex: 1 1 200px; max-width: 360px; margin-left: auto; position: relative; }
.kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 0.75rem var(--font-ui);
  color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; background: var(--surface); pointer-events: none;
}
.site-search input:focus + .kbd { display: none; }
.site-search input {
  width: 100%; font: inherit; padding: var(--space-2) var(--space-3); min-height: 40px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); color: var(--ink);
}
.updated { color: var(--muted); font-size: var(--fs-small); }

.intro { max-width: var(--timeline-width); }
.lede { color: var(--muted); font-size: 1.0625rem; margin-top: 0; }

/* What's new */
.whatsnew { margin: var(--space-6) 0; }
.wn-head { display: flex; align-items: baseline; gap: var(--space-4); flex-wrap: wrap; }
.wn-head h2 { margin: 0; }
.wn-all { margin-left: auto; }
.wn-rss { font-size: var(--fs-small); color: var(--muted); }
.wn-list {
  list-style: none; margin: var(--space-3) 0 0; padding: 0 0 var(--space-2);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr);
  gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory;
}
.wn-card { scroll-snap-align: start; }
.wn-card a {
  display: flex; flex-direction: column; gap: var(--space-1); height: 100%;
  padding: var(--space-3); background: var(--surface); border: 1px solid var(--rule);
  border-top: 3px solid var(--type-color, var(--rule)); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.wn-card a:hover .wn-title { text-decoration: underline; }
.wn-top { display: flex; justify-content: space-between; align-items: center; }
.wn-badge { font-size: 0.625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--surface); background: var(--ink); padding: 1px 5px; border-radius: 3px; }
.wn-count { font: 400 var(--fs-small) var(--font-ui); color: var(--muted); }
.wn-title { font-weight: 600; font-size: var(--fs-card); line-height: 1.35; }
.wn-added { color: var(--muted); font-size: var(--fs-small); margin-top: auto; }

/* Type colours (border/dot only; labels always in ink) */
.type-claim { --type-color: var(--type-claim); --type-text: var(--type-claim-text); }
.type-expedition { --type-color: var(--type-expedition); --type-text: var(--type-expedition-text); }
.type-study { --type-color: var(--type-study); --type-text: var(--type-study-text); }
.type-press { --type-color: var(--type-press); --type-text: var(--type-press-text); }
.type-interview { --type-color: var(--type-interview); --type-text: var(--type-interview-text); }
.type-rebuttal { --type-color: var(--type-rebuttal); --type-text: var(--type-rebuttal-text); }
.type-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--type-text, var(--ink));
}
.type-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--type-color, var(--muted)); flex: none; }
.type-tag.type-rebuttal .type-dot { border-radius: 2px; }
.type-tag.type-study .type-dot { border-radius: 2px; transform: rotate(45deg); width: 9px; height: 9px; }

/* Status pills: text always present */
.pill {
  display: inline-block; padding: 1px 9px; border-radius: var(--radius-pill); border: 1px solid;
  font-size: 0.75rem; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: middle;
}
.status-claimed { background: var(--status-claimed-bg); color: var(--status-claimed-fg); border-color: var(--status-claimed-bd); }
.status-disputed { background: var(--status-disputed-bg); color: var(--status-disputed-fg); border-color: var(--status-disputed-bd); }
.status-debunked { background: var(--status-debunked-bg); color: var(--status-debunked-fg); border-color: var(--status-debunked-bd); }
.status-debunked::before { content: "\2715\00a0"; font-size: .7em; }
.status-supported { background: var(--status-supported-bg); color: var(--status-supported-fg); border-color: var(--status-supported-bd); }
.pill--review { color: var(--muted); border-style: dashed; border-color: var(--muted); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-small);
  text-decoration: none; line-height: 1.6;
}
a.chip:hover { border-color: var(--accent); }
.chip--static { background: var(--chip-site-bg); border-color: transparent; }
.chip--toggle { cursor: pointer; min-height: 36px; padding: 4px 12px; text-transform: none; letter-spacing: 0; }
.chip--toggle[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip--toggle .type-dot { width: 9px; height: 9px; }
.chip--toggle[aria-pressed="true"] .type-dot { box-shadow: 0 0 0 2px var(--surface); }
.chip--active { cursor: pointer; background: var(--bg); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Filters */
.filter-panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  margin: var(--space-6) 0 var(--space-3); box-shadow: var(--shadow);
}
.filter-panel > summary { cursor: pointer; padding: var(--space-3) var(--space-4); font-weight: 600; min-height: 44px; }
.filters { padding: 0 var(--space-4) var(--space-3); display: grid; gap: var(--space-3); }
.f-group { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.f-group legend { float: left; font-size: var(--fs-small); color: var(--muted); font-weight: 600; width: 56px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.f-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.f-select { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-small); color: var(--muted); font-weight: 600; }
.f-select select {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--rule);
  border-radius: 8px; padding: 6px 8px; min-height: 36px; max-width: 220px;
}
.f-zoom { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg { font: inherit; font-size: var(--fs-small); border: 0; background: var(--bg); color: var(--ink); padding: 6px 12px; min-height: 36px; cursor: pointer; }
.seg + .seg { border-left: 1px solid var(--rule); }
.seg[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
@media (min-width: 640px) {
  .filter-panel > summary { display: none; }
  .filters { padding-top: var(--space-3); }
}

.results-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin: var(--space-2) 0; }
.count { margin: 0; color: var(--muted); font-size: var(--fs-small); }
.active { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.jump { font-size: var(--fs-small); color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: var(--space-2) 0 var(--space-4); }
.jump ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.jump-label { font-weight: 600; }
.jump-select { display: none; }
.jump-select select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule);
  border-radius: 8px; padding: 8px 10px; min-height: 44px; width: 100%;
}
@media (max-width: 1023px) {
  /* With JS: one compact select instead of a long wrapped list of decades */
  .js .jump-list, .js .jump-label { display: none; }
  .js .jump-select { display: block; flex: 1 1 100%; }
}
.tl-layout { display: flex; flex-direction: column; }
.tl-rail { order: -1; }
.tl-rail:empty { display: none; }
@media (min-width: 1024px) {
  .tl-layout {
    display: grid; grid-template-columns: minmax(0, var(--timeline-width)) max-content;
    justify-content: start; gap: var(--space-6); align-items: start;
  }
  .tl-layout .timeline { grid-column: 1; grid-row: 1; max-width: none; }
  .tl-rail { grid-column: 2; grid-row: 1; position: sticky; top: 80px; }
  .tl-rail .jump { flex-direction: column; border-left: 2px solid var(--rule); padding-left: var(--space-3); margin: 0; }
  .tl-rail .jump ol { flex-direction: column; gap: var(--space-2); }
  .tl-rail .jump a { text-decoration: none; color: var(--muted); }
  .tl-rail .jump a:hover { color: var(--accent); text-decoration: underline; }
}


/* Timeline */
.timeline { max-width: var(--timeline-width); position: relative; padding-left: calc(var(--spine-x) + 16px); }
.timeline::before { content: ""; position: absolute; left: var(--spine-x); top: 0; bottom: 0; width: 2px; background: var(--rule); }
.group { margin-bottom: var(--space-6); scroll-margin-top: 140px; }
.group-head {
  position: sticky; top: 56px; z-index: 2; margin: 0 0 var(--space-3) calc(-1 * (var(--spine-x) + 16px));
  padding: var(--space-2) 0; background: var(--bg); font-size: 1.75rem; font-weight: 600;
}
.group--detail .group-head { font-size: 1.375rem; }
.group-count { font: 400 var(--fs-small) var(--font-ui); color: var(--muted); vertical-align: middle; margin-left: var(--space-2); }
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.entry { position: relative; }
.entry::before {
  content: ""; position: absolute; left: calc(-16px - 7px); top: 18px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--type-color, var(--muted)); box-sizing: border-box;
}
.card {
  position: relative; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--type-color, var(--rule));
  border-radius: var(--radius); padding: var(--space-3) var(--space-4); font-size: var(--fs-card); box-shadow: var(--shadow);
}
.card:hover { border-color: var(--muted); border-left-color: var(--type-color); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-top { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; color: var(--muted); font-size: var(--fs-small); }
.card-top time { margin-left: auto; color: var(--muted); }
.card-title { margin: var(--space-1) 0; font-size: 1.125rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-title a:focus-visible { outline: none; }
.card-summary { margin: 0 0 var(--space-2); }
.card-meta { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; color: var(--muted); font-size: var(--fs-small); }
.responds { margin: 0 0 var(--space-1); color: var(--type-text, var(--muted)); font-size: var(--fs-small); font-weight: 600; }
.responds span { font-weight: 400; }
.entries:has(.entry--compact) { gap: 0; }
.entry--compact::before { top: 15px; width: 10px; height: 10px; left: calc(-16px - 5px); }
.entry-row {
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: center; padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-size: var(--fs-card); min-height: 44px;
}
.entry-row:hover { background: var(--surface); }
.entry-row time { color: var(--muted); font-size: var(--fs-small); min-width: 84px; }
.entry-row .entry-title { flex: 1 1 240px; font-weight: 500; }
.entry-row .type-tag { min-width: 96px; }
.gap { margin: 0 0 var(--space-6); color: var(--muted); font-size: var(--fs-small); font-style: italic; }
.empty { padding: var(--space-6); background: var(--surface); border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--muted); }

/* Detail */
.crumbs { margin-top: var(--space-6); font-size: var(--fs-small); color: var(--muted); }
.entry-detail { max-width: var(--timeline-width); }
.detail-head { border-left: 4px solid var(--type-color, var(--rule)); padding-left: var(--space-4); margin: var(--space-4) 0; }
.detail-head h1 { margin-top: var(--space-2); }
.detail-pills { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin: 0; }
.status-help { font-size: var(--fs-small); }
.detail-date { color: var(--muted); margin: 0; }
.detail-summary { font-size: 1.125rem; }
.notice { background: var(--status-disputed-bg); color: var(--status-disputed-fg); padding: var(--space-2) var(--space-3); border-radius: 8px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: var(--space-6) 0; }
.facts dt { font-weight: 600; color: var(--muted); font-size: var(--fs-small); padding-top: 3px; }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.block { margin: var(--space-8) 0; }
.block h2 { border-bottom: 1px solid var(--rule); padding-bottom: var(--space-2); }
.sources { padding-left: 1.25rem; display: grid; gap: var(--space-3); }
.src-link { font-weight: 600; word-break: break-word; }
.src-meta { color: var(--muted); font-size: var(--fs-small); }
.sources li { padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule); }
.related { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.related li { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.defs dt { margin-top: var(--space-3); }
.defs dd { margin: var(--space-1) 0 0; }

/* Index & profile */
.ix-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.ix-card a {
  display: flex; flex-direction: column; gap: 2px; padding: var(--space-4); height: 100%; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.ix-card a:hover { border-color: var(--accent); }
.ix-name { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; }
.ix-sub { color: var(--muted); font-size: var(--fs-small); margin: 0; }
.ix-meta { color: var(--muted); font-size: var(--fs-small); margin-top: var(--space-2); }
.profile-head { max-width: var(--timeline-width); margin-bottom: var(--space-6); }
.links { padding-left: 1.25rem; }
.breakdown { margin: var(--space-4) 0; }
.breakdown-bar { display: flex; height: 10px; border-radius: var(--radius-pill); overflow: hidden; gap: 2px; max-width: 360px; }
.breakdown-bar span { flex: 1; }
.seg-claimed { background: var(--status-claimed-bd); }
.seg-disputed { background: var(--status-disputed-bd); }
.seg-debunked { background: var(--status-debunked-bd); }
.seg-supported { background: var(--status-supported-bd); }
.breakdown-text { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--fs-small); }

/* What is claimed / What is established */
.claim-block { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-left: 4px solid; border-radius: 0 var(--radius) var(--radius) 0; }
.claim-block h2 { font: 700 0.75rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--space-2); }
.claim-block p { margin: 0 0 var(--space-2); }
.claim-block p:last-child { margin-bottom: 0; }
.claim-block--claimed { background: var(--status-disputed-bg); border-color: var(--type-claim); }
.claim-block--established { background: var(--claim-established-bg); border-color: var(--type-study); }

/* Desktop side panel for entry detail (JS, >=1024px) */
.side-panel {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; max-height: none; width: min(var(--sp-w, var(--panel-width)), 100vw);
  max-width: 100vw; padding: 0; border: 0; border-left: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  box-shadow: -8px 0 24px rgba(31, 35, 40, .15); overflow-y: auto;
}
.side-panel::backdrop { background: rgba(5, 6, 8, .55); }
.sp-bar { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: var(--space-2); background: var(--surface); z-index: 1; }
.sp-close { font: 400 1.5rem/1 var(--font-ui); width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.sp-close:hover { background: var(--bg); }
.sp-content { padding: 0 var(--space-6) var(--space-6); }
.sp-content .entry-detail { max-width: none; }
.sp-content .detail-head { margin-top: 0; }
.sp-content .detail-head h1 { font-size: 1.6rem; }
.sp-content .facts { grid-template-columns: 1fr; }
.sp-content .block { margin: var(--space-6) 0; }
.sp-loading { color: var(--muted); }

/* Filter bottom sheet action (mobile only) */
.sheet-actions { display: none; }
.btn-primary {
  font: 600 1rem var(--font-ui); width: 100%; min-height: 48px; border: 0; border-radius: var(--radius);
  background: var(--ink); color: var(--surface); cursor: pointer;
}

.ix-controls { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin: var(--space-4) 0 var(--space-2); }
.ix-search { flex: 1 1 220px; max-width: 360px; }
.ix-search input {
  width: 100%; font: inherit; padding: var(--space-2) var(--space-3); min-height: 40px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.seg .muted { font-size: .85em; margin-left: 2px; }
.seg[aria-pressed="true"] .muted { color: inherit; opacity: .75; }

.site-footer { border-top: 1px solid var(--rule); margin-top: var(--space-8); padding: var(--space-6) 0; color: var(--muted); font-size: var(--fs-small); }

@media (max-width: 639px) {
  :root { --spine-x: 8px; }
  .filter-panel[open]::before { content: ""; position: fixed; inset: 0; background: rgba(31, 35, 40, .4); z-index: 19; }
  .filter-panel[open] > .filters {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 85vh; overflow-y: auto;
    background: var(--surface); border-radius: 16px 16px 0 0; padding: var(--space-6) var(--space-4) var(--space-4);
    box-shadow: 0 -8px 24px rgba(31, 35, 40, .2);
  }
  .filter-panel[open] > .filters .sheet-actions { display: block; position: sticky; bottom: 0; padding-top: var(--space-2); background: var(--surface); }
  .f-group legend { float: none; width: auto; margin-bottom: var(--space-1); }
  .f-select select { max-width: none; }
  .site-search { order: 3; flex-basis: 100%; max-width: none; }
  .updated { display: none; }
  .group-head { top: 104px; font-size: 1.2rem; }
  .facts { grid-template-columns: 1fr; }
  .wn-list { grid-auto-columns: 78%; }
  .wn-all { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .filter-panel, .jump, .site-footer, .whatsnew { display: none; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- v2 front page: era strip + horizontal timeline (design/SPEC-v2-timeline.md) ---------- */
.wrap--wide, .site-header .wrap { max-width: 1440px; }
.st-claimed { --c: var(--st-claimed); } .st-disputed { --c: var(--st-disputed); }
.st-debunked { --c: var(--st-debunked); } .st-supported { --c: var(--st-supported); }
.st-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }

.tl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-6) 0 var(--space-4); }
.tl-tagline { font: 400 .95rem/1.4 var(--font-ui); color: var(--muted); margin: 0; }
.new-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 16px; border-radius: 18px;
  background: #1d1a12; border: 1px solid #3a3220; color: #d8c7a0; text-decoration: none; font-size: .875rem; }
.new-pill[aria-pressed="true"] { border-color: var(--st-claimed); color: var(--ink); }
.np-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-claimed); }

.tl-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.tl-filters .chips { margin-right: var(--space-2); }
.tl-filters .chip--toggle { gap: 7px; border-radius: 16px; min-height: 32px; font-size: .8125rem; color: var(--muted); background: transparent; border-color: var(--rule); }
.tl-filters .chip--toggle[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--c, #3a414c); box-shadow: inset 0 0 0 1px var(--c, #3a414c); }
.tl-filters .f-select select { border-radius: 16px; min-height: 32px; background: var(--bg); color: var(--muted); border-color: var(--rule); }
.era-all { margin-left: auto; }
.era-all[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: #3a414c; }

.eras { background: var(--surface); border-radius: 14px; padding: 8px; margin-bottom: var(--space-4); }
.era-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.era-strip > li { flex: 1 1 0; min-width: 0; }
.era-btn { all: unset; box-sizing: border-box; display: block; width: 100%; height: 100%; padding: 10px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.era-btn:hover { background: #171b21; }
.era-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.era-btn[aria-pressed="true"] { background: #1c2129; box-shadow: inset 0 0 0 1px #3a414c; }
.era-name { display: block; color: var(--ink); font-weight: 600; font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.era-sub { display: block; font-size: .75rem; }
.era-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.era-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }

.tl-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: .8125rem; color: var(--muted); margin: var(--space-2) 0; }
.tl-bar .link-btn { color: var(--muted); text-decoration: none; }
.tl-bar .link-btn:hover { color: var(--ink); }
.tl-bar .link-btn[disabled] { opacity: .35; cursor: default; }
.tl-label { margin: 0; }
.tl-foot { display: flex; justify-content: space-between; gap: var(--space-4); color: var(--dim); font-size: .78rem; margin: var(--space-3) 0 0; }

/* Cards (shared by desktop stage and mobile spine) */
.tl-track { list-style: none; margin: 0; padding: 0; }
.tl-card { display: block; width: 196px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px;
  color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.tl-card:hover { border-color: #3a414c; transform: translateY(-1px); }
.tl-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tl-ev.is-current .tl-card { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.tl-meta { display: flex; justify-content: space-between; gap: 6px; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.tl-new { display: none; color: var(--st-claimed); font-weight: 700; }
.tl-ev.is-new .tl-new { display: inline; }
.tl-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  font-size: .9375rem; font-weight: 600; line-height: 1.3; margin: 5px 0 8px; }
.tl-status { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--c); }
.tl-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tl-thumb { display: block; position: relative; height: 64px; margin: -2px -4px 10px; border-radius: 8px; overflow: hidden; background: #0f1216; }
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-thumb--art svg { width: 100%; height: 100%; fill: none; stroke: #d8c7a0; stroke-width: 1.2; opacity: .75; }
.tl-thumb-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 6px 3px; font-size: .625rem; color: #e6e9ee; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.eo-hero { display: block; position: relative; height: 110px; margin: -14px -14px 12px; border-radius: 12px 12px 0 0; overflow: hidden; background: #0f1216; }
.eo-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-node, .tl-stem, .tl-gap, .tl-year { display: none; }
.tl-era-h { font-size: 1rem; margin: var(--space-6) 0 var(--space-3); }
.detail-media { margin: var(--space-4) 0; }
.detail-media img { max-width: 100%; height: auto; border-radius: 10px; display: block; }
.detail-media figcaption { font-size: var(--fs-small); color: var(--muted); margin-top: 6px; }

/* Desktop stage: one era at a time on a horizontal axis (JS adds .js on <html>). */
@media (min-width: 1024px) {
  .js .tl-era { display: none; }
  .js .tl-era.is-active { display: block; }
  .js .tl-era-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tl-stage { --slot: 112px; --axis: 300px; --short: 40px; --long: 96px; position: relative; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin; scrollbar-color: #2a2f38 transparent; cursor: grab; scroll-behavior: smooth;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent); }
  .tl-stage.dragging { cursor: grabbing; scroll-behavior: auto; user-select: none; }
  .tl-stage.dragging .tl-card { pointer-events: none; }
  .tl-era { position: relative; }
  .tl-track { display: flex; position: relative; height: calc(var(--axis) * 2); padding: 0 140px 0 120px; width: max-content; min-width: 100%; }
  .tl-track::before { content: ""; position: absolute; left: 0; right: 0; top: var(--axis); height: 2px; background: var(--rule); }
  .tl-ev { position: relative; flex: none; width: var(--slot); }
  .tl-ev.tl-gapped { margin-left: 120px; }
  .tl-ev { --h: var(--short); } .tl-ev.tl-s2 { --h: var(--long); }
  .tl-node { display: block; position: absolute; left: 50%; top: calc(var(--axis) - 6px); width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%;
    background: var(--c); box-shadow: 0 0 0 4px var(--bg), 0 0 14px color-mix(in srgb, var(--c) 50%, transparent); z-index: 1; }
  .tl-stem { display: block; position: absolute; left: 50%; width: 1px; height: var(--h); background: var(--rule); }
  .tl-ev.tl-up .tl-stem { top: calc(var(--axis) - var(--h)); }
  .tl-ev.tl-dn .tl-stem { top: calc(var(--axis) + 2px); }
  .tl-card { position: absolute; left: 50%; transform: translateX(-50%); z-index: 2; }
  .tl-card:hover { transform: translateX(-50%) translateY(-1px); }
  .tl-ev.tl-up .tl-card { bottom: calc(var(--axis) * 2 - var(--axis) + var(--h)); }
  .tl-ev.tl-dn .tl-card { top: calc(var(--axis) + 2px + var(--h)); }
  .tl-year { display: block; position: absolute; top: calc(var(--axis) - 10px); right: calc(50% + 16px); font-size: .8125rem; font-weight: 700; color: var(--ink);
    background: var(--bg); padding: 0 6px; white-space: nowrap; z-index: 1; }
  .tl-gap { display: block; position: absolute; top: calc(var(--axis) - 9px); left: -120px; width: 120px; text-align: center; font-size: .72rem; color: var(--muted); }
  .tl-gap > b { font-weight: 500; background: var(--bg); padding: 1px 6px; border-radius: 4px; position: relative; }
  .tl-gap::before { content: ""; position: absolute; left: 22px; right: 22px; top: 9px; height: 2px; background: var(--bg);
    background-image: repeating-linear-gradient(90deg, var(--rule) 0 4px, transparent 4px 8px); z-index: -1; }
  .tl-ev.tl-gapped.tl-newyear .tl-gap { left: -150px; }
  .era-overview { list-style: none; margin: var(--space-4) 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
}

.eo-card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 14px; }
.eo-head { all: unset; cursor: pointer; display: block; margin-bottom: 8px; }
.eo-head:focus-visible { outline: 2px solid var(--focus); }
.eo-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .875rem; }
.eo-card li { padding-left: 14px; position: relative; }
.eo-card li::before { content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.eo-card a { color: var(--ink); text-decoration: none; } .eo-card a:hover { text-decoration: underline; }
.eo-date { color: var(--muted); font-size: .75rem; }

/* Mobile: vertical spine, newest first (JS renders it in that order), era chips scroll sideways. */
@media (max-width: 1023px) {
  .js .tl-era { display: none; }
  .js .tl-era.is-active { display: block; }
  .tl-foot .tl-keys, .tl-bar { display: none; }
  .tl-head { margin-top: var(--space-4); }
  .eras { background: none; padding: 0; overflow-x: auto; scrollbar-width: none; }
  .era-strip > li { flex: none; }
  .era-btn { border: 1px solid var(--rule); border-radius: 18px; padding: 6px 14px; }
  .era-sub, .era-dots { display: none; }
  .era-name { font-weight: 500; }
  .era-all { margin-left: 0; }
  .tl-track { position: relative; padding-left: 28px; display: grid; gap: 14px; }
  .tl-track::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--rule); }
  .tl-ev { position: relative; }
  .tl-node { display: block; position: absolute; left: -26px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--bg); }
  .tl-year { display: block; position: sticky; top: 56px; z-index: 1; font-size: 1.5rem; font-weight: 700; color: #3a414c; margin: 6px 0 8px; background: var(--bg); }
  .tl-card { width: auto; }
}

/* Draggable details pane: drag the left edge, arrow keys on the handle, double-click resets. */
.sp-resize { position: fixed; top: 0; bottom: 0; right: calc(min(var(--sp-w, 480px), 100vw) - 12px); width: 12px; cursor: ew-resize; z-index: 3; touch-action: none; }
.sp-resize::after { content: ""; position: absolute; left: 3px; top: 50%; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px; background: #3a414c; opacity: .6; transition: opacity .15s, background .15s; }
.sp-resize:hover::after, .sp-resize:focus-visible::after, .side-panel.resizing .sp-resize::after { opacity: 1; background: var(--accent); }
.sp-resize:focus-visible { outline: none; }
.side-panel { position: fixed; }
.side-panel.resizing { user-select: none; }
.side-panel.resizing .sp-content { pointer-events: none; }
.side-panel .sp-content { max-width: 920px; }
.side-panel .tl-year, .side-panel .tl-gap { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tl-stage { scroll-behavior: auto; }
  .tl-card, .sp-resize::after { transition: none; }
}
.sp-btn { font: 400 1.15rem/1 var(--font-ui); width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.sp-btn:hover, .sp-btn[aria-pressed="true"] { background: var(--bg); color: var(--ink); }
.side-panel.is-full .sp-content { margin: 0 auto; }
@media (max-width: 1023px) { .sp-resize, .sp-btn { display: none; } }

@media (max-width: 1023px) {
  .tl-app { display: flex; flex-direction: column; }
  .tl-head { order: 0; } .eras { order: 1; margin-bottom: var(--space-3); } .tl-filters { order: 2; } .tl-stage { order: 3; } .tl-foot { order: 4; }
  .tl-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .tl-filters .chips { flex-wrap: nowrap; }
  .tl-filters .chip--toggle, .tl-filters .f-select, .era-all { flex: none; }
  .tl-filters .f-select select { max-width: 9.5rem; }
  .tl-era-h { display: none; }
}

/* Share button (SPEC-v2-timeline "Share button"): pane header left of ⤢ and ✕, and on event pages. */
.share-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.share-btn:hover { background: var(--bg); color: var(--ink); }
.share-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.detail-head { position: relative; }
.detail-share { position: absolute; top: 0; right: 0; }
.detail-head .detail-pills { padding-right: 52px; }
.sp-content .detail-share { display: none; }
.sp-content .detail-head .detail-pills { padding-right: 0; }
.share-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--surface); font: 600 .95rem/1.2 var(--font-ui); box-shadow: 0 4px 16px rgba(0,0,0,.3); z-index: 10; pointer-events: none; }
.side-panel .share-toast { left: auto; right: 24px; transform: none; }
.share-toast:empty { padding: 0; box-shadow: none; background: transparent; }
