/* Cercle — feuille de style unique, sans dépendance externe.
   Direction artistique « Rose thé » : le pastel ne sert que de fond ; texte, bordures de contrôles,
   focus et marques de graphique restent foncés (≥ 4,5:1 pour le texte, ≥ 3:1 pour l'UI). */

/* ---------- Police : Atkinson Hyperlegible Next (SIL OFL 1.1, voir fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/AtkinsonHyperlegibleNext-latin-c30cdd7a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/AtkinsonHyperlegibleNext-latin-ext-6291a398.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/AtkinsonHyperlegibleNext-Italic-latin-803b25a5.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/AtkinsonHyperlegibleNext-Italic-latin-ext-1d85e5e9.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  /* Surfaces : pastel uniquement ici */
  --bg: #fbf6f5;
  --surface: #ffffff;
  --surface-2: #f8edee;
  --surface-tint: #fce4ea;
  --border: #ecdcdf;          /* décoratif */
  --border-input: #8c6f77;    /* champs, cases : 4,5 surface · 4,2 bg · 3,7 surface-tint */
  /* Texte */
  --ink: #2b1c22;
  --ink-2: #57404a;
  --ink-3: #6c5660;
  /* Marque */
  --primary: #99285c;
  --primary-strong: #7a1d48;
  --primary-ink: #ffffff;
  --primary-soft: #fbe3ec;
  --accent: #6a3c78;
  --focus: #7a1d48;
  /* Statuts */
  --good: #2b6a3d;  --good-soft: #e3f1e6;
  --warn: #875006;  --warn-soft: #fcf0c8;
  --bad:  #b3330f;  --bad-soft:  #fde3da;
  /* Graphiques */
  --chart: #99285c;
  --grid: #f0e3e6;
  --div-good: #2f6f9f;
  --div-mid:  #c7bcc0;
  --div-warn: #c4862a;
  --div-bad:  #8f2f0b;
  --div-good-ink: #ffffff;
  /* Avatars : pastels, initiales en --ink (≥ 11:1) */
  --av-1: #f8cfdc; --av-2: #fbd6c0; --av-3: #f3e0a6; --av-4: #cfe5c9;
  --av-5: #c4e4e0; --av-6: #cfdff4; --av-7: #ded4f4; --av-8: #f0cdeb;
  /* Forme */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(43, 28, 34, .05), 0 4px 14px rgba(153, 40, 92, .06);
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Espacements */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;
  /* Icônes de statut (masques CSS, forme distincte : coche / triangle / octogone) */
  --i-good: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM8 12.5l2.7 2.7L16.2 9.6'/%3E%3C/svg%3E");
  --i-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 4 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4a2 2 0 0 0-3.4 0zM12 9.5v4M12 17.2v.1'/%3E%3C/svg%3E");
  --i-bad: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.5h8L21.5 8v8L16 21.5H8L2.5 16V8zM15 9l-6 6M9 9l6 6'/%3E%3C/svg%3E");
  --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 11v5.5M12 7.8v.1'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v15H4zM4 10h16M8 3v4M16 3v4'/%3E%3C/svg%3E");
  --i-visit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E");
  --i-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2'/%3E%3C/svg%3E");
  --i-brief: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h18v12H3zM8 8V5h8v3'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1317; --surface: #251a20; --surface-2: #2f2229; --surface-tint: #3a2430;
    --border: #46343d; --border-input: #8f7681;
    --ink: #f7ecf0; --ink-2: #dcc7cf; --ink-3: #bba3ad;
    --primary: #f4a9c6; --primary-strong: #f9c9db; --primary-ink: #3b0d22; --primary-soft: #4a2135;
    --accent: #d4b5ec; --focus: #f9c9db;
    --good: #8fd3a0; --good-soft: #1c3325;
    --warn: #f2c16b; --warn-soft: #3a2c13;
    --bad:  #ffa071; --bad-soft:  #45231a;
    --chart: #f4a9c6; --grid: #352830;
    --div-good: #7fb7e3; --div-mid: #85767d; --div-warn: #f5d283; --div-bad: #d9532c;
    --div-good-ink: #0f2233;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; scroll-padding-bottom: 6.5rem; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-strong); text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; color: var(--ink); }
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code { font-size: .95em; }
abbr[title] { text-decoration: none; }
.muted { color: var(--ink-3); }
.small { font-size: .9375rem; line-height: 1.45; }
.nowrap { white-space: nowrap; }
.num, .amount, time { font-variant-numeric: tabular-nums; }
.icon { flex: none; vertical-align: -3px; }
.mt-0 { margin-top: 0 !important; } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); }
.mb-0 { margin-bottom: 0 !important; } .mb-3 { margin-bottom: var(--s3); }
.center { text-align: center; }
.right { text-align: right; }
.flex { display: flex; gap: var(--s4); align-items: flex-start; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 220px; }

/* Focus visible : anneau foncé + liseré clair (lisible même sur un bouton plein) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--surface);
}
.scale input:focus-visible + label, .choices input:focus-visible + .choice {
  outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 6px var(--surface);
}
main:focus, h1:focus, [tabindex="-1"]:focus { outline: none; box-shadow: none; }
@media (forced-colors: active) { :focus-visible { outline-color: Highlight !important; } }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--primary); color: var(--primary-ink); padding: .75rem 1.1rem; border-radius: 0 0 var(--radius-sm) 0; font-weight: 700; }
.skip-link:focus { left: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0; }

/* Barre de progression Turbo */
.turbo-progress-bar { height: 3px; background: var(--primary); }

