/* Cross-site presentation candidate. Load after the three existing page styles. */
:root {
  --reecho-bg: #0b1420;
  --reecho-surface: #111e2d;
  --reecho-surface-raised: #172638;
  --reecho-line: #2b3c48;
  --reecho-mint: #b8e6d4;
  --reecho-card-radius: 15px;
}

body[data-section="news"],
body[data-section="election"],
body[data-section="civic"] {
  --bg: var(--reecho-bg);
  --surface: var(--reecho-surface);
  --surface2: var(--reecho-surface-raised);
  --line: var(--reecho-line);
}

/* Keep mint as an accent; use the same navy family for large surfaces. */
body[data-section="news"] .prototype-strip {
  background: #142333;
  border-block-color: var(--reecho-line);
}
body[data-section="news"] .poc-pill {
  border-color: var(--reecho-line);
}
body[data-section="news"] .lead {
  background: linear-gradient(120deg, #1a3040, var(--reecho-surface) 80%);
  border-color: var(--reecho-line);
  border-radius: var(--reecho-card-radius);
}
body[data-section="news"] :is(.lead-top, .lead-bottom) {
  border-color: var(--reecho-line);
}
body[data-section="news"] .issue-card {
  background: linear-gradient(140deg, var(--reecho-surface-raised), var(--reecho-surface));
  border-radius: var(--reecho-card-radius);
}
body[data-section="news"] .sidebar > section {
  background: var(--reecho-surface);
  border-radius: var(--reecho-card-radius);
}

/* Long publisher titles must remain readable on a narrow screen. */
@media (max-width: 600px) {
  body[data-section="news"] :is(.brief-item .brief-title, .story-row h3) {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    overflow-wrap: anywhere;
  }
}

/* Leave room for user-increased text spacing in the shared mobile controls. */
@media (max-width: 390px) {
  #reecho-site-shell nav {
    min-width: 0;
    gap: 2px;
  }
  #reecho-site-shell nav a {
    flex: 1 1 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }
  body[data-section="civic"] .civic-mode-bar {
    flex-wrap: wrap;
    min-width: 0;
  }
  body[data-section="civic"] .civic-mode-bar select {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

/* Keep all three section links visible when zoom leaves very little CSS width. */
@media (max-width: 300px) {
  #reecho-site-shell nav {
    min-width: 0;
    gap: 2px;
  }
  #reecho-site-shell nav a {
    flex: 1 1 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.2;
  }
  [data-reecho-section-header] .section-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body[data-section="election"] .site-header {
    grid-template-columns: minmax(0, 1fr);
  }
  body[data-section="election"] .site-header .connection {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }
  body[data-section="election"] .desk-links {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
  }
  body[data-section="election"] .party-overview-counts,
  body[data-section="election"] .state-results-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  body[data-section="election"] .party-overview-counts :is(.party-overview-O, .party-overview-R) {
    text-align: left;
  }
  body[data-section="election"] :is(.metric, .state-result) {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  body[data-section="election"] .state-results-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  body[data-section="civic"] .civic-site-nav {
    min-width: 0;
  }
  body[data-section="civic"] .civic-site-nav a {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body[data-section="civic"] .civic-mode-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }
  body[data-section="civic"] .civic-mode-bar select {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }
  body[data-section="news"] #published-explainers .explainer-cards,
  body[data-section="news"] .sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
  body[data-section="news"] #published-explainers article,
  body[data-section="news"] .sidebar > section {
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 14px;
  }
  body[data-section="news"] .news-heading,
  body[data-section="news"] .feed-meta > div {
    flex-wrap: wrap;
  }
  body[data-section="news"] .news-heading .outline-button,
  body[data-section="news"] .feed-meta select,
  body[data-section="news"] .bridge-actions .outline-button {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

/* At a 195px CSS viewport, keep the remaining controls inside the page. */
@media (max-width: 220px) {
  body[data-section="news"] main {
    overflow-wrap: anywhere;
  }
  body[data-section="news"] .edition {
    flex-wrap: wrap;
  }
  body[data-section="news"] .edition-tools {
    width: 100%;
    align-items: stretch;
  }
  body[data-section="news"] .edition-tools .saved-top {
    justify-content: center;
  }
  body[data-section="news"] .lead-top,
  body[data-section="news"] .prototype-strip {
    flex-wrap: wrap;
  }
  body[data-section="news"] .lead-top .saved-top,
  body[data-section="news"] .prototype-strip p,
  body[data-section="news"] .prototype-strip .text-button {
    flex-basis: 100%;
  }
  body[data-section="news"] .lead-top .saved-top {
    justify-content: center;
  }
  body[data-section="news"] main .text-button {
    white-space: normal;
  }
  body[data-section="news"] .bridge {
    flex-wrap: wrap;
  }
  body[data-section="news"] .bridge-actions {
    width: 100%;
    margin-left: 0;
    flex-basis: 100%;
  }
  body[data-section="news"] .bridge-actions .outline-button {
    min-width: 0;
    flex-wrap: wrap;
  }
  body[data-section="civic"] .civic-transport {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 4px;
  }
  body[data-section="civic"] .civic-transport button {
    min-width: 0;
    padding-inline: 4px;
    gap: 2px;
  }
}
/* V2: one rendered layout and surface contract for the three entry pages. */
:root {
 --reecho-content: 1440px; --reecho-gutter: 48px;
 --reecho-bg: #0b1420; --reecho-surface: #111e2d;
 --reecho-surface-raised: #172638; --reecho-line: #344858;
 --reecho-ink: #f1eee6; --reecho-muted: #b4c5d0; --reecho-mint: #b8e6d4;
}
body:is([data-section="news"],[data-section="election"],[data-section="civic"]) {
 --bg:var(--reecho-bg);--surface:var(--reecho-surface);--surface2:var(--reecho-surface-raised);
 --line:var(--reecho-line);--ink:var(--reecho-ink);--muted:var(--reecho-muted);--accent:var(--reecho-mint);
 color:var(--reecho-ink);background:var(--reecho-bg);
}
body[data-section] > main,
#reecho-site-shell .reecho-shell-inner,
body[data-section] > [data-reecho-section-header] {
 width:calc(100% - var(--reecho-gutter) * 2);max-width:var(--reecho-content);
 margin-inline:auto;padding-inline:0;box-sizing:border-box;
}
body[data-section] > main {padding-top:0;padding-bottom:48px;}
#reecho-site-shell .reecho-shell-inner {padding-inline:0;}
body[data-section] > [data-reecho-section-header],body[data-section="news"] .edition {
 display:flex;align-items:center;justify-content:space-between;gap:16px;
 min-height:88px;height:auto;padding-block:20px;margin-block:0;
 border-bottom:1px solid var(--reecho-line);background:var(--reecho-bg);
 color:var(--reecho-ink);font-size:14px;line-height:1.5;
}
body[data-section="news"] .edition > span {font-size:16px;font-weight:750;letter-spacing:.01em;}
body[data-section="news"] .edition > span i {display:none;}
body[data-section="news"] .edition-tools {font-size:11px;color:var(--reecho-muted);}
body[data-section="election"] .header-meta {margin-left:auto;}
body[data-section="election"] .desk-links {gap:16px;}
body[data-section="election"] .connection {font-size:11px;}
body[data-section="news"] main > .intro,
body[data-section="election"] main > .hero,
body[data-section="civic"] main > .civic-intro {
 margin:0;padding:40px 0 32px;min-height:204px;box-sizing:border-box;
}
body[data-section] main h1.editorial-heading {font-size:clamp(36px,4.5vw,64px);line-height:1.08;letter-spacing:-.04em;margin:0 0 16px;font-weight:400;}
body[data-section] main :is(.kicker,.eyebrow).editorial-kicker {font-size:12px;line-height:18px;margin:0 0 12px;letter-spacing:.11em;color:var(--reecho-mint);}
body[data-section="news"] .deck,body[data-section="election"] .hero .intro,body[data-section="civic"] .civic-intro > .intro {
 font-size:15px;line-height:24px;color:var(--reecho-muted);margin:0;
}
body[data-section="civic"] .civic-course-callout {margin-top:32px;}
/* Filled panels use the same surface, rather than unrelated gradients/white/pastels. */
body[data-section="news"] :is(.lead,.issue-card,.sidebar > section,.reviewed-story,#published-explainers article,.brief),
body[data-section="election"] :is(.metrics,.turnout-overview,.party-overview,.map-card,.state-card,.detail-panel,.race-card,.source-card,.poll-card,.measure-card),
body[data-section="civic"] :is(.civic-course-callout,.civic-lesson,.civic-card,.civic-path,.civic-note,.civic-practice,.civic-tools,.civic-disclosure,.civic-scene) {
 background:var(--reecho-surface);color:var(--reecho-ink);border:1px solid var(--reecho-line);border-radius:12px;
}
body[data-section="news"] .brief {padding:24px;}
body[data-section="news"] .brief .brief-item {border-color:var(--reecho-line);}
body[data-section="news"] :is(.lead-top,.lead-bottom,.prototype-strip),
body[data-section="election"] :is(.race-footer,.detail-tabs),
body[data-section="civic"] :is(.civic-toolbar,.civic-tabs,.civic-picture) {
 background:var(--reecho-surface-raised);border-color:var(--reecho-line);color:var(--reecho-muted);
}
body[data-section="news"] #published-explainers article {padding:24px;}
body[data-section="news"] #published-explainers article > p:not(.explainer-label) {color:var(--reecho-muted);}
body[data-section="news"] #published-explainers :is(a,.explainer-label) {color:var(--reecho-mint);}
body[data-section="news"] #published-explainers a:focus-visible {outline-color:var(--reecho-mint);}
body[data-section="civic"] .civic-lesson[data-mode] .civic-scene {background:var(--reecho-surface);color:var(--reecho-ink);}
body[data-section="civic"] .civic-lesson[data-mode] .civic-scene p {color:var(--reecho-muted);}
body[data-section="civic"] .civic-lesson[data-mode] .civic-picture {
 background:var(--reecho-surface-raised);border:1px solid var(--reecho-line);border-radius:8px;
}
body[data-section="civic"] .civic-lesson[data-mode] .civic-scene h3 {color:var(--reecho-ink);}
/* Consistent table cells, including inline-styled turnout rows. Semantic chart colors remain. */
body[data-section] main table {border-collapse:collapse;background:var(--reecho-surface);color:var(--reecho-ink);border:1px solid var(--reecho-line);}
body[data-section] main table th {background:var(--reecho-surface-raised)!important;color:var(--reecho-ink)!important;font-weight:700;}
body[data-section] main table td {background:var(--reecho-surface)!important;color:var(--reecho-ink)!important;}
body[data-section] main table :is(th,td) {padding:12px 16px!important;border-color:var(--reecho-line)!important;line-height:1.5;}
body[data-section] main table tbody tr:nth-child(even) td {background:var(--reecho-surface-raised)!important;}
body[data-section] main table tbody tr:hover td {background:#203548!important;}
body[data-section] main :is(select,input[type="search"],input[type="text"]) {background:var(--reecho-bg);color:var(--reecho-ink);border-color:#647d8f;border-radius:6px;}
body[data-section] main :is(.primary-button,.civic-course-callout a,.civic-next) {background:var(--reecho-mint);color:var(--reecho-bg);border:1px solid var(--reecho-mint);border-radius:6px;}
body[data-section] main :is(.outline-button,.secondary-button,.civic-transport button:not(.civic-next)) {background:var(--reecho-surface-raised);color:var(--reecho-ink);border:1px solid var(--reecho-line);border-radius:6px;}
body[data-section] main button:disabled {opacity:.55;}
@media(max-width:1100px) {
 body[data-section="election"] > [data-reecho-section-header] {flex-wrap:wrap;}
 body[data-section="election"] .header-meta {display:none;}
}
@media(max-width:700px) {
 :root {--reecho-gutter:20px;}
 body[data-section] > [data-reecho-section-header],body[data-section="news"] .edition {min-height:96px;padding-block:16px;flex-wrap:wrap;gap:8px 12px;}
 body[data-section="election"] .desk-links {order:3;flex-basis:100%;gap:12px;}
 body[data-section="election"] .connection {margin-left:auto;}
 body[data-section="news"] main > .intro,body[data-section="election"] main > .hero,body[data-section="civic"] main > .civic-intro {padding:28px 0 24px;min-height:0;}
 body[data-section] main h1.editorial-heading {font-size:36px;}
 body[data-section="news"] .intro-aside {display:none;}
 body[data-section="news"] .brief {padding:20px;}
 body[data-section="news"] #published-explainers article {padding:20px;}
 body[data-section] main table :is(th,td) {padding:10px 12px!important;}
}
@media(max-width:350px) {:root {--reecho-gutter:12px;}body[data-section] main h1.editorial-heading {font-size:32px;}}
/* Matched mobile section bars preserve every action in a compact second row. */
body[data-section="civic"] .civic-slide-content {background:var(--reecho-surface);}
body[data-section="civic"] .civic-lesson[data-mode] .civic-scene {--scene-line:var(--reecho-bg);}
body[data-section="news"] .sidebar > section.follow-box {background:var(--reecho-surface);}
body[data-section="election"] .snapshot-status {padding:16px;border:1px solid var(--reecho-line);border-radius:0;background:var(--reecho-surface-raised);color:var(--reecho-muted);}
body[data-section="election"] .snapshot-status:is([data-state="unavailable"],[data-state="stale"]) {border-left:3px solid #ffdfa3;color:#ffdfa3;}
@media(max-width:700px) {
 body[data-section] > [data-reecho-section-header],body[data-section="news"] .edition {
  display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:44px 44px;
  min-height:112px;height:112px;gap:0 12px;padding:12px 0;
 }
 body[data-section="news"] .edition > span,body[data-section] [data-reecho-section-header] > .section-name {grid-column:1/-1;grid-row:1;font-size:16px;white-space:normal;}
 body[data-section="news"] .edition-tools {grid-column:1/-1;grid-row:2;justify-self:start;}
 body[data-section="civic"] .civic-site-nav {grid-column:1/-1;grid-row:2;justify-self:start;}
 body[data-section="election"] [data-reecho-section-header] > .section-name {grid-column:1;}
 body[data-section="election"] .connection {grid-column:2;grid-row:1;justify-self:end;max-width:100%;font-size:9px;}
 body[data-section="election"] .desk-links {grid-column:1/-1;grid-row:2;display:flex;flex-wrap:nowrap;overflow-x:auto;gap:16px;min-width:0;width:100%;height:44px;align-items:center;}
 body[data-section="election"] .desk-links a {flex:0 0 auto;min-height:44px;padding:0;display:inline-flex;align-items:center;white-space:nowrap;background:none;border:0;}
 body[data-section="election"] main {display:flex;flex-direction:column;}
 body[data-section="election"] main > .hero {order:-1;}
 body[data-section="election"] .phone-nav {position:static;margin:0 0 24px;}
}
/* Final shared-header alignment and legible civic line art. */
body[data-section="news"] .edition > span:first-child {padding-top:0;max-width:none;}
body[data-section="civic"] .civic-lesson[data-mode] .civic-art-detail {stroke:var(--scene-color);}
@media(max-width:700px) {
 body[data-section="election"] .desk-links {overflow-y:hidden;scrollbar-width:thin;}
 body[data-section="election"] .desk-links a {min-height:36px;height:36px;}
}
/* All four Election tools fit on ordinary phones; narrower screens use two rows. */
@media(min-width:351px) and (max-width:700px) {
 body[data-section="election"] .desk-links {gap:8px;overflow:visible;justify-content:space-between;}
 body[data-section="election"] .desk-links a {font-size:12px;min-height:44px;height:44px;letter-spacing:0;}
}
@media(max-width:350px) {
 body[data-section] > [data-reecho-section-header],body[data-section="news"] .edition {height:156px;min-height:156px;grid-template-rows:44px 88px;}
 body[data-section="election"] .desk-links {display:grid;grid-template-columns:1fr 1fr;gap:0 8px;height:88px;overflow:visible;}
 body[data-section="election"] .desk-links a {font-size:12px;min-height:44px;height:44px;white-space:normal;}
}
body[data-section="news"] main > .intro,body[data-section="election"] main > .hero {align-items:flex-start;}
@media(max-width:350px) {body[data-section] main :is(.kicker,.eyebrow).editorial-kicker {min-height:36px;}}
/* Retained-data cards and numeric tables use the same readable surface contract. */
body[data-section="news"] .follow-box {background:var(--reecho-surface)!important;border-color:var(--reecho-line);}
body[data-section="election"] main table {display:block;max-width:100%;overflow-x:auto;min-width:0;}
body[data-section="election"] main table :is(th,td) {white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;}
/* Major content cards share one padding scale; nested cells retain compact spacing. */
body[data-section="news"] :is(.lead-body,.brief,.reviewed-story,#published-explainers article),
body[data-section="election"] :is(.vote-stream,.party-overview,.map-card,.state-card,.source-card,.poll-card,.metric),
body[data-section="civic"] :is(.civic-course-callout,.civic-slide-content,.civic-lesson-section) {padding:24px;}
@media(max-width:700px) {
 body[data-section="news"] :is(.lead-body,.brief,.reviewed-story,#published-explainers article),
 body[data-section="election"] :is(.vote-stream,.party-overview,.map-card,.state-card,.source-card,.poll-card,.metric),
 body[data-section="civic"] :is(.civic-course-callout,.civic-slide-content,.civic-lesson-section) {padding:20px;}
}
/* Keep wide numeric tables inside their cards, never scrolling the whole panel. */
body[data-section="election"] #turnout-content > .source-card {min-width:0;}
body[data-section="election"] #turnout-content details {min-width:0;max-width:100%;}
@media(min-width:801px) {body[data-section="election"] #turnout-content {grid-template-columns:repeat(2,minmax(0,1fr));}}
body[data-section="news"] .lead-copy {padding:0;}

/* A single header treatment: page identity is white, navigation state is mint. */
body[data-section="news"] .edition > span:first-child,
body[data-section] [data-reecho-section-header] > .section-name {
 color:var(--reecho-ink);font-size:16px;font-weight:800;letter-spacing:.01em;
}
body[data-section] main h1.editorial-heading,
body[data-section] main h1.editorial-heading > span {color:var(--reecho-ink);}
body[data-section] main :is(.kicker,.eyebrow).editorial-kicker {color:var(--reecho-mint);}
body[data-section] [data-reecho-section-header] :is(.desk-links,.civic-site-nav) a {
 color:var(--reecho-mint);background:transparent;border:0;border-radius:0;
 padding:0;font-size:12px;font-weight:600;text-decoration:underline;text-underline-offset:.18em;
}
body[data-section] [data-reecho-section-header] :is(.desk-links,.civic-site-nav) a:hover {color:var(--reecho-ink);}
body[data-section] [data-reecho-section-header] :is(.desk-links,.civic-site-nav) a:focus-visible {
 outline:3px solid var(--reecho-mint);outline-offset:4px;
}


/* Section utilities share one shape; each retains its own meaning and state. */
body[data-section="news"] .edition-tools .saved-top,
body[data-section="election"] .connection,
body[data-section="civic"] .section-badge {
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  min-height:44px;padding:9px 13px;box-sizing:border-box;
  border:1px solid var(--reecho-line);border-radius:6px;
  background:var(--reecho-surface);color:var(--reecho-ink);
  font-size:11px;line-height:1.25;letter-spacing:0;white-space:nowrap;
}
body[data-section="news"] .edition-tools .saved-top:hover {border-color:var(--reecho-mint);}
body[data-section="election"] .connection.error {color:var(--reecho-warning,#e5bf7b);border-color:#695333;}
body[data-section="election"] .connection.error i {background:currentColor;}
body[data-section="civic"] .civic-site-nav {display:flex;align-items:center;gap:16px;margin-left:auto;}
body[data-section="civic"] .section-badge {color:var(--reecho-muted);}
body[data-section="civic"] .civic-footer {justify-content:flex-start;}
@media(max-width:700px) {
  body[data-section="election"] .connection {grid-row:1;font-size:10px;margin-left:0;}
  body[data-section="civic"] .civic-site-nav {grid-column:1;grid-row:2;justify-self:start;margin-left:0;gap:14px;}
  body[data-section="civic"] .section-badge {grid-column:2;grid-row:2;justify-self:end;padding-inline:9px;font-size:10px;}
}
@media(max-width:350px) {
  body[data-section="civic"] > [data-reecho-section-header] {height:auto;min-height:156px;grid-template-rows:44px 88px;}
  body[data-section="civic"] .civic-site-nav {grid-column:1/-1;align-self:start;}
  body[data-section="civic"] .section-badge {grid-column:1/-1;grid-row:2;justify-self:start;align-self:end;}
}

/* Keep Election Desk destinations and feed status together at the right. */
@media(min-width:701px) {
  body[data-section="election"] > [data-reecho-section-header] {justify-content:flex-start;}
  body[data-section="election"] .header-meta {margin-left:0;}
  body[data-section="election"] .desk-links {margin-left:auto;}
  body[data-section="election"] .connection {margin-left:0;}
}
