@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("fonts/lora.woff2") format("woff2"); font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("fonts/lora-italic.woff2") format("woff2"); font-weight: 100 700; font-style: italic; font-display: swap; }

:root {
  /* Direction « Crème & serif » */
  --paper: #F6F1E7;                /* fond app */
  --card: #FFFDF8;                 /* fond cartes (crème très clair) */
  --line: #E5DCCB;                 /* bordures */
  --bg: #EFE7D6;                   /* tuiles / puces */
  --track: #ECE3D2;               /* pistes de progression */
  --ink: #2B2620;                  /* encre */
  --ink-soft: #5D534A;             /* texte secondaire */
  --muted: #8A7D6A;                /* labels / tertiaire */
  --faint: #A99B85;                /* inactif */
  --red: #C8442E;                  /* accent rouge brique */
  --red-dark: #A1502E;
  --badge-bg: #F3E3D3;
  --on-red: #FFF7EE;               /* texte sur rouge */
  --ok: #3E7A4E; --ok-bg: #E9F1E6;
  --bad: #C8442E; --bad-bg: #FBEDE7;
  --gold: #C69A3A;
  --warning: #C08A2E;
  /* Pastilles teintées (fonds d'icônes) — v2 */
  --pill-green: #E9F1E6; --pill-red: #FBEDE7; --pill-blue: #EAEFF6; --pill-gold: #F6EBD5; --pill-peach: #F3E3D3;
  --icon-green: #3E7A4E; --icon-red: #C8442E; --icon-blue: #5B7DB1; --icon-gold: #C08A2E; --icon-terra: #A1502E;
  --radius: 16px;
  --radius-pill: 99px;
  /* Ombres douces v2 (remplacent la bordure de carte) */
  --shadow: 0 2px 14px rgba(60,45,20,.08);
  --shadow-sm: 0 1px 6px rgba(60,45,20,.06);
  --shadow-cta: 0 8px 24px rgba(200,68,46,.22);
  --shadow-card: 0 2px 14px rgba(60,45,20,.08); /* alias design system */
  --shadow-row: 0 1px 6px rgba(60,45,20,.06);   /* alias design system */
  --font-ui: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Lora", Georgia, ui-serif, "Times New Roman", serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* Pas de zoom au double-tap (feeling app natif) — conserve défilement & pinch.
   Appliqué aussi aux éléments interactifs pour couvrir iOS Safari. */
html, body { touch-action: manipulation; }
button, a, .mode-tile, .mode-row, .exam-cta, .option, .lang-select, .sup-amt, .canton-card, .commune-row { touch-action: manipulation; }
/* Reset global : aucun <button> n'a de bordure par défaut du navigateur.
   Les bordures voulues (réponse correcte, sélection, verrou, outline, chips)
   restent portées par leurs classes, qui l'emportent en spécificité. */
button { border: none; }

/* Un élément avec l'attribut [hidden] doit TOUJOURS être masqué, même si une
   classe lui donne display:flex/grid (sinon l'attribut hidden est ignoré). */
[hidden] { display: none !important; }

html, body {
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { background: var(--paper); min-height: 100vh; }

/* Titres & sur-titres en serif éditorial (Lora) */
h1, .explore-title, .result-inner h2, .question, .modal-card h3, .cd-head b, .setup-hero h1 {
  font-family: var(--font-serif); font-weight: 500; letter-spacing: 0;
}
/* Labels UI en Archivo majuscules espacées */
.chip { font-family: var(--font-ui); }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ---------- Screens ---------- */
.screen { display: none; padding: calc(var(--safe-top) + 18px) 18px calc(var(--safe-bot) + 28px); animation: fade .28s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Home hero ---------- */
.home-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.brand-mark { flex: 0 0 auto; display: block; border-radius: 28%; box-shadow: var(--shadow-cta); }
/* Déclinaisons edelweiss */
.result-mark { display: block; width: 40px; height: auto; margin: 4px auto 14px; }
.footer-flower { vertical-align: -2px; opacity: .5; margin-right: 3px; }
#screen-home { position: relative; overflow: hidden; }
#screen-home > *:not(.hero-deco) { position: relative; z-index: 1; }
.hero-deco { position: absolute; top: -18px; right: -24px; width: 128px; height: auto; opacity: .06; pointer-events: none; z-index: 0; }
/* Wordmark : « Nati » (Archivo 700) + « Coach » (Lora italic 500) */
.home-hero-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.wordmark { display: flex; align-items: baseline; font-size: 27px; letter-spacing: -.2px; line-height: 1.05; margin: 0; }
.commune-pill { margin-top: 0; }
/* Sélecteur de langue FR / EN */
.lang-toggle { display: inline-flex; flex: 0 0 auto; }
.home-hero .lang-toggle { margin-left: auto; align-self: center; }
#setupCantonStep .lang-toggle { position: absolute; top: calc(var(--safe-top) + 14px); right: 16px; z-index: 3; }
.lang-select { -webkit-appearance: none; appearance: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; color: var(--ink); background: var(--bg); border-radius: 99px;
  padding: 6px 26px 6px 12px; box-shadow: var(--shadow-row);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235D534A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
.wm-nati { font-family: var(--font-ui); font-weight: 700; font-style: normal; letter-spacing: -.5px; }
.wm-coach { font-family: var(--font-serif); font-weight: 500; font-style: italic; }
h1 { font-size: 27px; font-weight: 500; letter-spacing: 0; line-height: 1.12; }
.sub { color: var(--muted); font-size: 14px; font-style: italic; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
h2 { font-size: 19px; font-family: var(--font-serif); font-weight: 500; letter-spacing: 0; }
.section-h { margin: 8px 4px 12px; font-size: 16px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }

/* ---------- Readiness ring ---------- */
.readiness-card { display: flex; align-items: center; gap: 18px; }
.ring-wrap { position: relative; width: 120px; height: 120px; flex: 0 0 auto; }
.ring-wrap.big { width: 150px; height: 150px; margin: 0 auto 8px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--track); stroke-width: 12; }
.ring-fg {
  fill: none; stroke: var(--red); stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset .9s cubic-bezier(.4,0,.2,1);
}
.ring-tick { fill: none; stroke: var(--ink); stroke-width: 12; opacity: .42; stroke-dasharray: 2 325; stroke-dashoffset: -228; }
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.ring-center span { font-size: 26px; font-weight: 700; letter-spacing: -1px; }
.ring-wrap.big .ring-center span { font-size: 34px; }
.ring-center small { color: var(--muted); font-size: 11px; }

.readiness-meta { display: grid; grid-template-columns: 1fr; gap: 10px; flex: 1; }
.readiness-meta > div { display: flex; flex-direction: column; }
.readiness-meta strong { font-size: 18px; }
.readiness-meta span { font-size: 12px; color: var(--muted); }

/* ---------- Sparkline ---------- */
.spark { width: 100%; height: 90px; display: block; }
.spark path.line { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.spark path.area { fill: rgba(200,68,46,0.10); stroke: none; }
.spark circle { fill: var(--red); }

/* ---------- Category list ---------- */
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-item {
  background: var(--card); border-radius: 16px;
  padding: 14px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s ease;
}
.cat-item:active { transform: scale(0.98); }
.cat-emoji { font-size: 22px; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; background: var(--bg); flex: 0 0 auto; }
.cat-info { flex: 1; min-width: 0; }
.cat-info h3 { font-size: 15px; font-weight: 600; }
.cat-bar { height: 6px; background: var(--line); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.cat-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--red); width: 0; transition: width .6s ease; }
.cat-meta { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.cat-lock { font-size: 16px; opacity: .6; }
.cat-item.premium { background: linear-gradient(135deg,#faf7ff,#f2ecff); border-color: #e4d8ff; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: var(--radius-pill); font-size: 15px; font-weight: 700;
  padding: 15px 20px; cursor: pointer; width: 100%; font-family: var(--font-ui); letter-spacing: .1px;
  transition: transform .15s ease, filter .2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--red); color: var(--on-red); box-shadow: var(--shadow-cta); }
.btn-primary:active { filter: brightness(.94); }
.btn-ghost { background: transparent; color: var(--muted); box-shadow: none; font-weight: 600; }
.btn-ghost:active { background: rgba(43,38,32,.04); }
.btn.big { margin-top: 6px; }
.btn-share { background: #25D366; color: #fff; box-shadow: 0 6px 16px rgba(37,211,102,0.28); }
.btn-share:active { background: #1eb257; }
.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }
.footer-btn { display: block; width: 100%; background: none; border: none; font-family: inherit; cursor: pointer; padding: 8px 0; line-height: 1.5; }
.footer-info { color: var(--red); font-weight: 600; white-space: nowrap; }
/* À propos & sources */
.about-disclaimer p { font-size: 13.5px; line-height: 1.55; }
.src-list { padding: 4px 16px; }
.src-row { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.src-row:first-child { border-top: none; }
.src-cur { }
.src-canton { flex: 0 0 74px; font-weight: 700; font-size: 13px; color: var(--red); padding-top: 1px; }
.src-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.src-detail b { font-size: 13.5px; }
.src-detail > span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
.src-date { color: var(--muted) !important; font-size: 12px !important; }
.src-detail a { font-size: 12.5px; color: var(--red); font-weight: 600; text-decoration: none; margin-top: 2px; }

/* ---------- Quiz ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.icon-btn { background: var(--card); width: 38px; height: 38px;
  border-radius: 50%; font-size: 16px; cursor: pointer; color: var(--ink-soft); flex: 0 0 auto; box-shadow: var(--shadow-sm); }
.quiz-progress { flex: 1; height: 6px; background: var(--track); border-radius: var(--radius-pill); overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--red); width: 0; border-radius: var(--radius-pill); transition: width .4s ease; }
.quiz-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

.chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  padding: 0; background: none; color: var(--muted); margin-bottom: 10px; }
.question { font-size: 25px; line-height: 1.25; letter-spacing: 0; margin-bottom: 22px; font-weight: 500; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  background: var(--card); border: 1.5px solid transparent; box-shadow: var(--shadow-sm); border-radius: 14px;
  padding: 15px 16px; font-size: 16px; font-weight: 500; text-align: left; cursor: pointer; width: 100%;
  font-family: var(--font-ui); color: var(--ink); display: flex; align-items: center; gap: 13px;
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
}
.option:active { transform: scale(0.99); }
.option .mark { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line);
  flex: 0 0 auto; display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  color: var(--ink-soft); background: transparent; }
.option.correct { border-color: var(--ok); border-width: 2px; background: var(--ok-bg);
  box-shadow: 0 2px 10px rgba(62,122,78,.12); }
.option.correct .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.wrong { border-color: var(--red); border-width: 2px; background: var(--bad-bg); }
.option.wrong .mark { background: var(--red); border-color: var(--red); color: var(--on-red); }
/* Examen : sélection NEUTRE (pas de correction avant la fin) → ni rouge ni vert. */
.option.chosen { border-color: var(--ink-soft); border-width: 2px; background: #F4EFE3;
  box-shadow: 0 2px 10px rgba(90,70,40,.12); }
.option.chosen .mark { background: var(--ink-soft); border-color: var(--ink-soft); color: var(--card); }
.option.dim { opacity: .5; }
.option[disabled] { cursor: default; }

/* ---------- Explanation ---------- */
.explain {
  margin-top: 20px; background: #FBF7EE; box-shadow: var(--shadow-sm);
  border-radius: 16px; padding: 16px; display: flex; gap: 14px; align-items: flex-start;
  animation: fade .3s ease;
}
.explain-illus { flex: 0 0 auto; width: 96px; }
.explain-illus svg { width: 100%; height: auto; border-radius: 10px; display: block; }
.explain-illus:empty { display: none; }
.explain-head { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.explain-head.ok { color: var(--ok); }
.explain-head.bad { color: var(--bad); }
.explain-text p { font-size: 14px; color: var(--ink-soft); }

.quiz-foot { position: sticky; bottom: 0; padding-top: 14px; padding-bottom: var(--safe-bot);
  background: linear-gradient(to top, var(--bg) 70%, transparent); margin: 0 -18px -28px; padding-left: 18px; padding-right: 18px; }

/* ---------- Result ---------- */
.result-inner { text-align: center; padding-top: 30px; }
.result-inner h2 { font-size: 26px; margin-bottom: 6px; font-family: var(--font-display); font-weight: 600; letter-spacing: -.3px; }
.result-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 26px; }

/* ---------- Premium ---------- */
.premium-inner { text-align: center; padding-top: 20px; }
.premium-badge { font-size: 40px; width: 82px; height: 82px; margin: 10px auto 16px;
  display: grid; place-items: center; border-radius: 24px; background: linear-gradient(135deg,#efe6ff,#e0d0ff); }
.premium-inner h2 { font-size: 22px; margin-bottom: 10px; }
.premium-list { list-style: none; text-align: left; max-width: 300px; margin: 22px auto; display: flex; flex-direction: column; gap: 12px; }
.premium-list li { font-size: 15px; color: var(--ink-soft); }

/* ---------- Champs de sélection ---------- */
.field { display: block; text-align: left; margin: 16px auto 0; max-width: 340px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field select {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 14px 40px 14px 16px; cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7683' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field select:focus { outline: none; border-color: var(--red); }
#communeInfo { max-width: 340px; margin: 10px auto 4px; text-align: left; }
.premium-inner .btn.big { max-width: 340px; margin-left: auto; margin-right: auto; margin-top: 18px; }
.premium-inner .btn-ghost { max-width: 340px; margin-left: auto; margin-right: auto; }

/* ---------- Configuration / recherche de commune ---------- */
.setup-back { position: absolute; top: calc(var(--safe-top) + 14px); right: 16px; z-index: 2; }
.setup-hero { text-align: center; padding: 18px 0 20px; }
.setup-hero .brand-mark { margin: 0 auto 16px; }
.setup-hero h1 { font-size: 26px; }
.search-wrap { position: relative; margin-bottom: 12px; }
.search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .6; }
.search-input {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 15px 16px 15px 44px; -webkit-appearance: none; appearance: none;
}
.search-input:focus { outline: none; border-color: var(--red); }
.commune-results { display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; }
.commune-row {
  background: var(--card); border: 1.5px solid transparent; border-radius: 14px;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; text-align: left; width: 100%; font-family: inherit; transition: transform .1s, border-color .15s;
}
.commune-row:active { transform: scale(0.99); }
.commune-row.selected { border-color: var(--red); background: #fff6f6; }
.commune-row b { font-size: 16px; font-weight: 600; }
.commune-row small { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }
.commune-row .pin { font-size: 16px; opacity: .5; }
.results-empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

/* ---------- Accueil : commune + modes ---------- */
.home-hero-txt { flex: 1; }
.commune-pill {
  margin-top: 5px; background: var(--card); border-radius: 20px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; font-family: inherit; box-shadow: var(--shadow-sm);
}
.commune-pill .chev { color: var(--muted); font-size: 11px; }
.modes { display: flex; flex-direction: column; gap: 11px; margin-bottom: 18px; }
.mode-btn {
  background: var(--card); border-radius: 18px;
  padding: 15px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer;
  box-shadow: var(--shadow-sm); font-family: inherit; text-align: left; width: 100%;
  transition: transform .12s ease, box-shadow .2s ease;
}
.mode-btn:active { transform: scale(0.985); }
.mode-btn.primary { background: var(--red); border-color: transparent; box-shadow: var(--shadow-cta); }
.mode-btn.primary .mode-txt b, .mode-btn.primary .mode-txt small, .mode-btn.primary .chev { color: var(--on-red); }
.mode-btn.primary .mode-txt small { opacity: .92; }
.mode-btn.primary .mode-ico { background: rgba(255,255,255,0.2); }
.mode-ico { font-size: 22px; width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 14px; background: var(--bg); flex: 0 0 auto; }
.mode-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mode-txt b { font-size: 15.5px; letter-spacing: -.2px; }
.mode-txt small { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mode-btn .chev { font-size: 20px; color: var(--muted); }

/* ---------- Contrôle segmenté (scopes révision) ---------- */
.seg { flex: 1; display: flex; background: var(--line); border-radius: 12px; padding: 3px; gap: 2px; overflow: hidden; }
.seg button {
  flex: 1; border: none; background: transparent; font-family: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--muted); padding: 8px 4px; border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.seg button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.study-modebar { display: flex; justify-content: center; margin: 0 0 16px; }
.seg.mini { flex: 0 0 auto; width: auto; max-width: 300px; }
.seg.mini button { padding: 8px 18px; }

/* ---------- Minuteur examen ---------- */
.timer { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink);
  background: var(--bg); border-radius: 8px; padding: 4px 8px; }
.timer.warn { color: #fff; background: var(--red); }

/* ---------- Révision : options + navigation ---------- */
.option.reveal { border-color: var(--ok); border-width: 2px; background: var(--ok-bg); }
.option.reveal .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.muted-opt { opacity: .55; }
.study-foot { display: flex; gap: 10px; }
.btn.half { flex: 1; }

/* ---------- Explorer la Suisse : carte des cantons ---------- */
.explore-title { flex: 1; text-align: center; font-size: 17px; }
/* Contrepoids droit = largeur de la flèche retour, pour un titre vraiment centré */
.quiz-top .explore-title + span { flex: 0 0 38px; }
.explore-sub { text-align: center; margin-bottom: 8px; }
.canton-map { width: 100%; height: auto; display: block; margin: 0 auto 4px; touch-action: manipulation; }
.canton { cursor: pointer; }
.canton path { stroke: #ffffff; stroke-width: var(--csw, 0.22); stroke-linejoin: round; }
.canton.sel path { stroke: var(--ink); stroke-width: var(--csw-sel, 0.5); }
.canton text { pointer-events: none; font-family: -apple-system, sans-serif; paint-order: stroke; stroke: rgba(0,0,0,0.28); stroke-width: 0.35; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 6px 0 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; }

.canton-detail { background: var(--card); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.cd-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cd-badge { width: 48px; height: 48px; border-radius: 13px; color: #fff; font-weight: 800; font-size: 17px; display: grid; place-items: center; flex: 0 0 auto; letter-spacing: .5px; }
.cd-head b { font-size: 18px; display: block; }
.cd-head small { color: var(--muted); font-size: 12.5px; }
.cd-rows { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.cd-rows > div { display: flex; justify-content: space-between; align-items: center; background: var(--card); padding: 11px 14px; }
.cd-rows span { color: var(--muted); font-size: 13px; }
.cd-rows b { font-size: 14px; }
.cd-fact { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.cd-intro { text-align: center; color: var(--muted); font-size: 14px; padding: 8px 4px; }
.cd-intro b { color: var(--ink); }

/* ---------- Statistiques ---------- */
.stats-card { background: var(--card); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.stats-card h3 { font-size: 15px; margin-bottom: 14px; }
.stat-row { margin-bottom: 14px; }
.stat-row:last-child { margin-bottom: 0; }
.stat-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.stat-head b { font-size: 14px; }
.stat-head span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-bar { height: 9px; background: var(--line); border-radius: 5px; overflow: hidden; }
.stat-bar > i { display: block; height: 100%; border-radius: 5px; transition: width .6s ease; }
.stats-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 40px 16px; }
.stats-overall { text-align: center; padding: 6px 0 2px; }
.stats-overall .big-pct { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.stats-overall small { display: block; color: var(--muted); font-size: 13px; }
.btn-reset { background: transparent; color: var(--bad); box-shadow: none; font-size: 14px; }

/* ---------- Lightbox illustrations ---------- */
.explain-illus svg, .review-illus svg, .study-illus svg { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; background: rgba(15,20,28,0.78); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .2s ease; cursor: zoom-out; }
.lightbox-inner { width: 100%; max-width: 380px; background: #fff; border-radius: 20px; padding: 20px; }
.lightbox-inner svg { width: 100%; height: auto; display: block; }

/* ---------- Carte : zoom / déplacement ---------- */
.map-frame { position: relative; }
.canton-map { cursor: grab; touch-action: none; }
.canton-map.grabbing { cursor: grabbing; }
.map-zoom { position: absolute; right: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,0.92); font-size: 18px; font-weight: 600; color: var(--ink); cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center; }
.map-zoom button:active { background: var(--bg); }

/* ---------- Frise chronologique ---------- */
.timeline { padding: 4px 2px 24px; }
.tl-item { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 42px; bottom: -2px; width: 2px; background: var(--line); }
.tl-dot { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; z-index: 1; }
.tl-item.ch .tl-dot { background: var(--bad-bg); }
.tl-item.vd .tl-dot { background: var(--ok-bg); }
.tl-body { flex: 1; padding-top: 1px; }
.tl-year { font-size: 13px; font-weight: 800; letter-spacing: .2px; }
.tl-item.ch .tl-year { color: var(--red); }
.tl-item.vd .tl-year { color: var(--ok); }
.tl-body h3 { font-size: 15px; margin: 1px 0 4px; }
.tl-body p { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Écran de correction ---------- */
.review-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; }
.review-card { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review-head .chip { margin-bottom: 0; }
.review-flag { font-weight: 700; font-size: 14px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.review-flag.ok { background: var(--ok-bg); color: var(--ok); }
.review-flag.bad { background: var(--bad-bg); color: var(--bad); }
.review-qtext { font-size: 16px; line-height: 1.35; margin-bottom: 12px; font-weight: 600; }
.review-card .options { gap: 8px; }
.review-card .option { padding: 12px 14px; font-size: 14.5px; cursor: default; }
.review-card .option:active { transform: none; }
.review-noans { color: var(--bad); font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.review-exp { margin-top: 12px; background: #FBF7EE; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; display: flex; gap: 12px; align-items: flex-start; }
.review-illus { flex: 0 0 auto; width: 88px; }
.review-illus svg { width: 100%; height: auto; border-radius: 8px; display: block; }
.review-illus:empty { display: none; }

/* ---------- Badge résultat examen ---------- */
.result-badge { display: inline-block; font-size: 14px; font-weight: 700; padding: 7px 16px;
  border-radius: 20px; margin-bottom: 10px; }
.result-badge.pass { background: var(--ok-bg); color: var(--ok); }
.result-badge.fail { background: var(--bad-bg); color: var(--bad); }

/* ---------- Animations & gamification ---------- */
@keyframes optIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#optionsList .option { animation: optIn .34s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.option.correct { animation: pop .4s ease; }
.option.wrong { animation: shake .42s ease; }
@keyframes badgePush { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }

.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bot) + 22px);
  transform: translateX(-50%) translateY(160%); z-index: 70;
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28); display: flex; gap: 11px; align-items: center;
  max-width: 88%; font-size: 14px; transition: transform .45s cubic-bezier(.2,.9,.2,1);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast .t-ico { font-size: 22px; }
.toast b { font-weight: 700; }

/* Écran Succès */
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding-bottom: 24px; }
.badge-card { background: var(--card); border-radius: 16px; padding: 16px 12px;
  text-align: center; box-shadow: var(--shadow); }
.badge-card.on { animation: badgePush .4s ease both; }
.badge-card.locked { opacity: .55; filter: grayscale(1); }
.badge-ico { font-size: 34px; line-height: 1; }
.badge-card b { display: block; font-size: 13.5px; margin-top: 8px; }
.badge-card small { color: var(--muted); font-size: 11.5px; display: block; margin-top: 3px; }
.badge-progress { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* =====================================================================
 *  REFONTE 2026 — handoff Claude Design (9 écrans)
 * ===================================================================== */

/* ---------- Accueil : CTA examen + carte préparation + modes groupés ---------- */
.exam-cta { background: var(--red); color: var(--on-red); border: none; border-radius: 18px;
  padding: 19px 20px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-cta);
  margin-bottom: 14px; width: 100%; font-family: inherit; text-align: left; cursor: pointer; transition: transform .12s ease; }
.exam-cta:active { transform: scale(.99); }
.exam-cta-txt { flex: 1; display: flex; flex-direction: column; }
.exam-cta-txt b { font-family: var(--font-serif); font-weight: 500; font-size: 20px; }
.exam-cta-txt small { font-size: 12px; opacity: .85; margin-top: 3px; }
.exam-cta-arrow { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }

/* Carte préparation (héros) : anneau + sparkline aire, puis 3 mini-stats */
.prep-card { background: var(--card); border-radius: 24px; padding: 22px 20px 18px;
  box-shadow: var(--shadow-card); margin-bottom: 18px; }
.prep-top { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.prep-ring { position: relative; width: 118px; height: 118px; flex: 0 0 auto; }
.prep-ring .ring { width: 100%; height: 100%; }
.prep-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.prep-ring-c span { display: block; font-family: var(--font-serif); font-size: 27px; font-weight: 500; line-height: 1; }
.prep-ring-c small { display: block; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.prep-graph { flex: 1; min-width: 0; }
.prep-label { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.spark-mini { width: 100%; height: 54px; display: block; }
.spark-mini .area { fill: var(--pill-red); stroke: none; }
.spark-mini .line { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.spark-mini circle { fill: var(--red); }
.prep-graph-meta { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); margin-top: 4px; }
.prep-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.prep-delta.up { color: var(--red); }
.prep-delta.down { color: var(--muted); }
.prep-delta .tri { width: 8px; height: 8px; flex: 0 0 auto; }
.recap-val .tri { width: .5em; height: .5em; vertical-align: baseline; }
.prep-status { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .3px; margin: 2px 0 14px; }
.prep-tiles { display: flex; gap: 8px; }
.prep-tile { flex: 1; background: var(--bg); border-radius: 14px; padding: 11px 6px; text-align: center; }
.prep-tile b { display: block; font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
.prep-tile small { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

/* Jauges segmentées sur les tuiles Découvrir & suivre */
.nc-gauge { display: flex; gap: 3px; margin-top: 8px; }
.nc-gauge span { flex: 1; height: 4px; border-radius: 2px; background: var(--track); }
.nc-gauge span.on { background: currentColor; }
.mode-tile small.tile-prog { margin-top: 5px; }

/* Flèches SVG (CTA examen + lignes réviser) */
.exam-cta-arrow svg { width: 18px; height: 18px; }
.mode-row .chev svg { width: 16px; height: 16px; display: block; }

/* Traduction optionnelle des questions */
.qtr-btn { display: inline-block; background: none; border: none; color: var(--red); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 0 6px; }
.tts-btn { color: var(--ink-soft); margin-right: 16px; }
.tts-btn .ic { color: var(--red); margin-right: 3px; }
.qtr-text { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.qtr-text p { margin: 0; }
.qtr-text ul { list-style: none; margin: 6px 0 0; padding: 0; }
.qtr-text li { padding: 2px 0 2px 14px; position: relative; }
.qtr-text li::before { content: "·"; position: absolute; left: 4px; }
/* Avertissement « examen en français » */
.notice-panel { text-align: center; padding-bottom: 22px; }
.notice-ico { font-size: 40px; margin: 4px 0 6px; }
.notice-panel h3 { font-family: var(--font-serif); font-size: 19px; font-weight: 500; margin-bottom: 8px; }
.notice-panel p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 16px; }
.notice-panel .btn { width: 100%; }
/* Mentions légales (CGU / confidentialité) */
.legal-body { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.legal-draft { background: #F6EDD8; color: var(--red-dark); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
.legal-meta { font-family: var(--font-serif); font-size: 14px; color: var(--ink); margin-bottom: 10px; }
.legal-sec { margin-bottom: 14px; }
.legal-sec h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.legal-links { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.legal-link { text-align: left; background: var(--card); border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: 14px; color: var(--red); font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); }
/* Freemium : bannière accueil, verrou révision, écran premium */
.premium-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--pill-gold); border: none; border-radius: 16px; padding: 13px 15px; margin-bottom: 16px; box-shadow: var(--shadow-row); font-family: inherit; }
.pb-ico { flex: 0 0 auto; display: grid; place-items: center; color: var(--gold); }
.pb-ico svg { width: 20px; height: 20px; }
.pb-txt { flex: 1; display: flex; flex-direction: column; }
.pb-txt b { font-size: 14.5px; }
.pb-txt small { font-size: 12px; color: var(--muted); }
.pb-price { font-weight: 700; color: var(--gold); font-size: 14px; flex: 0 0 auto; }
.study-lock { display: block; width: 100%; text-align: center; cursor: pointer; font-family: inherit;
  background: #F6EDD8; color: var(--red-dark); border: none; border-radius: 12px; padding: 9px 12px; margin-bottom: 10px; font-size: 12.5px; }
.pr-hero { text-align: center; padding: 12px 8px 4px; }
.pr-flower { display: block; margin: 0 auto 8px; }
.pr-hero h3 { font-family: var(--font-serif); font-size: 21px; font-weight: 500; }
.pr-hero p { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.pr-owned .pr-badge { width: 52px; height: 52px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 26px; margin: 8px auto 10px; }
.pr-feats { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 22px 4px; }
.pr-feats li { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; color: var(--ink); line-height: 1.45; }
.pr-ico { flex: 0 0 auto; font-size: 18px; width: 28px; text-align: center; }
.pr-cta-wrap { position: sticky; bottom: 0; padding-top: 8px; }
.pr-cta-wrap .btn { width: 100%; }
.pr-note { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.pr-result-cta { width: 100%; margin-top: 6px; }

/* Soutenir le projet (dons) */
.support-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--pill-peach); border-radius: 16px; padding: 13px 15px; margin-bottom: 16px; box-shadow: var(--shadow-row); font-family: inherit; }
.sb-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.sb-ico img { display: block; }
.sb-txt { flex: 1; display: flex; flex-direction: column; }
.sb-txt b { font-size: 14.5px; }
.sb-txt small { font-size: 12px; color: var(--muted); }
.support-banner .chev { color: var(--muted); flex: 0 0 auto; }
.support-banner .chev svg { width: 16px; height: 16px; display: block; }
.sup-hero { text-align: center; padding: 8px 8px 4px; }
.sup-hero h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 500; margin-bottom: 8px; }
.sup-hero p { color: var(--ink-soft); font-size: 14px; line-height: 1.55; max-width: 320px; margin: 0 auto; }
.sup-amts { display: flex; gap: 8px; margin: 22px 0 18px; }
.sup-amt { flex: 1; padding: 15px 0; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-row);
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; transition: transform .1s; }
.sup-amt:active { transform: scale(.97); }
.sup-amt.on { background: var(--red); color: var(--on-red); box-shadow: var(--shadow-cta); }
.sup-cta-wrap { display: flex; flex-direction: column; gap: 10px; }
.sup-cta-wrap .btn { width: 100%; }
.sup-nudge { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; background: var(--pill-peach);
  border-radius: 12px; padding: 11px 16px; font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--red-dark); cursor: pointer; }
.sup-nudge img { display: block; }
/* Séparation « Examen » vs « Pour aller plus loin » */
.zone-head { margin: 6px 2px 14px; }
.zone-title { font-family: var(--font-serif); font-size: 19px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.zone-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.zone-bonus { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line); }
.mode-group-label { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0 4px 9px; }
.mode-rows { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.mode-row { background: var(--card); border: none; border-radius: 16px; padding: 13px 15px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm); font-family: inherit;
  text-align: left; width: 100%; cursor: pointer; transition: transform .12s ease; }
.mode-row:active { transform: scale(.985); }
/* Pastilles d'icônes (v2 : icônes SVG outline sur ronds teintés, zéro émoji) */
.mode-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--bg); position: relative; }
.mode-ico svg { width: 20px; height: 20px; }
.mi-green { background: var(--pill-green); color: var(--icon-green); }
.mi-red   { background: var(--pill-red);   color: var(--icon-red); }
.mi-blue  { background: var(--pill-blue);  color: var(--icon-blue); }
.mi-gold  { background: var(--pill-gold);  color: var(--icon-gold); }
.mi-terra { background: var(--pill-peach); color: var(--icon-terra); }
.mode-ico .ico-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: var(--on-red); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
/* Icônes inline (émojis remplacés par SVG outline) */
.ic { width: 1.05em; height: 1.05em; vertical-align: -.16em; flex: none; }
.cs-card-h .ic, .cs-h .ic { color: var(--red); margin-right: 4px; vertical-align: -.18em; }
.canton-emoji { font-size: 0; margin-bottom: 4px; color: var(--red); }
.canton-emoji svg { width: 30px; height: 30px; }
.search-ico { width: 16px; height: 16px; color: var(--muted); }
.search-ico svg { width: 100%; height: 100%; }
.notice-ico { color: var(--red); display: grid; place-items: center; }
.notice-ico svg { width: 40px; height: 40px; }
.option .mark svg { width: 15px; height: 15px; }
.pr-owned .pr-badge { font-size: 0; }
.pr-badge svg { width: 26px; height: 26px; }
.sheet-check svg, .commune-check svg { width: 15px; height: 15px; }
.badge-done svg { width: 11px; height: 11px; vertical-align: -1.5px; margin-right: 2px; }
.review-flag svg { width: 13px; height: 13px; }
.map-zoom button svg { width: 17px; height: 17px; }
.result-badge svg { width: 13px; height: 13px; vertical-align: -2px; }
.mode-row-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mode-row-txt b { font-size: 14.5px; }
.mode-row-txt small { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.mode-row-txt small.hot { color: var(--red); font-weight: 600; }
.mode-row .chev { font-size: 18px; color: var(--muted); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.mode-tile { background: var(--card); border: none; border-radius: 16px; padding: 13px 14px;
  box-shadow: var(--shadow-sm); font-family: inherit; text-align: left; cursor: pointer; transition: transform .12s ease; }
.mode-tile:active { transform: scale(.985); }
/* Reset de la bordure UA par défaut des <button> agissant comme surfaces */
.commune-pill, .icon-btn, .scope-title, .map-zoom button { border: none; }
.mode-tile .mode-ico { width: 36px; height: 36px; }
.mode-tile .mode-ico svg { width: 18px; height: 18px; }
.mode-tile b { display: block; font-size: 13.5px; margin-top: 9px; }
.mode-tile small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ---------- Révision : titre de portée déroulant + toggle + progression + « Le savais-tu » ---------- */
.scope-title { display: inline-flex; align-items: baseline; gap: 7px; margin: 0 auto; background: var(--card);
  border-radius: 99px; padding: 8px 16px; box-shadow: var(--shadow-sm);
  font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--ink); cursor: pointer; }
.scope-title .chev { font-size: 10px; color: var(--muted); font-family: var(--font-ui); }
.study-modebar { display: block; margin: 0 0 12px; }
.seg.toggle2 { width: 100%; flex: none; background: var(--line); border-radius: 99px; padding: 4px; gap: 3px; }
.seg.toggle2 button { border-radius: 99px; padding: 10px 4px; font-size: 13.5px; font-weight: 600; }
.seg.toggle2 button.active { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.study-progress { height: 4px; background: var(--track); border-radius: 2px; margin: 0 0 20px; overflow: hidden; }
.study-progress-fill { height: 100%; background: var(--red); border-radius: 2px; width: 0; transition: width .3s ease; }
.explain.savais { background: var(--badge-bg); border: none; }
.explain-flower { flex: 0 0 auto; width: 26px; height: 26px; margin-top: 1px; }
.savais-head { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 15px; color: var(--red-dark); margin-bottom: 3px; }
.savais-head.ok { color: var(--ok); }
.savais-head.bad { color: var(--red); }
.explain.savais .explain-text p { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.explain.savais .explain-illus { width: 100%; margin-top: 10px; }
.reveal-btn { margin-top: 4px; }
.card-choices { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 0 0 6px; }
.card-choices li { background: var(--card); border-radius: 14px;
  padding: 13px 16px 13px 40px; font-size: 15.5px; color: var(--ink); position: relative; box-shadow: var(--shadow-sm); }
.card-choices li::before { content: ""; position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }

/* Feuille de sélection (bottom-sheet) */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(15,20,28,.4); display: flex; align-items: flex-end; animation: fade .2s ease; }
.sheet-panel { width: 100%; max-width: 480px; margin: 0 auto; background: var(--paper); border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(var(--safe-bot) + 20px); box-shadow: 0 -8px 30px rgba(0,0,0,.2); animation: sheetUp .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-title { font-family: var(--font-serif); font-size: 16px; font-weight: 500; margin-bottom: 12px; text-align: center; }
.don-off { display: block; margin: 4px auto 0; background: none; border: none; color: var(--muted); font-family: inherit; font-size: 12.5px; padding: 6px; cursor: pointer; text-decoration: underline; }
.sheet-options { display: flex; flex-direction: column; gap: 8px; }
.sheet-options button { display: flex; justify-content: space-between; align-items: center; background: var(--card);
  border: 1.5px solid transparent; box-shadow: var(--shadow-sm); border-radius: 14px; padding: 14px 16px; font-family: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
.sheet-options button.sel { border-color: var(--red); color: var(--red); font-weight: 700; }
.sheet-check { color: var(--red); font-weight: 700; }

/* ---------- Explorer : fiche canton « carte d'identité » ---------- */
.legend-dash { width: 14px; height: 3px; border-radius: 2px; flex: 0 0 auto; }
.map-legend .legend-item { color: var(--muted); font-size: 11px; }
.map-legend .legend-item.on { color: var(--ink); font-weight: 600; }
.canton-detail.as-card { padding: 0; overflow: hidden; }
.cid-head { padding: 20px 22px 18px; color: var(--on-red); }
.cid-head-top { display: flex; align-items: baseline; justify-content: space-between; }
.cid-name { font-family: var(--font-serif); font-size: 28px; font-weight: 500; }
.cid-code { font-weight: 800; font-size: 15px; letter-spacing: 1px; opacity: .75; }
.cid-region { font-size: 11px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; opacity: .85; margin-top: 4px; }
.cid-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 16px 8px 14px; text-align: center; }
.cid-cols > div:nth-child(2) { border-left: 1px solid #EFE3D2; border-right: 1px solid #EFE3D2; }
.cid-val { font-family: var(--font-serif); font-size: 19px; font-weight: 500; line-height: 1.15; }
.cid-lab { font-size: 9.5px; font-weight: 600; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.cid-quote { margin: 0 16px 14px; background: #FBF7EE; border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; }
.cid-q { font-family: var(--font-serif); font-size: 34px; line-height: .9; flex: none; }
.cid-quote p { margin: 2px 0 0; font-family: var(--font-serif); font-style: italic; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.cid-cta-wrap { padding: 0 16px 16px; }
.cid-cta { width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; background: transparent;
  border: 1.5px solid var(--red); border-radius: 99px; padding: 11px 20px; font-size: 13.5px; font-weight: 700; font-family: inherit; cursor: pointer; }

/* ---------- Statistiques : bilan guidé ---------- */
.stats-hero { text-align: center; padding: 6px 0 20px; }
.stats-hero-sur { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.stats-hero-theme { font-family: var(--font-serif); font-style: italic; font-size: 34px; font-weight: 500; color: var(--red); line-height: 1.1; }
.stats-hero-msg { margin: 10px auto 16px; max-width: 270px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.stats-hero-cta { width: auto; display: inline-block; padding: 13px 26px; font-size: 14px; }
.stats-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.stats-card-title { font-family: var(--font-serif); font-size: 16px; font-weight: 500; }
.stats-thresh { font-size: 11px; color: var(--muted); }
.sbar-list { display: flex; flex-direction: column; gap: 14px; }
.sbar-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.sbar-head b { font-size: 13.5px; }
.sbar-head span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sbar-head span.weak { color: var(--red); font-weight: 700; }
.sbar-head span.good { color: var(--ok); font-weight: 700; }
.sbar { position: relative; height: 10px; background: var(--track); border-radius: 5px; }
.sbar > i { display: block; height: 100%; border-radius: 5px; transition: width .6s ease; }
.sbar > u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; }
.stats-tiles { display: flex; gap: 10px; margin: 14px 0 16px; }
.stats-tile { flex: 1; background: var(--card); border-radius: 14px; padding: 13px 14px; text-align: center; }
.stats-tile-val { font-family: var(--font-serif); font-size: 21px; font-weight: 500; }
.stats-tile-lab { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

/* ---------- Résultat : bilan / récap / confettis sobres ---------- */
#screen-result { position: relative; }
.result-inner { position: relative; z-index: 1; }
.result-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.result-confetti i { position: absolute; border-radius: 50%; animation: confDrop 1s ease both; }
@keyframes confDrop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; } }
.result-inner h2 { font-family: var(--font-serif); font-weight: 500; }
.result-card { background: var(--card); border-radius: 18px; padding: 18px 20px;
  box-shadow: var(--shadow); margin-bottom: 14px; text-align: left; }
.btn-outline { background: var(--card); color: var(--ink-soft); box-shadow: var(--shadow-sm); font-weight: 600; }
.btn-outline:active { background: rgba(43,38,32,.04); }
.btn-share { background: var(--red); color: var(--on-red); box-shadow: var(--shadow-cta); }
.btn-share:active { filter: brightness(.94); }
.recap-tiles { display: flex; justify-content: center; gap: 10px; margin-bottom: 6px; }
.recap-tile { background: var(--card); border-radius: 14px; padding: 11px 16px; text-align: center; }
.recap-val { font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
.recap-lab { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

/* ---------- Succès : héros + médaillons + verrouillés ---------- */
.badge-count { text-align: center; font-family: var(--font-serif); font-size: 34px; font-weight: 500; }
.badge-count em { color: var(--muted); font-size: 22px; font-style: normal; }
.badge-sub { text-align: center; margin: 0 0 14px; font-family: var(--font-serif); font-style: italic; font-size: 13.5px; color: var(--muted); }
.badge-segs { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; }
.badge-segs span { width: 26px; height: 5px; border-radius: 3px; background: #E0D5C0; }
.badge-segs span.on { background: var(--red); }
.badge-card { position: relative; }
.badge-card.on { background: var(--card); opacity: 1; filter: none; }
.badge-medal { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%; background: var(--badge-bg);
  display: grid; place-items: center; color: var(--red-dark); box-shadow: inset 0 0 0 2px rgba(200,68,46,.25); }
.badge-medal svg { width: 26px; height: 26px; }
.badge-card.locked .badge-medal { color: var(--muted); }
.badge-done { display: inline-block; margin-top: 8px; font-size: 9.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ok); }
.badge-card.locked { background: var(--paper); border: 1.5px dashed #D8CBB2; opacity: 1; filter: none; }
.badge-card.locked .badge-medal { background: var(--bg); filter: grayscale(1); opacity: .7; box-shadow: none; font-size: 22px; }
.badge-card.locked b { color: var(--ink-soft); }
.badge-bar { height: 4px; background: #E0D5C0; border-radius: 2px; margin: 9px 10px 4px; overflow: hidden; }
.badge-bar > i { display: block; height: 100%; background: var(--faint); border-radius: 2px; }
.badge-hint { font-size: 10px; color: var(--muted); }

/* ---------- Configuration : sur-titre + districts + CTA sticky ---------- */
.setup-surtitle { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.setup-surtitle span { color: inherit; }
.setup-hero .sub { font-style: normal; color: var(--ink-soft); max-width: 280px; margin: 8px auto 0; font-size: 13px; }
.dist-label { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 6px 4px 8px; }
.dist-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.commune-row.selected { border: 1.5px solid var(--red); background: var(--card); box-shadow: 0 2px 10px rgba(200,68,46,.1); }
.commune-check { width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: var(--on-red);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.commune-chev { color: var(--faint); font-size: 14px; }
.setup-cta { position: sticky; bottom: 0; padding: 12px 0 calc(var(--safe-bot) + 8px);
  background: linear-gradient(to top, var(--paper) 72%, transparent); }
.setup-cta .btn { max-width: 100%; }
.setup-note { text-align: center; font-size: 11px; color: var(--muted); margin-top: 10px; }

/* ---------- Frise : filtre + jalons d'époque + rail coloré ---------- */
.tl-filter { display: flex; justify-content: center; gap: 7px; margin-bottom: 22px; flex-wrap: wrap; }
.tl-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 99px; padding: 6px 14px; font-size: 12px; font-weight: 600; color: var(--muted); font-family: inherit; cursor: pointer; }
.tl-pill.active { border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; }
.tl-fdot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.tl-era { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.tl-era span { flex: 1; height: 1px; background: #E0D5C0; }
.tl-rail { position: relative; padding-left: 24px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.tl-rail::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 1px; }
.tl-node { position: relative; }
.tl-pin { position: absolute; left: -24px; top: 4px; width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 3px var(--paper); }
.tl-node.ch .tl-pin { background: var(--red); }
.tl-node.vd .tl-pin { background: var(--ok); }
.tl-year { font-family: var(--font-serif); font-size: 22px; font-weight: 500; line-height: 1; }
.tl-node.ch .tl-year { color: var(--red); }
.tl-node.vd .tl-year { color: var(--ok); }
.tl-year em { font-family: var(--font-ui); font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; vertical-align: 3px; }
.tl-card { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-top: 7px; box-shadow: var(--shadow-sm); }
.tl-card b { font-size: 14px; }
.tl-card p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.tl-card.key { background: var(--badge-bg); border: none; }
.tl-card.key b { color: var(--red-dark); }
.tl-card.key p i { font-family: var(--font-serif); }

/* ---------- Districts du Valais (ressource) ---------- */
.vsmap-frame { background: var(--card); border-radius: 16px; padding: 10px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.vsmap-svg { width: 100%; height: auto; display: block; }
.vsd-path { stroke: #fff; stroke-width: 0.8; cursor: pointer; transition: filter .15s; }
.vsd-path.sel { stroke: var(--ink); stroke-width: 2; }
.vsd-label { font-family: var(--font-ui); font-size: 13px; font-weight: 700; fill: #fff; pointer-events: none;
  paint-order: stroke; stroke: rgba(0,0,0,0.30); stroke-width: 0.7; }
.vsd-chip.on { border-color: var(--red); background: var(--bad-bg); font-weight: 700; }
.vsd-info { background: var(--card); border-left: 4px solid var(--red); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 13px 15px; margin: 12px 0 16px; animation: vsdFade .25s ease; }
@keyframes vsdFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.vsd-info-h { display: flex; align-items: center; gap: 8px; font-family: var(--font-serif); font-size: 17px; font-weight: 500; margin-bottom: 8px; }
.vsd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); }
.vsd-row span { font-size: 12.5px; color: var(--muted); }
.vsd-row b { font-size: 14px; text-align: right; }
.vsd-note { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.vsd-list { display: flex; flex-direction: column; gap: 14px; }
.vsd-group { }
.vsd-region { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.vsd-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.vsd-items { display: flex; flex-wrap: wrap; gap: 8px; }
.vsd-chip { background: var(--card); border-radius: 12px; padding: 8px 12px; font-size: 13.5px; color: var(--ink); box-shadow: var(--shadow-sm); }
.vsd-chip b { font-variant-numeric: tabular-nums; margin-right: 5px; }

/* ---------- Comprendre la Suisse (politique · piliers · santé) ---------- */
.cs-intro { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0 2px 16px; }
.cs-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 12px 2px 6px; }
.pol-level { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 12px; }
.pol-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pol-head b { font-family: var(--font-serif); font-size: 17px; font-weight: 500; }
.pol-head span { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.pol-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pol-row:first-of-type { border-top: none; }
.pol-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; flex: 0 0 auto; background: var(--bg); }
.pol-leg .pol-ico { background: #E7EDF4; } .pol-exe .pol-ico { background: #FBEDE7; } .pol-jud .pol-ico { background: #F6EDD8; }
.pol-txt { flex: 1; min-width: 0; }
.pol-power { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.pol-txt b { font-size: 15px; }
.pol-txt small { display: block; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; margin-top: 2px; }
.cs-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 11px; }
.cs-card-h { font-family: var(--font-serif); font-size: 15.5px; font-weight: 500; margin-bottom: 4px; }
.cs-card p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.cs-highlight { background: var(--badge-bg); border: none; margin-top: 4px; }
.cs-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cs-list li { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; padding-left: 16px; position: relative; }
.cs-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
/* Schéma « Qui élit qui ? » */
.cs-h { font-family: var(--font-serif); font-size: 18px; font-weight: 500; margin: 22px 2px 8px; }
.qe-peuple { text-align: center; background: var(--red); color: var(--on-red); font-weight: 600; font-size: 13.5px; padding: 11px 14px; border-radius: 13px; box-shadow: var(--shadow-sm); }
.qe-arrow { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 5px 0 2px; }
.qe-level { margin-bottom: 14px; }
.qe-lvl { display: block; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 7px 2px; }
.qe-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qe-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 11px 12px; display: flex; flex-direction: column; gap: 3px; }
.qe-leg { border-top: 3px solid #6E8CAE; }
.qe-exe { border-top: 3px solid var(--red); }
.qe-role { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.qe-card b { font-family: var(--font-serif); font-size: 14px; font-weight: 500; line-height: 1.25; }
.qe-meta { font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }
.qe-by { margin-top: 6px; font-size: 11px; font-weight: 600; padding: 5px 8px; border-radius: 9px; line-height: 1.35; }
.qe-by-people { background: var(--ok-bg); color: var(--ok); }
.qe-by-parl { background: #F6EDD8; color: var(--red-dark); }
/* Assurances sociales : branches par domaine */
.as-branch { display: flex; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); }
.as-branch:first-of-type { border-top: none; padding-top: 4px; }
.as-sig { flex: 0 0 auto; min-width: 52px; height: 26px; padding: 0 9px; border-radius: 8px; background: var(--badge-bg); color: var(--red-dark); font-size: 12px; font-weight: 700; letter-spacing: .3px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.as-txt { flex: 1; min-width: 0; }
.as-txt > b { font-size: 14.5px; display: block; }
.as-txt small { display: block; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin-top: 2px; }
.as-txt small b { font-size: inherit; }
.cs-pillar { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 11px; }
.cs-pillar-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cs-pillar-n { width: 38px; height: 38px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-family: var(--font-serif); font-size: 19px; font-weight: 500; flex: 0 0 auto; }
.cs-pillar-top b { font-size: 16px; } .cs-pillar-top small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.cs-tag { display: inline-block; font-size: 11px; font-weight: 700; border: 1.5px solid; border-radius: 99px; padding: 3px 11px; margin-bottom: 10px; }
.cs-pillar-row { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.cs-pillar-row > span { color: var(--muted); flex: 0 0 62px; }
.cs-pillar-row > b { font-weight: 600; color: var(--ink); }
.cs-duty .cs-list li::before { background: var(--red); }
.cs-right .cs-list li::before { background: var(--ok); }
/* Fiche « Mon canton » */
.mc-head { border-radius: 16px 16px 0 0; color: var(--on-red); padding: 18px 20px 16px; }
.mc-head-top { display: flex; align-items: baseline; justify-content: space-between; }
.mc-name { font-family: var(--font-serif); font-size: 26px; font-weight: 500; }
.mc-code { font-weight: 800; font-size: 14px; letter-spacing: 1px; opacity: .75; }
.mc-region { font-size: 11px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; opacity: .85; margin-top: 3px; }
.mc-head + .cs-card { border-radius: 0 0 16px 16px; border-top: none; margin-top: -1px; }
.mc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.mc-row:first-child { border-top: none; }
.mc-row > span { color: var(--muted); font-size: 13px; flex: 1; }
.mc-row > b { font-size: 14px; text-align: right; }

/* ---------- Sélecteur de canton (Vaud / Genève) ---------- */
.canton-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.canton-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; position: relative;
  background: var(--card); border: 1.5px solid transparent; border-radius: 18px; padding: 18px 20px;
  box-shadow: var(--shadow-sm); font-family: inherit; text-align: left; cursor: pointer; transition: transform .12s ease, border-color .15s; }
.canton-card:active { transform: scale(.985); }
.canton-card.sel { border-color: var(--red); box-shadow: 0 2px 12px rgba(200,68,46,.12); }
.canton-emoji { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.canton-name { font-family: var(--font-serif); font-size: 22px; font-weight: 500; }
.canton-desc { font-size: 12px; color: var(--muted); letter-spacing: .2px; }
.setup-note-top { margin-top: 14px; }

@media (min-width: 481px) { body { padding: 12px 0; } #app { border-radius: 24px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.1); background: var(--bg); min-height: calc(100vh - 24px); } }
