/* Decision Desk. Scoped so a homepage that is not swapped does not move.
   Light tokens are the default; dark matches the news page. */

.dd-skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.dd-skip:focus {
  left: 1rem;
  top: 0.5rem;
  z-index: 3000;
  background: #fff;
  color: #000;
  padding: 0.5rem 1rem;
}

.dd-banner {
  position: relative;
  z-index: 980;
  margin-top: var(--header-height, 64px);
  background: #0d1f0e;
  color: #e7ffe4;
  border-bottom: 2px solid #39ff14;
}

.dd-banner__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dd-preview-tag {
  flex: 0 0 auto;
  letter-spacing: 0.06em;
  font: 800 0.68rem/1 var(--dd-mono, "JetBrains Mono", monospace);
  background: #fff3bf;
  color: #3d2e00;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
}

.dd-banner a {
  flex: 1 1 auto;
  min-width: 0;
  color: #c8ffb0;
  font-family: var(--font-heading, "Onest", "Inter", sans-serif);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.dd-banner button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  color: #fff;
  font: 700 0.78rem/1 var(--font-heading, "Onest", sans-serif);
  cursor: pointer;
}

.dd-banner--counting a {
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .dd-banner--counting .dd-banner__inner {
    align-items: flex-start;
  }

  .dd-banner--counting a {
    font-size: 0.84rem;
    padding-top: 0.2rem;
  }
}

body.dd-has-banner .nw-masthead {
  padding-top: 0;
}

.dd {
  --dd-bg: #f5f8f3;
  --dd-card: #ffffff;
  --dd-ink: #1d261d;
  --dd-muted: #55615a;
  --dd-line: #d4e4d4;
  --dd-green: #1b5e20;
  --dd-green-2: #2e7d32;
  --dd-lime: #39ff14;
  --dd-dark: #0d1f0e;
  --dd-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --dd-safe-r: #f6c1bb;
  --dd-safe-d: #b9d4ff;
  --dd-early: #c5ccc6;
  --dd-called-r: #d50000;
  --dd-called-d: #0d47a1;
  --dd-none: #e7eee8;
  --dd-map-line: rgba(10, 16, 12, 0.55);
  --dd-map-bg: #fbfcfb;
  --dd-inset: #5f6d64;
  --dd-check: #ffffff;
  background: var(--dd-bg);
  color: var(--dd-ink);
  font-size: 17px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

html[data-theme="dark"] body.dd-page .dd,
.dd.dd--dark {
  --dd-bg: #0a0a0a;
  --dd-card: #121412;
  --dd-ink: #e4e7e4;
  --dd-muted: #a3aea6;
  --dd-line: #24402a;
  --dd-green: #9be39a;
  --dd-green-2: #7ee07a;
  --dd-dark: #f3f7f3;
  --dd-safe-r: #f6c1bb;
  --dd-safe-d: #b9d4ff;
  --dd-early: #4e5852;
  --dd-called-r: #ff1744;
  --dd-called-d: #2979ff;
  --dd-none: #161b16;
  --dd-map-line: rgba(255, 255, 255, 0.35);
  --dd-map-bg: #070907;
  --dd-inset: #9be39a;
  --dd-check: #ffffff;
  color-scheme: dark;
}

body.dd-page {
  background: #f5f8f3;
  color: #1d261d;
}

html[data-theme="dark"] body.dd-page {
  background: #0a0a0a;
  color: #e4e7e4;
}

.dd a {
  color: var(--dd-green-2);
}

.dd a:hover,
.dd a:focus {
  text-decoration: underline;
}

.dd-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
}

.dd-mast {
  padding-top: 1.2rem;
  border-bottom: 1px solid var(--dd-line);
  margin-bottom: 1.25rem;
}

body.dd-page .dd-mast {
  padding-top: calc(var(--header-height, 64px) + 1.2rem);
}

body.dd-has-banner.dd-page .dd-mast,
body.dd-has-banner .dd-offline {
  padding-top: 1.2rem;
}

.dd-mast__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
}

