/* ============================================================
   부산 북구갑 보궐선거 예측 — 다크 대시보드
   ============================================================ */

:root {
  --bg: #0b0f1a;
  --bg-soft: #121829;
  --bg-card: #161e33;
  --bg-card-hover: #1a2440;
  --border: #243054;
  --text: #e7ecf5;
  --text-dim: #8d97b3;
  --text-faint: #5a6584;
  --accent: #6ea8ff;

  /* 후보 컬러 — 정당 톤 */
  --c-ha: #2f6fdb;       /* 민주 블루 */
  --c-ha-soft: #2f6fdb22;
  --c-han: #b5bdcc;      /* 무소속 그레이 */
  --c-han-soft: #b5bdcc22;
  --c-park: #e74c5e;     /* 국힘 레드 */
  --c-park-soft: #e74c5e22;

  --risk-yellow: #f0b429;
  --risk-red: #e74c5e;

  --shadow: 0 2px 12px rgba(0,0,0,0.35);
  --shadow-lift: 0 8px 28px rgba(0,0,0,0.45);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(47, 111, 219, 0.22), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(231, 76, 94, 0.10), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(11, 15, 26, 0.78);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06);
  display: block;
}
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--text-dim); }
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
}
.dot.live {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18); }
  50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0.0); }
}

/* ============================================================
   LAYOUT
   ============================================================ */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}
.section { margin-top: 56px; }
.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.section-sub {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero { margin-top: 32px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.countdown-card {
  background: linear-gradient(160deg, #1b2547 0%, #11182b 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.countdown-label {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.countdown-number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 88px;
  font-weight: 700;
  line-height: 1;
  margin: 8px 0 4px;
  background: linear-gradient(180deg, #ffffff 0%, #94a3c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.countdown-unit { color: var(--text-dim); font-size: 15px; }
.election-date {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

.headline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.headline-tag {
  display: inline-block;
  background: var(--c-ha-soft);
  color: var(--c-ha);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
  margin-bottom: 12px;
}
.headline-lead {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.headline-lead .lead-name { color: var(--c-ha); }
.headline-lead .lead-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 800;
}
.headline-margin {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 14px;
}
.headline-caveat {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--risk-yellow);
  font-size: 13px;
}

/* ============================================================
   CANDIDATE CARDS
   ============================================================ */
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .candidate-grid { grid-template-columns: 1fr; }
}
.candidate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: #334065;
}
.candidate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--card-color, var(--text-dim));
}
.candidate-card.leading { box-shadow: 0 0 0 1px var(--card-color, var(--accent)) inset, var(--shadow-lift); }

.cand-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cand-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cand-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--card-color, var(--border));
  background: var(--bg-soft);
}
.cand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cand-party {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
.cand-pct-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.cand-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--card-color, var(--text));
}
.cand-pct-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.cand-bar {
  margin-top: 18px;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.cand-bar-fill {
  height: 100%;
  background: var(--card-color);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.cand-foot {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.cand-foot strong { color: var(--text); font-weight: 600; }

/* ============================================================
   CHART CARDS
   ============================================================ */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.chart-card canvas {
  width: 100% !important;
  max-height: 380px;
}

/* ============================================================
   SCENARIO NOTES
   ============================================================ */
.scenario-notes {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.scenario-notes li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--c-ha);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-dim);
}
.scenario-notes li strong { color: var(--text); }

/* ============================================================
   METHODOLOGY
   ============================================================ */
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .method-grid { grid-template-columns: 1fr; }
}
.method-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.method-step {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(110, 168, 255, 0.10);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.method-card h3 {
  margin: 12px 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.method-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 14px;
}
.method-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.num-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--text);
}

/* ============================================================
   ASSUMPTION TABLE
   ============================================================ */
.assumption-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.assump-row {
  display: grid;
  grid-template-columns: 2.4fr 1fr 0.7fr;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  align-items: center;
}
.assump-row:last-child { border-bottom: none; }
.assump-row.header {
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.risk {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.risk.yellow { background: rgba(240, 180, 41, 0.15); color: var(--risk-yellow); }
.risk.red { background: rgba(231, 76, 94, 0.15); color: var(--risk-red); }
.risk.green { background: rgba(74, 222, 128, 0.15); color: #4ade80; }

/* ============================================================
   CONTEXT
   ============================================================ */
.context-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .context-grid { grid-template-columns: 1fr; }
}
.context-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.context-card h3 {
  font-size: 16px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.context-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
}
.context-card strong { color: var(--text); font-weight: 600; }

/* ============================================================
   PLOT GRID
   ============================================================ */
.plot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .plot-grid { grid-template-columns: 1fr; }
}
.plot-grid figure {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow: hidden;
}
.plot-grid img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: white;
}
.plot-grid figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* ============================================================
   SHY CONSERVATIVE
   ============================================================ */
