/* SwissBillTracker — design 2026 : clair/sombre automatique, rouge suisse, cartes douces, typographie système. */
:root {
  --bg: #f6f5f2; --bg2: #ffffff; --ink: #16181d; --muted: #5d6470; --line: #e6e3dc;
  --red: #d52b1e; --red2: #ff5a4a; --red-soft: #fdeceb; --ok: #138a4b; --ok-soft: #e6f6ed;
  --warn: #9a6300; --warn-soft: #fff4dc; --shadow: 0 1px 2px rgba(20,20,30,.05), 0 8px 30px rgba(20,20,30,.06);
  --radius: 22px; --radius-sm: 12px;
  --d10: #f2c230; --d20: #e2432f; --d50: #4caf50; --d100: #2f6fd6; --d200: #a0632b; --d1000: #8a4fbf;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --bg2: #171a21; --ink: #eef0f4; --muted: #9aa3b2; --line: #272b35;
    --red-soft: #3a1714; --ok-soft: #10301f; --warn-soft: #33270b; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55;
  font: 16px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--red); text-decoration-thickness: .08em; text-underline-offset: .18em; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.narrow.reading { width: min(912px, 100% - 32px); }   /* pages de lecture : +20 % */
.section { padding: clamp(28px, 5vw, 56px) 0; }
.section-sm { margin-block: 22px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; letter-spacing: .04em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--red); margin-bottom: .6em; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 62ch; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--bg2); padding: 8px 12px; border-radius: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---- Barre du haut ---- */
.topbar { position: sticky; top: 0; z-index: 1000; backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.12rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand b { color: var(--red); font-weight: 800; }
.brand-sm { font-size: 1rem; }
.nav { display: flex; align-items: center; gap: 4px 6px; margin-left: auto; flex-wrap: nowrap; white-space: nowrap; }
.nav > a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 550; font-size: .95rem; }
.nav > a:hover, .nav > a.active { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav > a.btn { color: #fff; }
.nav-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.langs { display: inline-flex; gap: 2px; margin-left: 6px; }
.langs a { font-size: .75rem; font-weight: 700; color: var(--muted); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.langs a.on { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.nav-toggle, .nav-burger { display: none; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 650; font-size: .92rem; background: var(--bg2); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; display: grid; }
.usermenu-pop a, .usermenu-pop .linklike { padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; text-align: left; }
.usermenu-pop a:hover, .usermenu-pop .linklike:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }
.nav-static { margin-left: auto; }
@media (max-width: 1200px) {
  .nav-burger { display: block; margin-left: auto; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); position: relative; cursor: pointer; }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px; content: ""; }
  .nav-burger span { top: 20px; } .nav-burger span::before { top: -6px; left: 0; right: 0; } .nav-burger span::after { top: 6px; left: 0; right: 0; }
  .nav:not(.nav-static) { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--bg2); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 12px 16px 18px; box-shadow: var(--shadow); }
  .nav-toggle:checked ~ .nav { display: flex; }
  .nav-sep { display: none; }
  .usermenu-pop { position: static; box-shadow: none; margin-top: 6px; }
  .langs { margin: 8px 0 0; }
}

/* ---- Boutons ---- */
.btn { --b: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
  font: inherit; font-weight: 650; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--red2), var(--red)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--red) 35%, transparent); }