/* ---------- Mise en page ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.shell { min-width: 0; display: flex; flex-direction: column; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: .15rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; padding: .25rem .6rem .8rem; min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f8cfdc 0 28%, var(--primary) 70%); box-shadow: inset 0 0 0 4px var(--surface), 0 0 0 1.5px var(--primary); }

/* Sélecteur de personne accompagnée : pastilles */
.switch { display: flex; gap: .35rem; margin: 0 .25rem .75rem; padding: .25rem; background: var(--surface-2); border-radius: 999px; }
.switch a { flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .2rem .6rem .2rem .25rem; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; min-width: 0; }
.switch a:hover { background: var(--surface); color: var(--ink); }
.switch a[aria-current="page"] { background: var(--surface); color: var(--primary); box-shadow: 0 0 0 1.5px var(--primary); }
.switch .avatar { width: 30px; height: 30px; font-size: .8rem; }
.switch-label { overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: .45rem .75rem; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active, .nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.active::before, .nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--primary); }
.nav a.nav-urgent .icon { color: var(--bad); }
.nav-group + .nav-group { margin-top: .6rem; }
.nav-sep { height: 1px; background: var(--border); margin: .6rem .6rem; }
.nav-title { font-size: .9375rem; font-weight: 600; color: var(--ink-3); padding: .3rem .75rem .15rem; margin: 0; }
.sidebar-foot { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border); }
.sidebar-foot .button_to { display: block; }
.sidebar-foot .btn-link { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .4rem .75rem; text-decoration: none; color: var(--ink-2); font-weight: 500; width: 100%; }
.sidebar-foot .btn-link:hover { background: var(--surface-2); border-radius: var(--radius-sm); color: var(--ink); }

.main { padding: 1.75rem clamp(1rem, 3.5vw, 2.75rem) 4rem; max-width: 1120px; width: 100%; margin-inline: auto; }
.topbar { display: none; }
.backdrop { display: none; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-3); margin: .25rem 0 0; max-width: 68ch; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: .9375rem; color: var(--ink-3); margin-bottom: .4rem; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: 32px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .4rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; color: var(--ink-3); }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 86vw; max-width: 320px; z-index: 50; transform: translateX(-105%); box-shadow: 0 0 40px rgba(43, 28, 34, .25); visibility: hidden; }
  .app.nav-open .sidebar { transform: none; visibility: visible; }
  .app.nav-open .backdrop { display: block; }
  .backdrop { display: none; position: fixed; inset: 0; background: rgba(43, 28, 34, .4); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: .5rem; padding: .45rem .75rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; min-height: 60px; }
  .topbar .title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: .5rem; }
  .topbar .switch { flex: 1; margin: 0; min-width: 0; }
  .topbar .switch a { padding-right: .5rem; }
  .main { padding: 1rem 1rem 7rem; }
  .page-head { margin-bottom: 1rem; }
  .page-head > .actions { width: 100%; }
  .page-head > .actions > .btn-primary:only-child, .page-head > .actions > .btn-primary:first-child:last-child { flex: 1; }
  h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: no-preference) { .sidebar { transition: transform .2s ease, visibility .2s; } }

