/* Claude Reset — original "ink + paper" editorial design system. Not a copy of codexreset.ai's
   terminal look, and not agentresets'/whenreset's color values — see CLAUDE.md. Headings use a
   serif stack (paper/editorial feel); body and UI text use a system sans stack; figures use
   tabular-nums throughout. Accent: rose/crimson #be123c (light) / #fb7185 (dark) — chosen to not
   collide with codexreset.ai's cyan #0891b2 or any sibling nav-site color. Banked accent: amber
   #b45309 (both themes, per spec). Zero external font/script requests. */
:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --paper: #fffdf9;
  --card: #fbf8f1;
  --border: #e4dfd1;
  --border-strong: #d3cbb4;
  --ink: #211d16;
  --muted: #625c4c;
  --faint: #948c76;
  --accent: #be123c;
  --accent-ink: #9f0f33;
  --accent-soft: #fbe7ec;
  --accent-line: #f3c3cf;
  --banked: #b45309;
  --banked-soft: #fdf1e2;
  --banked-line: #f2d6a8;
  --empty: #e9e4d5;
  --good: #2f6f4e;
  --bad: #a3311f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 8px 22px -16px rgba(40, 30, 10, .28);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17140f; --paper: #1d1a13; --card: #221e16; --border: #35301f; --border-strong: #453f28;
    --ink: #f2ede1; --muted: #beb49b; --faint: #8b8368;
    --accent: #fb7185; --accent-ink: #ff9aab; --accent-soft: #2c1218; --accent-line: #52212b;
    --banked: #e0a752; --banked-soft: #2a1f10; --banked-line: #4a3618;
    --empty: #2a2618; --good: #6fbf94; --bad: #e07a63;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .04);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17140f; --paper: #1d1a13; --card: #221e16; --border: #35301f; --border-strong: #453f28;
  --ink: #f2ede1; --muted: #beb49b; --faint: #8b8368;
  --accent: #fb7185; --accent-ink: #ff9aab; --accent-soft: #2c1218; --accent-line: #52212b;
  --banked: #e0a752; --banked-soft: #2a1f10; --banked-line: #4a3618;
  --empty: #2a2618; --good: #6fbf94; --bad: #e07a63;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04);
}

