/* MyUndi — Malaysia Election Intelligence. Light evidence canvas, dark navigation rail. */
:root {
  --navy-900: #0E1B36;
  --navy-800: #14244A;
  --navy-700: #1B2F5C;
  --ink: #16213A;
  --ink-soft: #5A6680;
  --line: #E4E8F0;
  --bg: #F5F6F9;
  --surface: #FFFFFF;
  --red: #D02C2C;
  --accent: #33589E;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "Inter", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;

  /* spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  /* radius scale */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  /* elevation scale */
  --shadow-sm: 0 1px 2px rgba(20,30,60,.05);
  --shadow-md: 0 4px 14px rgba(20,30,60,.10);
  --shadow-lg: 0 10px 28px rgba(20,30,60,.16);
  /* status accents (reuse coalition-neutral tones, not new brand colors) */
  --gold: #96701A;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink);
  background: var(--bg); font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--navy-900); color: #E7EBF4;
  padding: 28px 22px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  -ms-overflow-style: none; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; }
.brand-row { position: relative; }
.brand { all: unset; display: block; width: 100%; cursor: pointer; border-radius: 8px; }
.brand:hover .brand-name, .brand:focus-visible .brand-name { color: #fff; }
.brand:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.brand-mark { display: none; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: .1em; }
.brand-sub { font-size: 9px; letter-spacing: .25em; color: #93A0BC; margin-top: 5px; line-height: 1.45; }
.brand-rule { width: 34px; height: 3px; background: var(--red); margin-top: 12px; }
.rail-toggle { position: absolute; top: -4px; right: -8px; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #33486f; border-radius: 6px; background: #162647; color: #DCE5F4; cursor: pointer; }.rail-toggle svg { width: 16px; height: 16px; transition: transform .2s ease-out; }.rail-toggle:hover { background: #21375f; color: #fff; }.rail-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.side-label {
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: #7E8BAA;
  margin-bottom: 8px;
}
.inv h2 { font-size: 19px; line-height: 1.3; margin: 0; font-weight: 700; color: #fff; }

.side-meta { list-style: none; margin: 0; padding: 18px 0; border-top: 1px solid #24345C; border-bottom: 1px solid #24345C; display: flex; flex-direction: column; gap: 16px; }
.side-meta li { display: flex; gap: 12px; align-items: flex-start; }
.meta-ico { color: #8FA0C6; font-size: 15px; margin-top: 1px; }
.side-meta b { display: block; font-size: 13.5px; color: #fff; font-weight: 600; }
.side-meta span { display: block; font-size: 11.5px; color: #93A0BC; }

.side-nav { display: flex; flex-direction: column; }
.side-nav a {
  display: flex; gap: 12px; align-items: center; padding: 11px 10px 11px 14px;
  color: #AEB9D2; text-decoration: none; border-left: 3px solid transparent;
  position: relative;
}
.side-nav a b { display: block; font-size: 12.5px; letter-spacing: .12em; color: inherit; }
.side-nav a i { display: block; font-style: normal; font-size: 11px; color: #7E8BAA; }
.side-nav a.active { border-left-color: var(--red); color: #fff; background: rgba(255,255,255,.04); }
.side-nav a.active b { color: #fff; }
.side-nav a.active .nav-ico { color: #fff; }
.nav-num { font-family: var(--mono); font-size: 11px; color: #66739A; align-self: flex-start; margin-top: 2px; }
.nav-ico { display: grid; place-items: center; width: 18px; height: 18px; flex: none; color: #8FA0C6; }
.nav-ico svg { width: 18px; height: 18px; }

/* MyUndi compact rail: the investigation remains reachable without sacrificing canvas space. */
.shell { transition: grid-template-columns .2s ease-out; }
html.rail-collapsed .shell { grid-template-columns: 72px 1fr; }
.rail-collapsed .sidebar { align-items: center; padding: 28px 10px; gap: 24px; }
.rail-collapsed .brand-row { width: 100%; text-align: center; }
.rail-collapsed .brand-mark { display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto; }
.rail-collapsed .brand-mark svg { width: 32px; height: 32px; }
.rail-collapsed .brand-name, .rail-collapsed .brand-sub, .rail-collapsed .brand-rule, .rail-collapsed .inv { display: none; }
.rail-collapsed .rail-toggle { position: static; margin: 11px auto 0; }
.rail-collapsed .rail-toggle svg { transform: rotate(180deg); }
.rail-collapsed .side-meta { width: 100%; padding: 0; border: 0; align-items: center; gap: 13px; }
.rail-collapsed .side-meta li { justify-content: center; }
.rail-collapsed .side-meta li > div { display: none; }
.rail-collapsed .side-nav { width: 100%; }
.rail-collapsed .side-nav a { justify-content: center; padding: 13px 2px; border-left-width: 2px; gap: 0; }
.rail-collapsed .side-nav a > span:last-child { display: none; }
.rail-collapsed .nav-num { display: none; }
.rail-collapsed .nav-ico { width: 20px; height: 20px; }
.rail-collapsed .nav-ico svg { width: 20px; height: 20px; }

/* collapsed-rail tooltip: instant, CSS-only, follows the active language via data-tip */
.rail-collapsed .side-nav a[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--navy-900); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .12s ease-out; z-index: 30;
}
.rail-collapsed .side-nav a[data-tip]:hover::after,
.rail-collapsed .side-nav a[data-tip]:focus-visible::after { opacity: 1; }

/* ---------- main ---------- */
.main { padding: 26px 34px 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.title-block { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar h1 { font-size: 25px; margin: 0; letter-spacing: .02em; font-weight: 800; text-transform: uppercase; }
.title-chip {
  background: var(--navy-900); color: #fff; font-size: 11px; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 3px; font-weight: 600;
}
.top-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ctl span { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #6B7690; margin-bottom: 4px; }
.ctl select {
  font: inherit; font-size: 13.5px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface); color: var(--ink); max-width: 300px;
}
.language-ctl select { min-width: 118px; }
.updated-row { font-size: 12px; color: #6B7690; margin: 6px 0 18px; }
.focus-deck { margin: 0 0 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 2px rgba(20,30,60,.05); overflow: hidden; }.watch-brief-head { display: flex; justify-content: space-between; gap: 30px; padding: 20px 22px 0; }.watch-brief-head .card-label { margin-bottom: 9px; color: var(--ink); }.watch-brief-head h2 { max-width: 720px; margin: 0 0 8px; color: var(--ink); font-size: 21px; line-height: 1.3; font-weight: 800; letter-spacing: 0; }.watch-brief-head p { max-width: 68ch; margin: 0; color: #3C465E; font-size: 14px; line-height: 1.5; }.watch-facts { display: grid; grid-template-columns: minmax(118px, 1fr); align-content: start; min-width: 195px; margin: 0; padding: 0; }.watch-facts div { display: grid; gap: 3px; padding: 0 0 13px; }.watch-facts div + div { padding-top: 13px; border-top: 1px dashed var(--line); }.watch-facts dt { color: var(--ink-soft); font: 700 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; }.watch-facts dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.35; }.focus-evidence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 18px 22px 0; padding: 15px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }.focus-evidence article { min-width: 0; padding: 0; border: 0; }.focus-evidence article + article { padding: 0; }.focus-evidence .card-label { margin-bottom: 9px; }.focus-evidence ul { gap: 7px; }.focus-evidence li { font-size: 12px; }.focus-evidence li b { font-size: 12.5px; }.focus-evidence li span { line-height: 1.45; }.focus-evidence li small { font-size: 10.5px; }.focus-deck footer { display: flex; justify-content: space-between; gap: 20px; padding: 13px 22px 18px; color: var(--ink-soft); font-size: 11.5px; }.focus-deck footer span { max-width: 75ch; }.focus-deck footer a { color: var(--accent); font-size: 11.5px; font-weight: 700; white-space: nowrap; }

.error-banner[hidden] { display: none; }

.error-banner {
  background: #FFF7E0; border: 1px solid #E6C34A; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 18px; font-size: 13.5px;
}

.band { padding: 30px 0; scroll-margin-top: 12px; }
/* Divider goes above every section except the visually-first one. A hidden
   band (display:none) must not count as "first" or as the thing before it —
   plain :first-of-type / .band + .band both get fooled by hidden siblings. */
.band:not([hidden]) ~ .band:not([hidden]) { border-top: 1px solid #DDE3EC; }
.band > * + * { margin-top: 22px; }
/* build_static.py's crawlable snapshot: same rhythm as .band, but must stay
   visible in the default body.mode-landing state (unlike the interactive
   sections below it) since it's the only content a non-JS crawler ever sees. */
.snapshot-band { padding: 30px 0; scroll-margin-top: 12px; }
.snapshot-band > * + * { margin-top: 22px; }
/* A generated snapshot is meaningful content, not a placeholder. Keep it as
   the sole canvas until the JavaScript view has a complete data model. */
body.static-pending #landing,
body.static-pending #focusDeck,
body.static-pending #watchWorkspace,
body.static-pending .band,
body.static-pending #countnight { display: none !important; }
.loading-state[hidden] { display: none; }
.loading-state { display: none; position: fixed; inset: 0; z-index: 100; min-height: 100vh; align-content: center; padding: 10vh 8vw; background: var(--bg); }
html.js body.static-pending .loading-state { display: grid; }
html.js body.static-pending #staticSnapshot { display: none; }
html.js.static-content body.static-pending .loading-state { display: none; }
html.js.static-content body.static-pending #staticSnapshot { display: block; }
.loading-panel { width: min(680px, 100%); margin: auto; padding: 25px 0 23px; border-top: 1px solid #C8D1E0; border-bottom: 1px solid #C8D1E0; }
.loading-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }.loading-head .card-label { color: var(--red); }.loading-head h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.015em; }.loading-head p:not(.card-label) { max-width: 56ch; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }.loading-orbit { flex: none; width: 30px; height: 30px; margin-top: 4px; border: 2px solid #D5DCE8; border-top-color: var(--red); border-radius: 50%; animation: loading-orbit .85s linear infinite; }.loading-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 25px 0 0; padding: 14px 0 0; border-top: 1px dashed var(--line); list-style: none; }.loading-steps li { min-width: 0; padding: 0 14px; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }.loading-steps li:first-child { padding-left: 0; }.loading-steps li + li { border-left: 1px solid var(--line); }@keyframes loading-orbit { to { transform: rotate(360deg); } }
body.is-loading-screen #landing,
body.is-loading-screen #focusDeck,
body.is-loading-screen #watchWorkspace,
body.is-loading-screen .band,
body.is-loading-screen #countnight { display: none !important; }
@media (prefers-reduced-motion: reduce) { .loading-orbit { animation: none; } }
.watch-workspace { padding: 8px 0 20px; }.watch-workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 0 14px; }.watch-workspace-head .card-label { margin-bottom: 5px; }.watch-workspace-head h3 { margin: 0; font-size: 19px; line-height: 1.25; }.watch-workspace-head > p { max-width: 540px; margin: 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.45; }.watch-brief-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }.watch-calendar ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; }.watch-calendar li { display: grid; gap: 7px; min-width: 0; padding: 0 14px; border-left: 1px solid var(--line); }.watch-calendar li:first-child { padding-left: 0; border-left: 0; }.watch-calendar time { color: var(--ink-soft); font: 700 10px var(--mono); }.watch-calendar li.current time { color: var(--red); }.watch-calendar span { display: grid; gap: 3px; }.watch-calendar b { font-size: 13px; }.watch-calendar small { color: var(--ink-soft); font-size: 11px; line-height: 1.35; }.watch-evidence { display: grid; align-content: start; gap: 13px; }.watch-evidence dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border-top: 1px dashed var(--line); }.watch-evidence dl div { display: grid; gap: 3px; padding: 9px 8px 0 0; }.watch-evidence dt { color: var(--ink-soft); font-size: 10px; }.watch-evidence dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 700; }.watch-evidence a, .watch-key-seats .card-head > a { color: var(--accent); font-size: 11px; font-weight: 700; text-decoration: none; }.watch-key-seats { margin-top: 18px; }.watch-key-seats .card-head { margin-bottom: 11px; }.watch-key-seats .card-sub { max-width: 62ch; }.watch-key-seats ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; border-top: 1px dashed var(--line); list-style: none; }.watch-key-seats li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 7px; min-width: 0; padding: 11px 10px; border-left: 1px solid var(--line); }.watch-key-seats li:first-child { padding-left: 0; border-left: 0; }.watch-key-seats li > b { color: var(--ink-soft); font: 700 10px var(--mono); }.watch-key-seats li span { min-width: 0; }.watch-key-seats li strong { display: block; font-size: 12px; }.watch-key-seats li small { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-soft); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }.watch-key-seats li em { grid-column: 2; color: var(--ink); font: 700 10px var(--mono); font-style: normal; }.watch-key-seats li.empty { grid-column: 1 / -1; display: block; border-left: 0; color: var(--ink-soft); }
.campaign-stream { margin-top: 18px; }.feed-status { color: var(--ink-soft); font: 700 10px var(--mono); }.campaign-stream-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; border-top: 1px dashed var(--line); }.campaign-news { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }.campaign-news-item { padding: 11px 0; border-bottom: 1px solid var(--line); }.campaign-news-item:nth-child(odd) { padding-right: 11px; }.campaign-news-item:nth-child(even) { padding-left: 11px; }.campaign-news-item summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }.campaign-news-item summary::-webkit-details-marker { display: none; }.campaign-news-item summary span { min-width: 0; }.campaign-news-item summary small, .campaign-news-item summary strong { display: block; }.campaign-news-item summary small { overflow: hidden; color: var(--ink-soft); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }.campaign-news-item summary strong { margin-top: 3px; font-size: 12px; line-height: 1.35; }.campaign-news-item summary > b { align-self: center; color: var(--accent); font-size: 10px; white-space: nowrap; }.campaign-news-item p { margin: 9px 0 7px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }.campaign-news-item a { color: var(--accent); font-size: 11px; font-weight: 700; }.campaign-social { align-self: stretch; margin: 11px 0; padding: 0 0 0 18px; border-left: 1px solid var(--line); }.campaign-social .card-label { margin-bottom: 9px; }.social-state { display: grid; gap: 5px; margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }.social-state b { color: var(--ink); font-size: 12px; }.social-note { margin: 10px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.watch-card { border-top: 3px solid var(--red); background: linear-gradient(110deg, #FFFFFF 0%, #F3F6FB 100%); }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }.watch-layout h3 { max-width: 620px; }
.watch-meta { margin: 14px 0 0; color: var(--ink-soft); font-size: 12px; }.watch-status { display: grid; justify-items: end; gap: 3px; min-width: 105px; padding-left: 24px; border-left: 1px solid var(--line); }.watch-status b { color: var(--navy-900); font-size: 31px; line-height: 1; font-variant-numeric: tabular-nums; }.watch-status span { color: var(--ink-soft); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }.watch-card .dossier-src { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }

.grid-3 { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 22px; box-shadow: 0 1px 2px rgba(20,30,60,.05);
}
.card-label {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700;
  color: var(--ink); margin-bottom: 12px;
}
.lbl-sub { font-weight: 400; letter-spacing: .02em; text-transform: none; color: #6B7690; margin-left: 6px; font-size: 11.5px; }
.card-sub { font-size: 12.5px; color: #6B7690; margin: -6px 0 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.card h3 { font-size: 21px; line-height: 1.3; margin: 0 0 10px; font-weight: 800; }
.card h4 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #6B7690; margin: 0 0 8px; }
.outlook-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 0; border-top: 1px solid var(--line); }.outlook-item { display: grid; gap: 10px; padding: 16px 18px 16px 0; border-bottom: 1px solid var(--line); }.outlook-item:nth-child(n+2) { padding-left: 18px; border-left: 1px solid var(--line); }.outlook-item > div:first-child b, .outlook-item > div:first-child small { display: block; }.outlook-item > div:first-child b { font-size: 13px; }.outlook-item > div:first-child small, .outlook-item p { color: var(--ink-soft); font-size: 11px; }.outlook-item p { min-height: 45px; margin: 0; line-height: 1.45; }.outlook-item > a { font-size: 11px; font-weight: 600; }.outlook-values { display: flex; flex-wrap: wrap; gap: 6px 12px; }.outlook-values span { font-size: 11px; white-space: nowrap; }.outlook-values i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; }.outlook-values small { color: var(--ink-soft); }
.narrative { font-size: 14px; color: #3C465E; margin: 0; }
.campaign-baseline { position: relative; }.campaign-baseline::before { content: "Previous election context"; position: absolute; z-index: 1; top: 15px; right: 20px; padding: 3px 7px; border: 1px solid #D7DEE9; border-radius: 3px; background: #F7F9FC; color: #6B7690; font: 700 9px var(--mono); letter-spacing: .07em; text-transform: uppercase; }.campaign-baseline .waffle rect, .campaign-baseline .hbar-fill, .campaign-baseline .waffle-legend .sw { opacity: .52; }.campaign-baseline .waffle-legend .logo { opacity: .62; }.campaign-baseline .majority-note { color: #6B7690; }.campaign-baseline .card { background: #FCFDFE; }

/* waffle + legend */
.waffle-wrap { display: flex; gap: 18px; align-items: flex-start; }
.waffle { width: 100%; max-width: 340px; display: block; }
#waffle { flex: 1; min-width: 0; }
.waffle-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 96px; }
.waffle-legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: baseline; font-size: 13px; }
.waffle-legend .sw { width: 12px; height: 12px; border-radius: 3px; align-self: center; }
.waffle-legend b { font-size: 16px; }
.waffle-legend .pc { font-size: 11px; color: #6B7690; grid-column: 2 / 4; margin-top: -6px; }
.majority-note { margin-top: 14px; font-size: 12.5px; color: #6B7690; border-top: 1px dashed var(--line); padding-top: 10px; }

/* hbars */
.hbar-row { display: grid; grid-template-columns: 64px 1fr 58px; gap: 10px; align-items: center; margin-bottom: 10px; }
.hbar-label { font-size: 13px; font-weight: 600; }
.hbar-track { background: #EEF1F6; border-radius: 4px; height: 18px; overflow: hidden; display: block; }
.hbar-fill { display: block; height: 100%; border-radius: 4px 0 0 4px; }
.hbar-value { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 14px; }
.stat-row .stat b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.stat-row .stat span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6B7690; }

/* geography */
.geo-wrap { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }
.geo-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.metric-lbl { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #6B7690; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button {
  font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; border: none;
  background: var(--surface); color: #4A5470; cursor: pointer; border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--navy-900); color: #fff; }
#seatSearch { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; width: 150px; }

/* choropleth map */
.map-wrap { position: relative; margin-top: 16px; background: #EDF1F7; border-radius: 8px; overflow: hidden; }
.geo-map { width: 100%; display: block; max-height: 560px; cursor: grab; touch-action: none; }
.geo-map:active { cursor: grabbing; }
.geo-seat { stroke: #FFFFFF; stroke-width: 0.7; transition: opacity .15s; }
.geo-seat:hover { stroke: #16213A; stroke-width: 1.4; }
.geo-seat.sel { stroke: #16213A; stroke-width: 1.8; }
.geo-seat.nodata { fill: #DFE3EB; }
.geo-seat.dim { opacity: .15; }
.map-controls {
  position: absolute; top: 10px; left: 10px; z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
}
.map-controls button {
  width: 30px; height: 30px; font-size: 15px; line-height: 1; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 1px 3px rgba(20,30,60,.12);
}
.map-controls button:hover { background: #F2F5FA; }
.geo-note { font-size: 11.5px; color: #6B7690; margin: 10px 0 0; }

.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 4px; margin-top: 16px; }
.seat-cell {
  aspect-ratio: 1; border-radius: 4px; cursor: pointer; border: none; padding: 0;
  font-size: 8.5px; color: rgba(255,255,255,.85); font-family: var(--mono);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.seat-cell:hover, .seat-cell.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.seat-cell.dim { opacity: .18; }
.geo-legend { flex-direction: row !important; flex-wrap: wrap; gap: 14px !important; margin-top: 16px !important; }
.geo-legend li { grid-template-columns: 12px auto; align-items: center; }
.geo-legend .legend-note { display: block; flex-basis: 100%; max-width: 420px; color: #6B7690; font-size: 11.5px; line-height: 1.45; }
.geo-legend b { font-size: 13px; }

.dossier { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; }
.dossier h3 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip { font-size: 10px; letter-spacing: .08em; font-weight: 700; color: #fff; padding: 3px 8px; border-radius: 3px; }
.dossier .sub { font-size: 12.5px; color: #6B7690; margin: 2px 0 14px; }
.cand-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.dossier-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.dossier-stats .stat b { display: block; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.dossier-stats .stat span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #6B7690; }
.dossier-src { font-size: 11.5px; color: #6B7690; border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 10px; }
.dossier-demo { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.dossier-demo-note { font-size: 11.5px; color: #6B7690; margin: 4px 0 10px; }
.dossier-demo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dossier-demo-cols h4 { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6B7690; margin: 0 0 6px; }
.dossier-demo-sex { font-size: 12px; color: #6B7690; margin: 10px 0 0; }
.dossier-demo--empty .empty { margin-top: 6px; }
.campaign-dossier { background: #FCFDFE; }.campaign-dossier .chip { color: #41506A; }.campaign-dossier .logo { opacity: .62; }.campaign-dossier .data-table, .campaign-dossier .dossier-stats { opacity: .72; }.campaign-dossier-note { margin: 10px 0 12px; padding: 8px 10px; border: 1px solid #DCE3ED; border-radius: 4px; background: #F5F7FA; color: #5A6680; font-size: 11.5px; line-height: 1.45; }

/* tables */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: #6B7690; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid #EEF1F6; white-space: nowrap; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr:hover td { background: #F7F9FC; }
.win-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; vertical-align: baseline; }
.campaign-baseline .data-table .logo { opacity: .62; }.campaign-baseline .data-table td { color: #536079; }.campaign-baseline .data-table td strong, .campaign-baseline .data-table td b { color: var(--ink); }

/* trends */
.linechart { width: 100%; display: block; }
.linechart .grid { stroke: #EEF1F6; stroke-width: 1; }
.linechart .tick { font-size: 10.5px; fill: #8A93A8; font-family: var(--sans); }
.series-label { font-size: 11.5px; font-weight: 700; font-family: var(--sans); }
.swing-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.swing-row { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center; margin-bottom: 9px; }
.swing-track { position: relative; background: #EEF1F6; border-radius: 4px; height: 16px; display: block; }
.swing-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.swing-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1.5px; background: #B9C1D2; }

.projection { font-size: 13.5px; }
.projection .proj-bars { margin-top: 10px; }
.projection h4 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #6B7690; margin: 0 0 6px; }
.projection .note { font-size: 11.5px; color: #8A5252; background: #FFF3F3; border-radius: 6px; padding: 8px 10px; margin-top: 12px; }
.poll-timeline { margin-top: 22px; padding: 18px 0 4px; border-top: 1px solid #DDE3EC; }
.poll-timeline .card-label { margin-bottom: 12px; }
.poll-records { margin-top: 22px; border-top: 1px solid #DDE3EC; }
.poll-record { display: grid; grid-template-columns: minmax(172px, .7fr) minmax(0, 1.8fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid #DDE3EC; }
.poll-record-head { display: grid; align-content: start; gap: 5px; }
.poll-record-head strong { color: var(--ink); font-size: 15px; }
.poll-record-head span { color: #68758B; font-size: 12px; line-height: 1.35; }
.poll-record-head small { color: #68758B; font: 700 10px var(--mono); }
.poll-record-body { min-width: 0; }
.poll-toplines { display: flex; flex-wrap: wrap; gap: 7px; }
.poll-topline { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid #D8E0EB; border-radius: 999px; background: #F7F9FC; color: #31415D; font-size: 12px; white-space: nowrap; }
.poll-topline i { width: 7px; height: 7px; border-radius: 50%; }
.poll-topline b { color: var(--ink); font-size: 11px; }
.poll-record-body p { max-width: 74ch; margin: 10px 0 7px; color: #56647C; font-size: 12.5px; line-height: 1.5; }
.poll-record-body a { color: var(--accent); font-size: 12px; font-weight: 700; }
.projection { margin-top: 26px; padding: 22px 0 4px; border-top: 1px solid #C9D4E2; }

#demographics .hbar-row { grid-template-columns: 170px 1fr 48px; }

/* party / coalition logos (proxied from ElectionData.MY) */
.logo {
  width: 20px; height: 20px; object-fit: contain; vertical-align: middle;
  margin-right: 6px; background: #fff; border: 1px solid var(--line);
  border-radius: 4px; padding: 1.5px;
}
.logo.sm { width: 16px; height: 16px; margin-right: 5px; }
.logo-missing { display: none; }
.dossier h3 .logo { width: 28px; height: 28px; }
.waffle-legend span .logo { margin-right: 4px; }

.badge { font-size: 10px; letter-spacing: .06em; font-weight: 700; padding: 2px 7px; border-radius: 3px; vertical-align: middle; }
.badge.est { background: #FFF3D6; color: #8A6D1A; border: 1px solid #E6C34A; }
.badge.src { background: #E7ECF5; color: var(--accent); border: 1px solid #C3D0E8; }

.brief { font-size: 13.5px; color: #3C465E; }
.brief p { margin: 0 0 10px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-ghost {
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 12px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
}
.btn-ghost:hover { background: #F2F5FA; }

.empty { color: #8A93A8; font-size: 13.5px; }

/* ---------- landing / home ---------- */
body.mode-landing .contest-ctl, body.mode-landing .election-ctl,
body.mode-landing .updated-row, body.mode-landing #focusDeck, body.mode-landing #watchWorkspace,
body.mode-landing .band,
body.mode-landing #countnight { display: none; }
body.mode-landing .title-chip { display: none; }
body.mode-landing .topbar { grid-template-columns: minmax(0, 1fr) auto; }
body.mode-landing .top-controls { width: auto; min-width: 132px; grid-template-columns: 118px; }
body.mode-landing #landing { display: block; }
body.mode-landing #sideNav a:not(#navHome) { display: none; }
body.mode-landing .inv, body.mode-landing .side-meta { display: none; }
#landing { display: none; }

.landing-hero { max-width: 720px; margin: 22px 0 28px; }
.landing-kicker { margin: 0 0 9px !important; color: var(--red) !important; font: 700 10px var(--mono) !important; letter-spacing: .16em; text-transform: uppercase; }
.landing-statement { max-width: 64ch; margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.landing-lead { margin: 0 0 30px; }
.landing-lead-panel { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 0; overflow: hidden; border: 1px solid #D8DFEA; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.landing-lead-main { padding: 26px 28px; }
.landing-lead-main .lc-badge { margin-bottom: 16px; }
.landing-lead-main h2 { max-width: 18ch; margin: 0 0 9px; color: var(--ink); font-size: 27px; line-height: 1.08; letter-spacing: -.025em; }
.landing-lead-main p { max-width: 65ch; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.landing-lead-action { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--surface); text-decoration: none; background: var(--navy-900); border: 1px solid var(--navy-900); border-radius: var(--r-sm); padding: 8px 12px; font: 700 12px var(--sans); cursor: pointer; }
.landing-lead-action:hover, .landing-lead-action:focus-visible { background: var(--navy-700); outline: none; }
.landing-lead-readout { display: grid; align-content: center; gap: 16px; padding: 26px 28px; background: #EEF2F8; }
.landing-lead-readout > span { color: var(--ink-soft); font: 700 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.landing-lead-coalition { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 17px; font-weight: 800; }
.landing-lead-coalition .logo { width: 25px; height: 25px; }
.landing-lead-coalition small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.landing-lead-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border-top: 1px solid #D6DEEA; }
.landing-lead-facts div { padding: 12px 10px 0 0; }.landing-lead-facts div + div { padding-left: 12px; border-left: 1px solid #D6DEEA; }
.landing-lead-facts dt { color: var(--ink-soft); font-size: 10px; }.landing-lead-facts dd { margin: 3px 0 0; color: var(--ink); font-size: 13px; font-weight: 800; }
.landing-section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 0 12px; }.landing-section-head .card-label { margin: 0 0 3px; }.landing-section-head p:last-child { margin: 0; color: var(--ink-soft); font-size: 12.5px; }
.landing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-3); }
.landing-card {
  text-align: left; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5); cursor: pointer; font: inherit; color: inherit;
  box-shadow: var(--shadow-sm); transition: box-shadow .15s ease-out, transform .15s ease-out, border-color .15s ease-out;
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.landing-card:hover, .landing-card:focus-visible {
  box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #AEBBD1; outline: none;
}
.lc-top { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: var(--sp-2); }
.lc-type { min-width: 0; justify-self: end; text-align: right; font-size: 10.5px; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase; color: #8A93A8; }
.landing-card h3 { margin: 0; font-size: 18px; font-weight: 800; }
.lc-result { display: flex; align-items: center; gap: 6px; font-size: 13.5px; min-height: 20px; }
.lc-result b { font-size: 13.5px; }
.lc-result span { color: var(--ink-soft); }
.lc-date { font-size: 12px; color: #8A93A8; font-family: var(--mono); margin-top: 2px; }

.lc-badge {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700;
  white-space: nowrap;
  letter-spacing: .04em; padding: 3px 9px; border-radius: 999px;
}
.lc-badge--live { background: #FFE9E9; color: var(--red); }
.lc-badge--live .live-dot { width: 7px; height: 7px; }
.lc-badge--result { background: var(--navy-900); color: #fff; }
.lc-badge--watch { background: #FFF3D6; color: var(--gold); }
.lc-badge--quiet { background: #EEF1F6; color: #6B7690; font-weight: 600; }

/* tooltip */
.chart-tooltip {
  position: fixed; display: none; z-index: 50; pointer-events: none;
  background: var(--navy-900); color: #fff; font-size: 12.5px; line-height: 1.45;
  padding: 8px 11px; border-radius: 6px; max-width: 280px; box-shadow: 0 4px 14px rgba(10,18,40,.35);
}
.chart-tooltip .tt-muted { color: #A9B4CD; font-size: 11.5px; }

/* ---------- MyUndi evidence canvas ----------
   The briefing should read as one investigation, not a stack of unrelated widgets. */
body { background: #F7F8FB; }
.main { padding: 32px 42px 80px; }
.topbar { min-height: 58px; padding-bottom: 17px; border-bottom: 1px solid #DDE3EC; }
.topbar h1 { font-size: 27px; letter-spacing: -.018em; }
.updated-row { margin: 9px 0 24px; color: #68758B; }
.card-label { margin-bottom: 10px; font-size: 10.5px; letter-spacing: .13em; }
.card-sub, .lbl-sub { color: #68758B; }

/* Result summary becomes a single editorial readout with dividers, not three cards. */
#overview .grid-3 { gap: 0; align-items: stretch; }
#overview .grid-3 > .card {
  min-width: 0; padding: 8px 26px; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
#overview .grid-3 > .card:first-child { padding-left: 0; }
#overview .grid-3 > .card + .card { border-left: 1px solid #DDE3EC; }
#overview .card h3 { max-width: 18ch; font-size: 24px; line-height: 1.18; letter-spacing: -.02em; }
#overview .narrative { max-width: 48ch; font-size: 14px; line-height: 1.58; }
#overview .majority-note { margin-top: 16px; }
#overview .stat-row { margin-top: 18px; }

/* Dense evidence areas use quiet ruled sections. Geography retains a true workspace panel. */
#countnight .card,
#contests .card,
#trends .card,
#reports .card {
  padding: 23px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
#countnight .card,
#contests .card,
#trends > .card { border-bottom: 1px solid #DDE3EC; }
#trends .grid-2 { gap: 0; border-bottom: 1px solid #DDE3EC; }
#trends .grid-2 > .card { padding: 0 26px 22px; }
#trends .grid-2 > .card:first-child { padding-left: 0; }
#trends .grid-2 > .card + .card { border-left: 1px solid #DDE3EC; }
#reports .grid-2 { gap: 0; }
#reports .grid-2 > .card { padding: 0 26px; }
#reports .grid-2 > .card:first-child { padding-left: 0; }
#reports .grid-2 > .card + .card { border-left: 1px solid #DDE3EC; }

#geography .geo-main, #geography .dossier {
  border-color: #D8DFEA; border-radius: 12px; box-shadow: 0 2px 8px rgba(20,30,60,.045);
}
#geography .geo-main { padding: 22px; }
#geography .dossier { padding: 22px; }
.map-wrap { border: 1px solid #DCE3ED; background: #E9EEF5; }
.geo-tools { gap: 8px; }
.seg { border-color: #CBD5E3; border-radius: 7px; }
.seg button { background: #FBFCFE; color: #4E5E77; }
.seg button.on { background: var(--navy-900); }
#seatSearch { border-color: #CBD5E3; background: #FBFCFE; }

/* The dossier is a peer workspace pane, not a floating card. Keep its footprint
   stable before selection and scroll its own evidence when it becomes dense. */
@media (min-width: 1181px) {
  .geo-wrap { align-items: stretch; }
  .geo-wrap > .dossier {
    position: static;
    align-self: stretch;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
}

/* Watch is the only elevated briefing. Everything below it is supporting evidence. */
.focus-deck { border-color: #CDD7E5; border-radius: 12px; box-shadow: 0 3px 12px rgba(20,30,60,.07); }
.focus-evidence { border-color: #DCE3ED; }
.watch-workspace { padding: 30px 0; }
.watch-workspace .card { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0; }
.watch-brief-grid { gap: 0; border-top: 1px solid #DDE3EC; border-bottom: 1px solid #DDE3EC; padding: 18px 0; }
.watch-brief-grid > .card + .card { padding-left: 28px; border-left: 1px solid #DDE3EC; }
.watch-calendar ol, .watch-key-seats ol { border-color: #DDE3EC; }
.campaign-stream { padding: 20px 0 !important; border-bottom: 1px solid #DDE3EC !important; }
.campaign-stream-grid { border-color: #DDE3EC; }
.watch-key-seats { padding: 20px 0 !important; }

/* Shared interaction vocabulary. */
.btn-ghost, .landing-lead-action { transition: background .16s ease-out, border-color .16s ease-out, color .16s ease-out, box-shadow .16s ease-out; }
.btn-ghost:focus-visible, .seg button:focus-visible, #seatSearch:focus-visible { outline: 2px solid #33589E; outline-offset: 2px; }
.btn-ghost { border-color: #CBD5E3; background: #FBFCFE; }
.btn-ghost:hover { border-color: #9FADC2; background: #F1F4F8; }
.data-table th { border-bottom-color: #CCD6E3; color: #68758B; }
.data-table td { border-bottom-color: #E3E8F0; }
.data-table tr:hover td { background: #EEF3F9; }
.outlook-grid { border-color: #CCD6E3; }
.outlook-item { border-color: #E0E6EF; }
.outlook-item:nth-child(n+2) { border-left-color: #E0E6EF; }

/* Investigation context dock: selection should remain legible and stationary while evidence refreshes. */
.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(590px, auto);
  align-items: end;
  gap: 24px;
}
.title-block { min-height: 50px; align-content: end; }
.top-controls {
  display: grid;
  grid-template-columns: 118px minmax(240px, 1.5fr) minmax(168px, .8fr);
  gap: 8px;
  align-items: end;
  min-width: 0;
  padding: 7px;
  border: 1px solid #D6DEE9;
  border-radius: 11px;
  background: #EEF2F7;
}
.ctl { display: grid; min-width: 0; gap: 5px; }
.ctl > span:first-child {
  min-height: 12px;
  margin: 0;
  padding: 0 4px;
  color: #61708A;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.2;
}
.ctl .select-shell {
  position: relative;
  display: block;
  height: 39px;
  margin: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #FCFDFE;
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(20,30,60,.025);
  letter-spacing: normal;
  text-transform: none;
}
.ctl .select-shell::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #50617C;
  border-bottom: 1.5px solid #50617C;
  transform: rotate(45deg);
  pointer-events: none;
}
.ctl select,
.language-ctl select {
  appearance: none;
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0 36px 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 39px;
  outline: 0;
  cursor: pointer;
}
.ctl:focus-within .select-shell {
  border-color: #4D6EA9;
  box-shadow: 0 0 0 3px rgba(77,110,169,.16);
}
/* Reserved for genuinely unknown, local fragments. Whole-page skeletons make
   election evidence disappear precisely when a person needs it most. */
@keyframes skel-shimmer { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.skel-fill {
  display: block; width: 100%; height: 100%; min-height: 96px; border-radius: inherit;
  background: linear-gradient(100deg, #EEF1F6 30%, #E4E8F0 45%, #EEF1F6 60%);
  background-size: 250% 100%; animation: skel-shimmer 1.3s ease-in-out infinite;
}
.landing-lead-panel.skeleton, .landing-card.skeleton { min-height: 180px; border: 1px solid var(--line); }
.landing-card.skeleton { padding: 0; }
#mainView[aria-busy="true"] .updated-row::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 1px;
  border-radius: 50%;
  background: #C82E35;
  animation: jejak-fetch 1s ease-in-out infinite;
}
@keyframes jejak-fetch { 50% { opacity: .28; } }

/* CJK copy needs normal tracking, not the Latin all-caps treatment. */
html[lang="zh"] .card-label,
html[lang="zh"] .side-label,
html[lang="zh"] .ctl span,
html[lang="zh"] .landing-kicker { letter-spacing: .04em; text-transform: none; }

@media (max-width: 1180px) {
  #overview .grid-3 > .card:nth-child(3) { border-left: 0; border-top: 1px solid #DDE3EC; margin-top: 20px; padding-top: 24px; }
  .topbar { grid-template-columns: 1fr; align-items: start; }
  .top-controls { width: 100%; grid-template-columns: 118px minmax(260px, 1.5fr) minmax(168px, .8fr); }
}

/* responsive */
@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .geo-wrap { grid-template-columns: 1fr; }
  .dossier { position: static; max-height: none; }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .shell.rail-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 18px; }
  .rail-toggle { display: none; }
  .side-meta { border: none; padding: 0; flex-direction: row; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-nav a { border-left: none; border-bottom: 3px solid transparent; }
  .side-nav a.active { border-bottom-color: var(--red); }
  .grid-3, .grid-2, .swing-cols { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 40px; }
  .focus-evidence { grid-template-columns: 1fr; }
  .focus-evidence article, .focus-evidence article + article { padding: 14px 0; border-right: 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .focus-evidence article:last-child { border-bottom: 0; }
  .watch-layout { grid-template-columns: 1fr; }
  .watch-status { justify-items: start; padding: 13px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .outlook-item:nth-child(n+2) { padding-left: 0; border-left: 0; }
  .watch-brief-head { display: block; }.watch-facts { grid-template-columns: 1fr 1fr; gap: 0; min-width: 0; margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); border-left: 0; }.watch-facts div { padding: 0 12px 0 0; }.watch-facts div + div { padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--line); }.focus-deck footer { display: block; }.focus-deck footer a { display: inline-block; margin-top: 9px; }
  .watch-workspace-head { display: block; }.watch-workspace-head > p { margin-top: 7px; }.watch-brief-grid { grid-template-columns: 1fr; }.watch-key-seats ol { grid-template-columns: 1fr 1fr; }.watch-key-seats li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .campaign-stream-grid { grid-template-columns: 1fr; }.campaign-social { margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }.campaign-news { grid-template-columns: 1fr; }.campaign-news-item:nth-child(n) { padding-left: 0; padding-right: 0; }
  .landing-lead-panel { grid-template-columns: 1fr; }.landing-lead-main, .landing-lead-readout { padding: 22px 20px; }.landing-lead-main h2 { font-size: 24px; }
  .main { padding: 24px 18px 52px; }.band { padding: 24px 0; }
  #overview .grid-3 > .card { padding: 20px 0; border-left: 0 !important; border-top: 1px solid #DDE3EC; }
  #overview .grid-3 > .card:first-child { border-top: 0; padding-top: 0; }
  #trends .grid-2, #reports .grid-2 { gap: 0; }
  #trends .grid-2 > .card, #reports .grid-2 > .card { padding: 20px 0; border-left: 0; border-top: 1px solid #DDE3EC; }
  #trends .grid-2 > .card:first-child, #reports .grid-2 > .card:first-child { border-top: 0; padding-top: 0; }
  .watch-brief-grid > .card + .card { margin-top: 20px; padding: 20px 0 0; border-left: 0; border-top: 1px solid #DDE3EC; }
  .topbar { gap: 15px; }
  .top-controls { grid-template-columns: minmax(112px, .8fr) minmax(0, 1.2fr); padding: 6px; }
  .contest-ctl { grid-column: 1 / -1; }
  .election-ctl { grid-column: 1 / -1; }
  .poll-record { grid-template-columns: 1fr; gap: 11px; }
}
@media (max-width: 560px) {
  .loading-state { min-height: 360px; padding: 32px 0 48px; }
  .loading-head h2 { font-size: 21px; }
  .loading-steps { grid-template-columns: 1fr; gap: 9px; }
  .loading-steps li, .loading-steps li:first-child { padding: 0; }
  .loading-steps li + li { padding-top: 9px; border-top: 1px solid var(--line); border-left: 0; }
}
