/* Power Line News — "Wire Desk" (2026-11 refresh).
   Dark-first editorial: serif headlines, a quiet sans for metadata, amber for the one live accent.
   Keeps every class contract used by js/site.js and vote-client.js (cards, rail, chips, embeds). */
:root {
  color-scheme: dark;
  --bg: #0f1318; --mast: #0b0e12; --card: #161b22; --ink: #ece8df; --quiet: #9aa3ad; --rule: #27303a;
  --accent: #8fb4dc; --live: #e8b04a; --chip: #212833; --btn: #1c222b;
  --a: #5fbf87; --b: #6f9fd4; --c: #d6a548; --d: #e0806f; --l: #ad94dc; --r: #93a1aa;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ad-bg: color-mix(in srgb, var(--card) 85%, var(--live) 6%);
}
:root[data-theme=light] {
  color-scheme: light;
  --bg: #f6f4ef; --mast: #fffdf8; --card: #fff; --ink: #16181c; --quiet: #5c636c; --rule: #ddd8cd;
  --accent: #1f4f86; --live: #a8660a; --chip: #eef1f5; --btn: #f1eee6;
  --a: #2e7d4f; --b: #2f5d8a; --c: #8a5d0c; --d: #8a3b2f; --l: #6a4c93; --r: #5f6b73;
  --ad-bg: #fbf7ee;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 52px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 980px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
a { color: var(--accent); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 6px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 12px; }

/* ---------- masthead ---------- */
.masthead { background: var(--mast); border-bottom: 1px solid var(--rule); position: relative; }
.mast-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; }
.brand { margin: 0; font-size: inherit; }
.brand a { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.mark { width: 42px; height: 42px; flex: none; color: var(--ink); }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 30px; letter-spacing: -.01em; line-height: 1.05; }
.wordmark span { color: var(--live); font-style: italic; font-weight: 600; }
.dateline { color: var(--quiet); font-size: 12.5px; padding-top: 8px; padding-bottom: 14px; display: flex; flex-wrap: wrap; gap: 0 8px; }
.dateline #today { color: var(--ink); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: 11.5px; padding-top: 1px; }
.wires { display: block; width: 100%; height: 12px; position: absolute; bottom: -12px; left: 0; pointer-events: none; }
.wires path { fill: none; stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tools { display: flex; gap: 8px; flex: none; }
.theme, .pill {
  background: var(--btn); color: var(--ink); border: 1px solid var(--rule); border-radius: 16px; padding: 4px 12px;
  font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; line-height: 1.5;
}
.theme:hover, .pill:hover { border-color: var(--live); }
.theme:focus-visible, .pill:focus-visible, .brand a:focus-visible, .tabs button:focus-visible, .foot-links a:focus-visible {
  outline: 2px solid var(--live); outline-offset: 2px;
}
.ad-slot[data-ad-slot=sponsor-line] { margin: 22px 0 0; }

/* ---------- intro, tabs, status ---------- */
main.wrap { padding-top: 22px; padding-bottom: 28px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--quiet); font-size: 13px; }
.note { color: var(--quiet); font-size: 13.5px; margin: 0; max-width: 780px; }
.tabs { display: flex; gap: 22px; margin: 18px 0 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.tabs button {
  background: none; color: var(--quiet); border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  padding: 8px 0 7px; margin-bottom: -1px; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--live); }
