/* Zyzz Project — direction « énergie hardstyle »
   Fond quasi noir, néon cyan dominant, magenta réservé aux alertes.
   Gros chiffres en Anton (condensée, très grasse), texte en Barlow. */

@font-face { font-family: 'Anton'; src: url('../fonts/anton-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('../fonts/barlow-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('../fonts/barlow-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('../fonts/barlow-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('../fonts/barlow-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #07090b;
  --s1: #0d1115;
  --s2: #131920;
  --line: #1b242c;
  --line2: #29353f;
  --text: #eaf4f8;
  --mute: #8d9da8;
  --dim: #5c6a74;
  --cyan: #00e5ff;
  --cyan-ink: #001318;
  --cyan-a: rgba(0, 229, 255, 0.1);
  --cyan-b: rgba(0, 229, 255, 0.22);
  --glow: 0 0 22px rgba(0, 229, 255, 0.38);
  --glow-text: 0 0 28px rgba(0, 229, 255, 0.45);
  --mag: #ff2e88;
  --mag-a: rgba(255, 46, 136, 0.11);
  --f-num: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --f-txt: 'Barlow', system-ui, -apple-system, sans-serif;
  --r: 3px;
  --pad: 20px;
  --cut: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.4 var(--f-txt);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
/* Grille néon très discrète en haut de l'écran */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 60vh;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 100% at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.55;
  z-index: 0;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden], .hidden { display: none !important; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 400; }
ol, ul { margin: 0; padding: 0; list-style: none; }

.num { font-family: var(--f-num); font-weight: 400; line-height: 0.9; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--cyan); }
.kicker { font: 700 12px/1.2 var(--f-txt); text-transform: uppercase; letter-spacing: 0.14em; color: var(--mute); }
.muted { color: var(--mute); font-size: 15px; }

#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100dvh; }
#view { padding: 0 var(--pad) calc(var(--tabbar-h) + var(--safe-b) + 28px); outline: none; }
body.immersive #view { padding-bottom: 0; }

.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash span { font-size: 64px; color: var(--cyan); text-shadow: var(--glow-text); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 18px;
  border: 1.5px solid transparent; border-radius: var(--r);
  background: transparent;
  font: 700 15px/1.1 var(--f-txt); text-transform: uppercase; letter-spacing: 0.07em;
  transition: transform 0.12s var(--ease), background-color 0.15s, border-color 0.15s, box-shadow 0.2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.primary { background: var(--cyan); color: var(--cyan-ink); }
.btn.ghost { border-color: var(--line2); color: var(--text); }
.btn.ghost:active { background: var(--cyan-a); border-color: var(--cyan); }
.btn.danger { background: var(--mag); color: #1a0010; }
.btn.xl { width: 100%; min-height: 64px; font-size: 17px; }
.btn.wide { width: 100%; }
.btn.go {
  background: var(--cyan); color: var(--cyan-ink);
  font: 400 52px/1 var(--f-num); letter-spacing: 0.04em;
  min-height: 96px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  box-shadow: var(--glow);
  border-radius: 0;
}
.btn.go:active { filter: brightness(1.15); }
.btn.go.xl { min-height: 80px; font-size: 32px; }
.btn.noway {
  min-height: 96px; padding: 0 8px;
  border-color: var(--line2); color: var(--text);
  font-size: 14px; line-height: 1.15;
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  border-radius: 0;
}
.btn.noway:active { border-color: var(--mag); color: var(--mag); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.btn-stack { display: grid; justify-items: center; gap: 6px; }
.btn-stack small { font: 700 12px/1 var(--f-txt); letter-spacing: 0.12em; }
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text); border-radius: var(--r);
}
.icon-btn:active { background: var(--cyan-a); color: var(--cyan); }
.icon-btn:disabled { opacity: 0.25; }
.icon-btn.sm { width: 38px; height: 38px; }
.link {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 10px 0; color: var(--cyan);
  font: 600 15px/1.2 var(--f-txt);
}
.link.center { display: flex; margin: 8px auto 0; }
.danger-text { color: var(--mag) !important; }
.pulse { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: var(--glow); } }

/* ---------- Puces, champs ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 46px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 4px;
  border: 1.5px solid var(--line2); border-radius: var(--r);
  background: transparent; color: var(--text);
  font: 600 15px/1 var(--f-txt);
}
.chip b { font: 400 20px/1 var(--f-num); }
.chip.on { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-a); }
.chip.sm { min-height: 40px; padding: 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.chip.big { min-height: 56px; justify-content: center; }
.chip.custom { gap: 6px; }
.days-pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daychip {
  min-height: 52px; border: 1.5px solid var(--line2); border-radius: var(--r);
  background: transparent; color: var(--mute); font: 700 14px/1 var(--f-txt);
}
.daychip.on { border-color: var(--cyan); background: var(--cyan); color: var(--cyan-ink); }

.field { display: grid; gap: 8px; margin: 20px 0; }
.field-label { font: 700 12px/1.2 var(--f-txt); text-transform: uppercase; letter-spacing: 0.13em; color: var(--mute); }
.field-input {
  width: 100%; min-height: 54px; padding: 12px 14px;
  background: var(--s1); color: var(--text);
  border: 1.5px solid var(--line2); border-radius: var(--r);
  font: 500 17px/1.35 var(--f-txt);
}
.field-input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-a); }
.field-input::placeholder { color: var(--dim); }
.field-input.area { min-height: 100px; resize: vertical; }
.field-input.mini { width: 64px; min-height: 40px; padding: 6px 8px; text-align: center; }
.field-input.time { width: 104px; min-height: 44px; padding: 6px 10px; color-scheme: dark; }
.form-msg { min-height: 22px; color: var(--mag); font-size: 15px; font-weight: 600; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line2); border-radius: var(--r); }
.stepper-btn { width: 46px; height: 46px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text); }
.stepper-btn:active { background: var(--cyan-a); color: var(--cyan); }
.stepper-val { min-width: 62px; text-align: center; font: 400 22px/1 var(--f-num); }

.switch { position: relative; display: inline-block; width: 54px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: 16px; background: var(--line2); transition: background 0.2s; }
.switch-track::after {
  content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--text); transition: transform 0.2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--cyan); }
.switch input:checked + .switch-track::after { transform: translateX(22px); background: var(--cyan-ink); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--cyan); outline-offset: 2px; }

.range { flex: 1; height: 44px; accent-color: var(--cyan); }

/* ---------- Connexion / premier lancement ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 44px; padding: calc(var(--safe-t) + 24px) var(--pad) calc(var(--safe-b) + 24px); }
.login-brand { display: grid; }
.brand-word { font-size: clamp(76px, 25vw, 112px); line-height: 0.86; color: var(--cyan); text-shadow: var(--glow-text); }
.brand-word.outline { color: transparent; text-shadow: none; }
.brand-line { margin-top: 14px; font: 700 12px/1.3 var(--f-txt); text-transform: uppercase; letter-spacing: 0.16em; color: var(--mute); }
.login-form { display: grid; gap: 12px; }
.login-kicker { font-weight: 600; color: var(--mute); }

.onboarding { padding: calc(var(--safe-t) + 20px) var(--pad) calc(var(--safe-b) + 28px); }
.ob-brand { font-size: 26px; color: var(--cyan); }
.ob-brand .outline { -webkit-text-stroke-width: 1px; }
.ob-stack { display: grid; margin-top: 28px; }
.ob-step { grid-area: 1 / 1; transition: opacity 0.2s var(--ease); }
.ob-step[inert] { opacity: 0; visibility: hidden; }
.ob-title { font-size: 60px; margin-top: 8px; }
.ob-lead { color: var(--mute); margin-top: 10px; font-size: 16px; }

/* ---------- Barres ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding-top: calc(var(--safe-t) + 16px); min-height: 52px; }
.top-date { font: 700 13px/1 var(--f-txt); text-transform: uppercase; letter-spacing: 0.14em; color: var(--mute); }
.sync { display: inline-flex; align-items: center; gap: 7px; font: 600 12px/1 var(--f-txt); color: var(--dim); }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.sync.wait i { animation: blink 1s steps(2) infinite; }
.sync.off i { background: var(--dim); box-shadow: none; }
@keyframes blink { 50% { opacity: 0.2; } }

.bar { display: flex; align-items: center; gap: 8px; padding-top: calc(var(--safe-t) + 12px); min-height: 64px; margin-bottom: 8px; }
.bar .seg { margin-left: auto; }
.bar-title { font-size: 34px; }
.page-lead { color: var(--mute); }

.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(7, 9, 11, 0.94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
body.immersive .tabbar { display: none; }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--dim); text-decoration: none;
  font: 700 11px/1 var(--f-txt); text-transform: uppercase; letter-spacing: 0.12em;
}
.tab.active { color: var(--cyan); }
.tab.active::before { content: ''; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--cyan); box-shadow: var(--glow); }

/* ---------- Accueil ---------- */
.cycle { margin-top: 14px; }
.cycle-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cycle-count { font-size: 22px; }
.cycle-count b { font-weight: 400; color: var(--cyan); }
.cycle-count small { font-size: 16px; color: var(--mute); }
.cycle-phase { font: 700 12px/1.2 var(--f-txt); text-transform: uppercase; letter-spacing: 0.1em; color: var(--mute); text-align: right; }
.cycle-bar { position: relative; height: 4px; margin-top: 10px; background: var(--line); overflow: hidden; }
.cycle-bar i { position: absolute; inset: 0 auto 0 0; background: var(--cyan); box-shadow: var(--glow); }
.cycle-sub { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--dim); font-weight: 600; }

.alert { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--mag); background: var(--mag-a); }
.alert-main { font-size: 17px; font-weight: 600; }
.alert-main strong { color: var(--mag); }
.alert-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 6px 0; border: 0; background: none; color: var(--mag); font: 600 14px/1.2 var(--f-txt); }