.shy-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.2fr;
  gap: 16px;
}
@media (max-width: 880px) {
  .shy-grid { grid-template-columns: 1fr; }
}
.shy-big-card,
.shy-method-card,
.shy-impact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.shy-big-card {
  background: linear-gradient(160deg, #2a1e34 0%, #1a1a2e 100%);
  border-color: #5a3068;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.shy-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.shy-number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.05;
  margin: 10px 0 6px;
  background: linear-gradient(180deg, #f0b429 0%, #e88a3c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.shy-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.shy-confidence {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-faint);
  width: 100%;
}
.shy-confidence strong { color: var(--text); font-weight: 600; }
.shy-h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.shy-evidence {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-dim);
}
.shy-evidence li {
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.shy-evidence li:last-child { border-bottom: none; }
.shy-year {
  font-weight: 600;
  color: var(--text);
}
.shy-delta {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  background: rgba(240, 180, 41, 0.12);
  color: var(--risk-yellow);
  border: 1px solid rgba(240, 180, 41, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}
.shy-formula {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.shy-formula strong { color: var(--risk-yellow); }
.shy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.shy-table th, .shy-table td {
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
}
.shy-table th {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-align: left;
}
.shy-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.shy-table td.delta { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.shy-table td.delta.pos { color: #4ade80; }
.shy-table td.delta.neg { color: var(--c-park); }
.shy-table td.delta.neutral { color: var(--text-dim); }
.shy-cand-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.shy-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}
.shy-pill {
  background: rgba(240, 180, 41, 0.18) !important;
  border-color: rgba(240, 180, 41, 0.5) !important;
  color: var(--risk-yellow) !important;
}

/* ============================================================
   LEAN BADGES (used in polls + sources)
   ============================================================ */
.lean-badge,
.src-tag.lean-right,
.src-tag.lean-left,
.src-tag.lean-center,
.src-tag.lean-centerleft,
.num-pill.lean-right,
.num-pill.lean-left,
.num-pill.lean-centerleft {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  font-family: 'Pretendard', sans-serif;
}
.lean-badge.lean-right, .src-tag.lean-right, .num-pill.lean-right {
  background: rgba(231,76,94,0.14); color: var(--c-park); border-color: rgba(231,76,94,0.35);
}
.lean-badge.lean-left, .src-tag.lean-left, .num-pill.lean-left {
  background: rgba(47,111,219,0.16); color: var(--c-ha); border-color: rgba(47,111,219,0.4);
}
.lean-badge.lean-centerleft, .src-tag.lean-centerleft, .num-pill.lean-centerleft {
  background: rgba(110,168,255,0.12); color: var(--accent); border-color: rgba(110,168,255,0.35);
}
.lean-badge.lean-center, .src-tag.lean-center {
  background: rgba(181,189,204,0.15); color: var(--c-han); border-color: rgba(181,189,204,0.4);
}
.poll-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.method-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 880px) {
  .method-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .method-grid-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   POLLS COMPACT GRID (dynamic from app.js)
   ============================================================ */
.poll-grid-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 880px) {
  .poll-grid-compact { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .poll-grid-compact { grid-template-columns: 1fr; }
}
.poll-card-c {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  position: relative;
  transition: transform 0.15s, border-color 0.15s;
}
.poll-card-c:hover {
  transform: translateY(-1px);
  border-color: #334065;
}
.poll-card-c.hilite {
  border-color: var(--c-han);
  box-shadow: 0 0 0 1px var(--c-han) inset;
}
.pc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.pc-source {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-meta {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.pc-weight {
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
}
.pc-bars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pc-bars .pb {
  font-size: 11px;
  padding: 3px 7px;
}
.pc-bars .pb.lead {
  font-weight: 700;
  border: 1px solid currentColor;
}
.pc-flag {
  margin-top: 8px;
  font-size: 11px;
  color: var(--c-han);
  font-weight: 600;
}

/* ============================================================
   POLLS COMPARISON
   ============================================================ */
.poll-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .poll-grid { grid-template-columns: 1fr; }
}
.poll-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
}
.poll-card.hilite {
  border-color: var(--c-han);
  box-shadow: 0 0 0 1px var(--c-han) inset, 0 8px 24px rgba(181,189,204,0.08);
}
.poll-card.current {
  border-color: var(--accent);
}
.poll-head { margin-bottom: 12px; }
.poll-source {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.poll-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.pill-now {
  font-size: 10px;
  font-weight: 700;
  background: rgba(110,168,255,0.15);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.poll-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px dashed var(--border);
}
.poll-row.hl {
  background: rgba(181,189,204,0.06);
  border-radius: 8px;
  padding: 8px 8px;
  margin: 4px -8px;
  border-top: none;
}
.poll-mode {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.poll-mode.hl-label { color: var(--c-han); }
.poll-bars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pb {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.pb.ha { background: var(--c-ha-soft); color: var(--c-ha); }
.pb.han { background: var(--c-han-soft); color: var(--c-han); }
.pb.park { background: var(--c-park-soft); color: var(--c-park); }
.pb.win {
  border-color: currentColor;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(181,189,204,0.18);
}
.poll-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--c-han);
  background: rgba(181,189,204,0.08);
  padding: 8px 12px;
  border-radius: 8px;
  line-height: 1.5;
}
.poll-note strong { color: #fff; }

.poll-channela {
  margin-top: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--radius);
}
.ca-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.poll-channela p {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}
.poll-channela strong { color: var(--text); font-weight: 600; }

/* ============================================================
   SOURCES SECTION
   ============================================================ */
.sources .src-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.src-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.src-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.src-list li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
}
.src-list li:last-child { border-bottom: none; }
.src-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.src-list a:hover { border-bottom-color: var(--accent); }
.src-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.src-tag.hl {
  color: var(--c-han);
  border-color: var(--c-han);
  background: rgba(181,189,204,0.10);
  font-weight: 600;
}
.src-tag.now {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(110,168,255,0.08);
}
.src-list.compact li {
  color: var(--text-dim);
  font-size: 13px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  margin-top: 80px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-dim);
}
.footer-col li { padding: 4px 0; }
.footer-col p { font-size: 13px; color: var(--text-dim); margin: 0; }
.footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  position: sticky;
  top: 64px;
  z-index: 9;
  backdrop-filter: blur(16px);
  background: rgba(11, 15, 26, 0.86);
  border-bottom: 1px solid var(--border);
}
.tabs-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-inner::-webkit-scrollbar { display: none; }
.tab-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 18px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease-out; }
.tab-panel.active > .section:first-of-type,
.tab-panel.active > .hero:first-of-type { margin-top: 8px; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 760px) {
  .tab-btn { font-size: 13px; padding: 12px 12px; }
}

/* ============================================================
   QUICK EXPLAIN CARD
   ============================================================ */
.quick-explain { margin-top: 32px; }
.quick-card {
  background: linear-gradient(140deg, rgba(110, 168, 255, 0.10) 0%, rgba(110, 168, 255, 0.02) 100%);
  border: 1px solid rgba(110, 168, 255, 0.28);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.quick-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.quick-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
}
.quick-card strong { color: var(--accent); font-weight: 700; }

/* ============================================================
   GLOSSARY (쉬운 용어 설명)
   ============================================================ */
.glossary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 760px) {
  .glossary { grid-template-columns: 1fr; }
}
.glossary-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.glossary-term {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.glossary-def {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.65;
}
.glossary-def strong { color: var(--text); font-weight: 600; }
.glossary-def em { color: var(--accent); font-style: normal; font-weight: 600; }

/* ============================================================
   TOPBAR: brand link + race switch (per-election pages)
   ============================================================ */
.brand-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.brand-link:hover .brand-title { color: var(--accent); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.race-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}
.race-switch:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(110, 168, 255, 0.06);
}
@media (max-width: 640px) {
  .race-switch { display: none; }
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.landing-hero {
  text-align: center;
  margin-bottom: 48px;
}
.landing-h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}
.landing-sub {
  font-size: 16px;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}
.landing-sub strong { color: var(--text); font-weight: 700; }

.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 56px;
}
@media (max-width: 820px) {
  .landing-grid { grid-template-columns: 1fr; }
  .landing-h1 { font-size: 28px; }
}

.race-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}
.race-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-grad, none);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.race-seoul { --card-grad: linear-gradient(140deg, #2f6fdb33, transparent 60%); }
.race-busan { --card-grad: linear-gradient(140deg, #e74c5e33, transparent 60%); }

.race-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}
.race-card > * { position: relative; z-index: 1; }

.race-card-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.race-card-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.race-card-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: -8px;
}

.race-card-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.race-card-vs.vs-three {
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 6px;
}
.vs-cand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.vs-cand img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.10);
}
.vs-three .vs-cand img { width: 52px; height: 52px; }
.vs-name {
  font-size: 14px;
  font-weight: 700;
}
.vs-three .vs-name { font-size: 13px; }
.vs-party {
  font-size: 11px;
  font-weight: 600;
}
.vs-divider {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.race-card-cta {
  margin-top: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.landing-method {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 32px;
}
.landing-method h2 {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.method-bullets {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
}
.method-bullets strong { color: var(--text); font-weight: 700; margin-right: 4px; }
