/*
 * voter2027.fr — public.css: builds on base.css's tokens/components (SPEC.md "Design").
 *
 * base.css already carries the ink-blue/warm-off-white tokens matching www/teaser/ (core aligned
 * them 2026-09-27), so colours are not redefined here. The one token this file overrides is
 * --radius-lg (base.css: 16px; teaser's cards: 12px) plus the safe-area custom properties base.css
 * does not define. Everything else below is layout/components, not colour.
 *
 * iPhone-first (SPEC.md "Design" > "iPhone first"): every component below is designed at 375px
 * first, then widened for desktop with min-width media queries. 100dvh not 100vh. Tap targets
 * >=44px. Inputs >=16px so Safari does not zoom on focus (base.css's form inputs are already
 * 1rem on a 17px body = >16px, kept as-is).
 */

/*
 * base.css's `.btn { display: inline-flex; ... }` is an author rule, and author rules always beat
 * the user-agent stylesheet's `[hidden] { display: none }` at equal specificity — so a
 * `<button class="btn" hidden>` was rendering VISIBLE (found 2026-09-27: the questionnaire's
 * "Retour" button showed on step 1, and certificate-share would have shown even without
 * navigator.share). This restores the correct behaviour for every hidden element, not just .btn.
 */
[hidden] { display: none !important; }

/* design review P2, 2026-09-27: base.css's .chip/.rank-move-group already grey out :disabled; .btn
   never had a rule at all, so a disabled primary button (e.g. "Continuer" before a theme is
   picked) rendered fully solid and clickable-looking. */
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* design review P2: footer links measured 24px tall (line-height only, no padding). */
.site-footer-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; }
.beta-banner a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; }

:root {
  --radius-lg: 12px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /*
   * Contrast tokens that flip with the theme (mirroring base.css's --color-accent-contrast
   * pattern). Design review, 2026-09-27: --color-badge-1 and --color-warn both LIGHTEN in dark
   * mode (base.css), so hardcoded white text on them (.flag-chip-fort, .demo-banner) dropped to
   * 2.6:1 / 2.25:1 in dark mode — below the 4.5:1 AA floor. Dark text on the lightened dark-mode
   * colour restores contrast in both themes.
   */
  --color-badge-1-contrast: #ffffff;
  --color-warn-contrast: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-badge-1-contrast: #2a1010;
    --color-warn-contrast: #2a1d06;
  }
}
:root[data-theme="dark"] {
  --color-badge-1-contrast: #2a1010;
  --color-warn-contrast: #2a1d06;
}

