/* =====================================================================
   OKTO · système visuel (praticien + patient)
   Noir OKTO, blanc, un gris de surface. Angles droits, peu de filets,
   les options avancées restent repliées.
   ===================================================================== */

:root {
  --ink: #000000;
  --paper: #FFFFFF;
  --graphite: #6E6E6E;
  --mist: #F3F3F3;
  --mist-2: #E6E6E6;
  --line: #ECECEC;
  --danger: #B42318;
  --font: 'Jost', 'Futura', 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side: 232px;
  --tabbar: 64px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--ink); }
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; font-size: 16px; color: var(--ink); }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Coquille : menu latéral (ordinateur) / onglets (téléphone) ---------- */
.shell { min-height: 100vh; }
.side { display: none; }
.main { min-width: 0; }
.page { max-width: 760px; margin: 0 auto; padding: 0 20px calc(120px + env(safe-area-inset-bottom)); }
.page.wide { max-width: 1240px; }
.vue { animation: apparait .16s var(--ease); }
@keyframes apparait { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.mhead { display: flex; align-items: center; justify-content: space-between; height: 56px; padding-top: env(safe-area-inset-top); }
.mhead .brand img.sym { width: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img.sym { width: 30px; height: auto; }
.brand img.mot { width: 84px; height: auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar); font-size: 11px; text-decoration: none; color: var(--graphite);
}
.tabbar a.active { color: var(--ink); }
.tabbar a.active svg { stroke-width: 2.2; }

@media (min-width: 1000px) {
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    padding: 28px 18px 24px; border-right: 1px solid var(--line);
  }
  .side .brand { padding: 0 10px 32px; }
  .side nav { display: flex; flex-direction: column; gap: 2px; }
  .side nav a, .side .out {
    display: flex; align-items: center; gap: 12px; padding: 10px 10px; text-decoration: none;
    color: var(--graphite); font-size: 15px; border: none; background: none; text-align: left;
  }
  .side nav a:hover, .side .out:hover { color: var(--ink); background: var(--mist); }
  .side nav a.active { color: var(--ink); background: var(--mist); font-weight: 500; }
  .side .out { margin-top: auto; font-size: 14px; }
  .tabbar, .mhead { display: none; }
  .page { padding: 0 48px 120px; }
}