/* Bouton rond « Urgence » de la barre du haut (mobile) */
.urgent-btn { flex: none; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--bad); color: #fff; text-decoration: none; }
.urgent-btn:hover { background: var(--bad); color: #fff; filter: none; box-shadow: 0 0 0 3px var(--bad-soft); }
@media (prefers-color-scheme: dark) { .urgent-btn, .urgent-btn:hover { color: #2a0c03; } }
.menu-btn { flex: none; }

/* Barre d'onglets du bas (mobile) */
.bottom-bar { display: none; }
@media (max-width: 860px) {
  .bottom-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 12px rgba(43, 28, 34, .06); padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); min-height: 68px; }
  .bottom-bar > a, .bottom-bar > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: .2rem 0; background: none; border: 0; font: inherit; text-decoration: none; color: var(--ink-2); font-size: .8125rem; font-weight: 600; line-height: 1.15; cursor: pointer; border-radius: 12px; }
  .bottom-bar .bb-ic { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; }
  .bottom-bar > a[aria-current="page"] { color: var(--primary); }
  .bottom-bar > a[aria-current="page"] .bb-ic { background: var(--primary-soft); }
  .bottom-bar > a[aria-current="page"] span:last-child { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
  .bottom-bar .bottom-main { color: var(--primary-ink); background: var(--primary); border-radius: 16px; margin: -14px .2rem 0; min-height: 66px; box-shadow: 0 4px 12px rgba(153, 40, 92, .25); }
  .bottom-bar .bottom-main .bb-ic { background: none; }
}

/* Feuille d'action « + Noter » */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: min(560px, 100%); max-width: 100%; max-height: 90vh; background: var(--surface); color: var(--ink); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -8px 30px rgba(43, 28, 34, .2); }
.sheet::backdrop { background: rgba(43, 28, 34, .45); }
.sheet-inner { padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.sheet-head h2 { margin: 0; }
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.sheet-list a { display: flex; align-items: center; gap: .9rem; min-height: 64px; padding: .6rem 1rem; border: 1.5px solid var(--border-input); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.125rem; }
.sheet-list a:hover { background: var(--surface-tint); }
.sheet-list .icon { color: var(--primary); }
.sheet-list small { display: block; font-weight: 400; font-size: .9375rem; color: var(--ink-3); }
@media (min-width: 861px) { .sheet { margin: auto; border-radius: var(--radius-lg); } }

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); }
.card + .card, .card + section, section + .card, .table-wrap + .card { margin-top: 1rem; }
.grid > .card + .card, .grid > * + .card, .grid > * + * { margin-top: 0; }
.grid + .card, .grid + section, .grid + .grid, .stats + .card, .card + .grid, .callout + .grid, .filters + .card { margin-top: 1rem; }
.card-feature { border-top: 4px solid var(--primary); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-foot { margin-top: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.stack > * + * { margin-top: 1rem; }
@media (max-width: 520px) { .card { padding: 1.05rem 1rem; } }

/* Boutons (cibles ≥ 44 px partout) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border-input); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-tint); color: var(--ink); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--primary-ink); }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { min-height: 44px; padding: .35rem .8rem; font-size: .9375rem; }
.btn-lg { min-height: 56px; padding: .7rem 1.25rem; font-size: 1.0625rem; border-radius: var(--radius); }
.btn-wide { min-width: 220px; min-height: 48px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn-icon { min-width: 44px; padding: .35rem; }
.btn-link { background: none; border: 0; color: var(--primary); padding: 0; min-height: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: progress; }
form.inline, .button_to { display: inline; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px; font-size: .9375rem; line-height: 1.4; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; vertical-align: 1px; }
.badge .icon { vertical-align: 0; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); }

/* Callouts & messages : bordure gauche + icône (jamais la teinte seule) */
.callout, .flash, .errors { position: relative; padding: .9rem 1rem .9rem 2.9rem; border-radius: 12px; border-left: 4px solid var(--primary); background: var(--surface-tint); color: var(--ink); margin-bottom: 1rem; }
.callout::before, .flash::before { content: ""; position: absolute; left: .9rem; top: 1rem; width: 20px; height: 20px; background: var(--primary); -webkit-mask: var(--i-info) center / contain no-repeat; mask: var(--i-info) center / contain no-repeat; }
.callout > :last-child { margin-bottom: 0; }
.callout-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-warn::before { background: var(--warn); -webkit-mask-image: var(--i-warn); mask-image: var(--i-warn); }
.callout-bad { border-left-color: var(--bad); background: var(--bad-soft); }
.callout-bad::before { background: var(--bad); -webkit-mask-image: var(--i-bad); mask-image: var(--i-bad); }
.callout-good { border-left-color: var(--good); background: var(--good-soft); }
.callout-good::before { background: var(--good); -webkit-mask-image: var(--i-good); mask-image: var(--i-good); }
.callout.small::before { top: .85rem; }
.callout ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.callout .btn { margin-top: .5rem; }
.flash { display: flex; align-items: flex-start; gap: .75rem; font-weight: 500; padding-right: .5rem; }
.flash-msg { flex: 1; padding-top: .55rem; }
.flash-notice { border-left-color: var(--good); background: var(--good-soft); }
.flash-notice::before { top: 1.45rem; background: var(--good); -webkit-mask-image: var(--i-good); mask-image: var(--i-good); }
.flash-alert { border-left-color: var(--bad); background: var(--bad-soft); }
.flash-alert::before { top: 1.45rem; background: var(--bad); -webkit-mask-image: var(--i-bad); mask-image: var(--i-bad); }
.flash .flash-close { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--ink-2); border-radius: var(--radius-sm); cursor: pointer; }
.flash .flash-close:hover { background: rgba(43, 28, 34, .07); }
.flash[hidden] { display: none; }
@media (max-width: 860px) {
  .toast-zone { position: fixed; left: .75rem; right: .75rem; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 45; }
  .toast-zone .flash { box-shadow: 0 6px 24px rgba(43, 28, 34, .18); margin-bottom: .5rem; }
  .no-bottom-bar .toast-zone { position: static; }
}
.errors { border-left-color: var(--bad); background: var(--bad-soft); padding-left: 1rem; }
.errors-title { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--bad); }
.errors ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.errors a { color: var(--ink); }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .8rem 0; border-top: 1px solid var(--border); display: flex; gap: .8rem; align-items: flex-start; }
.list > li:first-child { border-top: 0; padding-top: .2rem; }
.list .grow, .grow { flex: 1; min-width: 0; }
.list .meta, .meta { color: var(--ink-3); font-size: .9375rem; line-height: 1.45; }
.list-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.list-title { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; }
a.list-title:hover { text-decoration-thickness: 2px; }
.date-chip { flex: none; width: 56px; text-align: center; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); padding: .3rem 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.date-chip b { display: block; font-size: 1.25rem; }
.date-chip span { font-size: .875rem; font-weight: 600; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--av-1); color: #2b1c22; display: inline-grid; place-items: center; font-weight: 700; font-size: .875rem; letter-spacing: .02em; }
.av-1 { background: var(--av-1); } .av-2 { background: var(--av-2); } .av-3 { background: var(--av-3); } .av-4 { background: var(--av-4); }
.av-5 { background: var(--av-5); } .av-6 { background: var(--av-6); } .av-7 { background: var(--av-7); } .av-8 { background: var(--av-8); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.15rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.3rem; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }

/* Tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table caption { text-align: left; font-weight: 700; padding-bottom: .5rem; }
.table th, .table td { text-align: left; padding: .65rem .65rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { font-size: .9375rem; color: var(--ink-3); font-weight: 600; background: var(--surface-2); border-bottom-color: var(--border); }
.table thead th:first-child { border-top-left-radius: 8px; } .table thead th:last-child { border-top-right-radius: 8px; }
.table tbody th { font-weight: 600; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr:hover > * { background: var(--surface-2); }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.amount.neg { color: var(--ink); }
.amount.pos { color: var(--good); }
/* Tableau → cartes sur mobile (td::before = libellé de colonne) */
@media (max-width: 760px) {
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td, .table-stack tbody th { display: block; width: 100%; }
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack tr { border: 1px solid var(--border); border-radius: 12px; padding: .5rem .75rem; margin-bottom: .6rem; background: var(--surface); }
  .table-stack td, .table-stack tbody th { border: 0; padding: .3rem 0; text-align: left !important; white-space: normal; }
  .table-stack td[data-label]::before { content: attr(data-label); display: block; font-size: .9375rem; font-weight: 600; color: var(--ink-3); }
  .table-stack tbody tr:hover > * { background: none; }
  .card.table-wrap:has(.table-stack) { background: none; border: 0; box-shadow: none; padding: 0; }
}

