/* NC Ballot Tracker: Today's Early Vote (/ballot-tracker/today), on top of ballot-tracker.css.
   Tonight's in-person counts from the county boards that post each night. */

/* Key metrics: three cards, the vote total first */
.td-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.td-kpis .kc { grid-template-rows: none; grid-row: auto; }
.kc-chg.blue { color: var(--blue); }

/* Chart: what it shows, then the county */
.bt-seg.bt-seg-eq { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.bt-seg.bt-seg-eq button { min-width: 96px; }
.td-chart { position: relative; }
.td-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.td-plot { position: relative; }
.td-tick { position: absolute; left: 0; transform: translateY(-50%); text-align: right; font: 500 13px / 1 PolymathText, sans-serif; color: var(--mute2); }
.td-ytitle { position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); font: 600 13px / 1 PolymathText, sans-serif; color: var(--ink2); }
.td-days { display: grid; grid-template-columns: repeat(17, minmax(0, 1fr)); margin-top: 6px; }
.td-days div { text-align: center; font: 600 14px / 1 PolymathText, sans-serif; color: var(--ink2); }
.td-days div.on { font-weight: 700; color: var(--blue); }
.td-xtitle { margin-top: 8px; text-align: center; font: 600 14px / 1 PolymathText, sans-serif; color: var(--ink2); }
.td-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Phones: five days at a time */
.td-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.td-pager > span { font: 600 13px / 1 PolymathText, sans-serif; color: var(--ink2); }
.td-pager button { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--blue); background: #fff; color: var(--blue); display: grid; place-items: center; cursor: pointer; }
.td-pager button:disabled { opacity: .35; cursor: default; }
.td-pager .material-icons-round { font-size: 22px; }
.td-val { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: 500 10.5px / 1 PolymathText, sans-serif; color: var(--mute2); }
.td-val.now { font-weight: 700; }
.td-pdays { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 1.7%; margin-top: 6px; text-align: center; }
.td-pdays b { display: block; font: 600 12px / 1.2 PolymathText, sans-serif; color: var(--mute2); }
.td-pdays b.on { font-weight: 700; color: var(--blue); }
.td-pdays span { display: block; margin-top: 2px; font: 500 11px / 1 PolymathText, sans-serif; color: var(--mute2); }

/* Chart tooltip: hover or focus a day */
.td-hit { position: absolute; top: 0; bottom: 0; border: 0; padding: 0; margin: 0; background: transparent; border-radius: 6px; cursor: default; }
.td-hit:hover, .td-hit:focus-visible { background: rgba(1, 96, 166, 0.06); outline: none; }
.td-tip { position: absolute; z-index: 3; pointer-events: none; min-width: 200px; background: #fff; border: 1px solid var(--edge); border-radius: 10px; box-shadow: 0 6px 20px rgba(27, 23, 20, 0.12); padding: 10px 12px; font: 500 13px / 1.3 PolymathText, sans-serif; color: var(--ink2); white-space: nowrap; }
.td-tip[hidden] { display: none; }
.td-tip-d { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.td-tip-r { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.td-tip-r b { margin-left: auto; padding-left: 16px; font-weight: 700; color: var(--ink); }
.td-tip-c { margin-top: 6px; font-weight: 600; }

/* Share sits at the right of the summary's title, as on the main tracker */
.bt-eyebrow #td-share { margin-left: auto; letter-spacing: 0; text-transform: none; }
.bt-eyebrow #td-share[hidden] { display: none; }

/* By county: the title and CSV on one line */
.td-county-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 26px 8px 14px; }
.td-county-head .bt-chart-title { margin: 0; }

/* Table: ballots, then turnout and Dem–Rep groups on desktop; one column of each on phones */
.td-table { table-layout: fixed; }
.td-table td b { font-weight: 600; }
.td-table tr.td-grp th { cursor: default; text-align: center; font: 700 12px / 1.2 PolymathText, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); border-bottom: 2px solid var(--edge); padding: 12px 10px 8px; }
.td-table tr.td-grp th .hint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.td-table th.sep { border-left: 1px solid var(--line); }

@media (max-width: 640px) {
  .td-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .td-kpis .kc:first-child { grid-column: 1 / -1; }
  .td-kpis .kc:not(:first-child) { padding: 14px; }
  .td-kpis .kc:not(:first-child) .kc-num { font-size: 30px; }
  .td-county-head { padding: 22px 4px 10px; }
  /* The chart toggle fits the card: three equal parts of its width */
  .bt-chart-ctrls #td-metric { width: 100%; box-sizing: border-box; }
  .bt-chart-ctrls #td-metric button { min-width: 0; padding: 0 6px; }
  .td-table-card .bt-text-btn { display: none; }
  .td-table { min-width: 0; }
  .td-table th, .td-table td { padding: 9px 5px; font-size: 13.5px; }
  .td-table th { white-space: normal; vertical-align: bottom; }
  .td-table td:first-child { white-space: normal; }
}
