:root {
  --bg: #140c08;
  --surface: #1f140e;
  --surface-2: #2a1b13;
  --border: #3d2a1f;
  --text: #fff4ea;
  --muted: #c9b8aa;
  --accent: #ff5a1f;
  --accent-ink: #1a0a03;
  --confirmed: #ff4d1a;
  --linked: #ff9a1f;
  --suspected: #ffd166;
  --washing: #6ec1e4;
  --ok: #4ade80;
  --err: #f87171;
  --radius: 12px;
  --max: 1080px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--suspected); text-underline-offset: 2px; }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.2; margin: 1.4em 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: .5em 0; }
blockquote { margin: .6em 0; padding-left: .9em; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 12px; border-radius: 8px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.empty { color: var(--muted); padding: 1em 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }
:focus-visible { outline: 2px solid var(--suspected); outline-offset: 2px; }

main, .site-header, .site-footer { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
main { padding-bottom: 48px; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.logo { color: var(--text); text-decoration: none; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.logo b { color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--text); }
.site-footer { border-top: 1px solid var(--border); padding-top: 20px; padding-bottom: 40px; font-size: .9rem; }

.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--accent-ink); filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-small { padding: 6px 12px; font-size: .9rem; }
.site-header nav .btn { color: var(--accent-ink); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin: 16px 0; }

/* hero / counter */
.hero { text-align: center; padding: 32px 0 8px; }
.counter-label { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
.counter-num { font-size: clamp(3rem, 12vw, 6.5rem); font-weight: 900; line-height: 1; margin: .1em 0; color: var(--accent); font-variant-numeric: tabular-nums; text-shadow: 0 0 40px rgba(255, 90, 31, .35); }
.counter-sub { color: var(--muted); }
.lede { color: var(--muted); max-width: 640px; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.cta { text-align: center; margin-top: 32px; }

/* fire clock */
.fireclock { display: flex; gap: 18px; align-items: center; }
.fireclock h2 { margin-top: 0; }
.clock-face { fill: var(--surface-2); stroke: var(--border); stroke-width: 2; }
.clock-danger { fill: rgba(255, 77, 26, .35); }
.clock-tick { stroke: var(--muted); stroke-width: 1.5; }
.clock-hand { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.clock-hand-dot { fill: var(--accent); }
.clock-min { font-size: 1.2rem; }
.clock-min b { font-size: 2rem; color: var(--accent); }
.legend ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.legend h2 { margin-top: 0; }

/* fire badges */
.fire { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.fire-confirmed { color: var(--confirmed); }
.fire-linked { color: var(--linked); }
.fire-suspected { color: var(--suspected); }
.fire-washing { color: var(--washing); }
.tag { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); text-decoration: none; }
.tag-boomerang { color: var(--washing); border-color: var(--washing); }
.tag-disputed { color: var(--err); border-color: var(--err); }

/* event cards */
.event-list { display: grid; gap: 14px; }
.event-card { border-left: 4px solid var(--border); }
.event-card.lvl-confirmed { border-left-color: var(--confirmed); }
.event-card.lvl-linked { border-left-color: var(--linked); }
.event-card.lvl-suspected { border-left-color: var(--suspected); }
.event-card.lvl-washing { border-left-color: var(--washing); }
.card-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .9rem; }
.card-top time { margin-left: auto; }
.card-title { margin: .5em 0 .2em; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.meta { font-size: .9rem; }
.sources { font-size: .9rem; padding-left: 1.1em; margin: .4em 0; }
.note h2 { margin-top: 0; }

/* reactions */
.rx { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.rx-btn { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .95rem; cursor: pointer; min-height: 34px; }
.rx-btn:hover { border-color: var(--muted); }
.rx-btn[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 90, 31, .18); }
.rx-n { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); }
.rx-btn[aria-pressed="true"] .rx-n { color: var(--text); }
.rx-msg { font-size: .85rem; color: var(--suspected); }
.rx-compact .rx-btn { padding: 2px 7px; min-height: 28px; font-size: .85rem; }

/* stats */
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; min-width: 130px; }
.stats b { display: block; font-size: 1.6rem; color: var(--accent); }
.stats span { color: var(--muted); font-size: .85rem; }
.big-quote { font-size: 1.2rem; }

/* macro chart */
.macro { margin: 32px 0 0; }
.macro h2 { margin-top: 0; }
.macro-svg { width: 100%; height: 160px; display: block; margin-top: 8px; }
.bar { fill: var(--accent); }
.bar-hatch { fill: url(#hatch); }
.bar-derived { fill: var(--accent); }
.macro-labels { display: grid; text-align: center; font-size: .72rem; color: var(--muted); line-height: 1.3; }
.macro-labels b { color: var(--text); font-weight: 600; }

/* timeline */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filter-actions { display: flex; gap: 8px; }
label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
input, select, textarea { width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; }
textarea { resize: vertical; }
label.check { display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; }
.req { font-size: .75rem; color: var(--accent); }

.strip { position: relative; height: 280px; margin: 20px 0; background: linear-gradient(180deg, var(--surface), var(--bg)); border: 1px solid var(--border); border-radius: var(--radius); overflow: visible; }
.strip-axis { position: absolute; inset: auto 0 0 0; height: 24px; border-top: 1px solid var(--border); }
.strip-axis span { position: absolute; transform: translateX(-50%); font-size: .75rem; color: var(--muted); top: 4px; }
.bubble { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; opacity: .75; cursor: pointer; border: 1px solid rgba(0, 0, 0, .4); }
.bubble.lvl-confirmed { background: var(--confirmed); }
.bubble.lvl-linked { background: var(--linked); }
.bubble.lvl-suspected { background: var(--suspected); }
.bubble.lvl-washing { background: var(--washing); }
.bubble:hover, .bubble:focus-within, .bubble.pinned { opacity: 1; z-index: 5; outline: 2px solid var(--text); }
.hovercard { display: none; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: min(300px, 80vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; cursor: default; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: .9rem; }
.hovercard p { margin: .25em 0; }
.bubble:hover .hovercard, .bubble:focus-within .hovercard, .bubble.pinned .hovercard { display: block; }

/* misc */
.crumbs { font-size: .85rem; color: var(--muted); margin-top: 16px; }
.crumbs a { color: var(--muted); }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.link-list { padding-left: 1.1em; }
.ranking { padding-left: 1.6em; }
.ranking li.current { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .85rem; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); }
.pager { display: flex; justify-content: space-between; margin-top: 24px; }
.prose { max-width: 720px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.form { display: grid; gap: 12px; }
.form h2 { margin: 0; }
.notice { padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; }
.notice.ok { background: rgba(74, 222, 128, .12); border: 1px solid var(--ok); }
.notice.err { background: rgba(248, 113, 113, .12); border: 1px solid var(--err); }

/* admin */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dup { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.admin main { max-width: 1200px; }
.table-wrap { overflow-x: auto; }

@media (max-width: 600px) {
  .card-top time { margin-left: 0; width: 100%; }
  .strip { height: 220px; }
  .fireclock { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