* { box-sizing: border-box; }
html { color-scheme: light dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-wrap: anywhere;
}
a { color: var(--accent-ink); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 5px; }
.wrap, main, .site-header nav, .site-footer > .wrap {
  max-width: 980px; margin: 0 auto; padding: 0 18px;
}
.num, .tnum { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header nav { display: flex; align-items: center; gap: 16px; padding: 13px 0; }
.brand {
  display: flex; align-items: baseline; gap: 2px; text-decoration: none; color: var(--ink);
  font-family: var(--mono); font-weight: 600; font-size: 1rem; flex: none; letter-spacing: -.01em;
}
.brand .dot { color: var(--accent); }
.links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.links::-webkit-scrollbar { display: none; }
.links a { display: block; padding: 6px 9px; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.links a:hover { color: var(--ink); background: var(--card); }
.theme-btn {
  margin-left: auto; flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 7px; border: 1px solid var(--border-strong); background: var(--paper); color: var(--muted); cursor: pointer;
}
.theme-btn:hover { color: var(--ink); border-color: var(--faint); }

/* ---------- freshness banner (hidden by default; shown by app.js's checkFreshness()) ---------- */
.stale-banner {
  border-bottom: 1px solid var(--banked-line); background: var(--banked-soft); color: var(--banked);
  font-size: .82rem; line-height: 1.5; text-align: center; padding: 8px 18px;
}
.stale-banner[hidden] { display: none; }
.stale-banner a { color: inherit; font-weight: 600; text-decoration: underline; }

main { padding-top: 26px; padding-bottom: 46px; }
h1 { font-family: var(--serif); font-size: 1.65rem; line-height: 1.25; margin: 0 0 10px; max-width: 24ch; }
h2 { font-family: var(--serif); font-size: 1.2rem; margin: 0; }
h3 { font-family: var(--serif); font-size: 1.02rem; margin: 0; }
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 4px; }
.crumbs { color: var(--faint); font-size: .82rem; margin: 0 0 8px; }
.crumbs a { color: var(--faint); }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--faint); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.eyebrow .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- answer banner ---------- */
.answer {
  margin-top: 18px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--paper); box-shadow: var(--shadow); padding: 18px 20px;
}
.answer-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.15rem; font-weight: 600; font-family: var(--serif); }
.answer-line .yes { color: var(--good); }
.answer-line .no { color: var(--muted); }
.answer-sub { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.answer-sub a { color: var(--accent-ink); }

/* ---------- last-reset card + figure row ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.figure { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 15px; box-shadow: var(--shadow); }
.figure dt { font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin: 0; }
.figure dd { margin: 6px 0 0; font-size: 1.5rem; font-weight: 650; font-family: var(--serif); line-height: 1.1; }
.figure dd small { font-size: .62em; font-weight: 500; color: var(--muted); margin-left: 2px; }
.figure .s { display: block; font-size: .74rem; color: var(--faint); margin-top: 4px; font-weight: 400; font-family: var(--sans); }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } }

.card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-top: 16px; }
.card h2, .card h3 { margin-bottom: 6px; }
.kv-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: .88rem; }
.kv-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.kv-list li:first-child { border-top: 0; }
.kv-list b { font-weight: 600; }
.quote { border-left: 3px solid var(--accent); padding-left: 12px; margin: 10px 0; color: var(--ink); font-style: italic; }
.confidence { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card); }
.confidence.medium { color: var(--good); }
.confidence.low { color: var(--muted); }

/* ---------- signal strip ---------- */
.signals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.signal { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.signal .st-label { font-size: .74rem; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.signal .st-val { font-weight: 600; margin-top: 4px; }
.signal .st-val.ok { color: var(--good); }
.signal .st-val.warn { color: var(--bad); }
.signal a { font-size: .78rem; }
@media (max-width: 700px) { .signals { grid-template-columns: 1fr; } }

/* ---------- banked card ---------- */
.banked-card {
  margin-top: 18px; border: 1px solid var(--banked-line); background: var(--banked-soft);
  border-radius: var(--radius); padding: 16px 18px;
}
.banked-card h2 { color: var(--banked); }
.banked-card .countdown { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.banked-tag { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--banked); background: var(--banked-soft); border: 1px solid var(--banked-line); border-radius: 5px; padding: 1px 6px; }

/* ---------- heatmap ---------- */
.heatmap { margin-top: 6px; }
.hm-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 2px; overflow-x: auto; padding-bottom: 4px; }
.hm-cell { width: 10px; height: 10px; border-radius: 2px; background: var(--empty); display: block; }
a.hm-cell:hover, a.hm-cell:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 1px; }
.hm-cell.regular { background: var(--accent); }
.hm-cell.banked { background: var(--banked); }
.hm-cell.fut { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.hm-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--faint); margin-top: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin: 8px 0 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 9px; height: 9px; border-radius: 2px; flex: none; display: inline-block; background: var(--empty); }
.sw.regular { background: var(--accent); }
.sw.banked { background: var(--banked); }

/* ---------- history / event list ---------- */
.day { padding: 14px 0; border-top: 1px solid var(--border); }
.day:first-child { border-top: 0; }
.day h4 { margin: 0 0 8px; font-size: .84rem; font-weight: 600; font-family: var(--sans); display: flex; align-items: baseline; gap: 8px; }
.day h4 .rel { font-weight: 400; color: var(--faint); font-size: .75rem; }
.ev { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 4px 12px; padding: 8px 0; }
.ev + .ev { border-top: 1px dashed var(--border); }
.ev-time { font-family: var(--mono); font-size: .74rem; color: var(--faint); padding-top: 2px; white-space: nowrap; }
.ev-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 500; line-height: 18px; padding: 0 7px; border-radius: 5px; border: 1px solid var(--border); color: var(--muted); background: var(--card); }
.ev-sum { margin: 0; font-size: .88rem; color: var(--ink); line-height: 1.55; }
.ev-link { margin: 4px 0 0; font-size: .78rem; }
.gapbar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--border); }
.gapbar-row:first-child { border-top: 0; }
.gapbar-row .gb-date { font-size: .78rem; color: var(--faint); width: 92px; flex: none; }
.gapbar-track { flex: 1; height: 8px; background: var(--empty); border-radius: 4px; overflow: hidden; }
.gapbar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.gapbar-row .gb-days { font-size: .78rem; color: var(--muted); width: 62px; text-align: right; flex: none; }
table.hist-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.hist-table th, table.hist-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.hist-table th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; }

