:root {
  --bg: #f4f1ea;
  --panel: #fffdf9;
  --ink: #1d1c1a;
  --muted: #6c675e;
  --line: #e0dacb;
  --accent: #b5532a;
  --neg: #b5532a;
  --pos: #2f7d54;
  --neu: #8a857a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.55 -apple-system, "Segoe UI", Roboto, Georgia, serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.topbar nav { display: flex; gap: 14px; }
.regions { margin-left: auto; display: flex; gap: 6px; }
.chip {
  padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--muted); background: #fff;
}
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

main { max-width: 920px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 30px; margin: 8px 0 16px; letter-spacing: -0.5px; }
h1 small, h2 small { color: var(--muted); font-weight: 400; font-size: 0.5em; }
h2 { margin: 28px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.ai-banner {
  font-size: 12px; color: #7a5b12; background: #fbf3dc; border: 1px solid #e8d79f;
  border-radius: 8px; padding: 6px 10px; margin: 8px 0;
}
.ai-banner.off { color: var(--muted); background: #efece4; border-color: var(--line); }

.agenda {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 22px; margin-bottom: 12px;
}
.agenda h2 { margin-top: 18px; font-size: 18px; }
.agenda h2:first-child { margin-top: 0; }

.stories { display: flex; flex-direction: column; gap: 10px; }
.story {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px;
}
.story-title { font-weight: 700; font-size: 18px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.blindspot {
  margin-top: 8px; font-size: 13px; color: var(--neg);
  background: #f7e7df; border-radius: 6px; padding: 4px 8px; display: inline-block;
}

.sent { font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.sent.neg { background: #f3ddd2; color: var(--neg); }
.sent.pos { background: #d8ecdf; color: var(--pos); }
.sent.neu { background: #ece9e1; color: var(--neu); }

.actions { display: flex; gap: 10px; margin-top: 22px; }
.actions button {
  font: inherit; padding: 8px 16px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: 8px; cursor: pointer;
}
.actions button:hover { filter: brightness(1.05); }

/* At-a-glance spectrum bar */
.spectrum { display: flex; gap: 4px; margin: 14px 0 6px; height: 40px; }
.spectrum .seg {
  --lean: #8a857a;
  background: color-mix(in srgb, var(--lean) 16%, #fff);
  border: 1px solid var(--lean); border-bottom: 4px solid var(--lean);
  border-radius: 8px; min-width: 56px; padding: 4px 8px;
  display: flex; flex-direction: column; justify-content: center; overflow: hidden;
}
.seg-label { font-size: 11px; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.seg-count { font-size: 16px; font-weight: 800; color: var(--lean); line-height: 1; }
.spectrum-help { margin: 0 0 18px; }

/* Lean-grouped columns, left → right */
.lean-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.lean-col { --lean: #8a857a; }
.lean-head {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 15px; padding-bottom: 6px; border-bottom: 2px solid var(--lean);
}
.lean-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--lean); display: inline-block; }
.lean-n { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 400; }
.lean-cards { display: flex; flex-direction: column; gap: 12px; }

.outlet { --lean: #8a857a; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--lean); border-radius: 10px; padding: 14px; }
.outlet-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.outlet-name { font-weight: 700; }
.tag { font-size: 11px; background: #ece7da; color: var(--muted); padding: 1px 7px; border-radius: 999px; }
.tag-official { background: #d8eae3; color: #2f6d5c; font-weight: 700; }
.headline { display: block; font-weight: 700; margin: 2px 0 6px; }
.summary { font-size: 14px; color: #3a372f; margin: 0 0 8px; }
.framing { font-size: 13px; background: #faf6ee; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.framing div { margin: 2px 0; }
.quoted { font-size: 13px; margin-top: 8px; }
.vtype { color: var(--muted); }

.interests { font-size: 13px; margin-top: 8px; background: #f6f3ec; border-radius: 8px; padding: 8px 10px; }
.interests div { margin: 2px 0; }
.il-win { color: var(--pos); font-weight: 700; }
.il-lose { color: var(--neg); font-weight: 700; }
.il-ind { color: #7a5b12; font-weight: 700; }
.il-lobby { color: #8a4b1f; font-weight: 700; }

.beneficiaries { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 10px 0 16px; }
.beneficiaries h3 { margin: 0 0 8px; font-size: 15px; }
.ben-row { font-size: 14px; margin: 4px 0; }
.ben-row small { color: var(--muted); }

/* Outlet profile — stance timelines */
.stance-list { display: flex; flex-direction: column; gap: 6px; }
.stance-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.stance-topic { font-weight: 600; }
.stance-val { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 70px; text-align: right; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; }
.spark i { width: 5px; border-radius: 1px; display: inline-block; }
.stance-change { font-size: 12px; font-weight: 700; color: #8a4b1f; background: #f6e7d6; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.tallies { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tally { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tally h3 { margin: 0 0 6px; font-size: 14px; }
.tally ul { margin: 0; padding-left: 18px; }
.tally li { font-size: 13px; margin: 2px 0; }

table.sources { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.sources th, table.sources td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.sources th { background: #efe9da; }

/* What each outlet is leading with */
.lead-group-head { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.outlet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.outlet-lead { --lean: #8a857a; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--lean); border-radius: 10px; padding: 10px 14px; }
.outlet-lead h3 { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.outlet-lead ol { margin: 0; padding-left: 18px; }
.outlet-lead li { font-size: 13px; margin: 3px 0; }

/* Ad / sponsored flags */
.adflag { font-size: 12px; color: #8a4b1f; background: #f6e7d6; border: 1px solid #e6cdb0; border-radius: 6px; padding: 3px 8px; margin: 4px 0; }
.adtag { font-size: 11px; color: #8a4b1f; background: #f6e7d6; padding: 0 5px; border-radius: 4px; white-space: nowrap; }
.adlist { padding-left: 18px; }
.adlist li { margin: 4px 0; }

.history { list-style: none; padding: 0; }
.history li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Compare outlets */
.compare-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 6px 0 16px; font-size: 14px; }
.compare-form select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.compare-form button, .big-btn, .regen button { font: inherit; padding: 6px 14px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px; cursor: pointer; }
.big-btn { padding: 10px 20px; font-size: 16px; }
.regen { margin: 6px 0 14px; }
.regen button { background: #fff; color: var(--accent); }
.cmp-diff { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; line-height: 1.7; white-space: pre-wrap; font-size: 14px; }
.cmp-ins { background: #d8ecdf; color: #1d5b38; text-decoration: none; }
.cmp-del { background: #f3ddd2; color: #8a3413; }
.cmp-same { color: var(--ink); }

.back { font-size: 14px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; border-top: 1px solid var(--line); }
code { background: #ece7da; padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
