/* =========================================================================
   election.nsi.xyz — Material Design 3
   Jetons, typographie, composants. Aucune police distante, aucun appel
   réseau. Les composants rendent dans le DOM clair : cette feuille les
   atteint directement (voir src/ui/base.ts).
   ========================================================================= */

/* ========================================================== 1. jetons */
:root {
  color-scheme: light dark;

  --md-ref-typeface-plain: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --md-ref-typeface-brand: var(--md-ref-typeface-plain);

  /* Jeu de couleurs clair (baseline Material 3) */
  --md-sys-color-primary: #6750a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #eaddff;
  --md-sys-color-on-primary-container: #21005d;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary-container: #1d192b;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #ffd8e4;
  --md-sys-color-on-tertiary-container: #31111d;
  --md-sys-color-error: #b3261e;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #f9dedc;
  --md-sys-color-on-error-container: #410e0b;
  --md-sys-color-success: #1b6b3a;
  --md-sys-color-success-container: #c8f0d4;
  --md-sys-color-on-success-container: #06281a;
  --md-sys-color-surface: #fef7ff;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-surface-variant: #e7e0ec;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f7f2fa;
  --md-sys-color-surface-container: #f3edf7;
  --md-sys-color-surface-container-high: #ece6f0;
  --md-sys-color-surface-container-highest: #e6e0e9;
  --md-sys-color-outline: #79747e;
  --md-sys-color-outline-variant: #cac4d0;
  --md-sys-color-inverse-surface: #322f35;
  --md-sys-color-inverse-on-surface: #f5eff7;

  --app-max: 1200px;
  --app-gap: 20px;
  --app-radius: 22px;
  --app-radius-sm: 14px;
  --app-radius-xs: 10px;
  --app-tap: 48px;
  --app-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --app-shadow-2: 0 2px 6px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --app-shadow-3: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Jeu sombre — maintenir strictement en phase avec [data-theme='dark']. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --md-sys-color-primary: #d0bcff;
    --md-sys-color-on-primary: #381e72;
    --md-sys-color-primary-container: #4f378b;
    --md-sys-color-on-primary-container: #eaddff;
    --md-sys-color-secondary: #ccc2dc;
    --md-sys-color-on-secondary: #332d41;
    --md-sys-color-secondary-container: #4a4458;
    --md-sys-color-on-secondary-container: #e8def8;
    --md-sys-color-tertiary: #efb8c8;
    --md-sys-color-on-tertiary: #492532;
    --md-sys-color-tertiary-container: #633b48;
    --md-sys-color-on-tertiary-container: #ffd8e4;
    --md-sys-color-error: #f2b8b5;
    --md-sys-color-on-error: #601410;
    --md-sys-color-error-container: #8c1d18;
    --md-sys-color-on-error-container: #f9dedc;
    --md-sys-color-success: #8fd9a8;
    --md-sys-color-success-container: #14512c;
    --md-sys-color-on-success-container: #c8f0d4;
    --md-sys-color-surface: #131118;
    --md-sys-color-on-surface: #e6e0e9;
    --md-sys-color-surface-variant: #49454f;
    --md-sys-color-on-surface-variant: #cac4d0;
    --md-sys-color-surface-container-lowest: #0e0d12;
    --md-sys-color-surface-container-low: #1c1a21;
    --md-sys-color-surface-container: #201e25;
    --md-sys-color-surface-container-high: #2b2930;
    --md-sys-color-surface-container-highest: #36343b;
    --md-sys-color-outline: #938f99;
    --md-sys-color-outline-variant: #49454f;
    --md-sys-color-inverse-surface: #e6e0e9;
    --md-sys-color-inverse-on-surface: #322f35;
    --app-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
    --app-shadow-2: 0 2px 8px rgba(0, 0, 0, 0.55);
    --app-shadow-3: 0 10px 28px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme='dark'] {
  --md-sys-color-primary: #d0bcff;
  --md-sys-color-on-primary: #381e72;
  --md-sys-color-primary-container: #4f378b;
  --md-sys-color-on-primary-container: #eaddff;
  --md-sys-color-secondary: #ccc2dc;
  --md-sys-color-on-secondary: #332d41;
  --md-sys-color-secondary-container: #4a4458;
  --md-sys-color-on-secondary-container: #e8def8;
  --md-sys-color-tertiary: #efb8c8;
  --md-sys-color-on-tertiary: #492532;
  --md-sys-color-tertiary-container: #633b48;
  --md-sys-color-on-tertiary-container: #ffd8e4;
  --md-sys-color-error: #f2b8b5;
  --md-sys-color-on-error: #601410;
  --md-sys-color-error-container: #8c1d18;
  --md-sys-color-on-error-container: #f9dedc;
  --md-sys-color-success: #8fd9a8;
  --md-sys-color-success-container: #14512c;
  --md-sys-color-on-success-container: #c8f0d4;
  --md-sys-color-surface: #131118;
  --md-sys-color-on-surface: #e6e0e9;
  --md-sys-color-surface-variant: #49454f;
  --md-sys-color-on-surface-variant: #cac4d0;
  --md-sys-color-surface-container-lowest: #0e0d12;
  --md-sys-color-surface-container-low: #1c1a21;
  --md-sys-color-surface-container: #201e25;
  --md-sys-color-surface-container-high: #2b2930;
  --md-sys-color-surface-container-highest: #36343b;
  --md-sys-color-outline: #938f99;
  --md-sys-color-outline-variant: #49454f;
  --md-sys-color-inverse-surface: #e6e0e9;
  --md-sys-color-inverse-on-surface: #322f35;
  --app-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --app-shadow-2: 0 2px 8px rgba(0, 0, 0, 0.55);
  --app-shadow-3: 0 10px 28px rgba(0, 0, 0, 0.6);
}

