@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #1c2c27;
  --ink2: #2c4038;
  --muted: #53655b;
  --paper: #fffefa;
  --line: #dce2d8;
  --forest: #244e40;
  --editorial: 'Instrument Serif', Georgia, serif;
  --glass: rgba(255, 255, 252, .82);
  --panel-shadow: 0 1px 2px #263d2708, 0 12px 32px #26382b0a;
}

body {
  background:
    radial-gradient(ellipse at 84% 0%, #e4ede3 0%, transparent 40%),
    linear-gradient(#f6f6ef, #eef1e9 580px, #f6f6ef);
  color: var(--ink);
}

:is(a, button, input, select, summary):focus-visible {
  outline-color: #38785f;
}

.main-area {
  max-width: 1540px;
  margin: 0 auto;
  padding: 18px clamp(16px, 2.5vw, 38px) 24px;
}

.sidebar {
  min-height: 0;
  background: rgba(247, 249, 242, .86);
  border-color: var(--line);
  color: var(--ink);
  scrollbar-color: #b7c4b8 transparent;
}

.sidebar-brand { border-color: var(--line); }
.brand-glyph, .sidebar-brand > div strong { color: var(--ink); }
.brand-glyph span { color: #54782c; }
.brand-rule { background: #a8b5a4; }
.sidebar-brand > div small { color: var(--muted); }
.rail-group { color: var(--muted); font-family: var(--sans); font-size: 10px; }
.rail-link, .rail-region { color: var(--muted); }
.rail-link i { color: #50665d; }
.rail-link:hover, .rail-region:hover, .rail-region.active { background: #e9efe6; color: var(--ink); }
.rail-link.is-current { background: #e2ecd9; border-color: #ccdcbf; color: var(--forest); box-shadow: none; }
.rail-link.is-current .ic, .rail-link.is-current i { color: var(--forest); }
.rail-region.active .region-bubble { background: #5c8a59; border-color: #5c8a59; }
.sidebar-bottom { background: var(--glass); border-color: var(--line); border-radius: 16px; }
.sidebar-bottom-heading, .sidebar-bottom p, .sidebar-company { color: var(--muted); }
.sidebar-company:hover { color: var(--forest); }
.sidebar-method { background: #edf2e9; color: var(--forest); border-color: #d7e2d3; border-radius: 8px; }

.topbar {
  min-height: 64px;
  height: auto;
  margin: 12px clamp(16px, 2.5vw, 38px) 0;
  padding-inline: 18px;
  top: 10px;
  background: rgba(251, 252, 247, .9);
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 18px;
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(18px);
}

.topbar-location, .topbar-date { color: var(--muted); }
.topbar-location strong, .topbar-location b { color: var(--ink); }
.command-shortcut, .mobile-menu {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--ink2);
}
.command-shortcut:hover, .mobile-menu:hover { background: #edf2e9; border-color: #b5c7b9; }
.command-shortcut kbd, .search-field kbd {
  color: var(--muted);
  border-color: var(--line);
}
.uptime-pill { display: none; }
.pwa-top-install, .pwa-side-install, .pwa-install-close {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
  border-radius: 999px;
}
.pwa-top-install:hover, .pwa-side-install:hover, .pwa-install-close:hover {
  background: #34634f;
  color: #fff;
  border-color: #34634f;
}
.pwa-top-install { min-height: 38px; font-size: 11px; }
.pwa-install-dialog { border: 1px solid var(--line); border-radius: 22px; background: var(--paper); }
.pwa-install-heading { background: #e8efe2; color: var(--ink); }
.pwa-install-heading span { color: var(--forest); }
.pwa-install-heading h2 { font: 400 36px/1.02 var(--editorial); letter-spacing: -.02em; }
.pwa-install-content p { color: var(--muted); }

.workspace-heading {
  position: relative;
  display: block;
  text-align: center;
  overflow: hidden;
  margin: 0 0 14px;
  padding: clamp(23px, 3.3vw, 48px) 18px clamp(23px, 2.8vw, 38px);
  border: 1px solid #fffdf5;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 92% 100%, rgba(129, 168, 138, .38), transparent 59%),
    radial-gradient(ellipse at 0% 10%, rgba(225, 200, 156, .36), transparent 51%),
    linear-gradient(108deg, #f6f2e7 5%, #f4f7ee 55%, #e0eadf);
  box-shadow: var(--panel-shadow);
}

.workspace-eyebrow {
  justify-content: center;
  gap: 8px;
  color: var(--forest);
  font: 740 11px/1.25 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow-line { width: 7px; height: 7px; border-radius: 50%; background: #5c8564; }
.workspace-heading h1 {
  margin: 8px 0 7px;
  color: var(--ink);
  font: 400 clamp(52px, 6.1vw, 94px)/.95 var(--editorial);
  letter-spacing: -.035em;
  text-wrap: balance;
}
.workspace-heading h1 em { color: var(--forest); }
.lime-dot { color: #526e39; }
.workspace-heading p {
  margin: 0 auto;
  max-width: 42ch;
  color: #405b4d;
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.55;
  text-wrap: pretty;
}
.heading-actions { position: absolute; top: 13px; right: 13px; padding: 0; }
.heading-actions .solid-action { display: none; }
.outlined-action {
  background: var(--glass);
  color: var(--forest);
  border-color: rgba(255, 255, 255, .9);
  border-radius: 999px;
}
.outlined-action:hover { border-color: #a4bbae; }

.metrics { gap: 10px; margin-bottom: 16px; }
.metric {
  min-height: 96px;
  padding: 12px 15px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--panel-shadow);
}
.metric:hover { border-color: #b4c9b8; }
.metric.is-selected { background: #e9f2e2; border-color: #c9dcc1; }
.metric-label { color: var(--muted); font: 730 11px/1.3 var(--sans); letter-spacing: 0; }
.metric-label .ic { color: #5f7c6d; }
.metric > strong { margin: 5px 0 4px; color: var(--ink); font: 400 36px/.95 var(--editorial); letter-spacing: -.035em; }
.metric-note { color: var(--muted); }
.metric-led, .state-dot.green { background: #45825e; }

.work-grid { gap: 16px; }
.data-panel, .inspect-card, .agenda-card, .data-guide {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  box-shadow: var(--panel-shadow);
}
.data-head { align-items: center; padding-top: 15px; padding-bottom: 12px; }
.data-head h2, .agenda-heading h2, .guide-head h2 {
  margin: 0;
  color: var(--ink);
  font: 400 36px/1 var(--editorial);
  letter-spacing: -.02em;
}
.search-field, .field-select {
  height: 44px;
  background: #fffefa;
  border-color: var(--line);
  border-radius: 11px;
  color: var(--muted);
}
.search-field:focus-within { border-color: #5d8973; box-shadow: 0 0 0 3px #5d897320; }
.search-field input, .field-select select, .sort-field select { font-size: 12px; color: var(--ink2); }
.search-field input::placeholder { color: #606f67; }
.field-select > .ic { color: #5f7468; }
.scope-tabs {
  gap: 4px;
  padding: 7px 11px;
  border-color: #e4e9e1;
  background: #f5f7f0;
}
.scope-tabs button { color: var(--muted); border: 1px solid transparent; border-radius: 999px; padding: 8px 10px; }
.scope-tabs button:hover { color: var(--forest); background: #e9eee4; }
.scope-tabs button.active { color: var(--forest); border-color: #d2e0cd; background: #e4eddd; }
.scope-tabs button span, .scope-tabs button.active span { color: #426653; }
.table-header {
  background: #f5f7f0;
  border-color: #e4e9e1;
  color: var(--muted);
  font: 750 9px/1.3 var(--sans);
}
.election-table { scrollbar-color: #bac9bc #f5f7f0; }
.e-row { background: transparent; border-color: #e5ebe2; }
.e-row:hover { background: #f1f5ed; }
.e-row.is-selected { background: #ebf3e7; box-shadow: inset 3px 0 #72a280; }
.e-flag, .selected-flag { border-radius: 4px; background: #e6eee4; border-color: var(--line); }
.e-identity strong { color: var(--ink); font-size: 13px; }
.e-identity > span, .e-region, .e-date, .e-status { color: var(--muted); }
.e-identity > span { font-size: 11px; }
.icon-btn { border-radius: 8px; border-color: #dbe5db; color: #426354; background: #fffefa; }
.icon-btn:hover { color: #20573f; background: #e7f0e2; }
.table-footer { border-color: var(--line); color: var(--muted); }
.table-footer button, .list-zero button {
  color: var(--forest);
  background: #edf3e9;
  border-color: #d3e0d2;
  border-radius: 8px;
}

.insights { gap: 16px; }
.inspect-card { overflow: hidden; }
.card-strip { border-color: var(--line); color: var(--muted); font: 740 11px/1.35 var(--sans); }
.card-strip .ic, .module-kicker { color: var(--forest); }
.inspector-overline { color: var(--muted); }
.inspector-flag-meta strong { color: var(--ink); font: 400 34px/1 var(--editorial); letter-spacing: -.02em; }
.inspector-main h3 { color: var(--ink2); }
.selected-description { color: var(--muted); }
.inspector-info-grid { border-color: var(--line); border-radius: 10px; background: #f2f5ee; }
.inspector-info-grid > div + div { border-color: var(--line); }
.inspector-info-grid > div span { color: var(--muted); }
.inspector-info-grid > div strong { color: var(--ink2); }
.main-action, .secondary-action { border-radius: 9px; }
.main-action { background: var(--forest); border-color: var(--forest); }
.main-action:hover { background: #34634f; }
.secondary-action { border-color: var(--line); color: var(--forest); }
.secondary-action:hover { background: #edf3ea; }
.inspector-caution { background: #f5f7f0; border-color: var(--line); color: var(--muted); }
.agenda-heading { border-color: var(--line); }
.agenda-heading h2, .guide-head h2 { font-size: 31px; }
.agenda-count, .agenda-desc > span, .agenda-foot, .guide-head p, .trust-line { color: var(--muted); }
.agenda-entry { border-color: #e4e9e1; }
.agenda-entry:hover { background: #f0f5ed; }
.agenda-entry time { background: #e8efe2; border-radius: 9px; color: var(--forest); }
.agenda-entry time span, .agenda-desc strong { color: var(--forest); }
.guide-details details { background: #f7f8f2; border-color: var(--line); border-radius: 10px; }
.toast { border-radius: 12px; background: var(--forest); }

@media (max-width: 1000px) {
  .heading-actions { display: none; }
}

@media (max-width: 800px) {
  html { scroll-padding-top: calc(88px + env(safe-area-inset-top)); }
  .main-area { padding-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .topbar {
    top: env(safe-area-inset-top);
    margin: max(8px, env(safe-area-inset-top)) 12px 0;
    min-height: 58px;
    padding: 6px 8px;
    border-radius: 16px;
  }
  .topbar-location .topbar-mobile-brand { font-size: 14px; }
  .topbar-location b { display: none; }
  .mobile-menu, .command-shortcut, .pwa-top-install { min-height: 44px; border-radius: 11px; }
  .sidebar { background: #f6f8f0; }
  .workspace-heading { border-radius: 19px; }
  .workspace-heading h1 { font-size: clamp(49px, 8.5vw, 70px); }
  .election-table { max-height: none; overflow: visible; }
  .search-field input { font-size: 16px; }
}

@media (max-width: 650px) {
  .main-area { padding-top: 12px; }
  .workspace-heading { margin-bottom: 10px; padding: 20px 12px; }
  .workspace-eyebrow { font-size: 9px; }
  .workspace-heading h1 { font-size: clamp(42px, 11.4vw, 66px); letter-spacing: -.035em; }
  .workspace-heading p { max-width: 33ch; }
  .metrics { gap: 6px; margin-bottom: 10px; }
  .metric {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 5px;
    align-items: center;
    min-height: 45px;
    padding: 6px 8px;
    border-radius: 11px;
  }
  .metric > strong { grid-area: 1 / 1; margin: 0; font-size: 29px; text-align: center; }
  .metric-label { grid-area: 1 / 2; font-size: 11px; }
  .metric-label .ic, .metric-note { display: none; }
  .data-head { padding: 13px 12px 10px; }
  .data-head h2 { font-size: 32px; }
  .search-tools { padding: 0 11px 8px; }
  .search-field { height: 45px; }
  .field-select { height: 40px; }
  .scope-tabs { flex-wrap: wrap; gap: 3px; padding: 5px 6px; }
  .scope-tabs button span { margin-left: 2px; }
  .scope-tabs button { min-height: 36px; padding-inline: 6px; font-size: 10.5px; }
  .table-header { display: none; }
  .e-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'name actions' 'date actions';
    gap: 2px 8px;
    padding: 9px 9px 9px 10px;
    min-height: 65px;
  }
  .e-select { grid-area: name; align-self: end; gap: 9px; }
  .e-identity strong { font-size: 13px; }
  .e-identity > span { max-width: none; font-size: 11px; }
  .e-date { grid-area: date; align-self: start; padding-left: 42px; font-size: 9px; }
  .e-actions { grid-area: actions; }
  .e-actions .icon-btn { width: 43px; height: 44px; }
  .inspect-card {
    border-radius: 21px 21px 0 0;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--paper);
  }
  .card-strip > button { width: 44px; height: 44px; flex-basis: 44px; border-radius: 9px; }
  .insights { padding-top: 0; }
}

@media (max-width: 360px) {
  .topbar-right { gap: 4px; }
  .pwa-top-install { padding-inline: 7px; }
  .pwa-install-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .metric:hover { transform: none; }
}

/* Section navigation */
.mobile-tabs { display: none; }

.section-heading {
  margin-bottom: 18px;
  padding: clamp(22px, 3vw, 40px) clamp(17px, 3.1vw, 46px);
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 22px;
  background: linear-gradient(110deg, #f5f2e7, #e2ede1);
  box-shadow: var(--panel-shadow);
}

.section-heading h1 {
  margin: 0;
  color: var(--ink);
  font: 400 clamp(48px, 6vw, 76px)/.95 var(--editorial);
  letter-spacing: -.03em;
}

.section-heading p { margin: 10px 0 0; color: #405b4d; font-size: clamp(13px, 1.2vw, 15px); }
.section-heading h1:focus, #overview h1:focus, #main:focus { outline: none; }
#overview .metrics { margin-bottom: 5px; }
#overview .metric { min-height: 110px; }
#overview .metric:hover { background: #f5faf1; }
#directory-view .search-tools { padding-top: 14px; }
#directory-view:has(#insights[hidden]) { grid-template-columns: minmax(0, 1fr); }
#empty-browse {
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: 10px;
  color: white;
  background: var(--forest);
  font-weight: 750;
}
#key-dates { padding: 4px clamp(13px, 2.5vw, 27px); }
#key-dates .agenda-entries { display: block; }
#key-dates .agenda-entry { grid-template-columns: 54px minmax(0, 1fr) 18px; gap: 14px; padding: 12px 2px; }
#key-dates .agenda-entry time { height: 50px; }
#key-dates .agenda-desc strong { font-size: 15px; }
#key-dates .agenda-desc > span { font-size: 12px; }
#key-dates .agenda-foot { font-size: 12px; padding: 15px 0; }
#methodology { margin-top: 0; }
.sidebar-method.is-current { background: #e2ecd9; border-color: #b4c9b1; }

@media (max-width: 800px) {
  html { scroll-padding-top: calc(124px + env(safe-area-inset-top)); }
  .mobile-tabs {
    position: sticky;
    z-index: 24;
    top: calc(58px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    margin: 6px 12px 0;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .94);
    border-radius: 14px;
    background: rgba(251, 252, 247, .93);
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(16px);
  }
  .mobile-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 46px;
    border-radius: 9px;
    color: var(--muted);
    font: 730 10px/1.1 var(--sans);
    white-space: nowrap;
  }
  .mobile-tabs a.is-current { background: #e2ecd9; color: var(--forest); }
  #directory-view .insights { display: block; }
  .section-heading { margin-bottom: 11px; border-radius: 17px; }
}

@media (max-width: 650px) {
  #overview .metrics { gap: 8px; }
  #overview .metric { min-height: 51px; }
  .section-heading { padding-block: 20px; }
  .section-heading h1 { font-size: clamp(41px, 12vw, 60px); }
  .section-heading p { margin-top: 6px; }
  #directory-view .search-tools { padding-top: 10px; }
}

.election-news {
  margin-top: 22px;
  padding: clamp(15px, 2.3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  box-shadow: var(--panel-shadow);
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.news-header h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font: 400 clamp(38px, 4.1vw, 60px)/.95 var(--editorial);
  letter-spacing: -.02em;
}

.news-header p { margin: 0; color: var(--muted); font-size: 13px; }
.news-controls { display: flex; flex: none; gap: 7px; }
.news-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #cedbd0;
  border-radius: 50%;
  background: #e8f0e3;
  color: var(--forest);
}
.news-controls button:hover:not(:disabled) { background: #dcead7; }
.news-controls button:disabled { opacity: .42; }
#news-prev .ic { transform: rotate(180deg); }

.news-stories {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 30px) / 3);
  gap: 15px;
  margin: 0;
  padding: 2px 1px 13px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #a7baaa #e9eee6;
  list-style: none;
}

.news-story {
  min-width: 0;
  scroll-snap-align: start;
}
.news-story a {
  display: flex;
  flex-direction: column;
  min-height: 185px;
  height: 100%;
  padding: 17px;
  gap: 11px;
  border: 1px solid #dce6dc;
  border-radius: 16px;
  background: #f3f6ef;
}
.news-story:first-child a { background: #e6efe1; border-color: #d0e0d0; }
.news-story a:hover { background: #e8f1e5; border-color: #a3bfaa; }
.news-story a:focus-visible { outline-offset: -4px; }
.news-topic {
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.news-story strong {
  color: var(--ink);
  font: 400 clamp(26px, 2.5vw, 37px)/1.04 var(--editorial);
  overflow-wrap: anywhere;
}
.news-byline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 10px;
  row-gap: 3px;
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
}
.news-source { font-weight: 680; }

@media (max-width: 1050px) {
  .news-stories { grid-auto-columns: calc((100% - 15px) / 2); }
}

@media (max-width: 650px) {
  .election-news { margin-top: 14px; border-radius: 18px; }
  .news-header { align-items: start; margin-bottom: 12px; }
  .news-header p { font-size: 12px; }
  .news-controls { gap: 4px; }
  .news-stories { grid-auto-columns: 89%; gap: 9px; }
  .news-story a { min-height: 168px; padding: 14px; }
}

/* Overview */
.main-area:has(#overview:not([hidden])) {
  max-width: none;
}

.overview-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

#overview .workspace-heading {
  display: grid;
  align-items: center;
  min-height: 215px;
  margin: 0;
  padding: 28px clamp(22px, 3.2vw, 58px);
  text-align: left;
}

#overview .workspace-eyebrow { justify-content: flex-start; }
#overview .workspace-heading p { margin-inline: 0; max-width: 55ch; }

#overview .workspace-heading h1 {
  font-size: clamp(48px, 4.8vw, 88px);
}

#overview .metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

#overview .metric {
  min-height: 0;
  justify-content: center;
}

.overview-briefing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, .34fr);
  align-items: stretch;
  gap: 16px;
}

.overview-briefing .election-news,
.overview-dates {
  min-width: 0;
  margin: 0;
  padding: clamp(16px, 2vw, 30px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  box-shadow: var(--panel-shadow);
}

.news-header h2,
.overview-dates h2 {
  color: var(--ink);
  font: 400 clamp(36px, 3.5vw, 55px)/.95 var(--editorial);
  letter-spacing: -.025em;
}

.overview-dates h2 {
  margin: 0 0 16px;
  font-size: clamp(36px, 3vw, 49px);
}

#overview-agenda .agenda-entry {
  grid-template-columns: 44px minmax(0, 1fr) 15px;
  gap: 12px;
  padding: 10px 0;
  min-height: 62px;
}

#overview-agenda .agenda-desc strong { font-size: 13px; }
#overview-agenda .agenda-desc > span { font-size: 11px; line-height: 1.3; }
#overview-agenda > .agenda-entry:first-child { border-top: 1px solid var(--line); }

.overview-calendar-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 13px;
  min-height: 42px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 750;
}
.overview-calendar-link:hover { text-decoration: underline; }

@media (min-width: 1051px) {
  .overview-briefing .news-stories {
    grid-template-rows: repeat(3, minmax(106px, auto));
    grid-auto-columns: calc((100% - 13px) / 2);
    gap: 9px 13px;
    padding-bottom: 7px;
  }

  .overview-briefing .news-story:first-child { grid-row: span 3; }
  .overview-briefing .news-story a {
    min-height: 0;
    padding: 10px 15px;
    gap: 5px;
  }
  .overview-briefing .news-story strong {
    font-size: clamp(21px, 1.65vw, 32px);
    line-height: 1.03;
  }
  .overview-briefing .news-story:first-child a {
    justify-content: center;
    gap: 14px;
    padding: clamp(16px, 2vw, 33px);
    background:
      radial-gradient(ellipse at 5% 100%, #d2e4d1, transparent 65%),
      linear-gradient(145deg, #f0f4e8, #e5eede);
  }
  .overview-briefing .news-story:first-child strong {
    font-size: clamp(29px, 3.1vw, 58px);
    line-height: .98;
  }
  .overview-briefing .news-story:first-child .news-byline { margin-top: 12px; }
  .overview-briefing .news-story:first-child a:hover { border-color: #94b39a; }
}

@media (max-width: 1050px) {
  .overview-masthead { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
  #overview .workspace-heading { min-height: 178px; }
  .overview-briefing { grid-template-columns: minmax(0, 1fr) minmax(225px, .43fr); gap: 10px; }
  .overview-briefing .news-stories { grid-auto-columns: 83%; gap: 9px; }
  .overview-briefing .news-story a { min-height: 210px; }
}

@media (max-width: 800px) {
  .overview-masthead, .overview-briefing { grid-template-columns: minmax(0, 1fr); }
  #overview .workspace-heading { min-height: 0; padding: 20px 12px; text-align: center; }
  #overview .workspace-eyebrow { justify-content: center; }
  #overview .workspace-heading p { margin-inline: auto; }
  #overview .workspace-heading h1 { font-size: clamp(42px, 11.4vw, 68px); }
  #overview .metric { min-height: 51px; }
  .overview-briefing .election-news, .overview-dates { border-radius: 17px; }
  .overview-briefing .news-stories { grid-auto-columns: 85%; }
  .overview-briefing .news-story a { min-height: 153px; }
  .overview-dates h2 { margin-bottom: 12px; }
}

#overview .workspace-heading {
  isolation: isolate;
  background:
    linear-gradient(100deg, #f6efe0 0%, #f0f4e9 56%, #c4d7c9 100%);
}

.overview-intro { position: relative; z-index: 1; }
.overview-earth {
  position: absolute;
  z-index: 0;
  right: 14px;
  top: 50%;
  width: clamp(235px, 27vw, 495px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  transform: translate(13%, -48%);
  opacity: .94;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 35%);
}
#overview .heading-actions { z-index: 2; }
#overview .workspace-heading h1 { text-wrap: initial; }
#overview .workspace-heading p { max-width: 51ch; }

.news-photo {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2.55;
  background: #dce8dc;
  border-radius: 10px;
}
.news-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-photo > span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 3px 7px;
  border-radius: 5px;
  background: #23382ee8;
  color: white;
  font: 650 10px/1.25 var(--sans);
}

.news-photo-credits { margin-top: 9px; color: var(--muted); font-size: 11px; }
.news-photo-credits summary { cursor: pointer; width: fit-content; }
.news-photo-credits ul { padding-inline-start: 18px; }
.news-photo-credits a { text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 1051px) {
  .overview-briefing .news-story:first-child a:has(.news-photo) {
    justify-content: start;
    padding: clamp(12px, 1.45vw, 24px);
    gap: 9px;
  }
  .overview-briefing .news-story:first-child a:has(.news-photo) strong {
    font-size: clamp(27px, 2.65vw, 50px);
  }
  .overview-briefing .news-story:first-child a:has(.news-photo) .news-byline { margin-top: auto; }
}

@media (min-width: 801px) {
  #overview .overview-intro { max-width: 76%; }
}

@media (max-width: 1050px) {
  .overview-earth { right: 0; opacity: .68; }
}

@media (max-width: 800px) {
  #overview .workspace-heading { padding: 26px 14px; }
  .overview-earth { transform: translate(38%, -48%); opacity: .26; }
  #overview .workspace-heading h1 { text-wrap: balance; }
  #overview .workspace-heading p { max-width: 34ch; }
  .news-photo { aspect-ratio: 2.25; }
}

/* Overview front page */
#overview .workspace-heading {
  min-height: 230px;
  padding-block: 25px;
  background: linear-gradient(105deg, #f8f2e5 4%, #f1f4e9 55%, #c6d8cc);
}

#overview .workspace-heading h1 {
  font-size: clamp(46px, 4.5vw, 85px);
  line-height: .95;
  text-wrap: wrap;
}

.overview-earth {
  right: 7px;
  width: clamp(235px, 28vw, 540px);
  mask-image: linear-gradient(90deg, transparent, #000 42%);
}

.overview-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 14px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--forest);
  color: white;
  font-size: 12px;
  font-weight: 760;
}
.overview-explore:hover { background: #34634f; }

.overview-briefing .news-header { align-items: center; margin-bottom: 14px; }
.overview-briefing .news-header h2 { margin: 0; }
.overview-briefing .news-feed-status { margin-top: 8px; }

.overview-briefing .news-story:first-child a:has(.news-photo) {
  position: relative;
  isolation: isolate;
  justify-content: end;
  min-height: 300px;
  padding: clamp(16px, 1.8vw, 30px);
  gap: 9px;
  overflow: hidden;
  background: #193b32;
  color: white;
}

.overview-briefing .news-story:first-child a:has(.news-photo)::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, #0b251c12 15%, #102b24a8 52%, #0c251df5 100%);
  pointer-events: none;
}

.overview-briefing .news-photo {
  position: absolute;
  z-index: -2;
  inset: 0;
  height: 100%;
  aspect-ratio: auto;
  border-radius: inherit;
  background: #244338;
}

.overview-briefing .news-photo > span {
  top: 9px;
  right: 9px;
  bottom: auto;
  z-index: 1;
}

.overview-briefing .news-story:first-child a:has(.news-photo) .news-topic { color: #d9efd9; }
.overview-briefing .news-story:first-child a:has(.news-photo) strong {
  color: #fffefa;
  font-size: clamp(30px, 2.8vw, 52px);
  line-height: .99;
  text-wrap: pretty;
}
.overview-briefing .news-story:first-child a:has(.news-photo) .news-byline { margin: 4px 0 0; color: #e3ece6; }
.overview-briefing .news-story:first-child a:has(.news-photo):focus-visible { outline-color: #d9efd9; }

.overview-dates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.overview-dates-header h2 { margin: 0; }
.overview-dates-header .ic { color: var(--forest); }
#overview-agenda .agenda-entry:first-child time { background: var(--forest); color: white; }
#overview-agenda .agenda-entry:first-child time span { color: #dfecd8; }

@media (min-width: 1051px) {
  .overview-briefing .news-stories {
    grid-template-rows: repeat(3, minmax(94px, auto));
    grid-template-columns: calc(57% - 7px);
    grid-auto-columns: calc(43% - 6px);
  }
  .overview-briefing .news-story:not(:first-child) a {
    background: transparent;
    border-color: var(--line);
  }
  .overview-briefing .news-story:not(:first-child) a:hover { background: #e8f1e5; border-color: #a3bfaa; }
}

@media (max-width: 800px) {
  #overview .workspace-heading { min-height: 0; padding: 23px 14px; }
  #overview .workspace-heading h1 { font-size: clamp(41px, 11vw, 66px); text-wrap: balance; }
  .overview-earth { transform: translate(38%, -48%); opacity: .31; }
  .overview-briefing .news-story:first-child a:has(.news-photo) { min-height: 260px; }
}

@font-face {
  font-family: Geist;
  src: url('/assets/fonts/geist-sans-variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Elections overview */
.control-shell:has(#overview:not([hidden])) {
  --sans: Geist, system-ui, sans-serif;
  --edition-paper: #f8faf8;
  --edition-rule: #dce6e0;
  --edition-ink: #142c25;
  --edition-tint: #eaf2ed;
  background: var(--edition-paper);
}

.control-shell:has(#overview:not([hidden])) .sidebar {
  background: #f0f5f1;
  border-color: var(--edition-rule);
}

.control-shell:has(#overview:not([hidden])) .rail-link.is-current {
  background: #dcece2;
  border-color: #c9e0d1;
  border-radius: 8px;
}

.control-shell:has(#overview:not([hidden])) .topbar {
  min-height: 61px;
  padding-inline: 0;
  background: var(--edition-paper);
  border: 0;
  border-bottom: 1px solid var(--edition-rule);
  border-radius: 0;
  box-shadow: none;
  top: 0;
}

#overview .overview-masthead {
  display: block;
  margin-bottom: 25px;
}

#overview .workspace-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 190px;
  margin-bottom: 12px;
  padding: 20px clamp(19px, 3vw, 44px);
  border: 1px solid var(--edition-rule);
  border-radius: 16px;
  background: linear-gradient(114deg, #eef5f0 0%, #e3efe7 100%);
  color: var(--edition-ink);
  box-shadow: none;
}

#overview .overview-intro { max-width: 72%; }
#overview .workspace-eyebrow { letter-spacing: .08em; font-size: 10px; }

#overview .workspace-heading h1 {
  margin: 6px 0 9px;
  color: var(--edition-ink);
  font: 680 clamp(42px, 4.3vw, 82px)/1.02 var(--sans);
  letter-spacing: -.055em;
  text-wrap: balance;
}

#overview .workspace-heading h1 span { color: #305f4d; }
#overview .workspace-heading p { max-width: none; color: #39574d; font-size: 14px; }

#overview .overview-explore {
  margin-top: 15px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 7px;
  background: #1f4a3b;
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}
#overview .overview-explore:hover { background: #2c624f; }

#overview .overview-earth-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: 43%;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(to right, transparent, #000 57%);
  background: radial-gradient(ellipse at 76% 55%, #528475 0%, #416b5e 50%, #b3cfc0 100%);
}

#overview .overview-earth {
  width: clamp(315px, 34vw, 650px);
  right: 0;
  opacity: .9;
  transform: translate(8%, -49%);
  mask-image: linear-gradient(to right, transparent 2%, #000 24%);
}

#overview .heading-actions { top: auto; bottom: 13px; right: 13px; }
#overview .outlined-action {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid #fff6;
  background: #19362ddc;
  color: #fff;
}
#overview .outlined-action:hover { background: #254e40; }

#overview .metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--edition-rule);
  border-radius: 10px;
  background: #fff;
}

#overview .metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 49px;
  padding: 6px 17px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
#overview .metric + .metric { border-inline-start: 1px solid var(--edition-rule); }
#overview .metric:hover { background: var(--edition-tint); transform: none; }
#overview .metric:focus-visible { outline-offset: -3px; }
#overview .metric > strong {
  grid-area: 1 / 1;
  margin: 0;
  color: #305f4d;
  font: 680 22px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
#overview .metric-label { grid-area: 1 / 2; font-size: 12px; font-weight: 560; }
#overview .metric-label .ic, #overview .metric-note { display: none; }

#overview .overview-briefing {
  grid-template-columns: minmax(0, 1fr) minmax(235px, .29fr);
  gap: clamp(16px, 2vw, 34px);
  align-items: start;
}

#overview .election-news, #overview .overview-dates {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

#overview .news-header, #overview .overview-dates-header {
  min-height: 48px;
  margin: 0 0 13px;
  padding: 0 0 9px;
  border-bottom: 1px solid var(--edition-rule);
}
#overview .news-header h2, #overview .overview-dates h2 {
  color: var(--edition-ink);
  font: 680 clamp(24px, 2vw, 34px)/1.12 var(--sans);
  letter-spacing: -.045em;
}

#overview .news-controls button {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  border-color: var(--edition-rule);
  background: #fff;
}
#overview .news-controls button:hover:not(:disabled) { background: var(--edition-tint); }
#overview .news-stories { padding: 0 0 9px; scrollbar-color: #91ad9c transparent; }

#overview .news-story a {
  min-height: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--edition-ink);
}
#overview .news-story a:hover { background: var(--edition-tint); }
#overview .news-story a:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
#overview .news-story strong { color: var(--edition-ink); font: 650 20px/1.23 var(--sans); letter-spacing: -.03em; }
#overview .news-topic { color: #305f4d; }
#overview .news-byline { margin: 0; color: var(--muted); }

#overview .news-story:first-child a:has(.news-photo) {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  justify-content: stretch;
  gap: 8px;
  padding: 0 0 10px;
  background: none;
}
#overview .news-story:first-child a:has(.news-photo)::after { content: none; }
#overview .news-story:first-child .news-photo {
  position: relative;
  inset: auto;
  z-index: 0;
  height: auto;
  max-height: 305px;
  aspect-ratio: 2.2;
  border-radius: 10px;
  margin-bottom: 3px;
}
#overview .news-story:first-child a:has(.news-photo) strong {
  color: var(--edition-ink);
  font-size: clamp(24px, 2.1vw, 39px);
  line-height: 1.12;
  text-wrap: pretty;
}
#overview .news-story:first-child a:has(.news-photo) .news-topic { color: #305f4d; }
#overview .news-story:first-child a:has(.news-photo) .news-byline { align-self: end; margin-top: 4px; color: var(--muted); }
#overview .news-story:first-child a:has(.news-photo):focus-visible { outline-color: var(--forest); }

#overview-agenda .agenda-entry:first-child { border-top: 0; }
#overview-agenda .agenda-entry { padding-block: 10px; }
#overview-agenda .agenda-entry time { border-radius: 7px; }
#overview-agenda .agenda-entry time strong { font-family: var(--sans); font-weight: 690; }
#overview .overview-calendar-link { margin-top: 8px; }
.main-area:has(#overview:not([hidden])) .trust-line { margin-top: 16px; border-top: 1px solid var(--edition-rule); }

@media (min-width: 1051px) {
  #overview .news-stories {
    grid-template-columns: calc(59% - 10px);
    grid-template-rows: repeat(3, minmax(94px, auto));
    grid-auto-columns: calc(41% - 10px);
    gap: 0 20px;
  }
  #overview .news-story:not(:first-child) a {
    min-height: 0;
    padding: 8px 6px 10px 13px;
    gap: 7px;
    border-radius: 0;
    border-inline-start: 1px solid var(--edition-rule);
    border-bottom: 1px solid var(--edition-rule);
  }
  #overview .news-story:not(:first-child) strong { font-size: clamp(16px, 1.4vw, 23px); }
  #overview .news-story:not(:first-child) .news-byline { margin-top: 4px; }
}

@media (max-width: 1050px) {
  #overview .news-story:not(:first-child) a {
    min-height: 190px;
    background: #edf4ef;
  }
}

@media (max-width: 800px) {
  #overview .overview-masthead { margin-bottom: 18px; }
  #overview .workspace-heading { min-height: 158px; padding: 15px 13px; text-align: left; }
  #overview .overview-intro { max-width: 100%; }
  #overview .workspace-eyebrow { justify-content: flex-start; font-size: 9px; }
  #overview .workspace-heading h1 { font-size: clamp(31px, 7.5vw, 61px); text-wrap: wrap; }
  #overview .workspace-heading p { max-width: 30ch; margin-inline: 0; font-size: 12px; }
  #overview .overview-earth-panel { width: 48%; opacity: .26; }
  #overview .overview-earth { width: clamp(230px, 47vw, 350px); transform: translate(35%, -49%); }
  #overview .overview-explore { margin-top: 8px; }
  #overview .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #overview .metric { min-height: 44px; padding-inline: 9px; }
  #overview .metric:nth-child(n + 3) { border-top: 1px solid var(--edition-rule); }
  #overview .metric:nth-child(3) { border-inline-start: 0; }
  #overview .overview-briefing { grid-template-columns: minmax(0, 1fr); }
  #overview .news-controls button { width: 44px; height: 44px; }
  #overview .news-story:first-child .news-photo { aspect-ratio: 1.85; }
}
