/* house.css - US House hub and district pages (prefix hs-). Tokens only. */

.hs-p-rep { --party-color: var(--pc-party-rep); }
.hs-p-dem { --party-color: var(--pc-party-dem); }
.hs-p-ind { --party-color: var(--pc-party-usind); }
.hs-p-oth { --party-color: var(--pc-text-meta); }
.hs-p-new { --party-color: var(--pc-text-meta); }
.hs-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Seat count: pc-seatbar with the 218 tick, R left, D right, independent and vacant in neutral tones between */
.hs-seg-r { --party-color: var(--pc-party-rep); }
.hs-seg-d { --party-color: var(--pc-party-dem); }
.hs-seg-i { --party-color: var(--pc-text-meta); }
.hs-seg-v { --party-color: var(--pc-border); }
.hs-bar-wrap { margin: 20px 0 0; }
.hs-bar.pc-seatbar { height: 36px; border-radius: 0; }
.hs-bar .pc-seat-seg { color: var(--pc-on-party-dark); font-size: 13px; transition: none; }
.hs-seat-legend { margin-top: 18px; }
.hs-seat-legend .pc-swatch { background: var(--party-color); }

/* Controls */
.hs-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 6px; }
.hs-search { flex: 1 1 220px; max-width: 340px; }
.hs-search .pc-input { width: 100%; box-sizing: border-box; }
.hs-lines-note { margin: 4px 0 0; }

/* Map */
.hs-map-wrap { touch-action: manipulation; max-width: 960px; }
.hs-map { width: 100%; height: auto; display: block; }
.hs-map .hs-d { fill: var(--party-color); stroke: var(--pc-surface); stroke-width: 0.35; cursor: pointer; }
.hs-map .hs-d.hs-p-new { fill: var(--pc-border-light); stroke: var(--pc-border); }
.hs-map .hs-d.hs-p-vacant { fill: var(--pc-border); }
.hs-map .hs-d.hs-hex { stroke: none; }
.hs-map .hs-d.is-focus { stroke: var(--pc-text); stroke-width: 1.4; }
.hs-map .hs-ds.is-filtered .hs-d { opacity: 0.18; }
.hs-map .hs-ds.is-filtered .hs-d.is-match { opacity: 1; }
.hs-map .hs-states { fill: none; stroke: var(--pc-surface); stroke-width: 1.1; pointer-events: none; }
.hs-map .hs-hex-states { stroke: var(--pc-text); stroke-width: 0.9; }
.hs-map .hs-hex-label { font-family: var(--pc-sans); font-size: 7px; font-weight: 700; fill: var(--pc-text); paint-order: stroke;
    stroke: var(--pc-surface); stroke-width: 2px; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.hs-tip .us-party-dot { background: var(--party-color); }
.hs-tip-short { color: inherit; opacity: 0.7; font-weight: 400; }
.hs-tip-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; display: inline-block; margin-top: 4px; }
.pc-wrap .hs-tip a.hs-tip-link, .pc-wrap .hs-tip a.hs-tip-link:hover { color: var(--pc-tooltip-text); }   /* outranks .pc-wrap a (dark ink on the dark card) */
.hs-tip-x { display: none; }
/* Phones: the tapped district's card is a bottom sheet pinned to the viewport bottom; its bottom padding
   clears the anchor ad (--pc-ad-inset from /js/ad-inset.js). The district link is a full-width button. */
@media (max-width: 600px) {
    .us-map-tip.hs-tip.is-sheet {
        position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 1000;
        min-width: 0; max-width: none; box-sizing: border-box; max-height: 70vh; overflow-y: auto;
        padding: 14px 52px calc(14px + var(--pc-ad-inset, 0px) + env(safe-area-inset-bottom, 0px)) 16px; font-size: 14px;
        border-top: 1px solid var(--pc-border);
    }
    .hs-tip.is-sheet b { font-size: 15px; }
    .hs-tip.is-sheet .hs-tip-link {
        display: block; margin-top: 10px; padding: 10px 12px; text-align: center; font-weight: 600;
        text-decoration: none; border: 1px solid currentColor;
    }
    .hs-tip.is-sheet .hs-tip-x {
        display: block; position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; padding: 0; margin: 0;
        background: transparent; border: 0; color: inherit; font-size: 22px; line-height: 1; cursor: pointer;
    }
}
.us-map-legend i.hs-l-ind { background: var(--pc-party-usind); }
.us-map-legend i.hs-l-new { background: var(--pc-border-light); }
.hs-redrawn { margin-top: 8px; }

