:root {
  --bg: #fbfaf7;
  --paper: #ffffff;
  --ink: #1b1b1f;
  --muted: #6b6a66;
  --rule: #e4e1d9;
  --accent: #b8860b;
  --accent-ink: #7a5806;
  --lock: #1f7a3d;
  --contender: #1f5fa8;
  --darkhorse: #9a4d9e;
  --field: #8a8780;
  --up: #1f7a3d;
  --down: #b3261e;
  --bar: #f1e6c8;
  --max: 52rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
.masthead {
  border-bottom: 3px double var(--rule);
  background: var(--paper);
}
.brand {
  display: block;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 16px 6px;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
}
.brand-k { font-weight: 800; }
.brand-n { font-weight: 800; color: var(--accent-ink); }
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.95rem;
}
.nav a { text-decoration: none; color: var(--muted); }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); border-bottom: 2px solid var(--accent); }
.page { max-width: var(--max); margin: 0 auto; padding: 24px 16px 48px; }
.foot { max-width: var(--max); margin: 0 auto; padding: 16px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--rule); }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin: 32px 0 10px; }
h3 { font-size: 1.1rem; margin: 20px 0 8px; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 8px; }
.asof { font-size: 0.95rem; color: var(--muted); margin: 0 0 20px; }
.crumb { font-size: 0.85rem; color: var(--muted); margin: 0 0 6px; }
.muted { color: var(--muted); }
time { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* Rankings */
.tier { margin: 22px 0 8px; }
.tier-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 6px; padding-left: 10px; border-left: 5px solid var(--field); }
.tier-name small { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.tier-lock .tier-name { border-color: var(--lock); }
.tier-contender .tier-name { border-color: var(--contender); }
.tier-darkhorse .tier-name { border-color: var(--darkhorse); }
.standings { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); }
.standings th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 8px 6px; border-bottom: 1px solid var(--rule); }
.standings td { padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.standings tr:last-child td { border-bottom: 0; }
.c-rank { width: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-mv { width: 3rem; white-space: nowrap; }
.c-name a { font-weight: 600; text-decoration: none; }
.c-name a:hover { text-decoration: underline; }
.aff { font-size: 0.82rem; color: var(--muted); }
.c-theme { font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.c-src { width: 4.5rem; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.c-score { width: 6.5rem; text-align: right; font-variant-numeric: tabular-nums; position: relative; }
.score { font-weight: 700; position: relative; z-index: 1; }
.bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; background: var(--rule); border-radius: 2px; }
.bar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--accent); border-radius: 2px; }
.mv { font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mv-up { color: var(--up); }
.mv-down { color: var(--down); }
.mv-flat { color: var(--muted); }
.mv-new { color: var(--accent-ink); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.badge { display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 6px; border-radius: 3px; background: var(--rule); color: var(--ink); vertical-align: middle; }
.badge-sleeper { background: #fff2c2; color: var(--accent-ink); border: 1px solid #ecd58a; }
.badge-w { background: transparent; border: 1px solid var(--rule); color: var(--muted); }
@media (max-width: 560px) {
  .c-theme, .standings th.c-theme { display: none; }
  .c-src, .standings th.c-src { display: none; }
  body { font-size: 16px; }
}

/* Faces */
.c-face { width: 48px; padding-right: 0 !important; }
.face { display: inline-block; border-radius: 50%; object-fit: cover; background: var(--rule); vertical-align: middle; }
.face-s { width: 40px; height: 40px; }
.face-l { width: 160px; height: 160px; flex: 0 0 160px; }
.face-initials { color: var(--muted); font-weight: 700; text-align: center; letter-spacing: 0.02em; }
.face-s.face-initials { line-height: 40px; font-size: 0.85rem; }
.face-l.face-initials { line-height: 160px; font-size: 3rem; }
.cand-head { display: flex; gap: 20px; align-items: flex-start; margin: 4px 0 16px; }
.cand-head h1 { margin-top: 0; }
.credit { font-size: 0.78rem; color: var(--muted); margin: 4px 0 0; }
@media (max-width: 560px) {
  .cand-head { gap: 14px; }
  .face-l { width: 96px; height: 96px; flex-basis: 96px; }
  .face-l.face-initials { line-height: 96px; font-size: 2rem; }
}

/* Updates feed */
.feed h2 { border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.update-card { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.update-card h3 { margin: 2px 0 4px; }
.update-card h3 a { text-decoration: none; }
.update-card p { margin: 0 0 6px; }
.more { font-size: 0.9rem; }

/* Update page */
.update h1, .candidate h1 { margin-top: 4px; }
.prose { max-width: 40rem; }
.prose p, .prose li { font-size: 1.05rem; }
.prose img { max-width: 100%; height: auto; }
.prose blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--rule); color: var(--muted); }
.prose code { background: var(--rule); padding: 1px 4px; border-radius: 3px; font-size: 0.9em; }
.obs-box { margin: 28px 0; padding: 14px 16px; background: var(--paper); border: 1px solid var(--rule); border-left: 5px solid var(--accent); }
.obs-box h2 { margin: 0 0 8px; font-size: 1.05rem; }
.obs { padding-left: 1.2em; margin: 0; }
.obs li { margin: 6px 0; }
.obs time { display: inline-block; min-width: 7.5rem; }
.heat { color: var(--muted); font-size: 0.85rem; }
.move { color: var(--muted); font-size: 0.9rem; margin-left: 6px; }
.ctx { font-size: 0.85rem; margin-left: 6px; }
.standing-line { padding: 10px 14px; background: var(--paper); border: 1px solid var(--rule); font-size: 0.95rem; }
.spark { display: block; margin-top: 4px; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* Score page */
.example { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); font-size: 0.95rem; margin: 10px 0 16px; }
.example th, .example td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.example th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.score-doc { max-width: 100%; }

/* Sources */
.sources { list-style: none; padding: 0; margin: 0; }
.sources li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.sources h3 { margin: 0 0 4px; }
.sources p { margin: 0; }

/* Replay */
.replay-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 18px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--rule); position: sticky; top: 0; z-index: 2; }
#replay-play { font-size: 1rem; width: 2.4rem; height: 2.4rem; border: 1px solid var(--rule); background: var(--bg); border-radius: 50%; cursor: pointer; }
#replay-range { flex: 1 1 200px; accent-color: var(--accent); }
.replay-label { flex: 1 1 100%; font-size: 0.95rem; }
.replay-label a { font-weight: 600; text-decoration: none; }
#replay-board tr { transition: transform 420ms cubic-bezier(.2,.7,.2,1); will-change: transform; }
.flash td { animation: flash 900ms ease-out; }
@keyframes flash { from { background: #fff2c2; } to { background: transparent; } }