/* ---------- sponsored relay cards ---------- */
.stations { margin-top: 34px; scroll-margin-top: 70px; }
.spons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.sp { padding: 14px 16px; }
.sp-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mono-mark { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: .74rem; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-line); flex: none; }
.sp .station-name { font-weight: 650; font-size: .94rem; text-decoration: none; color: var(--ink); }
.sp .station-name:hover { color: var(--accent-ink); }
.sp .spons-label { margin-left: auto; font-size: .6rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.sp p { margin: 8px 0 10px; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.pays { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 820px) { .spons { grid-template-columns: minmax(0, 1fr); } }

/* ---------- subscribe ---------- */
.subscribe { border-style: dashed; }
.subscribe p { color: var(--muted); margin: 6px 0 0; font-size: .88rem; }

/* ---------- FAQ ---------- */
.faq { margin-top: 30px; }
.faq h2 { margin-bottom: 6px; }
.faq details { border-bottom: 1px solid var(--border); padding: 0; margin: 0; }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 2px; font-weight: 600; font-size: .94rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent-ink); }
.faq summary::after { content: "+"; color: var(--faint); font-weight: 400; font-size: 1.1em; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { color: var(--muted); margin: 0 0 15px; padding: 0 2px; max-width: 66ch; }

/* ---------- generic content sections ---------- */
.sec { margin-top: 34px; scroll-margin-top: 70px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.sec-head p { margin: 2px 0 0; font-size: .84rem; color: var(--faint); }
.fact-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.fact-list li { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: var(--paper); }
.fact-text { margin: 0 0 6px; }
.fact-source { font-size: .78rem; color: var(--faint); }
.event-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: .87rem; }
.event-detail { margin: 20px 0; }
.cross { margin-top: 24px; color: var(--muted); }
.disclaimer { color: var(--muted); font-size: .8rem; margin: 10px 0 16px; max-width: 72ch; }
.source-list { padding-left: 1.2em; font-size: .88rem; }
pre, code { font-family: var(--mono); }
.code-box { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); overflow: hidden; }
.code-top { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px 5px 11px; border-bottom: 1px solid var(--border); font-size: .68rem; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.code-box pre { margin: 0; padding: 9px 11px; font-size: .78rem; line-height: 1.6; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-btn { font-size: .76rem; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--paper); color: var(--ink); cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.guide-section { margin-top: 26px; }
.guide-section pre { padding: 12px 14px; overflow-x: auto; font-size: .8rem; line-height: 1.6; border: 1px solid var(--border); background: var(--card); border-radius: 6px; }
.guide-section code { padding: 1px 5px; font-size: .88em; background: var(--card); border-radius: 4px; }
.btn { display: inline-block; background: var(--accent); color: #fff; padding: 9px 15px; border-radius: 8px; text-decoration: none; font-weight: 600; border: none; font: inherit; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- notify-in-tab block ---------- */
.notify-block .btn { margin-top: 4px; }
.notify-notice { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 8px; font-size: .88rem; }

/* ---------- worth-it calculator ---------- */
.calc-form { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin-top: 14px; }
.calc-form label { display: block; font-size: .88rem; color: var(--muted); }
.calc-form input[type="number"] { width: 6em; margin: 0 4px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.calc-form input[type="checkbox"] { margin-right: 6px; }
.calc-bar-wrap { height: 10px; border-radius: 6px; background: var(--border); margin: 14px 0; overflow: hidden; }
.calc-bar { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.calc-result p { margin: 6px 0; }
.calc-result .verdict { font-weight: 650; font-family: var(--serif); font-size: 1.05rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 46px; padding: 22px 0 30px; }
.foot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: .86rem; }
.foot-links a:hover { color: var(--ink); }
.site-footer .disclaimer { margin: 16px 0 0; }
.fine { color: var(--faint); font-size: .75rem; margin: 8px 0 0; }

/* ---------- small screens (site-wide) ---------- */
@media (max-width: 640px) {
  .wrap, main, .site-header nav, .site-footer > .wrap { padding: 0 14px; }
  .site-header nav { gap: 8px; }
  h1 { font-size: 1.35rem; }
  .signals { grid-template-columns: 1fr; }
  .spons { grid-template-columns: 1fr; }
}
/* Nav links no longer fit in a single row next to the brand + theme toggle at phone widths — was
   squeezing .links into a ~150px sliver that scrolled horizontally with no visible affordance,
   hiding "Worth it? / Status / Developers" off the edge of the screen entirely. Wrap the header
   onto two rows instead: row 1 keeps brand + theme toggle, row 2 is the full-width link list,
   itself wrapping normally — every link stays reachable and the page never scrolls horizontally. */
@media (max-width: 560px) {
  .site-header nav { flex-wrap: wrap; row-gap: 6px; }
  .links { order: 3; flex: 1 1 100%; overflow-x: visible; flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .grid3 { grid-template-columns: 1fr; }
}
