/* =============================================================================
   The Sweeney Model: homepage
   ============================================================================= */

.asof { color: var(--ink-soft); margin: 4px 0 28px; }

/* hero */
.hero { padding: 28px 0 48px; }
.hero h1 { font-size: var(--step-4); margin-bottom: 6px; }
.hero .odds { margin-top: 8px; }
.dotgrid .dot { border: 0; padding: 0; cursor: pointer; }
.dotgrid .dot:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.dotgrid .dot.picked { outline: 3px solid var(--sun); outline-offset: 1px; box-shadow: 0 0 0 5px var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 30px; }
.hero-actions .muted { font-size: var(--step--1); }

/* simulation result pop-up */
.simcard { margin-top: 26px; animation: pop .22s ease-out; }
.simcard header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.simcard .close { background: none; border: 0; font: 700 var(--step-1)/1 var(--body); cursor: pointer; color: var(--ink); }
.sim-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 14px; }
.sim-totals .big { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: var(--step-4); line-height: 1; }
.flips { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.flips li { padding-left: 14px; border-left: 4px solid var(--line); }
.flips li.to-d { border-left-color: var(--sky); }
.flips li.to-r { border-left-color: var(--red); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* view chips row */
.viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.viewbar .muted { font-size: var(--step--1); }

/* section heads */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }

/* Senate map */
.usmap svg { width: 100%; height: auto; display: block; }
.usmap path.state { stroke: #fff; stroke-width: 1.2; }
.usmap path.state.race { cursor: pointer; }
.usmap path.state.race:hover, .usmap path.state.race:focus { stroke: var(--ink); stroke-width: 2.5; outline: none; }
.usmap path.state.none { fill: #EEF2F6; }

/* House chamber chart */
.chamber svg { width: 100%; height: auto; display: block; }
.chamber circle.seat { stroke: #fff; stroke-width: .8; }
.chamber circle.seat.modeled { cursor: pointer; }
.chamber circle.seat.modeled:hover { stroke: var(--ink); stroke-width: 2; }
.chamber .majority-line { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 4; }
.chamber .center-label { font-family: var(--display); font-stretch: 125%; font-weight: 900; fill: var(--ink); }

/* mini race card (hover / tap) */
.minicard {
  position: fixed; z-index: 50; width: 300px; pointer-events: none;
  background: var(--paper); border: var(--outline); border-radius: var(--radius-card);
  box-shadow: 5px 5px 0 var(--ink); overflow: hidden; display: none;
}
.minicard.show { display: block; }
.minicard.pinned { pointer-events: auto; }
.minicard header { padding: 10px 14px; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.minicard header.lead-d { background: var(--sky-pale); }
.minicard header.lead-r { background: var(--red-pale); }
.minicard header.lead-t { background: var(--sun-pale); }
.minicard .mbody { padding: 12px 14px; font-size: var(--step--1); }
.minicard .row { display: flex; justify-content: space-between; gap: 10px; }
.minicard .row b { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: var(--step-2); line-height: 1.05; }
.minicard .probbar { height: 10px; margin: 8px 0; }
.minicard .open { display: none; margin-top: 10px; }
.minicard.pinned .open { display: inline-block; }

/* closest races lists */
.closest { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 36px; margin-top: 26px; }
.closest a { display: grid; grid-template-columns: 9.5rem 1fr 3rem; align-items: center; gap: 12px;
             color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--line); }
.closest a:hover .name { text-decoration: underline; }
.closest .probbar { margin: 0; height: 10px; }
.closest .p { text-align: right; font-weight: 700; }

/* charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis text { font: var(--step--1) var(--body); fill: var(--ink-soft); }
.chart .axis path, .chart .axis line { stroke: var(--line); }
.chart .majority { stroke: var(--ink); stroke-dasharray: 4 3; }
.chart .label { font: 700 var(--step--1) var(--body); fill: var(--ink); }
.chart .line { fill: none; stroke-width: 3; }

.footer { padding: 40px 0 60px; color: var(--ink-soft); font-size: var(--step--1); border-top: 1px solid var(--line); }

/* status sentence under the headline */
.status { font-size: var(--step-1); font-weight: 700; margin: 10px 0 2px; max-width: 60ch; }

/* what's driving the forecast (collapsible on phones) */
details.drivers > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; }
details.drivers > summary::-webkit-details-marker { display: none; }
details.drivers > summary h2 { margin: 0; }
details.drivers > summary::after { content: "+"; font-family: var(--display); font-weight: 900; font-size: var(--step-2); }
details.drivers[open] > summary::after { content: "–"; }

/* market comparison table */
table.mkt-table { border-collapse: collapse; width: 100%; max-width: 720px; font-size: var(--step-0); }
table.mkt-table th, table.mkt-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.mkt-table thead th { border-bottom: 2px solid var(--ink); font-size: var(--step--1); }
table.mkt-table td.num { text-align: right; font-weight: 700; font-family: var(--display); font-stretch: 125%; font-size: var(--step-1); }
table.mkt-table thead th:not(:first-child) { text-align: right; }
table.mkt-table td.ours { color: var(--sky-deep); }
.mkt-note { font-size: var(--step--1); margin-top: 10px; max-width: 70ch; }

/* election news: deliberately quiet */
.news-list { list-style: none; padding: 0; margin: 0; max-width: 760px; }
.news-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.news-list a { color: var(--ink); text-decoration: none; font-weight: 700; }
.news-list a:hover { text-decoration: underline; }
.news-list .muted { font-size: var(--step--1); }

/* map/chart + its closest-races list (stacked on phones, side by side on desktop) */
.closest-h { margin-top: 34px; }
.cta { margin-top: 22px; }

/* ---------- desktop: give the page room to breathe (phones unchanged) ---------- */
@media (min-width: 960px) {
  .section { padding: 72px 0; }
  .split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
           gap: 48px; align-items: start; }
  .split .closest-h { margin-top: 0; }
  .hero .odds-headline { font-size: var(--step-2); }
  .hero .odds-headline .n { font-size: 3.1rem; }
  .hero .dotgrid { max-width: 270px; }
  .charts { max-width: 960px; }
  #trend { max-width: 880px; }
}

/* ---------- predictions page ---------- */
.pred-intro { max-width: 68ch; margin-top: 18px; }
.pred-intro p { margin-bottom: 14px; font-size: 1.05rem; }
.pred-soon { max-width: 68ch; border: 2px dashed var(--line); border-radius: 16px; padding: 28px 30px; }
.pred-soon h2 { margin-bottom: 10px; }
.pred-soon p { margin-bottom: 10px; }
