/* Shared archive palette: dark query controls, warm paper maps and results. */
body.history-archive .layout,
body.local-executive-page .local-layout{background:#e9e2d6}

body.history-archive .map-panel,
body.local-executive-page .local-map-panel{align-self:start;width:100%;box-sizing:border-box;background:#e9e2d6;border-color:#c9c0b3}
body.history-archive .map-title strong,
body.local-executive-page .local-map-title strong{color:#171310}
body.history-archive .map-status,
body.local-executive-page .local-map-status{color:#665f56}
body.history-archive .map-status b,
body.local-executive-page .local-map-status b{color:#26211c}
body.history-archive .county,
body.local-executive-page .local-county{stroke:#f7f1e8;stroke-width:1.2}
body.history-archive .county:hover,
body.history-archive .county.selected,
body.local-executive-page .local-county:hover,
body.local-executive-page .local-county.selected{stroke:#E4022B;filter:brightness(1.04)}

body.history-archive .result-panel,
body.local-executive-page .local-result{background:#eee9df;color:#171310}
body.history-archive .election-meta,
body.local-executive-page .local-result-head{border-color:#c9c0b3}
body.history-archive #election-title,
body.history-archive .meta-stats strong,
body.local-executive-page .local-result-head h2,
body.local-executive-page .local-head-stat strong{color:#171310}
body.history-archive .meta-stats span,
body.history-archive .section-label,
body.local-executive-page .local-head-stat span,
body.local-executive-page .local-section-label{color:#71695f}

body.history-archive .candidate,
body.local-executive-page .local-candidate{border-color:#4a4037;background:#1b1612;color:#f4f1ea;box-shadow:0 8px 24px rgba(80,58,39,.08)}
body.history-archive .candidate .cand-no,
body.local-executive-page .local-number{border-color:#6b6056;background:#2a241f;color:#f4f1ea}
body.history-archive .candidate .cand-party,
body.history-archive .candidate .cand-votes small,
body.local-executive-page .local-candidate .local-party,
body.local-executive-page .local-candidate .local-vote small{color:#aaa097}
body.history-archive .candidate:not(.elected) .cand-name,
body.history-archive .candidate:not(.elected) .cand-votes,
body.local-executive-page .local-candidate:not(.elected) .local-name,
body.local-executive-page .local-candidate:not(.elected) .local-vote{color:#f4f1ea}
body.history-archive .candidate .bar,
body.local-executive-page .local-candidate .local-bar{background:#40362e}
body.history-archive #candidates .candidate.elected.archive-elected-card,
body.local-executive-page .local-candidate.elected{border-color:#d5ccbf;background:#f4f1ea;color:#171411;box-shadow:0 10px 26px rgba(80,58,39,.12)}
body.local-executive-page .local-candidate.elected .local-name{color:#171411}

body.history-archive .county-detail,
body.history-archive .archive-insights,
body.local-executive-page .local-historical-race>h3{border-color:#c9c0b3}
body.history-archive .county-card{border-color:#4a4037;background:#1b1612;color:#f4f1ea}
body.history-archive .county-head{border-color:#40362e}
body.history-archive .county-head h3,
body.history-archive .county-row-name,
body.history-archive .county-row-votes,
body.history-archive .county-row-share{color:#f4f1ea}
body.history-archive .county-row{border-color:#40362e}
body.history-archive .county-row-party{color:#aaa097}
body.history-archive .county-summary{background:#2a211b;color:#d2c7bb}
body.history-archive .county-empty,
body.local-executive-page .local-empty{border-color:#bcb1a2;background:#e6dfd4;color:#655d53}
body.history-archive .county-empty strong,
body.local-executive-page .local-empty strong{color:#211c18}

body.history-archive .overview-stat,
body.history-archive .insight-card,
body.local-executive-page .local-seat-card{border-color:#c8beaf;background:#ded6ca;color:#171310}
body.history-archive .overview-stat strong,
body.history-archive .insight-head h3,
body.history-archive .party-summary-row>div b,
body.history-archive .party-summary-row>strong,
body.local-executive-page .local-seat-card strong{color:#171310}
body.history-archive .insight-head>span,
body.history-archive .overview-stat span,
body.history-archive .party-summary-row>div small,
body.history-archive .party-summary-row>strong small,
body.local-executive-page .local-seat-card small{color:#6d655b}
body.history-archive .party-summary-row>span{background:#c9bfb0}
body.history-archive .trend-grid{stroke:#cec5b8}
body.history-archive .trend-axis{stroke:#9d9386}
body.history-archive .trend-year,
body.history-archive .trend-y,
body.history-archive .trend-value{fill:#6d655b}
body.history-archive .trend-point circle{fill:#f4f1ea}

body.local-executive-page .local-overview-note{border-color:#c3b7a6;background:#e2d9cb;color:#5e564d}
body.local-executive-page .local-historical-race>h3{color:#171310}
body.local-executive-page .local-compare-stat{border-color:#c3b8a8;background:#ddd4c7;color:#171310}
body.local-executive-page .local-compare-stat span,
body.local-executive-page .local-legend span{color:#71695f}
body.local-executive-page .local-flip-chip{border-color:#aa9d8b;background:#e3dbcf;color:#3d352e}
body.local-executive-page .local-compare-detail{border-color:#c3b8a8;background:#ded5c8;color:#5c544b}
body.local-executive-page .local-compare-detail h3,
body.local-executive-page .local-compare-detail strong{color:#171310}
body.history-archive .source,
body.local-executive-page .local-source{border-color:#c9c0b3;color:#71695f}
body.history-archive .source a,
body.local-executive-page .local-source a{color:#312b25}

body.archive-comparing .archive-query-shell,
body.local-compare-active .local-query-shell,
body.compare-map-active .local-query-shell{position:relative;top:auto}

.paired-compare-maps{display:none;position:absolute;inset:76px 24px 84px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}
body.archive-comparing #map,
body.archive-comparing #mobile-map,
body.local-compare-active #local-map{display:none!important}
body.archive-comparing #archive-compare-maps,
body.local-compare-active #local-exec-compare-maps{display:grid}
body.local-compare-active .local-mobile-insets{display:none!important}
.paired-compare-maps>section{min-width:0;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;border:1px solid #c8beaf;background:#f3ede3}
.paired-compare-maps>section+section{box-shadow:-10px 0 24px rgba(92,70,48,.06)}
.paired-compare-maps header{display:flex;align-items:end;justify-content:space-between;padding:13px 15px 8px;border-bottom:1px solid #d4cbbb}
.paired-compare-maps header span{padding:4px 8px;background:#dac678;color:#171310;font:900 clamp(20px,2.4vw,34px)/1 Archivo,sans-serif}
.paired-compare-maps header small{color:#766e63;font-size:9px;font-weight:900;letter-spacing:.12em}
.paired-compare-maps svg{display:block;width:100%;height:100%;min-height:0}
.paired-compare-maps path{stroke:#f7f1e8;stroke-width:1.3;vector-effect:non-scaling-stroke;cursor:pointer;transition:fill .18s,stroke .18s,filter .18s}
.paired-compare-maps path:hover{stroke:#171310;filter:brightness(1.08)}
.paired-compare-maps path.selected{stroke:#E4022B;stroke-width:2.5}

.paired-compare-chart{display:grid;gap:12px;margin-top:14px;padding:16px;border:1px solid #c4b9aa;background:#e2d9cc;color:#171310}
.paired-chart-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.paired-chart-head strong{font-size:13px}
.paired-chart-key{display:flex;gap:10px;color:#6f665c;font-size:9px;font-weight:800}
.paired-chart-key span{display:flex;align-items:center;gap:5px}.paired-chart-key i{width:9px;height:9px}
.paired-chart-row{display:grid;grid-template-columns:92px minmax(0,1fr);gap:10px;align-items:center}
.paired-chart-row>span{font-size:10px;font-weight:900}
.paired-chart-bars{display:grid;gap:5px}.paired-chart-bar{display:grid;grid-template-columns:36px minmax(0,1fr) 58px;gap:7px;align-items:center;color:#71685e;font:800 9px Archivo,sans-serif}
.paired-chart-bar em{font-style:normal}.paired-chart-track{height:8px;background:#c9bfb0;overflow:hidden}.paired-chart-track i{display:block;height:100%;min-width:2px}.paired-chart-bar b{text-align:right;color:#28221d;font-size:10px}
.archive-map-legend span{display:inline-flex;align-items:center;gap:5px}.archive-map-legend span>i:not(.legend-bar){width:8px;height:8px;border-radius:2px}

.archive-result-disclosure{margin-top:24px;border-top:1px solid #c9c0b3;border-bottom:1px solid #c9c0b3}
.archive-result-disclosure.archive-insights{padding-top:0}
.archive-result-disclosure>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;cursor:pointer;list-style:none}
.archive-result-disclosure>summary::-webkit-details-marker{display:none}
.archive-result-disclosure>summary .section-label,
.archive-result-disclosure>summary .local-section-label{margin:0;color:#71695f}
.archive-disclosure-action{display:inline-flex;align-items:center;gap:7px;color:#71695f;font-size:10px;font-weight:900}
.archive-disclosure-action:before{content:'收起概況'}
.archive-disclosure-action:after{content:'−';display:grid;place-items:center;width:25px;height:25px;border:1px solid #a99e90;border-radius:50%;color:#312b25;font:900 15px Archivo,sans-serif}
.archive-result-disclosure:not([open]) .archive-disclosure-action:before{content:'展開概況'}
.archive-result-disclosure:not([open]) .archive-disclosure-action:after{content:'＋'}
.archive-overview-content{padding:0 0 18px}
.archive-area-section,.county-detail{margin-top:24px}
.result-area-toolbar{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:12px}
.result-area-toolbar>.section-label,.result-area-toolbar>.local-section-label{margin:0}
.result-area-picker{display:grid;grid-template-columns:auto minmax(150px,210px);align-items:center;gap:9px}
.result-area-picker>span{color:#71695f;font-size:9px;font-weight:900;letter-spacing:.08em}
.result-area-picker select{height:40px;appearance:none;border:1px solid #b5aa9b;border-radius:9px;background:#e3dbcf url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23171310' stroke-width='2.4'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 10px center/14px;padding:0 34px 0 11px;color:#171310;font-size:12px;font-weight:900;cursor:pointer}
.result-area-picker select:focus-visible{outline:2px solid #E4022B;outline-offset:2px}
.election-overview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.election-overview-stat{min-width:0;border:1px solid #c8beaf;border-radius:11px;background:#ded6ca;padding:11px 12px;color:#171310}
.election-overview-stat:last-child{grid-column:1/-1}
.election-overview-stat span{display:flex;justify-content:space-between;gap:6px;color:#6d655b;font-size:10px;font-weight:800}
.election-overview-stat span small{font:700 8px Archivo,sans-serif;letter-spacing:.09em}
.election-overview-stat strong{display:block;margin-top:5px;color:#171310;font:900 18px Archivo,'Noto Sans TC',sans-serif;font-variant-numeric:tabular-nums}

@media(max-width:660px){
  body.history-archive .map-panel,
  body.local-executive-page .local-map-panel{background:#e9e2d6;border-color:#c9c0b3}
  body.history-archive .result-panel,
  body.local-executive-page .local-result{background:#eee9df;color:#171310}
  body.history-archive .candidate,
  body.local-executive-page .local-candidate{border-color:#4a4037!important;background:#1b1612!important;color:#f4f1ea!important}
  body.history-archive #candidates .candidate.elected.archive-elected-card,
  body.local-executive-page .local-candidate.elected{border-color:#d5ccbf!important;background:#f4f1ea!important;color:#171411!important}
  body.history-archive #candidates .candidate.elected.archive-elected-card .cand-name{color:#171411!important}
  body.history-archive #candidates .candidate.elected.archive-elected-card .cand-no{background:#e6e1d6!important;color:#171411!important}
  body.history-archive #candidates .candidate.elected.archive-elected-card .cand-party{color:#655e56!important}
  body.history-archive #candidates .candidate.elected.archive-elected-card .cand-votes{color:#c6002e!important}
  body.history-archive #candidates .candidate.elected.archive-elected-card .cand-votes small{color:#655e56!important}
  body.archive-comparing .map-panel,body.local-compare-active .local-map-panel{order:1;min-height:520px}
  body.archive-comparing .result-panel,body.local-compare-active .local-result{order:2}
  .paired-compare-maps{inset:68px 8px 70px;gap:7px}
  .paired-compare-maps header{padding:8px}.paired-compare-maps header span{font-size:17px}.paired-compare-maps header small{font-size:7px}
  .paired-chart-row{grid-template-columns:76px minmax(0,1fr)}.paired-chart-bar{grid-template-columns:30px minmax(0,1fr) 52px}
  .result-area-toolbar{display:grid;gap:10px}.result-area-picker{grid-template-columns:auto minmax(0,1fr)}.result-area-picker select{height:42px}.election-overview-stat strong{font-size:16px}
}
