/* Ergreg — styles. Sombre par défaut (salle, lumière tamisée), thème clair en option. */

:root {
  --bg: #0b1220;
  --bg2: #111a2c;
  --card: #16213a;
  --line: rgba(255,255,255,.08);
  --text: #eef2f8;
  --muted: #9aa4b1;
  --accent: #4fc3f7;
  --accent2: #ffb74d;
  --ok: #66bb6a;
  --hr: #ef5350;
  --chart-text: #9aa4b1;
  --chart-grid: rgba(255,255,255,.08);
  --chart-font: 12px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  /* Dégradés des tuiles : mêmes tons que le thème, nuances différentes */
  --g0: linear-gradient(135deg, #16213a, #1d3157);
  --g1: linear-gradient(135deg, #16213a, #17384a);
  --g2: linear-gradient(135deg, #17253f, #0f3d5c);
  --g3: linear-gradient(135deg, #1f2238, #3a2f1c);
  --g4: linear-gradient(135deg, #1c2140, #2e2454);
  --g5: linear-gradient(135deg, #1b2238, #3b1f2c);
  --g6: linear-gradient(135deg, #15263a, #13413d);
  --g7: linear-gradient(135deg, #1a2140, #3a2c16);
  --g8: linear-gradient(135deg, #17223a, #40331a);
  --g9: linear-gradient(135deg, #172236, #23335a);
  --g10: linear-gradient(135deg, #1a2236, #2c2e4a);
  --g11: linear-gradient(135deg, #142239, #1d3a52);
}
html.light {
  --bg: #f3f5f9;
  --bg2: #ffffff;
  --card: #ffffff;
  --line: rgba(0,0,0,.08);
  --text: #16213a;
  --muted: #5b6573;
  --chart-text: #5b6573;
  --chart-grid: rgba(0,0,0,.08);
  --g0: linear-gradient(135deg, #ffffff, #e3ecfb);
  --g1: linear-gradient(135deg, #ffffff, #dff3fb);
  --g2: linear-gradient(135deg, #ffffff, #d7ecf8);
  --g3: linear-gradient(135deg, #ffffff, #fbedd8);
  --g4: linear-gradient(135deg, #ffffff, #ebe3fb);
  --g5: linear-gradient(135deg, #ffffff, #fbe1e6);
  --g6: linear-gradient(135deg, #ffffff, #dcf5ef);
  --g7: linear-gradient(135deg, #ffffff, #fbe8d1);
  --g8: linear-gradient(135deg, #ffffff, #f7f0cf);
  --g9: linear-gradient(135deg, #ffffff, #dde6fb);
  --g10: linear-gradient(135deg, #ffffff, #e6e4f3);
  --g11: linear-gradient(135deg, #ffffff, #d9eef8);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
body { padding-bottom: 40px; }
h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
h3 { font-size: .95rem; margin: .8rem 0 .4rem; color: var(--muted); font-weight: 600; }
code { background: var(--line); padding: 0 .3em; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- en-tête ---------- */
.top { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; background: var(--bg2); border-bottom: 1px solid var(--line);
  padding-top: calc(.8rem + env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand .logo { display: inline-flex; align-items: center; background: #0a0a0a; border-radius: 10px; padding: .35rem .6rem; }
.brand .logo img { display: block; height: 30px; width: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sub { margin: 0; color: var(--muted); font-size: .85rem; }
.conn { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pill { padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--line); }
.pill.off { color: var(--muted); }
.pill.busy { color: var(--accent2); }
.pill.on { color: var(--ok); background: rgba(102,187,106,.15); }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: .55rem .95rem;
  border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; transition: transform .08s, background .15s; }
.btn:hover { background: var(--bg2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: #062033; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--hr); }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn.icon { font-size: 1.1rem; padding: .4rem .7rem; line-height: 1; }

.warn { margin: .8rem 1rem; padding: .7rem .9rem; border-radius: 10px; background: rgba(255,183,77,.15); color: var(--text); border: 1px solid rgba(255,183,77,.4); font-size: .9rem; }

/* ---------- synchronisation & aide connexion ---------- */
.btn.sync { color: var(--accent2); font-weight: 700; }
.sync-bar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.session .sync-state { font-size: .85rem; font-weight: 600; }
.session .sync-state.ok { color: var(--ok); }
.session .sync-state.ko { color: var(--hr); }
.session .sync-state.wait { color: var(--accent2); }
.session .sync-state a { color: inherit; }
details.help { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin-bottom: .8rem; font-size: .9rem; }
details.help summary { cursor: pointer; font-weight: 600; color: var(--accent2); }
details.help ul { margin: .5rem 0 .2rem; padding-inline-start: 1.2rem; color: var(--muted); }
details.help li { margin: .25rem 0; }
.pill.busy::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: currentColor; margin-inline-end: .4em; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- plein écran ---------- */
.btn-exit { position: fixed; top: .5rem; inset-inline-end: .5rem; z-index: 60; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(127,127,127,.35); color: var(--text); font-size: 1.1rem; cursor: pointer; opacity: .55; }
.btn-exit:hover { opacity: 1; }
html.fs .top, html.fs .tabs, html.fs .autosave, html.fs .swipe-hint { display: none; }
html.fs .panel { padding: .5rem; max-width: none; }
html.fs .tile.big .val { font-size: clamp(2.6rem, 7vw, 5rem); }
html.fs .tile .val { font-size: clamp(1.8rem, 4.2vw, 3rem); }
html.fs .chart { height: clamp(200px, 30vh, 360px); }
html.fs body { padding-bottom: 0; }

/* ---------- onglets ---------- */
.tabs { display: flex; gap: .2rem; padding: .5rem .6rem 0; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; overflow-x: auto; }
.tab { flex: 1 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted);
  padding: .6rem .6rem; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--text); border-color: var(--accent); }
.badge { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px; background: var(--accent); color: #062033; font-size: .75rem; text-align: center; margin-inline-start: .3em; }

.panel { display: none; padding: 1rem; max-width: 1200px; margin: 0 auto; }
.panel.active { display: block; }

/* ---------- barre de séance ---------- */
.workout-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; color: var(--muted); font-size: .9rem; }
.workout-bar .state { font-weight: 600; color: var(--text); }
.workout-bar .state.active { color: var(--ok); }
.workout-bar .state.rest { color: var(--accent2); }
.workout-bar .state.done { color: var(--accent); }
.progress { position: relative; height: 22px; border-radius: 999px; background: var(--card); overflow: hidden; margin-bottom: .8rem; border: 1px solid var(--line); }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #81d4fa); transition: width .4s linear; }
.progress-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; font-weight: 600; }

/* ---------- pages glissantes ---------- */
.swipe { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -1rem; padding: 0 1rem; cursor: grab; }
.swipe::-webkit-scrollbar { display: none; }
.swipe.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.page { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; min-width: 0; padding-inline-end: 0; }
.page + .page { margin-inline-start: 2rem; }
.dots { display: flex; justify-content: center; gap: .5rem; margin: .5rem 0 .2rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--line); padding: 0; cursor: pointer; }
.dot.active { background: var(--accent); }
.swipe-hint { text-align: center; margin: 0 0 .6rem; font-size: .8rem; }

/* ---------- tuiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem .6rem; display: grid;
  grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: baseline; min-height: 84px; overflow: hidden; }
.tile .lbl { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding-inline-end: 1.6rem; }
.tile .val { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .unit { color: var(--muted); font-size: .8rem; margin-inline-start: .3rem; }
.tile.big { grid-column: span 2; min-height: 110px; }
.tile.big .val { font-size: 2.8rem; }
.tile.accent .val { color: var(--accent); }
.tile.pulse { animation: pulse .35s ease-out; }
.tile.g0 { background: var(--g0); } .tile.g1 { background: var(--g1); } .tile.g2 { background: var(--g2); } .tile.g3 { background: var(--g3); }
.tile.g4 { background: var(--g4); } .tile.g5 { background: var(--g5); } .tile.g6 { background: var(--g6); } .tile.g7 { background: var(--g7); }
.tile.g8 { background: var(--g8); } .tile.g9 { background: var(--g9); } .tile.g10 { background: var(--g10); } .tile.g11 { background: var(--g11); }
.tile .edit { position: absolute; top: .35rem; inset-inline-end: .35rem; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(127,127,127,.18); color: var(--muted); font-size: .85rem; cursor: pointer; opacity: .6; line-height: 26px; padding: 0; }
.tile .edit:hover { opacity: 1; background: rgba(127,127,127,.35); }
.tile select.picker { position: absolute; inset: 0; width: 100%; height: 100%; font: inherit; font-weight: 600; background: var(--bg2); color: var(--text);
  border: 2px solid var(--accent); border-radius: var(--radius); padding: .5rem; z-index: 2; }
/* Glisser-déposer des tuiles */
.tiles .tile:not(.add) { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile-ghost { position: fixed; z-index: 60; margin: 0; pointer-events: none; opacity: .93; transform: scale(1.05); box-shadow: 0 14px 34px rgba(0,0,0,.55); border-color: var(--accent); }
.tile-ghost .edit { display: none; }
.tile.drag-src { opacity: .35; }
.tile.drop-before, .tile.drop-after { box-shadow: 0 0 0 2px var(--accent) inset; }
.tile.drop-before::before, .tile.drop-after::before { content: ""; position: absolute; top: 6px; bottom: 6px; width: 4px; border-radius: 2px; background: var(--accent); }
.tile.drop-before::before { inset-inline-start: -5px; }
.tile.drop-after::before { inset-inline-end: -5px; }
.sheet-hint { margin: -.3rem 0 0; color: var(--muted); font-size: .8rem; }
/* Tuile « + » (ajouter une donnée à l'écran) */
.tile.add { display: grid; place-items: center; align-content: center; gap: .1rem; border-style: dashed; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.tile.add .plus { font-size: 1.7rem; line-height: 1; }
.tile.add .lbl { grid-column: auto; padding: 0; text-transform: none; letter-spacing: 0; }
.tile.add:hover { color: var(--text); border-color: var(--accent); }
/* En-tête de chaque écran glissant */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .1rem 0 .6rem; }
.page-title { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.split-mode { font: inherit; font-size: .9rem; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .3rem .6rem; }
#splitsTable tr.current td { color: var(--muted); font-style: italic; }
/* Feuille de choix d'une tuile */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg2); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 1rem 1rem 1.3rem; width: 100%; max-width: 520px; display: grid; gap: .8rem; box-shadow: 0 -20px 60px rgba(0,0,0,.5); }
.sheet h3 { margin: 0; font-size: 1rem; }
.sheet .row { display: flex; gap: .5rem; flex-wrap: wrap; }
.sheet .field { display: grid; gap: .3rem; }
.sheet .field > span { color: var(--muted); font-size: .85rem; }
.sheet select { font: inherit; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; width: max-content; }
.seg button { background: transparent; color: var(--text); border: 0; padding: .45rem 1.1rem; font: inherit; cursor: pointer; }
.seg button.on { background: var(--accent); color: #062033; font-weight: 700; }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 18px; } }
/* Tuile FC colorée par zone : fond plein de la couleur de la zone */
.tile.zoned { border-color: transparent; }
.tile.zoned .lbl, .tile.zoned .unit, .tile.zoned .val { color: inherit; }
.tile.zoned .edit { color: inherit; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(79,195,247,.5); } to { box-shadow: 0 0 0 10px rgba(79,195,247,0); } }
@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile.big .val { font-size: 2.3rem; }
  .tile .val { font-size: 1.5rem; }
}

/* ---------- zones cardiaques ---------- */
.zones { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: 1rem; }
.zone-head { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .5rem; }
.zone-head #zoneCurrent { color: var(--text); font-weight: 700; text-transform: none; letter-spacing: 0; }
.zone-bar { display: flex; height: 20px; border-radius: 999px; overflow: hidden; background: var(--line); }
.zone-bar span { flex: 0 0 0; transition: flex .5s; min-width: 0; font-size: .7rem; font-weight: 700; display: grid; place-items: center; color: #0b1220; overflow: hidden; white-space: nowrap; }
.zone-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .5rem; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.zone-legend i, .swatch { display: inline-block; width: .85em; height: .85em; border-radius: 3px; margin-inline-end: .4em; vertical-align: -1px; }
.zones-table input { width: 5.5em; font: inherit; padding: .3rem .4rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); text-align: end; }
.zones-table td:first-child { white-space: nowrap; }

/* ---------- graphiques ---------- */
.charts { display: grid; grid-template-columns: 1fr; gap: .7rem; margin-bottom: 1rem; }
.chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); height: 220px; padding: 4px; position: relative; overflow: hidden; }
.chart canvas { display: block; }

/* ---------- guide fractionné / course ---------- */
.guide { background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); padding: .8rem .9rem; margin-bottom: .8rem; }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .4rem; }
.guide-name { font-weight: 700; }
.guide-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.guide-phase { display: grid; }
.guide-phase .lbl { color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.guide-phase .val { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; }
.guide-phase .sub { font-size: .85rem; }
.guide-next { color: var(--muted); font-size: .9rem; text-align: end; }
.guide .progress { margin: .6rem 0 .2rem; height: 12px; }
.guide.phase-warmup { border-color: #66bb6a; } .guide.phase-warmup .lbl { color: #66bb6a; }
.guide.phase-work { border-color: #ef5350; } .guide.phase-work .lbl { color: #ef5350; }
.guide.phase-rest { border-color: #ffb74d; } .guide.phase-rest .lbl { color: #ffb74d; }
.guide.phase-cooldown { border-color: #4fc3f7; } .guide.phase-cooldown .lbl { color: #4fc3f7; }
.guide.phase-race { border-color: #ba68c8; } .guide.phase-race .lbl { color: #ba68c8; }
.guide.phase-done { border-color: var(--ok); } .guide.phase-done .lbl { color: var(--ok); }
.reps { margin-top: .5rem; }
.track-wrap { margin-top: .6rem; }
#track { width: 100%; max-height: 220px; display: block; }
#trackPath { fill: none; stroke: var(--line); stroke-width: 22; stroke-linejoin: round; }
html.light #trackPath { stroke: #dfe5ee; }
#trackFinish { stroke: var(--text); stroke-width: 3; stroke-dasharray: 4 3; }
#ghostDot { fill: #b39ddb; stroke: #fff; stroke-width: 2; opacity: .9; }
#youDot { fill: #4fc3f7; stroke: #fff; stroke-width: 2.5; }
.track-info { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; font-weight: 600; margin-top: .3rem; }
.track-legend { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.track-legend i { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin: 0 .3em 0 .6em; vertical-align: -1px; }
.track-legend .dot-you { background: #4fc3f7; } .track-legend .dot-ghost { background: #b39ddb; }
.gap-ahead { color: var(--ok); } .gap-behind { color: var(--hr); }

/* ---------- séances fractionnées (constructeur) ---------- */
.blocks { display: grid; gap: .5rem; }
.block { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: .5rem; align-items: end; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .6rem; }
.block .field { margin: 0; }
.block .field input { padding: .4rem .5rem; }
@media (max-width: 520px) { .block { grid-template-columns: 1fr 1fr; } .block .btn { grid-column: span 2; } }

/* ---------- splits ---------- */
.splits { margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; }
th, td { padding: .5rem .7rem; text-align: end; white-space: nowrap; }
th:first-child, td:first-child { text-align: start; }
thead th { background: var(--bg2); color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; }
tbody tr:nth-child(even) { background: rgba(127,127,127,.06); }

/* ---------- listes (séances, fractionnés) ---------- */
.hint { color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 0; }
.sessions { display: grid; gap: .7rem; }
.session { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: grid; gap: .5rem; }
.session .head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.session .title { font-weight: 700; }
.session .date { color: var(--muted); font-size: .85rem; }
.presets .cat { margin: .6rem 0 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.presets .cat:first-child { margin-top: 0; }
.session.preset { background: linear-gradient(135deg, var(--card), rgba(79,195,247,.06)); }
.session .stats { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-variant-numeric: tabular-nums; font-size: .95rem; }
.session .stats b { font-weight: 700; }
.session .stats span { color: var(--muted); font-size: .8rem; }
.session .row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.session .sent { color: var(--ok); font-size: .85rem; font-weight: 600; }
.session .sent a { color: inherit; }
.session .desc { color: var(--muted); font-size: .9rem; }
.mini-zones { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line); }
.sess-zones { width: 100%; height: 18px; }
.sess-zones span { transition: none; }
#tab-live > .zones { margin-top: .8rem; }
.mini-zones span { flex: 0 0 0; }

/* ---------- réglages / profil ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .8rem; }
.status { margin: 0 0 .6rem; }
.status.ok { color: var(--ok); }
.status.ko { color: var(--accent2); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; margin-top: .8rem; }
.field { display: grid; gap: .3rem; margin: .6rem 0; }
.field > span { color: var(--muted); font-size: .85rem; }
.field input, .field select { font: inherit; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); width: 100%; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .6rem 0; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .1rem; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.radios { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: .4rem 0; }
.radios label { display: flex; align-items: center; gap: .35rem; cursor: pointer; }
.radios input { accent-color: var(--accent); }

/* ---------- divers ---------- */
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.35); z-index: 50; max-width: 92vw; text-align: center; }
.toast.err { background: var(--hr); color: #fff; }
dialog { border: 0; border-radius: var(--radius); background: var(--card); color: var(--text); padding: 1.2rem; width: min(480px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.55); }
/* Détail d'une séance */
dialog.wide { width: min(980px, 96vw); max-height: 92vh; overflow-y: auto; }
.sd-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.sd-head h2 { margin: 0; }
.sd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .5rem; margin: .8rem 0 1rem; }
.sd-stats div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; font-variant-numeric: tabular-nums; }
.sd-stats span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.sd-stats b { font-size: 1.25rem; }
.sd-stats small { color: var(--muted); }
#sessionDialog h3 { margin: 1rem 0 .5rem; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sd-charts { margin-top: 1rem; }
.sd-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
a.btn { text-decoration: none; display: inline-block; }
dialog h2 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 1.2rem; }
.autosave { margin: 0 0 .5rem; }
