/* GR20 / prépa — feuille de style unique */

/* ---------- Thèmes ---------- */
:root, .t-dark {
  --m1:#151C26; --m2:#1C2532; --m3:#253142; --sun:#E9E2D3;
  --bg:#0F141B; --surface:#141B24; --card:#18202A; --line:#222B37; --line2:#2A3442;
  --text:#F2EEE6; --muted:#A9B3BF; --soft:#C3CBD4; --dim:#6E7A88;
  --sel:#1F2A38; --rest:#121820; --nav:#1B2430;
  --accent:#FF6B4A; --onaccent:#0F141B;
  --ok:#7BD88F; --okbg:#1C3326; --miss:#FF8A70;
  --muscu:#7FB2FF; --gr:#FFC24A;
  --shadow:rgba(0,0,0,.4);
  color-scheme: dark;
}
.t-light {
  --m1:#CBBFAC; --m2:#DCD3C4; --m3:#E9E2D6; --sun:#F2A27A;
  --bg:#F4F2EE; --surface:#FFFFFF; --card:#FFFFFF; --line:#E3DFD7; --line2:#D5D0C6;
  --text:#141A22; --muted:#56606D; --soft:#3B4450; --dim:#8A929C;
  --sel:#FFF1EC; --rest:#EFECE6; --nav:#E9E5DE;
  --accent:#D9431F; --onaccent:#FFFFFF;
  --ok:#1E7A3A; --okbg:#E3F4E8; --miss:#B93A12;
  --muscu:#2F66C9; --gr:#A86A0C;
  --shadow:rgba(20,26,34,.18);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.45;
  transition: background .3s, color .3s;
}
body.noscroll { overflow: hidden; }
a { color: inherit; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, .display { font-family: 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
#app { flex: 1 0 auto; padding-top: 16px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 16px; }
body.has-timer #app { padding-bottom: 180px; }
.page-seance #app { max-width: 1000px; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.hint { font-size: 13px; color: var(--muted); }
.cap { text-transform: capitalize; }

/* ---------- En-tête ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.logo-mark { display: flex; flex-direction: column; gap: 2px; width: 20px; }
.logo-mark span { height: 4px; background: var(--text); }
.logo-mark span:nth-child(2) { background: var(--accent); }
.logo-txt { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.logo-txt b { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nl { padding: 12px 14px; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted); }
.nl:hover { color: var(--accent); }
.nl[aria-current] { background: var(--nav); color: var(--text); font-weight: 700; }
.theme-btn .i-moon { display: none; }
.t-light .theme-btn .i-sun { display: none; }
.t-light .theme-btn .i-moon { display: block; }

/* ---------- Icônes ---------- */
.ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.k-haut, .k-jambes { stroke: var(--muscu); }
.k-cardio, .k-flag { stroke: var(--accent); }
.k-gr { stroke: var(--gr); }
.k-repos { stroke: var(--dim); }

/* ---------- Boutons ---------- */
.btn {
  min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--card); color: var(--text); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .15s, border-color .2s; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn-acc { background: var(--accent); border-color: var(--accent); color: var(--onaccent); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.btn-inv { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn.sm { min-height: 36px; padding: 0 10px; font-size: 13px; background: transparent; white-space: nowrap; }
.btn.big { min-height: 52px; padding: 0 18px; border-radius: 12px; font-size: 16px; font-weight: 800; }
.ibtn {
  width: 44px; height: 44px; flex: none; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s, background .2s, border-color .2s;
}
.ibtn:active { transform: scale(.94); }
.ibtn:disabled { opacity: .35; cursor: default; }
.ibtn.danger { color: var(--miss); }
.ibtn.on { background: var(--sel); border-color: var(--accent); }
.btns { display: flex; gap: 6px; }

/* ---------- Titres de page / panneaux ---------- */
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 8px; }
.phead-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kicker { font-size: 14px; color: var(--muted); }
.phead h1 { margin: 0; font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.05; }
.phead-r { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stat { padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.stat .lbl { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .val { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; font-size: 20px; }
.bar { display: block; height: 4px; border-radius: 2px; background: var(--line2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.bar.ok > span { background: var(--ok); }
.bar.thick { height: 6px; border-radius: 3px; }

.panel { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.panel h2 { margin: 0; font-weight: 800; font-size: 20px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }

.hint-touch { display: none; }

/* ---------- Semaine (accueil) ---------- */
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wkc {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 150px; padding: 12px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); text-decoration: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab;
  transition: transform .2s, border-color .2s, background .2s, opacity .2s;
}
a.wkc:hover { transform: translateY(-3px); border-color: var(--dim); }
.wkc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.wkc-day { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.wkc-num { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; font-size: 22px; line-height: 1.1; }
.wkc-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wkc-title { font-size: 14px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.wkc-status { font-size: 12px; font-weight: 700; }

.is-rest { background: var(--rest); }
.is-rest .wkc-num, .is-rest .mc-num { color: var(--dim); }
.is-today { border-color: var(--accent); }
.is-today .wkc-day, .is-today .mc-num { color: var(--accent); }
.is-drag { opacity: .35; }
.is-over { background: var(--sel) !important; border-color: var(--accent) !important; border-style: dashed !important; }
.st-ok { color: var(--ok); } .st-miss { color: var(--miss); } .st-muted { color: var(--muted); }

/* ---------- Mois (calendrier) ---------- */
.mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mg.dow span { padding: 2px 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.mc {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 104px; min-width: 0; padding: 10px;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); text-decoration: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab;
  transition: transform .2s, border-color .2s, background .2s, opacity .2s;
}
a.mc:hover { transform: translateY(-2px); border-color: var(--dim); }
.mc.out { opacity: .4; }
.mc-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; width: 100%; }
.mc-num { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; font-size: 18px; }
.mc-bot { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; }
.mc-title { font-size: 12px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Séance ---------- */
.sbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.back { min-height: 44px; display: flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; font-weight: 700; color: var(--muted); }
.daynav { display: flex; align-items: center; gap: 6px; }
.daylbl { min-width: 150px; text-align: center; font-size: 14px; font-weight: 700; }
.stitle { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kbadge { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.badge { font-size: 13px; font-weight: 700; color: var(--muted); }
.badge.acc { color: var(--accent); }
.prog { display: flex; flex-direction: column; gap: 4px; min-width: 170px; }
.prog .lbl { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toolrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

.exlist, .edlist, .drlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.exlist { gap: 10px; }
.excard { padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; transition: background .25s, border-color .25s; }
.excard.ok { background: var(--okbg); border-color: var(--ok); }
.exhead { display: flex; align-items: flex-start; gap: 12px; }
.exnum { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--rest); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.excard.ok .exnum { background: var(--ok); color: var(--bg); }
.exinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.exname { font-weight: 800; font-size: 17px; line-height: 1.25; }
.exsum { font-size: 13px; color: var(--muted); }
.sets { display: flex; flex-direction: column; gap: 6px; }
.setrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 92px 92px 44px; gap: 8px; align-items: center; padding: 6px 6px 6px 10px; border-radius: 12px; background: var(--rest); transition: background .25s; }
.setrow.done { background: var(--okbg); }
.excard.ok .setrow { background: transparent; }
.slab { font-size: 13px; font-weight: 800; color: var(--muted); }
.stgt { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit { position: relative; display: block; }
.unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--dim); pointer-events: none; }
.unit .inp { padding-right: 34px; }
.chk { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line2); background: transparent; color: var(--dim); display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s, transform .15s; }
.chk .ico { stroke-width: 3; }
.chk:active { transform: scale(.92); }
.chk.done { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.actions .btn-acc, .actions .btn-ok { flex: 1 1 220px; }
.restbox { margin: 0; padding: 24px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 16px; color: var(--soft); }

/* ---------- Formulaires / éditeur ---------- */
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fld.grow { flex: 1 1 240px; }
.inp { height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font-size: 16px; font-weight: 700; width: 100%; min-width: 0; letter-spacing: normal; text-transform: none; }
.inp:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.inp::placeholder { color: var(--dim); font-weight: 500; }
.edhead { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.edit .edhead { padding: 0; border: none; background: none; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.edlist { gap: 8px; }
.ed { display: grid; grid-template-columns: minmax(0, 2.2fr) 72px minmax(0, 1fr) 96px 96px auto; gap: 8px; align-items: end; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.ed-act { display: flex; gap: 4px; }
.addrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px; border-radius: 14px; border: 1.5px dashed var(--line2); }

/* ---------- Programme ---------- */
.lay { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.side { flex: 1 1 280px; min-width: 0; }
.edit { flex: 999 1 560px; min-width: 0; }
.drlist { gap: 6px; }
.dr {
  width: 100%; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  text-align: left; display: flex; align-items: center; gap: 12px; color: var(--text);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab;
  transition: background .2s, border-color .2s, opacity .2s;
}
.dr.sel { background: var(--sel); border-color: var(--accent); }
.drday { width: 34px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.drt { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drc { font-size: 12px; color: var(--dim); }
.dr .grip { color: var(--dim); stroke-width: 3; }

/* ---------- Exercices ---------- */
.search { height: 44px; width: 100%; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--text); font-size: 16px; }
.search::placeholder { color: var(--dim); }
.searchbox { display: flex; flex-direction: column; gap: 6px; flex: 0 1 320px; min-width: 0; }
.searchbox label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--card); color: var(--text); font-weight: 700; font-size: 14px; flex: none; transition: transform .15s; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.exgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.excell {
  text-align: left; min-height: 116px; padding: 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--text); display: flex; flex-direction: column; justify-content: space-between; gap: 12px; transition: transform .2s, border-color .2s;
}
.excell:hover { transform: translateY(-3px); border-color: var(--dim); }
.exgrp { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.excell .exn { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; font-size: 17px; line-height: 1.15; }
.excell .exeq { font-size: 13px; color: var(--muted); }
.excell > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.empty { grid-column: 1 / -1; margin: 0; padding: 24px; border-radius: 14px; border: 1px dashed var(--line2); color: var(--muted); }

.backdrop { position: fixed; inset: 0; z-index: 70; border: none; padding: 0; margin: 0; background: rgba(8,10,14,.55); animation: fade .25s ease-out; }
.sheet {
  position: fixed; z-index: 71; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 64px); overflow-y: auto;
  padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 60px var(--shadow);
  display: flex; flex-direction: column; gap: 18px; animation: pop .3s cubic-bezier(.2,.8,.2,1);
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet h2 { margin: 0; font-weight: 800; font-size: 26px; line-height: 1.1; }
.sheet .sec { display: flex; flex-direction: column; gap: 8px; }
.sheet .lbl { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cues { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cues li { display: flex; gap: 10px; font-size: 15px; color: var(--soft); }
.cues li::before { content: ''; flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--accent); }
.daytags { display: flex; flex-wrap: wrap; gap: 6px; }
.daytags a, .daytags span { padding: 10px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 14px; font-weight: 700; }

/* ---------- Minuteur ---------- */
.timer {
  position: fixed; z-index: 60; left: 50%; bottom: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(560px, calc(100% - 24px)); padding: 14px 16px; border-radius: 18px;
  background: var(--card); border: 1.5px solid var(--line2); box-shadow: 0 18px 40px var(--shadow);
  display: flex; flex-direction: column; gap: 10px; animation: slideup .35s cubic-bezier(.2,.8,.2,1);
}
.timer.fired { background: var(--sel); border-color: var(--accent); animation: ring .5s ease-in-out 2; }
.trow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ttitle { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.tnext { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tleft { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.tbar { transition: width .25s linear !important; }
.tbtns { display: flex; gap: 6px; }
.tbtns .btn { flex: 1; }
.tbtns .btn-acc { flex: 1.4; }

/* ---------- Fantôme du glisser-déposer ---------- */
.ghost {
  position: fixed; z-index: 80; pointer-events: none; transform: translate(-50%, -60%) rotate(-2deg);
  padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--accent); color: var(--text);
  box-shadow: 0 12px 30px var(--shadow); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.ghost[hidden] { display: none; }
body.dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }

/* ---------- Paysage de bas de page ---------- */
.land { position: relative; height: 200px; overflow: hidden; pointer-events: none; flex: none; }
.land svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.land .sun { fill: var(--sun); }
.land .m3 { fill: var(--m3); } .land .m2 { fill: var(--m2); } .land .m1 { fill: var(--m1); }
.land .trail { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 10; animation: march 10s linear infinite; }
.land .pole { stroke: var(--text); stroke-width: 2; }
.land .fw { fill: var(--text); } .land .fr { fill: var(--accent); }
.land .m3 { animation: up 1s .05s both; } .land .m2 { animation: up 1s .2s both; } .land .m1 { animation: up 1s .35s both; }
.land .sun { animation: up 1.4s both; } .land .flag { animation: up .8s .8s both; }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes up { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes march { to { stroke-dashoffset: -240; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes sheetup { from { transform: translateY(100%); } to { transform: none; } }
@keyframes slideup { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ring { 0%,100% { transform: translate(-50%,0); } 20% { transform: translate(calc(-50% - 6px),0); } 40% { transform: translate(calc(-50% + 6px),0); } 60% { transform: translate(calc(-50% - 4px),0); } 80% { transform: translate(calc(-50% + 4px),0); } }
/* .anim n'est posé qu'au chargement de la page, pour ne pas rejouer les animations à chaque clic */
.anim .rise { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.anim .d1 { animation-delay: .08s; } .anim .d2 { animation-delay: .16s; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .nav { order: 3; width: 100%; margin-left: 0; }
  .nl { flex: 1; text-align: center; padding: 12px 4px; }
  .theme-btn { order: 2; }
  .hint-mouse { display: none; } .hint-touch { display: inline; }

  .wk { grid-template-columns: 1fr; gap: 6px; }
  .wkc { flex-direction: row; align-items: center; min-height: 60px; gap: 12px; }
  a.wkc:hover { transform: none; }
  .wkc-head { flex-direction: column; align-items: flex-start; gap: 0; width: 44px; flex: none; }
  .wkc-body { flex-direction: row; align-items: center; flex: 1; gap: 10px; }
  .wkc-status { margin-left: auto; white-space: nowrap; }

  .mg { gap: 4px; }
  .mc { min-height: 58px; padding: 6px 4px; align-items: center; gap: 4px; }
  a.mc:hover { transform: none; }
  .mc-title, .mc-now { display: none; }
  .mc-num { font-size: 15px; }
  .mc-bot { justify-content: center; }
  .panel { padding: 12px; }

  .setrow { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 44px; padding: 6px; }
  .stgt { display: none; }
  .ed { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ed { position: relative; }
  .ed-name { grid-column: 1 / -1; padding-right: 48px; }
  .ed-act { position: absolute; top: 8px; right: 8px; }
  .ed-act .ibtn { width: 40px; height: 40px; }

  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
  .exgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .excell { min-height: 100px; padding: 12px; }
  .sheet { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 85vh; border-radius: 20px 20px 0 0; padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); animation: sheetup .3s cubic-bezier(.2,.8,.2,1); }
}

/* ---------- Ajouts v2 : serveur, schémas, connexion ---------- */
.site-header .nav + .ibtn { margin-left: 4px; }
.schema { display: flex; justify-content: center; padding: 8px; border-radius: 14px; background: #141B24; border: 1px solid var(--line2); }
.schema img { display: block; width: 100%; max-width: 320px; height: auto; }
#syncerr { position: fixed; z-index: 90; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--miss); color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 8px 24px var(--shadow); }

.page-login .page { justify-content: center; }
.login { width: min(400px, 100%); margin: 0 auto; padding: 32px 20px; display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 1; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.login-brand .logo-mark { width: 32px; gap: 3px; margin-bottom: 8px; }
.login-brand .logo-mark span { height: 6px; }
.login-brand h1 { margin: 0; font-weight: 800; font-size: 34px; line-height: 1.05; }
.login-brand h1 b { color: var(--accent); }
.login-brand p { margin: 0; color: var(--muted); font-size: 15px; }
.login form { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.login .fld { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.profiles { display: flex; flex-wrap: wrap; gap: 8px; }
.profiles .chip { flex: 1; min-height: 44px; }
.login .err { min-height: 1.3em; margin: 0; color: var(--miss); font-size: 14px; font-weight: 700; }
.login .btn-acc { width: 100%; }
@media (max-width: 760px) {
  .site-header .wrap { justify-content: flex-start; gap: 6px; }
  .site-header .ibtn { order: 2; width: 40px; height: 40px; }
  .site-header .nav + .ibtn { margin-left: 0; }
  .logo { margin-right: auto; }
}

/* ---------- Séances faites / manquées, jour courant ---------- */
.t-dark, :root { --done-bg: #1A3A28; --miss-bg: #3A1F1C; --today-bg: #22344A; }
.t-light { --done-bg: #D6F0DE; --miss-bg: #FBE0D8; --today-bg: #E4EEFB; }

.is-done { background: var(--done-bg); border-color: var(--ok); }
.is-miss { background: var(--miss-bg); border-color: var(--miss); border-style: dashed; }
.is-done .wkc-num, .is-done .mc-num { color: var(--ok); }
.is-miss .wkc-num, .is-miss .mc-num { color: var(--miss); }
.is-today {
  border: 2.5px solid var(--accent); background: var(--today-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), 0 8px 22px var(--shadow);
}
.is-today.is-done { background: var(--done-bg); }
.is-today.is-miss { border-style: solid; }
.mc.is-today .mc-num, .wkc.is-today .wkc-num {
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; background: var(--accent); color: var(--onaccent);
  display: inline-flex; align-items: center; justify-content: center;
}
.mc-now { margin-right: auto; margin-left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.mc-mark { width: 22px; height: 22px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.mc-mark .ico { stroke-width: 3.2; }
.mc-mark.ok { background: var(--ok); color: var(--bg); }
.mc-mark.miss { background: var(--miss); color: var(--bg); }
.legend-st { margin-top: -4px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 2px solid; flex: none; }
.lg-done { background: var(--done-bg); border-color: var(--ok); }
.lg-miss { background: var(--miss-bg); border-color: var(--miss); border-style: dashed; }
.lg-today { background: var(--today-bg); border-color: var(--accent); }

/* ---------- En-tête de page : chiffres du mois et boutons alignés ---------- */
.phead-r { align-items: stretch; }
.phead-r .btns { align-items: stretch; }
.phead-r .btns .btn { height: auto; }
.phead-r .btns .ibtn { height: auto; min-height: 44px; }

/* ---------- Choix d'exercice, formulaires, paramètres ---------- */
.ed-nm { font-size: 16px; font-weight: 800; letter-spacing: normal; text-transform: none; color: var(--text); min-height: 44px; display: flex; align-items: center; }
.addrow { align-items: center; }
.form { display: flex; flex-direction: column; gap: 14px; }
.area { height: auto; padding: 10px; resize: vertical; font-family: inherit; line-height: 1.4; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.err { min-height: 1.3em; margin: 0; color: var(--miss); font-size: 14px; font-weight: 700; }
.err.ok { color: var(--ok); }
.danger-t { color: var(--miss); }
.setcols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.setcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.setcol .btn { align-self: flex-start; }
.setcol .hint { margin: 0; line-height: 1.5; }
.inst-help { padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--soft); }
.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv > div:first-child { border-top: none; padding-top: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-weight: 700; text-align: right; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker { width: min(620px, calc(100% - 32px)); }
.picker .chips { flex-wrap: wrap; }
.pk-list { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.pk-item {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; text-align: left; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text); flex: none;
}
.pk-n { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.pk-e { font-size: 12px; color: var(--muted); text-align: right; max-width: 40%; }
.pk-new { font-size: 14px; font-weight: 700; color: var(--accent); }
/* Barre recherche + nouvel exercice */
.extools { display: flex; gap: 10px; align-items: stretch; }
.extools .search { flex: 1; min-width: 0; }
.extools .btn { flex: none; }

/* Glisser-déposer : lignes d'exercice et appui long */
.ed { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: opacity .2s, border-color .2s, background .2s; }
.ed .inp { user-select: text; -webkit-user-select: text; cursor: text; }
.ed-lab { display: flex; align-items: center; gap: 6px; }
.ed-lab .grip { color: var(--dim); stroke-width: 3; }
.is-hold { animation: wiggle .14s ease-in-out infinite; border-color: var(--accent); }
@keyframes wiggle { 0%, 100% { transform: rotate(-1.4deg) scale(1.02); } 50% { transform: rotate(1.4deg) scale(1.02); } }
.ibtn[aria-current] { border-color: var(--accent); color: var(--accent); }

/* ---------- Survol des boutons ---------- */
button, .btn, .ibtn, .chip, .nl, .back { transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, background-color .2s, border-color .2s, color .2s, opacity .2s; }
.ibtn .ico, .btn .ico { transition: transform .2s cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) {
  .btn:hover:not(:disabled), .ibtn:hover:not(:disabled), .chip:hover, .pk-item:hover, .chk:hover, .excell:hover {
    transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 16px var(--shadow);
  }
  .btn-acc:hover:not(:disabled), .btn-ok:hover:not(:disabled) { filter: brightness(1.08); }
  .ibtn:hover:not(:disabled) .ico, .btn:hover:not(:disabled) .ico { transform: scale(1.18); }
  .nl:hover { transform: translateY(-1px); }
  .back:hover { color: var(--accent); transform: translateX(-3px); }
  .chip[aria-pressed="true"]:hover { border-color: var(--text); }
}
.btn:active:not(:disabled), .ibtn:active:not(:disabled), .chip:active, .pk-item:active { transform: scale(.96); box-shadow: none; }

@media (max-width: 760px) {
  .setcols { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .extools { flex-wrap: wrap; }
  .extools .btn { flex: 1 1 100%; }
  .phead-r { width: 100%; }
  .phead-r .stat { flex: 1; }
  .phead-r .btns { flex: 1 1 100%; }
  .phead-r .btns .btn { flex: 1; }
  .mc-mark { width: 16px; height: 16px; position: absolute; top: 3px; right: 3px; }
  .mc-mark .ico { width: 10px; height: 10px; }
  .mc { position: relative; }
  .mc.is-today .mc-num { min-width: 26px; height: 26px; }
  .trio { grid-template-columns: 1fr 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
