/* ============================================================
   Compass prototype styles (shared by compass-a.html / compass-b.html)
   Relies on styles.css for theme vars (:root / html.dark), fonts,
   .party-page-bar, .language-switch, .dark-toggle, .back-link.
   All prototype-specific classes are prefixed .cp-
   ============================================================ */

.cp-wrap { max-width: 1140px; margin: 0 auto; padding: 22px 20px 80px; }
.cp-head { margin: 0 0 6px; }
.cp-head h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin: 0 0 6px; letter-spacing: -0.01em; }
.cp-lede { color: var(--muted); max-width: 70ch; margin: 0 0 18px; }
.cp-proto-tag {
  display: inline-block; margin-left: 10px; vertical-align: middle;
  font-size: 0.62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: rgba(36,87,166,0.12); color: var(--blue);
}

/* ---------- result hero ---------- */
.cp-result {
  position: relative; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.cp-result::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 6px;
  background: var(--accent, var(--blue)); transition: background .35s ease;
}
.cp-result-lead { display: flex; align-items: center; gap: 16px; min-width: 260px; }
.cp-result-badge {
  width: 64px; height: 64px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.5rem; color: #fff;
  background: var(--accent, var(--blue)); transition: background .35s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.cp-result-meta { display: flex; flex-direction: column; gap: 2px; }
.cp-result-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.cp-result-name { font-size: 1.5rem; font-weight: 900; line-height: 1.1; }
.cp-result-name a { text-decoration: none; }
.cp-result-pct { font-variant-numeric: tabular-nums; }
.cp-result-pct b { color: var(--accent, var(--blue)); transition: color .35s ease; }
.cp-podium-mini { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.cp-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px 7px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font-size: 0.82rem; font-weight: 700; white-space: nowrap;
}
.cp-chip .cp-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.cp-chip .cp-chip-pct { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- presets (persona cards) ---------- */
.cp-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.cp-card {
  --hl: #6366f1;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  padding: 12px 12px 14px; text-align: center; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.cp-card:hover { transform: translateY(-3px); border-color: var(--hl); }
.cp-card.active { border-color: var(--hl); box-shadow: 0 0 0 3px rgba(99,102,241,0.25); }
/* square avatar tile: width == height, fills the card */
.cp-card img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  border-radius: 12px; border: 3px solid var(--line); margin-bottom: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cp-card:hover img { border-color: var(--hl); }
.cp-card.active img { border-color: var(--hl); box-shadow: 0 0 0 3px rgba(99,102,241,0.32); }
.cp-card-name { display: block; font-weight: 800; font-size: 0.98rem; }
.cp-card-tag { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 3px; line-height: 1.3; }

/* ---------- main grid: controls | viz ---------- */
.cp-main { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.cp-panel {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow); padding: 18px;
}
.cp-panel-title { font-size: 0.78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.cp-viz { position: sticky; top: 16px; }

/* ---------- sliders with party tick-marks ---------- */
.cp-axis { padding: 13px 0; border-bottom: 1px solid var(--line); }
.cp-axis:first-of-type { padding-top: 2px; }
.cp-axis:last-child { border-bottom: none; padding-bottom: 2px; }
.cp-axis-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.cp-axis-swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--ax); flex: none; }
.cp-axis-name { font-weight: 800; font-size: 0.96rem; }
.cp-axis-val {
  margin-left: auto; min-width: 38px; text-align: center;
  font-weight: 800; font-variant-numeric: tabular-nums; font-size: 0.82rem;
  padding: 3px 8px; border-radius: 7px; color: #fff; background: var(--ax);
}

.cp-slider-wrap { position: relative; padding: 6px 0 2px; }
.cp-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 6px;
  background: var(--line); outline: none; cursor: pointer; margin: 0; position: relative; z-index: 2;
}
.cp-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--ax); cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25); transition: transform .1s ease;
}
.cp-range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.12); }
.cp-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--ax);
  cursor: grab; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