.dd-prompt,
.dd-stamp,
.dd-kicker,
.dd-tier,
.dd-byline,
.dd-close {
  font-family: var(--dd-mono);
}

.dd-prompt {
  margin: 0;
  color: var(--dd-green-2);
  font-weight: 700;
}

.dd h1,
.dd h2,
.dd h3 {
  color: var(--dd-dark);
  font-family: var(--font-heading, "Onest", "Inter", sans-serif);
  line-height: 1.2;
}

.dd h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.dd h2 {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
}

.dd h3 {
  margin: 0.2rem 0 0.45rem;
  font-size: 1.12rem;
}

.dd-date,
.dd-note,
.dd-close,
.dd-context,
.dd-byline,
.dd-source,
.dd-reported,
.dd-close-note {
  color: var(--dd-muted);
}

.dd-date,
.dd-stamp {
  margin: 0.35rem 0 0;
}

.dd-stampwrap {
  text-align: right;
}

.dd-stamp--stale {
  border-left: 3px solid #a84f00;
  padding-left: 0.55rem;
}

.dd-theme,
.dd-status button,
.dd-field select {
  min-height: 44px;
  font: 700 0.78rem/1.2 var(--dd-mono);
}

.dd-theme {
  margin-top: 0.55rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--dd-green-2);
  background: var(--dd-card);
  color: var(--dd-ink);
  cursor: pointer;
}

.dd-preview {
  margin: 0;
  padding: 0.45rem 1rem;
  text-align: center;
  letter-spacing: 0.14em;
  font: 800 0.85rem/1.2 var(--dd-mono);
  background: #fff3bf;
  color: #3d2e00;
}

.dd-preview-note {
  display: block;
  margin-top: 0.2rem;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.35;
}

.dd-hidden {
  font: 700 0.78rem/1.3 var(--dd-mono);
  color: #8a5a00;
}

.dd.dd--dark .dd-hidden {
  color: #ffd27a;
}

.dd-follow,
.dd-chamber,
.dd-race,
.dd-closed,
.dd-past {
  background: var(--dd-card);
  border: 1px solid var(--dd-line);
  border-radius: 14px;
}

.dd-follow,
.dd-closed {
  padding: 1rem 1.1rem;
  margin-bottom: 1.1rem;
}

.dd-chamber-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.dd-chamber {
  padding: 0.9rem 1rem;
  min-width: 0;
}

.dd-chamber p,
.dd-follow p,
.dd-closed p,
.dd-race p {
  margin: 0.35rem 0;
}

.dd-chamber span,
.dd-outcome span {
  font-family: var(--dd-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dd-green-2);
}

.dd-outcome {
  margin-top: 0.7rem !important;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--dd-lime);
  background: rgba(57, 255, 20, 0.08);
}

.dd-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin: 0.5rem 0 1rem;
}

.dd-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font: 700 0.75rem/1.2 var(--dd-mono);
  color: var(--dd-muted);
  min-width: 0;
}

.dd-field select {
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--dd-line);
  background: var(--dd-card);
  color: var(--dd-ink);
}

.dd-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dd-status button {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--dd-line);
  background: var(--dd-card);
  color: var(--dd-ink);
  cursor: pointer;
}

.dd-status button[aria-pressed="true"] {
  border-color: var(--dd-green-2);
  box-shadow: inset 0 0 0 1px var(--dd-green-2);
}

.dd-race {
  padding: 0.95rem 1rem 1rem;
  margin: 0 0 0.9rem;
  min-width: 0;
  scroll-margin-top: calc(var(--header-height, 64px) + 0.75rem);
}

.dd-race--target {
  box-shadow: 0 0 0 3px var(--dd-lime);
  animation: dd-race-flash 1.6s ease;
}

@keyframes dd-race-flash {
  0% { box-shadow: 0 0 0 0 var(--dd-lime); background-color: rgba(57, 255, 20, 0.32); }
  30% { box-shadow: 0 0 0 4px var(--dd-lime); background-color: rgba(57, 255, 20, 0.16); }
  100% { box-shadow: 0 0 0 3px var(--dd-lime); background-color: transparent; }
}