/* ---------- En-têtes de page ---------- */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 18px; }
.phead .txt { min-width: 0; }
h1 { font-weight: 300; font-size: 34px; line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
h2 { font-weight: 400; font-size: 21px; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
@media (min-width: 1000px) { h1 { font-size: 44px; } .phead { margin: 48px 0 24px; } }
.sub { color: var(--graphite); font-size: 14px; }
.phead .sub { margin-top: 6px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-top: 4px;
  font-size: 14px; text-decoration: none; color: var(--graphite);
}
.back:hover { color: var(--ink); }
@media (min-width: 1000px) { .back { margin-top: 32px; } .back + .phead { margin-top: 8px; } }

.label { display: block; font-size: 13px; font-weight: 500; color: var(--graphite); margin-bottom: 8px; }
.section { margin-top: 36px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.section-head .label { margin: 0; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; margin-top: 16px; }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid transparent; border-radius: 0; background: var(--mist);
  outline: none; -webkit-appearance: none; appearance: none; transition: background .15s, border-color .15s;
}
.input:hover, .textarea:hover, .select:hover { background: #EDEDED; }
.input:focus, .textarea:focus, .select:focus { background: var(--paper); border-color: var(--ink); }
.input::placeholder, .textarea::placeholder { color: #A3A3A3; }
.textarea { resize: vertical; min-height: 92px; line-height: 1.45; }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 19px) 20px, calc(100% - 14px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input.center { text-align: center; padding-left: 6px; padding-right: 6px; }
.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cadre { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
@media (max-width: 520px) { .cadre { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.small-label { display: block; font-size: 12.5px; color: var(--graphite); margin-bottom: 5px; }

.search { display: flex; align-items: center; gap: 10px; background: var(--mist); padding: 0 14px; margin-top: 4px; }
.search:focus-within { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.search input { flex: 1; border: none; outline: none; min-height: 46px; background: transparent; }
.search svg { color: var(--graphite); }

.tabs { display: flex; gap: 22px; overflow-x: auto; margin-top: 14px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; min-height: 42px; padding: 0; border: none; background: none;
  font-size: 15px; color: var(--graphite); box-shadow: inset 0 -2px 0 transparent; transition: color .15s, box-shadow .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--mist); padding: 3px; gap: 3px; }
.seg button { min-height: 36px; padding: 0 14px; border: none; background: transparent; font-size: 14px; color: var(--graphite); transition: background .15s, color .15s; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  border: 1px solid var(--mist-2); background: var(--paper); min-height: 34px; padding: 0 12px;
  font-size: 14px; color: var(--ink); transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 500; text-decoration: none;
  transition: opacity .15s, background .15s, transform .08s;
}
.btn:hover { opacity: .86; }
.btn:active { transform: scale(.985); }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--mist-2); }
.btn.ghost:hover { opacity: 1; border-color: var(--ink); }
.btn.soft { background: var(--mist); color: var(--ink); border-color: var(--mist); }
.btn.soft:hover { opacity: 1; background: var(--mist-2); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.linkbtn { text-align: left; border: none; background: none; padding: 8px 0; font-size: 14px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 4px; }
.linkbtn.muted { color: var(--graphite); }
.linkbtn.danger { color: var(--danger); }
.iconbtn {
  width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--graphite); transition: background .15s, color .15s;
}
.iconbtn:hover:not(:disabled) { color: var(--ink); background: var(--mist); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.iconbtn.fav.on { color: var(--ink); }
.addbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); border: none; flex-shrink: 0; }
.phead .btn { flex-shrink: 0; }
.only-desk { display: none !important; }
@media (min-width: 1000px) { .only-desk { display: inline-flex !important; } .only-mob { display: none !important; } }

/* Barre d'action en bas (enregistrer…) */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
}
.bottombar .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.bottombar .btn { flex: 1; }
.bottombar .hint { font-size: 13px; color: var(--graphite); flex: 1; }
@media (min-width: 1000px) {
  .bottombar { left: var(--side); padding-left: 48px; padding-right: 48px; }
  .bottombar .inner { max-width: 1240px; justify-content: flex-end; }
  .bottombar .btn { flex: 0 0 auto; min-width: 260px; }
}

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; }
.list > * { flex-shrink: 0; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0; min-height: 64px;
  border: none; border-bottom: 1px solid var(--line); background: none;
  text-decoration: none; color: var(--ink); width: 100%; text-align: left; transition: background .12s;
}
a.row:hover, button.row:hover { background: linear-gradient(90deg, var(--paper), var(--mist) 12%, var(--mist) 88%, var(--paper)); }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row .title { font-size: 16.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13.5px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .aside { text-align: right; flex-shrink: 0; font-size: 13px; color: var(--graphite); line-height: 1.35; }
.initials {
  width: 42px; height: 42px; flex-shrink: 0; background: var(--mist); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500;
}
.thumb { width: 48px; height: 64px; flex-shrink: 0; background: #1A1A1A; object-fit: cover; }
.thumb.sm { width: 40px; height: 52px; }
.thumb.ph { display: flex; align-items: center; justify-content: center; color: #8A8A8A; }
.empty { padding: 40px 0; color: var(--graphite); text-align: left; }
.pick {
  width: 32px; height: 32px; flex-shrink: 0; border: 1px solid var(--mist-2); background: var(--paper);
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.pick.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Banque en grille sur ordinateur */
@media (min-width: 1000px) {
  .list.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 28px 18px; margin-top: 12px; }
  .grille .tile { flex-direction: column; align-items: stretch; gap: 10px; border: none; padding: 0; min-height: 0; position: relative; }
  .grille .tile:hover { background: none; }
  .grille .tile .thumb { width: 100%; height: auto; aspect-ratio: 3 / 4; transition: opacity .15s; }
  .grille .tile:hover .thumb { opacity: .9; }
  .grille .tile .fav { position: absolute; top: 6px; right: 6px; background: rgba(255, 255, 255, .92); }
}
.tile { position: relative; }
.tile .b-add { gap: 14px; }
@media (min-width: 1000px) {
  .grille .tile .b-add { flex-direction: column; align-items: stretch; gap: 10px; padding: 0; }
  .grille .tile .grow { gap: 0; }
}
.duo { grid-template-columns: minmax(0, 1fr); gap: 0 10px; }
@media (min-width: 700px) { .duo { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.ed-main { max-width: 820px; min-width: 0; }

/* ---------- Bloc programme (dossier) ---------- */
.panel { background: var(--ink); color: var(--paper); padding: 24px 22px; margin-top: 8px; }
.panel .label { color: #A8A8A8; }
.panel h2 { font-size: 26px; font-weight: 300; }
.panel .line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #262626; font-size: 15px; }
.panel .line span:last-child { color: #A8A8A8; flex-shrink: 0; }
.panel .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.panel .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.panel .btn.ghost { background: transparent; color: var(--paper); border-color: #4A4A4A; }
.panel .btn.ghost:hover { border-color: var(--paper); }
.liens { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Éditeur ---------- */
.editeur { display: block; }
.ed-banque { display: none; }
@media (min-width: 1180px) {
  .editeur { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: start; }
  .ed-banque {
    display: block; position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
    padding: 40px 0 120px 32px; border-left: 1px solid var(--line); scrollbar-width: thin;
  }
  .ed-banque .row { min-height: 56px; padding: 6px 0; }
  .ed-banque .title { font-size: 15px; }
  .ed-ajout { display: none !important; }
}
.b-row { gap: 4px; }
.b-add { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: none; background: none; padding: 4px 0; text-align: left; color: inherit; }
.b-add:hover .pick { border-color: var(--ink); }
.b-row.in .title { color: var(--graphite); }
.outils { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.ex { border-bottom: 1px solid var(--line); }
.ex:first-child { border-top: 1px solid var(--line); }
.ex-head { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.ex-head .num { width: 18px; font-size: 13px; color: var(--graphite); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ex-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: none; background: none; padding: 0; text-align: left; color: inherit; }
.ex-toggle .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ex-toggle .name { font-size: 16px; font-weight: 500; line-height: 1.25; }
.ex-toggle .dose { font-size: 14px; color: var(--ink); }
.ex-toggle .cons { font-size: 13px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-toggle .chev { color: var(--graphite); transition: transform .2s var(--ease); flex-shrink: 0; }
.ex.open .ex-toggle .chev { transform: rotate(180deg); }
.ex-acts { display: none; }
@media (min-width: 700px) { .ex-acts { display: flex; } }
.ex-body { display: none; padding: 4px 0 18px 30px; }
.ex.open .ex-body { display: flex; flex-direction: column; gap: 14px; animation: deplie .18s var(--ease); }
@keyframes deplie { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ex-foot { display: flex; gap: 4px; justify-content: flex-end; }
@media (min-width: 700px) { .ex-foot { display: none; } }
@media (max-width: 699px) { .ex-body { padding-left: 0; } }
.plus { align-self: flex-start; }

/* ---------- Fenêtres ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 40; background: var(--paper); overflow-y: auto;
  animation: monte .24s var(--ease);
}
.sheet .page { padding-bottom: 120px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; background: var(--paper); z-index: 2; padding: calc(10px + env(safe-area-inset-top)) 0 10px; }
@keyframes monte { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-back {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .4);
  display: flex; align-items: flex-end; justify-content: center; animation: fond .18s ease;
}
@keyframes fond { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--paper); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: monte .24s var(--ease);
}
.modal .section-head { margin-bottom: 4px; }
@media (min-width: 640px) { .modal-back { align-items: center; } .modal { padding: 28px; } }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70;
  background: var(--ink); color: var(--paper); padding: 12px 18px; font-size: 14px; max-width: calc(100% - 40px);
  animation: monte .2s var(--ease);
}

.progress { font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.progress .st { color: var(--graphite); flex-shrink: 0; }
.progress .st.ok { color: var(--ink); }
.progress .st.err { color: var(--danger); }

/* QR code */
.qr { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0 6px; }
.qr canvas { width: 220px; height: 220px; image-rendering: pixelated; }
.qr .url { font-size: 12.5px; color: var(--graphite); word-break: break-all; text-align: center; }

/* ---------- Connexion ---------- */
.login { max-width: 400px; margin: 14vh auto 0; padding: 0 20px; }
.login .brand { margin-bottom: 48px; }
.login h1 { margin-bottom: 8px; }
.error { color: var(--danger); font-size: 14px; margin-top: 12px; }

/* ---------- Documents ---------- */
.doc-ico {
  width: 46px; height: 60px; flex-shrink: 0; background: var(--mist); color: var(--graphite);
  display: flex; align-items: flex-end; padding: 6px; font-size: 10px; letter-spacing: .08em;
}
.doc-ico.equipe { background: var(--ink); color: var(--paper); }
.doc-thumb {
  width: 46px; height: 60px; flex-shrink: 0; display: block; object-fit: cover; object-position: top;
  background: var(--paper); box-shadow: 0 0 0 1px var(--line);
}
.doc-thumb.equipe { box-shadow: 0 0 0 1px var(--line), inset 0 -3px 0 var(--ink); }
.doc-apercu { display: block; width: 100%; border: none; padding: 0; margin-top: 14px; background: none; cursor: zoom-in; }
.doc-apercu .doc-thumb { width: 100%; height: auto; max-height: 34vh; }
.badge { display: inline-block; font-size: 12px; padding: 1px 6px; background: var(--ink); color: var(--paper); margin-left: 6px; vertical-align: 2px; }

/* =====================================================================
   Page patient
   ===================================================================== */
.p-hero { background: var(--ink); color: var(--paper); }
.p-hero .page { padding-bottom: 34px; }
.p-hero .topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(18px + env(safe-area-inset-top)) 0 0; }
.p-hero .topbar .tag { font-size: 13px; color: #A8A8A8; }
.p-hero h1 { font-size: 40px; margin-top: 8px; }
.p-hero .sub { color: #BDBDBD; margin-top: 8px; }
.p-hero .label { color: #A8A8A8; }
.langs { display: flex; gap: 2px; }
.lang { min-width: 38px; min-height: 32px; border: none; background: transparent; color: #8A8A8A; font-size: 13px; }
.lang.on { color: var(--paper); box-shadow: inset 0 -1px 0 var(--paper); }
@media (max-width: 420px) { .p-hero .tag { display: none; } }

.p-start { margin-top: 22px; }
.p-start .btn { min-height: 56px; font-size: 16px; }
.p-start .sub { text-align: center; margin: 10px 0 0; }
.p-start .rappel { margin-top: 8px; min-height: 52px; font-weight: 400; }
.p-start .rappel.fait { border-color: var(--line); color: var(--graphite); }
.p-cadre { display: grid; margin-top: 22px; background: var(--mist); }
.p-cadre > div { padding: 14px; }
.p-cadre > div + div { box-shadow: inset 2px 0 0 var(--paper); }
.p-cadre .k { font-size: 12.5px; color: var(--graphite); }
.p-cadre .v { font-size: 16px; margin-top: 2px; }
.p-mot { margin-top: 22px; padding-left: 16px; box-shadow: inset 2px 0 0 var(--ink); }
.p-mot p { margin: 4px 0 0; font-size: 17px; white-space: pre-line; }

.p-sec { margin-top: 36px; }
.p-item {
  display: flex; gap: 14px; align-items: center; width: 100%; padding: 12px 0; border: none; border-bottom: 1px solid var(--line);
  background: none; text-align: left; color: inherit; text-decoration: none;
}
.p-item:first-of-type { border-top: 1px solid var(--line); }
.p-item .media { width: 72px; height: 96px; flex-shrink: 0; background: #1A1A1A; object-fit: cover; }
.p-item .txt { flex: 1; min-width: 0; }
.p-item .name { font-size: 17px; font-weight: 500; line-height: 1.25; }
.p-item .dose { font-size: 15px; margin-top: 3px; }
.p-item .why { font-size: 13.5px; color: var(--graphite); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-item .go { color: var(--graphite); flex-shrink: 0; }
.p-docs .doc-thumb { width: 52px; height: 68px; }

.p-alerte { margin-top: 36px; padding: 14px 16px; background: var(--mist); font-size: 14px; }
.p-foot { margin-top: 36px; }
.p-foot .rdv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-foot .legal { margin: 28px 0 0; font-size: 12px; color: var(--graphite); text-align: center; }
.p-foot .reseaux { display: flex; justify-content: center; gap: 22px; margin-top: 8px; }
.p-foot .reseaux a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); text-decoration: none; min-height: 40px; }
.p-foot .reseaux a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Fiche exercice plein écran (page patient) */
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; overflow-y: auto; animation: monte .22s var(--ease); }
.viewer .s-video { height: 56vh; }
.v-params { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; margin-top: 4px; border-top: 1px solid #262626; }
.v-params > div { padding: 12px 0 4px; }
.v-params .k { font-size: 12.5px; color: #A8A8A8; }
.v-params .v { font-size: 18px; }

/* ---------- Séance guidée ---------- */
.seance {
  position: fixed; inset: 0; z-index: 60; background: #000; color: #fff;
  display: flex; flex-direction: column; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom);
  animation: monte .22s var(--ease);
}
.s-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 20px 10px; }
.s-top .label { color: #A8A8A8; margin: 0; }
.s-close { width: 40px; height: 40px; border: none; background: rgba(255, 255, 255, .1); color: #fff; font-size: 22px; line-height: 1; }
.s-video { width: 100%; height: 40vh; min-height: 200px; object-fit: contain; background: #000; flex-shrink: 0; }
.s-body { padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 12px; max-width: 760px; width: 100%; margin: 0 auto; }
.s-name { font-size: 24px; font-weight: 400; margin: 0; }
.s-phase { font-size: 14px; color: #A8A8A8; }
.s-chrono { font-size: 76px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.s-target { font-size: 40px; font-weight: 300; line-height: 1.1; }
.s-sub { margin: 0; color: #CFCFCF; font-size: 15px; }
.s-consigne { margin: 0; font-size: 16px; border-top: 1px solid #262626; padding-top: 12px; }
.s-btn {
  min-height: 56px; border: 1px solid #fff; background: #fff; color: #000;
  font-size: 16px; font-weight: 500; margin-top: 6px; width: 100%;
}
.s-btn.ghost { background: transparent; color: #fff; border-color: #4A4A4A; }
.s-btn:disabled { opacity: .55; }
.s-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.s-nav { display: flex; justify-content: space-between; margin-top: 6px; }
.s-link { border: none; background: none; color: #A8A8A8; font-size: 14px; padding: 12px 0; min-height: 44px; }
.s-link:disabled { opacity: .35; }
.s-notes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.s-notes button { min-height: 48px; border: 1px solid #3A3A3A; background: transparent; color: #fff; font-size: 17px; }
.s-notes button.on { background: #fff; color: #000; border-color: #fff; }

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

/* Rangement automatique de la banque */
.rangement { max-height: 42vh; overflow-y: auto; margin-top: 14px; border-top: 1px solid var(--line); }
.rangement .row { min-height: 0; padding: 9px 0; }
.rangement .row:first-child { border-top: none; }

/* Capsules vidéo (Documents) */
.doc-vid { position: relative; width: 46px; height: 60px; flex-shrink: 0; background: #1A1A1A; display: flex; align-items: center; justify-content: center; color: #FFFFFF; overflow: hidden; }
.doc-vid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.doc-vid > span { position: relative; width: 26px; height: 26px; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); }
.p-docs .doc-vid { width: 52px; height: 68px; }

/* Règle de la douleur à 24 h (page patient) */
.p-regle { margin: 10px 0 0; font-size: 13.5px; color: var(--graphite); }
.p-matin { margin-top: 22px; padding: 18px 16px; background: var(--ink); color: var(--paper); }
.p-matin .label { color: #A8A8A8; margin-bottom: 4px; }
.p-matin .q { margin: 0 0 14px; font-size: 18px; line-height: 1.3; }
.p-matin .notes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.p-matin .notes button { min-height: 46px; border: 1px solid #3A3A3A; background: transparent; color: var(--paper); font-size: 17px; }
.p-matin .notes button:active { background: var(--paper); color: var(--ink); }
.p-matin .pied { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 12px; }
.p-matin .pied .sub { color: #A8A8A8; font-size: 12.5px; }
.p-matin .linkbtn { color: #CFCFCF; white-space: nowrap; }
.p-verdict { margin-top: 22px; padding: 14px 16px; box-shadow: inset 2px 0 0 var(--ink); background: var(--mist); }
.p-verdict.trop { background: var(--ink); color: var(--paper); box-shadow: none; }
.p-verdict strong { font-weight: 500; font-size: 16px; }
.p-verdict p { margin: 4px 0 0; font-size: 14.5px; }
.meta.alerte { color: var(--danger); }

/* =====================================================================
   Version imprimable (A4)
   ===================================================================== */
@page { size: A4; margin: 12mm; }
.impression { background: #FFFFFF; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.imp { max-width: 186mm; margin: 0 auto; color: #000; font-size: 10.5pt; line-height: 1.35; }
@media screen { .imp { padding: 24px 20px 48px; } }
.imp-head { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 4mm; border-bottom: 0.4mm solid #000; }
.imp-logo { width: 32mm; }
.imp-meta { text-align: right; font-size: 9pt; color: #555; }
.imp h1 { font-size: 24pt; font-weight: 300; margin: 6mm 0 3mm; }
.imp-cadre { display: flex; gap: 10mm; flex-wrap: wrap; }
.imp-cadre span { display: block; font-size: 8.5pt; color: #555; }
.imp-cadre strong { font-weight: 500; }
.imp-regle { margin: 3mm 0 0; font-size: 9.5pt; }
.imp-regle strong { font-weight: 500; }
.imp-mot { margin-top: 4mm; padding-left: 3mm; border-left: 0.6mm solid #000; }
.imp-mot span { font-size: 8.5pt; color: #555; }
.imp-mot p { margin: 1mm 0 0; white-space: pre-line; }
.imp-ex { list-style: none; padding: 0; margin: 6mm 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4mm 6mm; }
.imp-ex li { display: flex; gap: 3.5mm; padding-top: 3mm; border-top: 0.3mm solid #CFCFCF; break-inside: avoid; page-break-inside: avoid; }
.imp-ex img, .imp-ex .ph { width: 21mm; height: 28mm; object-fit: cover; flex-shrink: 0; background: #E6E6E6; }
.imp-ex .n { font-weight: 500; font-size: 11pt; }
.imp-ex .d { margin-top: 1mm; }
.imp-ex .x, .imp-ex .w { margin-top: 1mm; font-size: 9pt; color: #555; }
.imp-ex .c { margin-top: 1mm; font-size: 9.5pt; }
.imp-docs { margin-top: 6mm; break-inside: avoid; }
.imp-docs span { font-size: 8.5pt; color: #555; }
.imp-docs ul { margin: 1mm 0 0; padding-left: 5mm; }
.imp-foot { display: flex; gap: 6mm; align-items: flex-start; margin-top: 8mm; padding-top: 4mm; border-top: 0.4mm solid #000; break-inside: avoid; page-break-inside: avoid; font-size: 9pt; }
.imp-qr { width: 30mm; height: 30mm; flex-shrink: 0; image-rendering: pixelated; }
.imp-foot strong { font-weight: 500; font-size: 10pt; }
.imp-foot .url { margin-top: 1mm; color: #555; word-break: break-all; }
.imp-foot p { margin: 2mm 0 0; }
.imp-foot .cab { color: #555; }

/* Paliers (programme sur plusieurs semaines) */
.pal-ligne { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 14.5px; }
.pal-ligne .input { width: 72px; min-height: 40px; padding: 6px; }
.palier-titre { font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: -6px; }
.grid.palier .input { min-height: 40px; padding: 8px 4px; }
.grid.palier .small-label { font-size: 12px; }
.p-palier { margin: 14px 0 0; padding: 12px 14px; background: var(--mist); font-size: 14px; }
.p-palier strong { font-weight: 500; }
.imp-ex .d.p { font-size: 9.5pt; }