/* ============================================================ 2. base */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-plain);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/*
  Liens : jamais soulignés au repos. Le soulignement est réservé au survol et
  au focus, où il sert de repère — pas de décoration permanente.
*/
a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  border-radius: 4px;
}
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ====================================================== 3. typographie */
.t-display {
  font-size: clamp(2.2rem, 5.2vw, 3.4rem);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.t-headline { font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.t-title { font-size: 1.06rem; line-height: 1.35; font-weight: 650; letter-spacing: -0.005em; margin: 0; }
.t-body { font-size: 0.95rem; line-height: 1.55; margin: 0; }
.t-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--md-sys-color-on-surface-variant); margin: 0; }
.t-mono { font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Menlo, Consolas, monospace; }
.t-muted { color: var(--md-sys-color-on-surface-variant); }
.t-error { color: var(--md-sys-color-error); }
.t-success { color: var(--md-sys-color-success); }
.t-center { text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--md-sys-color-primary);
}

/* ========================================================= 4. icônes */
.icone { display: block; flex: none; }

.chip-icon {
  width: 42px; height: 42px; flex: none;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
.chip-icon--doux { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.chip-icon--ok { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.chip-icon--alerte { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }

/* ======================================================= 5. coquille */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  min-height: 64px;
  padding: 8px max(16px, env(safe-area-inset-left)) 8px max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--md-sys-color-surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; color: inherit; text-decoration: none; min-width: 0; }
.topbar__brand:hover { text-decoration: none; }
.topbar__nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__logo { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); display: grid; place-items: center; }
.topbar__spacer { flex: 1; min-width: 8px; }
.topbar__badge {
  font-size: 0.75rem; font-weight: 650; padding: 5px 11px; border-radius: 999px;
  background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
}
.topbar__badge--warn { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }

/* Sur téléphone, le nom de l'application s'efface devant le sélecteur de vue. */
@media (max-width: 640px) {
  .topbar--vues .topbar__brand { display: none; }
}

/* Réglages d'affichage : sélecteur de thème, compact. */
.segmented {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 999px;
  background: var(--md-sys-color-surface-container-low);
}
.segmented__item {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--md-sys-color-on-surface-variant);
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented__item:hover { background: var(--md-sys-color-surface-container-high); }
.segmented__item[aria-pressed='true'] { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }

/*
  Variante du sélecteur de vue : icône + libellé. Déclarée après
  `.segmented__item`, à qui elle doit l'emporter à spécificité égale.
*/
.segmented--vues { flex: none; }
.segmented__item--large {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
}
.segmented__nom { font-size: 0.85rem; font-weight: 650; white-space: nowrap; }

@media (max-width: 900px) {
  .segmented__nom { display: none; }
  .segmented__item--large { width: 34px; padding: 0; }
}

.page { flex: 1; width: 100%; max-width: var(--app-max); margin: 0 auto; padding: var(--app-gap); display: grid; gap: var(--app-gap); align-content: start; }
.page--narrow { max-width: 640px; }
.page--wide { max-width: none; }

.stack { display: grid; gap: var(--app-gap); }
.stack--tight { gap: 10px; }
.prose { max-width: 66ch; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; gap: 16px; }

/* ======================================================== 6. cartes */
.card {
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--app-radius);
  padding: 22px;
  display: grid; gap: 16px;
  align-content: start;
}
.card--flat { background: var(--md-sys-color-surface-container); border-color: transparent; }
.card--accent { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border-color: transparent; }
.card--accent .t-muted, .card--accent .t-label { color: inherit; opacity: 0.78; }
.card--warn { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); border-color: transparent; }
.card--warn .t-muted, .card--warn .t-label { color: inherit; opacity: 0.8; }
.card--ok { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); border-color: transparent; }
.card--ok .t-muted, .card--ok .t-label { color: inherit; opacity: 0.8; }

