/* Clallam election tracker — Albright Daily News, WSJ-style compact */
:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6dc;
  --card: #faf8f4;
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --rule: #c9c2b3;
  --lead: #1a1a1a;
  --trail: #8a8478;
  --accent: #8b1e1e;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink);
  font-family: "Source Sans 3", system-ui, sans-serif; line-height: 1.45; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
.mast { max-width: 980px; margin: 0 auto; padding: 1.25rem 1rem .75rem;
  border-bottom: 3px double var(--ink); }
.paper-name { margin: 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.paper-name a { text-decoration: none; }
.mast h1 { font-family: "Libre Baskerville", Georgia, serif; font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem); margin: .2rem 0 .15rem; line-height: 1.15; }
.dek { margin: 0; color: var(--muted); font-size: .95rem; }
.topline, .featured, #races, #impossible, #sources, #method, footer {
  max-width: 980px; margin: 0 auto; padding: 1.1rem 1rem; }
.topline { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem;
  border-bottom: 1px solid var(--rule); }
.stat { background: var(--card); border: 1px solid var(--rule); padding: .7rem .85rem; }
.stat .lbl { margin: 0; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  font-weight: 700; color: var(--muted); }
.stat .num { margin: .1rem 0 0; font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2.15rem); font-weight: 700; }
.topline-note { grid-column: 1 / -1; margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.kicker { margin: 0 0 .2rem; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.featured { border-bottom: 1px solid var(--rule); }
.featured h2 { font-family: "Libre Baskerville", Georgia, serif; font-size: 1.45rem; margin: 0 0 .35rem; }
.lead-line { font-size: 1.05rem; margin: 0 0 .8rem; }
.bar-row { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr auto; gap: .5rem; align-items: center; margin: .3rem 0; }
.bar-name { font-weight: 600; }
.bar-track { height: .7rem; background: var(--paper-2); border: 1px solid var(--rule); }
.bar { display: block; height: 100%; background: var(--lead); }
.bar.trail { background: var(--trail); }
.bar-n { font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--muted); }
.need, .model, .src, .table-note, #sources p, #method p, #impossible p { color: var(--muted); font-size: .92rem; }
#races h2, #impossible h2, #sources h2, #method h2 {
  font-family: "Libre Baskerville", Georgia, serif; font-size: 1.25rem; margin: 0 0 .4rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .4rem .45rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid var(--ink); }
td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
tr.group th { background: var(--paper-2); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .55rem .45rem .3rem; border-bottom: 1px solid var(--ink); }
tr.feat td { background: #f3efe3; }
tr.feat td.office { font-weight: 700; }
.office a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.combined { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; margin-top: .15rem; }
.badge { display: inline-block; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase;
  font-weight: 700; padding: .12rem .35rem; border: 1px solid var(--ink); white-space: nowrap; }
.badge.is-leading { background: var(--ink); color: var(--paper); }
.badge.is-impossible { background: #1e3a2f; color: #f4f1ea; border-color: #1e3a2f; }
.badge.is-flipped { background: var(--accent); color: #fff; border-color: var(--accent); }
.badge.is-certified { background: #2c2c2c; color: #fff; }
.badge.is-unopposed { background: transparent; color: var(--muted); border-color: var(--rule); }
#sources ul { padding-left: 1.1rem; }
#sources li { margin: .25rem 0; }
footer { border-top: 3px double var(--ink); color: var(--muted); font-size: .85rem; }
.fetched { font-size: .8rem; }
.count-history { margin-top: 1.15rem; padding-top: .9rem; border-top: 1px solid var(--rule); }
.count-history h3 { font-family: "Libre Baskerville", Georgia, serif; font-size: 1.05rem; margin: 0 0 .4rem; }
.hist-note { color: var(--muted); font-size: .88rem; margin: 0 0 .75rem; }
.hist-charts { background: var(--card); border: 1px solid var(--rule); padding: .35rem .25rem .15rem; margin: 0 0 .8rem; }
.hist-charts svg, .hist-svg { display: block; width: 100%; height: auto; max-width: 100%; }
.hist-table td, .hist-table th { font-variant-numeric: tabular-nums; }
.hist-table tr.is-latest { background: #f3efe3; }
.hist-src { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; margin-top: .12rem; }
.hist-who { display: block; font-size: .82rem; margin-top: .12rem; }
.gain-fr { color: #1a1a1a; font-weight: 700; }
.gain-sg { color: #8b1e1e; font-weight: 700; }
.gain-even { color: var(--muted); font-weight: 600; }
@media (max-width: 700px) {
  .topline { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: .15rem; }
  table { font-size: .84rem; }
  th, td { padding: .35rem .3rem; }
  .hist-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hist-table, .hist-table tbody, .hist-table tr, .hist-table td { display: block; width: 100%; }
  .hist-table tr { border: 1px solid var(--rule); margin: 0 0 .65rem; padding: .45rem .65rem .4rem; background: var(--card); }
  .hist-table tr.is-latest { background: #f3efe3; }
  .hist-table td { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem;
    border-bottom: 1px dotted var(--rule); padding: .3rem 0; text-align: right; white-space: normal; }
  .hist-table td:last-child { border-bottom: 0; }
  .hist-table td::before { content: attr(data-label); font-weight: 700; text-align: left; font-size: .7rem;
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted); flex: 0 0 7.2rem; padding-top: .15rem; }
  .hist-table td.num { text-align: right; }
}