.hero {
  position: relative; margin-top: 16px; padding: 18px 16px 16px;
  background:
    linear-gradient(225deg, transparent 0 14.8px, var(--cyan) 14.8px 16.4px, transparent 16.4px) top right / 40px 40px no-repeat,
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(180deg, var(--s1), var(--bg));
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.hero-main { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 18px; min-height: 184px; margin-top: 6px; }
.hero-letter { position: relative; font-size: 212px; line-height: 0.78; color: var(--cyan); text-shadow: var(--glow-text); margin-bottom: -4px; }
.hero-letter.done { color: var(--text); text-shadow: none; opacity: 0.9; }
.hero-check { position: absolute; right: -14px; bottom: 6px; width: 46px; height: 46px; display: grid; place-items: center; background: var(--cyan); color: var(--cyan-ink); }
.hero-word { grid-column: 1 / -1; font-size: clamp(84px, 27vw, 128px); line-height: 0.82; align-self: end; }
.hero-list { counter-reset: ex; display: grid; gap: 5px; padding-bottom: 6px; align-self: end; }
.hero-list li { counter-increment: ex; font: 600 14px/1.15 var(--f-txt); color: var(--mute); display: grid; grid-template-columns: 22px 1fr; }
.hero-list li::before { content: counter(ex, decimal-leading-zero); font: 400 12px/1.3 var(--f-num); color: var(--cyan); opacity: 0.8; }
.hero-meta { margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--mute); }
.hero-actions { display: grid; grid-template-columns: 1fr 100px; gap: 10px; margin-top: 16px; }
.hero-actions > .btn.wide, .hero-actions > .btn:only-child { grid-column: 1 / -1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 112px; padding: 12px; background: var(--s1); border: 1px solid var(--line); }
.stat-num { font-size: 50px; color: var(--text); }
.stat-label { font: 700 11px/1.25 var(--f-txt); text-transform: uppercase; letter-spacing: 0.1em; color: var(--mute); }
.ring-wrap { position: relative; width: 58px; height: 58px; }
.ring { width: 58px; height: 58px; display: block; }
.ring-bg { fill: none; stroke: var(--line2); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--cyan); stroke-width: 5; filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.6)); transition: stroke-dasharray 0.6s var(--ease); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; }
.ring-num small { font-size: 13px; color: var(--mute); }
.ring-num { grid-auto-flow: column; justify-content: center; align-items: center; }