body {
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
a:active, button:active, .btn:active, .chip:active, .segbtn:active {
  transform: scale(0.98);
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  a:active, button:active, .btn:active, .chip:active, .segbtn:active { transform: none; }
}

/*
 * Header restyle to match www/teaser/'s logo mark and proportions, without touching
 * templates/layout.php (core's file — the markup itself, brand link text and nav links stay as
 * core wrote them). The ballot-box mark is a CSS mask-image so it recolours with --color-accent
 * in dark mode automatically, rather than a baked-in SVG fill.
 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  background: color-mix(in srgb, var(--color-surface) 85%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}
.site-header .wrap { padding-top: var(--safe-top); min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  background-color: var(--color-accent);
  -webkit-mask-image: url("/assets/img/ballot-icon.svg");
  mask-image: url("/assets/img/ballot-icon.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.site-footer .wrap { padding-bottom: calc(var(--space-4) + var(--safe-bottom)); }
.wrap { padding-left: max(var(--space-3), var(--safe-left)); padding-right: max(var(--space-3), var(--safe-right)); }

/* ---------------------------------------------------------------- hero / home */

/* Dense home (Hakon's feedback, 2026-09-27): hero + actions + 3 steps within ~1.3 screens at 390px. */
.hero { padding-top: var(--space-3); padding-bottom: var(--space-2); }
.hero .kicker { margin: 0 0 4px; color: var(--color-text-muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.hero h1 { font-size: 1.875rem; line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 6px; }
.hero .lead {
  max-width: 40em;
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.hero-actions .btn { height: 48px; }
.hero-secondary { font-weight: 600; font-size: 0.95rem; }

.status-strip { color: var(--color-text-muted); font-size: 0.82rem; margin: 0 0 var(--space-3); }

.home-steps { margin-bottom: var(--space-3); }
.home-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.home-steps li { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-2) var(--space-3); }
.home-steps li + li { border-top: 1px solid var(--color-border); }
.home-steps .num { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--color-accent); color: var(--color-accent-contrast); font-weight: 700; font-size: 0.85rem; margin-top: 2px; }
.home-steps h2 { margin: 0; font-size: 1rem; display: inline; }
.home-steps p { color: var(--color-text-muted); margin: 2px 0 0; font-size: 0.88rem; }

.method-rows { list-style: none; margin: 0 0 var(--space-2); padding: 0; }
.method-rows li { display: flex; align-items: center; gap: var(--space-2); padding: 6px 0; font-size: 0.92rem; border-bottom: 1px solid var(--color-border); }
.method-rows li span { flex: 1 1 0%; min-width: 0; } /* flex:1 so the text fills the remaining row width and wraps there, instead of flex:0 1 auto's max-content-then-shrink, which either overflowed or wrapped into an oddly narrow column (2026-09-27) */
.method-rows li:last-child { border-bottom: none; }
.method-rows .icon { color: var(--color-accent); flex-shrink: 0; }

/* ---------------------------------------------------------------- stepper (injected by app.js) */

/* Compact, single-row stepper (~60px): small circles + short labels beside them, "Étape X/3"
   inline at the end. Injected by app.js as the first child of <main>, which has no side gutter of
   its own (base.css's `main` sets only vertical padding), so this component supplies its own. */
.v27-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px max(var(--space-3), var(--safe-right)) 4px max(var(--space-3), var(--safe-left));
  margin: 0 0 var(--space-2);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}
.v27-stepper ol {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  min-width: 0;
  flex: 1 1 auto;
}
.v27-step { flex: 0 1 auto; min-width: 0; }
.v27-step a {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--color-text-muted);
  padding: 4px 6px;
  border-radius: 999px;
  min-height: 44px; /* design review P2: was 36px, under the tap-target floor on a per-page control */
}
.v27-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.v27-step-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 6.5em; /* comfortably fits "Comprendre", the longest of the three, at this font-size */
}
.v27-step-current a { color: var(--color-accent); }
.v27-step-current .v27-step-num { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-accent-contrast); }
.v27-step-done .v27-step-num { border-color: var(--color-accent); color: var(--color-accent); }
.v27-step-caption { flex: 0 0 auto; margin: 0 0 0 auto; font-size: 11px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; padding-left: 4px; }
.v27-resume { flex: 0 0 auto; margin: 0; font-size: 11px; }
@media (min-width: 26rem) {
  .v27-step-caption { font-size: 0.8rem; }
}

/* ---------------------------------------------------------------- sticky bottom action bar */

/*
 * Fixed (not sticky) to the viewport bottom, always in thumb reach (SPEC.md "iPhone first").
 * Because it's fixed it overlays page content, so every page that renders one also renders a
 * `.v27-actionbar-spacer` right before it (see templates/public/questionnaire.php etc.) reserving
 * real space in the flow, and app.js sizes that spacer to the bar's actual height on load/resize
 * — fixing Hakon's 2026-09-27 feedback that the bar covered the last chips and sat under the home
 * indicator.
 */
.v27-actionbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--color-border);
  padding: 10px max(var(--space-3), var(--safe-right)) calc(12px + var(--safe-bottom)) max(var(--space-3), var(--safe-left));
  display: flex;
  gap: var(--space-2);
  z-index: 20;
}
.v27-actionbar .btn { flex: 1 1 auto; }
.v27-actionbar .btn-secondary { flex: 0 0 auto; min-width: 5.5rem; }
.v27-actionbar-spacer { height: 84px; }

/* ---------------------------------------------------------------- theme chips (questionnaire step 1) */

.chip-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.55em 1.1em;
  border-radius: 999px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-contrast); }
.chip .chip-rank { display: none; }
.chip[aria-pressed="true"] .chip-rank { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--color-accent-contrast); color: var(--color-accent); font-size: 0.75rem; font-weight: 800; }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }

