/* Electoral Vote Map — state pages (/states/…) and the forecasters table [evm_ratings] (1.7.0).
   Colors come from the --evm-* tokens map.css puts on .evm-sheet (light) and
   html[data-evm-theme="dark"] .evm-sheet (dark). Loaded only where needed. */

.evm-state, .evm-states { font-family: inherit; color: inherit; margin: 0; }
.evm-sheet .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); }

.evm-crumbs { font: 600 13px/1.3 var(--evm-sans); color: var(--evm-ink-dim); margin: 0 0 8px; }
.evm-crumbs a { color: var(--evm-accent); text-decoration: none; }
.evm-crumbs a:hover { text-decoration: underline; }

.evm-state__lede { font-size: 1.08em; line-height: 1.6; }
.evm-state__intro { margin-bottom: 1em; }
.evm-sheet__fine { font: 13px/1.5 var(--evm-sans); color: var(--evm-ink-dim); margin: 6px 0 1.2em; }
.evm-sheet__notes { font: 13px/1.5 var(--evm-sans); color: var(--evm-ink-dim); margin: 0 0 1.2em; padding-left: 1.2em; }
.evm-sheet__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 .6em; }
.evm-sheet__scroll table { margin: 0; }

/* ---- the strip of year tiles ---- */
.evmt-entry__body .evm-strip, .evm-strip { list-style: none; margin: 18px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; font-family: var(--evm-sans); }
.evm-strip__tile { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 7px 2px 6px; border-radius: 4px; line-height: 1.15; text-align: center; min-width: 0; }
.evm-strip__year { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.evm-strip__who { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evm-strip__m { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .92; }
.evmt-entry__body .evm-strip--mini, .evm-strip--mini { display: flex; gap: 2px; margin: 0; }
.evm-strip__tile--none { background: none; box-shadow: inset 0 0 0 1px var(--evm-rule); }
.evm-strip--mini .evm-strip__tile { width: 12px; height: 16px; padding: 0; border-radius: 2px; flex: none; }

/* ---- 2028 ratings for the state ---- */
.evmt-entry__body .evm-outlook, .evm-outlook { list-style: none; padding: 0; margin: 10px 0 6px; display: grid; gap: 8px; font: 15px/1.35 var(--evm-sans); }
.evm-outlook li { display: flex; align-items: center; gap: 10px; }
.evm-outlook .evm-rt__chip { min-width: 78px; }
.evm-outlook__date { color: var(--evm-ink-dim); font-size: 13px; margin-left: 4px; }
.evm-outlook a { color: inherit; }

/* ---- margin chart ---- */
.evm-chart-wrap { margin: 8px 0 1.4em; }
.evm-chart { display: block; width: 100%; height: auto; font-family: var(--evm-sans); }
.evm-chart__grid { stroke: var(--evm-rule); stroke-width: 1; }
.evm-chart__zero { stroke: var(--evm-ink-dim); }
.evm-chart__axis { fill: var(--evm-ink-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.evm-chart__bar { stroke: none; }
.evm-chart__nat { fill: none; stroke: var(--evm-ink); stroke-width: 2; stroke-linejoin: round; }
.evm-chart__natdot { fill: var(--evm-bg); stroke: var(--evm-ink); stroke-width: 2; }
.evm-chart__legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 13px/1.4 var(--evm-sans); color: var(--evm-ink-dim); margin: 6px 0 0; }
.evm-chart__legend .evm-dot { margin-right: 2px; }
.evm-chart__key-line { display: inline-block; width: 20px; height: 0; border-top: 2px solid var(--evm-ink); vertical-align: middle; margin-right: 4px; position: relative; }
.evm-sheet .evm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; }

/* ---- history tables ---- */
.evm-history { border-collapse: collapse; width: 100%; font: 14px/1.35 var(--evm-sans); font-variant-numeric: tabular-nums; }
.evm-history th, .evm-history td { padding: 8px 6px; border-bottom: 1px solid var(--evm-rule); text-align: left; vertical-align: middle; white-space: nowrap; }
.evmt-entry__body .evm-history thead th { font-size: 12px; }
.evmt-entry__body .evm-history tbody th, .evmt-entry__body .evm-rt tbody th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--evm-ink); font-weight: 700; }
.evm-history .num { text-align: right; }
.evm-history__short { display: none; }
@media (max-width: 1280px) { .evm-state .evm-history__full { display: none; } .evm-state .evm-history__short { display: inline; } }
.evm-history a { font-weight: 700; }
.evm-history__who { color: var(--evm-ink-dim); font-size: 12px; margin-right: 2px; }
.evm-history__votes { display: block; color: var(--evm-ink-dim); font-size: 11px; }
.evm-history__margin { font-weight: 700; }
.evm-history__nat { color: var(--evm-ink-dim); }
.evm-history__m { color: var(--evm-ink-dim); font-size: 12px; }
.evm-history__miss { display: inline-block; margin-left: 4px; padding: 1px 5px; border-radius: 3px; font-size: 11px; font-weight: 600; color: var(--evm-ink-dim); border: 1px solid var(--evm-rule); }
.evm-sheet .evm-t-dem { color: var(--evm-dem-0); }
.evm-sheet .evm-t-rep { color: var(--evm-rep-0); }
.evm-states-table td:nth-child(3) { width: 1%; }