.statusline { color: var(--quiet); font-size: 13px; margin: 10px 0 0; min-height: 20px; }
.retry {
  margin-left: 8px; background: var(--btn); color: var(--ink); border: 1px solid var(--rule);
  border-radius: 12px; padding: 2px 10px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.retry:hover { border-color: var(--accent); }

/* ---------- day sections and cards ---------- */
section.day > h2.day {
  position: sticky; top: 0; z-index: 1; background: var(--bg); margin: 20px 0 6px; padding: 10px 0 7px;
  font: 700 13px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid var(--ink);
}
section.day > h2.day span { color: var(--quiet); font-weight: 500; letter-spacing: .02em; text-transform: none; font-size: 12.5px; }
.story { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; margin: 8px 0; }
.story a.hl { color: var(--ink); font: 650 17px/1.32 var(--serif); text-decoration: none; text-wrap: pretty; }
.story a.hl:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.story a.hl:visited { color: color-mix(in srgb, var(--ink) 78%, var(--quiet)); }
.story a.hl:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; border-radius: 2px; }
.meta { color: var(--quiet); font-size: 12.5px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.sum { font-size: 13.5px; color: var(--quiet); margin-top: 4px; }
.chip { display: inline-block; background: var(--chip); border-radius: 10px; padding: 1px 8px; font-size: 12px; margin: 5px 4px 0 0; }
.chip.person { font-weight: 600; }
.chip.broad { opacity: .7; }
.chips { margin-top: 2px; }
.meta .chip.source-badge { color: var(--ink); background: transparent; padding: 0; margin: 0 2px 0 0; font-weight: 700; font-size: 12.5px; }
.g {
  display: inline-block; min-width: 22px; text-align: center; border-radius: 4px; color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 0 5px; margin-right: 6px;
}
:root:not([data-theme=light]) .g:not(.gUngraded) { color: #0f1318; }
.gA { background: var(--a); }
.gB { background: var(--b); }
.gC { background: var(--c); }
.gD { background: var(--d); }
.gL { background: var(--l); }
.gR, .gS { background: var(--r); }
.gUngraded { background: transparent; color: var(--quiet); border: 1px solid var(--rule); }
.story a.also { color: var(--accent); text-decoration: none; }
.story a.also:hover { text-decoration: underline; }
.srcs { margin-top: 6px; }
.srcs summary { cursor: pointer; color: var(--quiet); font-size: 12.5px; }
.srcs summary:hover { color: var(--ink); }
.share { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.sh {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px;
  padding: 0; background: var(--btn); border: 1px solid var(--rule); cursor: pointer; color: var(--ink);
  text-decoration: none; opacity: .8;
}
.sh:hover { opacity: 1; border-color: var(--accent); }
.sh:focus-visible { opacity: 1; outline: 2px solid var(--live); outline-offset: 1px; }
.sh img { width: 20px; height: 20px; border-radius: 4px; display: block; }
.sh .mono { font-size: 13px; font-weight: 700; line-height: 1; }
.sh.done { border-color: var(--a); }

/* Voting rail and reaction chips: markup contract shared with vote-client.js. */
.story.feed-card { display: flex; gap: 8px; padding: 12px 14px 12px 6px; position: relative; }
.rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 40px; }
.rail .vote-btn {
  background: none; border: 0; color: var(--quiet); font-size: 18px; line-height: 1; width: 32px; height: 28px;
  border-radius: 6px; cursor: pointer; padding: 0;
}
.rail .vote-btn:hover { background: var(--btn); color: var(--ink); }
.rail .vote-btn[data-action=up].active { color: var(--c); }
.rail .vote-btn[data-action=down].active { color: var(--b); }
.rail .vote-btn > svg { display: block; width: 16px; height: 16px; margin: 6px auto 0; }
.flags .vote-btn > svg { vertical-align: middle; }
.flags .vote-btn .bulb { fill: var(--r); }
.flags .vote-btn .bulb-rays { display: none; }
.flags .vote-btn.chip-good .bulb { fill: var(--a); }
.flags .vote-btn.chip-good .bulb-rays { display: block; }
.flags .vote-btn.chip-bad .bulb { fill: var(--d); }
.flags .vote-btn:has(> svg) { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; }
.flags .vote-btn .flag-icon { flex: none; }
.net { font-weight: 700; font-size: 15px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.feed-card .body { flex: 1; min-width: 0; }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule); }
.foot .share { margin: 0; padding: 0; border: 0; }
.flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.flags .vote-btn {
  background: var(--btn); color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px;
  font: inherit; font-size: 12.5px; line-height: 1.4; cursor: pointer;
}
.flags .vote-btn:hover { border-color: var(--quiet); }
.flags .chip-good { color: var(--a); border-color: color-mix(in srgb, var(--a) 45%, var(--rule)); }
.flags .chip-bad { color: var(--d); border-color: color-mix(in srgb, var(--d) 45%, var(--rule)); }
.flags .chip-good.active { background: color-mix(in srgb, var(--a) 22%, var(--btn)); border-color: var(--a); }
.flags .chip-bad.active { background: color-mix(in srgb, var(--d) 22%, var(--btn)); border-color: var(--d); }
.flags .chip-offtopic.active, .flags .chip-spam.active { background: var(--chip); border-color: var(--ink); }
.flags .n { font-weight: 600; }
.vote-btn:disabled { opacity: .5; cursor: wait; }
.vote-btn:focus-visible { outline: 2px solid var(--live); outline-offset: 1px; }
.vote-status { color: var(--d); font-size: 12px; }
.vote-error { border-color: var(--d); }

/* Inline embeds: nothing third-party loads until the card's + is pressed. */
.story.feed-card:not(:has(> .rail)) { padding-left: 14px; }
.has-emb .body { padding-right: 30px; }
.xbtn {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; padding: 0; border-radius: 6px;
  border: 1px solid var(--rule); background: var(--btn); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
}
.xbtn:hover, .xbtn[aria-expanded=true] { border-color: var(--accent); color: var(--accent); }
.xbtn:focus-visible { outline: 2px solid var(--live); outline-offset: 1px; }
.emb { margin-top: 10px; max-width: 560px; }
.emb-frame { display: block; width: 100%; border: 0; border-radius: 8px; background: var(--chip); }
.emb-frame.ratio { aspect-ratio: 16 / 9; height: auto; }
.emb .twitter-tweet { margin: 0 !important; }
.emb-note, .emb-fail { color: var(--quiet); font-size: 13px; margin: 6px 0; }
.emb-fail a { color: var(--accent); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--rule); padding-top: 18px; padding-bottom: 36px; color: var(--quiet); font-size: 12.5px; }
.site-foot p { margin: 10px 0 0; max-width: 760px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }
.foot-links a { color: var(--ink); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.foot-links a:hover { color: var(--live); text-decoration: underline; }
.ad-slot[data-ad-slot=supporters] { margin: 0 0 18px; }

@media (max-width: 560px) {
  .dateline { flex-direction: column; }
  .dateline .sep { display: none; }
  .mast-row { padding-top: 14px; }
  .mark { width: 34px; height: 34px; }
  .wordmark { font-size: 23px; }
  .tools { gap: 6px; }
  .theme, .pill { padding: 3px 10px; font-size: 12.5px; }
  .tabs { gap: 16px; }
  .tabs button { font-size: 13.5px; }
  .story a.hl { font-size: 16px; }
  .flags { margin-left: 0; }
  .story.feed-card { padding-left: 4px; }
}
@media (max-width: 380px) { .theme { font-size: 0; width: 34px; } .theme::before { content: "◐"; font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
@media print { .tools, .tabs, .ad-slot, .foot, .rail, .xbtn, .wires { display: none !important; } body { background: #fff; color: #000; } }