.theme-ranked { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.theme-ranked li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
}
.theme-ranked .rank-badge { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--color-surface-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.theme-ranked .rank-label { flex: 1 1 auto; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-move-group { display: flex; gap: 4px; flex: 0 0 auto; }
.rank-move-group button {
  width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid var(--color-border); background: var(--color-surface-2);
  color: var(--color-text); font-size: 1rem; cursor: pointer;
}
.rank-move-group button:disabled { opacity: 0.35; cursor: not-allowed; }
.rank-remove {
  width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid var(--color-border); background: transparent; color: var(--color-bad, #8a2b2b);
  font-size: 1rem; cursor: pointer; flex: 0 0 auto;
}

/* ---------------------------------------------------------------- 5-point segmented scale (axes) */

.axis-card { margin-bottom: var(--space-4); }
.axis-card .axis-question { font-weight: 700; margin-bottom: var(--space-1); }
.axis-labels { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: var(--space-2); gap: var(--space-2); }
.axis-labels span { flex: 1 1 0; }
.axis-labels span:last-child { text-align: right; }

.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: var(--space-3);
}
.segbtn {
  min-height: 44px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius);
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  font-size: 1rem;
}
.segbtn[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-contrast); }

.importance-toggle { display: flex; gap: var(--space-2); margin-bottom: var(--space-2); }
.importance-toggle button {
  flex: 1 1 0;
  min-height: 44px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
.importance-toggle button[aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-surface-2); }

.axis-explain { margin-top: var(--space-2); }
.axis-explain summary { cursor: pointer; font-size: 0.9rem; color: var(--color-link); min-height: 44px; display: flex; align-items: center; }
.axis-explain[open] summary { font-weight: 600; }
.axis-explain p { color: var(--color-text-muted); font-size: 0.92rem; }

/* ---------------------------------------------------------------- candidate result cards */

.result-note { color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: var(--space-4); }
.candidate-card { position: relative; }
.candidate-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.candidate-name { margin: 0; font-size: 1.15rem; }
.candidate-party { color: var(--color-text-muted); font-size: 0.9rem; margin: 0 0 var(--space-2); }
.accord-figure { text-align: right; flex: 0 0 auto; }
.accord-pct { font-size: 1.8rem; font-weight: 800; color: var(--color-accent); line-height: 1; }
.accord-coverage { font-size: 0.75rem; color: var(--color-text-muted); }

.score-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }

.axis-why { display: grid; gap: var(--space-2); margin: var(--space-3) 0; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .axis-why { grid-template-columns: 1fr 1fr; } }
.axis-why h4 { margin: 0 0 var(--space-1); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); }
.axis-why ul { margin: 0; padding-left: 1.1em; font-size: 0.92rem; }

.evidence-toggle summary { cursor: pointer; font-weight: 600; color: var(--color-link); min-height: 44px; display: flex; align-items: center; }
.evidence-block { border-top: 1px solid var(--color-border); margin-top: var(--space-2); padding-top: var(--space-2); }
.pledge-card { border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-2); background: var(--color-surface-2); }
.pledge-quote { font-style: italic; }
.source-list { font-size: 0.85rem; color: var(--color-text-muted); }
.source-list a { color: var(--color-text-muted); }

.empty-state { text-align: center; padding: var(--space-6) var(--space-3); color: var(--color-text-muted); }

/* ---------------------------------------------------------------- certificate */

.certificate-card {
  text-align: center;
  padding: var(--space-5) var(--space-4);
  max-width: 30rem;
  margin: 0 auto;
}
.certificate-card h1 { margin-bottom: var(--space-1); }
.certificate-qr { margin: var(--space-4) auto; width: 220px; height: 220px; }
.certificate-fineprint { font-size: 0.82rem; color: var(--color-text-muted); margin-top: var(--space-4); }
.share-row { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin: var(--space-3) 0; }
.share-row a, .share-row button { min-height: 44px; }

@media print {
  .site-header, .site-footer, .v27-stepper, .v27-actionbar, .share-row, .no-print { display: none !important; }
  body { background: #fff; }
  .certificate-card { border: none; box-shadow: none; }
}

/* ---------------------------------------------------------------- signaler / small forms */

.field-hint { font-size: 0.85rem; color: var(--color-text-muted); margin-top: -0.5rem; margin-bottom: var(--space-3); }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status[data-state="ok"] { color: var(--color-good); }
.form-status[data-state="error"] { color: var(--color-bad); }

/* ---------------------------------------------------------------- module / quiz */

.module-meta { color: var(--color-text-muted); font-size: 0.9rem; }
.module-body :is(h3, h4, h5) { margin-top: var(--space-4); }
.quiz-question { margin-bottom: var(--space-4); }
.quiz-options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--color-surface);
}
.quiz-option[aria-pressed="true"] { border-color: var(--color-accent); }
.quiz-option.is-correct { border-color: var(--color-good); background: color-mix(in srgb, var(--color-good) 12%, var(--color-surface)); }
.quiz-option.is-incorrect { border-color: var(--color-bad); background: color-mix(in srgb, var(--color-bad) 12%, var(--color-surface)); }
.quiz-explain { margin-top: var(--space-2); font-size: 0.92rem; color: var(--color-text-muted); }

