/* ==========================================================================
   COACH AD — Application séances
   Layout: app mobile une colonne (max 560px), en-tête collant, barre d'onglets
   fixée en bas. Fond noir de marque, or réservé aux actions et aux moments clés
   (heure de la prochaine séance, signature, carnet). Le "papier" blanc rappelle
   la feuille d'émargement : il n'apparaît que là où l'on signe.
   ========================================================================== */
:root {
  --bg: #111111;
  --bg-raise: #191817;
  --bg-field: #1d1c1a;
  --line: #2a2825;
  --line-strong: #3b3830;
  --gold: #c9a84c;
  --gold-bright: #dcc173;
  --gold-wash: rgba(201, 168, 76, 0.12);
  --gold-line: rgba(201, 168, 76, 0.38);
  --on-gold: #111111;
  --fg: #ffffff;
  --fg-soft: #d6d2c8;
  --muted: #8f8a7f;
  --brand-grey: #555555;
  --paper: #ffffff;
  --paper-ink: #111111;
  --paper-rule: #e7e2d4;
  --ok: #7fbf92;
  --danger: #e2806f;
  --danger-wash: rgba(226, 128, 111, 0.12);

  --font: 'Montserrat', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --tabbar-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}
.app.no-tabs { padding-bottom: calc(var(--safe-bottom) + 32px); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: calc(var(--safe-top) + 10px);
  padding-bottom: 10px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  background: rgba(17, 17, 17, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.mark { width: 36px; height: 36px; flex: none; display: block; object-fit: contain; }
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
}
.icon-btn svg { width: 20px; height: 20px; }

.demo-band {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-block: 8px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  background: var(--gold-wash);
  border-bottom: 1px solid var(--gold-line);
  font-size: 12.5px;
  color: var(--fg-soft);
}
.demo-band button {
  border: 1px solid var(--gold-line); background: transparent; color: var(--gold);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}

main.view {
  padding-top: 20px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: #151413;
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.tabbar .inner { max-width: 560px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--tabbar-h); }
.tabbar button {
  border: 0; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button[aria-current="page"] { color: var(--gold); }
.tabbar .badge-dot { position: relative; }
.tabbar .badge-dot::after {
  content: ""; position: absolute; top: -2px; right: -5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 2px #151413;
}

.fab {
  position: fixed;
  right: max(18px, calc((100vw - 560px) / 2 + 18px), calc(env(safe-area-inset-right, 0px) + 18px));
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  z-index: 25;
  height: 52px; padding: 0 20px 0 16px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 26px; border: 0;
  background: var(--gold); color: var(--on-gold);
  font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.fab svg { width: 20px; height: 20px; }

/* ---------- Type ---------- */
.h2 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 0 12px;
  font-size: 16px; font-weight: 700;
}
.h2 .link { font-size: 13.5px; font-weight: 600; color: var(--gold); background: none; border: 0; padding: 0; }
.muted { color: var(--muted); }
.soft { color: var(--fg-soft); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.greeting { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
.lede { margin: 6px 0 0; color: var(--muted); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  width: 100%;
}
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 700; }
.btn-gold:active { background: var(--gold-bright); }
.btn-dark { background: var(--paper-ink); border-color: var(--paper-ink); color: var(--gold); font-weight: 700; }
.btn-danger { color: var(--danger); border-color: rgba(226, 128, 111, 0.45); }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 14px; width: auto; border-radius: 12px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; width: auto; }
.text-btn { background: none; border: 0; padding: 6px 0; color: var(--gold); font-weight: 600; font-size: 14px; }

/* ---------- Champs ---------- */
form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--fg-soft); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input[type="url"],
input[type="date"], input[type="time"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--bg-field);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"], input[type="time"] { min-width: 0; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: #6d695f; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg-soft);
  font-size: 14px; font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0; }