/* ---- electoral votes over time ---- */
.evmt-entry__body .evm-evhist, .evm-evhist { list-style: none; padding: 0; margin: 8px 0 1.4em; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; font-family: var(--evm-sans); }
.evm-evhist li { background: var(--evm-panel); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; line-height: 1.2; }
.evm-evhist__n { font-size: 26px; font-weight: 800; color: var(--evm-ink); }
.evm-evhist__y { font-size: 13px; font-weight: 600; }
.evm-evhist__c { font-size: 12px; color: var(--evm-ink-dim); }

.evm-state-nav { display: flex; justify-content: space-between; gap: 12px; margin: 2em 0 0; padding-top: 14px; border-top: 1px solid var(--evm-rule); font: 600 14px/1.3 var(--evm-sans); }
.evmt-entry__body .evm-state-nav a { text-decoration: none; color: var(--evm-accent); }
.evm-state-nav__all { text-align: center; }

.evmt-entry__body .evm-states-list, .evm-states-list { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 24px; font-family: var(--evm-sans); }
.evm-states-list li { padding: 3px 0; break-inside: avoid; }
@media (max-width: 520px) { .evm-states-list { columns: 2; } }

/* ---- [evm_ratings] ---- */
.evm-ratings { font-family: var(--evm-sans); margin: 8px 0 1.5em; }
.evm-rt { border-collapse: collapse; width: 100%; font: 14px/1.3 var(--evm-sans); font-variant-numeric: tabular-nums; }
.evm-rt th, .evm-rt td { padding: 6px 6px; border-bottom: 1px solid var(--evm-rule); text-align: center; vertical-align: middle; }
.evm-rt .evm-rt__state { text-align: left; white-space: nowrap; }
.evm-rt__ev { color: var(--evm-ink-dim); font-weight: 400; font-size: 12px; margin-left: 4px; }
.evm-rt__col { white-space: nowrap; }
.evm-rt__date { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--evm-ink-dim); }
.evm-rt__col--consensus, .evm-rt__cell--consensus { border-left: 2px solid var(--evm-rule); }
.evm-rt__chip { display: inline-block; min-width: 72px; padding: 4px 6px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.evm-rt__last { color: var(--evm-ink-dim); font-size: 13px; white-space: nowrap; }
.evm-rt__totals th { text-align: left; font-size: 12px; }
.evm-rt__tally { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.evm-rt__toss { display: block; margin-top: 3px; color: var(--evm-ink-dim); font-size: 11px; white-space: nowrap; }
.evm-rt__bar { height: 6px; margin-top: 4px; min-width: 80px; }
.evm-rt__safe { margin: 10px 0 0; }
.evm-rt__safe summary { cursor: pointer; font: 600 14px/1.4 var(--evm-sans); color: var(--evm-accent); padding: 6px 0; }
.evm-rt__credits { font: 13px/1.5 var(--evm-sans); color: var(--evm-ink-dim); margin: 10px 0 0; }
.evm-rt__credits a { color: var(--evm-accent); }
.evm-sheet .evm-bar { position: relative; display: flex; background: var(--evm-toss-0); border-radius: 3px; }
.evm-sheet .evm-bar__seg { display: block; height: 100%; }
.evm-sheet .evm-bar__tick { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--evm-ink); transform: translateX(-1px); }

/* dark: links the theme brightens need the sheet's accent back */
html[data-evm-theme="dark"] .evm-crumbs a,
html[data-evm-theme="dark"] .evm-rt__credits a,
html[data-evm-theme="dark"] .evm-rt__safe summary,
html[data-evm-theme="dark"] .evmt-entry__body .evm-state-nav a { color: var(--evm-accent); }

@media (max-width: 600px) {
  .evm-history th, .evm-history td { padding: 7px 5px; font-size: 13px; }
  .evm-state .evm-history__votes, .evm-state .evm-history__who { display: none; }
  .evm-chart__axis { font-size: 22px; }
  .evm-chart__nat { stroke-width: 3; }
  .evm-strip { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .evm-rt__chip { min-width: 0; padding: 3px 5px; font-size: 11px; }
}

/* ---- 1.8.0: projected electoral votes ---- */
.evm-evhist li.evm-evhist--proj { background: none; border: 1px dashed var(--evm-ink-dim); }
.evm-evhist--proj .evm-evhist__c { font-style: italic; }
.evm-proj { font-family: var(--evm-sans); margin: 8px 0 1.5em; }
.evm-proj__lede { font: 16px/1.5 var(--evm-sans); margin: 0 0 12px; }
.evm-proj__chg { display: inline-block; min-width: 26px; font-size: 12px; font-weight: 700; color: var(--evm-ink-dim); }
.evm-proj__chg--up { color: #1b7a3d; }
.evm-proj__chg--down { color: #b3261e; }
html[data-evm-theme="dark"] .evm-proj__chg--up { color: #6fd08c; }
html[data-evm-theme="dark"] .evm-proj__chg--down { color: #ff8a80; }
.evm-proj__h { font-size: 18px; margin: 1.4em 0 .4em; }
.evm-proj__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; }
.evm-proj__sub { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--evm-ink-dim); margin: 0 0 4px; }
.evmt-entry__body .evm-proj__list, .evm-proj__list { margin: 0; padding-left: 1.3em; font-size: 14px; line-height: 1.7; }
.evm-proj__list span { color: var(--evm-ink-dim); font-size: 13px; }
@media (max-width: 600px) {
  .evm-proj__cols { grid-template-columns: 1fr; }
  .evm-proj__table th, .evm-proj__table td { white-space: normal; }
  .evm-proj__table thead th { font-size: 11px; line-height: 1.25; }
  .evm-proj__chg { display: block; min-width: 0; }
}

/* ---- 1.8.0: In Congress ---- */
.evm-cong { font-family: var(--evm-sans); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 28px; }
.evm-cong > .evm-sheet__fine { grid-column: 1 / -1; }
.evm-cong__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--evm-ink-dim); margin: 0 0 6px; }
.evmt-entry__body .evm-cong__list, .evm-cong__list { list-style: none; margin: 0 0 8px; padding: 0; font-size: 15px; line-height: 1.7; }
.evm-cong__party, .evm-cong__since { color: var(--evm-ink-dim); font-size: 13px; }
.evmt-entry__body .evm-cong a { color: inherit; }
.evm-cong__bar { display: flex; gap: 2px; flex-wrap: wrap; margin: 2px 0 8px; }
.evm-cong__bar span { width: 14px; height: 14px; border-radius: 2px; }
.evm-cong__more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--evm-accent); }
.evmt-entry__body .evm-cong__house, .evm-cong__house { list-style: none; margin: 6px 0 8px; padding: 0; font-size: 14px; line-height: 1.8; columns: 2; column-gap: 20px; }
.evm-cong__house li { break-inside: avoid; }
.evm-cong__dist { display: inline-block; min-width: 22px; color: var(--evm-ink-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .evm-cong { grid-template-columns: 1fr; } .evm-cong__house { columns: 1; } }