/* List: one closed <details> per state, districts in a pc-table inside */
.hs-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hs-list-head .pc-section-title { margin-bottom: 0; }
.hs-states { border-top: 1px solid var(--pc-text); }
.hs-state { border-bottom: 1px solid var(--pc-border-light); }
.hs-state-sum { display: grid; grid-template-columns: minmax(0, 1fr) 72px 120px minmax(0, 1.1fr); gap: 12px; align-items: center;
    padding: 11px 0; cursor: pointer; list-style: none; font-family: var(--pc-sans); font-size: 14px; color: var(--pc-text); }
.hs-state-sum::-webkit-details-marker { display: none; }
.hs-state-sum:hover { background: var(--pc-hover-bg); }
.hs-state-name { font-weight: 600; }
.hs-state-name::before { content: '+'; display: inline-block; width: 16px; color: var(--pc-text-meta); font-weight: 400; }
.hs-state[open] > .hs-state-sum .hs-state-name::before { content: '\2212'; }
.hs-state-n, .hs-state-txt { color: var(--pc-text-secondary); font-variant-numeric: tabular-nums; }
.hs-state-n { text-align: right; }
.hs-split { display: flex; height: 10px; background: var(--pc-border-light); overflow: hidden; justify-self: start; width: 100%; }
.hs-state-txt { text-align: left; }
.hs-collapse { margin: 0 0 14px 16px; }
.hs-split i { display: block; height: 100%; }
.hs-split-r { background: var(--pc-party-rep); }
.hs-split-d { background: var(--pc-party-dem); }
.hs-split-i { background: var(--pc-text-meta); }
.hs-split-v { background: var(--pc-border); }
.hs-state .hs-table { margin: 0 0 12px 16px; width: calc(100% - 16px); }
.hs-table td, .hs-table th { white-space: nowrap; }
.hs-table td:nth-child(2) { white-space: normal; }
.hs-table a { color: var(--pc-text); }
.hs-party-col { color: var(--pc-text-secondary); }
.hs-vacant { color: var(--pc-text-meta); }
.hs-cand .us-party-dot { background: var(--party-color); }
.hs-party { color: var(--pc-text-meta); font-size: 12px; }
.hs-fusion { color: var(--pc-text-meta); font-size: 11px; }
.hs-others { color: var(--pc-text-meta); font-size: 11px; white-space: nowrap; }
@media (max-width: 600px) {
    :is(.hs-table, .hs-c28) .hs-party-col { display: none; }
    .hs-state-sum { grid-template-columns: minmax(0, 1fr) 28px 56px minmax(0, 0.9fr); gap: 8px; }
    .hs-state-n small { display: none; }
    .hs-state-txt { font-size: 12px; }
    .hs-state .hs-table { margin-left: 0; width: 100%; }
    .hs-collapse { margin-left: 0; }
}

/* District page */
.hs-top-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
@media (max-width: 768px) { .hs-top-grid { grid-template-columns: 1fr; } }
.hs-member { display: flex; gap: 14px; align-items: center; }
.hs-member .us-pt { flex-shrink: 0; }
.hs-member-lab { font-family: var(--pc-sans); font-size: 13px; color: var(--pc-text-meta); }
.hs-member-name { font-family: var(--pc-serif); font-size: 22px; font-weight: 700; color: var(--pc-text); margin: 2px 0; }
.hs-member-name .us-party-dot { background: var(--party-color); width: 10px; height: 10px; }
.hs-member-meta { font-family: var(--pc-sans); font-size: 14px; color: var(--pc-text-secondary); }
.hs-dmap-fig { margin: 0; }
.hs-dmap { width: 100%; height: auto; display: block; max-height: 420px; background: var(--pc-surface); }
.hs-dm-ctx { fill: none; stroke: var(--pc-border); stroke-width: 0.8; }
.hs-dm-states { fill: none; stroke: var(--pc-text-meta); stroke-width: 1.4; }
.hs-dm-self { fill: color-mix(in srgb, var(--party-color) 40%, var(--pc-surface)); stroke: var(--pc-text); stroke-width: 1.4; stroke-linejoin: round; }
.hs-p-vacant { --party-color: var(--pc-text-meta); }
.hs-dm-old { fill: none; stroke: var(--pc-text); stroke-width: 1.6; stroke-dasharray: 5 4; }
.us-map-legend i.hs-l-self { background: color-mix(in srgb, var(--party-color) 40%, var(--pc-surface)); border-color: var(--pc-text); }
.us-map-legend i.hs-l-old { background: none; border: 1.5px dashed var(--pc-text); }