.quote { position: relative; margin: 10px 0 0; padding: 16px 16px 16px 44px; border: 1px solid var(--line); font-size: 17px; font-weight: 600; line-height: 1.35; }
.quote-mark { position: absolute; left: 14px; top: 15px; font-size: 20px; color: var(--cyan); }

.why-card { margin-top: 10px; padding: 16px; border: 1px solid var(--line); background: var(--s1); }
.why-card.urgent { border-color: var(--mag); }
.why-card.urgent .kicker { color: var(--mag); }
.why-text { margin-top: 8px; font-size: 18px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Pas envie ---------- */
.noway { padding: calc(var(--safe-t) + 8px) 0 calc(var(--safe-b) + 24px); }
.noway .bar { padding-top: 0; }
.noway-title { font-size: clamp(46px, 14vw, 64px); line-height: 0.92; margin-top: 4px; }
.why-list { margin-top: 20px; }
.why-block { padding: 2px 0 2px 16px; border-left: 2px solid var(--cyan); margin-bottom: 22px; }
.why-big { margin-top: 6px; font-size: 22px; font-weight: 600; line-height: 1.3; white-space: pre-line; }
.noway-actions { display: grid; gap: 12px; margin-top: 28px; }
.noway-actions .btn.go { min-height: 108px; }
.noway-note { text-align: center; color: var(--mute); font-size: 14px; }

/* ---------- Mode séance ---------- */
.workout { min-height: 100dvh; display: flex; flex-direction: column; padding-top: var(--safe-t); }
.wo-top { display: grid; grid-template-columns: 48px 1fr auto 48px; align-items: center; gap: 6px; height: 56px; margin: 0 -10px; }
.wo-title { text-align: center; font: 700 13px/1 var(--f-txt); letter-spacing: 0.14em; text-transform: uppercase; }
.wo-clock { font-size: 22px; color: var(--mute); min-width: 52px; text-align: right; }
.wo-progress { display: flex; gap: 4px; height: 4px; }
.wo-progress i { position: relative; flex: 1; background: var(--line); overflow: hidden; }
.wo-progress i b { position: absolute; inset: 0 auto 0 0; background: var(--cyan); }
.wo-progress i.cur { background: var(--line2); box-shadow: 0 0 0 1px var(--cyan-b); }
.wo-progress i.skip { opacity: 0.35; }
.wo-body { flex: 1; display: flex; flex-direction: column; padding: 16px 0 calc(var(--safe-b) + 16px); }
.wo-name { font-size: clamp(36px, 11vw, 46px); line-height: 0.95; margin-top: 6px; text-transform: uppercase; }
.wo-target { margin-top: 6px; font-size: 16px; font-weight: 700; color: var(--cyan); }
.wo-info { display: grid; grid-template-columns: 112px 1fr; gap: 14px; margin-top: 14px; }
.wo-fig {
  position: relative; width: 112px; height: 112px; padding: 0;
  border: 1px solid var(--line2); background: var(--s1);
  display: grid; place-items: center; overflow: hidden;
}
.wo-fig-img { width: 100%; height: 100%; object-fit: contain; }
.wo-fig-label { position: absolute; left: 6px; bottom: 5px; font: 700 10px/1 var(--f-txt); text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.wo-fig.placeholder { align-content: center; justify-items: start; padding: 10px; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 14px, var(--s1); }
.wo-fig-muscles { display: grid; gap: 3px; }
.wo-fig-muscles b { font: 400 15px/1.05 var(--f-num); color: var(--cyan); text-transform: uppercase; }
.wo-cues { display: grid; gap: 7px; align-content: start; }
.wo-cues li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.3; color: var(--mute); }
.wo-cues li::before { content: ''; position: absolute; left: 0; top: 8px; width: 8px; height: 2px; background: var(--cyan); }
.wo-last { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wo-last-reps { font-size: 24px; }
.wo-set { margin-top: auto; padding-top: 16px; }
.wo-set-head { display: flex; align-items: center; gap: 12px; }
.wo-set-label { font-size: 26px; }
.wo-set-label small { font-size: 18px; color: var(--mute); }
.wo-dots { display: flex; gap: 5px; }
.wo-dots i { width: 28px; height: 28px; display: grid; place-items: center; border: 1.5px solid var(--line2); font: 400 13px/1 var(--f-num); font-style: normal; }
.wo-dots i.on { background: var(--cyan); border-color: var(--cyan); color: var(--cyan-ink); }
.wo-dots i.cur { border-color: var(--cyan); box-shadow: var(--glow); }
.chip.load { margin-left: auto; min-height: 40px; font-family: var(--f-num); font-weight: 400; font-size: 17px; }
.wo-reps { display: grid; grid-template-columns: 88px 1fr 88px; align-items: center; gap: 8px; margin-top: 12px; }
.wo-step { height: 88px; display: grid; place-items: center; border: 1.5px solid var(--line2); background: var(--s1); color: var(--text); border-radius: var(--r); transition: transform 0.1s var(--ease), background 0.12s; }
.wo-step:active { transform: scale(0.94); background: var(--cyan-a); color: var(--cyan); border-color: var(--cyan); }
.wo-reps-val { text-align: center; font-size: 132px; line-height: 0.82; color: var(--cyan); text-shadow: var(--glow-text); }
.wo-reps-hint { text-align: center; margin-top: 8px; font: 700 12px/1.2 var(--f-txt); text-transform: uppercase; letter-spacing: 0.12em; color: var(--mute); }
.wo-validate { margin-top: 14px; }

.rest {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(var(--safe-t) + 20px) var(--pad) calc(var(--safe-b) + 24px);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 32px,
    var(--bg);
}
.rest > * { max-width: 480px; }
.rest-clock { font-size: clamp(140px, 46vw, 220px); color: var(--cyan); text-shadow: var(--glow-text); transition: color 0.2s, transform 0.25s var(--ease); }
.rest.last .rest-clock { color: var(--text); }
.rest.ending .rest-clock { transform: scale(1.12); color: var(--cyan); }
.rest-bar { width: 100%; height: 6px; background: var(--line); }
.rest-bar i { display: block; height: 100%; background: var(--cyan); box-shadow: var(--glow); transform-origin: left; }
.rest-next { color: var(--mute); text-align: center; }
.rest-next strong { color: var(--text); }
.rest-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 18px; }
.rest-actions .btn { min-height: 76px; font-size: 18px; }

.flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; background: var(--cyan); opacity: 0; }
.flash.on { animation: flash 0.75s ease-out; }
@keyframes flash { 0% { opacity: 0.9; } 25% { opacity: 0.15; } 40% { opacity: 0.7; } 100% { opacity: 0; } }

