/* State explorer, statistics taxonomy, and public-voices controls (2026-07-21) */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.stats-overview article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid #657078;
  border-radius: 10px;
}

.stats-overview article.overview-adverse { border-top-color: #bb3e2e; }
.stats-overview article.overview-favorable { border-top-color: #138808; }
.stats-overview span,
.stats-overview small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.stats-overview strong { font-size: clamp(24px, 3vw, 34px); line-height: 1; }
.stats-overview small { font-size: 9px; font-weight: 700; letter-spacing: .015em; text-transform: none; }

.stats-toolbar {
  grid-template-columns: minmax(210px, 1.35fr) repeat(3, minmax(135px, .62fr)) auto !important;
}
.stats-toolbar .stats-result { grid-column: 1 / -1; padding: 0 0 2px !important; }
.indicator-taxonomy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.indicator-topic {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: #3f474d;
  background: #f1efe9;
  border: 1px solid #ded9cd;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.indicator-data-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .025em;
}

.state-map-section { background: #fbf8f1; }
.state-map-head { max-width: 780px; margin-bottom: 14px; }
.state-map-toolbar {
  display: grid;
  grid-template-columns: minmax(230px, 340px) auto minmax(240px, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.state-map-toolbar label { display: grid; gap: 5px; }
.state-map-toolbar label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.state-map-toolbar select { min-height: 42px; padding: 0 36px 0 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.state-map-toolbar .clear-filters-button { min-height: 42px; }
.state-map-summary { align-self: center; margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.state-map-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(330px, .78fr); gap: 12px; align-items: stretch; }
.state-map-canvas-wrap,
.state-map-panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.state-map-canvas-wrap { position: relative; }
.state-map-canvas { width: 100%; height: 620px; background: #f4efe5; }
.state-map-error { display: grid; place-items: center; height: 100%; min-height: 360px; padding: 24px; color: var(--muted); text-align: center; }
.state-map-legend { display: flex; align-items: center; gap: 8px; padding: 10px 13px 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.state-map-scale { display: block; width: min(180px, 38vw); height: 8px; background: linear-gradient(90deg, #ece8df, #f6c66f, #e98f38, #bb3e2e, #6f1d2a); border-radius: 99px; }
.state-map-credit { margin: 0; padding: 5px 13px 11px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.state-map-panel { max-height: 620px; overflow-y: auto; }
.state-map-selection { position: sticky; top: 0; z-index: 1; padding: 17px 18px 14px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.state-map-kicker { color: #a54b1a; font-size: 9px; font-weight: 900; letter-spacing: .095em; text-transform: uppercase; }
.state-map-selection h3 { margin: 4px 0 5px; font-size: 25px; line-height: 1.06; }
.state-map-selection p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.state-government { border-bottom: 1px solid var(--line); }
.state-governance-current { padding: 16px 18px; background: #f8f6f0; }
.state-governance-heading h4 { margin: 4px 0 4px; font-size: 15px; }
.state-governance-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.state-governance-current-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 11px; }
.state-governance-current-grid article { min-width: 0; padding: 10px; background: #fff; border: 1px solid #ded9cf; border-radius: 7px; }
.state-governance-current-grid span { display: block; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.state-governance-current-grid strong { display: block; margin-top: 4px; font-size: 12px; line-height: 1.25; }
.state-governance-current-grid p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.state-governance-history { padding: 13px 18px 4px; }
.state-governance-history + .state-governance-history { padding-top: 8px; }
.state-governance-history > h4 { margin: 0 0 7px; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; }
.state-governance-term { padding: 10px 0; border-top: 1px solid var(--line); }
.state-governance-term-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 8px; font-weight: 800; }
.state-governance-term-head strong { color: #a54b1a; text-align: right; }
.state-governance-term h5 { margin: 5px 0 2px; font-size: 13px; }
.state-governance-term p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.state-governance-term .state-governance-affiliation { margin-top: 0; color: var(--ink); font-weight: 700; }
.state-governance-sources { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.state-governance-sources a,
.state-governance-source-missing { padding: 3px 6px; color: #0d5d35; background: #edf7ed; border: 1px solid #c9dfca; border-radius: 99px; font-size: 8px; font-weight: 800; text-decoration: none; }
.state-governance-source-missing { color: var(--muted); background: #f1efe9; border-color: #ded9cf; }
.state-governance-empty { padding: 18px; background: #fff7e8; }
.state-governance-empty strong { display: block; font-size: 12px; }
.state-governance-empty p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.state-timeline { display: grid; gap: 0; }
.state-timeline-item { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.state-timeline-item:last-child { border-bottom: 0; }
.state-timeline-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
.state-timeline-meta time { color: #a54b1a; font-size: 13px; }
.state-timeline-item h4 { margin: 7px 0 5px; font-size: 15px; line-height: 1.25; }
.state-timeline-item h4 a { color: inherit; text-decoration-color: rgba(0,0,0,.2); text-underline-offset: 3px; }
.state-timeline-item p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.state-timeline-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.state-timeline-foot .chip { font-size: 8px; }
.state-timeline-foot .evidence-state { color: var(--muted); font-size: 9px; font-weight: 800; }
.state-timeline-foot .evidence-state.linked { color: #0d6a04; }
.state-timeline-foot .evidence-state.pending { color: #8a5a00; }
.state-timeline-empty { padding: 28px 18px; color: var(--muted); text-align: center; }
.state-timeline-empty strong { display: block; margin-bottom: 5px; color: var(--ink); }
.state-timeline-empty p { margin: 0; font-size: 12px; line-height: 1.5; }
.state-directory-wrap { margin-top: 14px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.state-directory-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.state-directory-head h3 { margin: 0; font-size: 16px; }
.state-directory-head span { color: var(--muted); font-size: 10px; font-weight: 800; }
.state-directory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.state-directory-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 42px; padding: 7px 9px; color: var(--ink); background: #f8f6f0; border: 1px solid #e1ddd3; border-radius: 7px; text-align: left; cursor: pointer; }
.state-directory-item span { min-width: 0; overflow: hidden; font-size: 10px; font-weight: 800; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.state-directory-item strong { display: grid; place-items: center; min-width: 25px; height: 25px; padding: 0 5px; color: #fff; background: #535b60; border-radius: 99px; font-size: 10px; }
.state-directory-item:hover,
.state-directory-item:focus-visible { border-color: #a54b1a; background: #fff3e3; outline: none; }
.state-directory-item.is-selected { color: #073d24; border-color: #138808; background: #edf7ed; box-shadow: inset 3px 0 0 #138808; }
.state-directory-item.is-selected strong { background: #138808; }
.maplibregl-ctrl-group { border-radius: 8px !important; box-shadow: 0 2px 10px rgba(0,0,0,.14) !important; }
.maplibregl-ctrl-group button { width: 34px !important; height: 34px !important; }

.voice-issue-spotlight { margin-bottom: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.voice-issue-spotlight-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.voice-issue-spotlight-head strong { font-size: 12px; }
.voice-issue-spotlight-head span { color: var(--muted); font-size: 10px; font-weight: 700; }
.voice-issue-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-issue-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 7px 6px 10px; color: var(--ink); background: #f7f4ee; border: 1px solid #ded9cf; border-radius: 999px; cursor: pointer; }
.voice-issue-chip span { max-width: 210px; overflow: hidden; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.voice-issue-chip strong { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; color: #fff; background: #677078; border-radius: 999px; font-size: 9px; }
.voice-issue-chip:hover,
.voice-issue-chip:focus-visible { border-color: #a54b1a; background: #fff3e3; outline: none; }
.voice-issue-chip.is-active { color: #073d24; border-color: #138808; background: #edf7ed; }
.voice-issue-chip.is-active strong { background: #138808; }

@media (max-width: 1040px) {
  .stats-toolbar { grid-template-columns: minmax(200px, 1.4fr) repeat(2, minmax(135px, .7fr)) !important; }
  .stats-toolbar label:nth-of-type(4) { grid-column: 1; }
  .stats-toolbar .clear-filters-button { grid-column: 2; justify-self: start; }
  .state-map-layout { grid-template-columns: 1fr; }
  .state-map-panel { max-height: 520px; }
  .state-directory { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .stats-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stats-overview article { padding: 10px 11px; }
  .stats-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .stats-toolbar .stats-search,
  .stats-toolbar .stats-result { grid-column: 1 / -1; }
  .stats-toolbar label:nth-of-type(4) { grid-column: auto; }
  .stats-toolbar .clear-filters-button { grid-column: 1; }
  .state-map-toolbar { grid-template-columns: 1fr auto; align-items: end; padding: 10px; }
  .state-map-summary { grid-column: 1 / -1; }
  .state-map-canvas { height: 440px; }
  .state-map-panel { max-height: none; }
  .state-governance-current-grid { grid-template-columns: 1fr; }
  .state-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .state-directory-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .voice-issue-spotlight-head { align-items: flex-start; flex-direction: column; gap: 2px; }
}

@media (max-width: 420px) {
  .state-map-toolbar { grid-template-columns: 1fr; }
  .state-map-toolbar .clear-filters-button { width: 100%; }
  .state-map-canvas { height: 390px; }
  .state-directory { grid-template-columns: 1fr; }
  .state-directory-item span { white-space: normal; }
}