/* party tick-marks overlaid on the track */
.cp-ticks { position: absolute; left: 11px; right: 11px; top: 50%; height: 0; z-index: 1; pointer-events: none; }
.cp-tick {
  position: absolute; top: -10px; width: 3px; height: 20px; border-radius: 2px;
  transform: translateX(-50%); opacity: 0.7; pointer-events: auto; cursor: help;
}
.cp-tick:hover { opacity: 1; height: 26px; top: -13px; }
.cp-poles { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 0.74rem; color: var(--muted); }
.cp-poles span:last-child { text-align: right; }

.cp-prio { display: flex; align-items: center; gap: 6px; margin-top: 11px; }
.cp-prio-label { font-size: 0.74rem; color: var(--muted); margin-right: 3px; }
.cp-prio-dot {
  width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; padding: 0; transition: background .12s ease, transform .1s ease;
}
.cp-prio-dot:hover { transform: scale(1.15); }
.cp-prio-dot.on { background: var(--gold); border-color: var(--gold); }

.cp-reset {
  margin-top: 14px; width: 100%; padding: 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 800; cursor: pointer;
}
.cp-reset:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- radar ---------- */
.cp-radar-svg { width: 100%; height: auto; display: block; }
.cp-radar-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.cp-radar-spoke { stroke: var(--line); stroke-width: 1; }
.cp-radar-label { fill: var(--muted); font-size: 12px; font-weight: 800; }
.cp-radar-poly { stroke-linejoin: round; transition: opacity .2s ease; }

/* ---------- 2-D plane (Direction B) ---------- */
.cp-view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.cp-view-btn { display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); padding: 7px 13px; border-radius: 7px; cursor: pointer; transition: background .12s ease, color .12s ease; }
.cp-view-btn svg { width: 19px; height: 19px; display: block; }
.cp-view-btn:hover { color: var(--ink); }
.cp-view-btn.active { background: var(--blue); color: #fff; }

/* axis-switching badges (replace the X/Y select boxes) */
.cp-axisbars { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.cp-axisbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cp-axisbar-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; color: var(--muted); flex: none; }
.cp-axisbar-icon svg { width: 17px; height: 17px; }
.cp-axis-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-axis-badge {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font: inherit; font-weight: 700; font-size: 0.78rem; padding: 5px 11px; border-radius: 999px;
  cursor: pointer; transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.cp-axis-badge:hover:not(.disabled) { border-color: var(--blue); color: var(--blue); }
.cp-axis-badge.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.cp-axis-badge.disabled { opacity: 0.35; cursor: not-allowed; }

.cp-plane {
  position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(0deg, rgba(36,87,166,0.05), rgba(36,87,166,0.05)) ,
    var(--surface);
  overflow: hidden;
}
.cp-plane-quad { position: absolute; inset: 0; }
.cp-plane-quad::before, .cp-plane-quad::after { content: ""; position: absolute; background: var(--line); }
.cp-plane-quad::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-0.5px); }
.cp-plane-quad::after { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-0.5px); }
.cp-plane-glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(160px 160px at var(--ux,50%) var(--uy,50%), rgba(31,138,76,0.18), transparent 70%);
  transition: background .35s ease; }
.cp-plane-poles { position: absolute; inset: 0; pointer-events: none; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.cp-pole { position: absolute; white-space: nowrap; opacity: 0.8; }
.cp-pole.top { top: 6px; left: 50%; transform: translateX(-50%); }
.cp-pole.bottom { bottom: 6px; left: 50%; transform: translateX(-50%); }
.cp-pole.left { left: 8px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: left center; }
.cp-pole.right { right: 8px; top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: right center; }

.cp-pdot {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3); cursor: pointer; z-index: 2;
  transition: left .35s ease, top .35s ease, width .12s ease, height .12s ease;
}
.cp-pdot:hover { width: 22px; height: 22px; z-index: 5; }
.cp-pdot .cp-pdot-label {
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  background: var(--ink); color: var(--surface); font-size: 0.7rem; font-weight: 700;
  padding: 2px 6px; border-radius: 5px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.cp-pdot:hover .cp-pdot-label { opacity: 1; }
.cp-you {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  background: #1f8a4c; border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(31,138,76,0.25), 0 0 16px 3px rgba(31,138,76,0.55);
  transition: left .35s cubic-bezier(.34,1.3,.5,1), top .35s cubic-bezier(.34,1.3,.5,1);
}
.cp-you::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(31,138,76,0.5); animation: cp-pulse 1.8s ease-out infinite; }
@keyframes cp-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.1); opacity: 0; } }