.switch-row .txt { font-size: 14.5px; }
.switch-row .txt small { display: block; color: var(--muted); font-size: 12.5px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background 0.2s;
  pointer-events: none;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--fg); transition: transform 0.2s;
}
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--on-gold); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Statuts ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--muted);
}
.pill svg { width: 13px; height: 13px; }
.pill.st-tosign { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.pill.st-signed { border-color: var(--gold-line); color: var(--gold); }
.pill.st-coach { border-color: var(--line-strong); color: var(--fg-soft); background: var(--bg-raise); }
.pill.st-cancelled { border-color: rgba(226, 128, 111, 0.4); color: var(--danger); }

/* ---------- Carte "à signer" ---------- */
.sign-call {
  border-radius: var(--r-lg);
  background: var(--gold);
  color: var(--on-gold);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.sign-call h2 { margin: 0; font-size: 19px; font-weight: 800; text-wrap: balance; }
.sign-call p { margin: 4px 0 0; font-size: 14px; font-weight: 600; opacity: 0.8; }

/* ---------- Prochaine séance ---------- */
.next {
  position: relative;
  border: 1px solid var(--gold-line);
  border-radius: var(--r-lg);
  padding: 20px;
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.07), rgba(201, 168, 76, 0) 70%);
  display: flex; flex-direction: column; gap: 4px;
}
.next .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.next .count { color: var(--gold); }
.next .day { margin: 10px 0 0; font-size: 21px; font-weight: 700; }
.next .time { font-size: 44px; line-height: 1.05; font-weight: 800; color: var(--gold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.next .time .end { font-size: 22px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.next .meta { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; color: var(--fg-soft); font-size: 14px; }
.next .meta div { display: flex; gap: 8px; align-items: flex-start; }
.next .meta svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--muted); }
.quote {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--bg-raise);
  font-size: 14px; color: var(--fg-soft);
}
.quote b { display: block; font-size: 12.5px; color: var(--gold); margin-bottom: 2px; }
.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- Carnet ---------- */
.carnet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.carnet-head .big { font-size: 28px; font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums; }
.carnet-head .big small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.carnet-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.box {
  position: relative;
  aspect-ratio: 1 / 1.08;
  max-width: 100%;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #5d5a52;
  overflow: hidden;
}
.box.filled { background: var(--paper); border: 0; color: var(--paper-ink); }
.box.filled img { position: absolute; inset: 8% 6% 24%; width: 88%; height: 68%; object-fit: contain; }
.box.filled .d { position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font-size: 10.5px; font-weight: 600; color: #8a8576; font-variant-numeric: tabular-nums; }
.box.coach { background: #262420; border: 0; color: var(--fg-soft); font-size: 10.5px; text-align: center; line-height: 1.2; padding: 4px; }
.box.next-box { border-color: var(--gold); color: var(--gold); border-style: dashed; }
.carnet-foot { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.carnet-over { color: var(--danger); font-weight: 600; }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0;
  border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; width: 100%;
  color: inherit;
}
.list > .row:first-child { border-top: 1px solid var(--line); }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .t1 { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: #5d5a52; width: 18px; height: 18px; flex: none; }
.row.is-cancelled .t1 { text-decoration: line-through; color: var(--muted); }
.dateblock { width: 46px; flex: none; text-align: center; line-height: 1.1; }
.dateblock .dn { display: block; font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dateblock .dm { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.timeblock { width: 52px; flex: none; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timeblock small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.avatar {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--gold-line);
  color: var(--gold); font-weight: 800; font-size: 14px; letter-spacing: 0.02em;
}
.avatar.off { border-color: var(--line-strong); color: var(--muted); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 9px; min-height: 38px; font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: #2a2824; color: var(--fg); }

/* ---------- Planning coach ---------- */
.weeknav { display: flex; align-items: center; gap: 10px; }
.weeknav .lbl { flex: 1; text-align: center; font-weight: 700; font-size: 15px; }
.weeknav .lbl small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
.daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.daystrip button {
  border: 1px solid var(--line); background: transparent; border-radius: 12px;
  padding: 8px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--fg-soft);
}
.daystrip .w { font-size: 11px; font-weight: 600; color: var(--muted); }
.daystrip .n { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.daystrip .c { height: 6px; display: flex; gap: 2px; }
.daystrip .c i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.daystrip button.today { border-color: var(--gold); }
.daystrip button.today .n { color: var(--gold); }
.daygroup h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--fg-soft); display: flex; justify-content: space-between; }
.daygroup h3 span { color: var(--muted); font-weight: 600; font-size: 13px; }
.daygroup.today h3 { color: var(--gold); }
.daygroup .none { font-size: 13px; color: #5d5a52; padding: 2px 0 4px; }
.days { display: flex; flex-direction: column; gap: 22px; }
.alert {
  border: 1px solid var(--gold-line); background: var(--gold-wash);
  border-radius: var(--r-md); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.alert .ttl { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.alert .ttl svg { width: 18px; height: 18px; color: var(--gold); }
.pending { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--gold-line); }
.pending .main { flex: 1; min-width: 0; }
.pending .t1 { font-weight: 700; font-size: 14px; }
.pending .t2 { font-size: 12.5px; color: var(--muted); }
.stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.stats b { color: var(--fg); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Fiche client ---------- */
.client-head { display: flex; gap: 14px; align-items: center; }
.client-head .avatar { width: 56px; height: 56px; font-size: 18px; }
.client-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.client-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick a, .quick button {
  border: 1px solid var(--line); background: var(--bg-raise); border-radius: var(--r-md);
  min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--fg-soft); font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.quick svg { width: 20px; height: 20px; color: var(--gold); }
.access {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.access.highlight { border-color: var(--gold); }
.code { font-size: 30px; font-weight: 800; letter-spacing: 0.12em; color: var(--gold); font-variant-numeric: tabular-nums; user-select: all; }
.kv { display: flex; flex-direction: column; }
.kv .r { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv .r span:first-child { color: var(--muted); }
.kv .r span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.feedback { margin-top: 6px; font-size: 13px; color: var(--fg-soft); font-style: italic; }

/* ---------- Programmes ---------- */
.prog {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--bg-raise);
  text-align: left; width: 100%; color: inherit;
}
.prog .tick {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center; margin-top: 1px;
}
.prog .tick svg { width: 15px; height: 15px; }
.prog.done .tick { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.prog .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prog .t1 { font-weight: 700; }
.prog .t2 { font-size: 13px; color: var(--muted); margin-top: 2px; }
.progs { display: flex; flex-direction: column; gap: 10px; }
.rich { font-size: 15.5px; line-height: 1.65; color: var(--fg-soft); }
.rich p { margin: 0; }
.rich ul { margin: 6px 0; padding-left: 20px; }
.rich li { margin: 3px 0; }
.rich li::marker { color: var(--gold); }
.rich .gap { height: 10px; }
.rich a { overflow-wrap: anywhere; }

/* ---------- Feuilles (bottom sheets) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); opacity: 0; transition: opacity 0.22s; }
.sheet {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: calc(100% - var(--safe-top) - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #161514;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding-top: 8px;
  padding-bottom: calc(var(--safe-bottom) + 24px);
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  transform: translateY(24px); opacity: 0;
  transition: transform 0.24s cubic-bezier(.2, .8, .2, 1), opacity 0.2s;
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
.sheet-wrap.full .sheet { height: calc(100% - var(--safe-top) - 12px); max-height: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.sheet-body { display: flex; flex-direction: column; gap: 20px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.dialog-wrap { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.66); }
.dialog {
  width: 100%; max-width: 380px; background: #1b1a18; border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px;
}
.dialog h3 { margin: 0; font-size: 18px; font-weight: 800; }
.dialog p { margin: 0; color: var(--fg-soft); font-size: 14.5px; }

/* ---------- Signature ---------- */
.sig-recap { display: flex; flex-direction: column; gap: 2px; }
.sig-recap .d { font-size: 22px; font-weight: 800; }
.sig-recap .t { color: var(--gold); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.sig-recap .k { color: var(--muted); font-size: 14px; }
.attest { margin: 0; font-size: 14.5px; color: var(--fg-soft); }
.sigpad {
  position: relative;
  height: clamp(230px, 36vh, 340px);
  border-radius: 16px;
  background: var(--paper);
  overflow: hidden;
  touch-action: none;
}
.sigpad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sigpad .base { position: absolute; left: 22px; right: 22px; bottom: 52px; height: 1.5px; background: var(--gold); pointer-events: none; }
.sigpad .here { position: absolute; left: 22px; bottom: 26px; font-size: 12px; font-weight: 600; color: #a39d8c; pointer-events: none; }
.sigpad .x { position: absolute; left: 22px; bottom: 58px; font-size: 20px; font-weight: 700; color: var(--gold); pointer-events: none; }
.sig-actions .btn:first-child { flex: 0 0 auto; width: auto; padding: 0 22px; }
.sig-actions .btn:last-child { flex: 1 1 auto; }
.sig-view { background: var(--paper); border-radius: 14px; padding: 10px; display: grid; place-items: center; }
.sig-view img { max-height: 120px; }
.proof { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

.done-burst { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 10px 10px; }
.done-burst .ring {
  width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--gold);
  display: grid; place-items: center; color: var(--gold);
  animation: pop 0.45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.done-burst .ring svg { width: 46px; height: 46px; }
.done-burst h2 { margin: 6px 0 0; font-size: 22px; font-weight: 800; }
.done-burst p { margin: 0; color: var(--muted); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Connexion / accueil démo ---------- */
.gate {
  min-height: 100vh; min-height: 100dvh;
  max-width: 440px; margin: 0 auto;
  padding-top: calc(var(--safe-top) + 48px);
  padding-bottom: calc(var(--safe-bottom) + 32px);
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  display: flex; flex-direction: column; gap: 28px;
}
.gate .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.gate .brand .mark { width: 96px; height: 96px; }
.gate h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
.gate p.lede { font-size: 15px; }
.code-input { font-size: 24px !important; font-weight: 800 !important; letter-spacing: 0.14em; text-align: center; text-transform: uppercase; color: var(--gold) !important; min-height: 62px !important; }
.err { color: var(--danger); font-size: 14px; font-weight: 600; }
.foot { margin-top: auto; font-size: 12.5px; color: var(--muted); }

.tip {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--fg-soft);
}
.tip svg { width: 20px; height: 20px; color: var(--gold); flex: none; margin-top: 1px; }
.tip .main { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.tip b { color: var(--fg); }
.tip.gold { border-color: var(--gold-line); background: var(--gold-wash); }
.tip .main > .btn { align-self: flex-start; }
.tip .btn svg { color: currentColor; width: 18px; height: 18px; margin-top: 0; }

/* ---------- Émargement ---------- */
.sheet-paper {
  background: var(--paper); color: var(--paper-ink); border-radius: var(--r-md);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 16px;
}
.sheet-paper .ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-paper .ph h2 { margin: 0; font-size: 18px; font-weight: 800; }
.sheet-paper .ph p { margin: 2px 0 0; font-size: 12.5px; color: #6b6658; }
.sheet-paper .brand-logo { display: block; width: 46px; height: 46px; margin: 0 0 6px auto; }
.sheet-paper .brandline { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: #8a6f22; text-align: right; }
.table-wrap { overflow-x: auto; }
table.em { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 330px; }
table.em .s { display: block; font-size: 11.5px; color: #6b6658; font-weight: 500; }
table.em td.n { color: #8a8576; width: 22px; }
table.em th { text-align: left; font-weight: 700; color: #6b6658; border-bottom: 1.5px solid var(--paper-ink); padding: 6px 6px; }
table.em td { border-bottom: 1px solid var(--paper-rule); padding: 6px; vertical-align: middle; font-variant-numeric: tabular-nums; }
table.em td.sig { width: 34%; }
table.em td.sig img { height: 40px; width: auto; max-width: 110px; display: block; }
table.em td.coachv { font-size: 11.5px; color: #6b6658; }
table.em .hash { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: #8a8576; }
.sheet-paper .legal { font-size: 11px; color: #6b6658; }

/* ---------- Annulations, choix, paiements, contrat ---------- */
.pill.st-late { border-color: rgba(226, 128, 111, 0.4); color: var(--danger); background: var(--danger-wash); }
.box.late { background: #2a1d1a; border: 0; color: var(--danger); font-size: 10.5px; text-align: center; line-height: 1.2; padding: 4px; }
.pending { flex-wrap: wrap; }
.pending .main { flex: 1 1 140px; }
.pending-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pending-actions .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  text-align: left; border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--fg);
  border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px;
}
.choice b { font-size: 15px; }
.choice span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.choice.current { border-color: var(--gold); }
.choice:active { background: #26241f; }
.paychip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.paychip.paid { color: var(--ok); border: 1px solid rgba(127, 191, 146, 0.45); }
.paychip.due { color: var(--on-gold); background: var(--gold); }
.packrow { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; text-align: left; padding: 11px 0; display: flex; gap: 12px; align-items: center; }
.packrow .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.packrow .t1 { font-weight: 700; font-size: 14.5px; }
.packrow .t2 { font-size: 12.5px; color: var(--muted); }
.packrow .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.check-row { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--fg-soft); }
.check-row input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--gold); }
.contract-text { display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.6; color: var(--fg-soft); }
.contract-text h3 { margin: 6px 0 0; font-size: 15px; color: var(--fg); }
.contract-text p { margin: 0; }
.contract-text b { color: var(--fg); }
.keypoints { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--fg-soft); }
.keypoints li::marker { color: var(--gold); }
.group-names { font-size: 13px; color: var(--muted); }
.participants { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 12px; }
.participants label { display: flex; gap: 12px; align-items: center; padding: 8px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
.participants label:last-child { border-bottom: 0; }
.participants input { width: 20px; height: 20px; accent-color: var(--gold); }

/* ---------- Demandes, devis ---------- */
.pill.st-company { border-color: var(--line-strong); color: var(--fg-soft); }
.pill.st-asked { border-color: var(--gold-line); color: var(--gold); background: var(--gold-wash); }
.sheet-paper .qd { font-family: var(--font); color: var(--paper-ink); font-size: 13.5px; line-height: 1.5; }
.qd h2 { margin: 0; font-size: 19px; font-weight: 800; }
.qd p { margin: 8px 0; }
.qd-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--paper-ink); padding-bottom: 10px; }
.qd-head p { margin: 2px 0 0; color: #6b6658; font-size: 12.5px; }
.qd-logo { width: 56px; height: 56px; flex: none; object-fit: contain; }
.qd-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; font-size: 12.5px; }
.qd-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.qd-t th { text-align: left; font-weight: 600; color: #6b6658; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--paper-rule); width: 42%; vertical-align: top; }
.qd-t td { padding: 6px 0; border-bottom: 1px solid var(--paper-rule); }
.qd-total th, .qd-total td { font-weight: 800; color: var(--paper-ink); font-size: 14.5px; border-bottom: 2px solid var(--paper-ink); }
.qd-small { font-size: 11.5px; color: #4a463d; }
.qd-tiny { font-size: 10.5px; color: #6b6658; }
.qd-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; font-size: 11.5px; color: #6b6658; min-height: 60px; }
@media (max-width: 380px) { .qd-parties, .qd-sign { grid-template-columns: 1fr; } }

/* ---------- Facturation ---------- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat.wide { grid-column: 1 / -1; }
@media (max-width: 340px) { .stats-grid { grid-template-columns: 1fr; } }
.stat { border: 1px solid var(--line); background: var(--bg-raise); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .val { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.warn { border-color: rgba(226, 128, 111, 0.45); }
.delta { font-weight: 700; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-y, .ch-x { fill: var(--muted); font-size: 10px; font-family: var(--font); font-weight: 600; }
.ch-y { text-anchor: end; }
.ch-x { text-anchor: middle; }
.ch-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--gold); opacity: 0.12; }
.ch-dot { fill: var(--gold); stroke: var(--bg); stroke-width: 2; }
.ch-cross { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-hover { fill: var(--gold); stroke: var(--bg); stroke-width: 2; }
.ch-tip { position: absolute; transform: translateX(-50%); pointer-events: none; background: #f4f2ec; color: #111; border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); white-space: nowrap; }
.ch-tip b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ch-tip span { font-size: 11.5px; color: #555; }
.duerow { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > .duerow:first-child { border-top: 1px solid var(--line); }
.duerow .main { background: none; border: 0; padding: 0; text-align: left; color: inherit; display: flex; flex-direction: column; gap: 2px; }
.duerow .t1 { font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.duerow .amt { font-variant-numeric: tabular-nums; }
.duerow .t2 { font-size: 13px; color: var(--muted); }
table.bt { width: 100%; border-collapse: collapse; font-size: 14px; }
table.bt th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 0; border-bottom: 1px solid var(--line-strong); }
table.bt td { padding: 9px 0; border-bottom: 1px solid var(--line); }
table.bt .num { text-align: right; font-variant-numeric: tabular-nums; padding-left: 12px; }
.rates { display: flex; flex-direction: column; }
.rate { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.rate > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.rate-in { display: flex; align-items: center; gap: 6px; flex: none; }
.rate-in input { width: 92px; min-height: 42px; text-align: right; }
.rate-in em { font-style: normal; color: var(--muted); font-size: 13px; }

.inst-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.inst-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1.35fr); grid-template-areas: "n amt due" ". paid paid"; gap: 6px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.inst-n { grid-area: n; font-size: 13px; font-weight: 700; color: var(--muted); }
.inst-row .inst-amount { grid-area: amt; min-height: 44px; text-align: right; }
.inst-row .inst-due { grid-area: due; min-height: 44px; }
.inst-paid { grid-area: paid; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-soft); }
.inst-paid input { width: 20px; height: 20px; accent-color: var(--gold); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; z-index: 500;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  transform: translateX(-50%);
  max-width: min(92vw, 440px);
  background: #f4f2ec; color: #111; font-weight: 600; font-size: 14px;
  padding: 12px 18px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.25s ease both;
}
.toast.error { background: var(--danger); color: #111; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.loading { display: grid; place-items: center; padding: 60px 0; color: var(--muted); font-size: 14px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--gold); animation: spin 0.8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

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

@media (max-width: 360px) {
  .next .time { font-size: 38px; }
  .carnet-grid { gap: 6px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Impression de la feuille d'émargement ---------- */
@media print {
  body, html { background: #fff !important; color: #111 !important; }
  .topbar, .tabbar, .fab, .demo-band, .no-print { display: none !important; }
  .app, main.view { padding: 0 !important; max-width: none; }
  .sheet-paper { border-radius: 0; padding: 0; }
  table.em { min-width: 0; font-size: 11px; }
  tr { break-inside: avoid; }
}

/* ---- Objectif du client (compte à rebours) ---- */
.goal { border: 1px solid var(--gold-line); background: var(--gold-wash); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.goal.past { border-color: var(--line); background: var(--bg-raise); }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.goal-lbl { font-size: 12.5px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }
.goal.past .goal-lbl { color: var(--muted); }
.goal-j { font-size: 26px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1; }
.goal-t { font-size: 17px; font-weight: 800; color: var(--fg); }
.goal-n { font-size: 13px; color: var(--fg-soft); }
.goal-note { margin-top: -2px; }

/* ---- Parrainage ---- */
.refer { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.refer > div:first-child { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--fg-soft); }
.refer b { color: var(--fg); }
.refer-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.refer-code .btn { width: auto; }

/* ---- Bilan de départ ---- */
.gate.intake { justify-content: flex-start; }
.intake-form { display: flex; flex-direction: column; gap: 18px; }
.intake-form .chips + .chips { margin-top: 8px; }

/* ---- Compte rendu de séance ---- */
.report-box { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.report-box .field { margin: 0; }

/* ---- Ma journée ---- */
.daygroup h3 .dg-r { display: inline-flex; align-items: center; gap: 12px; }
.daygroup h3 .link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--gold); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.daygroup h3 .link svg { width: 14px; height: 14px; }
.dayroute { display: flex; flex-direction: column; }
.dayroute .stop { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.dayroute .stop .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); background: var(--bg); flex: none; margin: 0 6px; }
.dayroute .stop.home .dot { background: var(--gold); }
.dayroute .stop .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dayroute .stop .t1 { font-weight: 700; font-size: 15px; }
.dayroute .stop .t1 b { color: var(--gold); margin-right: 4px; font-variant-numeric: tabular-nums; }
.dayroute .stop .t2 { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dayroute .leg { display: flex; gap: 12px; align-items: center; min-height: 52px; }
.dayroute .leg .ln { width: 2px; align-self: stretch; background: repeating-linear-gradient(var(--gold-line) 0 6px, transparent 6px 11px); margin: 0 11px 0 11px; flex: none; }
.dayroute .leg .main { flex: 1; font-size: 14px; color: var(--fg-soft); }
.dayroute .leg .btn { width: auto; flex: none; }

/* ---- Prospects ---- */
.pill.ps-discovery { background: var(--gold-wash); border-color: var(--gold-line); color: var(--gold); }
.pill.ps-new { border-color: var(--line-strong); color: var(--fg-soft); }
.pill.ps-client { border-color: rgba(127, 191, 146, 0.45); color: var(--ok); }
.pill.ps-lost { color: var(--muted); }

/* ---- Programmes : envoi à plusieurs clients ---- */
details.also { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
details.also summary { cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--fg-soft); }
details.also[open] summary { margin-bottom: 10px; }
details.also .hint { display: block; margin-top: 8px; }

/* ---- Validation en deux étapes ---- */
.mfa-qr { width: 200px; height: 200px; margin: 6px auto 4px; background: var(--paper); border-radius: var(--r-md); padding: 10px; display: flex; align-items: center; justify-content: center; }
.mfa-qr img { width: 100%; height: 100%; display: block; }
.codebox { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; margin: 4px 0; }
.codebox .proof { overflow-wrap: anywhere; font-size: 13px; letter-spacing: 0.04em; }
.codebox .btn { width: auto; flex: none; }
.row.wrap .t2 { white-space: normal; }

.dayroute .leg .main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.home-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px dashed var(--gold-line); color: var(--gold); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.home-toggle svg { width: 14px; height: 14px; }
.dayroute .stop.home .btn { width: auto; flex: none; }

/* ---- Facturation : listes repliables ---- */
.fold { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-raise); }
.fold-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; background: none; border: 0; color: var(--fg); font: inherit; cursor: pointer; text-align: left; }
.fold-t { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; }
.fold-n { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--gold-wash); border: 1px solid var(--gold-line); color: var(--gold); font-size: 12.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.fold-n:empty { display: none; }
.fold-sub { font-size: 14px; color: var(--fg-soft); white-space: nowrap; }
.fold-sub b { font-size: 16px; color: var(--gold); }
.fold-carnet .fold-body { padding-top: 4px; }
.fold-r { display: inline-flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.fold-r { flex: none; }
.fold-r b { font-size: 16px; white-space: nowrap; }
.fold-late { font-size: 12.5px; font-weight: 700; color: var(--danger); }
.fold-chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s ease; }
.fold-head[aria-expanded="true"] .fold-chev { transform: rotate(90deg); }
.fold-body { padding: 0 16px 14px; }
.fold-body .list { border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .fold-chev { transition: none; } }
.folds { display: flex; flex-direction: column; gap: 10px; }
.fold.fold-day .fold-head { padding: 13px 16px; }
.fold.fold-day .fold-t { font-size: 15px; font-weight: 700; }
.fold.fold-day .fold-r b { font-size: 15px; }
.fold-est { font-size: 12px; font-weight: 700; color: var(--gold); }
.fold-trip .row .t1, .fold-trip .row .t2 { white-space: normal; }
/* Planning : jours repliables */
section.days { gap: 10px; }
.fold.today { border-color: var(--gold-line); }
.fold.today .fold-t { color: var(--gold); }
.fold-empty .fold-head { cursor: default; }
.fold-empty .fold-t { color: var(--muted); font-weight: 600; }
.fold-empty { background: none; }
.dg-trips { display: flex; justify-content: flex-end; padding: 0 0 8px; }
.dg-trips .link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--gold); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.dg-trips .link svg { width: 15px; height: 15px; }
.fold-head[role="button"] { -webkit-user-select: none; user-select: none; }
.fold-head[role="button"]:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: var(--r-md); }
.dg-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--gold); background: none; border: 0; padding: 4px 2px; cursor: pointer; font-family: inherit; }
.dg-link svg { width: 15px; height: 15px; }
.faceid-login { margin-top: 14px; }
.faceid-login .btn svg, [data-act="passkey-add"] svg { width: 20px; height: 20px; }
.pk-list { display: flex; flex-direction: column; gap: 8px; }
.pk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--gold-line); padding-top: 8px; font-weight: 600; color: var(--fg); }
.pk-row small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.pk-row .btn { width: auto; flex: none; }

/* ---- Progrès : série, records, badges ---- */
.streak { display: flex; align-items: center; gap: 16px; border: 1px solid var(--gold-line); background: var(--gold-wash); border-radius: var(--r-md); padding: 16px 18px; }
.streak .fl { width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: var(--on-gold); display: flex; align-items: center; justify-content: center; flex: none; }
.streak .fl svg { width: 30px; height: 30px; }
.streak .sn { font-size: 20px; font-weight: 800; }
.streak .ss { font-size: 13px; color: var(--fg-soft); margin-top: 2px; }
.rec-row .spark { flex: none; width: 64px; height: 28px; }
.rec-row .t2 { white-space: normal; }
.dur { display: flex; align-items: flex-start; gap: 8px; }
.dur b { font-size: 24px; font-weight: 800; color: var(--muted); padding-top: 12px; }
.dur-f { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dur-f input { width: 78px; text-align: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dur-f small { font-size: 12px; color: var(--muted); }
.rec-best { font-weight: 800; font-size: 15px; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rec-hero { display: flex; flex-direction: column; gap: 2px; }
.rec-hero .lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rec-hero .val { font-size: 40px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.rec-hero .sub { font-size: 13px; color: var(--fg-soft); }
.rec-chart { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; }
.rec-chart .spark { width: 100%; height: auto; display: block; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; opacity: .55; }
.badge .medal { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: var(--muted); }
.badge .bt { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.badge .bs { font-size: 11.5px; color: var(--muted); }
.badge.ok { opacity: 1; border-color: var(--gold-line); background: var(--gold-wash); }
.badge.ok .medal { background: var(--gold); border-color: var(--gold-bright); color: var(--on-gold); box-shadow: 0 0 18px rgba(201,168,76,.35); }
.badge.ok .bs { color: var(--gold); font-weight: 700; }

/* ---- Défi du mois ---- */
.chal { border: 1px solid var(--gold-line); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(160deg, rgba(201,168,76,.14), rgba(201,168,76,.03)); }
.chal.compact { cursor: pointer; }
.chal.mini { padding: 12px 14px; gap: 7px; }
.chal.mini .chal-t { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chal.mini .chal-bar { height: 8px; }
.chal.mini .left { display: inline-flex; align-items: center; gap: 2px; }
.chal-chev { width: 16px; height: 16px; margin-right: -4px; }
.chal-top { display: flex; justify-content: space-between; align-items: center; }
.chal-top .lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.chal-top .lbl svg { width: 16px; height: 16px; }
.chal-top .left { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.chal-t { font-size: 17px; font-weight: 800; }
.chal-d { font-size: 13.5px; color: var(--fg-soft); }
.chal-bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.chal-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
.chal-n { font-size: 13.5px; color: var(--fg-soft); }
.chal-n b { color: var(--fg); font-size: 16px; }
.chal-me { font-size: 14px; color: var(--fg-soft); }
.chal-me b { color: var(--gold); }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank li.me { color: var(--gold); }
.rank .pos { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex: none; }
.rank li:first-child .pos { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.rank .nm { flex: 1; font-weight: 700; }
.rank .am { font-weight: 800; font-variant-numeric: tabular-nums; }
.h3 { margin: 6px 0 0; font-size: 15px; font-weight: 800; }
.story-prev { width: 100%; max-width: 320px; align-self: center; border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.5); display: block; margin: 0 auto; }

/* ---- Minuteur ---- */
#timer { position: fixed; inset: 0; z-index: 300; background: radial-gradient(120% 70% at 50% 0%, #2b2415 0%, #111 55%); color: var(--fg); display: flex; flex-direction: column; padding: calc(var(--safe-top) + 12px) var(--gutter-r) calc(var(--safe-bottom) + 18px) var(--gutter-l); }
#timer[hidden] { display: none; }
body.timer-on { overflow: hidden; }
.tm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tm-title { font-weight: 800; font-size: 16px; }
.tm-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.tm-meta { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.tm-step.long { font-size: 22px; }
.tm-step { font-size: 30px; font-weight: 800; line-height: 1.15; max-width: 340px; }
.tm-step.rest { color: var(--ok); }
.tm-ring { position: relative; width: 260px; height: 260px; }
.tm-ring svg { width: 100%; height: 100%; }
.tm-ring circle { fill: none; stroke-width: 14; }
.tm-ring .bg { stroke: rgba(255,255,255,.08); }
.tm-ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .2s linear; filter: drop-shadow(0 0 10px rgba(201,168,76,.6)); }
.tm-ring .fg.rest { stroke: var(--ok); filter: none; }
.tm-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tm-ok { width: 220px; height: 220px; border-radius: 50%; border: 0; background: var(--gold); color: var(--on-gold); font: inherit; font-size: 28px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 0 50px rgba(201,168,76,.35); cursor: pointer; }
.tm-ok svg { width: 48px; height: 48px; }
.tm-next { font-size: 15px; color: var(--fg-soft); max-width: 340px; }
.tm-ctrl { display: flex; align-items: center; justify-content: center; gap: 28px; }
.tm-play { width: 76px; height: 76px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(255,255,255,.06); color: var(--fg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tm-play svg { width: 30px; height: 30px; }
.tm-play:empty { visibility: hidden; }
.tm-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.tm-done { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tm-done > svg { width: 84px; height: 84px; color: var(--gold); border: 3px solid var(--gold); border-radius: 50%; padding: 14px; }
.tm-big { font-size: 40px; font-weight: 800; }
.tm-done p { margin: 0; color: var(--fg-soft); }
.tm-done .btn { width: auto; }

/* ---- Statistiques, objectif ---- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar i { display: block; width: 100%; min-height: 3px; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-radius: 6px 6px 2px 2px; }
.bar span { margin-bottom: 4px; font-size: 11px; font-weight: 700; color: var(--fg-soft); }
.bar small { margin-top: 6px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.goalca { border: 1px solid var(--gold-line); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; background: var(--bg-raise); }
.gc-top { display: flex; justify-content: space-between; align-items: baseline; }
.gc-top .lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.gc-top .pct { font-size: 22px; font-weight: 800; color: var(--gold); }
.gc-bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; display: flex; }
.gc-bar .d { background: var(--gold); }
.gc-bar .p { background: repeating-linear-gradient(135deg, rgba(201,168,76,.55) 0 6px, rgba(201,168,76,.25) 6px 12px); }
.gc-n { font-size: 13.5px; color: var(--fg-soft); }
.gc-n b { color: var(--fg); }
.gc-s { font-size: 12.5px; color: var(--muted); }