.card__head { display: flex; align-items: center; gap: 14px; }
.card__head .t-title { flex: 1; min-width: 0; }
.card__step {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
  background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);
}
.card__step--done { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.card__step--todo { background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface-variant); }

/* ================================================ 7. accueil : tuiles */
.roles { display: grid; gap: 16px; grid-template-columns: 1fr; }
.role {
  position: relative;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 20px;
  border-radius: var(--app-radius);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  color: inherit;
  box-shadow: var(--app-shadow-1);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.role:hover, .role:focus-visible {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--app-shadow-3);
  border-color: var(--md-sys-color-primary);
}
.role__icon {
  width: 52px; height: 52px; border-radius: 17px;
  display: grid; place-items: center;
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);
}
.role:nth-child(2) .role__icon { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.role:nth-child(3) .role__icon { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.role__texte { display: grid; gap: 4px; min-width: 0; }
.role__chev { color: var(--md-sys-color-on-surface-variant); opacity: 0.7; }
.role:hover .role__chev { color: var(--md-sys-color-primary); opacity: 1; }

/* ============================================ 8. boutons et champs */
.btn {
  min-height: var(--app-tap);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px; border-radius: 999px; font: inherit; font-weight: 650;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
}
.btn--tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.btn--outline { background: transparent; color: var(--md-sys-color-primary); border-color: var(--md-sys-color-outline); }
.btn--text { background: transparent; color: var(--md-sys-color-primary); padding: 0 12px; }
.btn--danger { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--big { min-height: 56px; font-size: 1.02rem; padding: 0 26px; }

.field { display: grid; gap: 7px; }
.field > label { font-size: 0.86rem; font-weight: 650; }
input[type='text'], input[type='number'], input[type='date'], textarea, select {
  width: 100%; min-height: var(--app-tap);
  padding: 12px 14px; font: inherit;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--app-radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, textarea:hover, select:hover { border-color: var(--md-sys-color-on-surface); }
input:focus, textarea:focus, select:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
  outline: none;
}
textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; }
.code-input {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(1.35rem, 6vw, 1.9rem);
  letter-spacing: 0.18em; text-align: center; text-transform: uppercase;
  min-height: 66px; font-weight: 650;
}

/* Champ de fichier masqué : la sélection est déclenchée par un bouton. */
.champ-fichier { display: none; }

/* QR code : fond blanc garanti, y compris en thème sombre, car un scanner a
   besoin de contraste. */
.qr-cadre { display: grid; place-items: center; background: #ffffff; border-radius: var(--app-radius-sm); padding: 12px; }
.qr { display: block; width: 100%; max-width: 220px; height: auto; }
body.projection .qr { max-width: 360px; }

/* ================================================== 9. chiffres et listes */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat {
  background: var(--md-sys-color-surface-container);
  border-radius: var(--app-radius-sm);
  padding: 14px 16px;
  display: grid; gap: 2px;
}
.stat__value { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 680; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 0.76rem; font-weight: 600; color: var(--md-sys-color-on-surface-variant); }

.result { display: grid; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.result:last-child { border-bottom: 0; padding-bottom: 0; }
.result__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.result__name { font-weight: 620; display: inline-flex; align-items: center; gap: 8px; }
.result__marque { color: var(--md-sys-color-success); }
.marque-erreur { color: var(--md-sys-color-error); }
.result__voix { font-variant-numeric: tabular-nums; font-weight: 700; }
.result__track { height: 10px; border-radius: 999px; background: var(--md-sys-color-surface-container-highest); overflow: hidden; }
.result__fill { height: 100%; border-radius: 999px; background: var(--md-sys-color-primary); transition: width 0.4s ease; }
.result--elected .result__fill { background: var(--md-sys-color-success); }
.result--majoritaire .result__name::after {
  content: 'majorité absolue'; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--md-sys-color-success);
  background: var(--md-sys-color-success-container); padding: 2px 8px; border-radius: 999px;
}

.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--app-radius-sm);
}
.pill {
  font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);
  white-space: nowrap;
}
.pill--ok { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.pill--warn { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }

/* ====================================================== 10. isoloir */
.ballot { display: grid; gap: 12px; }

.progress-dots { display: flex; align-items: center; gap: 8px; }
.progress-dots__point {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline);
  transition: background 0.2s ease, transform 0.2s ease;
}
.progress-dots__point--plein { background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); transform: scale(1.15); }