.module-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.module-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 56px;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
}
.module-list .module-status { font-size: 0.8rem; color: var(--color-text-muted); flex-shrink: 0; }
.module-list .module-status[data-status="done"] { color: var(--color-good); font-weight: 700; }

/* ---------------------------------------------------------------- browse grids */

/* ---------------------------------------------------------------- demo/fixture banner */

.demo-banner {
  display: inline-block;
  background: var(--color-warn);
  color: var(--color-warn-contrast);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}

.theme-grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 40rem) { .theme-grid { grid-template-columns: 1fr 1fr; } }
.theme-grid a.card { text-decoration: none; color: inherit; display: block; }
.theme-grid p { color: var(--color-text-muted); margin: 0; }

/*
 * NOTE (2026-09-27): the canonical copies of .icon/.lvl-*/.avatar/.status-chip/.metric-chip/
 * .stacked-bar/.verif-dot/.flag-chip*/.warning-chip/.sr-only now live in scorecard.css (new file,
 * shared by /candidats and /candidat/<slug>). Both those pages passed to dedicated agents the same
 * day this file was mid-split, so — to avoid breaking either page while their $styles arrays are
 * out of my hands — the definitions below are kept here too rather than removed. Whoever wires
 * scorecard.css into those two pages' $styles can delete the duplicates below; scripts/data.php's
 * page_theme()/page_resultat() (still owned by the public builder) already load scorecard.css
 * instead of duplicating anything.
 */

/* ---------------------------------------------------------------- /candidats: dense list */

.candidate-legend { margin-bottom: var(--space-3); }
.candidate-legend summary { cursor: pointer; color: var(--color-link); font-size: 0.85rem; min-height: 32px; display: inline-flex; align-items: center; }
.candidate-legend-body { font-size: 0.82rem; color: var(--color-text-muted); padding-top: var(--space-2); }
.candidate-legend-body ul { margin: 0; padding-left: 1.1em; }

.candidate-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); grid-template-columns: 1fr; }
@media (min-width: 46rem) { .candidate-list { grid-template-columns: 1fr 1fr; } }

.candidate-row {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
}
.candidate-row-top { display: flex; align-items: center; gap: var(--space-2); }
.candidate-row-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.candidate-row-name strong { font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-row .candidate-party { font-size: 0.82rem; margin: 0; }

.candidate-row-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }

/* ---------------------------------------------------------------- /candidat/<slug> */

.candidate-header { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); }
.candidate-header-text { min-width: 0; }
.candidate-header-text h1 { margin-bottom: 2px; }
.candidate-header-text .candidate-party { margin-bottom: 4px; }

.scorecard { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-bottom: var(--space-2); }
.score-tile {
  background: color-mix(in srgb, var(--lvl, var(--color-text-muted)) 10%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--lvl, var(--color-border)) 45%, var(--color-border));
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3) var(--space-3);
}
.score-tile .icon { width: 18px; height: 18px; color: var(--lvl, var(--color-text-muted)); margin-bottom: 4px; }
.tile-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--color-text-muted); margin-bottom: 2px; }
.tile-value { font-size: 1.3rem; font-weight: 800; line-height: 1.15; }
.tile-value-muted { font-size: 0.95rem; font-weight: 600; color: var(--color-text-muted); }
.tile-sub { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 2px; }
.score-chips { margin-bottom: var(--space-3); }
.score-chips .metric-chip { --lvl: var(--color-text-muted); }

.candidate-tabs {
  position: sticky;
  top: 56px; /* below the sticky site header */
  z-index: 12;
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  background: var(--color-bg);
  padding: var(--space-2) 0;
  margin: 0 0 var(--space-3);
  border-bottom: 1px solid var(--color-border);
  -webkit-overflow-scrolling: touch;
}
.candidate-tabs a { flex: 0 0 auto; font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
.candidate-tabs a.is-active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.clamp-block { margin-bottom: var(--space-3); }
.clamp-text { color: var(--color-text-muted); }
.clamp-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-toggle { font-size: 0.85rem; }

.pledge-theme-group { border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-bottom: var(--space-2); background: var(--color-surface); }
.pledge-theme-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); font-weight: 700; min-height: 44px; }
.pledge-theme-group summary::-webkit-details-marker { display: none; }
.theme-summary-dots { display: inline-flex; gap: 3px; }
.mini-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lvl, var(--color-border)); display: inline-block; }
.pledge-card-collapsible { border-top: 1px solid var(--color-border); }
.pledge-card-collapsible summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-weight: 500;
  min-height: 44px;
}
.pledge-card-collapsible summary::-webkit-details-marker { display: none; }
.pledge-summary-text { flex: 1 1 auto; min-width: 0; }
.pledge-card-body { padding: 0 var(--space-3) var(--space-3); }