.hs-results td, .hs-results th { vertical-align: top; }
.hs-results td.hs-num, .hs-results th.hs-num { text-align: right; white-space: nowrap; }
.hs-results tr.hs-era th { text-align: left; padding-top: 16px; font-family: var(--pc-sans); font-size: 13px; color: var(--pc-text); border-bottom: 1px solid var(--pc-text); }
.hs-era-why { display: block; font-weight: 400; color: var(--pc-text-meta); font-size: 12px; }
.hs-results tr.hs-none td { color: var(--pc-text-meta); }
.hs-unopp { color: var(--pc-text-secondary); }
@media (max-width: 600px) {
    .hs-results .hs-party, .hs-results .hs-fusion { display: block; }
    .hs-results th:nth-child(4), .hs-results td:nth-child(4), .hs-results th:nth-child(5), .hs-results td:nth-child(5) { display: none; }
}

/* Margin chart */
.hs-chart { position: relative; }
.hs-chart-svg { display: block; overflow: visible; }
.hs-c-grid { stroke: var(--pc-border-light); stroke-width: 1; }
.hs-c-zero { stroke: var(--pc-text-meta); stroke-width: 1; }
.hs-c-break { stroke: var(--pc-text-meta); stroke-width: 1; stroke-dasharray: 3 3; }
.hs-c-ylab { font-family: var(--pc-sans); font-size: 11px; fill: var(--pc-text-meta); text-anchor: end; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.hs-c-xlab { font-family: var(--pc-sans); font-size: 11px; fill: var(--pc-text-meta); text-anchor: middle; font-variant-numeric: tabular-nums; }
.hs-c-line { fill: none; stroke: var(--pc-text-secondary); stroke-width: 1.5; }
.hs-c-pt { fill: var(--party-color); stroke: var(--pc-surface); stroke-width: 1; }
.hs-c-cross { stroke: var(--pc-text-meta); stroke-width: 1; }
.hs-chart-tip .pc-tooltip-dot { background: var(--party-color); }
.pc-table:is(.hs-results, .hs-pres, .hs-table, .hs-c28) :is(th, td):not(.hs-num) { text-align: left; }
.pc-table:is(.hs-results, .hs-pres, .hs-table, .hs-c28) :is(th, td).hs-num { text-align: right; white-space: nowrap; }

/* 2024 presidential margin: diverging ramp on the party tokens (fills through --party-color) */
.hs-mg-d1 { --party-color: color-mix(in srgb, var(--pc-party-dem) 22%, var(--pc-surface)); }
.hs-mg-d2 { --party-color: color-mix(in srgb, var(--pc-party-dem) 45%, var(--pc-surface)); }
.hs-mg-d3 { --party-color: color-mix(in srgb, var(--pc-party-dem) 70%, var(--pc-surface)); }
.hs-mg-d4 { --party-color: color-mix(in srgb, var(--pc-party-dem) 92%, var(--pc-surface)); }
.hs-mg-r1 { --party-color: color-mix(in srgb, var(--pc-party-rep) 22%, var(--pc-surface)); }
.hs-mg-r2 { --party-color: color-mix(in srgb, var(--pc-party-rep) 45%, var(--pc-surface)); }
.hs-mg-r3 { --party-color: color-mix(in srgb, var(--pc-party-rep) 70%, var(--pc-surface)); }
.hs-mg-r4 { --party-color: color-mix(in srgb, var(--pc-party-rep) 92%, var(--pc-surface)); }
.hs-mg-none { --party-color: var(--pc-border-light); }
.hs-ramp { position: relative; display: inline-flex; padding-bottom: 14px; margin-right: 12px; }
.hs-ramp i { width: 22px; height: 10px; background: var(--party-color); display: block; border: 0; }
.hs-ramp b { position: absolute; top: 12px; transform: translateX(-50%); font-weight: 400; font-size: 10px; color: var(--pc-text-meta);
    font-variant-numeric: tabular-nums; white-space: nowrap; }
.hs-ramp b:first-of-type { transform: none; }
.hs-ramp b:last-of-type { transform: translateX(-100%); }
.hs-pres-legend a { color: var(--pc-text-secondary); text-decoration: underline; text-underline-offset: 2px; }

/* District map: member view (default, works without JS) or the 2024 county layer */
.hs-dmap-toggle { margin: 0 0 8px; }
.hs-dmap-wrap { margin: 0; touch-action: manipulation; }
.hs-dmap-wrap:not(.is-pres) .hs-dm-ctys { display: none; }
.hs-dmap-wrap.is-pres .hs-dm-self { fill: none; stroke-width: 1.6; pointer-events: none; }
.hs-dm-cty { fill: var(--party-color); stroke: var(--pc-surface); stroke-width: 0.8; stroke-linejoin: round; }
.hs-dm-cty.is-focus { stroke: var(--pc-text); stroke-width: 1.6; }
.hs-dm-states, .hs-dm-old, .hs-dm-ctx { pointer-events: none; }
.us-map-legend i.hs-l-outline { background: none; border: 1.5px solid var(--pc-text); }

/* President table */
.hs-pres .hs-pres-c { color: var(--pc-text-meta); font-size: 12px; }
.hs-method p { font-family: var(--pc-serif); font-size: 17px; line-height: 1.7; color: var(--pc-text); }
@media (max-width: 600px) { .hs-pres .hs-pres-c { display: block; } }

/* hidden attribute wins over the flex/grid display of legends and controls */
.us-map-legend[hidden], .us-map-legend [hidden], .hs-state[hidden] { display: none; }
body .pc-btn.hs-expand[hidden] { display: none; }   /* outranks site.css's body.ps-site .pc-btn { display: inline-flex } */

/* Who lives here: district vs US, thin share bar with a tick at the US figure */
.pc-table.hs-dg { max-width: 760px; }
.pc-table.hs-dg th[scope="row"] { text-align: left; font-weight: 400; color: var(--pc-text); }
.pc-table.hs-dg tr.hs-dg-g th { text-align: left; padding-top: 14px; font-family: var(--pc-sans); font-size: 13px; font-weight: 600;
    color: var(--pc-text-secondary); border-bottom: 1px solid var(--pc-border); }
.pc-table.hs-dg tbody tr.hs-dg-g:hover { background: none; }
.hs-dg .hs-dg-v { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.hs-dg .hs-dg-v span { min-width: 64px; }
.hs-dg td.hs-dg-us { color: var(--pc-text-secondary); width: 72px; }
.hs-dg-bar { position: relative; display: block; flex: 0 1 180px; height: 6px; background: var(--pc-border-light); }
.hs-dg-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pc-text-meta); }
.hs-dg-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--pc-text); }
.hs-dg-est { color: var(--pc-text-meta); margin-left: 2px; }
.hs-dg-src { margin-top: 8px; }
@media (max-width: 600px) {
    .hs-dg-bar { flex-basis: 64px; }
    .hs-dg .hs-dg-v span { min-width: 54px; }
    .hs-dg td.hs-dg-us { width: 56px; }
}
.hs-c28 a { color: var(--pc-text); text-decoration: underline; text-underline-offset: 2px; }
/* "More on <state>": race, registration and sibling-district links (wrap on phones and for big delegations) */
.hs-more-row { flex-wrap: wrap; gap: 2px 18px; }
.hs-more .pc-help { margin: 14px 0 0; }

