/* =============================================================================
   The Sweeney Model: Senate and House pages
   ============================================================================= */

.page-intro { max-width: 70ch; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0 0; font-weight: 700; font-size: var(--step--1); }
.subnav a { color: var(--ink); text-decoration: none; border-bottom: 3px solid var(--sun); padding-bottom: 1px; }

/* market comparison */
.mkts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 720px; }
.mkt { border: 2px solid var(--line); border-radius: var(--radius-card); padding: 14px 16px; }
.mkt.ours { border: var(--outline); box-shadow: var(--btn-shadow); }
.mkt-name { font-weight: 700; font-size: var(--step--1); }
.mkt-p { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: var(--step-3); line-height: 1.1; margin-top: 4px; }
@media (max-width: 560px) { .mkts { grid-template-columns: 1fr; } }

/* pick the winners */
.pick-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .pick-layout { grid-template-columns: 1fr; } }
.pick-result { position: sticky; top: 16px; }
.pick-result .body { padding: 18px 20px; }
.pick-result .big { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: var(--step-4); line-height: 1; }
.pick-result .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0 14px; }
.pick-result .shift { font-weight: 700; font-size: var(--step--1); }
.pick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pick-warn { background: var(--sun-pale); border-radius: 8px; padding: 8px 10px; font-size: var(--step--1); margin-top: 10px; }

.picklist { display: grid; gap: 0; margin-top: 18px; }
.pickrow { display: grid; grid-template-columns: minmax(7rem, 1fr) 3.5rem auto; gap: 12px; align-items: center;
           padding: 8px 0; border-bottom: 1px solid var(--line); }
.pickrow .who { font-size: var(--step--1); color: var(--ink-soft); }
.pickrow .p { text-align: right; font-weight: 700; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; }
.seg button { font: 700 var(--step--1)/1 var(--body); border: 0; background: var(--paper); color: var(--ink); padding: 8px 12px; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button.d[aria-pressed="true"] { background: var(--sky); color: #fff; }
.seg button.r[aria-pressed="true"] { background: var(--red); color: #fff; }
.seg button.u[aria-pressed="true"] { background: var(--sun); }

/* picked states on the map */
.usmap path.state.picked-d { fill: var(--sky-deep) !important; }
.usmap path.state.picked-r { fill: var(--red-deep) !important; }

/* poll feed */
.feed-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.feed-bar select { font: 700 var(--step--1) var(--body); border: 2px solid var(--ink); border-radius: var(--radius-pill); padding: 6px 12px; margin-left: 6px; background: var(--paper); }
.searchbox { font: var(--step-0) var(--body); border: 2px solid var(--ink); border-radius: var(--radius-pill); padding: 8px 14px; width: min(320px, 100%); }

/* races table */
table.races { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 640px; }
table.races th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
table.races td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.races td.num { text-align: right; font-weight: 700; white-space: nowrap; }
table.races a { font-weight: 700; }

.genavg { display: flex; flex-wrap: wrap; gap: 28px; margin: 6px 0 18px; }
.genavg .big { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: var(--step-4); line-height: 1; }

/* district map (House page): real state outlines with hex districts on top */
.hexmap svg { width: 100%; height: auto; display: block; }
.hexmap path.state { fill: #EEF2F6; }
.hexmap path.state-mesh { fill: none; stroke: #fff; stroke-width: 1.4; }
.hexmap path.hex { stroke: #fff; stroke-width: 1; transition: opacity .2s ease; }
.hexmap path.hex.modeled { cursor: pointer; }
.hexmap path.hex.modeled:hover { stroke: var(--ink); stroke-width: 2; }
.hexmap path.hex.faded { opacity: .18; }
.hexmap .callouts line { stroke: var(--ink-soft); stroke-width: 1; }
.hexmap .callouts circle { fill: var(--ink-soft); }
.hexmap .callouts text { font: 700 13px var(--body); fill: var(--ink); }
/* House page graphics (phones unaffected): the map a little wider than the chamber so hexes stay easy to hover */
#chamber-sec .chamber { max-width: 720px; }
.hexmap { max-width: 960px; }

/* ---------- governor page ---------- */
.gov-odds { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.gov-map { max-width: 820px; }
.gov-about { max-width: 70ch; }
.gov-about p { margin-bottom: 14px; }
.govtable { width: 100%; border-collapse: collapse; }
.govtable th { text-align: left; font-size: .85rem; padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.govtable td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.govtable .num { text-align: right; white-space: nowrap; }
.govtable .muted-h { color: var(--ink-soft); font-weight: 600; }
.gov-row { cursor: pointer; }
.gov-row:hover, .gov-row:focus, .gov-row[aria-expanded="true"] { background: rgba(0, 0, 0, .03); outline: none; }
.gov-row .pnum { font-weight: 700; margin-left: 4px; }
.gov-detail-row > td { background: rgba(0, 0, 0, .025); padding: 4px 16px 18px; }
.gov-detail p { margin: 10px 0; max-width: 80ch; }
.gov-detail .polls { margin-top: 8px; }
.pbar { display: flex; width: 110px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.pbar .pb-d { background: var(--sky); }
.pbar .pb-r { background: var(--red); }
.badge-nopolls { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: 2px 7px;
                 border-radius: 999px; border: 1px dashed var(--ink-soft); color: var(--ink-soft); white-space: nowrap; }
.gov-tip { position: absolute; z-index: 50; pointer-events: none; background: #fff; border: 2px solid var(--ink);
           border-radius: 10px; padding: 8px 10px; font-size: .85rem; line-height: 1.4; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
@media (max-width: 720px) {
  .govtable th:nth-child(4), .govtable td:nth-child(4), .govtable th:nth-child(8), .govtable td:nth-child(8) { display: none; }
}