.btn-primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--red) 45%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.btn-soft { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.btn-danger { background: #b42318; color: #fff; }
.btn-sm { padding: 7px 13px; font-size: .88rem; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 650; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.pill-red { background: var(--red-soft); color: var(--red); }

/* ---- Cartes et blocs ---- */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 28px); box-shadow: var(--shadow); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-block: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .split, .grid3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.flash { margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; font-weight: 600; background: var(--ok-soft); color: var(--ok); }
.flash-warn, .flash-error { background: var(--warn-soft); color: var(--warn); }
.flash-hit { background: linear-gradient(135deg, var(--red2), var(--red)); color: #fff; font-size: 1.1rem; animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.96); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: .92rem; }

/* ---- Accueil ---- */
.hero { padding: clamp(16px, 3vw, 36px) 0 24px; background:
  radial-gradient(900px 400px at 10% -10%, color-mix(in srgb, var(--red) 12%, transparent), transparent 70%),
  radial-gradient(700px 400px at 100% 10%, color-mix(in srgb, var(--d100) 10%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }
.grad { background: linear-gradient(120deg, var(--red2), var(--red) 45%, var(--d1000)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-notes { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-notes li { width: 92px; }
.float { animation: float 6s ease-in-out infinite; }
.f2 { animation-delay: -1s } .f3 { animation-delay: -2s } .f4 { animation-delay: -3s } .f5 { animation-delay: -4s } .f6 { animation-delay: -5s }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg) } 50% { transform: translateY(-6px) rotate(2deg) } }
@media (prefers-reduced-motion: reduce) { .float, .flash-hit { animation: none; } }
.note-svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.12)); }
.note-xs { width: 52px; flex: none; }
.note-lg { width: min(280px, 100%); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 10px auto 0; }
.kpis-sm { margin: 18px 0; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.kpi p { margin: 0; color: var(--muted); font-size: .88rem; }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .bento { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } }
.step-n { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-weight: 800; margin-bottom: 12px;
  background: var(--red-soft); color: var(--red); }
.step-n.sm { width: 26px; height: 26px; border-radius: 8px; font-size: .85rem; margin: 0 6px 0 0; }
.step.accent { background: linear-gradient(145deg, var(--red2), var(--red)); color: #fff; border: 0; }
.step.accent .step-n { background: rgba(255,255,255,.2); color: #fff; }
.feed { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.feed a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.feed a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.feed a > span:first-of-type { flex: 1; }
.passion { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--red) 8%, var(--bg2)), var(--bg2)); }
.passion p { margin: 0; max-width: 70ch; }

/* ---- Carte ---- */
.map { height: 380px; border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--ink) 6%, transparent); z-index: 0; }
.map-hero { height: clamp(320px, 46vw, 460px); }
.map-full { height: min(72vh, 680px); }
.map-card { padding: 8px; }
.hero-map { padding: 8px; }
.map-caption { margin: 8px 6px 2px; }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0; }
.legend li { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.d10 { background: var(--d10); } .d20 { background: var(--d20); } .d50 { background: var(--d50); }
.d100 { background: var(--d100); } .d200 { background: var(--d200); } .d1000 { background: var(--d1000); }
.leaflet-container { font: inherit; }
.leaflet-popup-content-wrapper { border-radius: 12px; }

/* ---- Formulaires ---- */
.form { display: grid; gap: 6px; margin-bottom: 20px; }
.form h2 { margin-bottom: .3em; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; display: grid; gap: 6px; }
legend { font-weight: 750; font-size: 1.1rem; margin-bottom: 10px; display: flex; align-items: center; }
label { font-weight: 600; font-size: .93rem; margin-top: 8px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--red); flex: none; }
.field-error { color: #b42318; font-weight: 600; font-size: .9rem; margin: 2px 0 0; }
.denoms { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 720px) { .denoms { grid-template-columns: repeat(3, 1fr); } }
.denom { margin: 0; cursor: pointer; border-radius: 14px; padding: 6px; border: 2px solid transparent; transition: transform .15s, border-color .15s, background .15s; }
.denom input { position: absolute; opacity: 0; pointer-events: none; }
.denom:hover { transform: translateY(-2px); }
.denom:has(input:checked) { border-color: var(--red); background: var(--red-soft); transform: translateY(-2px); }
.denom:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--red) 55%, transparent); }
.serial-input { position: relative; }
.serial-input input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.5rem; letter-spacing: .14em; text-transform: uppercase; padding: 14px 52px 14px 16px; }
.serial-state { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.serial-state.ok { background: var(--ok); } .serial-state.ok::after { content: "✓"; }
.serial-state.bad { background: #b42318; } .serial-state.bad::after { content: "!"; }
.serial-live { min-height: 1.4em; margin: 2px 0; }
.serial-live.ok { color: var(--ok); } .serial-live.bad { color: #b42318; }
.autocomplete { position: relative; }
.ac-list { position: absolute; z-index: 1100; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 6px; list-style: none; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.ac-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.ac-list li[aria-selected=true], .ac-list li:hover { background: var(--red-soft); }
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 5vw, 60px); align-items: start; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; display: grid; gap: 10px; }
.ticks li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 10px; }
.danger-zone { border-color: color-mix(in srgb, #b42318 40%, var(--line)); }

/* ---- Billet ---- */
.note-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(16px, 4vw, 40px); align-items: center; margin-bottom: 10px; }
@media (max-width: 640px) { .note-head { grid-template-columns: 1fr; } }
.note-head h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .85rem; font-weight: 650; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.chip-hit { background: var(--red-soft); color: var(--red); }
.timeline { list-style: none; padding: 0; margin: 0 0 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: repeating-linear-gradient(var(--line) 0 6px, transparent 6px 10px); }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 8px 0; position: relative; }
.timeline p { margin: 0; }
.dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--bg2); border: 2px solid var(--line); z-index: 1; }
.timeline li.mine .dot { border-color: var(--red); color: var(--red); }
.comment { font-style: italic; color: var(--muted); }