/* 2026 result block (house-result.js; candidate rows use house-map.css) */
.hs-res26 .us-ap-tag { display: inline-block; font-family: var(--pc-sans); font-size: 12px; font-weight: 800; letter-spacing: 0.02em; color: var(--pc-on-ink); background: var(--pc-text); padding: 4px 8px; text-decoration: none; }
.hs-res26 .hm-cands { max-width: 520px; }

/* Fundraising: FEC 2026 totals at each candidate's latest report, bar of total raised (pc-bar track/fill) */
.hs-fec { list-style: none; margin: 0; padding: 0; max-width: 760px; font-family: var(--pc-sans); font-variant-numeric: tabular-nums; }
.hs-fec-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 56px minmax(0, 210px); gap: 2px 12px;
    align-items: center; padding: 7px 0; border-bottom: 1px solid var(--pc-border-light); }
.hs-fec-name { font-size: 14px; color: var(--pc-text); min-width: 0; }
.hs-fec-name a { color: var(--pc-text); text-decoration: underline; text-underline-offset: 2px; }
.hs-fec-name .us-party-dot { background: var(--party-color); }
.hs-fec-asof { display: block; font-size: 12px; color: var(--pc-text-meta); margin-left: 13px; }
.hs-fec-track.pc-bar-track { height: 12px; }
.hs-fec-raised { font-size: 14px; font-weight: 700; color: var(--pc-text); text-align: right; }
.hs-fec-sub { font-size: 12px; color: var(--pc-text-secondary); }
.hs-fec-debt { color: var(--pc-text-meta); }
.hs-fec-more { margin: 8px 0 0; }
.hs-fec-src { margin: 4px 0 0; }
@media (max-width: 600px) {
    .hs-fec-row { grid-template-columns: minmax(0, 1fr) 56px; }
    .hs-fec-name, .hs-fec-sub { grid-column: 1 / -1; }
    .hs-fec-asof { display: inline; margin-left: 6px; }
}