.dd-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dd-green-2);
}

.dd-tier {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--dd-line);
  border-radius: 4px;
  color: var(--dd-muted);
  letter-spacing: 0;
  text-transform: none;
}

.dd-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.dd-pill {
  display: inline-block;
  max-width: 100%;
  padding: 0.28rem 0.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
  font: 700 0.78rem/1.35 var(--dd-mono);
  color: #1d261d;
  background: #e7eee7;
}

.dd-pill--too_early { background: #e7eee7; color: #1d261d; }
.dd-pill--leaning { background: #fff3bf; color: #3d2e00; }
.dd-pill--projected { background: #d9f5d4; color: #0d1f0e; }
.dd-pill--called { background: #39ff14; color: #041404; }
.dd-pill--under_review { background: #f3d27a; color: #2a2108; }
.dd-pill--flag { background: #ece7f5; color: #241838; }

.dd-pill a {
  color: inherit;
  text-decoration: underline;
}

.dd-rule {
  font-size: 0.88rem;
  color: var(--dd-muted);
}

.dd-votes {
  list-style: none;
  margin: 0.6rem 0;
  padding: 0;
}

.dd-votes li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.2rem 0.8rem;
  padding: 0.35rem 0;
  border-top: 1px dashed var(--dd-line);
}

.dd-party,
.dd-nums,
.dd-source,
.dd-reported,
.dd-byline {
  font-family: var(--dd-mono);
  font-size: 0.82rem;
}

.dd-nums {
  font-weight: 700;
  color: var(--dd-dark);
}

.dd-correction {
  margin: 0.7rem 0 0;
  padding: 0.5rem 0.65rem;
  background: #fff8e8;
  color: #4d3a00;
  border-left: 3px solid #d39b00;
  border-radius: 0 6px 6px 0;
}

html[data-theme="dark"] body.dd-page .dd-correction,
.dd.dd--dark .dd-correction {
  background: #2a2210;
  color: #f3dfa4;
}

.dd-history {
  margin-top: 0.8rem;
}

.dd-history summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.dd-past {
  margin-top: 0.6rem;
  padding: 0.75rem 0.8rem;
}

.dd-official,
.dd-byline {
  margin-top: 0.6rem;
}

.dd-foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dd-line);
  color: var(--dd-muted);
  font-size: 0.92rem;
}

.dd-legend {
  margin: 0;
  padding-left: 1.1rem;
}

.dd-legend li,
.dd-closed li,
.dd-follow li {
  margin: 0.35rem 0;
}

.dd-schedule {
  margin: 0 0 0.35rem;
  padding-left: 1.15rem;
}

.dd-schedule li {
  margin: 0.12rem 0;
}

.dd-close-notes {
  margin: 0 0 0.85rem;
}

.dd-close-notes summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 700;
}

.dd-close-note {
  display: block;
  font-size: 0.85rem;
}

.dd-bar {
  margin: 0.7rem 0 0.4rem;
}

.dd-bar__badge {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #fff3bf;
  color: #3d2e00;
  font: 800 0.72rem/1.2 var(--dd-mono);
  letter-spacing: 0.04em;
}

.dd-bar__track {
  display: flex;
  height: 1.7rem;
  border-radius: 999px;
  overflow: hidden;
  background: #d7ddd4;
}

.dd-bar__seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  color: #102018;
  font: 700 0.72rem/1 var(--dd-mono);
}

.dd-bar__seg--safe-d { background: #b9d4ff; }
.dd-bar__seg--safe-r { background: #f6c1bb; }
.dd-bar__seg--called-d { background: #1d4e89; color: #fff; }
.dd-bar__seg--called-r { background: #8d2424; color: #fff; }
.dd-bar__seg--proj-d { background: #5d93d6; color: #fff; }
.dd-bar__seg--proj-r { background: #d06a6a; color: #fff; }
.dd-bar__seg--open { background: #e4e0d6; }
.dd-bar__seg--other { background: #8d8a84; color: #fff; }

.dd-bar__legend,
.dd-bar__sources,
.dd-bar__note {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.dd-bar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
}

.dd-bar__note {
  color: var(--dd-muted);
}

.dd-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dd-offline {
  max-width: 40rem;
  margin: 0 auto;
  padding: calc(var(--header-height, 64px) + 2.5rem) 1.25rem 3rem;
}

.dd-offline h1 {
  font-family: var(--font-heading, "Onest", "Inter", sans-serif);
  color: inherit;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
}

.dd a:focus-visible,
.dd button:focus-visible,
.dd select:focus-visible,
.dd summary:focus-visible,
.dd-banner a:focus-visible,
.dd-banner button:focus-visible,
.dd-hero-auth a:focus-visible {
  outline: 3px solid #39ff14;
  outline-offset: 2px;
}

body.dd-home-swap [data-news-promo],
body.dd-home-swap main.site-main {
  display: none !important;
}

body.dd-home-swap .hero.hero--dd {
  min-height: 0;
  height: 0;
  margin-top: var(--header-height, 64px);
  padding: 0;
  background: transparent;
  background-image: none;
  overflow: hidden;
}

body.dd-has-banner.dd-home-swap .hero.hero--dd {
  margin-top: 0;
}

body.dd-home-swap .hero.hero--dd::before,
body.dd-home-swap .hero.hero--dd .hero-static,
body.dd-home-swap .hero.hero--dd .hero-matrix,
body.dd-home-swap .hero.hero--dd .hero-copy,
body.dd-home-swap .hero.hero--dd .hero-inner,
body.dd-home-swap .hero.hero--dd .scroll-cue {
  display: none !important;
}

.dd-hero-auth {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  gap: 0.75rem;
}

.dd-map {
  background: var(--dd-card);
  border: 1px solid var(--dd-line);
  border-radius: 14px;
  padding: 0.9rem 0.75rem 1rem;
  margin: 0 0 1.1rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.dd-map h2 {
  margin: 0 0 0.35rem;
}

.dd-map-note,
.dd-map-status,
.dd-map-forecast,
.dd-map-called-note,
.dd-map-insets {
  margin: 0.35rem 0;
  color: var(--dd-muted);
  font-size: 0.92rem;
}

.dd-map-status {
  min-height: 1.4em;
  font-weight: 700;
  color: var(--dd-ink);
}

.dd-map-forecast,
.dd-map-called-note {
  font-weight: 700;
  color: var(--dd-ink);
}

.dd-map-toggle {
  display: flex;
  gap: 0.45rem;
  margin: 0.55rem 0 0.7rem;
  min-width: 0;
}

.dd-map-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0.4rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--dd-line);
  background: var(--dd-card);
  color: var(--dd-ink);
  font: 700 0.85rem/1.2 var(--font-heading, "Onest", sans-serif);
  cursor: pointer;
}

.dd-map-tab[aria-selected="true"] {
  border-color: var(--dd-green-2);
  box-shadow: inset 0 0 0 1px var(--dd-green-2);
}

.dd-house-fit {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.dd-map-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: hidden;
  background: var(--dd-map-bg);
  border-radius: 10px;
  touch-action: manipulation;
}

.dd-hex-label,
.dd-hex-num {
  text-anchor: middle;
  pointer-events: none;
}

.dd-hex-label {
  font: 700 14px/1 var(--font-heading, "Onest", sans-serif);
  fill: var(--dd-ink);
}

.dd-hex-num {
  font: 700 8px/1 var(--dd-mono, ui-monospace, monospace);
  dominant-baseline: central;
  fill: #142018;
}

.dd-map-state--called-r .dd-hex-num,
.dd-map-state--called-d .dd-hex-num {
  fill: #fff;
}

.dd-map-state--safe-r .dd-hex-num,
.dd-map-state--safe-d .dd-hex-num {
  fill: #142018;
}

.dd--dark .dd-hex-num,
html[data-theme="dark"] .dd-hex-num {
  fill: #f4f7f4;
}

.dd--dark .dd-map-state--safe-r .dd-hex-num,
.dd--dark .dd-map-state--safe-d .dd-hex-num,
html[data-theme="dark"] .dd-map-state--safe-r .dd-hex-num,
html[data-theme="dark"] .dd-map-state--safe-d .dd-hex-num {
  fill: #142018;
}

.dd-map-shape {
  stroke: var(--dd-map-line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.dd-map-state {
  cursor: pointer;
}

.dd-map-state:focus {
  outline: none;
}

.dd-map-state:focus-visible .dd-map-shape {
  stroke: var(--dd-lime);
  stroke-width: 3px;
}

.dd-map-state--safe-r .dd-map-shape { fill: var(--dd-safe-r); }
.dd-map-state--safe-d .dd-map-shape { fill: var(--dd-safe-d); }
.dd-map-state--gray .dd-map-shape { fill: var(--dd-early); }
.dd-map-state--called-r .dd-map-shape { fill: var(--dd-called-r); }
.dd-map-state--called-d .dd-map-shape { fill: var(--dd-called-d); }
.dd-map-state--none .dd-map-shape { fill: var(--dd-none); }

.dd-map-check {
  stroke: var(--dd-check);
  stroke-width: 2.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.dd-map-check-halo {
  stroke: #111;
  stroke-width: 4.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.dd-map-inset {
  fill: none;
  stroke: var(--dd-inset);
  stroke-width: 1.6;
  pointer-events: none;
}

.dd-expected {
  margin: 0.35rem 0 0.15rem;
}

.dd-expected__label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
}

.dd-expected__label input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--dd-green-2);
}

.dd-expected__label input:focus-visible {
  outline: 2px solid var(--dd-lime);
  outline-offset: 3px;
}

/* Neon lime disappears on the light map. Dark green stays visible. */
.dd:not(.dd--dark) .dd-expected__label input:focus-visible {
  outline-color: var(--dd-green);
}

.dd-expected--locked .dd-expected__label {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Opacity 0.55 on light paper drops the label under WCAG AA. Muted ink stays grayed and readable. */
.dd:not(.dd--dark) .dd-expected--locked .dd-expected__label {
  opacity: 1;
  color: var(--dd-muted);
}

.dd:not(.dd--dark) .dd-expected--locked .dd-expected__label input {
  accent-color: var(--dd-muted);
}

.dd-expected__note {
  margin: 0 0 0.35rem;
  color: var(--dd-muted);
  font-size: 0.9rem;
}

.dd-map-legend ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0.6rem 0 0;
  padding: 0;
}

.dd-map-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.92rem;
}

.dd-swatch {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid var(--dd-map-line);
  border-radius: 3px;
}

.dd-swatch--safe-r { background: var(--dd-safe-r); }
.dd-swatch--safe-d { background: var(--dd-safe-d); }
.dd-swatch--early { background: var(--dd-early); }
.dd-swatch--none { background: var(--dd-none); }
.dd-swatch--called {
  background: linear-gradient(90deg, var(--dd-called-d) 0 50%, var(--dd-called-r) 50% 100%);
  position: relative;
}
.dd-swatch--called::after {
  content: "\2713";
  position: absolute;
  inset: 0;
  color: #fff;
  font: 700 0.72rem/1.15rem var(--dd-mono, ui-monospace, monospace);
  text-align: center;
}

.dd-stage,
.dd-aside,
.dd-rail,
.dd-results,
.dd-chambers,
.dd-calls,
.dd-winner-row {
  min-width: 0;
  max-width: 100%;
}

.dd-winner-row {
  margin: 0 0 0.9rem;
}

.dd-winner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.dd-chambers {
  margin: 0 0 1.1rem;
}

.dd-stage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Phones and anything under the desktop split: map, then seat bars, then cards. */
@media (max-width: 1023px) {
  .dd-chamber-grid {
    grid-template-columns: 1fr;
  }

  .dd-stampwrap,
  .dd-mast__inner {
    text-align: left;
  }

  .dd {
    font-size: 16px;
  }
}

.dd-calls {
  display: none;
  background: var(--dd-card);
  border: 1px solid var(--dd-line);
  border-radius: 14px;
  padding: 0.85rem 0.9rem 1rem;
  margin: 0 0 1rem;
}

.dd-calls h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.dd-calls__note,
.dd-calls__empty {
  margin: 0 0 0.55rem;
  color: var(--dd-muted);
  font-size: 0.88rem;
}

.dd-calls__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dd-calls__list li {
  margin: 0;
  border-top: 1px solid var(--dd-line);
}

.dd-calls__list a {
  display: block;
  padding: 0.45rem 0;
  color: var(--dd-ink);
  text-decoration: none;
}

.dd-calls__kind {
  font: 700 0.72rem/1.2 var(--dd-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dd-green-2);
}

.dd-calls__when {
  display: block;
  color: var(--dd-muted);
  font-size: 0.82rem;
}

/* Desktop. Stack is the live default: full-width map, seat bars and latest
   calls below it, race cards in a full-width grid.
   Grid and side stay available as ?layout= in the local mock. */
@media (min-width: 1024px) {
  .dd.dd-layout-grid .dd-stage {
    display: grid;
    grid-template-columns: minmax(0, 60%) minmax(0, 1fr);
    grid-template-areas:
      "map rail"
      "results results";
    align-items: start;
    gap: 1rem;
  }

  .dd.dd-layout-grid .dd-map { grid-area: map; }
  .dd.dd-layout-grid .dd-aside { display: contents; }
  .dd.dd-layout-grid .dd-rail { grid-area: rail; }
  .dd.dd-layout-grid .dd-results { grid-area: results; }
  .dd.dd-layout-grid .dd-calls { display: block; }
  .dd.dd-layout-grid .dd-chamber-grid { grid-template-columns: 1fr; }

  .dd.dd-layout-grid .dd-chamber-races,
  .dd.dd-layout-stack .dd-chamber-races {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
  }

  .dd.dd-layout-grid .dd-chamber-races > h2,
  .dd.dd-layout-stack .dd-chamber-races > h2 {
    grid-column: 1 / -1;
    margin: 0;
  }

  .dd.dd-layout-grid .dd-race,
  .dd.dd-layout-stack .dd-race {
    margin: 0;
  }

  .dd.dd-layout-side .dd-stage {
    display: grid;
    grid-template-columns: minmax(0, 55%) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
  }

  .dd.dd-layout-side .dd-map {
    position: sticky;
    top: calc(var(--header-height, 64px) + 0.6rem);
  }

  .dd.dd-layout-side .dd-aside {
    max-height: calc(100vh - var(--header-height, 64px) - 2rem);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .dd.dd-layout-side .dd-chamber-grid {
    grid-template-columns: 1fr;
  }

  /* Side mock: keep the seat bars beside the map. Banners follow them. */
  .dd.dd-layout-side .dd-rail {
    display: flex;
    flex-direction: column;
  }

  .dd.dd-layout-side .dd-winner-row {
    order: 2;
  }

  .dd.dd-layout-stack .dd-stage {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  /* Stack (live default): full-width map, then seat bars beside Latest calls,
     then the race-card grid. */
  .dd.dd-layout-stack .dd-map { width: 100%; }
  .dd.dd-layout-stack .dd-map-svg { width: 100%; max-height: 72vh; }
  .dd.dd-layout-stack .dd-rail {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }
  .dd.dd-layout-stack .dd-calls { display: block; margin: 0; }
  .dd.dd-layout-stack .dd-winner-row { grid-column: 1 / -1; }
  .dd.dd-layout-stack .dd-winner-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .dd-mast .dd-wrap,
  .dd-wrap.dd-sheet {
    max-width: 1360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dd-banner,
  .dd-banner button,
  .dd-theme,
  .dd-race,
  .dd-race--target,
  .dd-status button {
    transition: none;
    animation: none;
  }
}

/* Admin preview only: app.css caps .app-main--wide at 720px, which shrank the
   map. Match the public page width instead. */
body[data-dd-preview-page] .app-main {
  min-width: 0;
  max-width: 1360px;
}

/* Admin preview only (election-preview.html): race cards wrap into a grid on desktop.
   Scoped by body[data-dd-preview-page] so www/election.html and phones are unchanged. */
@media (min-width: 601px) {
  body[data-dd-preview-page] .dd-chamber-races {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9rem;
    align-items: start;
  }

  body[data-dd-preview-page] .dd-chamber-races > h2 {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  body[data-dd-preview-page] .dd-chamber-races > .dd-race {
    margin: 0;
  }
}

/* Election Day pre-results panel. Hidden unless the homepage forecast view is mounted. */
.dd-eday-wrap {
  padding-top: 1rem;
  padding-bottom: 0.25rem;
}

.dd-eday {
  background: #071207;
  color: #e7f6e4;
  border: 2px solid #39ff14;
  border-radius: 18px;
  padding: 1.15rem 1.2rem 1rem;
}

.dd-eday__kicker {
  margin: 0 0 0.45rem;
  color: #39ff14;
  font-family: var(--dd-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dd-eday__title {
  margin: 0 0 0.45rem;
  color: #fff;
  font-family: var(--font-heading, "Onest", "Inter", sans-serif);
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.dd-eday__title span {
  color: #39ff14;
}

.dd-eday > p {
  margin: 0 0 1rem;
  max-width: 46rem;
  color: #d5e6d4;
  font-size: 1.02rem;
  line-height: 1.45;
}

.dd-eday__bars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.dd-eday__label {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 0.98rem;
}

.dd-eday__label strong {
  font-weight: 700;
}

.dd-eday__track {
  display: flex;
  width: 100%;
  min-height: 2.35rem;
  overflow: hidden;
  border-radius: 8px;
  background: #2a2f2c;
}

.dd-eday__seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0 0.15rem;
  color: #fff;
  font-family: var(--font-heading, "Onest", sans-serif);
  font-size: clamp(0.68rem, 1.6vw, 0.95rem);
  font-weight: 800;
  line-height: 1;
}

.dd-eday__seg--solid_d { background: #1565c0; }
.dd-eday__seg--likely_d { background: #1e88e5; }
.dd-eday__seg--lean_d { background: #90caf9; color: #0b1d33; }
.dd-eday__seg--toss { background: #8d9390; color: #111; }
.dd-eday__seg--lean_r { background: #ffcdd2; color: #3b0a0a; }
.dd-eday__seg--likely_r { background: #e53935; }
.dd-eday__seg--solid_r { background: #c62828; }

.dd-eday__source,
.dd-eday__note,
.dd-eday__mapnote {
  margin: 0.35rem 0 0;
  color: #b7c4b8;
  font-size: 0.82rem;
  line-height: 1.35;
}

.dd-eday__source a {
  color: #c8ffb0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.dd-eday__mapnote {
  margin-top: 0.9rem;
}

.dd:not(.dd--dark) .dd-eday {
  background: #f4fff2;
  color: #142018;
  border-color: #1b5e20;
}

.dd:not(.dd--dark) .dd-eday__kicker,
.dd:not(.dd--dark) .dd-eday__title span {
  color: #1b5e20;
}

.dd:not(.dd--dark) .dd-eday__title,
.dd:not(.dd--dark) .dd-eday__label {
  color: #142018;
}

.dd:not(.dd--dark) .dd-eday > p,
.dd:not(.dd--dark) .dd-eday__source,
.dd:not(.dd--dark) .dd-eday__note,
.dd:not(.dd--dark) .dd-eday__mapnote {
  color: #243028;
}

.dd:not(.dd--dark) .dd-eday__source a {
  color: #1b5e20;
}

@media (min-width: 800px) {
  .dd-eday__bars {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
  }

  .dd-eday__mapnote {
    grid-column: 1 / -1;
  }
}

/* Winner banners. Dark is the default. Party blue on #041151 is #2d7cff,
   about 4.52:1. The line stays at least 18.75px bold at every width.
   Words stay whole: overflow-wrap and word-break stay normal, and a narrow
   card drops the line size instead of splitting a word. */
.dd-winner-banner {
  box-sizing: border-box;
  container-type: inline-size;
  max-width: 100%;
  margin: 0;
  padding: 0.9rem 0.95rem 0.75rem;
  border-radius: 12px;
  background: #1a1d1a;
  color: #e4e7e4;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

.dd-winner-banner__contest {
  margin: 0 0 0.35rem;
  font: 700 0.78rem/1.2 var(--dd-mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
  text-transform: none;
  color: #f3f6fb;
  overflow-wrap: normal;
  word-break: normal;
}

.dd-winner-banner__line {
  margin: 0;
  font-family: var(--font-heading, "Onest", "Inter", sans-serif);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
  overflow-wrap: normal;
  word-break: normal;
}

.dd-winner-banner__check {
  display: inline-block;
  margin-right: 0.28rem;
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 0.85;
  vertical-align: -0.12em;
  text-transform: none;
  color: inherit;
}

.dd-winner-banner__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0.55rem 0 0;
}

.dd-winner-banner__pill {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: #2c332e;
  color: #e4e7e4;
  font: 700 0.78rem/1.2 var(--dd-mono, ui-monospace, monospace);
  letter-spacing: 0;
  text-transform: none;
}

.dd-winner-banner__time {
  font: 600 0.95rem/1.3 var(--dd-mono, ui-monospace, monospace);
  letter-spacing: 0;
  text-transform: none;
  color: #e4e7e4;
  overflow-wrap: normal;
  word-break: normal;
}

.dd-winner-banner__credit {
  margin: 0.6rem 0 0;
  font: 600 0.82rem/1.3 var(--dd-mono, ui-monospace, monospace);
  letter-spacing: 0;
  text-transform: none;
  color: #a3aea6;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.dd-winner-banner--r {
  background: #2a0610;
  color: #ff1744;
}

.dd-winner-banner--d {
  background: #041151;
  color: #2d7cff;
}

.dd-winner-banner--r .dd-winner-banner__line,
.dd-winner-banner--r .dd-winner-banner__check,
.dd-winner-banner--d .dd-winner-banner__line,
.dd-winner-banner--d .dd-winner-banner__check {
  color: inherit;
}

@container (max-width: 17rem) {
  .dd-winner-banner__line { font-size: 1.35rem; }
  .dd-winner-banner__check { font-size: 2.1rem; }
}

@container (max-width: 13rem) {
  .dd-winner-banner__line { font-size: 18.75px; }
  .dd-winner-banner__check { font-size: 1.55rem; }
  .dd-winner-banner__credit {
    font-size: 0.72rem;
    white-space: normal;
  }
}

html[data-theme="light"] .dd-winner-banner,
.dd:not(.dd--dark) .dd-winner-banner {
  background: #f3f5f3;
  color: #1d261d;
}

html[data-theme="light"] .dd-winner-banner__contest,
.dd:not(.dd--dark) .dd-winner-banner__contest {
  color: #1d261d;
}

html[data-theme="light"] .dd-winner-banner__pill,
.dd:not(.dd--dark) .dd-winner-banner__pill {
  background: #e1e6e1;
  color: #1d261d;
}

html[data-theme="light"] .dd-winner-banner__time,
.dd:not(.dd--dark) .dd-winner-banner__time {
  color: #1d261d;
}

html[data-theme="light"] .dd-winner-banner__credit,
.dd:not(.dd--dark) .dd-winner-banner__credit {
  color: #3e4c44;
}

html[data-theme="light"] .dd-winner-banner--r,
.dd:not(.dd--dark) .dd-winner-banner--r {
  background: #fff5f6;
  color: #c4001d;
}

html[data-theme="light"] .dd-winner-banner--d,
.dd:not(.dd--dark) .dd-winner-banner--d {
  background: #f4f8ff;
  color: #1a5fd6;
}
