:root {
  --bg: #f4f6f5; --card: #ffffff; --ink: #14201d; --muted: #63716d; --line: #e2e8e6;
  --brand: #0f766e; --brand-ink: #ffffff; --brand-soft: #d9f0ec;
  --ok: #15803d; --no: #b91c1c; --warn: #b45309;
  --s-bureau: #2563eb; --s-core: #0891b2; --s-depart: #d97706; --s-cantine: #16a34a; --s-parti: #db2777; --s-ailleurs: #7c3aed; --s-absent: #94a3b8;
  --radius: 16px; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .05);
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1413; --card: #16201e; --ink: #e8efed; --muted: #93a39f; --line: #24312e;
          --brand: #2dd4bf; --brand-ink: #062b27; --brand-soft: #123a35; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 24px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.top h1 { font-size: 22px; letter-spacing: -.01em; }
.top > .av { margin: 0; flex: none; }   /* macaron calé à droite (pas centré par le margin:auto de .av) */
.sub { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.btn { border: 0; border-radius: 12px; padding: 12px 16px; background: var(--brand); color: var(--brand-ink);
  font-weight: 600; cursor: pointer; min-height: 44px; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: transparent; color: var(--no); border: 1.5px solid var(--no); }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.on { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
.err { color: var(--no); font-size: 14px; margin-top: 8px; min-height: 1em; }

/* Sondage du jour */
.poll h2 { font-size: 18px; margin-bottom: 4px; }
.poll .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.poll .yes.on { background: var(--ok); color: #fff; }
.poll .no.on { background: var(--no); color: #fff; }
.meter { display: flex; align-items: baseline; gap: 6px; }
.meter b { font-size: 34px; letter-spacing: -.02em; }
.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--s-depart); transition: width .4s; }

/* Personnes */
.section h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  display: flex; align-items: center; gap: 8px; margin: 18px 4px 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.person { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px;
  text-align: center; cursor: pointer; position: relative; }
.person .name { font-size: 13px; font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .zone { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center;
  font-weight: 700; color: #fff; background-size: cover; background-position: center; border: 3px solid var(--line); }
.meal { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.meal svg { width: 14px; height: 14px; }
.meal.yes { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.meal.no { background: var(--line); color: var(--muted); }
.person.nomeal { opacity: .55; }
.lane .meal { width: 28px; height: 28px; } .lane .meal svg { width: 18px; height: 18px; }
.empty { color: var(--muted); font-size: 14px; padding: 4px; }
.st-bureau .av { border-color: var(--s-bureau); } .st-depart .av { border-color: var(--s-depart); }
.st-core .av { border-color: var(--s-core); } .st-cantine .av { border-color: var(--s-cantine); } .st-parti .av { border-color: var(--s-parti); } .st-ailleurs .av { border-color: var(--s-ailleurs); }
.st-absent { opacity: .6; }

/* Navigation */
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: center; z-index: 5; }
nav.tabs a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); text-decoration: none; font-size: 12px; position: relative; }
nav.tabs a.on { color: var(--brand); font-weight: 600; }
nav.tabs svg { width: 24px; height: 24px; }
.badge { position: absolute; top: 8px; left: 55%; background: var(--no); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg .av { width: 32px; height: 32px; font-size: 12px; border-width: 2px; margin: 0; flex: none; }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; max-width: 80%; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--brand); color: var(--brand-ink); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.bubble .meta { font-size: 11px; opacity: .7; margin-bottom: 2px; }
.msg.ping .bubble { border: 2px dashed var(--s-depart); }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--bg);
  padding: 10px 16px; border-top: 1px solid var(--line); }
.composer form { max-width: 720px; margin: 0 auto; display: flex; gap: 8px; }

/* Panel horizontal (écran mural) */
.panel { min-height: 100vh; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.panel header { display: flex; align-items: center; justify-content: space-between; }
.panel header h1 { font-size: 34px; }
.panel .clock { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lanes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; flex: 1; }
.lane { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; }
.lane h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.lane h2 .n { margin-left: auto; font-size: 28px; }
.lane .people { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.lane .av { width: 84px; height: 84px; font-size: 26px; border-width: 4px; }
.lane .name { font-size: 16px; }
.panel .summary { display: flex; gap: 28px; font-size: 22px; color: var(--muted); }
.panel .summary b { color: var(--ink); font-size: 30px; }
@media (max-width: 900px) { .lanes { grid-template-columns: 1fr 1fr; } }

/* Admin */
.seg { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.seg button { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 8px 14px; white-space: nowrap; cursor: pointer; }
.seg button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; }
.code { font: 600 22px/1.2 ui-monospace, monospace; letter-spacing: .12em; }
.mono { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Feuille d'action */
.sheet-bg { position: fixed; inset: 0; background: rgb(0 0 0 / .4); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
.sheet .av { width: 72px; height: 72px; font-size: 22px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; opacity: 0; transition: .25s; z-index: 30; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hero { text-align: center; margin: 8vh 0 24px; }
.hero .logo { width: 72px; height: 72px; }
.hero h1 { font-size: 30px; margin-top: 10px; }

/* ───────── Ligne de départ façon piste d'athlétisme ───────── */
.race { position: relative; overflow: hidden; border-radius: 22px; margin: 6px 0 4px; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.race-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.race-head b { font-size: 20px; letter-spacing: -.01em; }
.race-head .mood { color: var(--muted); font-size: 14px; }
.race-head .score { margin-left: auto; text-align: right; font-size: 15px; color: var(--muted); line-height: 1; }
.race-head .score b { font-size: 34px; color: var(--ink); }
.race-head .score small { display: block; font-size: 12px; margin-top: 2px; }
.flag { width: 30px; height: 30px; flex: none; border-radius: 6px; transform: rotate(-8deg);
  background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 10px 10px; box-shadow: 0 0 0 2px #111; }
.phase-go .flag { animation: wave 0.6s ease-in-out infinite alternate; }
/* fond uni légèrement texturé : des lignes de couloir à pas fixe traversaient les noms dès que la police
   du téléphone est plus grande ou plus haute (police Samsung, taille de texte système) */
.track { position: relative; padding: 18px 12px 0; min-height: 150px; display: flex; flex-direction: column;
  background: radial-gradient(circle at 20% 10%, rgb(255 255 255 / .10), transparent 45%), #c8553d; }
.runners { flex: 1; align-content: flex-end; display: flex; flex-wrap: wrap; gap: 14px 10px; align-items: flex-end; justify-content: center; padding-bottom: 12px; position: relative; z-index: 1; }
.runner { position: relative; flex: 0 1 auto; min-width: 70px; max-width: 100px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; }   /* avatar, nom, étiquettes : toujours empilés */
.runner .av { width: 56px; height: 56px; border: 3px solid #fff; box-shadow: 0 3px 0 rgb(0 0 0 / .25);
  animation: hop 0.9s ease-in-out infinite; animation-delay: var(--d, 0s); }
.runner .bib { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); background: #fff; color: #111;
  font: 800 11px/1 ui-monospace, monospace; padding: 2px 5px; border-radius: 4px; border: 1.5px solid #111; }
.runner .rname { display: inline-block; max-width: 100%; margin-top: 10px; padding: 1px 7px; border-radius: 99px;
  background: rgb(0 0 0 / .28); font-size: 12px; line-height: 1.3; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.runner .speech { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; white-space: nowrap;
  background: #fff; color: #111; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 10px; z-index: 2;
  animation: pop 2.4s ease-in-out infinite; }
.runner .speech::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: #fff; }
.runner.ghost .av { opacity: .55; filter: grayscale(1); border: 3px dashed #fff; box-shadow: none; animation: wobble 2.6s ease-in-out infinite; }
.runner.ghost .rname { opacity: .8; }
.runner .quip { font-size: 11px; line-height: 1.3; color: #ffe8df; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-track { color: #ffe8df; font-weight: 600; padding: 30px 0 18px; }
.startline { height: 16px; margin: 0 -12px; background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.gone-line { padding: 10px 16px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.phase-go .track { background: radial-gradient(circle at 20% 10%, rgb(255 255 255 / .12), transparent 45%), #16a34a; }
.phase-go .runner .av { animation-duration: .45s; }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; background: var(--c); border-radius: 2px;
  animation: fall 2.2s linear infinite; animation-delay: var(--t); }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes wave { from { transform: rotate(-14deg); } to { transform: rotate(10deg); } }
@keyframes pop { 0%, 70%, 100% { transform: translateX(-50%) scale(1); } 80% { transform: translateX(-50%) scale(1.12); } }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(260px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .race * { animation: none !important; } .confetti { display: none; } }

/* Panel : piste en grand */
.race.big .race-head b { font-size: 30px; } .race.big .race-head .mood { font-size: 18px; }
.race.big .race-head .score b { font-size: 48px; } .race.big .flag { width: 44px; height: 44px; }
.race.big .track { min-height: 210px; padding-top: 26px; }
.race.big .runner { min-width: 100px; max-width: 140px; } .race.big .runner .av { width: 86px; height: 86px; font-size: 26px; }
.race.big .runner .bib { top: 56px; font-size: 14px; } .race.big .runner .rname { font-size: 16px; }
.lanes.three { grid-template-columns: repeat(3, 1fr); }
.lanes.five { grid-template-columns: repeat(5, 1fr); }

/* Admin : scanner de bornes */
.scan-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.scan-item:last-child { border-bottom: 0; }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 18px; }
.bars i { width: 4px; background: var(--line); border-radius: 1px; }
.bars i.on { background: var(--ok); }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.tag.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
a.btn { text-decoration: none; display: inline-block; text-align: center; }

[hidden] { display: none !important; }

.legal summary { cursor: pointer; font-weight: 600; }
.legal p { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.legal b { color: var(--ink); }

/* ───────── v1.6 : accueil repensé ───────── */
.hello { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.hello h1 { font-size: 26px; letter-spacing: -.02em; margin-top: 2px; }
.hello .sub::first-letter { text-transform: uppercase; }
.hello > .av { margin: 0; flex: none; width: 48px; height: 48px; font-size: 17px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px;
  background: var(--brand-soft); color: var(--brand); font-size: 14px; }
.banner b { font-size: 15px; display: block; }
.banner > div > div { opacity: .85; }
.banner .pulse { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.banner.live { background: color-mix(in srgb, var(--s-depart) 16%, var(--card)); color: color-mix(in srgb, var(--s-depart) 80%, var(--ink)); }
.banner.live .pulse { animation: pulse 1.6s ease-out infinite; }
.banner.off { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

.mecard { display: flex; align-items: center; gap: 14px; }
.mecard .av.big { width: 64px; height: 64px; font-size: 22px; margin: 0; flex: none; border-width: 4px; }
.mecard .st-label { font-size: 19px; display: block; letter-spacing: -.01em; }
.mecard.is-paused { background: color-mix(in srgb, var(--s-absent) 14%, var(--card)); }
.pause-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--s-absent); color: #fff; display: grid; place-items: center; flex: none; }
.pause-ic svg { width: 20px; height: 20px; }
.note-chip { margin-top: 8px; border: 0; border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer;
  background: var(--brand-soft); color: var(--brand); font-weight: 600; max-width: 100%; text-align: left; }
.note-chip.empty { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); font-weight: 500; }

.poll .choices { gap: 12px; margin-top: 14px; }
.choice { border: 2px solid var(--line); background: var(--bg); border-radius: 18px; padding: 16px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .15s, background .2s, border-color .2s, color .2s; }
.choice svg { width: 34px; height: 34px; margin-bottom: 4px; }
.choice b { font-size: 18px; } .choice span { font-size: 12px; color: var(--muted); }
.choice:active { transform: scale(.95); }
.choice.yes.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.choice.no.on { background: var(--s-absent); border-color: var(--s-absent); color: #fff; }
.choice.on span { color: inherit; opacity: .85; }
.choice.on svg { animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: none; } }
.counts { margin: 4px 4px 0; }

details.section > summary { list-style: none; cursor: pointer; font-size: 14px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); display: flex; align-items: center; gap: 8px; margin: 18px 4px 10px; font-weight: 600; user-select: none; }
details.section > summary::-webkit-details-marker { display: none; }
details.section .count { background: var(--line); color: var(--ink); border-radius: 99px; padding: 0 8px; font-size: 12px; letter-spacing: 0; }
details.section .chev { width: 18px; height: 18px; margin-left: auto; transition: transform .25s; }
details.section:not([open]) .chev { transform: rotate(-90deg); }
details.section[open] .people { animation: fadeUp .3s ease-out; }
.person { transition: box-shadow .2s, transform .15s; }
.person:active { transform: scale(.96); }
.person .note { font-size: 10.5px; margin-top: 4px; padding: 2px 6px; border-radius: 8px; background: var(--brand-soft); color: var(--brand);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note.big { display: inline-block; font-size: 13px; padding: 4px 10px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); margin-top: 6px; }
.person .zone svg { width: 10px; height: 10px; vertical-align: -1px; }
.person.paused .av { filter: grayscale(1); border-style: dashed; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* statut du jour, couleur */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { border: 1.5px solid var(--line); background: var(--bg); border-radius: 99px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.chip:active { background: var(--brand-soft); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1.5px var(--line);
  cursor: pointer; color: #fff; font-weight: 700; font-size: 13px; transition: transform .15s; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.08); }
.paused-box { border-color: var(--s-absent); }

/* statistiques */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile b { display: block; font-size: 28px; letter-spacing: -.02em; color: var(--brand); }
.tile span { font-size: 13px; color: var(--muted); }
.stat { animation: fadeUp .4s ease-out both; animation-delay: calc(var(--i) * 60ms); }
.stat-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.stat-head h3 { font-size: 17px; }
.stat-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.stat-ic svg { width: 24px; height: 24px; }
.ic-medal { background: #fef3c7; color: #b45309; } .ic-flame { background: #ffedd5; color: #ea580c; }
.ic-snail { background: #ede9fe; color: #7c3aed; } .ic-bolt { background: #fef9c3; color: #a16207; }
.ic-box { background: #e2e8f0; color: #475569; } .ic-clock { background: #dbeafe; color: #2563eb; }
.podium { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.podium li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.podium li.r1 { background: color-mix(in srgb, #f59e0b 14%, transparent); }
.podium .rank { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--line); color: var(--ink); flex: none; }
.podium .r1 .rank { background: #f59e0b; color: #fff; } .podium .r2 .rank { background: #94a3b8; color: #fff; } .podium .r3 .rank { background: #b45309; color: #fff; }
.podium .av { width: 34px; height: 34px; font-size: 13px; border-width: 2px; margin: 0; flex: none; }

/* administration des statistiques */
.radio { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); margin: 8px 0; }
.radio input { width: auto; min-height: 0; margin-top: 4px; }
.ev-day { font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.ev-day::first-letter { text-transform: uppercase; }
.ev-row { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ev-row input { width: 110px; min-height: 34px; padding: 4px 8px; }
.ev-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }

@media (prefers-color-scheme: dark) {
  .ic-medal, .ic-flame, .ic-snail, .ic-bolt, .ic-box, .ic-clock { background: var(--brand-soft); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.pause-grid { gap: 10px; }
.tag.rot { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.scan-item .acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* v1.7 : file d'attente, ligne franchie */
:root { --s-file: #ca8a04; }
.st-file .av { border-color: var(--s-file); }
.queue-card { display: flex; align-items: center; gap: 14px; }
.q-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--s-file) 16%, transparent); color: var(--s-file); }
.q-ic svg { width: 26px; height: 26px; }
.q-est { text-align: right; line-height: 1; } .q-est b { font-size: 30px; letter-spacing: -.02em; } .q-est small { display: block; font-size: 12px; color: var(--muted); }
.finish { margin: 0 -12px; padding: 10px 12px 14px; background: radial-gradient(circle at 80% 0, rgb(255 255 255 / .10), transparent 50%), #15803d; }
.finish-head { color: #dcfce7; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.finishers { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.runner.done { min-width: 66px; max-width: 96px; }
.runner.done .av { width: 46px; height: 46px; font-size: 15px; animation: none; }
.ftag { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; margin-top: 3px; font-size: 10.5px; font-weight: 700; background: #fff; color: #15803d; border-radius: 99px; padding: 1px 7px; }
.ftag.q { background: #fef3c7; color: #a16207; }
.race.big .runner.done { min-width: 90px; max-width: 130px; } .race.big .runner.done .av { width: 64px; height: 64px; font-size: 20px; } .race.big .ftag { font-size: 13px; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.facts dt { font-size: 12px; color: var(--muted); } .facts dd { margin: 2px 0 0; font-weight: 700; }
.ic-queue { background: #fef3c7; color: #a16207; } .ic-rocket { background: #fee2e2; color: #dc2626; } .ic-chef { background: #f1f5f9; color: #334155; }
@media (prefers-color-scheme: dark) { .ic-queue, .ic-rocket, .ic-chef { background: var(--brand-soft); } }

/* v1.7.1 : diagnostic */
.verdict.ok { border-color: var(--ok); color: var(--ok); } .verdict.warn { border-color: var(--warn); color: var(--warn); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check .ck { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; color: #fff; }
.check.ok .ck { background: var(--ok); } .check.ko .ck { background: var(--no); }
.tip { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); font-size: 14px; }
.tag.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tag.weak { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
[data-find] { cursor: pointer; }
.finder .big-signal { text-align: center; margin: 6px 0; } .finder .big-signal b { font-size: 56px; letter-spacing: -.03em; } .finder .big-signal small { color: var(--muted); margin-left: 4px; }
.gauge { position: relative; height: 14px; border-radius: 99px; background: var(--line); overflow: visible; margin: 6px 0 10px; }
.gauge i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #22c55e, #f59e0b, #ef4444); transition: width .4s; }
.gauge span { position: absolute; top: -4px; width: 3px; height: 22px; background: var(--ink); border-radius: 2px; }
.diag-r pre { white-space: pre-wrap; font-size: 11px; max-height: 260px; overflow: auto; background: var(--bg); padding: 8px; border-radius: 10px; }
.diag-r summary { cursor: pointer; }
.update-card { display: flex; align-items: center; gap: 12px; border-color: var(--brand); background: var(--brand-soft); }
.update-card .acts { display: flex; flex-direction: column; gap: 6px; }

/* « Au café » */
:root { --s-cafe: #92400e; }
@media (prefers-color-scheme: dark) { :root { --s-cafe: #d97706; } }
.st-cafe .av { border-color: var(--s-cafe); }
.lanes.six { grid-template-columns: repeat(6, 1fr); }

/* environnement de test : bandeau bien visible */
.env-ribbon { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 50; pointer-events: none;
  background: #ea580c; color: #fff; font: 800 11px/1 system-ui, sans-serif; letter-spacing: .12em; padding: 4px 12px 5px; border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 6px rgb(0 0 0 / .25); }

/* ═════════ Administration v1.8 : pensée pour un téléphone moyen ou petit ═════════ */
.admin .top { margin-bottom: 10px; }
.tabs-scroll { margin: 0 -16px 14px; padding: 2px 16px 6px; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%); }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll button { scroll-snap-align: center; font-weight: 600; font-size: 14px; }
.admin .card { overflow-wrap: anywhere; }
.admin .card h3 { margin-bottom: 8px; }
.btn.full { width: 100%; margin-top: 10px; }
.admin > #adm > .btn.full:first-child, .admin #adm > .row:first-child { margin: 0 0 12px; }
.help { font-size: 13px; color: var(--muted); margin: 6px 2px 0; line-height: 1.4; }
.field { margin-top: 12px; } .field:first-of-type { margin-top: 4px; }
.field label { margin: 0 0 5px; font-weight: 600; color: var(--ink); font-size: 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.pair .field { margin-top: 12px; min-width: 0; }
.unit { display: flex; align-items: center; gap: 8px; } .unit input { flex: 1; min-width: 0; } .unit span { color: var(--muted); font-size: 14px; flex: none; }
.save-bar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 4; margin-top: 4px; }
.save-bar .btn { box-shadow: 0 6px 18px rgb(0 0 0 / .18); }
/* jours du sondage : pastilles à cocher */
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { margin: 0; } .day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: grid; place-items: center; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.day input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.day input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
/* interrupteurs */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 4px; color: var(--ink); cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; } .switch-row .help { margin: 2px 0 0; }
input.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; min-height: 0; padding: 0; border-radius: 99px; border: 0;
  background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s; }
input.switch:checked { background: var(--brand); } input.switch:checked::after { transform: translateX(20px); }
/* listes */
.card.list { padding: 4px 14px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; }
.li:last-child { border-bottom: 0; } .li.static { cursor: default; }
.li:active:not(.static) { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.li .grow { min-width: 0; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t .tag { vertical-align: 1px; margin-left: 4px; }
.li .s { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.li .s .tag { margin-top: 3px; }
.mono-s { font-family: ui-monospace, monospace; font-size: 12px !important; }
.li > .av { width: 42px; height: 42px; font-size: 15px; border-width: 2px; margin: 0; flex: none; }
.li .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 700; font-size: 17px; }
.li .ic.beacon { background: var(--brand-soft); } .li .ic.beacon.off { background: var(--line); }
.li-chev { color: var(--muted); flex: none; }
.order { display: flex; flex-direction: column; gap: 2px; flex: none; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 34px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.icon-btn:disabled { opacity: .25; } .icon-btn:active:not(:disabled) { background: var(--line); }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 16px 4px 8px; }
.group-title .count { background: var(--line); color: var(--ink); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kpis div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.kpis b { display: block; font-size: 24px; color: var(--brand); } .kpis span { font-size: 12px; color: var(--muted); }
/* panneau du bas */
.sheet.tall { max-height: 92vh; display: flex; flex-direction: column; padding: 0; animation: sheetUp .25s ease-out; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px 8px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { overflow-y: auto; padding: 4px 18px calc(18px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; }
.seg2 button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg2 button.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 4px rgb(0 0 0 / .12); }
/* codes */
.code.big { font-size: 30px; text-align: center; padding: 14px 8px; margin: 10px 0 4px; background: var(--bg); border-radius: 14px; letter-spacing: .18em; }
.code-card .row .btn { min-width: 0; }
.link-box { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 8px 0 2px; }
/* journal des stats et scanner : retour à la ligne sur petit écran */
.ev-row { flex-wrap: wrap; } .ev-row .grow { min-width: 160px; }
.scan-item { flex-wrap: wrap; } .scan-item .grow { min-width: 0; flex: 1 1 160px; }
.scan-item .acts { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 360px) {
  .pair { grid-template-columns: 1fr; }
  .code.big { font-size: 24px; letter-spacing: .12em; }
  .day span { height: 36px; font-size: 12px; }
}
@media (max-width: 420px) { .ev-add { grid-template-columns: 1fr; } }
html, body { overflow-x: clip; }   /* jamais de défilement horizontal de la page */
.tabs-scroll { position: relative; }

/* ═════════ v1.8 : 3 choix, lieux, départ collectif, version web ═════════ */
.poll .choices.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choices.three .choice { padding: 14px 6px; }
.choices.three .choice svg { width: 28px; height: 28px; }
.choices.three .choice b { font-size: 15px; } .choices.three .choice span { font-size: 11px; line-height: 1.25; text-align: center; }
.choice.out.on { background: #2563eb; border-color: #2563eb; color: #fff; }
.out-mode { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.out-mode .seg2 button { font-size: 13px; line-height: 1.25; }
.meal.out { background: color-mix(in srgb, #2563eb 15%, transparent); color: #2563eb; }
.meal.no { background: var(--line); color: var(--muted); }
/* sondage des lieux, résultats en direct */
.place-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.place-row { display: flex; align-items: center; gap: 4px; }
.place { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; overflow: hidden; text-align: left; }
.place .pbar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, #2563eb 14%, transparent); transition: width .5s ease; }
.place.on { border-color: #2563eb; } .place.on .pbar { background: color-mix(in srgb, #2563eb 26%, transparent); }
.place > *:not(.pbar) { position: relative; }
.place .pname { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place .pvoters { display: flex; } .place .pvoters .av { margin-left: -6px; }
.av.xs { width: 24px; height: 24px; font-size: 10px; border-width: 2px; margin: 0; border-color: var(--card); }
.place .pcount { font-size: 18px; min-width: 22px; text-align: right; color: #2563eb; }
.add-place { margin-top: 4px; flex-wrap: nowrap; }
/* départ collectif */
.coll-admin { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-color: var(--s-depart); }
.coll-admin .row { flex-wrap: nowrap; }
.coll-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 30%, #16a34a, #0f5132); color: #fff; animation: collIn .35s ease-out; }
.coll-overlay.out { background: radial-gradient(circle at 50% 30%, #2563eb, #1e3a8a); }
.coll-overlay.bye { animation: collOut .3s ease-in forwards; }
.coll-box { text-align: center; max-width: 420px; position: relative; z-index: 1; }
.coll-box h1 { font-size: 46px; letter-spacing: -.02em; margin: 14px 0 4px; animation: pop .6s cubic-bezier(.3,1.6,.5,1); }
.coll-where { font-size: 20px; font-weight: 700; margin: 0 0 18px; }
.coll-flag { width: 64px; height: 64px; margin: 0 auto; border-radius: 10px; transform: rotate(-8deg);
  background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 16px 16px; box-shadow: 0 0 0 3px #fff; animation: wave .5s ease-in-out infinite alternate; }
.coll-runners { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 16px; }
.coll-runners span { animation: dash 1.1s ease-in-out infinite; animation-delay: var(--d); }
.coll-runners .av { width: 44px; height: 44px; font-size: 15px; border: 3px solid #fff; margin: 0; }
.coll-box .sub { color: rgb(255 255 255 / .85); }
.coll-box .btn { background: #fff; color: #111; margin-top: 14px; padding: 14px 34px; font-size: 18px; border-radius: 99px; }
.coll-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.coll-confetti i { position: absolute; top: -14px; width: 9px; height: 15px; background: var(--c); border-radius: 2px; animation: fallBig 2.6s linear infinite; animation-delay: var(--t); }
@keyframes collIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes collOut { to { opacity: 0; transform: scale(.96); } }
@keyframes dash { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px) rotate(-6deg); } }
@keyframes fallBig { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(110vh) rotate(720deg); } }
/* piste extérieur : couleur propre */
.race-kicker { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.race.out .track { background: radial-gradient(circle at 20% 10%, rgb(255 255 255 / .10), transparent 45%), #1e40af; }
.race.out .finish { background: radial-gradient(circle at 80% 0, rgb(255 255 255 / .10), transparent 50%), #1e3a8a; }
.race.out .ftag { color: #1e3a8a; }
.races.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* version web : se déclarer */
.declare .chips { margin: 10px 0 0; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.notif-card .n-detail { border-left: 2px solid var(--line); padding-left: 12px; margin-left: 4px; }
.notif-card .n-detail.off { opacity: .45; }
.push-box { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.push-box svg { width: 16px; height: 16px; vertical-align: -3px; }
@media (display-mode: standalone) {
  .wrap { padding-top: calc(16px + env(safe-area-inset-top)); }
  .env-ribbon { top: env(safe-area-inset-top); }
}
@media (max-width: 360px) { .choices.three .choice span { display: none; } }
