/* archive 회차 전용 페이지 */

.ar-breadcrumb {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 8px 0 16px;
}
.ar-breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.ar-breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.ar-breadcrumb span { color: var(--ink); font-weight: 600; }

/* hero */
.ar-hero {
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
/* hero 상단 행 — 태그(좌) + 렌즈 전환(우, h1 위 우측) */
.ar-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ar-hero-top .ar-hero-tag { margin-bottom: 0; }
.ar-hero-top .lens-switcher { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.ar-hero-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.ar-hero-title {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.ar-hero-date {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.ar-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 700px) {
  .ar-hero-stats { grid-template-columns: repeat(2, 1fr); }
}
.ar-stat {
  padding: 4px 18px 4px 0;
  border-right: 1px solid var(--rule);
}
.ar-stat:last-child { border-right: none; }
.ar-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.ar-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.ar-hero-status {
  font-size: 12px;
  color: var(--ink-soft);
  border-left: 3px solid var(--ink-mute);
  padding: 4px 0 4px 10px;
  margin: 0;
}

/* sections */
/* 아카이브 본문 단일 칸 — 컴포넌트가 모바일 최적(440~760)이라 PC 넓은 .page(1320)에선
   가운데 떠 허전. 본문 블록을 ~800px 중앙 칸으로 통일(시군구의회 지도 포함). */
.ar-hero, .ar-section {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}
.ar-section {
  margin-bottom: 40px;
  padding-top: 8px;
}
.ar-section-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}


/* prediction grid — 17 시도 */
.ar-prediction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.ar-pred-cell {
  border: 1px solid var(--rule);
  padding: 10px 12px;
}
.ar-pred-cell.is-hit { border-left: 3px solid #2e7d6f; }
.ar-pred-cell.is-miss { border-left: 3px solid #c8553d; }
.ar-pred-sido { font-size: 11px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.ar-pred-row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12px;
}
.ar-pred-row + .ar-pred-row { margin-top: 2px; }
.ar-pred-row .lbl { font-size: 11px; color: var(--ink-mute); }
.ar-pred-row .party { font-weight: 700; }
.ar-pred-row .pct { font-size: 11px; color: var(--ink-soft); margin-left: 6px; }
.ar-pred-result { font-size: 12px; margin-top: 6px; color: var(--ink-soft); }

/* polls list */
.ar-polls-list-host {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.ar-poll-item {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 12px;
}
.ar-poll-item .agency { font-weight: 700; }
.ar-poll-item .period { color: var(--ink-soft); font-size: 11px; margin-top: 2px; }

/* trend chart */
.ar-trend-host {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 14px;
  min-height: 280px;
  font-size: 11px;
  color: var(--ink-soft);
}

/* byelection */
.ar-byelection-host {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.ar-by-card {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 12px 14px;
  background: var(--bg2);
}
.ar-by-elpc { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.ar-by-reason {
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--bg3);
  padding: 4px 8px;
  border-radius: 2px;
  display: inline-block;
  margin: 4px 0;
}



/* 개표 진행 grid */
.ar-counting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.ar-count-cell {
  padding: 10px 12px;
  border: 1px solid var(--rule);
}
.ar-count-sido { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.ar-count-bar { width: 100%; height: 8px; background: var(--bg3); position: relative; overflow: hidden; }
.ar-count-fill { display: block; height: 100%; }
.ar-count-meta { font-size: 11px; margin-top: 6px; display: flex; justify-content: space-between; }
.ar-count-pct { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* 대선 전국 후보별 막대 */
.ar-nation-bars { display: flex; flex-direction: column; gap: 8px; }
.ar-nation-row {
  display: grid;
  grid-template-columns: 180px 1fr 64px 110px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
@media (max-width: 640px) {
  .ar-nation-row { grid-template-columns: 1fr 60px; grid-template-areas: "name pct" "bar bar" "votes votes"; gap: 4px; }
  .ar-nation-name { grid-area: name; }
  .ar-nation-bar { grid-area: bar; }
  .ar-nation-pct { grid-area: pct; text-align: right; }
  .ar-nation-votes { grid-area: votes; text-align: right; }
}
.ar-nation-name { font-weight: 700; }
.ar-nation-party { font-size: 11px; color: var(--ink-soft); font-weight: 500; margin-left: 4px; }
.ar-nation-bar { height: 10px; background: var(--bg3); position: relative; overflow: hidden; }
.ar-nation-fill { display: block; height: 100%; }
.ar-nation-pct { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.ar-nation-pct .unit { font-size: 11px; color: var(--ink-soft); font-weight: 400; margin-left: 1px; }
.ar-nation-votes { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; text-align: right; }

/* 총선 의회 구성 */
/* 의회 구성 — 정당별 지역구/비례/계 상세표 (반원은 히어로 소관). */
.ar-parl-table { max-width: 460px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ar-parl-thead, .ar-parl-trow {
  display: grid;
  grid-template-columns: 12px 1fr 56px 56px 56px;
  gap: 10px; align-items: center; padding: 5px 0;
}
.ar-parl-table.two-col .ar-parl-thead,
.ar-parl-table.two-col .ar-parl-trow { grid-template-columns: 12px 1fr 72px; }
.ar-parl-note { font-size: 12.5px; color: var(--ink-soft); margin: 8px 0 0; max-width: 460px; }
.ar-parl-thead {
  font-size: 12.5px; color: var(--ink-soft); font-weight: 700;
  border-bottom: 1.5px solid var(--rule-strong);
}
.ar-parl-thead span:nth-child(n+3), .ar-parl-trow .ar-parl-n { text-align: right; }
.ar-parl-trow { font-size: 15px; border-bottom: 1px dashed var(--rule); }
.ar-parl-swatch { width: 11px; height: 11px; border-radius: 2px; }
.ar-parl-name { font-weight: 600; }
.ar-parl-n { color: var(--ink-soft); font-weight: 600; }
.ar-parl-tot { color: var(--ink); font-weight: 800; }
.ar-parl-foot {
  border-bottom: none; border-top: 1.5px solid var(--rule-strong);
  font-size: 14px; color: var(--ink-soft);
}
.ar-parl-foot .ar-parl-name { font-weight: 700; }

/* 총선 지역구 grid */
.ar-districts-host { display: flex; flex-direction: column; gap: 18px; }
.ar-dist-block { }
.ar-dist-sido { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.ar-dist-count { font-weight: 400; font-size: 11px; color: var(--ink-soft); margin-left: 6px; }
.ar-dist-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 10px;
}
.ar-dist-row {
  display: grid;
  grid-template-columns: 1fr auto 56px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  padding: 4px 8px;
}
.ar-dist-name { color: var(--ink-soft); font-weight: 600; }
.ar-dist-cand { font-weight: 700; }
.ar-dist-meta { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--ink-soft); text-align: right; }

/* (시도/시군구 시각화 진입은 하단 nav 센터 '더 자세히' 셀로 통합 → .ar-nav-detail) */

/* 여론조사 link 카드 — archive에 폴 N건 통계 + active이면 시각화 페이지 link */
.ar-polls-link-card {
  border: 1px solid var(--rule);
  padding: 14px 18px;
  background: var(--bg2);
}
.ar-polls-link-stat {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.ar-polls-link-stat b { color: var(--ink); font-size: 18px; font-weight: 700; margin: 0 2px; }
.ar-polls-link-row {
  display: flex; justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
}
.ar-polls-link-office { color: var(--ink-soft); }
.ar-polls-link-count { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.ar-polls-link-cta {
  display: inline-block;
  margin-top: 12px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong, var(--ink));
}
.ar-polls-link-cta:hover { color: var(--accent, #c8553d); border-color: var(--accent, #c8553d); }
.ar-polls-link-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-mute);
  font-style: italic;
}

/* 옛 데이터 source caveat — 위키 source 등 */
.ar-source-caveat {
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--bg2);
  padding: 8px 12px;
  margin: 0 0 24px;
  border-left: 2px solid var(--ink-mute);
}
.ar-source-caveat-tag {
  display: inline-block;
  font-weight: 700;
  color: var(--ink);
  margin-right: 6px;
  letter-spacing: 0.02em;
  font-size: 11px;
}

/* 재보궐 결과 mini 카드 (통합 회차 archive 안) */
.ar-by-result-card { background: var(--bg2); }
.ar-by-result-winner {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 10px; margin-top: 4px;
}
.ar-by-result-winner :nth-child(1) { flex: 1; }
.ar-by-result-second {
  font-size: 12px; color: var(--ink-soft);
  padding: 4px 10px 0;
}
.ar-by-more-link {
  display: inline-block;
  font-size: 12px; color: var(--ink); font-weight: 600;
  margin-top: 12px; padding: 6px 12px;
  border: 1px solid var(--rule);
  text-decoration: none;
}
.ar-by-more-link:hover { background: var(--bg2); }

/* 재보궐 — 광역단체장 큰 카드 (보통 1~2건) */
.ar-by-sido-host { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ar-by-sido-card { border: 1px solid var(--rule); padding: 14px 18px; }
.ar-by-sido-name { font-size: 14px; font-weight: 700; margin: 0 0 10px; color: var(--ink); }
.ar-by-sido-winner {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 12px; background: var(--bg2);
  border-radius: 2px; margin-bottom: 6px;
}
.ar-by-sido-w-name { font-size: 16px; flex: 1; }
.ar-by-sido-w-party { font-size: 11px; font-weight: 600; }
.ar-by-sido-w-pct { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ar-by-sido-second {
  display: flex; gap: 8px; font-size: 12px; color: var(--ink-soft);
  padding: 0 12px 4px;
}
.ar-by-sido-second :first-child { flex: 1; }
.ar-by-sido-second :last-child { font-variant-numeric: tabular-nums; }
.ar-by-sido-meta { font-size: 11px; color: var(--ink-soft); padding: 6px 12px 0; border-top: 1px solid var(--rule); }

/* 재보궐 — 실시 사유 */
.ar-by-reasons-host { display: flex; flex-direction: column; gap: 18px; }
.ar-rsn-block {}
.ar-rsn-kind { font-size: 13px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.ar-rsn-count { font-weight: 400; font-size: 11px; color: var(--ink-soft); margin-left: 6px; }
.ar-rsn-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 12px; }
.ar-rsn-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  font-size: 12px;
  padding: 6px 8px;
  border-left: 2px solid var(--rule);
}
.ar-rsn-loc { font-weight: 600; }
.ar-rsn-prev { font-size: 11px; color: var(--ink-soft); }
.ar-rsn-party { font-size: 11px; }
.ar-rsn-rsn { grid-column: 1 / -1; font-size: 11px; color: var(--ink); background: var(--bg3); padding: 2px 6px; border-radius: 2px; display: inline-block; justify-self: start; margin-top: 2px; }

/* 의석 예측 vs 실제 (총선 22대형) */
.ar-seat-rows { display: grid; gap: 4px; }
.ar-seat-row {
  display: grid;
  grid-template-columns: 1fr 80px 130px;
  gap: 10px;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.ar-seat-row.is-hit { border-left: 2px solid #2e7d6f; padding-left: 8px; }
.ar-seat-row.is-miss { border-left: 2px solid #c8553d; padding-left: 8px; }
.ar-seat-party { font-weight: 700; }
.ar-seat-sat { font-size: 11px; color: var(--ink-mute); font-weight: 400; }
.ar-seat-pred { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.ar-seat-actual { font-variant-numeric: tabular-nums; color: var(--ink-soft); text-align: right; }

/* 총선 출구조사 의석 덤벨 — 정당별 예측 범위 막대 + 실제 의석 ● (대선/지선 시도 덤벨과 같은 시각 언어) */
.ar-seatbar-row {
  display: grid; grid-template-columns: 124px 1fr 112px;
  gap: 10px; align-items: center; padding: 6px 12px; background: var(--bg);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.ar-seatbar-row:nth-child(even) { background: var(--bg2); }
.ar-seatbar-row.is-hit { box-shadow: inset 3px 0 0 #2e7d6f; }
.ar-seatbar-row.is-miss { background: rgba(211,47,47,0.10); box-shadow: inset 3px 0 0 #d32f2f; }
.ar-seatbar-party { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-seatbar-track { position: relative; height: 14px; background: var(--bg3); border-radius: 7px; }
.ar-seatbar-range { position: absolute; top: 0; height: 100%; border-radius: 7px; opacity: 0.4; }   /* 예측 범위 */
.ar-seatbar-dot {                                                                                    /* 실제 의석 */
  position: absolute; top: 1px; width: 12px; height: 12px; border-radius: 50%;
  transform: translateX(-50%); border: 1.5px solid var(--bg); box-shadow: 0 0 0 1.5px var(--ink);
}
.ar-seatbar-nums { text-align: right; color: var(--ink-soft); }
.ar-seatbar-nums b { color: var(--ink); font-weight: 800; }
@media (max-width: 480px) {
  .ar-seatbar-row { grid-template-columns: 84px 1fr 86px; gap: 6px; font-size: 11px; }
}

/* 출구조사 — 전국 행 강조 */
.ar-exit-row.is-nation { border-top: 1px solid var(--ink); padding-top: 6px; }
.ar-exit-row.is-nation .ar-exit-sido { color: var(--ink); }

/* 출구조사 */
.ar-exit-block { margin-bottom: 22px; }
.ar-exit-source { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.ar-exit-rows { display: grid; gap: 4px; }
.ar-exit-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--rule);
}
.ar-exit-row.is-hit { border-left: 2px solid #2e7d6f; padding-left: 8px; }
.ar-exit-row.is-miss { border-left: 2px solid #c8553d; padding-left: 8px; }
.ar-exit-sido { font-weight: 700; color: var(--ink-soft); }
.ar-exit-pred { font-weight: 700; }
.ar-exit-actual { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* 데이터 출처 line */
.ar-source-line {
  font-size: 11px;
  color: var(--ink-soft);
  margin: -6px 0 12px;
}
.ar-source-line a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); }
.ar-source-line a:hover { text-decoration-color: var(--ink); }

/* 지선 archive — 선출직 정당 분포 (4단: 광역장·기초장·광역의원·기초의원).
   메인 status 스택바와 동일: 비율 막대 + 1·2위 inline 범례 + 나머지 tail. */
.ar-offices-grid { display: grid; gap: 10px; }
.ar-office-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  column-gap: 14px;
  row-gap: 4px;
  padding: 8px 10px;
  background: var(--bg2);
  border-left: 3px solid var(--ink);
  align-items: center;
}
.ar-office-label {
  grid-column: 1; grid-row: 1 / span 2;
  align-self: center;
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.ar-office-total {
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; margin-left: 4px;
}
/* 막대·범례 내부 스타일은 common.css .sbar*/.sleg* (공용). 여기선 grid 배치만. */
.ar-office-bar { grid-column: 2; grid-row: 1; }
.ar-office-legend {
  grid-column: 2; grid-row: 2;
  display: flex; flex-wrap: wrap; gap: 2px 12px;
  font-size: 12px;
}
@media (max-width: 640px) {
  .ar-office-row { grid-template-columns: 1fr; }
  .ar-office-label { grid-column: 1; grid-row: 1; font-size: 12px; }
  .ar-office-bar { grid-column: 1; grid-row: 2; }
  .ar-office-legend { grid-column: 1; grid-row: 3; }
}

/* 의회 의석 hex cluster — 시군구별 정당별 spiral. render-council-hex.js */
.ar-council-hex { margin-top: 12px; }
.council-hex-svg { width: 100%; height: auto; max-width: 900px; display: block; margin: 0 auto; }
/* 권역(시도) 경계 — 시군구 hex 그룹 외곽선 */
/* .sido-border → components.css로 이동(폴 페이지 공용 — archive.css 미로드 대응). */
.council-turnout-cell { transition: filter .1s; }
.council-turnout-cell:hover { filter: brightness(1.12); }
/* 시군구 hex 커서추적 툴팁 */
.hex-tip { position: fixed; z-index: 2000; background: var(--ink, #0a0e1a); color: var(--bg, #fff); padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.ar-council-hex-meta {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px;
  font-size: 12px; color: var(--ink-soft);
}
.ar-council-hex-meta .ch-leg { white-space: nowrap; }
.ar-council-hex-meta .ch-leg b { font-weight: 800; margin-right: 2px; }
.ar-council-hex-meta #ar-council-hex-total { font-weight: 700; color: var(--ink); margin-right: 12px; }

/* 광역의원 시도 hex cluster — render-metro-hex.js */
.ar-metro-hex { margin-top: 12px; }
.metro-hex-svg { width: 100%; height: auto; max-width: 760px; display: block; margin: 0 auto; }
.ar-metro-hex-meta {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px;
  font-size: 12px; color: var(--ink-soft);
}
.ar-metro-hex-meta .mh-leg { white-space: nowrap; }
.ar-metro-hex-meta .mh-leg b { font-weight: 800; margin-right: 2px; }
.ar-metro-hex-meta #ar-metro-hex-total { font-weight: 700; color: var(--ink); margin-right: 12px; }

/* 시의원 당선인 list — render-winners.js */
.ar-winners-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.ar-winners-controls input, .ar-winners-controls select {
  font: inherit; font-size: 13px; padding: 4px 8px;
  border: 1px solid var(--rule-strong); background: var(--bg); color: var(--ink); border-radius: 2px;
}
.ar-winners-controls input[type=search] { min-width: 220px; }
.ar-winners-count { font-size: 12px; color: var(--ink-soft); font-weight: 700; margin-left: auto; }
.ar-winners-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: 2px; overflow: hidden;
}
.ar-winner-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 8px; align-items: center;
  padding: 6px 12px; font-size: 12px;
  background: var(--bg);
}
.ar-winner-lvl {
  font-size: 11px; font-weight: 700; color: var(--ink-soft);
  background: var(--bg2); border-radius: 3px; padding: 1px 5px; white-space: nowrap;
}
.ar-winner-loc { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-winner-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.ar-winner-party { font-weight: 600; white-space: nowrap; }
.ar-winner-pct { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 600; }
.ar-winners-more { padding: 10px; text-align: center; color: var(--ink-soft); font-size: 12px; background: var(--bg2); }
.ar-winners-hint { padding: 18px 16px; text-align: center; color: var(--ink-soft); font-size: 13px; line-height: 1.6; background: var(--bg2); border-radius: 4px; }
.ar-winners-hint b { color: var(--ink); font-weight: 700; }

/* Hero scorecard — 1당 vs 2당 의석 비교 */
/* 의회 구성 — 의석 반원(총선 아카이브). */
.ar-parliament { max-width: 460px; margin: 18px auto 6px; text-align: center; }
.ar-parliament .parliament-chart { max-width: 440px; }
.ar-pl-total { font-size: 15px; font-weight: 800; color: var(--ink); margin: 2px 0 8px; }
.ar-pl-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12px; font-variant-numeric: tabular-nums; }
.ar-pl-leg { white-space: nowrap; color: var(--ink-soft); }
.ar-pl-leg .ar-pl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; }
.ar-pl-leg b { color: var(--ink); font-weight: 800; margin-right: 1px; }

.ar-hero-scorecard {
  margin: 16px 0; padding: 14px 18px;
  border: 1px solid var(--rule); border-radius: 4px;
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
.ar-sc-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--rule);
}
.ar-sc-row:last-child { border-bottom: none; }
/* 직위 행 바로 아래 자기 '기타' 줄이 오면 그 사이 점선 제거 — 직위+기타를 한 묶음으로(구분선은 기타 줄 아래에). */
.ar-sc-row:has(+ .ar-sc-other:not([hidden])) { border-bottom: none; }
.ar-sc-other:last-child { border-bottom: none; }
.ar-sc-head, .ar-sc-foot { font-weight: 800; padding: 8px 0; border-bottom: 2px solid var(--rule-strong); }
.ar-sc-foot { border-top: 2px solid var(--rule-strong); border-bottom: none; padding-top: 12px; }
.ar-sc-num { font-size: 22px; font-weight: 800; }
.ar-sc-num-l { text-align: right; color: var(--ink); }
.ar-sc-num-r { text-align: left; color: var(--ink); }
.ar-sc-label { font-size: 12px; color: var(--ink-soft); font-weight: 600; min-width: 80px; text-align: center; }
.ar-sc-party { text-align: center; }
.ar-sc-pname { font-size: 15px; font-weight: 800; padding-bottom: 2px; }
.ar-sc-foot .ar-sc-num { font-size: 26px; }

/* === 대선 히어로 — 당선자 강조 + 구도 막대 === */
.ar-pres-sc { display: flex; flex-direction: column; gap: 10px; }
.ar-pres-winner { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.ar-pres-wname { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.ar-pres-wparty {
  font-size: 13px; font-weight: 700;
  padding: 1px 7px; border: 1.5px solid; border-radius: 3px;
}
.ar-pres-badge {
  font-size: 11px; font-weight: 800; color: #fff; background: var(--ink);
  padding: 2px 7px; border-radius: 3px; letter-spacing: 0.02em;
}
.ar-pres-wstat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.ar-pres-wpct { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ar-pres-wpct .u { font-size: 16px; font-weight: 700; margin-left: 1px; }
.ar-pres-wmeta { font-size: 13px; color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.ar-pres-racebar {
  display: flex; height: 16px; border-radius: 3px; overflow: hidden;
  background: var(--rule); margin-top: 2px;
}
.ar-pres-seg { display: block; min-width: 1px; }
.ar-pres-seg-etc { background: var(--rule-strong); }
.ar-pres-racelabs {
  display: flex; flex-wrap: wrap; gap: 3px 14px;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.ar-pres-lab b { font-weight: 700; margin-right: 3px; }
.ar-pres-lab.is-win b { font-weight: 800; }
.ar-pres-lab .u { font-size: 11px; opacity: 0.8; margin-left: 1px; }
.ar-pres-lab-etc { color: var(--ink-soft); }

.ar-hero-meta {
  display: flex; flex-wrap: wrap; gap: 16px 24px;
  margin-top: 12px;
  font-size: 13px;
}
.ar-hm-item { display: inline-flex; align-items: baseline; gap: 6px; }
.ar-hm-label { color: var(--ink-soft); font-weight: 600; }
.ar-hm-value { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Exit poll dumbbell chart */
.ar-exit-block { margin-bottom: 24px; }
.ar-exit-source {
  font-size: 14px; font-weight: 800; margin: 0 0 10px;
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline;
}
.ar-exit-hitrate { font-size: 12px; font-weight: 700; color: var(--ink); padding: 2px 8px; background: var(--bg2); border-radius: 2px; }
.ar-exit-err { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ar-exit-dumbbell { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.ar-exit-dbb {
  display: grid;
  grid-template-columns: 70px 1fr 50px 18px 50px 60px 26px;
  gap: 10px; align-items: center;
  padding: 6px 12px; background: var(--bg);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.ar-exit-dbb:nth-child(even) { background: var(--bg2); }
.ar-exit-dbb.is-hit { box-shadow: inset 3px 0 0 #2e7d6f; }
.ar-exit-dbb.is-miss { background: rgba(211,47,47,0.13); box-shadow: inset 3px 0 0 #d32f2f; }
.ar-exit-dbb.is-nation { border-top: 2px solid var(--ink); }
.ar-exit-dbb .ar-exit-sido { font-weight: 700; color: var(--ink); }
.ar-exit-track {
  position: relative; height: 14px;
  background: var(--bg3); border-radius: 7px;
}
.ar-exit-line {
  position: absolute; top: 6px; height: 2px;
  background: var(--ink-soft);
}
.ar-exit-line.is-miss { background: #d32f2f; height: 3px; top: 5.5px; }
.ar-exit-dot {
  position: absolute; top: 2px; width: 10px; height: 10px;
  border-radius: 50%; transform: translateX(-50%);
  border: 1.5px solid var(--bg);
  box-shadow: 0 0 0 1px var(--ink-soft);
}
.ar-exit-dot-pred { opacity: 0.55; }
.ar-exit-dot-actual { box-shadow: 0 0 0 1.5px var(--ink); }
.ar-exit-pred-pct, .ar-exit-actual-pct { font-weight: 700; }
.ar-exit-pred-pct { text-align: right; opacity: 0.7; }
.ar-exit-arrow { color: var(--ink-mute); text-align: center; }
.ar-exit-actual-pct { text-align: right; }
.ar-exit-diff { color: var(--ink-soft); font-size: 11px; text-align: right; }
/* 총선 지역구 의석 — 시도별 의석 spiral 지도(1석=1 hex) */
.ar-genhex-svg { display: block; width: 100%; max-width: 600px; height: auto; margin: 4px auto 0; }
/* 공유 시도 클러스터(헥스·dorling 동일 크기 → 토글 시 권역 위치 고정) */
.ar-sidocluster-svg { display: block; width: 100%; max-width: 600px; height: auto; margin: 4px auto 0; }
.ar-genhex-outline { fill: var(--bg2); stroke: var(--rule); stroke-width: 1; }
.ar-genhex-label { font-size: 12px; font-weight: 700; fill: var(--ink); pointer-events: none;
  paint-order: stroke; stroke: var(--bg); stroke-width: 2.5; }
.ar-genhex-legend { margin-top: 10px; font-size: 13px; line-height: 1.9; }
.ar-genhex-note { color: var(--ink-mute); font-size: 12px; }
/* dorling (시도별 원+파이) — 헥스 토글의 다른 보기 (대선·총선·광역의회 공용) */
.ar-dorling-svg { display: block; width: 100%; max-width: 600px; height: auto; margin: 4px auto 0; }
.ar-dorling-ring { fill: none; stroke: rgba(0,0,0,0.2); stroke-width: 1; }
.ar-dorling-label { font-size: 11px; font-weight: 700; fill: #fff; pointer-events: none;
  paint-order: stroke; stroke: rgba(0,0,0,0.4); stroke-width: 2.4; stroke-linejoin: round; }

/* 시도명 외곽 세로줄 라벨 (history 방식, councilHex·sido-map 공용) */
.hist-sido-edge-label {
  fill: var(--ink); opacity: 0.55;
  stroke: var(--bg); stroke-width: 2.5; paint-order: stroke fill;
}

.ar-exit-mark { font-weight: 800; text-align: center; font-size: 13px; }
.ar-exit-dbb.is-hit .ar-exit-mark { color: #2e7d6f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ar-exit-dbb.is-hit .ar-exit-mark { color: #5fc9b3; } }
:root[data-theme="dark"] .ar-exit-dbb.is-hit .ar-exit-mark { color: #5fc9b3; }
.ar-exit-miss-mark { color: #fff; background: #d32f2f; border-radius: 3px; padding: 1px 4px; }

@media (max-width: 480px) {
  /* Dumbbell mobile — track 영역 보존, 우측 텍스트 컴팩트 */
  .ar-exit-dbb {
    grid-template-columns: 38px 1fr 36px 36px 22px;
    gap: 6px; padding: 5px 8px; font-size: 11px;
  }
  .ar-exit-dbb .ar-exit-arrow,
  .ar-exit-dbb .ar-exit-diff { display: none; }
  .ar-exit-dbb .ar-exit-pred-pct, .ar-exit-dbb .ar-exit-actual-pct { font-size: 11px; }
  .ar-exit-source { font-size: 13px; }
  .ar-exit-hitrate { font-size: 11px; }
  .ar-exit-err { font-size: 11px; }
  .ar-exit-dot { width: 8px; height: 8px; }
  /* Hero scorecard — 모바일에서 라벨/숫자 약간 작게 */
  .ar-sc-num { font-size: 18px; }
  .ar-sc-foot .ar-sc-num { font-size: 22px; }
  .ar-sc-label { font-size: 11px; min-width: 70px; }
  .ar-hero-meta { gap: 8px 14px; font-size: 12px; }
}

/* 상단: 히어로(현재 회차 제목) 좌우에 이전·다음 회차 */
.ar-tophead {
  display: grid;
  grid-template-columns: 1fr minmax(0, 820px) 1fr;
  gap: 16px; align-items: start;
  max-width: 1180px; margin: 0 auto;
}
.ar-tophead > .ar-hero { max-width: none; margin: 0; }
/* 양옆 회차 셀을 히어로 제목 줄 높이에 맞춤 */
.ar-tophead > .ar-nav-cell { margin-top: 30px; }

/* Archive 회차 nav — 이전 · [더 자세히] · 다음 */
.ar-nav {
  display: grid; grid-template-columns: 1fr minmax(0, 1.05fr) 1fr;
  gap: 10px; margin: 24px 0; align-items: stretch;
}
.ar-nav-cell {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--rule); border-radius: 2px;
  background: var(--bg2);
  text-decoration: none; color: var(--ink);
  transition: background .12s, border-color .12s;
}
a.ar-nav-cell:hover { background: var(--bg3); border-color: var(--rule-strong); }
.ar-nav-empty {
  background: transparent; border: 1px dashed var(--rule);
  color: var(--ink-mute); text-align: center; justify-content: center;
  font-size: 12px; cursor: default;
}
.ar-nav-prev { text-align: left; }
.ar-nav-next { text-align: right; }
/* 하단 가운데: 더 자세히 — history 진입 (강조 링크) */
.ar-nav-detail {
  text-align: center; align-items: center;
  border-color: var(--rule-strong); background: var(--bg2);
}
.ar-nav-detail .ar-nav-label { color: var(--ink); letter-spacing: .03em; }
.ar-nav-detail .ar-nav-name { font-size: 15px; }
.ar-nav-detail-sub { font-size: 11px; color: var(--ink-soft); }
/* 더 자세히 없는 하단 nav(재보궐) — 2칸 */
.ar-nav-nodetail { grid-template-columns: 1fr 1fr; }
.ar-nav-label { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.ar-nav-name { font-size: 14px; font-weight: 800; color: var(--ink); }
.ar-nav-date { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  /* 좁은 화면: 상단 히어로 위로, 이전·다음은 아래에 가로로 */
  .ar-tophead { grid-template-columns: 1fr 1fr; max-width: 820px; gap: 8px; }
  .ar-tophead > .ar-hero { grid-column: 1 / -1; order: -1; }
  .ar-tophead > .ar-nav-cell { margin-top: 0; }
}
@media (max-width: 520px) {
  /* 하단 nav 세로 스택, 더 자세히를 맨 위로 */
  .ar-nav { grid-template-columns: 1fr; gap: 8px; }
  .ar-nav-detail { order: -1; }
  .ar-nav-prev, .ar-nav-next { text-align: left; }
  .ar-nav-next .ar-nav-label { text-align: left; }
  .ar-nav-name { font-size: 13px; }
}

/* === 광역단체장 hex (시·도) === */
.ar-governor-hex { width: 100%; max-width: 600px; margin: 0 auto; }
.governor-hex-svg { width: 100%; height: auto; }
.gov-hex-cell { stroke: var(--bg); stroke-width: 1.5; }
.gov-hex-cell.no-data { fill: var(--bg2); stroke: var(--rule-strong); }
.gov-hex-label { text-anchor: middle; pointer-events: none; }
.gov-hex-label.on-data { fill: var(--bg); }
.gov-hex-label.no-data { fill: var(--ink-soft); }
.gov-hex-name { fill: var(--bg); text-anchor: middle; pointer-events: none; }
.gov-hex-pct { fill: var(--bg); opacity: 0.85; text-anchor: middle; pointer-events: none; }
/* 시도 헥스/지도 토글 */
/* 방식 토글을 지도 위(우상단)로 — 포커스 보존되니 '같은 뷰를 다른 방식으로 변형'하는 인맵 컨트롤. */
:has(> .ar-sido-toggle) { position: relative; }
.ar-sido-toggle { position: absolute; top: 6px; right: 6px; z-index: 5; display: flex; flex-wrap: wrap;
  justify-content: flex-end; gap: 6px; margin: 0; }
/* 인맵 토글(우상단 절대배치)이 지도 상단·캡션을 가리지 않게 위쪽 여유 — 토글 높이(~45)+여백 */
.ar-sido-view { width: 100%; padding-top: 54px; }
/* 투표율 뷰 범례 — 절대 스케일 바 + 이 선거 범위 */
.ar-turnout-legend { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 0; font-size: 11px; color: var(--ink-soft); flex-wrap: wrap; }
.ar-turnout-bar { display: inline-block; width: 120px; height: 9px; border-radius: 5px; border: 1px solid var(--rule); }
.ar-turnout-range { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
/* .sido-map-svg/.sido-map-region → components.css(폴 공용)로 이동. 중앙 centroid 라벨만 잔존. */
.sido-map-label { fill: #fff; font-size: 11px; font-weight: 700; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,0.55); stroke-width: 2.6px; stroke-linejoin: round; }
/* 시도 비례 뷰 범례 (대선 — sidoCluster mode:proportional이 그림. 나머지 스타일은 .ar-* 공용) */
.sido-prop-legend { fill: var(--ink-soft); font-size: 9px; }
.sido-prop-legend-hex { fill: var(--ink-soft); }
.metro-hex-label { fill: var(--ink); }
.council-hex-sido-label { fill: var(--ink); opacity: 0.35; }

/* scorecard 기타 정당 line — sport-card row 아래 작은 글씨 */
.ar-sc-other {
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  padding: 2px 0 6px;
  border-bottom: 1px dashed var(--rule);
  line-height: 1.4;
}
.ar-sc-row + .ar-sc-other { border-top: none; margin-top: -4px; }
.ar-sc-oseg { font-weight: 600; }
/* 비례 시·도별 분포 맵 (총선) */
.ar-prop-map { margin-top: 22px; }
.ar-subhead { font-size: 14px; font-weight: 700; color: var(--ink-soft); margin: 0 0 10px; }
/* 대선 종합 — 시군구 1위 후보 결과 맵 */
.ar-sgg-result-host .council-hex-svg { width: 100%; height: auto; max-width: 820px; display: block; margin: 0 auto; }
.ar-sgg-result-legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.ar-sgg-result-legend .ch-leg { font-weight: 700; }

/* 시군구 결과 — 단색/격자/dorling 토글 + cartogram */
/* 버튼은 공용 .seg-btn. 방식 토글을 지도 위(우상단)로 — 인맵 컨트롤. */
:has(> .sgg-mode-toggle) { position: relative; }
.sgg-mode-toggle { position: absolute; top: 6px; right: 6px; z-index: 5; display: flex; gap: 6px; margin: 0; }
.cartogram-map { width: 100%; height: auto; max-width: 820px; display: block; margin: 0 auto; }
.sgg-result-legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.sgg-result-legend .ch-leg { font-weight: 700; }

/* 성·연령 득표 기여 (render-demographics) — 막대 길이=실측 투표자수, 채움=출구조사 구성 */
.dg-toggle { margin: 4px 0 14px; }
.dg-body { max-width: 720px; }
.dg-grouphd { font-size: 12px; font-weight: 800; color: var(--ink-soft); margin: 12px 0 4px; letter-spacing: .02em; }
.dg-grouphd:first-child { margin-top: 0; }
.dg-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; margin: 3px 0; }
.dg-rlab { font-size: 13px; font-weight: 600; color: var(--ink); text-align: right; }
.dg-rsub { display: block; font-size: 10px; font-weight: 400; color: var(--ink-mute); }
.dg-track { position: relative; display: flex; align-items: center; gap: 8px; }
.dg-bar { display: flex; height: 20px; border-radius: 3px; overflow: hidden; background: var(--bg2); min-width: 1px; }
.dg-seg { display: block; height: 100%; }
.dg-seg.dg-f { border-top: 2px solid rgba(255,255,255,0.55); }   /* 여성 세그 구분(역피벗 뷰) */
.dg-rtot { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) {
  .dg-row { grid-template-columns: 66px 1fr; gap: 6px; }
  .dg-rlab { font-size: 12px; }
}

/* 직전 대선 대비 swing — 발산형(0 기준 좌우) 막대 (render-demographics swing view) */
.dg-swing { max-width: 640px; }
.dg-srow { display: grid; grid-template-columns: 78px 1fr 54px; gap: 10px; align-items: center; margin: 3px 0; }
.dg-slab { font-size: 13px; font-weight: 600; color: var(--ink); text-align: right; }
.dg-strack { position: relative; height: 20px; background: var(--bg2); border-radius: 3px; }
.dg-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--rule-strong); }
.dg-sbar { position: absolute; top: 0; height: 100%; border-radius: 3px; min-width: 1px; }
.dg-sval { position: absolute; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dg-send { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) {
  .dg-srow { grid-template-columns: 56px 1fr 46px; gap: 6px; }
  .dg-slab { font-size: 12px; }
}

/* 성별 격차 덤벨 — 연령별 남녀 득표율 점+연결선 (render-demographics gap view) */
.dg-gap { max-width: 640px; margin-top: 4px; }
.dg-grow { display: grid; grid-template-columns: 78px 1fr 40px; gap: 10px; align-items: center; margin: 6px 0; }
.dg-gtrack { position: relative; height: 16px; }
.dg-gtrack::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule); }
.dg-gline { position: absolute; top: 50%; transform: translateY(-50%); height: 3px; background: var(--ink-mute); opacity: .45; border-radius: 2px; }
.dg-gdot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 1.5px solid var(--bg); }
.dg-gap .dg-send { text-align: right; }
@media (max-width: 560px) {
  .dg-grow { grid-template-columns: 56px 1fr 36px; gap: 6px; }
}

/* 지역 투표율 히트맵 (render-demographics region view) */
.dg-rtoggle { display: flex; gap: 4px; margin: 4px 0 10px; }
.dg-rsex { font-size: 12px; padding: 3px 10px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink-soft); border-radius: 3px; cursor: pointer; }
.dg-rsex.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.dg-heat { display: grid; gap: 2px; max-width: 560px; }
.dg-hcell { font-size: 10px; font-weight: 700; color: var(--ink-soft); text-align: center; padding: 2px 0; }
.dg-rlab2 { text-align: right; padding-right: 4px; }
.dg-hm { font-size: 10px; font-weight: 600; color: var(--ink); text-align: center; padding: 4px 0; border-radius: 2px; font-variant-numeric: tabular-nums; }
.dg-hm.dg-na { background: var(--bg2); }