.axis-track-row { margin-bottom: var(--space-3); }
.axis-track-label { font-weight: 600; font-size: 0.9rem; margin: 0 0 2px; }
.axis-track-row .axis-labels { font-size: 0.72rem; margin-bottom: 4px; }
.axis-track { position: relative; height: 20px; background: var(--color-surface-2); border-radius: 999px; }
.axis-track-dot {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid var(--color-accent);
  background: var(--color-accent);
}
.axis-track-dot.dot-deduit { background: var(--color-surface); }
.axis-track-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; color: var(--color-text-muted); }

.outcome-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-bottom: var(--space-2); }
.outcome-chip { flex: 0 0 auto; font-weight: 700; font-size: 0.8rem; background: var(--color-surface-2); border-radius: 999px; padding: 0.15em 0.6em; }
.source-numbered { padding-left: 1.3em; font-size: 0.9rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- red-flag chips (pledge cards, scorecard, /candidats) */

.flag-chip-row { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}
.flag-chip .icon { width: 12px; height: 12px; }
.flag-chip-fort { background: var(--color-badge-1); color: var(--color-badge-1-contrast); border: 1px solid var(--color-badge-1); }
.flag-chip-fort .icon { color: var(--color-badge-1-contrast); }
.flag-chip-modere { background: transparent; color: var(--color-badge-2); border: 1px solid var(--color-badge-2); }
.flag-chip-modere .icon { color: var(--color-badge-2); }

.warning-chip { --lvl: var(--color-badge-2); }
.warning-chip.no-flags { --lvl: var(--color-text-muted); }

/* ---------------------------------------------------------------- /resultat: compact rows below the top 3 (design review P2) */

.compact-candidate-row { border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-bottom: var(--space-2); background: var(--color-surface); }
.compact-row-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  min-height: 44px;
}
.compact-row-summary::-webkit-details-marker { display: none; }
.compact-rank { flex: 0 0 auto; color: var(--color-text-muted); font-size: 0.8rem; font-weight: 700; }
.compact-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.compact-accord { flex: 0 0 auto; font-weight: 800; color: var(--color-accent); }
.compact-row-body.card { border: none; border-top: 1px solid var(--color-border); border-radius: 0; margin: 0; padding: var(--space-3); background: transparent; }

/* ---------------------------------------------------------------- /comparer */

.horizon-switch-wrap { position: relative; }
.horizon-radio { position: absolute; opacity: 0; pointer-events: none; }
.horizon-switch { display: flex; gap: 6px; margin-bottom: var(--space-3); }
.horizon-switch label {
  flex: 1 1 0;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}
#hz-5:checked ~ .horizon-switch label[for="hz-5"],
#hz-10:checked ~ .horizon-switch label[for="hz-10"],
#hz-20:checked ~ .horizon-switch label[for="hz-20"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-contrast);
}
.horizon-panel { display: none; }
#hz-5:checked ~ #panel-5,
#hz-10:checked ~ #panel-10,
#hz-20:checked ~ #panel-20 { display: block; }

.comparer-criterion-card { margin-bottom: var(--space-3); }
.comparer-baseline { background: var(--color-surface-2); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin: var(--space-2) 0; }
.comparer-baseline-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--color-text-muted); margin: 0 0 4px; }
.comparer-candidate-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.comparer-candidate-row { border-top: 1px solid var(--color-border); padding: var(--space-2) 0; }
.comparer-candidate-row summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; }
.comparer-candidate-row summary::-webkit-details-marker { display: none; }
.comparer-name { font-weight: 700; flex: 1 1 auto; min-width: 8em; }
.comparer-best-tag { font-size: 0.7rem; font-weight: 700; color: var(--color-good); border: 1px solid var(--color-good); border-radius: 999px; padding: 1px 8px; }
.comparer-reason { padding: var(--space-2) 0 0; }