/* ---------- match results (full-width payoff) ---------- */
.cp-results { margin-top: 26px; }
.cp-results h2 { font-size: 1.2rem; margin: 0 0 4px; }
.cp-results-hint { color: var(--muted); font-size: 0.86rem; margin: 0 0 16px; }
.cp-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.cp-podium-card {
  position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  padding: 16px; box-shadow: var(--shadow); cursor: pointer; overflow: hidden;
  transition: transform .12s ease;
}
.cp-podium-card:hover { transform: translateY(-2px); }
.cp-podium-card .cp-rank { position: absolute; top: 10px; right: 14px; font-size: 1.8rem; font-weight: 900; color: var(--line); }
.cp-podium-card.is-1 { border-color: var(--pcol); box-shadow: 0 0 0 2px var(--pcol), var(--shadow); }
.cp-podium-top { display: flex; align-items: center; gap: 10px; }
.cp-podium-top .cp-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--pcol); flex: none; }
.cp-podium-name { font-weight: 800; font-size: 1rem; }
.cp-podium-name a { text-decoration: none; }
.cp-podium-pct { margin-top: 12px; font-size: 2rem; font-weight: 900; color: var(--pcol); font-variant-numeric: tabular-nums; line-height: 1; }
.cp-podium-bar { margin-top: 8px; height: 7px; background: var(--line); border-radius: 5px; overflow: hidden; }
.cp-podium-bar > span { display: block; height: 100%; background: var(--pcol); border-radius: 5px; transition: width .5s cubic-bezier(.3,1,.4,1); }

