/* QG Viinox. Mise en page : une colonne de 760 px max ; sur téléphone, barre d'onglets en bas,
   sous-onglets collants en haut de chaque section, minuteur de repos flottant au-dessus. */
@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/Barlow-Regular.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/Barlow-Medium.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/Barlow-SemiBold.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/Barlow-Bold.woff2) format('woff2'); }
@font-face { font-family: 'Lilita One'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/LilitaOne-Regular.woff2) format('woff2'); }

:root {
  --bg: #F3F4F1;
  --surface: #FFFFFF;
  --fig-bg: #F7F8F5;
  --ink: #17191B;
  --muted: #5C6166;
  --line: #DDE0DB;
  --soft: #ECEEE9;
  --accent: #D9262B;
  --accent-text: #B71C22;
  --accent-fill: #D9262B;
  --on-accent: #FFFFFF;
  --accent-soft: #FBE6E6;
  --good: #1D7A47;
  --on-good: #FFFFFF;
  --good-soft: #E1F2E8;
  --warn: #8A5300;
  --warn-soft: #FDF0D5;
  --info: #1F5FAD;
  --info-soft: #E3EEFB;
  --hero-bg: #17191B;
  --hero-ink: #FFFFFF;
  --bar-bg: #17191B;
  --bar-ink: #FFFFFF;
  --bar-muted: #A9AEB2;
  --bar-btn: #2E3236;
  --done-bg: #1D7A47;
  --done-btn: #2E8B57;
  --shadow: rgb(23 25 27 / .2);
  --scrim: rgb(15 17 18 / .45);
  --fig-ink: #1D2023;
  --fig-far: #9CA2A6;
  --prop: #B1B6B2;
  --prop-fill: #E6E8E3;
  --db: #3A3F43;
  --font-display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
  --font-text: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (min-width: 900px) { :root { --tabbar-h: 0px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1112;
    --surface: #191C1E;
    --fig-bg: #15181A;
    --ink: #EDEFEC;
    --muted: #A1A7AA;
    --line: #2C3033;
    --soft: #222629;
    --accent: #FF5A5F;
    --accent-text: #FF7A7E;
    --accent-fill: #D9262B;
    --on-accent: #FFFFFF;
    --accent-soft: #3A1B1C;
    --good: #5ACB8B;
    --on-good: #0F1112;
    --good-soft: #15291D;
    --warn: #F2B35B;
    --warn-soft: #2F2410;
    --bar-bg: #262A2D;
    --bar-ink: #EDEFEC;
    --bar-muted: #A1A7AA;
    --bar-btn: #363B3F;
    --done-bg: #5ACB8B;
    --done-btn: #7FD9A6;
    --shadow: rgb(0 0 0 / .55);
    --fig-ink: #E9EBE8;
    --fig-far: #697075;
    --prop: #5A6064;
    --prop-fill: #262A2D;
    --db: #C9CDCA;
    --info: #7FB2F0;
    --info-soft: #172334;
    --hero-bg: #262A2D;
    --hero-ink: #EDEFEC;
    --scrim: rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1112;
  --surface: #191C1E;
  --fig-bg: #15181A;
  --ink: #EDEFEC;
  --muted: #A1A7AA;
  --line: #2C3033;
  --soft: #222629;
  --accent: #FF5A5F;
  --accent-text: #FF7A7E;
  --accent-fill: #D9262B;
  --on-accent: #FFFFFF;
  --accent-soft: #3A1B1C;
  --good: #5ACB8B;
  --on-good: #0F1112;
  --good-soft: #15291D;
  --warn: #F2B35B;
  --warn-soft: #2F2410;
  --bar-bg: #262A2D;
  --bar-ink: #EDEFEC;
  --bar-muted: #A1A7AA;
  --bar-btn: #363B3F;
  --done-bg: #5ACB8B;
  --done-btn: #7FD9A6;
  --shadow: rgb(0 0 0 / .55);
  --fig-ink: #E9EBE8;
  --fig-far: #697075;
  --prop: #5A6064;
  --prop-fill: #262A2D;
  --db: #C9CDCA;
  --info: #7FB2F0;
  --info-soft: #172334;
  --hero-bg: #262A2D;
  --hero-ink: #EDEFEC;
  --scrim: rgb(0 0 0 / .6);
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}
[hidden] { display: none !important; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { color: inherit; }
svg { flex: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.wrap {
  max-width: 760px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}
.label {
  font: 600 12px/1.25 var(--font-text);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.h2 { font: 400 34px/1.02 var(--font-display); letter-spacing: .005em; text-wrap: balance; }
.h3 { font: 700 20px/1.2 var(--font-text); text-wrap: balance; }
.lead { font-size: 17px; color: var(--muted); max-width: 62ch; }
.sub { font-size: 15px; color: var(--muted); max-width: 62ch; }
.loading { padding-block: 40px; color: var(--muted); display: grid; gap: 14px; justify-items: start; }

/* ---------- barre du haut, onglets principaux ---------- */
.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: 6px;
}
.brand { display: flex; align-items: baseline; gap: 7px; text-decoration: none; }
.brand b { font: 400 28px/1 var(--font-display); color: var(--accent); }
.brand span { font: 600 13px/1 var(--font-text); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mainnav { display: none; }
.mainnav a {
  display: flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 14px; border-radius: 12px;
  font-weight: 600; color: var(--muted); text-decoration: none;
}
.mainnav a svg { width: 20px; height: 20px; }
.mainnav a:hover { color: var(--ink); background: var(--soft); }
.mainnav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.mainnav a[aria-current="page"] svg { color: var(--accent); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; padding: 0;
  display: grid; place-items: center; background: transparent; color: var(--muted);
}
.icon-btn:hover { color: var(--ink); background: var(--soft); }
.icon-btn svg { width: 22px; height: 22px; }
.tabbar {
  position: fixed; z-index: 15; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  box-sizing: border-box;
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  display: grid; justify-items: center; align-content: center; gap: 4px; min-width: 0;
  text-decoration: none; color: var(--muted); font: 600 12px/1.1 var(--font-text);
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] svg { color: var(--accent); }
@media (min-width: 900px) {
  .mainnav { display: flex; gap: 4px; }
  .tabbar { display: none; }
}

main { padding-block: 6px calc(var(--tabbar-h) + 130px); }
.section { display: grid; gap: 22px; }
.view { display: grid; gap: 22px; min-width: 0; }
.shead, .today-head { display: grid; gap: 4px; padding-top: 8px; }

/* ---------- sous-onglets collants ---------- */
.subnav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 8;
  display: flex;
  margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.subtab {
  flex: 1 1 0; min-width: 0;
  padding: 14px 2px 11px; text-align: center;
  font: 600 15px/1.2 var(--font-text); color: var(--muted); text-decoration: none;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.subtab:hover { color: var(--ink); }
.subtab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.subtab:focus-visible { outline-offset: -3px; }

/* ---------- boutons et champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; box-sizing: border-box;
  border: 0; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { opacity: .88; }
.btn:disabled { opacity: .5; }
.btn svg, .btn-ghost svg { width: 18px; height: 18px; }
.btn.sm, .btn-ghost.sm { min-height: 38px; padding: 0 12px; font-size: 15px; }
.btn-danger {
  min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: transparent; color: var(--accent-text); font-weight: 700;
}
.btn-danger[data-sure] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.link-btn {
  border: 0; background: none; padding: 6px 0; color: inherit;
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:disabled { text-decoration: none; opacity: .7; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label { font-weight: 600; font-size: 15px; line-height: 1.25; }
.field input, .field select, .field textarea, .qadd input, .qadd select, .search {
  width: 100%; min-height: 46px; box-sizing: border-box; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink);
  font: 400 16px/1.35 var(--font-text);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .qadd input:focus, .qadd select:focus, .search:focus { border-color: var(--ink); outline: none; }
.field input::placeholder, .field textarea::placeholder, .qadd input::placeholder, .search::placeholder { color: var(--muted); opacity: .75; }
.hint-s { font-size: 13.5px; color: var(--muted); }
.empty { padding: 14px 16px; border: 1.5px dashed var(--line); border-radius: 16px; color: var(--muted); }

/* ---------- en-tête : la semaine en cours ---------- */
.wk-head { padding-top: 8px; }
.top-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 12px; }
.wk { display: grid; gap: 4px; }
.wk-big { font: 400 60px/.88 var(--font-display); letter-spacing: -.01em; }
.wk-big small { font-size: 26px; color: var(--muted); margin-left: 3px; }
.wk-btns { display: flex; gap: 8px; padding-bottom: 2px; }
.wkbtn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface);
  display: grid; place-items: center; padding: 0;
}
.wkbtn svg { width: 22px; height: 22px; }
.wkbtn:not(:disabled):hover { border-color: var(--ink); }
.wkbtn:disabled { opacity: .35; cursor: default; }
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.strip-ph { display: grid; gap: 7px; min-width: 0; }
.strip-segs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.seg { height: 8px; border-radius: 2px; background: var(--line); }
.seg.past { background: var(--muted); }
.seg.now { background: var(--accent); }
.strip-lab {
  font: 600 12px/1.1 var(--font-text); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip-ph.now .strip-lab { color: var(--ink); }
.wk-target { margin-top: 12px; font-size: 16px; color: var(--muted); }
.wk-target b { color: var(--ink); font-weight: 700; }


.sec { display: grid; gap: 12px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card {
  display: grid; gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
.note { padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.note.warn { background: var(--warn-soft); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: 10px; box-sizing: border-box;
  border: 1.5px solid var(--line); background: transparent; font-weight: 600; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- séance ---------- */
.picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pick {
  display: grid; align-content: start; gap: 6px;
  min-height: 68px; padding: 10px 8px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  text-align: left; min-width: 0;
}
.pick:hover { border-color: var(--muted); }
.pick-day {
  display: flex; align-items: center; gap: 5px;
  font: 600 12px/1 var(--font-text); letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.pick-name { font: 700 14.5px/1.12 var(--font-text); overflow-wrap: anywhere; }
.pick[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pick[aria-pressed="true"] .pick-day { color: inherit; opacity: .75; }
.today-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

.s-head { display: grid; gap: 8px; }
.s-focus { font-size: 17px; color: var(--muted); }
.effort {
  display: flex; gap: 10px; align-items: baseline;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.tag {
  flex: none;
  font: 700 12px/1 var(--font-text); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-text);
}
.fold { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); padding: 0 14px; }
.fold > p { padding-bottom: 12px; }
.fold > summary, .more > summary, .tblfold > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; font-weight: 600;
}
.fold > summary::-webkit-details-marker, .more > summary::-webkit-details-marker, .tblfold > summary::-webkit-details-marker { display: none; }
.fold > summary::after, .more > summary::after, .tblfold > summary::after {
  content: ""; flex: none;
  width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.fold[open] > summary::after, .more[open] > summary::after, .tblfold[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.hint { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--muted); }
.hint-chip {
  flex: none; width: 30px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line);
  font-weight: 700; color: var(--ink); font-size: 14px;
}

.exlist { display: grid; gap: 14px; }
.ex {
  display: grid; gap: 14px;
  grid-template-areas: "head" "fig" "body";
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
.ex-head { grid-area: head; display: flex; gap: 12px; align-items: flex-start; }
.ex-n {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  font: 400 18px/1 var(--font-display);
}
.ex.done .ex-n { background: var(--good); color: var(--on-good); }
.ex-ttl { display: grid; gap: 2px; padding-top: 2px; min-width: 0; }
.ex-ttl h3 { font: 700 20px/1.2 var(--font-text); text-wrap: balance; }
.ex-mus { font-size: 15px; color: var(--muted); }
.ex-fig { grid-area: fig; display: grid; gap: 6px; }
.figbtn {
  --surface: var(--fig-bg);
  position: relative; display: block;
  width: 100%; max-width: 360px; margin-inline: auto;
  padding: 6px 8px 2px; border: 0; border-radius: 14px;
  background: var(--fig-bg);
}
.figbtn:disabled { cursor: default; }
.figstate {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fig-bg); border: 1.5px solid var(--line);
}
.figstate::before {
  content: ""; box-sizing: border-box;
  width: 11px; height: 12px;
  border-left: 3.5px solid var(--muted); border-right: 3.5px solid var(--muted);
}
.figbtn[aria-pressed="true"] .figstate::before {
  width: 11px; height: 12px; margin-left: 3px; border: 0;
  background: var(--muted);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.figbtn:disabled .figstate { display: none; }
.fig-cap { font-size: 13.5px; color: var(--muted); text-align: center; }

.ex-body { grid-area: body; display: grid; gap: 14px; min-width: 0; }
.presc { display: grid; gap: 10px; padding: 12px 14px 14px; border-radius: 14px; background: var(--soft); }
.presc-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.sets { font-size: 17px; font-weight: 600; }
.sets b { font: 400 28px/1 var(--font-display); margin-right: 3px; }
.rest-lab { font-size: 15px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-width: 52px; height: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface);
  font: 700 16px/1 var(--font-text); font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: var(--on-good); }
.chip[aria-pressed="true"]::before {
  content: ""; width: 11px; height: 6px;
  border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: translateY(-2px) rotate(-45deg);
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font: 600 13.5px/1.2 var(--font-text); padding: 5px 9px; border-radius: 7px; background: var(--soft); }
.badge.acc { background: var(--accent-soft); color: var(--accent-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.ex-note { font-size: 15.5px; }
.ex-note b { font-weight: 700; }
.blk { display: grid; gap: 10px; }
.blk h4 { font: 600 12px/1.25 var(--font-text); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.cues { display: grid; gap: 9px; counter-reset: cue; }
.cues li { position: relative; padding-left: 32px; line-height: 1.45; max-width: 62ch; }
.cues li::before {
  counter-increment: cue; content: counter(cue);
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text);
  font: 700 12.5px/22px var(--font-text); text-align: center;
}
.cues.bad li::before { content: ""; counter-increment: none; background: var(--soft); }
.cues.bad li::after {
  content: ""; position: absolute; left: 6px; top: 6px;
  width: 10px; height: 10px; background: var(--muted);
  clip-path: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%);
}
.more { border-top: 1px solid var(--line); }
.more > summary { padding-top: 6px; }
.more-in { display: grid; gap: 14px; padding: 6px 0 4px; }
.vars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vars > div { display: grid; gap: 3px; align-content: start; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.vars dt { font: 600 12px/1.25 var(--font-text); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.vid {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; box-sizing: border-box;
  border-radius: 10px; border: 1.5px solid var(--line);
  text-decoration: none; font-weight: 600;
}
.vid:hover { border-color: var(--ink); }
.vid svg { width: 15px; height: 15px; flex: none; }
.s-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.s-done { font-weight: 600; color: var(--muted); }
.s-done.ok { color: var(--good); }

/* ---------- programme ---------- */
.chart-wrap { position: relative; min-width: 0; }
.chart { display: block; max-width: 100%; height: auto; overflow: visible; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.chart:focus-visible { outline-offset: 4px; border-radius: 6px; }
.c-band { fill: var(--soft); }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-axis, .c-ref { stroke: var(--muted); stroke-width: 1; }
.c-tick { fill: var(--muted); font: 500 12px var(--font-text); }
.c-tick.ref { fill: var(--ink); font-weight: 700; }
.c-phase { fill: var(--muted); font: 600 12px var(--font-text); }
.c-phase.now { fill: var(--ink); font-weight: 700; }
.c-area { fill: var(--accent); fill-opacity: .1; }
.c-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.c-lab {
  fill: var(--ink); font: 700 13px var(--font-text);
  paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round;
}
.c-cross { stroke: var(--ink); stroke-width: 1; stroke-opacity: .45; }
.c-hit { fill: transparent; }
.tip {
  position: absolute; z-index: 2; pointer-events: none;
  transform: translate(-50%, -100%);
  display: grid; gap: 1px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-size: 13px; line-height: 1.25; white-space: nowrap;
}
.tip b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); }
.tbl thead th { border-top: 0; font: 600 12px/1.25 var(--font-text); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.tbl tbody th { font-weight: 600; }
.tbl tr.now { background: var(--accent-soft); }

.phases { display: grid; gap: 12px; }
.phase { display: grid; gap: 12px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.phase.now { border: 2px solid var(--ink); padding: 15px; }
.ph-top { display: flex; align-items: center; gap: 12px; }
.ph-n {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--soft); font: 400 21px/1 var(--font-display);
}
.phase.now .ph-n { background: var(--accent-fill); color: var(--on-accent); }
.ph-ttl { display: grid; gap: 1px; min-width: 0; }
.ph-ttl h3 { font: 700 19px/1.2 var(--font-text); }
.ph-w { font-size: 15px; color: var(--muted); }
.pill {
  margin-left: auto; flex: none;
  font: 700 12px/1 var(--font-text); letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-text);
}
.phase dl { display: grid; gap: 12px; }
.phase dt { font: 600 12px/1.25 var(--font-text); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }

.days { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.days > li + li { border-top: 1px solid var(--line); }
.day {
  display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 0; background: none; text-align: left;
}
button.day:hover { background: var(--soft); }
.day-n { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.day-s { display: grid; gap: 1px; min-width: 0; }
.day-s b { font-weight: 700; }
.day-s span { font-size: 14.5px; color: var(--muted); }
.day.rest .day-s b { font-weight: 500; color: var(--muted); }
.day-l { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.day-l svg { width: 16px; height: 16px; }
.rules { display: grid; gap: 10px; }
.rules li { position: relative; padding-left: 20px; max-width: 62ch; }
.rules li::before {
  content: ""; position: absolute; left: 3px; top: .6em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* ---------- repas ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.stat b { font: 400 34px/1 var(--font-display); }
.stat span { font-size: 15px; color: var(--muted); }
.meals { display: grid; gap: 12px; }
.meal { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.meal-top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; }
.meal-top h3 { font: 700 19px/1.2 var(--font-text); }
.meal-sous { font-weight: 500; color: var(--muted); font-size: 15px; }
.meal-num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meal-num span { font-weight: 500; color: var(--muted); }
.opts { display: grid; gap: 8px; }
.opt { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.opt-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; }
.opt-top b { font-weight: 700; }
.opt-n { font-size: 14.5px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.opt-tip { font-size: 14.5px; color: var(--muted); }
.sans { padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); }
.checks { display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before {
  content: ""; position: absolute; left: 4px; top: .35em;
  width: 11px; height: 6px;
  border-left: 2.5px solid var(--good); border-bottom: 2.5px solid var(--good);
  transform: rotate(-45deg);
}
.list { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.ck {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 14px; box-sizing: border-box; cursor: pointer;
}
.ck input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent-fill); }
.ck input:checked ~ .ck-name { color: var(--muted); text-decoration: line-through; }
.ck-q { font-size: 15px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- suivi ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fields .field { align-content: end; }
.fields .field label { font-size: 15px; font-weight: 600; line-height: 1.25; }
.fields .field input {
  width: 100%; height: 50px; box-sizing: border-box; padding: 0 12px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg);
  font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.fields .field input:focus { border-color: var(--ink); }
.fields .field input::placeholder { color: var(--muted); opacity: .6; }
.calc-out { padding: 14px; border-radius: 14px; background: var(--soft); }
.calc-out.up { background: var(--accent-soft); }
.calc-out.ok { background: var(--good-soft); }
.calc-out.down { background: var(--warn-soft); }
.calc-diff { display: block; font: 400 28px/1.05 var(--font-display); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.calc-out b { font-weight: 700; }
.rulecols { display: grid; gap: 10px; }
.rulecol { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.rulecol dl { display: grid; gap: 6px; }
.rulecol dl > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 10px; align-items: baseline; }
.rulecol dt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 620px) { .rulecols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- minuteur de repos ---------- */
.timer {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) calc(12px + var(--tabbar-h) + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.tm {
  pointer-events: auto;
  position: relative; overflow: hidden;
  max-width: 696px; margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 12px 16px 18px;
  border-radius: 18px;
  background: var(--bar-bg); color: var(--bar-ink);
  box-shadow: 0 12px 32px var(--shadow);
}
.tm-txt { display: grid; gap: 2px; min-width: 0; }
.tm-label {
  font: 600 12px/1.25 var(--font-text); letter-spacing: .08em; text-transform: uppercase;
  color: var(--bar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tm-left { font: 700 36px/1 var(--font-text); font-variant-numeric: tabular-nums; }
.tm-btns { display: flex; gap: 8px; }
.tm-btns button {
  height: 44px; padding: 0 14px; border-radius: 12px; border: 0;
  background: var(--bar-btn); color: var(--bar-ink); font-weight: 700; white-space: nowrap;
}
.tm-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--bar-btn); }
.tm-bar span { display: block; height: 100%; background: var(--accent); transform-origin: left center; }
.timer.done .tm { background: var(--done-bg); color: var(--on-good); }
.timer.done .tm-label { color: inherit; }
.timer.done .tm-btns button { background: var(--done-btn); color: var(--on-good); }
.timer.done .tm-bar { display: none; }

/* ---------- écrans plus larges ---------- */
@media (min-width: 680px) {
  .h2 { font-size: 40px; }
  .ex {
    grid-template-columns: 270px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "fig head" "fig body";
    column-gap: 22px;
    padding: 18px;
    align-items: start;
  }
  .phase dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 400px) {
  .vars { grid-template-columns: 1fr; }
  .subtab { font-size: 14.5px; }
}
@media (prefers-reduced-motion: no-preference) {
  .pick, .chip, .wkbtn, .btn-ghost, .vid, .subtab, .filt, .step, .pcard, .crow, .tcard { transition: background-color .15s, border-color .15s, color .15s; }
  .fold > summary::after, .more > summary::after { transition: transform .2s; }
  .seg { transition: background-color .2s; }
}

/* ---------- fenêtre d'édition et notification ---------- */
#dlg {
  width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(760px, calc(100dvh - 32px));
  padding: 0; border: 0; border-radius: 20px; overflow: hidden;
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px var(--shadow);
}
#dlg::backdrop { background: var(--scrim); }
.dlg-form { display: flex; flex-direction: column; max-height: inherit; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 10px 4px 18px; }
.dlg-head .h3 { min-width: 0; overflow-wrap: anywhere; }
.dlg-body {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px;
  padding: 10px 18px 18px; overflow-y: auto; overscroll-behavior: contain;
}
.dlg-body > .field, .dlg-err { grid-column: 1 / -1; }
.dlg-body > .field.half { grid-column: auto; }
.dlg-err { color: var(--accent-text); font-weight: 600; }
.dlg-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
}
.dlg-acts { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 600px) {
  #dlg { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
}
.toast {
  position: fixed; z-index: 40; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px);
  transform: translateX(-50%); max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-weight: 600; box-shadow: 0 10px 30px var(--shadow);
}

/* ---------- aujourd'hui ---------- */
.motiv { display: grid; gap: 10px; padding: 18px 18px 14px; border-radius: 20px; background: var(--hero-bg); color: var(--hero-ink); }
.motiv .label { color: inherit; opacity: .7; }
.motiv-t { font: 500 19px/1.45 var(--font-text); max-width: 62ch; white-space: pre-line; }
.motiv-t.wait { opacity: .7; }
.motiv-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 14px; font-size: 13.5px; }
.motiv-foot > span { opacity: .7; }
.tcard {
  display: grid; gap: 6px; padding: 16px 16px 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit;
}
.tcard:hover { border-color: var(--muted); }
.tc-t { font: 400 30px/1.05 var(--font-display); }
.tc-s { color: var(--muted); }
.tc-prog { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tc-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 700; }
.tc-go svg { width: 18px; height: 18px; color: var(--accent); }
.pbar { display: block; flex: 1; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.pbar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.pbar.ok > span, .obj.is-done .pbar > span { background: var(--good); }

/* ---------- tâches ---------- */
.grp { display: grid; gap: 8px; }
.grp-n { margin-left: 4px; color: var(--ink); }
.late-l { color: var(--accent-text); }
.tasks { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.tasks > li + li { border-top: 1px solid var(--line); }
.task { display: flex; align-items: stretch; min-width: 0; }
.tick { position: relative; flex: none; width: 54px; padding: 0; border: 0; background: none; display: grid; place-items: center; }
.tick::before { content: ""; width: 22px; height: 22px; box-sizing: border-box; border-radius: 7px; border: 2px solid var(--muted); }
.tick[aria-pressed="true"]::before { background: var(--good); border-color: var(--good); }
.tick[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 5px;
  border-left: 2.5px solid var(--on-good); border-bottom: 2.5px solid var(--on-good);
  transform: translate(-50%, -70%) rotate(-45deg);
}
.task-main {
  flex: 1; min-width: 0; display: grid; gap: 3px; align-content: center;
  min-height: 52px; padding: 10px 14px 10px 0; border: 0; background: none; text-align: left;
}
.task-t { font-weight: 500; overflow-wrap: anywhere; }
.task.is-done .task-t { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; color: var(--muted); }
.task-meta .late { color: var(--accent-text); font-weight: 600; }
.space-tag {
  display: inline-block; font: 700 11px/1 var(--font-text); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 6px; border-radius: 5px; background: var(--soft); color: var(--muted); vertical-align: 2px;
}
.qadd { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.qadd.with-space { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.qadd select { width: auto; padding-right: 8px; }
@media (max-width: 560px) {
  .qadd { grid-template-columns: minmax(0, 1fr) auto; }
  .qadd.with-space { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .qadd input { grid-column: 1 / -1; }
  .qadd select { width: 100%; }
}
.fold-s > summary { cursor: pointer; padding: 6px 0; font-weight: 600; color: var(--muted); }
.fold-s[open] > summary { margin-bottom: 8px; }

/* ---------- objectifs ---------- */
.objs { display: grid; gap: 10px; }
.obj {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px;
  padding: 12px 12px 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.obj-main {
  grid-column: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  min-width: 0; padding: 0; border: 0; background: none; text-align: left; font-weight: 600;
}
.obj-t { min-width: 0; overflow-wrap: anywhere; }
.obj-n { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.obj .pbar { grid-column: 1; }
.obj-btns { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.step {
  width: 44px; height: 44px; padding: 0; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); font: 700 20px/1 var(--font-text);
}
.step:hover:not(:disabled) { border-color: var(--muted); }
.step:disabled { opacity: .4; }

/* ---------- prospects ---------- */
.sec-ttl { display: grid; gap: 2px; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filt {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 14.5px; font-weight: 600;
}
.filt span { color: var(--muted); font-variant-numeric: tabular-nums; }
.filt:hover { border-color: var(--muted); }
.filt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filt[aria-pressed="true"] span { color: inherit; opacity: .7; }
.search { -webkit-appearance: none; appearance: none; }
.cards { display: grid; gap: 10px; }
.pcard {
  width: 100%; display: grid; gap: 4px; padding: 14px 16px; box-sizing: border-box;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left;
}
.pcard:hover { border-color: var(--muted); }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pc-nom { min-width: 0; font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.pc-sub { font-size: 14.5px; color: var(--muted); overflow-wrap: anywhere; }
.pc-next { font-size: 15px; overflow-wrap: anywhere; }
.pc-next.due { color: var(--accent-text); font-weight: 600; }
.st {
  flex: none; padding: 5px 9px; border-radius: 99px; white-space: nowrap;
  font: 700 12px/1 var(--font-text); background: var(--soft); color: var(--ink);
}
.st-contacte, .cs-pret { background: var(--info-soft); color: var(--info); }
.st-a-relancer, .cs-a-faire { background: var(--warn-soft); color: var(--warn); }
.st-interesse { background: var(--accent-soft); color: var(--accent-text); }
.st-client, .cs-publie { background: var(--good-soft); color: var(--good); }
.st-perdu, .cs-idee { background: var(--soft); color: var(--muted); }

/* ---------- contenu ---------- */
.crows { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.crows > li + li { border-top: 1px solid var(--line); }
.crow {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 10px 14px; box-sizing: border-box; border: 0; background: none; text-align: left;
}
.crow:hover { background: var(--soft); }
.cr-main { display: grid; gap: 2px; min-width: 0; }
.cr-t { font-weight: 600; overflow-wrap: anywhere; }
.cr-sub { font-size: 14px; color: var(--muted); }

/* ---------- connexion ---------- */
.login {
  min-height: 100dvh; display: grid; place-items: center; box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.login::before { display: none; }
.login-card {
  width: min(400px, 100%); box-sizing: border-box; display: grid; gap: 22px;
  padding: 26px 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
}
.login-card .brand b { font-size: 46px; }
.login-form { display: grid; gap: 14px; }

/* ---------- visuels TikTok : galerie ---------- */
.dlg-left { display: flex; flex-wrap: wrap; gap: 8px; }
.crow .cr-main { flex: 1; }
.cr-mini { flex: none; width: 36px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
.vgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 640px) { .vgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vcard { width: 100%; display: grid; gap: 7px; align-content: start; padding: 0; border: 0; background: none; text-align: left; }
.vthumb {
  position: relative; display: block; aspect-ratio: 9 / 16; max-width: 100%; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
}
.vthumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vcard:hover .vthumb { border-color: var(--muted); }
.vph { display: grid; place-items: center; height: 100%; padding: 12px; box-sizing: border-box; text-align: center; color: var(--muted); font-weight: 600; }
.vthumb.busy::after {
  content: "Génération…"; position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px 8px; border-radius: 8px;
  background: var(--hero-bg); color: var(--hero-ink); font: 600 12.5px/1.2 var(--font-text); text-align: center;
}
.vthumb.busy:has(.vph)::after { display: none; }
.vt { font-weight: 700; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.vmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .vthumb.busy { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .55; } }
}

/* ---------- visionneuse ---------- */
#viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--ink);
}
#viewer[open] { display: flex; flex-direction: column; }
#viewer::backdrop { background: var(--scrim); }
.vw-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
}
.vw-ttl { display: grid; gap: 2px; min-width: 0; }
.vw-ttl .h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-note { margin: 0 max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); font-size: 14.5px; }
.vw-strip {
  flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; padding: 4px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
}
.vw-page { flex: none; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - 32px); margin: 0; scroll-snap-align: center; }
.vw-page img {
  display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 14px;
  background: var(--surface); box-shadow: 0 6px 22px var(--shadow);
}
.vw-acts {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--line); background: var(--surface);
}
.vw-acts .btn-ghost, .vw-acts .btn-danger { min-height: 44px; }
@media (max-width: 600px) { .vw-main { flex: 1 1 100%; } }

/* ---------- éditeur de carrousel ---------- */
.ed { display: grid; gap: 16px; }
.ed-back { justify-self: start; }
.ed-card { display: grid; gap: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.ed-h { display: flex; align-items: center; gap: 10px; font: 700 19px/1.2 var(--font-text); }
.ed-h > span {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font: 400 17px/1 var(--font-display);
}
.ed-h .link-btn { margin-left: auto; font-size: 14.5px; }
.ed-bloc { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--soft); min-width: 0; }
.ed-bloc .field input, .ed-bloc .field textarea { background: var(--surface); }
.ed-bloc-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ed .field textarea { min-height: 70px; }
.flabel { font-weight: 600; font-size: 15px; }
.emo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.emo {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; box-sizing: border-box;
  padding: 3px 2px 3px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
}
.emo img { width: 36px; height: 36px; }
.emo-face {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft); font-weight: 700; color: var(--muted);
}
.emo-n { min-width: 0; max-width: 130px; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emo-x { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); display: grid; place-items: center; }
.emo-x svg { width: 16px; height: 16px; }
.emo-x:hover { color: var(--ink); background: var(--soft); }
.emo-add {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border-radius: 12px; border: 1.5px dashed var(--muted); background: none; font-weight: 600;
}
.emo-add svg { width: 16px; height: 16px; }
.ed-acts {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 5;
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-block: 12px; background: var(--bg);
}

/* ---------- choix d'un emoji ---------- */
#emojiPicker {
  width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(640px, calc(100dvh - 32px));
  padding: 0; border: 0; border-radius: 20px; overflow: hidden; background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 64px var(--shadow);
}
#emojiPicker[open] { display: flex; flex-direction: column; }
#emojiPicker::backdrop { background: var(--scrim); }
@media (max-width: 600px) { #emojiPicker { width: 100%; max-height: 85dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; } }
.pk-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 8px 16px; }
.pk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; align-content: start;
  padding: 6px 14px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain;
}
.pk-grid .empty { grid-column: 1 / -1; }
.pk-e { aspect-ratio: 1; padding: 7px; border: 0; border-radius: 12px; background: var(--soft); display: grid; place-items: center; }
.pk-e:hover { background: var(--line); }
.pk-e img { width: 100%; height: auto; }