.option {
  display: flex; align-items: center; gap: 16px; cursor: pointer;
  padding: 18px; border-radius: var(--app-radius);
  border: 2px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  min-height: 72px; font: inherit; color: inherit; text-align: left; width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.option:hover:not(:disabled) { border-color: var(--md-sys-color-primary); }
.option:active:not(:disabled) { transform: scale(0.995); }
.option:disabled { opacity: 0.5; cursor: not-allowed; }
.option--picked { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.option__mark {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  border: 2px solid var(--md-sys-color-outline);
  display: grid; place-items: center; color: var(--md-sys-color-on-primary);
}
.option--picked .option__mark { background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }
.option__corps { display: grid; gap: 2px; min-width: 0; }
.option__kind { font-size: 0.78rem; color: var(--md-sys-color-on-surface-variant); }
.option--picked .option__kind { color: inherit; opacity: 0.85; }

/* Barre d'action collante : le bouton de dépôt reste sous le pouce. */
.actions-fixes { position: sticky; bottom: 0; z-index: 5; }
@media (max-width: 899px) {
  .actions-fixes {
    margin: 0 -22px -22px;
    padding: 12px 22px calc(16px + env(safe-area-inset-bottom));
    background: var(--md-sys-color-surface-container-low);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 0 0 var(--app-radius) var(--app-radius);
  }
}

/* ================================================ 11. planche de codes */
.details { display: grid; gap: 12px; }
.details > summary {
  cursor: pointer; padding: 13px 16px; border-radius: var(--app-radius-sm);
  background: var(--md-sys-color-surface-container); list-style: none;
}
.details > summary::-webkit-details-marker { display: none; }
.details > summary::before { content: '▸ '; }
.details[open] > summary::before { content: '▾ '; }

.sheet { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ticket {
  border: 1px dashed var(--md-sys-color-outline);
  border-radius: var(--app-radius-xs);
  padding: 12px; display: grid; gap: 4px;
  background: var(--md-sys-color-surface-container-lowest);
}
.ticket__num { font-size: 0.7rem; color: var(--md-sys-color-on-surface-variant); }
.ticket__code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.02rem; font-weight: 700; letter-spacing: 0.08em; }
.ticket__hint { font-size: 0.68rem; color: var(--md-sys-color-on-surface-variant); }

/* ===================================================== 12. projection */
body.projection { font-size: 19px; }
body.projection .page { max-width: none; }
body.projection .t-display { font-size: clamp(3rem, 6vw, 5.5rem); }
body.projection .t-headline { font-size: clamp(2rem, 4vw, 3.2rem); }
body.projection .t-title { font-size: 1.35rem; }
body.projection .stat__value { font-size: clamp(2.6rem, 5.2vw, 4.2rem); }
body.projection .stat__label { font-size: 0.95rem; }
body.projection .result__name { font-size: 1.32rem; }
body.projection .result__voix { font-size: 1.32rem; }
body.projection .result__track { height: 20px; }
body.projection .list__item { padding: 20px 24px; font-size: 1.3rem; }
body.projection .card { padding: 28px; }
body.projection .topbar__nom { font-size: 1rem; }

/* ==================================================== 13. responsive */
@media (min-width: 620px) {
  .roles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .role { grid-template-columns: 1fr; align-content: start; gap: 14px; padding: 22px; }
  .role__chev { position: absolute; top: 20px; right: 18px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --app-gap: 22px; }
}

@media (max-width: 640px) {
  .topbar__nom { display: none; }
  .topbar__badge { max-width: 34vw; }
}

@media (min-width: 1040px) {
  :root { --app-gap: 24px; }
  .page { padding: 28px 32px 56px; }
  .layout-bureau { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: var(--app-gap); align-items: start; }
  .sticky-col { position: sticky; top: 88px; }
}

/* ==================================================== 14. impression */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card, .ticket, .list__item { border-color: #999; break-inside: avoid; }
  .sheet { grid-template-columns: repeat(3, 1fr); }
  .page { max-width: none; padding: 0; }
  a[href]::after { content: ''; }
}