.cp-matchrow {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px;
  border: 1px solid transparent; cursor: pointer;
}
.cp-matchrow:hover { background: rgba(36,87,166,0.06); }
.cp-matchrow.on { border-color: var(--line); background: var(--paper); }
.cp-matchrow .cp-rank-sm { width: 22px; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.cp-matchrow .cp-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.cp-matchrow .cp-mname { font-weight: 700; min-width: 130px; }
.cp-matchrow .cp-mname a { text-decoration: none; }
.cp-matchrow .cp-mbar { flex: 1; height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.cp-matchrow .cp-mbar > span { display: block; height: 100%; border-radius: 6px; transition: width .5s cubic-bezier(.3,1,.4,1); }
.cp-matchrow .cp-mpct { width: 44px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* clickable ballot-letter chip -> party profile (the dedicated nav target) */
.cp-ballot {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 34px; height: 28px; padding: 0 8px; border-radius: 8px;
  background: var(--bcol, #888); color: #fff; font-weight: 800; font-size: 0.86rem;
  text-decoration: none; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .1s ease, box-shadow .15s ease, filter .15s ease;
}
.cp-ballot:hover { transform: translateY(-1px) scale(1.07); box-shadow: 0 3px 9px rgba(0,0,0,.34); filter: brightness(1.06); }
.cp-ballot:active { transform: scale(.97); }
.cp-podium-top .cp-ballot { min-width: 40px; height: 32px; font-size: 0.95rem; }

.cp-caveat { font-size: 0.78rem; color: var(--muted); margin-top: 26px; max-width: 80ch; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cp-main { grid-template-columns: 1fr; }
  .cp-viz { position: static; }
  .cp-presets { grid-template-columns: repeat(2, 1fr); }
  .cp-podium { grid-template-columns: 1fr; }
  .cp-podium-card .cp-rank { font-size: 1.4rem; }
}
@media (max-width: 520px) {
  .cp-result { flex-direction: column; align-items: flex-start; }
  .cp-podium-mini { margin-left: 0; }
}

/* ---------- slide-in party panel ---------- */
.cp-drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.cp-drawer.hidden { display: none; }
.cp-drawer-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.5); animation: cpFade .18s ease; }
.cp-drawer-panel {
  position: relative; width: min(420px, 92vw); max-width: 92vw; height: 100%;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0,0,0,.22); display: flex; flex-direction: column;
  animation: cpSlideIn .22s cubic-bezier(.3,1,.4,1);
}
@keyframes cpSlideIn { from { transform: translateX(28px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes cpFade { from { opacity: 0; } to { opacity: 1; } }
.cp-drawer-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cp-drawer-nav, .cp-drawer-close {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); color: var(--ink); font-size: 1.2rem; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.cp-drawer-nav:hover:not(:disabled), .cp-drawer-close:hover { background: var(--line); }
.cp-drawer-nav:disabled { opacity: .35; cursor: default; }
.cp-drawer-close { margin-left: auto; font-size: 1.5rem; }
.cp-drawer-body { padding: 16px 18px 28px; overflow-y: auto; flex: 1; }

.cp-panel-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.cp-panel-ballot { min-width: 46px; height: 38px; font-size: 1.05rem; }
.cp-panel-titles { min-width: 0; }
.cp-panel-name { margin: 0; font-size: 1.18rem; font-weight: 900; line-height: 1.15; }
.cp-panel-heb { display: block; color: var(--muted); font-size: .92rem; margin-top: 2px; }
.cp-panel-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.cp-panel-status, .cp-panel-seats { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.cp-panel-score { text-align: right; }
.cp-panel-pct { display: block; font-size: 1.7rem; font-weight: 900; color: var(--pcol, var(--blue)); line-height: 1; font-variant-numeric: tabular-nums; }
.cp-panel-rank { font-size: .72rem; color: var(--muted); white-space: nowrap; }

.cp-panel-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.cp-panel-cmp { margin-bottom: 16px; }
.cp-cmp-row { display: grid; grid-template-columns: 88px 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.cp-cmp-name { font-size: .82rem; font-weight: 700; }
.cp-cmp-track { position: relative; height: 10px; background: var(--line); border-radius: 6px; }
.cp-cmp-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 6px; opacity: .85; transition: width .4s cubic-bezier(.3,1,.4,1); }
.cp-cmp-you { position: absolute; top: -3px; width: 3px; height: 16px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); box-shadow: 0 0 0 2px var(--surface); transition: left .25s ease; }
.cp-cmp-tag { font-size: .67rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.cp-cmp-close { background: rgba(31,138,76,.16); color: #1f8a4c; }
.cp-cmp-partial { background: rgba(191,122,26,.18); color: #a86a13; }
.cp-cmp-far { background: rgba(182,69,61,.16); color: #b6453d; }
.cp-cmp-legend { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--muted); margin: 10px 0 0; }
.cp-cmp-legend-fill { width: 14px; height: 8px; border-radius: 3px; opacity: .85; display: inline-block; }
.cp-cmp-legend-you { width: 3px; height: 14px; border-radius: 2px; background: var(--ink); display: inline-block; margin-left: 8px; }

.cp-panel-pos { font-weight: 700; font-size: .9rem; margin: 0 0 8px; }
.cp-panel-leader { font-weight: 400; color: var(--muted); }
.cp-panel-summary { font-size: .88rem; color: var(--ink); margin: 0 0 10px; line-height: 1.5; }
.cp-panel-plans { margin: 0 0 12px; padding-left: 18px; font-size: .85rem; color: var(--muted); }
.cp-panel-plans li { margin-bottom: 5px; line-height: 1.4; }
.cp-panel-quote { margin: 0 0 14px; padding: 10px 12px; border-left: 3px solid var(--pcol, var(--blue)); background: var(--paper); border-radius: 0 8px 8px 0; }
.cp-panel-quote blockquote { margin: 0; font-size: .86rem; font-style: italic; line-height: 1.45; }
.cp-panel-quote figcaption { margin-top: 6px; font-size: .72rem; color: var(--muted); }

.cp-panel-actions { display: flex; gap: 10px; margin-top: 6px; }
.cp-panel-radar { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-weight: 700; font-size: .82rem; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.cp-panel-radar.on { background: rgba(31,138,76,.14); border-color: #1f8a4c; color: #1f8a4c; }
.cp-panel-full { flex: 1; padding: 10px; border-radius: 10px; background: var(--ink); color: var(--surface); font-weight: 800; font-size: .82rem; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.cp-panel-full:hover { filter: brightness(1.12); }

@media (max-width: 520px) {
  .cp-drawer-panel { width: 100%; max-width: 100%; }
}

/* ---------- quiz button ---------- */
.cp-lede-row {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin: 0 0 18px;
}
.cp-lede-row .cp-lede { margin: 0; }
.cp-quiz-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 0.84rem; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
  flex-shrink: 0;
}
.cp-quiz-btn:hover { background: var(--line); border-color: var(--muted); transform: translateY(-1px); }

/* ---------- quiz modal ---------- */
.quiz-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  animation: qmFadeIn .2s ease;
}
.quiz-modal.hidden { display: none; }
@keyframes qmFadeIn { from { opacity: 0; } to { opacity: 1; } }

.quiz-modal-inner {
  position: relative; width: 94vw; max-width: 600px; max-height: 88vh;
  overflow-y: auto; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  padding: 32px 28px 28px;
  animation: qmSlideUp .25s cubic-bezier(.34,1.3,.5,1);
}
@keyframes qmSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.quiz-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 1.6rem; color: var(--muted); cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background .12s ease, color .12s ease;
}
.quiz-close:hover { background: rgba(0,0,0,0.08); color: var(--ink); }

.quiz-content h2 { font-size: 1.3rem; margin: 0 0 6px; }
.quiz-content .quiz-disclaimer { font-size: 0.82rem; color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.quiz-progress { height: 6px; background: var(--line); border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
.quiz-progress-bar { height: 100%; background: var(--blue); border-radius: 4px; transition: width .3s ease; }
.quiz-counter { font-size: 0.78rem; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.quiz-question { font-size: 1.05rem; font-weight: 800; margin: 0 0 16px; line-height: 1.4; }
.quiz-answers { display: flex; flex-direction: column; gap: 8px; }
.quiz-answer {
  display: block; width: 100%; text-align: left; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
  transition: border-color .12s ease, background .12s ease, transform .08s ease;
}
.quiz-answer:hover { border-color: var(--blue); background: rgba(36,87,166,0.08); transform: translateX(3px); }
.quiz-answer.selected { border-color: var(--blue); background: rgba(36,87,166,0.14); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 20px; gap: 12px; }
.quiz-nav button {
  padding: 10px 22px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  transition: background .12s, color .12s;
}
.quiz-nav button:hover { border-color: var(--blue); color: var(--blue); }
.quiz-nav button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.quiz-nav button.primary:hover { background: #1a4588; }
.quiz-nav button:disabled { opacity: .4; cursor: not-allowed; }

/* quiz results */
.quiz-axes { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.quiz-axis-row { display: flex; align-items: center; gap: 10px; }
.quiz-axis-name { width: 100px; font-weight: 700; font-size: .84rem; flex-shrink: 0; }
.quiz-axis-track { flex: 1; height: 8px; background: var(--line); border-radius: 5px; overflow: hidden; }
.quiz-axis-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.quiz-axis-val { width: 32px; font-weight: 800; font-size: .84rem; text-align: right; font-variant-numeric: tabular-nums; }

.quiz-top3 { display: flex; flex-direction: column; gap: 6px; }
.quiz-party-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); }
.quiz-party-rank { width: 20px; font-weight: 800; color: var(--muted); text-align: center; }
.quiz-party-name { font-weight: 700; min-width: 100px; font-size: .9rem; }
.quiz-party-bar { flex: 1; height: 7px; background: var(--line); border-radius: 5px; overflow: hidden; }
.quiz-party-bar > span { display: block; height: 100%; border-radius: 5px; }
.quiz-party-pct { width: 44px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; font-size: .9rem; }

/* Supporter quote shown under the quiz's top match (sourced, verified only). */
.cp-quote { margin: 18px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--qcol, var(--blue)); border-radius: 10px; background: var(--bg-soft, rgba(0,0,0,.02)); }
.cp-quote-head { font-size: .74rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--qcol, var(--muted)); margin: 0 0 6px; }
.cp-quote-text { margin: 0; font-size: .95rem; line-height: 1.5; font-style: italic; }
.cp-quote-by { margin: 8px 0 0; font-size: .78rem; color: var(--muted); }
.cp-quote-src { font-weight: 700; white-space: nowrap; }