/* ---- Tableau de bord, gamification ---- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; }
.ascent-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ascent-head h3 { font-size: 1.5rem; margin: 0; }
.alt { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.alt span { font-size: 2rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.meter { height: 12px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; margin: 14px 0 8px; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--d50), var(--d100), var(--d1000)); transition: width .6s ease; }
.mountain { list-style: none; padding: 0; margin: 16px 0 0; display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.mountain li { flex: 1; position: relative; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.mountain li.done { background: linear-gradient(180deg, #ffffff 0 14%, color-mix(in srgb, var(--d100) 70%, var(--d50)) 14%); }
.mountain li span, .mountain li em { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .62rem; opacity: 0; transition: opacity .15s; pointer-events: none; }
.mountain li span { bottom: calc(100% + 16px); font-weight: 700; }
.mountain li em { bottom: calc(100% + 3px); font-style: normal; color: var(--muted); }
.mountain li:hover span, .mountain li:hover em { opacity: 1; }
.mountain li:nth-child(1) { height: 8% } .mountain li:nth-child(2) { height: 12% } .mountain li:nth-child(3) { height: 20% }
.mountain li:nth-child(4) { height: 35% } .mountain li:nth-child(5) { height: 39% } .mountain li:nth-child(6) { height: 46% }
.mountain li:nth-child(7) { height: 64% } .mountain li:nth-child(8) { height: 75% } .mountain li:nth-child(9) { height: 84% }
.mountain li:nth-child(10) { height: 90% } .mountain li:nth-child(11) { height: 97% } .mountain li:nth-child(12) { height: 100% }
.mountain-lg { height: 160px; margin-bottom: 14px; }
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; align-items: center; }
.badge-icon { grid-row: span 2; font-size: 1.6rem; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--red-soft); }
.badge-name { font-weight: 700; font-size: .92rem; }
.badge-desc { font-size: .78rem; color: var(--muted); }
.badge.locked { opacity: .45; filter: grayscale(1); }
.passport { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.passport li { aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; font-weight: 800; font-size: .9rem; border: 1.5px dashed var(--line); color: var(--muted); }
.passport li.on { border: 0; color: #fff; background: linear-gradient(145deg, var(--red2), var(--red)); box-shadow: 0 6px 14px color-mix(in srgb, var(--red) 30%, transparent); }
.passport-heat li { border-style: solid; align-content: center; gap: 0; }
.passport-heat li small { font-weight: 600; font-size: .7rem; }
.heat1 { background: color-mix(in srgb, var(--red) 18%, var(--bg2)); color: var(--ink) !important; }
.heat2 { background: color-mix(in srgb, var(--red) 40%, var(--bg2)); color: var(--ink) !important; }
.heat3 { background: color-mix(in srgb, var(--red) 65%, var(--bg2)); color: #fff !important; }
.heat4 { background: var(--red); color: #fff !important; }

/* ---- Tableaux, classements, barres ---- */
.table-card { padding: 6px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table.compact td, .table.compact th { padding: 5px 8px; }
.table td .note-svg { width: 46px; display: inline-block; vertical-align: middle; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 18px 0; }
.empty { text-align: center; }
.rank { list-style: none; counter-reset: r; padding: 0; margin: 0; display: grid; gap: 4px; }
.rank li { counter-increment: r; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.rank li::before { content: counter(r); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: .8rem; font-weight: 800; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.rank li:nth-child(1)::before { background: #f5c542; color: #3b2a00; } .rank li:nth-child(2)::before { background: #cfd5de; color: #222; } .rank li:nth-child(3)::before { background: #d99a63; color: #2b1400; }
.rank li > :first-child { flex: 1; } .rank li b { font-variant-numeric: tabular-nums; }
.rank li.muted::before { display: none; }
.rank-cols { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 56px 1fr 64px; align-items: center; gap: 12px; }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
.bar-label { font-weight: 700; }
.bar { height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--red); min-width: 2px; }

/* largeurs en pas de 5 % (pas de style en ligne : CSP stricte) */
.p0{width:0}.p5{width:5%}.p10{width:10%}.p15{width:15%}.p20{width:20%}.p25{width:25%}.p30{width:30%}.p35{width:35%}.p40{width:40%}.p45{width:45%}.p50{width:50%}
.p55{width:55%}.p60{width:60%}.p65{width:65%}.p70{width:70%}.p75{width:75%}.p80{width:80%}.p85{width:85%}.p90{width:90%}.p95{width:95%}.p100{width:100%}

/* ---- Page numéro, contenu éditorial ---- */
.checker { margin: 20px 0 30px; }
.anatomy { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.anatomy .big { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.anatomy ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.a1 { color: var(--d100); } .a2 { color: var(--red); } .a3 { color: var(--d50); }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .3em 0; }
.history { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 4px; }
.history > li { display: grid; grid-template-columns: 84px 1fr; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.h-year { font-weight: 800; font-size: 1.2rem; color: var(--red); }
.history ul { padding-left: 1.1em; }

/* ---- Pied de page ---- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 36px 0 20px; background: var(--bg2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 24px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid a { display: block; color: var(--ink); text-decoration: none; padding: 3px 0; font-size: .93rem; }
.footer-grid a:hover { color: var(--red); }
.footer-title { font-weight: 750; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 14px; }

/* ---- Admin ---- */
.admin .narrow { max-width: 460px; }
.qr { background: #fff; padding: 12px; border-radius: 14px; width: 240px; margin: 10px auto; }
.qr svg { width: 100%; height: auto; display: block; }
.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
form.inline { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 2px 0; }
form.inline input { width: auto; padding: 6px 8px; }

/* Saisie du code reçu par e-mail */
.code-input { font-size: 2rem !important; letter-spacing: .5em; text-align: center; padding: 14px !important; }
.inline-link { display: inline; width: auto; color: var(--red); text-decoration: underline; padding: 0; }

/* Boutons Suisse / Monde sur les cartes */
.leaflet-control.map-jump { display: flex; overflow: hidden; }
.leaflet-container .leaflet-control.map-jump a.map-jump-btn { width: auto; min-width: 0; padding: 0 12px; font: 650 .8rem/32px ui-sans-serif, system-ui, sans-serif;
  height: 32px; color: #16181d; background: #fff; border-bottom: 0; border-right: 1px solid #ccc; text-decoration: none; white-space: nowrap; }
.leaflet-container .leaflet-control.map-jump a.map-jump-btn:last-child { border-right: 0; }
.leaflet-container .leaflet-control.map-jump a.map-jump-btn:hover { background: #f3f3f3; }

.footer-mail { display: block; width: auto; text-align: left; padding: 3px 0; font-size: .93rem; color: var(--ink); }
.footer-mail:hover { color: var(--red); }

/* Anciennes séries */
.series-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.series-row select { width: auto; min-width: 260px; }
.series-label { margin: 0; }
.denom[hidden] { display: none; }
.note-old { filter: sepia(.55) saturate(.8); }
.chip-old { background: #f3e9d8; color: #6b4a1f; }
@media (prefers-color-scheme: dark) { .chip-old { background: #3a2e1d; color: #e7cfa6; } }

/* FAQ */
.faq { display: grid; gap: 12px; margin: 24px 0; }
.faq-item { padding: 0; }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 54px 18px 22px; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 700; color: var(--red); }
.faq-item[open] summary::after { content: "–"; }
.faq-item summary h2 { font-size: 1.08rem; margin: 0; }
.faq-answer { padding: 0 22px 18px; color: var(--ink); }
.faq-answer p { margin: 0; }

/* Partage d'un billet */
.share-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: center; margin-top: 20px; }
.share-card.share-hit { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.share-preview { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); display: block; }
.share-body h2 { margin-bottom: .4em; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-buttons [hidden] { display: none; }
@media (max-width: 760px) { .share-card { grid-template-columns: 1fr; } }