.finish { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(var(--safe-t) + 36px) 0 calc(var(--safe-b) + 16px); min-height: 100dvh; }
.finish-num { position: relative; font-size: clamp(130px, 42vw, 180px); color: var(--cyan); text-shadow: var(--glow-text); margin-top: 14px; animation: pop 0.45s var(--ease) both; }
.finish-hash { font-size: 0.45em; vertical-align: top; color: var(--mute); text-shadow: none; }
.finish-num small { font-size: 0.3em; color: var(--mute); text-shadow: none; }
.finish-sub { margin-top: 10px; color: var(--mute); font-weight: 600; }
.finish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 26px; }
.finish-stat { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); background: var(--s1); text-align: left; }
.finish-stat b { font-size: 30px; }
.finish-records { width: 100%; margin-top: 18px; text-align: left; }
.finish-records ul { display: grid; gap: 6px; margin-top: 10px; }
.finish-records li { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 10px; padding: 12px 14px; border-left: 3px solid var(--cyan); background: var(--cyan-a); font-weight: 600; }
.finish-records li b { font-size: 22px; color: var(--cyan); }
.finish-records li small { color: var(--mute); }
.finish-records .muted { margin-top: 8px; }
.finish-quote { margin: 22px 0; font-size: 17px; font-weight: 600; color: var(--mute); }
.finish .btn.go { margin-top: auto; }
.burst { position: absolute; top: calc(var(--safe-t) + 150px); left: 50%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -1px; top: 0; width: 2px; height: 70px; background: linear-gradient(var(--cyan), transparent); transform-origin: 50% 0; transform: rotate(var(--a)) translateY(60px) scaleY(0); animation: ray 0.9s var(--ease) var(--d) forwards; opacity: 0.9; }
@keyframes ray { 0% { transform: rotate(var(--a)) translateY(40px) scaleY(0); opacity: 1; } 60% { opacity: 1; } 100% { transform: rotate(var(--a)) translateY(130px) scaleY(1); opacity: 0; } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- Agenda ---------- */
.seg { display: inline-flex; border: 1.5px solid var(--line2); border-radius: var(--r); overflow: hidden; }
.seg.wide { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin: 6px 0 4px; }
.seg-btn { min-height: 42px; padding: 0 14px; border: 0; background: transparent; color: var(--mute); font: 700 13px/1 var(--f-txt); text-transform: uppercase; letter-spacing: 0.08em; }
.seg-btn.on { background: var(--cyan); color: var(--cyan-ink); }
.nav-row { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; margin: 6px -8px 8px; }
.nav-label { display: grid; justify-items: center; gap: 3px; text-align: center; }
.nav-label b { font-weight: 700; font-size: 16px; }
.nav-label b::first-letter, .chip.big::first-letter { text-transform: uppercase; }
.nav-label small { color: var(--mute); font-size: 12px; font-weight: 600; }
.days { border-top: 1px solid var(--line); }
.day {
  width: 100%; display: grid; grid-template-columns: 50px 30px 1fr 20px; align-items: center; gap: 12px;
  min-height: 62px; padding: 0 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left;
  font: 600 15px/1.25 var(--f-txt);
}
button.day:active { background: var(--cyan-a); }
.day.is-today { background: var(--cyan-a); box-shadow: inset 2px 0 var(--cyan); }
.day-name { display: grid; gap: 2px; }
.day-name b { font: 700 12px/1 var(--f-txt); text-transform: uppercase; letter-spacing: 0.12em; color: var(--mute); }
.day-name small { font: 400 24px/1 var(--f-num); }
.day .ico { color: var(--dim); }
.st-missed .day-text { color: var(--mag); }
.st-rest .day-text { color: var(--dim); }
.st-shifted .day-text { color: var(--mute); }
.week-sum { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--mute); font-weight: 600; }
.week-sum b { font-size: 28px; color: var(--text); }
.badge-ok { margin-left: auto; padding: 6px 10px; border: 1px solid var(--cyan); color: var(--cyan); font: 700 11px/1 var(--f-txt); text-transform: uppercase; letter-spacing: 0.12em; }