/* Formulaires */
.form { max-width: 640px; }
.form-wide { max-width: 860px; }
.field { margin-bottom: 1.1rem; }
.field > label, .label { display: block; font-weight: 600; font-size: 1rem; margin-bottom: .35rem; }
.field:has(> :is(input, select, textarea)[required]) > label::after,
.field:has(> .field_with_errors > :is(input, select, textarea)[required]) > label::after { content: " *"; color: var(--bad); }
form:has(.field [required]) > div.card:first-of-type::before, form.card:has(.field [required])::before, .form-required-note { content: "Les champs marqués * sont obligatoires."; display: block; color: var(--ink-3); font-size: .9375rem; margin-bottom: .9rem; }
.hint { color: var(--ink-3); font-size: .9375rem; line-height: 1.45; margin-top: .3rem; }
.field-error { display: flex; gap: .4rem; align-items: flex-start; color: var(--bad); font-weight: 600; font-size: .9375rem; margin: .35rem 0 0; }
.field-error::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; background: var(--bad); -webkit-mask: var(--i-bad) center / contain no-repeat; mask: var(--i-bad) center / contain no-repeat; }
[aria-invalid="true"] { border-color: var(--bad) !important; border-width: 2px !important; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=month], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--border-input); border-radius: var(--radius-sm); padding: .6rem .75rem; min-height: 46px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input[type=file] { font: inherit; max-width: 100%; min-height: 44px; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.check { display: flex; align-items: center; gap: .65rem; font-weight: 500; margin-bottom: .4rem; min-height: 44px; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: none; margin: 0; }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.25rem; flex-wrap: wrap; }
.form-actions .btn-link { padding: .5rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; padding: 0 .4rem; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; list-style-position: inside; }
details > summary::-webkit-details-marker { color: var(--primary); }
details.card[open] > summary { margin-bottom: .75rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters select, .filters input:not([type=checkbox]) { width: auto; min-width: 150px; }
.filters .check { margin: 0; }
@media (max-width: 520px) { .filters select, .filters input:not([type=checkbox]) { flex: 1 1 100%; } }

/* Barre d'action collante (mobile) */
@media (max-width: 860px) {
  .form-actions.sticky, .no-bottom-bar .form .form-actions, .no-bottom-bar form.card .form-actions {
    position: sticky; bottom: 0; z-index: 20; background: var(--bg); margin: 1rem -1rem 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(43, 28, 34, .06);
  }
  form.card .form-actions { margin-left: -1rem; margin-right: -1rem; }
  .form-actions.sticky .btn-primary, .no-bottom-bar .form-actions .btn-primary { flex: 1; min-height: 56px; }
  .no-bottom-bar .main { padding-bottom: 2rem; }
}

/* Saisie rapide d'un échange */
.quick-when { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; color: var(--ink-2); font-size: 1.0625rem; }
.quick-when strong { color: var(--ink); }
.reveal[hidden] { display: none; }

/* Échelle d'observation */
.scale { display: flex; gap: .4rem; flex-wrap: wrap; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label { display: inline-grid; place-items: center; min-width: 48px; min-height: 44px; padding: .3rem .8rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border-input); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; font-size: .9375rem; margin: 0; }
.scale label:hover { background: var(--surface-tint); }
.scale input:checked + label { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.scale input:checked + label::before { content: ""; width: 14px; height: 14px; margin-right: .3rem; background: currentColor; -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat; display: inline-block; }
.scale input:checked + label { display: inline-flex; align-items: center; }
.indicator-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: .5rem 1rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--border); }
.indicator-row:first-of-type { border-top: 0; }
fieldset.indicator-row { border: 0; border-top: 1px solid var(--border); border-radius: 0; margin: 0; padding: .65rem 0; }
fieldset.indicator-row legend { float: left; width: 100%; padding: 0; margin-bottom: .4rem; }
@media (max-width: 560px) { .indicator-row { grid-template-columns: 1fr; } }
.score { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 7px; font-size: .9375rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.score-1, .score-2 { background: var(--bad-soft); color: var(--bad); }
.score-3 { background: var(--warn-soft); color: var(--warn); }
.score-4, .score-5 { background: var(--good-soft); color: var(--good); }
.scores { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }

/* Choix « par rapport à d'habitude » : grille 2×2 */
.choice-group { border: 0; padding: 0; margin: .25rem 0 1.1rem; }
.choice-group legend { font-weight: 700; font-size: 1.1rem; padding: 0; margin-bottom: .6rem; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (min-width: 700px) { .choices { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choice { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 64px; padding: .5rem; border-radius: 12px; border: 2px solid var(--border-input); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; text-align: center; line-height: 1.25; }
.choice:hover { background: var(--surface-tint); }
.choices input:checked + .choice::before { content: ""; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat; }
.choices input:checked + .choice-mieux { background: var(--div-good); border-color: var(--div-good); color: var(--div-good-ink); }
.choices input:checked + .choice-pareil { background: var(--surface-2); border-color: var(--ink-2); color: var(--ink); }
.choices input:checked + .choice-moins_bien { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.choices input:checked + .choice-nettement_moins_bien { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }

/* Observations dans le journal */
ul.obs { list-style: none; padding: 0; margin: .5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .3rem 1rem; font-size: .9375rem; }
ul.obs li { display: block; }
ul.obs span { color: var(--ink-2); }
ul.obs strong { color: var(--ink); }
ul.obs li.obs-warn strong, ul.obs li.obs-bad strong { white-space: nowrap; }
ul.obs li.obs-warn strong { color: var(--warn); }
ul.obs li.obs-bad strong { color: var(--bad); }
ul.obs li.obs-warn strong::before, ul.obs li.obs-bad strong::before { content: ""; display: inline-block; vertical-align: -2px; margin-right: .25rem; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--i-warn) center / contain no-repeat; mask: var(--i-warn) center / contain no-repeat; }
ul.obs li.obs-bad strong::before { -webkit-mask-image: var(--i-bad); mask-image: var(--i-bad); }

/* Échange du journal : carte légère */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.entry { display: flex; gap: .8rem; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: .9rem 1rem; }
.entry .entry-head { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.entry .entry-body > * + * { margin-top: .35rem; }
.entry .callout { margin: .5rem 0 0; }
.entry-actions { flex: none; }
@media (max-width: 520px) { .entry { flex-wrap: wrap; } .entry-actions { width: 100%; padding-left: calc(36px + .8rem); } }
.day-title { position: sticky; top: 0; z-index: 2; background: var(--bg); font-size: 1.05rem; font-weight: 700; color: var(--ink-2); padding: .5rem 0 .4rem; margin: 1.1rem 0 .4rem; }
.day-title:first-child { margin-top: 0; }
@media (max-width: 860px) { .day-title { top: 60px; } }

/* Puces de filtres */
.chips { display: flex; gap: .5rem; margin-bottom: 1rem; overflow-x: auto; padding: 4px 4px 6px; margin-inline: -4px; scrollbar-width: thin; }
.chips a { flex: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .3rem 1rem; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--border-input); text-decoration: none; color: var(--ink-2); font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.chips a:hover { background: var(--surface-tint); color: var(--ink); }
.chips a.active, .chips a[aria-current] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chips a.active::before, .chips a[aria-current]::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat; }

/* Statistiques et carte « État » */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat .k { color: var(--ink-3); font-size: .9375rem; font-weight: 600; }
.stat .v { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .s { color: var(--ink-3); font-size: .9375rem; }
.stat-warn { border-color: var(--warn); border-left-width: 4px; }
.stat-warn .v { display: flex; align-items: center; gap: .4rem; color: var(--warn); }
.stat-warn .v::before { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--i-warn) center / contain no-repeat; mask: var(--i-warn) center / contain no-repeat; }
.state-card { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--primary); border-radius: var(--radius); padding: 1.15rem 1.4rem; box-shadow: var(--shadow); }
.state-line { font-size: 1.2rem; line-height: 1.45; margin: 0; }
.state-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-top: .6rem; color: var(--ink-3); font-size: .9375rem; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1rem 0 .4rem; }
.quick-actions .btn { min-height: 56px; font-size: 1.0625rem; border-radius: var(--radius); }
.quick-more { margin: 0 0 1rem; }
.quick-more a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
@media (max-width: 420px) { .quick-actions .btn { white-space: normal; padding-inline: .5rem; } }

/* Tableau de bord : 2/3 – 1/3 */
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.dash-main, .dash-side { display: grid; gap: 1rem; min-width: 0; }
.dash-main > *, .dash-side > * { margin: 0 !important; }
@media (max-width: 1000px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.alerts { border-left: 4px solid var(--bad); }
.alerts-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.alerts-list li { position: relative; padding-left: 1.75rem; }
.alerts-list li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; background: var(--warn); -webkit-mask: var(--i-warn) center / contain no-repeat; mask: var(--i-warn) center / contain no-repeat; }
.alerts-list li.is-bad::before { background: var(--bad); -webkit-mask-image: var(--i-bad); mask-image: var(--i-bad); }
.alerts details summary { font-weight: 600; color: var(--primary); }
.compact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.count-pill { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 .5rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Frise « Cette semaine » */
.weekline { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.weekline > li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: .75rem; align-items: start; padding: .55rem .7rem; border-radius: 12px; background: var(--surface-2); }
.weekline > li.is-today { background: var(--surface); box-shadow: inset 0 0 0 2px var(--primary); }
.weekline .wl-day { font-weight: 700; line-height: 1.2; }
.weekline .wl-day small { display: block; font-weight: 600; font-size: .875rem; color: var(--ink-3); }
.weekline .wl-day .today-tag { color: var(--primary); }
.weekline .wl-items { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; min-height: 32px; }
.wl-none { color: var(--warn); font-weight: 600; display: inline-flex; gap: .35rem; align-items: center; }
.wl-none::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--i-warn) center / contain no-repeat; mask: var(--i-warn) center / contain no-repeat; }

/* Évènements (agenda, planning, frise) : fond pastel + icône de type + texte */
.cal-e { display: flex; align-items: flex-start; gap: .3rem; font-size: .9375rem; line-height: 1.3; padding: .3rem .45rem; border-radius: 7px; text-decoration: none; background: var(--primary-soft); color: var(--primary); overflow-wrap: break-word; hyphens: auto; min-width: 0; }
a.cal-e { min-height: 32px; }
a.cal-e:hover { text-decoration: underline; color: var(--primary-strong); }
.cal-e::before { content: ""; flex: none; width: 13px; height: 13px; margin-top: .2em; background: currentColor; -webkit-mask: var(--i-cal) center / contain no-repeat; mask: var(--i-cal) center / contain no-repeat; }
.cal-e.visit { background: var(--good-soft); color: var(--good); }
.cal-e.visit::before { -webkit-mask-image: var(--i-visit); mask-image: var(--i-visit); }
.cal-e.deadline { background: var(--warn-soft); color: var(--warn); }
.cal-e.deadline::before { -webkit-mask-image: var(--i-clock); mask-image: var(--i-clock); }
.cal-e.service { background: var(--surface-2); color: var(--ink-2); }
.cal-e.service::before { -webkit-mask-image: var(--i-brief); mask-image: var(--i-brief); }
.cal-e.cancelled { text-decoration: line-through; }
.weekline .cal-e { display: inline-flex; }

/* Calendrier (mois) */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.cal-nav h2 { margin: 0; text-transform: capitalize; flex: 1; text-align: center; }
table.cal { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal th { background: var(--surface-2); text-align: center; font-size: .9375rem; font-weight: 600; color: var(--ink-3); padding: .45rem 0; border-bottom: 1px solid var(--border); }
.cal th abbr { text-decoration: none; }
.cal td { background: var(--surface); height: 116px; padding: .3rem; vertical-align: top; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal td:last-child { border-right: 0; }
.cal tr:last-child td { border-bottom: 0; }
.cal-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal td.out { background: var(--surface-2); }
.cal td.out .cal-n { color: var(--ink-3); }
.cal td.today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal td.today .cal-n { background: var(--primary); color: var(--primary-ink); }
.cal-n { align-self: flex-start; font-size: .9375rem; font-weight: 700; min-width: 36px; min-height: 36px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; color: var(--ink-2); font-variant-numeric: tabular-nums; }
a.cal-n:hover { background: var(--surface-tint); color: var(--ink); }
.cal-wd { display: none; }
.cal-today { display: none; }
.legend { display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; font-size: .9375rem; color: var(--ink-2); margin-top: .75rem; align-items: center; }
.legend .cal-e { display: inline-flex; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: .35rem; box-shadow: inset 0 0 0 1px rgba(43, 28, 34, .25); }
.view-switch { display: none; }
@media (max-width: 700px) {
  table.cal, .cal tbody, .cal tr, .cal td { display: block; width: 100%; height: auto; border: 0; background: none; }
  .cal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cal { border: 0; overflow: visible; }
  .cal td { padding: 0; margin-bottom: .5rem; }
  .cal td.out, .cal td.empty-day { display: none; }
  .cal-cell { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem; border: 1px solid var(--border); border-radius: 12px; padding: .45rem .6rem; background: var(--surface); }
  .cal td.today .cal-cell { box-shadow: inset 0 0 0 2px var(--primary); }
  .cal td.today { box-shadow: none; }
  .cal-n { min-width: 44px; min-height: 44px; }
  .cal-wd { display: inline; font-weight: 600; color: var(--ink-2); text-transform: capitalize; margin-right: auto; }
  .cal-today { display: inline; color: var(--primary); font-weight: 700; }
  .cal-cell .cal-e { flex: 1 1 100%; }
  .cal.is-shown td.empty-day { display: block; }
  .view-switch { display: block; margin: 0 0 .75rem; }
}

/* Planning semaine */
.week-title { font-size: 1.05rem; font-weight: 700; color: var(--ink-2); margin: 1.25rem 0 .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; list-style: none; padding: 0; }
.week-day { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .5rem; min-height: 120px; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.week-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.week-day.gap { background: var(--surface); border-style: dashed; border-color: var(--warn); }
.week-day .wd { font-size: .9375rem; font-weight: 700; color: var(--ink-2); text-transform: capitalize; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .2rem; }
.week-day .wd .today-tag { color: var(--primary); text-transform: none; }
.week-day .badge { align-self: flex-start; white-space: normal; }
.week-day .add { margin-top: auto; }
.week-day .add .btn { width: 100%; white-space: normal; font-size: .9375rem; }
@media (max-width: 1100px) and (min-width: 761px) { .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .week { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
  .week-later { display: none; }
  .week-later.is-shown { display: block; }
  .week-more { display: block; }
}
.week-more { display: none; }

/* Graphiques */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-size: 13px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .dot, .chart .dot:hover { r: 6; }
.chart .bar { fill: var(--chart); }
.chart .seg { stroke: var(--surface); stroke-width: 2; }
.chart-card h3 { margin-bottom: .15rem; }
.chart-card .latest { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-wide { grid-column: span 2; }
@media (max-width: 860px) { .chart-wide { grid-column: auto; } }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: .35rem; }
.sw-mieux { background: var(--div-good); } .sw-pareil { background: var(--div-mid); box-shadow: inset 0 0 0 1px var(--ink-3); }
.sw-moins_bien { background: var(--div-warn); } .sw-nettement_moins_bien { background: var(--div-bad); }

/* Articles (markdown) */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.4em; font-size: 1.3rem; }
.prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .25rem 0; }
.prose table { border-collapse: collapse; margin: 1rem 0; font-size: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: .45rem .65rem; text-align: left; }
.prose th { background: var(--surface-2); }
.prose blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 4px solid var(--primary); background: var(--surface-tint); border-radius: 0 10px 10px 0; }
.prose code { background: var(--surface-2); padding: .1rem .3rem; border-radius: 4px; font-size: .9em; }
.prose a { overflow-wrap: anywhere; }

.tabs { display: flex; gap: .25rem; box-shadow: inset 0 -1px var(--border); margin-bottom: 1.1rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: .5rem .9rem; text-decoration: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tabs a:hover { color: var(--ink); background: var(--surface-2); }
.tabs a.active, .tabs a[aria-current="page"] { color: var(--primary); box-shadow: inset 0 -3px var(--primary); }

.empty { text-align: center; padding: 1.5rem 1rem; color: var(--ink-2); }
.empty p { max-width: 46ch; margin-inline: auto; }
.empty-ill { display: block; margin: 0 auto .6rem; }
.empty-ill .ill-a { fill: var(--surface-tint); }
.empty-ill .ill-b { fill: var(--primary-soft); stroke: var(--surface); stroke-width: 3; }
.kv { display: grid; grid-template-columns: minmax(130px, 210px) 1fr; gap: .45rem 1rem; margin: 0; }
.kv dt { color: var(--ink-3); font-weight: 600; font-size: .9375rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .55rem; } }
.comment { padding: .8rem 0; border-top: 1px solid var(--border); display: flex; gap: .75rem; }
.comment:first-child { border-top: 0; }
.file-link { font-weight: 600; overflow-wrap: anywhere; }
.folder-tile { display: flex; gap: .8rem; align-items: center; min-height: 64px; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.folder-tile:hover { border-color: var(--primary); background: var(--surface-tint); color: var(--ink); }
.folder-tile .icon { color: var(--primary); }
.perm-table select { min-width: 140px; }
.danger-zone { border-color: var(--bad); border-left-width: 4px; }
.lock-tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .9375rem; font-weight: 600; color: var(--ink-2); }
.page-sub-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* Menu « ⋯ » (actions secondaires) */
.more-menu { position: relative; display: inline-block; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu[open] > .more-list { display: grid; }
.more-list { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(43, 28, 34, .15); padding: .4rem; gap: 2px; }
.more-list a, .more-list button { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 44px; padding: .45rem .7rem; border-radius: 8px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-weight: 500; text-align: left; cursor: pointer; white-space: normal; }
.more-list a:hover, .more-list button:hover { background: var(--surface-2); }
.more-list .button_to { display: block; }

/* Accès & droits : cartes par membre sur mobile */
.member-cards { display: none; }
@media (max-width: 760px) {
  .members-table { display: none; }
  .member-cards { display: grid; gap: .75rem; list-style: none; margin: 0; padding: 0; }
}
.member-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.member-card header { display: flex; gap: .75rem; align-items: flex-start; }
.member-card dl { margin: .7rem 0 0; display: grid; gap: .35rem; }
.member-card dt { font-weight: 600; font-size: .9375rem; color: var(--ink-3); }
.member-card dd { margin: 0 0 .25rem; }
.member-card .card-foot { border-top: 1px solid var(--border); padding-top: .75rem; }
.members-table th:first-child, .members-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.members-table thead th:first-child { background: var(--surface-2); }

/* ---------- Ajouts du fork « pages administratives » ---------- */
.block-form { display: block; }
.indent { padding-left: 1.6rem; }
.span-2 { grid-column: span 2; }
@media (max-width: 560px) { .span-2 { grid-column: auto; } }
textarea.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .95rem; }
.filters .search-wide { min-width: min(100%, 320px); flex: 1 1 320px; }
.code-lg { font-size: 1.1rem; }
.break { overflow-wrap: anywhere; }
.home-tile { padding: 1.2rem; }
.home-tile-name { font-size: 1.15rem; }
.qr { background: #fff; display: inline-block; padding: 8px; border-radius: 8px; }
.h-sm { font-size: 1.1rem; }
.check.check-inline { display: inline-flex; margin: 0 0 0 .5rem; min-height: 44px; }
.member-name { font-size: 1.1rem; margin: 0; }
.empty > .icon { color: var(--primary); display: block; margin: 0 auto .5rem; }
.table tbody th[scope="row"] .small { font-weight: 400; }
/* Les textes masqués (position:absolute) d'un tableau défilant ne doivent pas élargir la page */
.table-wrap { position: relative; }
.members-table th[scope="row"] { min-width: 11rem; }
/* Tableaux en cartes (mobile) : libellé à gauche, valeur à droite, plus compact */
@media (max-width: 760px) {
  .table-stack td[data-label] { display: grid; grid-template-columns: minmax(6.5rem, 34%) minmax(0, 1fr); gap: .1rem .75rem; align-items: baseline; padding: .2rem 0; }
  .table-stack td[data-label]::before { display: block; }
  .table-stack td[data-label="Actions"] { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .5rem; }
  .table-stack td[data-label="Actions"]::before { display: none; }
  .table-stack td[data-label="Actions"]:empty { display: none; }
  .table-stack td.num { text-align: left !important; }
}
@media (max-width: 760px) { .table-stack td[data-label] > .badge, .table-stack td[data-label] > .btn { justify-self: start; } }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background-color: var(--bg); background-image: radial-gradient(var(--surface-tint) 1.5px, transparent 1.6px); background-size: 18px 18px; }
.auth .card { width: 100%; max-width: 420px; padding: 2rem 1.75rem; }
.auth .brand { justify-content: center; font-size: 1.5rem; padding-bottom: .25rem; }
.auth-tagline { text-align: center; color: var(--ink-3); margin: 0 0 1.5rem; }
.auth h1 { font-size: 1.3rem; text-align: center; }
.auth .flash { margin-bottom: 1rem; }

/* ---------- Interface simplifiée (personne accompagnée) : toujours claire ---------- */
body:has(.simple) {
  --bg: #fffaf8; --surface: #fff; --surface-2: #f8edee; --surface-tint: #fce4ea; --border: #ecdcdf;
  --border-input: #8c6f77; --ink: #2b1c22; --ink-2: #57404a; --ink-3: #6c5660;
  --primary: #99285c; --primary-strong: #7a1d48; --primary-ink: #fff; --primary-soft: #fbe3ec; --focus: #7a1d48;
  --good: #2b6a3d; --good-soft: #e3f1e6; --warn: #875006; --warn-soft: #fcf0c8; --bad: #b3330f; --bad-soft: #fde3da;
  --shadow: 0 1px 2px rgba(43, 28, 34, .05), 0 4px 14px rgba(153, 40, 92, .06);
  background: #fffaf8; color: #2b1c22; color-scheme: light;
}
.simple { font-size: 21px; line-height: 1.6; max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 4rem; color-scheme: light; }
.simple h1 { font-size: 2.1rem; margin: 1.5rem 0 .25rem; }
.simple h2 { font-size: 1.45rem; margin: 2rem 0 .6rem; }
.simple .small, .simple .muted, .simple .hint, .simple .meta { font-size: 1.05rem; }
.simple .big-btn { display: flex; align-items: center; justify-content: center; gap: .7rem; width: 100%; min-height: 72px; padding: .6rem 1rem; font-size: 1.3rem; font-weight: 700; border-radius: 18px; background: var(--primary); color: var(--primary-ink); text-decoration: none; border: 0; cursor: pointer; font-family: inherit; text-align: center; }
.simple .big-btn:hover { background: var(--primary-strong); color: var(--primary-ink); }
.simple .big-btn.secondary { background: var(--surface); color: var(--ink); border: 2px solid var(--border-input); }
.simple .big-btn.secondary:hover { background: var(--surface-tint); }
.simple .quiet-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 60px; font-size: 1.1rem; font-weight: 600; border-radius: 16px; border: 1.5px solid var(--border-input); background: transparent; color: var(--ink-2); text-decoration: none; }
.simple .quiet-btn:hover { background: var(--surface-2); color: var(--ink); }
.simple .card { padding: 1.25rem 1.35rem; }
.simple .list > li { padding: 1rem 0; align-items: center; }
.simple .date-chip { width: 74px; padding: .4rem 0; }
.simple .date-chip b { font-size: 1.7rem; }
.simple .date-chip span { font-size: 1rem; }
.simple input, .simple select, .simple textarea { font-size: 1.1rem; min-height: 54px; }
.simple .field > label { font-size: 1.1rem; }
.simple .tel { font-size: 1.3rem; font-weight: 700; }
.simple .today { font-size: 1.15rem; color: var(--ink-2); }
.simple .call-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 64px; padding: .5rem 1.1rem; border-radius: 16px; background: var(--surface); border: 2px solid var(--primary); color: var(--primary-strong); font-weight: 700; text-decoration: none; white-space: nowrap; }
.simple .call-btn:hover { background: var(--surface-tint); }
.simple .call-who { flex: 1; min-width: 0; }
.simple .numbers li { flex-wrap: wrap; }
.simple .help-zone { margin-top: 2.5rem; }
.simple .help-zone .icon { width: 28px; height: 28px; }
.simple .settings { margin-top: 3rem; text-align: center; }
.simple .settings summary { justify-content: center; color: var(--ink-2); font-size: 1.05rem; min-height: 48px; }
.simple .settings .button_to { display: block; margin-top: .75rem; }
.simple .settings .btn-link { font-size: 1.05rem; min-height: 48px; }
.simple .secondary-zone { margin-top: 2.5rem; }
.simple .flash { font-size: 1.1rem; }
@media (max-width: 480px) { .simple .call-btn { width: 100%; } }
.today-banner { background: var(--surface-tint); color: var(--ink); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.today-date { font-size: 2.2rem; font-weight: 800; line-height: 1.15; color: var(--primary-strong); }
.today-moment { font-size: 1.3rem; color: var(--ink-2); margin-top: .25rem; }
.today-visits { font-size: 1.3rem; }
.today-visits strong { font-size: 1.4rem; }
.calm { color: var(--ink-2); }

/* ---------- Écran permanent (tablette) : toujours clair le jour, noir sans rose la nuit ---------- */
.screen-body { margin: 0; background: #fffaf8; color: #2b1c22; color-scheme: light; }
.screen { min-height: 100vh; padding: 4vh 5vw; display: grid; gap: 3vh 4vw; grid-template-columns: 1fr; align-content: start; font-size: clamp(24px, 3.2vw, 42px); line-height: 1.3; }
.screen-clock { display: flex; flex-direction: column; gap: 1vh; }
.screen-day { font-size: max(1.3em, 7vh); font-weight: 700; line-height: 1.1; }
.screen-time { font-size: min(30vh, 17vw); font-weight: 800; line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.screen-moment { font-size: 1.2em; color: #57404a; }
.screen-side { display: flex; flex-direction: column; gap: 3vh; }
.screen-block { background: #fff; border: 2px solid #ecdcdf; border-radius: 24px; padding: 2.5vh 3vw; }
.screen-block h2 { font-size: 1em; margin: 0 0 .3em; color: #7a1d48; }
.screen-block p { margin: .2em 0; }
.screen-small { font-size: .85em; }
.screen-muted { color: #57404a; }
@media (orientation: landscape) and (min-width: 900px) {
  .screen { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; min-height: 100vh; }
  .screen-time { font-size: min(32vh, 10vw); }
}
.screen-body:has(.screen-night) { background: #000; }
.screen-night { background: #000; color: #e7e0e3; grid-template-columns: 1fr !important; place-content: center; text-align: center; }
.screen-night .screen-moment, .screen-night .screen-day { color: #b9adb2; }

/* ---------- Impression ---------- */
.print-page { max-width: 820px; margin: 0 auto; padding: 1.5rem; background: #fff; color: #000; }
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --surface-tint: #f3f3f3; --ink: #000; --ink-2: #222; --ink-3: #444; --border: #999; --primary-soft: #eee; color-scheme: light; }
  .btn, .form-actions, .bottom-bar, .skip-link, .urgent-btn { display: none !important; }
  .sidebar, .topbar, .no-print, .actions, .flash, .toast-zone { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 12px; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .turbo-progress-bar { display: none; }
}
.print-body { background: #fff; color: #000; }
.entries-page .entry { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
form:has([data-reveal-target="panel"][hidden]) > div.card:first-of-type::before { content: none; display: none; }
.sidebar .switch { flex-direction: column; border-radius: 16px; gap: 2px; }
.sidebar .switch a { justify-content: flex-start; border-radius: 12px; padding-left: .4rem; }
@media (max-width: 700px) { .cal-nav h2 { font-size: 1.15rem; } }
.id-photo { width: 120px; height: 150px; object-fit: cover; border-radius: var(--radius-sm); }
.id-name { font-size: 1.5rem; margin-bottom: .2rem; }
.table tbody th[scope="row"] { font-weight: 600; }
.weigh-form { align-items: flex-end; margin-top: .75rem; }
.weigh-form .input-kg { max-width: 120px; min-width: 0 !important; }
.chart-note { font-size: .9375rem; color: var(--ink-3); margin: .4rem 0 0; }