.mk { width: 28px; height: 28px; display: grid; place-items: center; font: 400 14px/1 var(--f-num); border: 1.5px solid transparent; }
.mk-done { background: var(--cyan); color: var(--cyan-ink); border-color: var(--cyan); }
.mk-rescue { border: 1.5px dashed var(--cyan); color: var(--cyan); }
.mk-shifted { border: 1.5px dashed var(--line2); }
.mk-missed { background: var(--mag-a); border-color: var(--mag); color: var(--mag); }
.mk-today { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--glow); }
.mk-planned { border-color: var(--line2); color: var(--mute); }
.mk-rest::after { content: ''; width: 5px; height: 5px; background: var(--line2); }

.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mhead { text-align: center; font: 700 11px/1 var(--f-txt); color: var(--dim); padding: 6px 0; }
.mcell { aspect-ratio: 1 / 1.2; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 7px 0 8px; background: var(--s1); border: 1px solid var(--line); color: var(--text); }
.mcell .mk { width: 22px; height: 22px; font-size: 12px; }
.mcell-n { font: 600 13px/1 var(--f-txt); }
.mcell.out { opacity: 0.3; }
.mcell.is-today { border-color: var(--cyan); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 22px; color: var(--mute); font-size: 13px; font-weight: 600; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend .mk { width: 18px; height: 18px; font-size: 10px; }
.legend .mk svg { width: 10px; height: 10px; }

.day-sheet-w { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.mini-log { display: grid; gap: 6px; margin: 10px 0 4px; }
.mini-log li { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.mini-log b { font-size: 18px; color: var(--cyan); }
.move-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }

/* ---------- Réglages ---------- */
.set-section { margin: 26px 0 0; }
.set-title { font: 400 20px/1 var(--f-num); letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-row-text { display: grid; gap: 2px; }
.set-row-text span { font-size: 16px; font-weight: 600; }
.set-row-text small { font-size: 13px; color: var(--mute); font-weight: 500; }
.link-row { width: 100%; border-left: 0; border-right: 0; border-top: 0; background: none; color: var(--text); text-align: left; }
.link-row .ico { color: var(--dim); flex: none; }
.row-ctl { display: flex; align-items: center; gap: 10px; }
.notif-box > .btn.xl { margin-top: 14px; }
.notice { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--cyan); background: var(--s1); font-size: 15px; display: grid; gap: 6px; }
.pill { padding: 6px 10px; font: 700 11px/1 var(--f-txt); text-transform: uppercase; letter-spacing: 0.12em; border: 1px solid var(--line2); }
.pill.on { color: var(--cyan); border-color: var(--cyan); }
.rest-pick { display: flex; align-items: center; gap: 14px; }
.rest-val { min-width: 70px; text-align: right; font-size: 26px; color: var(--cyan); }
.cycle-card { margin-top: 14px; padding: 16px; background: var(--s1); border: 1px solid var(--line); }
.cycle-card-big { font-size: 52px; color: var(--cyan); }
.cycle-card-big small { font: 600 16px/1 var(--f-txt); color: var(--mute); }
.cycle-card .muted { margin-top: 8px; font-size: 14px; }
.phases { display: grid; gap: 12px; margin-top: 16px; }
.phases li { display: grid; gap: 3px; padding-left: 12px; border-left: 2px solid var(--line2); }
.phases li.cur { border-color: var(--cyan); }
.phases li.cur b { color: var(--cyan); }
.phases li.past { opacity: 0.55; }
.phases b { font-size: 15px; }
.phases small { font-size: 13px; color: var(--mute); }
.version { margin: 34px 0 0; text-align: center; color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Programme ---------- */
.prog-list { display: grid; gap: 10px; margin: 14px 0; }
.prog-item { padding: 14px; background: var(--s1); border: 1px solid var(--line); }
.prog-head { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: start; }
.prog-idx { font-size: 22px; color: var(--cyan); }
.prog-name b { display: block; font-size: 17px; font-weight: 700; line-height: 1.2; }
.prog-target { font-size: 14px; color: var(--mute); }
.prog-order { display: flex; }
.prog-ctl { display: grid; gap: 10px; margin: 14px 0 6px; }
.prog-ctl-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reps-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.reps-ctl .stepper-btn { width: 38px; }
.reps-ctl .stepper-val { min-width: 40px; }

/* ---------- Feuilles, toasts, listes ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.65); opacity: 0; transition: opacity 0.2s; }
.scrim.open { opacity: 1; }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 var(--pad) calc(var(--safe-b) + 22px);
  background: var(--s1); border-top: 1px solid var(--line2);
  transform: translateY(28px); transition: transform 0.24s var(--ease);
}
.scrim.open .sheet { transform: none; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0 10px; background: var(--s1); }
.sheet-title { font: 400 26px/1 var(--f-num); text-transform: uppercase; }
.sheet-head .icon-btn { margin-right: -12px; }
.sheet-body { display: grid; gap: 12px; }
.sheet-body > .field-input { margin: 0; }
.sheet-text { color: var(--mute); }
.sheet-body > .stepper { justify-self: center; }
.sheet-body > .stepper .stepper-btn { width: 64px; height: 64px; }
.sheet-body > .stepper .stepper-val { min-width: 110px; font-size: 34px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 90;
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; text-align: center;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--s2); border: 1px solid var(--cyan); color: var(--text);
  font-weight: 600; font-size: 15px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
.toast.warn { border-color: var(--mag); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.immersive .toast { bottom: calc(var(--safe-b) + 16px); }

.pick-list, .menu-list { display: grid; gap: 6px; }
.pick, .menu-ex {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 54px; padding: 0 14px; border: 1px solid var(--line); background: var(--s2); color: var(--text);
  font: 600 16px/1.2 var(--f-txt); text-align: left; border-radius: var(--r);
}
.pick small { color: var(--mute); font-size: 13px; font-weight: 500; }
.menu-ex.cur { border-color: var(--cyan); }
.menu-ex.skip .menu-ex-name { text-decoration: line-through; color: var(--mute); }
.menu-ex:disabled { opacity: 0.5; }
.menu-ex-state { font-size: 18px; color: var(--cyan); }
.menu-actions { display: grid; gap: 8px; margin-top: 6px; }
.menu-actions .btn { justify-content: flex-start; text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 600; }

.ico { flex: none; }

@media (min-width: 700px) {
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: rgba(7, 9, 11, 0.6); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .flash.on { animation: flash-static 0.6s steps(1) !important; }
  @keyframes flash-static { 0% { opacity: 0.6; } 100% { opacity: 0; } }
}
