/* Lexend : Copyright 2019 The Lexend Project Authors, SIL Open Font License 1.1 (OFL-Lexend.txt). Chiffres tabulaires et espace fine insécable ajoutés pour Prépa. */
@font-face{font-family:'Lexend';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/lexend-latin-400.75c2a3fb7f5e.woff2) format('woff2');}
@font-face{font-family:'Lexend';font-style:normal;font-weight:600;font-display:swap;src:url(fonts/lexend-latin-600.a14e5b1752c1.woff2) format('woff2');}
@font-face{font-family:'Lexend';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/lexend-latin-700.3317b5f75cb3.woff2) format('woff2');}
/* Prépa — jetons de style. Retouches du 17 novembre : fond abricot sous un grain fin, cartes blanches en relief,
   couleurs d'étape franches avec toujours du texte foncé dessus, neutres teintés chauds (plus aucun gris), un seul
   bleu pour « tu es ici » et le focus, police Lexend. Ces variables et les composants qui s'en servent sont repris
   tels quels en phase 2 (PHP).
   Contrastes notés « x pour 1 » : 4,5 au moins pour le texte, 3 pour les composants. */
:root {
  /* ----- Surfaces et texte ----- */
  --bg: #fbeee4;            /* fond de page, abricot */
  /* Grain fin dessiné par l'appli (aucun fichier téléchargé) : tuile de 180 px, bruit brun à 34 %. */
  --bg-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .28 0 0 0 0 .17 0 0 0 .34 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  --card: #fff;             /* cartes, feuilles, champs */
  --ink: #22252b;           /* texte : 15,4 pour 1 sur blanc, 13,5 sur le fond */
  --ink-2: #6b5244;         /* texte secondaire : 7,2 sur blanc, 6,3 sur le fond */
  --ink-3: #735e51;         /* indications : 6,1 sur blanc, 5,2 sur le fond */
  --paper: var(--card);
  --wash: #f7efe9;          /* survol, champ en lecture seule, encadré discret, en-têtes de tableau */
  --line: #f1e4da;          /* filets dans les cartes */
  --line-bg: #efdccd;       /* filets posés sur le fond (barre d'onglets) */
  --line-strong: #e0bda6;   /* contours doux, arête du bouton secondaire */
  --field-edge: #9a7b66;    /* contour d'un champ de saisie : 3,9 pour 1 sur blanc */
  --black: #22252b;

  /* ----- Repères ----- */
  --here: #2f6fd0;          /* trait de l'onglet et de la section actifs, focus, aujourd'hui : 4,8 sur blanc */
  --here-ink: #285db0;      /* texte bleu posé sur le fond : 5,5 pour 1 (le bleu --here n'y fait que 4,3) */
  --select: #cfe0fa;        /* « ce que tu as touché » : jour choisi, mois choisi */
  --select-soft: #e8f0fc;
  --today-bg: #e1ecfb;      /* puce « aujourd'hui » */
  --today-ink: #1f5fbf;     /* son texte : 5,1 pour 1 */
  --key: #4aa8ff;           /* bouton principal, bleu Tournage (texte foncé : 6,1 pour 1) */
  --key-hover: #6cb8ff;
  --key-edge: #2a7fd0;      /* son bord inférieur */
  --off: #f1e3d8;           /* bouton désactivé, creusé */
  --on-off: #9a8578;
  --ancien: #7a5f4e;        /* membre archivé ou ancien membre : brun chaud, en rond creux */
  --me-off: #7a5f4e;        /* « Je suis indisponible ce jour-là » : son pictogramme (Rétroplanning, phase 2, lot 4) */

  /* ----- Étiquettes ----- */
  --todo: #ffc21a;          /* « À faire », compteurs (texte foncé : 9,5 pour 1) */
  --todo-edge: #a87b00;
  --critical: #b42318;      /* texte rouge : 5,8 pour 1 sur --critical-soft */
  --critical-soft: #fdecea;
  --critical-edge: #f1b8b1;
  --warning: #8a5a00;
  --warning-soft: #fff3d6;
  --ok: #23774a;
  --ok-soft: #e6f4eb;
  /* Chiffre d'affaires (retouches du 17 novembre) : écart en hausse, colonnes de l'année et de l'année précédente. */
  --gain: #17643a;          /* 6,3 pour 1 sur --gain-soft */
  --gain-soft: #dcf3e3;
  --ca-cur: #1e8c7a;        /* 4,1 pour 1 sur blanc */
  --ca-prev: #a8ded2;

  /* ----- Couleurs d'étape : aplat (scotch, onglet, point), liseré de la même teinte, teinte claire, pâle (« fait »).
     Texte toujours foncé sur l'aplat : 4,9 pour 1 au moins. ----- */
  --tape-dossier: #ff8a3d;   --on-tape-dossier: var(--ink);   --edge-dossier: #c2561a;   --tint-dossier: #ffe9da;   --pale-dossier: #ffc49e;
  --tape-prepa: #ffc21a;     --on-tape-prepa: var(--ink);     --edge-prepa: #a87b00;     --tint-prepa: #fff1c7;     --pale-prepa: #ffdc7a;
  --tape-tournage: #4aa8ff;  --on-tape-tournage: var(--ink);  --edge-tournage: #1f84e0;  --tint-tournage: #dceeff;  --pale-tournage: #a4d3ff;
  --tape-post: #a57fff;      --on-tape-post: var(--ink);      --edge-post: #7f55e6;      --tint-post: #ece4ff;      --pale-post: #d2bfff;
  /* Organisation du collectif (Gantt, Agenda). */
  --tape-collectif: #2fb39e; --on-tape-collectif: var(--ink); --edge-collectif: #1e8c7a; --tint-collectif: #d6f1ec; --pale-collectif: #97d9ce;

  /* ----- Rail d'étape du projet ----- */
  --rail: #ecd9cb;          /* rail creusé */
  --rail-done: #7a5f4e;     /* étape faite : 4,3 pour 1 sur le rail */
  --rail-now: #4aa8ff;      /* étape en cours (avec la tête de lecture bleue et le texte en gras) */

  /* ----- Surligneur (couleur d'accent des réglages ; valeurs posées par l'appli) ----- */
  --marker: #ffd84d;
  --marker-soft: #fff4cc;
  --marker-line: #e6b800;
  --rowtint: #e5edf8;

  /* Encres des membres et des catégories : initiales blanches (4,9 pour 1 au moins), encre sur moutarde (5,5). */
  --cat-bordeaux: #8e2341;
  --cat-orange: #b5501c;
  --cat-moutarde: #c79100;
  --cat-olive: #5f7a12;
  --cat-sapin: #1e7a46;
  --cat-canard: #0f6e7a;
  --cat-nuit: #2b3f96;
  --cat-indigo: #4b3fb8;
  --cat-prune: #6e2c8f;
  --cat-chocolat: #7a4a28;

  /* Plan de travail : intérieur jour, extérieur jour, intérieur nuit, extérieur nuit (inchangées). */
  --strip-int-jour: #ffffff;
  --strip-ext-jour: #fff1a8;
  --strip-int-nuit: #bcd4ff;
  --strip-ext-nuit: #b9e6c3;

  /* ----- Relief : ombres teintées de la chaleur du fond ----- */
  --shadow-card: 0 1px 2px rgba(107, 64, 40, 0.08), 0 6px 14px -6px rgba(107, 64, 40, 0.24);
  --shadow-raised: 0 1px 2px rgba(107, 64, 40, 0.1), 0 4px 10px -3px rgba(107, 64, 40, 0.2);
  --shadow-sheet: 0 2px 5px rgba(107, 64, 40, 0.24), inset 0 -2px 0 rgba(107, 64, 40, 0.05);
  --shadow-folder: 0 10px 14px rgba(107, 64, 40, 0.2);   /* drop-shadow : onglet et chemise ensemble */
  /* Éléments flottants (menus, listes déroulantes, notifications, bulle du CA) : contour et double ombre. */
  --shadow-pop: 0 1px 2px rgba(107, 64, 40, 0.2), 0 12px 24px -8px rgba(107, 64, 40, 0.45);
  --pop-edge: #dcc3b0;
  --shadow-press: inset 0 2px 4px rgba(107, 64, 40, 0.14);
  --veil: rgba(251, 238, 228, 0.72);                    /* voile abricot des fenêtres, flouté */

  /* ----- Rondeur ----- */
  --r-xl: 24px;             /* chemises, grandes cartes */
  --r-lg: 20px;             /* cartes, fenêtres */
  --r-md: 14px;             /* listes et éléments dans une carte */
  --r-sm: 10px;             /* champs, petites pastilles */
  --r-xs: 8px;              /* étiquettes */
  --r-tab: 16px;            /* coins du haut des onglets de classeur */
  --r-pill: 999px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --fs-xs: 12.5px;
  --fs-sm: 13.5px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 21px;
  --fs-2xl: 26px;
  --fs-3xl: 32px;

  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tap: 44px;
  --content: 920px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* « only light » : le thème sombre forcé d'Android (WebView, Chrome) ne repeint pas la page ; fond blanc opaque partout. */
:root { color-scheme: only light; background: var(--bg) var(--bg-grain); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.5; color: var(--ink);
  background: var(--bg) var(--bg-grain); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }
/* Heures, durées, montants : chiffres de même largeur (fonction « tnum » ajoutée à Lexend, tools/lexend.py). */
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Couleurs de catégorie et de membre ---------- */
.cat-bordeaux { --c: var(--cat-bordeaux); --on-c: #fff; }
.cat-orange { --c: var(--cat-orange); --on-c: #fff; }
.cat-moutarde { --c: var(--cat-moutarde); --on-c: var(--ink); }
.cat-olive { --c: var(--cat-olive); --on-c: #fff; }
.cat-sapin { --c: var(--cat-sapin); --on-c: #fff; }
.cat-canard { --c: var(--cat-canard); --on-c: #fff; }
.cat-nuit { --c: var(--cat-nuit); --on-c: #fff; }
.cat-indigo { --c: var(--cat-indigo); --on-c: #fff; }
.cat-prune { --c: var(--cat-prune); --on-c: #fff; }
.cat-chocolat { --c: var(--cat-chocolat); --on-c: #fff; }
/* Catégorie disparue : brun chaud plein. Membre archivé ou ancien membre : rond creux brun (pastille blanche). */
.cat-neutre { --c: var(--ancien); --on-c: #fff; }
.cat-ancien { --c: var(--ancien); --on-c: #fff; }
.avatar.cat-ancien { background: var(--card); color: var(--ancien); box-shadow: inset 0 0 0 2px var(--ancien); }

/* ---------- Bandeaux ---------- */
.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3);
  padding: var(--s2) var(--s4); font-size: var(--fs-sm); line-height: 1.4;
}
.banner-demo { background: var(--marker-soft); border-bottom: 1px solid var(--marker-line); }
.banner-demo strong { font-weight: 700; }
.banner-demo .asuser { margin-left: auto; min-width: 0; }
@media (max-width: 640px) {
  /* Téléphone : « Version de test » et « Voir en tant que » sur une seule ligne. */
  .banner-demo { flex-wrap: nowrap; padding: 2px var(--s3); }
  .banner-demo-text { flex: none; white-space: nowrap; }
  .banner-demo-more { display: none; }
  .banner-demo .asuser { max-width: 60%; }
  .banner-demo .asuser-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .banner-demo .dd-compact { min-height: 32px; max-width: 100%; }
  /* « Voir en tant que » ne sert qu'aux tests : un nom très long y est abrégé, le bandeau reste sur une ligne. */
  .banner-demo .dd-compact .dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.banner-warn { background: var(--warning-soft); color: var(--warning); border-bottom: 1px solid #f0d9a6; font-weight: 600; }
.banner-critical { background: var(--critical-soft); color: var(--critical); border-bottom: 1px solid #f3c4bf; font-weight: 600; }
.banner .btn { min-height: 38px; box-shadow: 0 2px 0 var(--line-strong); }

/* ---------- Barre du haut ---------- */
/* Sur le fond de la page ; l'onglet actif est en gras avec un trait bleu de 4 px dessous (« tu es ici »). */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg) var(--bg-grain); box-shadow: 0 1px 0 rgba(107, 64, 40, 0.07); }
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: var(--s1) var(--s4); min-height: 60px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s2) var(--s4);
}
.brand { display: flex; align-items: center; gap: var(--s2); text-decoration: none; min-height: var(--tap); border-radius: var(--r-sm); }
/* Logo : trois petits onglets de classeur (Dossier, Pré-prod, Tournage) devant le nom. */
.brand-tabs { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; flex: none; }
.brand-tabs > span { width: 8px; border-radius: 4px 4px 0 0; }
.brand-tabs > span:nth-child(1) { height: 14px; background: var(--tape-dossier); }
.brand-tabs > span:nth-child(2) { height: 18px; background: var(--tape-prepa); }
.brand-tabs > span:nth-child(3) { height: 22px; background: var(--tape-tournage); }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin-left: -2px; }
.brand-sub { font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; padding-top: 3px; }
.topnav { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; align-self: stretch; align-items: stretch; }
.topnav a {
  position: relative; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s3);
  text-decoration: none; font-weight: 600; color: var(--ink-2); border-radius: var(--r-sm); white-space: nowrap;
}
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current='page'] { color: var(--ink); font-weight: 700; }
.topnav a[aria-current='page']::after {
  content: ''; position: absolute; left: var(--s3); right: var(--s3); bottom: 6px; height: 4px; border-radius: 2px; background: var(--here);
}
.topnav .nav-short { display: none; }
@media (max-width: 520px) {
  /* Lot 5 : cinq onglets sur une ligne ; « Planning » et « Profil » (le nom accessible reste complet). */
  .topnav .nav-long { display: none; }
  .topnav .nav-short { display: inline; }
}
@media (max-width: 400px) {
  /* Lexend est plus large qu'Inter : à 360 px, les cinq onglets tiennent en 14 px, un peu plus serrés. */
  .topbar .topnav a { font-size: 14px; padding: 0 6px; }
  .topbar .topnav a[aria-current='page']::after { left: 6px; right: 6px; }
}
.asuser { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--ink-2); }
.asuser .dd-compact { max-width: 46vw; }
.savestate { font-size: var(--fs-xs); color: var(--ink-3); min-width: 9ch; text-align: right; }
.savestate[data-state='error'] { color: var(--critical); font-weight: 600; }
@media (max-width: 760px) {
  /* Une seule ligne : la navigation (le nom « Prépa » s'efface, le logo reste s'il y en a un). */
  .topbar-in { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s3); min-height: 0; }
  .topnav { flex: 1 1 auto; min-width: 0; gap: 0; margin: 0 calc(-1 * var(--s2)); }
  .topnav a { padding: 0 var(--s2); }
  .topnav a[aria-current='page']::after { left: var(--s2); right: var(--s2); bottom: 4px; }
  .brand { flex: none; padding-top: 0; align-items: center; }
  .brand-tabs, .brand-name, .brand-sub { display: none; }
  .brand:not(:has(.brand-logo:not([hidden]))) { display: none; }
  .topbar-status { display: none; }
  /* Masquée en descendant, de retour en remontant (autohide.js) ; la barre « Sommaire » prend sa place. */
  .topbar { transition: transform 0.15s ease; }
  html.bar-hidden .topbar { transform: translateY(-100%); }
}

/* ---------- Page ---------- */
.page { max-width: var(--content); margin: 0 auto; padding: var(--s5) var(--s4) 120px; background: var(--bg) var(--bg-grain); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.page-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.marker {
  background: linear-gradient(180deg, transparent 56%, var(--marker) 56%, var(--marker) 94%, transparent 94%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 2px;
}
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.back { display: inline-flex; align-items: center; gap: var(--s1); min-height: 36px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--s2); }
.back:hover { color: var(--ink); }
.stack > * + * { margin-top: var(--s4); }
.sec { margin-top: var(--s6); }
.sec:first-child { margin-top: 0; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.sec-title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; }
.sec-hint { font-size: var(--fs-sm); color: var(--ink-3); }
.empty { border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); padding: var(--s4); background: rgba(255, 255, 255, 0.55); color: var(--ink-2); font-size: var(--fs-sm); }
.notice { border-radius: var(--r-md); padding: var(--s3) var(--s4); background: var(--card); box-shadow: var(--shadow-card); color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- Boutons : des touches en pilule ---------- */
/* Secondaire : blanc, contour doux et bord inférieur de 3 px. Principal : bleu ciel, bord de 4 px et léger reflet.
   Les deux s'enfoncent quand on appuie. Désactivé : gris et creusé. Cible de 44 px au moins (la petite taille
   garde une cible de 44 px par une zone invisible autour). */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 18px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--card); box-shadow: 0 3px 0 var(--line-strong); font-weight: 600; font-size: 15px; line-height: 1.2;
  text-decoration: none; color: var(--ink); white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s ease;
}
.btn:hover { background: var(--wash); border-color: var(--line-strong); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line-strong); }
.btn:disabled, .btn[aria-disabled='true'] {
  background: var(--off); border-color: var(--off); color: var(--on-off); box-shadow: var(--shadow-press); transform: none; cursor: not-allowed;
}
.btn-primary {
  background: var(--key); border-color: var(--key); font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 0 var(--key-edge);
}
.btn-primary:hover { background: var(--key-hover); border-color: var(--key-hover); }
.btn-primary:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 0 var(--key-edge); }
.btn-primary .ico, .btn-primary:disabled .ico { color: inherit; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(107, 64, 40, 0.06); border-color: transparent; }
.btn-ghost:active { transform: none; }
.btn-danger { color: var(--critical); border-color: var(--critical-edge); box-shadow: 0 3px 0 var(--critical-edge); }
.btn-danger:hover { border-color: var(--critical); background: var(--critical-soft); }
.btn-danger:active { box-shadow: 0 0 0 var(--critical-edge); }
.btn-sm { min-height: 36px; padding: 0 12px; gap: 6px; font-size: var(--fs-sm); }
.btn-sm::before { content: ''; position: absolute; inset: -4px -2px; } /* cible de 44 px */
.btn-dashed { border-style: dashed; color: var(--ink-2); box-shadow: none; }
.btn-dashed:active { transform: none; }
.btn-block { display: flex; width: 100%; }
/* Bouton rond (fermer, précédent, suivant, « ⋯ ») : sans contour au repos, gris au survol. */
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--ink-2); -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: rgba(107, 64, 40, 0.07); color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }
.icon-btn.danger:hover { color: var(--critical); background: var(--critical-soft); }
.ico { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- Champs ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: var(--s3); }
/* Cartes de liste sur téléphone : champs plus serrés. Placée avant la règle « margin-top: 0 » des grilles, qui l'emporte. */
@media (max-width: 560px) { .le-item .field + .field { margin-top: var(--s2); } }
/* Dans une grille, l'écart vient du gap : pas de marge en plus (sinon les champs d'une même ligne se décalent). */
:is(.grid-2, .grid-3, .le-fields, .le-body, .synth-row) > .field + .field { margin-top: 0; }
.field { align-content: start; }
.field-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: var(--fs-xs); color: var(--ink-3); }
.field-msg { font-size: var(--fs-xs); color: var(--warning); font-weight: 600; }
/* Champ : contour visible (3,4 pour 1 sur blanc), coins arrondis, focus bleu. */
.in {
  width: 100%; min-height: var(--tap); padding: 9px 12px; border: 1px solid var(--field-edge); border-radius: var(--r-sm);
  background: var(--card); font-size: var(--fs-md); line-height: 1.45;
}
/* Un champ atteint au clavier ne se glisse pas sous les barres collées (en haut : barre du haut et « Sommaire » ; en bas : mode modification). */
.in { scroll-margin: calc(var(--topbar-h, 64px) + 64px) 0 96px; }
textarea.in { resize: vertical; min-height: 88px; }
textarea.in.short { min-height: 64px; }
.in:focus { outline: 3px solid var(--here); outline-offset: 1px; border-color: var(--here); }
.in[readonly] { background: var(--wash); }
.in-title { font-size: var(--fs-lg); font-weight: 700; }
.grid-2 { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.check { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--here); margin: 0; }

/* ---------- Pastilles ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--line-strong); background: var(--paper); white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--ink-3)); }
.st-preparation { --dot: var(--edge-prepa); }
.st-pret { --dot: #e3b400; border-color: var(--marker-line); background: var(--marker-soft); }
.st-tourne { --dot: var(--cat-bleu); }
.st-postprod { --dot: var(--cat-violet); }
.st-livre { --dot: var(--ok); }
.st-archive { --dot: var(--ink-3); color: var(--ink-3); }
.st-modele { --dot: var(--ink-3); }
/* Lot 4 : dossier en proposition : pastille au contour en pointillé, comme ses bandes sur la frise. */
.st-tentative { border-style: dashed; border-color: var(--ink-2); font-style: italic; }
.st-tentative::before { display: none; }
.chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 700; background: var(--c, var(--tape-dossier)); color: var(--on-c, var(--ink));
}
.chip-marker { background: var(--marker); color: var(--ink); }
.tag { display: inline-flex; padding: 2px 8px; border-radius: var(--r-sm); background: var(--marker-soft); border: 1px solid var(--marker-line); font-size: var(--fs-xs); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; background: var(--wash); color: var(--ink-2); }
.badge-demande { background: var(--marker); color: var(--ink); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-crit { background: var(--critical-soft); color: var(--critical); }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c, var(--ancien)); color: var(--on-c, #fff); font-size: 11.5px; font-weight: 700; flex: none;
  border: 2px solid var(--paper);
}
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.who { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 600; }

/* ---------- Accueil ---------- */
.group + .group { margin-top: 28px; }
.group-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--s3); display: flex; gap: var(--s2); align-items: center; }
.group-count { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.drows { display: grid; gap: var(--s3); }
/* Carte d'un dossier : la date dans un bloc de la couleur de l'étape (texte foncé), le reste sur la feuille blanche. */
.drow {
  display: grid; grid-template-columns: 84px 1fr; border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  overflow: hidden; text-decoration: none; color: inherit; background: var(--card); transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.drow:hover { box-shadow: var(--shadow-raised), 0 10px 22px -12px rgba(107, 64, 40, 0.3); }
.drow:active { transform: translateY(1px); }
.drow-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--tape, var(--tape-dossier)); color: var(--on-tape, var(--ink)); padding: var(--s3) var(--s2); text-align: center;
}
.drow-date.is-muted { background: var(--tape-dossier); color: var(--ink); }
.drow-day { font-size: var(--fs-2xl); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.drow-month { font-size: var(--fs-sm); font-weight: 600; }
.drow-wd { font-size: var(--fs-xs); font-weight: 600; }
.drow-none { font-size: var(--fs-sm); font-weight: 600; }
.drow-body { padding: var(--s3) var(--s4); display: grid; gap: 6px; min-width: 0; }
.drow-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.drow-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.drow-title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.drow-sub { color: var(--ink-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.drow-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); font-size: var(--fs-sm); color: var(--ink-2); }
.meter { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); font-weight: 600; color: var(--ink); }
/* Jauge : rail creusé, la part faite en gris foncé (comme les étapes faites du rail d'étape). */
.meter-bar { position: relative; flex: none; width: 72px; height: 10px; border-radius: 5px; background: var(--rail); box-shadow: inset 0 1px 2px rgba(107, 64, 40, 0.22); }
.meter-fill { position: absolute; left: 2px; top: 2px; bottom: 2px; width: 0; max-width: calc(100% - 4px); border-radius: 3px; background: var(--rail-done); }
.mydeliv { background: var(--card); box-shadow: var(--shadow-card); border-radius: var(--r-lg); padding: var(--s3) var(--s4); margin-bottom: var(--s6); }
.mydeliv-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--s2); }
.mydeliv-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.mydeliv-row:first-of-type { border-top: 0; }
.mydeliv-row:hover .mydeliv-name { text-decoration: underline; }
.mydeliv-name { font-weight: 600; }
.late { color: var(--critical); font-weight: 700; }

/* ---------- Dossier : en-tête et onglets ---------- */
.dhead { margin-bottom: var(--s4); }
.dhead-title { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; overflow-wrap: anywhere; }
/* Le titre se lit seul, sans surligneur : le relief et la couleur sont gardés pour ce qui compte dans la page. */
.dhead-title .marker { background: none; padding: 0; }
@media (max-width: 640px) { .dhead-title { font-size: var(--fs-2xl); } }
.dhead-facts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s3); color: var(--ink-2); font-size: var(--fs-sm); align-items: center; }
.dhead-facts .fact { display: inline-flex; align-items: center; gap: 6px; }
.dhead-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.tabs {
  display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line-strong);
  margin: 0 calc(-1 * var(--s4)) var(--s5); padding: 0 var(--s4); position: sticky; top: 61px; background: var(--bg) var(--bg-grain); z-index: 10;
}
@media (max-width: 760px) { .tabs { top: 98px; } }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s3); white-space: nowrap;
  text-decoration: none; font-weight: 600; color: var(--ink-2); border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab:hover { color: var(--ink); }
.tab[aria-current='page'] { color: var(--ink); font-weight: 700; }
.tab[aria-current='page']::after { content: ''; position: absolute; left: var(--s3); right: var(--s3); bottom: 4px; height: 4px; border-radius: 2px; background: var(--here); }
.tab .count { margin-left: 6px; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
.editbar {
  position: sticky; bottom: 0; z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  margin: var(--s5) calc(-1 * var(--s4)) 0; padding: 10px var(--s4) 12px; background: var(--card); color: var(--ink); font-size: var(--fs-sm);
  font-weight: 600; border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -10px 24px -14px rgba(107, 64, 40, 0.45);
}
.editbar::before { content: ''; flex: none; width: 4px; align-self: stretch; border-radius: 2px; background: var(--here); }
.editbar > span { flex: 1 1 auto; min-width: 0; }

/* ---------- Infos ---------- */
.dates-ed { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.date-row { display: flex; align-items: flex-end; gap: var(--s2); max-width: 340px; }
.date-row .field { flex: 1; }
.team-row { align-items: start; }
.team-edit { display: grid; gap: var(--s3); min-width: 0; }
.dhead-notices { margin-top: var(--s4); }

/* ---------- Bloc d'édition de liste ---------- */
.le { display: grid; gap: var(--s2); }
.le-item { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); align-items: start; padding: var(--s3); border: 1.5px solid transparent; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.le-item.is-new { border-color: var(--here); }
.le-tools { display: flex; gap: 2px; }
.le-foot { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.le-body { display: grid; gap: var(--s2); min-width: 0; }
.le-lead { display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); align-items: start; }
.le-lead > :last-child { display: grid; gap: var(--s2); min-width: 0; }
.le-item > .le-more { display: none; }
@media (max-width: 560px) {
  .le-item { grid-template-columns: 1fr; padding: var(--s2); }
  /* Les autres rangées d'outils (tâches du planning, versions des livrables) gardent leurs boutons au-dessus. */
  .le-tools { justify-content: flex-end; order: -1; margin: -6px -6px 0 0; }
  /* Cartes de liste modifiables : un seul bouton « ⋯ » à droite au lieu de la rangée Monter / Descendre / Supprimer. */
  .le-item:has(> .le-more) { grid-template-columns: minmax(0, 1fr) 44px; }
  .le-item:has(> .le-more) > .le-tools { display: none; }
  .le-item > .le-more { display: block; }
  .le-more .ico { stroke-width: 3.2; } /* trois points bien visibles : c'est le seul bouton d'actions de la carte */
  .le-item textarea.in { min-height: 64px; }
}

/* ---------- Déroulé ---------- */
.legend { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.day-title { font-size: var(--fs-lg); font-weight: 700; margin: var(--s5) 0 var(--s3); }
.day-title:first-of-type { margin-top: 0; }
.tl { display: grid; gap: var(--s3); }
.tl-item { display: grid; grid-template-columns: 118px 1fr; border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
.tl-time {
  background: var(--c, var(--tape-dossier)); color: var(--on-c, var(--ink)); display: flex; flex-direction: column; justify-content: center;
  align-items: center; padding: var(--s3) var(--s2); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; text-align: center;
}
.tl-time { font-variant-numeric: tabular-nums; }
.tl-time small { font-size: var(--fs-sm); font-weight: 600; }
.tl-body { padding: var(--s3) var(--s4); display: grid; gap: 4px; min-width: 0; }
.tl-title { font-size: var(--fs-lg); font-weight: 700; }
.tl-place { color: var(--ink-2); font-size: var(--fs-sm); }
.tl-ms { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); background: var(--tape-tournage); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--s3) var(--s4); font-weight: 700; font-size: var(--fs-lg); }
.tl-ms .chip-marker { font-size: var(--fs-md); padding: 3px 12px; }
@media (max-width: 520px) { .tl-item { grid-template-columns: 84px 1fr; } .tl-time { font-size: var(--fs-lg); } }

/* ---------- Texte enrichi ---------- */
.rt > * + * { margin-top: 0.6em; }
.rt-p { white-space: pre-line; }
.rt-ul { padding-left: 1.1em; list-style: square; }
.rt-ul li + li { margin-top: 4px; }
.rt a { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.rt strong { font-weight: 700; }

/* ---------- Encadrés ---------- */
.callout { background: var(--marker-soft); border: 1px solid var(--marker-line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--s4) var(--s5); }
.callout-label { font-size: var(--fs-xs); font-weight: 700; color: #6e5600; margin-bottom: 6px; }
.callout .rt { font-size: var(--fs-lg); line-height: 1.5; }
.squares { list-style: none; display: grid; gap: var(--s2); }
.squares > li { display: grid; grid-template-columns: 14px 1fr; gap: var(--s3); align-items: baseline; }
.squares > li::before { content: ''; width: 9px; height: 9px; background: var(--ink-2); border-radius: 3px; transform: translateY(-1px); }

/* ---------- Listes numérotées ---------- */
.numlist { list-style: none; display: grid; gap: var(--s3); counter-reset: num; }
.num-item { display: grid; grid-template-columns: 32px 1fr; gap: var(--s4); align-items: start; border-radius: var(--r-lg); padding: var(--s4); background: var(--card); box-shadow: var(--shadow-card); }
.num-item.tint:nth-child(even) { background: var(--rowtint); }
/* Numéro : petite étiquette de la couleur de l'étape, texte foncé. */
.num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--tape, var(--tape-dossier)); color: var(--on-tape, var(--ink)); font-weight: 700; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.num-title { font-weight: 700; font-size: var(--fs-lg); line-height: 1.35; }
.num-text { margin-top: 4px; color: var(--ink-2); }

/* ---------- Shotlist ---------- */
.progress { display: inline-flex; align-items: center; gap: var(--s3); font-weight: 700; }
.progress .meter-bar { width: 120px; }
.shots { display: grid; grid-template-columns: 1fr; border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
@media (min-width: 720px) { .shots { grid-template-columns: 1fr 1fr; } }
.shot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); min-height: 60px; background: var(--paper); }
@media (min-width: 720px) { .shot:nth-child(odd) { border-right: 1px solid var(--line); } }
.shot-check { position: relative; display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); margin: -10px -6px -10px -10px; cursor: pointer; }
.shot-check input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--ink-2); border-radius: 7px; background: var(--card); cursor: pointer; display: grid; place-items: center; }
.shot-check input:checked { background: var(--here); border-color: var(--here); }
.shot-check input:checked::after { content: ''; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg); }
.shot-check input:disabled { cursor: default; opacity: 0.55; }
.shot-check input:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }
.shot-main { display: grid; gap: 3px; min-width: 0; }
.shot-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.shot.is-done .shot-title { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-3); }
.shot-detail { font-size: var(--fs-sm); color: var(--ink-3); }
.shot-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--ink-3); }
.shot-note { font-size: var(--fs-sm); color: var(--ink-2); background: var(--wash); border-radius: var(--r-sm); padding: 4px 8px; }
/* Cible de 44 px, mais la rangée garde la hauteur du titre (comme la case à cocher). */
.shot-note-btn { grid-column: 3; margin: -10px -10px -10px 0; }

/* ---------- Interview ---------- */
.ltc { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
.ltc th { background: var(--tint, var(--wash)); color: var(--ink); text-align: left; padding: var(--s3) var(--s4); font-size: var(--fs-sm); border-bottom: 1px solid var(--line-strong); }
.ltc td { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); vertical-align: top; }
.ltc tr:nth-child(even) td { background: var(--wash); }
.ltc td.says { font-weight: 700; }
@media (max-width: 600px) {
  .ltc, .ltc tbody, .ltc tr, .ltc td { display: block; width: 100%; }
  .ltc thead { display: none; }
  .ltc td::before { content: attr(data-label); display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); margin-bottom: 2px; }
}
.boxes { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .boxes { grid-template-columns: 1fr 1fr; } }
.box { border-radius: var(--r-lg); padding: var(--s4); background: var(--card); box-shadow: var(--shadow-card); }
.box-title { font-weight: 700; font-size: var(--fs-lg); text-align: center; margin-bottom: var(--s2); }

/* ---------- Intervenants ---------- */
.people { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pcard { border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
.pcard-head { background: var(--tint, var(--wash)); color: var(--ink); display: flex; align-items: center; gap: var(--s2); padding: 10px var(--s3); font-weight: 700; font-size: var(--fs-sm); min-height: 46px; border-bottom: 1px solid var(--line); }
.pcard-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--tape, var(--marker)); color: var(--on-tape, var(--ink)); flex: none; font-variant-numeric: tabular-nums; }
.pcard-org { overflow-wrap: anywhere; }
.pcard-photo { aspect-ratio: 4 / 5; background: var(--wash); display: grid; place-items: center; overflow: hidden; position: relative; }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.pcard-initials { width: 100%; height: 100%; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--ancien)) 13%, #fff); color: var(--c, var(--ancien)); font-size: 44px; font-weight: 700; letter-spacing: -0.02em; }
.pcard-body { padding: var(--s3); text-align: center; display: grid; gap: 6px; justify-items: center; }
.pcard-name { font-weight: 700; font-size: var(--fs-lg); line-height: 1.25; }
.pcard-fn { font-size: var(--fs-sm); color: var(--ink-2); }
.pcard-flags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pcard-consent { width: 100%; }
.pcard-consent select { min-height: 38px; font-size: var(--fs-sm); }

/* ---------- Technique ---------- */
.gear { display: grid; gap: var(--s4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 720px) { .gear { grid-template-columns: 1fr 1fr; } }
.gcol { border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
.gcol-head { background: var(--c, var(--tint, var(--wash))); color: var(--on-c, var(--ink)); text-align: center; font-weight: 700; padding: 10px var(--s3); }
.gcol-head small { display: block; font-weight: 500; font-size: var(--fs-xs); }
.gfam { padding: var(--s3) var(--s4); }
.gfam + .gfam { border-top: 1px solid var(--line); }
.gfam-title { font-size: var(--fs-xs); font-weight: 700; text-align: center; color: var(--ink-2); margin-bottom: var(--s2); letter-spacing: 0.02em; }
.gitem-note { color: var(--ink-3); font-size: var(--fs-sm); }
.tiles { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { border-radius: var(--r-lg); padding: var(--s3) var(--s4); background: var(--card); box-shadow: var(--shadow-card); }
.tile-label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.tile-value { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.tile .chip-marker { margin-top: 4px; }

/* ---------- Post-prod ---------- */
.cards { display: grid; gap: var(--s3); }
.card { border-radius: var(--r-lg); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); background: var(--card); box-shadow: var(--shadow-card); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.card-title { font-weight: 700; font-size: var(--fs-lg); }
.specs { display: flex; flex-wrap: wrap; gap: 6px; }
.spec { display: inline-flex; padding: 2px 8px; border-radius: var(--r-xs); background: var(--wash); font-size: var(--fs-sm); color: var(--ink-2); }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
.kv > div { padding: 10px var(--s4); border-top: 1px solid var(--line); }
.kv > div:nth-child(-n + 2) { border-top: 0; }
.kv .k { font-weight: 600; color: var(--ink-2); background: var(--wash); }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv .k { border-top: 1px solid var(--line); padding-bottom: 2px; } .kv .v { border-top: 0; padding-top: 0; } }
.synth { display: grid; gap: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
.synth-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); padding: 10px var(--s4); border-top: 1px solid var(--line); align-items: center; }
.synth-row:first-child { border-top: 0; }
.synth-name { font-weight: 700; }
.thumbs { display: flex; flex-wrap: wrap; gap: var(--s2); }
.thumb { position: relative; width: 96px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--wash); }
.thumb img { width: 96px; height: 72px; object-fit: cover; }
.thumb-name { font-size: 11px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .icon-btn { position: absolute; top: 2px; right: 2px; width: 30px; height: 30px; background: rgba(255, 255, 255, 0.92); }

/* ---------- Formulaires de création / admin ---------- */
.panel { border-radius: var(--r-lg); padding: var(--s4) var(--s5); background: var(--card); box-shadow: var(--shadow-card); }
.panel + .panel { margin-top: var(--s4); }
.choice { display: grid; gap: var(--s2); }
.choice label { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border: 1.5px solid transparent; border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow-card); cursor: pointer; }
/* Choix coché : contour bleu (« tu es ici ») et fond bleu très pâle ; le bouton radio coché le dit aussi. */
.choice label:has(input:checked) { border-color: var(--here); background: var(--select-soft); }
.choice input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--here); }
.choice-title { font-weight: 700; }
.blocks-pick { display: grid; gap: var(--s1); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.subnav { display: flex; flex-wrap: wrap; gap: var(--s1); margin-bottom: var(--s5); border-bottom: 1px solid var(--line-strong); }
.table-list { display: grid; border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
.table-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); align-items: center; }
.table-row:first-child { border-top: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--paper); outline: 1px solid var(--line-strong); background: var(--c); padding: 0; }
.swatch[aria-pressed='true'] { outline: 3px solid var(--here); }

/* ---------- Superpositions ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: grid; gap: var(--s2); width: min(560px, calc(100% - 24px)); pointer-events: none; }
/* Phase 2, lot 2 : au-dessus de la barre « Mode modification » (« Terminer » reste à portée de doigt). */
html:has(.editbar:not([hidden])) .toasts { bottom: 88px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); position: relative;
  background: var(--card); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-pop), 0 0 0 1px rgba(107, 64, 40, 0.06);
  padding: 10px var(--s3) 10px 22px; font-size: var(--fs-sm); font-weight: 600;
}
.toast::before { content: ''; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: var(--here); }
.toast-action { background: none; border: 0; border-radius: var(--r-pill); color: var(--here); font-weight: 700; min-height: var(--tap); padding: 0 var(--s3); text-decoration: underline; text-underline-offset: 2px; }
.toast-action:hover { background: var(--wash); }
.toast.err { background: var(--critical-soft); color: var(--critical); }
.toast.err::before { background: var(--critical); }
.toast.err .toast-action { color: var(--critical); }
dialog.dlg {
  border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 48px);
  color: var(--ink); background: var(--card); box-shadow: var(--shadow-pop);
}
/* Voile gris clair légèrement flouté (plus de voile noir). */
dialog.dlg::backdrop { background: var(--veil); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dlg-head { padding: var(--s5) var(--s5) var(--s2); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.dlg-body { padding: 0 var(--s5) var(--s4); overflow: auto; max-height: 60vh; }
.dlg-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--s2); padding: var(--s3) var(--s5) var(--s4); border-top: 1px solid var(--line); }
.pick-list { display: grid; gap: 2px; margin-top: var(--s2); }
.pick-list label { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: start; padding: 10px var(--s2); border-radius: var(--r-sm); cursor: pointer; }
.pick-list label:hover { background: var(--wash); }
.pick-list input { width: 20px; height: 20px; accent-color: var(--here); margin: 1px 0 0; }
.pick-label { display: block; font-weight: 500; }
.pick-hint { display: block; font-size: var(--fs-sm); color: var(--ink-3); }
.notfound { text-align: left; padding: var(--s6) 0; }
.notfound h1 { font-size: var(--fs-2xl); margin-bottom: var(--s2); }

/* ---------- Onglets : compléments ---------- */
.tab-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.015em; margin-bottom: var(--s4); }
.sec-gap { margin-top: var(--s4); }
.le-fields { display: grid; gap: var(--s2); min-width: 0; }
.slot-ed { display: grid; gap: var(--s2); border-left: 6px solid var(--c, var(--line)); padding-left: var(--s3); }
.slot-grid { display: grid; gap: var(--s2); grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .slot-grid { grid-template-columns: 1.2fr 1fr 1fr 1.4fr; } }
.intention-callout .rt { font-size: var(--fs-md); }
.intention-callout .rt strong { font-size: var(--fs-lg); }
.shot-note-btn { color: var(--ink-3); }
.shot-note-btn:hover { color: var(--ink); }
.people-note { margin-bottom: var(--s4); }
.person-ed { display: grid; grid-template-columns: 112px 1fr; gap: var(--s4); align-items: start; }
@media (max-width: 560px) { .person-ed { grid-template-columns: 1fr; } }
.person-photo { display: grid; gap: 6px; justify-items: start; }
.person-thumb { width: 96px; aspect-ratio: 4 / 5; border-radius: var(--r-md); overflow: hidden; background: var(--wash); }
.person-thumb img { width: 100%; height: 100%; object-fit: cover; }
.person-thumb .pcard-initials { font-size: 26px; }
.checks { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-end; }
.gcol-ed .le-item { padding: var(--s2) var(--s3); }
.callout-plain p + p { margin-top: var(--s3); }
.callout-plain .callout-label { margin-bottom: 0; }

/* ---------- Menu « Autres actions » ---------- */
.menu { position: relative; display: inline-block; }
.menu-list { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 260px; display: grid; gap: 2px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.menu-list[hidden] { display: none; }
.menu-item { text-align: left; background: none; border: 0; border-radius: var(--r-md); min-height: var(--tap); padding: 0 var(--s3); font-weight: 600; color: var(--ink); }
.menu-item:hover, .menu-item:focus-visible { background: var(--wash); outline: none; }
.menu-item:focus-visible { box-shadow: inset 0 0 0 3px var(--here); }
.menu-item.is-danger { color: var(--critical); }
@media (max-width: 560px) {
  .menu-list { position: fixed; top: auto; left: 12px; right: 12px; bottom: 12px; min-width: 0; }
}

/* ---------- Création, profil, admin ---------- */
fieldset.choice, fieldset.plain { border: 0; padding: 0; margin-inline: 0; margin-bottom: 0; min-width: 0; }
fieldset.choice legend, fieldset.plain legend { padding: 0; margin-bottom: var(--s2); }
.create { max-width: 760px; }
.profile, .admin { max-width: 900px; }
.create .page-title, .admin .page-title { margin: var(--s2) 0 var(--s4); }
.form-foot { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.blocks-pick + .check { margin-top: var(--s2); }
.profile-id { display: flex; align-items: center; gap: var(--s3); }
.profile-id .avatar { width: 44px; height: 44px; font-size: var(--fs-md); }
.kit { display: grid; gap: var(--s2); }
.kit-head, .kit-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 1fr) 44px; gap: var(--s2); align-items: center; }
.kit-head { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); padding: 0 2px; }
.kit-row .field + .field { margin-top: 0; }
@media (max-width: 720px) {
  .kit-head { display: none; }
  .kit-row { grid-template-columns: 1fr 1fr 44px; padding: var(--s2) 0; border-top: 1px solid var(--line); }
  .kit-row > .field:first-child { grid-column: 1 / 3; }
  .kit-row > .field:nth-child(4) { grid-column: 1 / 3; }
  .kit-row > .icon-btn { grid-column: 3; grid-row: 1; }
  .kit-row > .kit-rate { grid-column: 1; }
  .kit-row > .kit-unit { grid-column: 2; }
}
.members { display: grid; gap: var(--s3); }
.member { border-radius: var(--r-lg); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); background: var(--card); box-shadow: var(--shadow-card); }
.member.is-off { background: var(--wash); }
.member-id { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.member-name { font-weight: 700; font-size: var(--fs-lg); }
.member .checks { align-items: center; }
.member-role { min-width: 180px; }
/* Retouches du 17 novembre : « Archiver » à droite du nom ; volet replié des membres archivés en bas de la page. */
.member-archive { margin-left: auto; }
.members-archived { margin-top: var(--s5); }
.members-archived > summary { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
.members-archived > summary::before { content: ''; width: 0; height: 0; margin-right: 8px; border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform 0.15s ease; }
.members-archived[open] > summary { margin-bottom: var(--s3); }
.members-archived[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .members-archived > summary::before { transition: none; } }
.member-leftover { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.member-leftover p { margin: 0; color: var(--ink-2); }
.archive-preview { display: grid; gap: var(--s2); }
.archive-preview p { margin: 0; }
.archive-list { margin: 0; padding-left: 1.2em; }
.lib { display: grid; gap: var(--s2); }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: var(--s2); align-items: start; padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.lib-row .grid-3, .lib-row .grid-2, .lib-one { min-width: 0; }
.cat-row { grid-template-columns: 14px minmax(0, 1fr) 44px; align-items: center; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.link-strong { font-weight: 700; }
.logo-ed { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.logo-preview { width: 120px; height: 72px; display: grid; place-items: center; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--card); overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.brand-logo { align-self: center; display: inline-flex; }
.brand-logo[hidden] { display: none; }
.brand-logo img { height: 26px; width: auto; max-width: 80px; object-fit: contain; }
.stack-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.lib-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3); margin-right: calc(44px + var(--s2)); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
@media (max-width: 719px) { .lib-head { display: none; } }
.sec-intro { margin-bottom: var(--s4); }
@media (max-width: 560px) {
  .people { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .pcard-initials { font-size: 32px; }
  .pcard-name { font-size: var(--fs-md); }
}

/* ---------- Liste déroulante de l'outil (remplace le <select> natif) ---------- */
.dd { position: relative; min-width: 0; }
.dd-trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); text-align: left; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.dd-value { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; } /* une valeur longue passe à la ligne, jamais coupée */
.dd-value.is-empty { color: var(--ink-3); }
.dd-chevron { flex: none; width: 18px; height: 18px; color: var(--ink-2); transition: transform 0.15s ease; }
.dd-trigger[aria-expanded='true'] { border-color: var(--here); }
.dd-trigger[aria-expanded='true'] .dd-chevron { transform: rotate(180deg); }
.dd-trigger:disabled { opacity: 0.6; cursor: default; }
.dd-compact { width: auto; min-height: 38px; padding: 0 var(--s2) 0 var(--s3); font-size: var(--fs-sm); font-weight: 600; }
.dd-list {
  position: fixed; inset: auto; margin: 0; z-index: 80; list-style: none; padding: 4px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); animation: dd-in 0.12s ease-out;
}
.dd-list.is-up { animation-name: dd-in-up; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(4px); } }
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 44px; padding: 8px 10px 8px 12px;
  border-radius: var(--r-sm); cursor: pointer; line-height: 1.3; -webkit-tap-highlight-color: transparent;
}
.dd-opt.is-active { background: var(--wash); }
.dd-opt:active { background: #e3edfb; }
.dd-opt[aria-selected='true'] { font-weight: 700; }
.dd-check { flex: none; width: 18px; height: 18px; visibility: hidden; }
.dd-opt[aria-selected='true'] .dd-check { visibility: visible; }

/* v1.3, lot 3 : adresse qui ouvre l'itinéraire (texte de l'adresse, sauts de ligne gardés). */
.route-link { display: inline-flex; align-items: flex-start; gap: 4px; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.route-link .ico { flex: none; margin-top: 3px; }
.route-text { white-space: pre-line; overflow-wrap: anywhere; }

/* Couleur prise par un autre membre (profil) : indisponible, le nom de qui la porte est écrit dessous. */
.swatch:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.colors-taken { margin: var(--s2) 0 0; }

/* ---------- v1.1 : classeur à intercalaires (refonte visuelle : cartes en relief, étiquettes de gaffer) ---------- */

/* Couleur d'étape : chaque élément marqué grp-* reçoit sa bande, sa teinte et son bord (un ton plus foncé). */
.grp-dossier { --tape: var(--tape-dossier); --on-tape: var(--on-tape-dossier); --tint: var(--tint-dossier); --tape-dark: var(--edge-dossier); --edge: var(--edge-dossier); --pale: var(--pale-dossier); }
.grp-prepa { --tape: var(--tape-prepa); --on-tape: var(--on-tape-prepa); --tint: var(--tint-prepa); --tape-dark: var(--edge-prepa); --edge: var(--edge-prepa); --pale: var(--pale-prepa); }
.grp-tournage { --tape: var(--tape-tournage); --on-tape: var(--on-tape-tournage); --tint: var(--tint-tournage); --tape-dark: var(--edge-tournage); --edge: var(--edge-tournage); --pale: var(--pale-tournage); }
.grp-post { --tape: var(--tape-post); --on-tape: var(--on-tape-post); --tint: var(--tint-post); --tape-dark: var(--edge-post); --edge: var(--edge-post); --pale: var(--pale-post); }

/* Bande de gaffer : bords légèrement déchirés, comme une étiquette sur une malle. Toujours du texte foncé dessus. */
.tape {
  display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 7px 18px 7px 14px;
  background: var(--tape, var(--tape-dossier)); color: var(--on-tape, var(--ink)); font-weight: 700; letter-spacing: -0.01em;
  clip-path: polygon(0 6%, 2% 0, 30% 5%, 62% 0, 98% 4%, 100% 0, 99% 48%, 100% 100%, 70% 95%, 35% 100%, 3% 96%, 0 100%, 1% 52%);
}
.tape .ico { width: 20px; height: 20px; }

/* Onglet de classeur (coins du haut arrondis) et chemise de la couleur de l'étape : bloc du moment, points de
   contrôle. La feuille blanche est rangée dedans ; onglet et chemise portent la même ombre. */
.folder { filter: drop-shadow(0 6px 10px rgba(107, 64, 40, 0.12)); }
.folder-tab {
  display: inline-flex; align-items: center; max-width: 100%; min-height: 34px; margin: 0; padding: 4px 16px;
  border-radius: 14px 14px 0 0; background: var(--tape); color: var(--on-tape); font-size: 15px; font-weight: 700; line-height: 1.2;
}
.folder-body { background: var(--tape); border-radius: 0 22px 22px 22px; padding: 5px 6px 6px; margin-top: -1px; }
.folder-sheet { background: var(--card); border-radius: 17px; }

.page[data-route='dossier'] { max-width: 1240px; }
.dhead .dhead-actions { margin-top: 0; }
.fact-kind { font-weight: 600; color: var(--ink); }

.dlayout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: var(--s6); align-items: start; margin-top: var(--s5); }
.dmain { min-width: 0; }
/* Colonne fixe : de la place autour des cartes pour les étiquettes qui dépassent et pour les ombres. */
.dside {
  position: sticky; top: calc(var(--topbar-h, 60px) + 8px); max-height: calc(100vh - var(--topbar-h, 60px) - 16px);
  overflow: auto; padding: 20px 10px 16px; margin: -20px -10px 0; scrollbar-width: thin;
}

/* Sommaire : une carte blanche arrondie par étape ; son nom sur une étiquette de gaffer à cheval sur le haut. */
.dnav { display: grid; gap: 28px; }
.dnav-group { position: relative; display: block; padding: 22px 6px 4px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.dnav-glabel {
  position: absolute; left: 12px; top: -14px; z-index: 1; display: flex; align-items: center; gap: var(--s2); max-width: calc(100% - 24px);
  padding: 3px 14px 3px 12px; background: var(--tape); color: var(--on-tape); font-size: 16px; font-weight: 700; line-height: 1.25;
  clip-path: polygon(0 10%, 5% 0, 50% 8%, 95% 0, 100% 12%, 98% 50%, 100% 92%, 50% 100%, 4% 92%, 0 100%, 2% 50%);
  transform: rotate(-1.5deg);
}
.dnav-group.grp-prepa .dnav-glabel { transform: rotate(1deg); clip-path: polygon(0 12%, 4% 0, 55% 8%, 96% 0, 100% 10%, 98% 52%, 100% 90%, 45% 100%, 5% 94%, 0 100%, 2% 46%); }
.dnav-group.grp-tournage .dnav-glabel { transform: rotate(-1deg); clip-path: polygon(0 8%, 6% 0, 45% 6%, 95% 0, 100% 12%, 98% 48%, 100% 94%, 55% 100%, 4% 92%, 0 100%, 2% 52%); }
.dnav-group.grp-post .dnav-glabel { transform: rotate(1.5deg); }
.dnav-glabel .dnav-swatch { display: none; }
.dnav-now { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--ink); background: rgba(255, 255, 255, 0.62); border-radius: var(--r-pill); padding: 0 7px; white-space: nowrap; }
.dnav-swatch { width: 8px; height: 22px; background: var(--tape); border-radius: 4px; }
.dnav-list { list-style: none; display: grid; }
.dnav-list li + li .dnav-link { border-top: 1px solid var(--line); }
.dnav-link {
  position: relative; display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); margin: 0 8px; padding: 6px 4px 6px 14px;
  text-decoration: none; color: var(--ink); font-weight: 400; line-height: 1.25; -webkit-tap-highlight-color: transparent;
}
.dnav-link:hover { background: var(--wash); border-radius: var(--r-sm); }
.dnav-list li + li .dnav-link:hover { border-radius: 0 0 var(--r-sm) var(--r-sm); }
/* « Tu es ici » : trait bleu de 4 px à gauche de la section active, texte en gras, sans fond ni contour. */
.dnav-link[aria-current='page'] { font-weight: 700; }
.dnav-link[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: var(--here); }
.dnav-ico { display: none; }
.dnav-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* Compteurs : petites étiquettes arrondies (moutarde : à régler ; rouge pâle : bloquant ; vert : fait). */
.dnav-count {
  flex: none; margin-left: auto; padding: 1px 8px; border-radius: var(--r-xs); background: var(--wash); color: var(--ink-2);
  font-size: 13px; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums;
}
.dnav-count.is-warn { background: var(--todo); color: var(--ink); }
.dnav-count.is-crit { background: var(--critical-soft); color: var(--critical); }
.dnav-count.is-ok { background: var(--ok-soft); color: var(--ok); }

/* Téléphone : barre « Sommaire » (pilule blanche) + précédent / suivant ronds ; sommaire complet en plein écran. */
.pbar-wrap { display: none; }
.pbar { display: flex; align-items: center; gap: var(--s2); padding: 6px 0; }
.pbar-open {
  flex: 1 1 auto; min-width: 0; min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 14px;
  border: 0; border-radius: 26px; background: var(--card); box-shadow: var(--shadow-raised); color: var(--ink); text-align: left;
  -webkit-tap-highlight-color: transparent; transition: transform 0.08s ease;
}
.pbar-open:active { transform: translateY(1px); }
.pbar-open .dnav-swatch { flex: none; }
.pbar-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.pbar-kicker { font-size: 13px; color: var(--ink-2); }
.pbar-pos { font-variant-numeric: tabular-nums; }
.pbar-pos:not(:empty)::before { content: ' · '; }
.pbar-label { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pbar-chev { flex: none; width: 20px; height: 20px; stroke-width: 2.25; }
.pbar-step { flex: none; width: 46px; height: 46px; background: var(--card); box-shadow: var(--shadow-raised); color: var(--ink); }
.pbar-step:hover { background: var(--card); }
.pbar-step .ico { stroke-width: 2.25; }
.pbar-step.is-off { background: var(--off); box-shadow: var(--shadow-press); color: var(--on-off); }
dialog.sommaire { width: min(440px, calc(100% - 16px)); max-height: calc(100% - 24px); background: var(--bg) var(--bg-grain); }
.sommaire-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s4) 18px; }
.sommaire-titles { display: grid; gap: 2px; min-width: 0; }
.sommaire-title { font-size: 30px; font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
.sommaire-sub { font-size: var(--fs-md); color: var(--ink-2); overflow-wrap: anywhere; }
.sommaire-close { margin-left: auto; flex: none; width: 48px; height: 48px; background: var(--card); box-shadow: var(--shadow-raised); color: var(--ink); }
.sommaire-close:hover { background: var(--card); }
.dnav-sheet { padding: 14px var(--s4) var(--s5); }

@media (max-width: 999px) {
  .dlayout { grid-template-columns: 1fr; gap: 0; margin-top: 0; }
  .dside { display: none; }
  .pbar-wrap { display: block; position: sticky; top: var(--topbar-h, 61px); z-index: 12; background: var(--bg) var(--bg-grain); margin: 0 calc(-1 * var(--s4)) var(--s2); padding: 0 var(--s4); transition: top 0.15s ease; }
  /* Barre du haut masquée (autohide.js) : la barre « Sommaire » monte tout en haut. */
  html.bar-hidden .pbar-wrap { top: 0; }
  /* Toujours de quoi faire monter une section courte sous la barre « Sommaire » : elle ne bouge pas d'une section à l'autre. */
  /* --app-h : la hauteur de la fenêtre au démarrage ou après une rotation, pas quand le clavier s'ouvre (platform.js). */
  .dmain { min-height: calc(100vh - var(--topbar-h, 61px)); min-height: calc(var(--app-h, 100dvh) - var(--topbar-h, 61px)); }
  /* Le sommaire s'ouvre en plein écran, sur le fond gris (plus de boîte blanche sur fond noir). */
  dialog.sommaire {
    inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border-radius: 0; box-shadow: none; overflow: auto;
    overscroll-behavior: contain;
  }
  dialog.sommaire::backdrop { background: var(--bg) var(--bg-grain); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sommaire-head { position: sticky; top: 0; z-index: 2; background: var(--bg) var(--bg-grain); }
  .sommaire-head, .dnav-sheet { max-width: 560px; margin-inline: auto; }
}

/* En-tête de section : la bande de l'étape porte le nom du document. */
.shead { margin-bottom: var(--s5); }
.shead-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.shead-tape { font-size: var(--fs-xl); }
.shead-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.shead-desc { margin-top: var(--s2); color: var(--ink-2); max-width: 64ch; }
.hidden-section .btn { margin-top: var(--s1); }

@media (max-width: 560px) {
  .shead-tape { font-size: var(--fs-lg); }
}

/* ---------- Vue d'ensemble ---------- */
.overview > * + * { margin-top: var(--s5); }

/* Le bloc du moment : une feuille blanche rangée dans une chemise de la couleur de l'étape, ombre plus marquée. */
.hero { position: relative; filter: drop-shadow(var(--shadow-folder)); }
.hero-tab {
  display: inline-flex; align-items: center; max-width: 100%; min-height: 36px; margin: 0; padding: 4px 18px;
  border-radius: var(--r-tab) var(--r-tab) 0 0; background: var(--tape); color: var(--on-tape); font-size: 16px; font-weight: 700; line-height: 1.2;
}
.hero-folder { background: var(--tape); border-radius: 0 var(--r-xl) var(--r-xl) var(--r-xl); padding: 6px 7px 8px; margin-top: -1px; }
.hero-sheet { background: var(--card); border-radius: 18px; padding: var(--s4); box-shadow: var(--shadow-sheet); container-type: inline-size; }
/* Compte à rebours en très grand ; la date et le rendez-vous à côté, ou dessous quand la place manque :
   jamais l'un sur l'autre, jamais hors de la carte. */
.hero-when { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px var(--s4); }
.hero-count {
  flex: none; margin: 0; padding-top: 0.06em; font-size: clamp(64px, 20vw, 92px); font-weight: 700; line-height: 0.8;
  letter-spacing: -0.05em; white-space: nowrap;
}
.hero-count.is-word { font-size: clamp(46px, 14vw, 68px); letter-spacing: -0.04em; }
.hero-count.is-late { color: var(--critical); }
.hero-date { flex: 0 1 auto; width: max-content; max-width: 100%; display: flex; flex-direction: column; gap: 2px; margin: 0; padding-bottom: 1px; }
.hero-day { font-size: 19px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.hero-rdv { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hero-late { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.hero-big { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.hero-done { display: flex; align-items: center; gap: var(--s3); }
.hero-done-ico { width: 44px; height: 44px; padding: 9px; border-radius: 50%; background: var(--tape); color: var(--ink); stroke-width: 2.5; }
.hero-sub { margin-top: var(--s2); color: var(--ink-2); }
.hero-place { margin-top: var(--s3); color: var(--ink); }
.hero-meter { margin-top: var(--s3); }
.hero-actions { display: grid; gap: var(--s3); margin-top: var(--s4); }
.hero-main { min-height: 50px; font-size: 17px; }
/* Les autres boutons côte à côte : chacun à la largeur de son nom, sur une ligne à lui quand ils ne tiennent pas. */
.hero-more { display: flex; flex-wrap: wrap; gap: 10px var(--s2); }
.hero-more > .btn { flex: 1 1 auto; max-width: 100%; white-space: normal; text-align: center; }
.nownext { margin-top: var(--s3); display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--r-md); background: var(--tint); }
.nownext p { display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: var(--s2); align-items: baseline; }
.nn-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.nn-what { font-weight: 600; overflow-wrap: anywhere; }
.nn-time { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Sur une carte large (ordinateur), les boutons passent dans une colonne à droite. */
@container (min-width: 600px) {
  .hero-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 300px); column-gap: var(--s6); align-items: start; }
  .hero-body > * { grid-column: 1; }
  .hero-body > .hero-actions { grid-column: 2; grid-row: 1 / span 8; margin-top: 0; }
}

.hero-meter .meter { color: var(--ink-2); font-size: var(--fs-sm); }
.hero-meter .meter-bar { width: 120px; }
/* Feuille étroite : le libellé de la jauge au-dessus, la jauge sur toute la largeur. */
@container (max-width: 420px) {
  .hero-meter .meter { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 6px; }
  .hero-meter .meter-bar { width: 100%; }
}

/* Étape du projet : rail creusé, un segment par étape (fait, en cours, à venir), tête de lecture bleue. */
.stepper { list-style: none; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 3px; padding: 0 2px; }
.stepper::before {
  content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 14px; border-radius: 8px;
  background: var(--rail); box-shadow: inset 0 2px 3px rgba(107, 64, 40, 0.22);
}
.step { position: relative; min-width: 0; }
.step-btn {
  position: relative; width: 100%; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  margin: 0; padding: 40px 2px 6px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); text-align: center;
  font-size: 13px; line-height: 1.15; -webkit-tap-highlight-color: transparent;
}
button.step-btn:hover .step-label { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.step-seg { position: absolute; left: 0; right: 0; top: 12px; height: 10px; border-radius: 5px; }
.step.is-done .step-seg { background: var(--rail-done); }
.step.is-current .step-seg { background: var(--rail-now); }
/* Tête de lecture : trait bleu et rond blanc cerclé de bleu, ombré. */
.step.is-current .step-seg::before { content: ''; position: absolute; left: 50%; top: -12px; width: 3px; height: 34px; margin-left: -1.5px; border-radius: 2px; background: var(--here); }
.step.is-current .step-seg::after {
  content: ''; position: absolute; left: 50%; top: -6px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--here); box-shadow: 0 2px 5px rgba(107, 64, 40, 0.3);
}
.step-label { max-width: 100%; overflow-wrap: anywhere; hyphens: manual; }
.step.is-current .step-label { color: var(--ink); font-weight: 700; }

.ov-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.ov-cols > div > .sec:first-child { margin-top: 0; }
@media (max-width: 860px) { .ov-cols { grid-template-columns: 1fr; gap: 0; } .ov-cols > div + div > .sec:first-child { margin-top: var(--s6); } }
.ov-card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 4px var(--s4); }

/* Alertes : carte blanche avec une étiquette (le mot dit l'état, la couleur l'appuie). */
.alerts { display: grid; gap: 10px; }
.alert {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); align-items: center;
  padding: 10px 14px 10px 10px; border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow-card); font-size: var(--fs-md);
}
.alert-tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--r-xs); font-size: 13px; font-weight: 700;
  line-height: 1.3; white-space: nowrap;
}
.alert-tag.is-todo { background: var(--todo); color: var(--ink); box-shadow: 0 2px 0 var(--todo-edge); }
.alert-tag.is-crit { background: var(--critical-soft); color: var(--critical); box-shadow: 0 2px 0 var(--critical-edge); }
.alert-text { min-width: 0; overflow-wrap: anywhere; }
/* Téléphone : l'étiquette ouvre la première ligne, le texte prend toute la largeur. */
@media (max-width: 560px) {
  .alert { display: block; padding: 10px 14px; }
  .alert-tag { margin-right: var(--s2); vertical-align: 1px; }
}
.alert-who { font-weight: 700; }
.alert-link { font-weight: 700; text-underline-offset: 2px; }

/* Points de contrôle : dans une chemise grise. */
.checkpoints { list-style: none; display: grid; padding: 2px 14px; }
/* Le libellé garde au moins la moitié de la ligne ; un détail long passe à la ligne dans sa colonne. */
.cp { display: grid; grid-template-columns: 26px minmax(50%, 1fr) minmax(0, auto); gap: var(--s3); align-items: center; min-height: var(--tap); padding: 6px 0; border-top: 1px solid var(--line); }
.cp:first-child { border-top: 0; }
.cp-state { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; }
.cp-state .ico { width: 15px; height: 15px; stroke-width: 2.5; }
.cp.is-ok .cp-state { background: var(--ok-soft); color: var(--ok); }
.cp.is-warn .cp-state { background: var(--todo); color: var(--ink); }
.cp.is-todo .cp-state { border: 2px dashed var(--field-edge); color: var(--ink-2); }
.cp-label { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.cp-label:hover { text-decoration: underline; text-underline-offset: 2px; }
.cp.is-ok .cp-label { color: var(--ink-2); font-weight: 400; }
.cp-detail { font-size: var(--fs-sm); color: var(--ink-2); text-align: right; }
.cp.is-warn .cp-detail { color: var(--ink); font-weight: 600; }

.upcoming { list-style: none; display: grid; }
.up { display: grid; grid-template-columns: 92px 20px minmax(0, 1fr) auto; gap: var(--s2); align-items: center; min-height: var(--tap); padding: 8px 0; border-top: 1px solid var(--line); }
.up:first-child { border-top: 0; }
.up-date { display: grid; font-variant-numeric: tabular-nums; }
.up-day { font-weight: 700; font-size: var(--fs-sm); }
.up-time { font-size: var(--fs-xs); color: var(--ink-2); }
.up-ico { width: 18px; height: 18px; color: var(--ink-2); }
.up-label { text-decoration: none; overflow-wrap: anywhere; }
.up-label:hover { text-decoration: underline; text-underline-offset: 2px; }
.up.is-late .up-day { color: var(--critical); }
.up.is-done .up-label { color: var(--ink-3); text-decoration: line-through; }
.team-mini { list-style: none; display: grid; }
.team-mini li { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 6px 0; border-top: 1px solid var(--line); }
.team-mini li:first-child { border-top: 0; }

/* ---------- Planning (rétro-planning) ---------- */
.ico-sm { width: 15px; height: 15px; vertical-align: -2px; margin-right: 2px; }
.planning-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
/* Filtres : pilules ; celle qui est choisie a un contour bleu, un fond bleu pâle et son texte en gras. */
.fchip { position: relative; min-height: 38px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: var(--card); font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); }
.fchip::before { content: ''; position: absolute; inset: -3px 0; }
.fchip:hover { border-color: #b3bbc8; color: var(--ink); }
.fchip[aria-pressed='true'] { background: var(--select-soft); border-color: var(--here); color: var(--ink); font-weight: 700; }
.pweek + .pweek { margin-top: var(--s5); }
.pweek-title { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-lg); font-weight: 700; padding-bottom: var(--s2); border-bottom: 2px solid var(--line-strong); }
.chip-now { flex: none; font-size: var(--fs-xs); font-weight: 700; background: var(--today-bg); color: var(--today-ink); border-radius: var(--r-xs); padding: 1px 8px; white-space: nowrap; }
.pday { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.pday.is-today { background: linear-gradient(90deg, #e3edfb, transparent 70%); border-radius: var(--r-sm); }
.pday-head { display: grid; align-content: start; gap: 2px; padding-top: 10px; }
.pday-date { font-weight: 700; }
.pday-rel { justify-self: start; font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; background: var(--tape-tournage); padding: 0 7px; border-radius: var(--r-xs); }
.prows { list-style: none; display: grid; }
.prow { display: grid; grid-template-columns: 48px 44px minmax(0, 1fr) auto; gap: var(--s2); align-items: start; padding: 4px 0; }
.prow-when { padding-top: 11px; font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prow-check { margin: 0; }
.prow-ev-ico { display: grid; place-items: center; width: var(--tap); height: 40px; color: var(--ink-3); }
.prow-main { min-width: 0; padding-top: 9px; display: grid; gap: 2px; }
.prow-text { font-weight: 600; overflow-wrap: anywhere; cursor: pointer; }
a.prow-text { font-weight: 500; text-decoration: none; color: var(--ink-2); }
a.prow-text:hover { text-decoration: underline; }
.prow.is-done .prow-text { text-decoration: line-through; color: var(--ink-3); }
.prow.is-late .pday-date, .prow.is-late .prow-when { color: var(--critical); }
.prow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); font-size: var(--fs-sm); color: var(--ink-2); }
.prow-meta .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.chip-phase { font-size: var(--fs-xs); color: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 7px; }
.ev-tournage .prow-text { font-weight: 700; color: var(--ink); }
.ev-tournage .prow-ev-ico { color: var(--ink); }
@media (max-width: 640px) {
  .pday { grid-template-columns: 1fr; gap: 0; }
  .pday-head { grid-auto-flow: column; justify-content: start; align-items: center; gap: var(--s2); padding-top: 4px; }
  .prow { grid-template-columns: 40px 44px minmax(0, 1fr); }
  .prow .le-tools { grid-column: 3; justify-content: flex-start; margin-top: -4px; }
}

/* ---------- Fiches (lieux, autorisations, contacts) ---------- */
.fold { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.fold + .fold, .le-fields > .fold { margin-top: 2px; }
.fold-title { cursor: pointer; padding: 10px var(--s3); font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); }
.fold-title::-webkit-details-marker { display: none; }
.fold-title::before { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.fold[open] > .fold-title::before { transform: rotate(45deg); }
.fold[open] > .fold-title { color: var(--ink); border-bottom: 1px solid var(--line); }
.fold-body { display: grid; gap: var(--s2); padding: var(--s3); }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s4); }
.toc-link { font-size: var(--fs-sm); font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); background: var(--wash); text-decoration: none; }
.toc-link:hover { background: var(--tint, var(--wash)); text-decoration: underline; }

.lieux { display: grid; gap: var(--s5); }
.lieu { border-radius: var(--r-lg); padding: var(--s4) var(--s5); display: grid; gap: var(--s4); scroll-margin-top: 120px; background: var(--card); box-shadow: var(--shadow-card); }
@media (max-width: 560px) { .lieu { padding: var(--s4); } }
.lieu-head { display: grid; gap: var(--s2); }
.lieu-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.lieu-name { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.015em; }
.lieu-address { color: var(--ink-2); }
.lieu-address a { font-size: var(--fs-sm); font-weight: 600; margin-left: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s3) var(--s5); }
.fact-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--s2); align-items: start; }
.fact-ico { color: var(--ink-3); padding-top: 2px; }
.fact-ico .ico { width: 18px; height: 18px; }
.fact-label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); }
.fact-value { overflow-wrap: anywhere; }
.figure { margin: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--wash); }
.figure img { width: 100%; max-height: 460px; object-fit: contain; background: #fff; }
.figure figcaption { padding: 6px var(--s3); font-size: var(--fs-sm); color: var(--ink-2); }
.lieu-notes { border-left: 3px solid var(--tape-prepa); padding-left: var(--s3); }
.lieu-links { padding-top: var(--s2); border-top: 1px solid var(--line); }
.lieu-links a { text-decoration: none; }
.thumbs-lg .thumb { width: 168px; }
.thumbs-lg .thumb img { width: 168px; height: 112px; }

.auths { display: grid; gap: var(--s3); }
.auth { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s3); align-items: start; border-left: 6px solid var(--line-strong); border-radius: var(--r-lg); padding: var(--s3) var(--s4); background: var(--card); box-shadow: var(--shadow-card); }
.auth.is-demandee { border-left-color: #e3a008; }
.auth.is-obtenue { border-left-color: var(--ok); }
.auth.is-refusee { border-left-color: var(--critical); background: var(--critical-soft); }
.auth.is-inutile { opacity: 0.75; }
.auth-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--wash); }
.auth-main { display: grid; gap: 4px; min-width: 0; }
.auth-kind { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); }
.auth-title { font-size: var(--fs-lg); font-weight: 700; }
.auth-status .status-select select, .auth-status select { min-height: 38px; font-size: var(--fs-sm); }
.spec.late { background: var(--critical-soft); color: var(--critical); font-weight: 600; }
@media (max-width: 600px) { .auth { grid-template-columns: 1fr; } .auth-ico { display: none; } }

.contacts { display: grid; border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
.contact { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 10px var(--s4); border-top: 1px solid var(--line); }
.contact:first-child { border-top: 0; }
.contact-cat { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); }
.contact-ways { display: flex; flex-wrap: wrap; gap: var(--s3); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .contact { grid-template-columns: 1fr; gap: 2px; } }
.client-line { margin-bottom: var(--s2); font-size: var(--fs-lg); }
.kind-line { font-size: var(--fs-md); }
.depts { display: grid; gap: var(--s4); }
.dept-title { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.team-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s3); justify-content: flex-end; font-variant-numeric: tabular-nums; }
/* Téléphone : le nom et le poste sur toute la largeur, téléphone et accès dessous. */
@media (max-width: 520px) {
  .table-row.team-row { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .team-row .team-meta { justify-content: flex-start; }
}
.sections-ed { display: grid; gap: var(--s3); }
.field-btn { align-content: end; }
.sections-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); }
/* fieldset.plain retire bordure et marges : le groupe les reprend, une case par ligne, la légende au-dessus de la bande. */
fieldset.sections-group { margin: 0; min-width: 0; border: 0; border-top: 6px solid var(--tape); border-radius: var(--r-md); padding: var(--s2) var(--s3) var(--s3); background: var(--card); box-shadow: var(--shadow-card); }
fieldset.sections-group > legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; }
.sections-group > .check { display: flex; clear: both; min-height: 40px; }
.stack-lg > * + * { margin-top: var(--s6); }

/* ---------- Moodboard ---------- */
.mood > * + * { margin-top: var(--s5); }
.mood-note .rt { font-size: var(--fs-xl); line-height: 1.45; letter-spacing: -0.01em; max-width: 60ch; }
.swatches-lg { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--s3); }
.swatch-card { display: grid; gap: 2px; border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; padding-bottom: var(--s2); background: var(--card); }
.swatch-block { display: block; height: 84px; background: var(--sw, var(--off)); margin-bottom: var(--s2); }
.swatch-name { padding: 0 var(--s3); font-weight: 700; }
.swatch-hex { padding: 0 var(--s3); font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.swatch-chip { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--sw, var(--off)); border: 1px solid rgba(107, 64, 40, 0.2); vertical-align: middle; }
.mood-grid { columns: 3 220px; column-gap: var(--s3); }
.mood-img { break-inside: avoid; margin: 0 0 var(--s3); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-card); background: var(--card); }
.mood-img img { width: 100%; height: auto; }
.mood-img figcaption { padding: 6px var(--s3); font-size: var(--fs-sm); color: var(--ink-2); }
.mood-grid-ed .mood-img { padding-bottom: var(--s2); }
.mood-grid-ed .field, .mood-grid-ed .btn { margin: var(--s2) var(--s3) 0; }
.mood-missing { padding: var(--s5); color: var(--ink-3); text-align: center; }
.in-color { padding: 4px; height: var(--tap); cursor: pointer; }

/* ---------- Intervenants par catégorie ---------- */
.people-group + .people-group { margin-top: var(--s6); }
.people-group-title { display: flex; gap: var(--s2); align-items: baseline; font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--s3); }
.pcard-role { font-weight: 600; font-size: var(--fs-sm); }
.pcard-contact { color: var(--ink-3); overflow-wrap: anywhere; }

/* ---------- Découpage : séquences, storyboard, séquences par décor ---------- */
.fx-int_jour { --strip: var(--strip-int-jour); }
.fx-ext_jour { --strip: var(--strip-ext-jour); }
.fx-int_nuit { --strip: var(--strip-int-nuit); }
.fx-ext_nuit { --strip: var(--strip-ext-nuit); }
.viewbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s4); margin-bottom: var(--s5); }
.seqblock { border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--card); }
.seqblock + .seqblock { margin-top: var(--s4); }
.seqblock-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--s3); align-items: center; padding: var(--s3) var(--s4); background: var(--strip, var(--wash)); border-bottom: 1px solid var(--line-strong); }
.seqblock-head .specs { grid-column: 1 / -1; }
.seq-num { font-weight: 700; font-size: var(--fs-sm); background: var(--card); color: var(--ink); border: 1.5px solid var(--ink-2); border-radius: var(--r-xs); padding: 1px 8px; font-variant-numeric: tabular-nums; }
.seq-title { font-size: var(--fs-lg); font-weight: 700; }
.seq-notes { padding: var(--s3) var(--s4) 0; color: var(--ink-2); }
.seq-empty { padding: var(--s3) var(--s4); }
.seqblock .shots { border: 0; border-radius: 0; }
.fx-chip { background: var(--strip); border: 1px solid rgba(0, 0, 0, 0.12); color: var(--ink); font-weight: 600; }
.shot.has-thumb { grid-template-columns: auto minmax(0, 1fr) auto 96px; }
.shot.has-thumb .shot-thumb { grid-column: 4; }
.shot-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-xs); border: 1px solid var(--line); }
.shot-framing { display: flex; flex-wrap: wrap; gap: 4px; }
.shot-framing .spec { font-size: var(--fs-xs); padding: 1px 6px; }
.shot-extra { font-size: var(--fs-sm); color: var(--ink-2); }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s4); }
.frame { margin: 0; display: grid; gap: var(--s2); }
.frame-img { aspect-ratio: 16 / 9; border: 2px solid var(--ink-2); border-radius: var(--r-sm); background: var(--card); display: grid; place-items: center; overflow: hidden; }
.frame-img img { width: 100%; height: 100%; object-fit: cover; }
.frame-num { font-size: var(--fs-3xl); font-weight: 700; color: var(--line-strong); }
.frame figcaption { display: grid; gap: 2px; font-size: var(--fs-sm); }
.frame-ref { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); }
.frame.is-done .frame-img { opacity: 0.55; }
.decors { display: grid; gap: var(--s5); }
.decor-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.decor-head h3 { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-lg); }
.decor-total { font-weight: 700; font-variant-numeric: tabular-nums; background: var(--wash); border-radius: var(--r-pill); padding: 2px 10px; }
.decor-table tr[class^='fx-'] td:first-child, .decor-table tr[class*=' fx-'] td:first-child { box-shadow: inset 6px 0 0 var(--strip); }
.decor-table tr.fx-ext_jour td, .decor-table tr.fx-int_nuit td, .decor-table tr.fx-ext_nuit td { background: var(--strip); }
.num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.minutage-total { margin-top: var(--s2); font-size: var(--fs-lg); font-weight: 700; text-align: right; }
.roles-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.decor-table { display: table; }
@media (max-width: 640px) { .decor-table { display: block; overflow-x: auto; } .shot.has-thumb { grid-template-columns: auto minmax(0, 1fr) auto; } .shot.has-thumb .shot-thumb { grid-column: 2; } }

/* Déroulé : séquence tournée pendant un créneau */
.tl-seq { margin-top: var(--s2); border-left: 6px solid var(--strip, var(--line-strong)); background: var(--wash); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 6px var(--s3); }
.tl-seq-head { font-size: var(--fs-sm); }
.tl-shots { margin-top: 4px; padding-left: 1.1em; list-style: square; font-size: var(--fs-sm); }
.tl-shots li.is-done { text-decoration: line-through; color: var(--ink-3); }

/* ---------- Plan de feu ---------- */
.setups { display: grid; gap: var(--s6); }
.setup { display: grid; gap: var(--s3); }
.setup-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.setup-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.015em; }
.setup-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
@media (max-width: 900px) { .setup-body { grid-template-columns: 1fr; } }
.setup-side { display: grid; gap: var(--s3); min-width: 0; }
.setup-side .p-table { display: block; overflow-x: auto; }
.setup-note { border-left: 3px solid var(--tape-prepa); padding-left: var(--s3); }
.plot-wrap { border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; background: #fff; }
.plot { display: block; width: 100%; height: auto; }
.plot-bg { fill: #fdfdfb; }
.grid-line { fill: none; stroke: var(--line); stroke-width: 1.5; }
.hatch { stroke: #c9a891; stroke-width: 3; }
.plot .beam { fill: rgba(255, 212, 59, 0.28); stroke: rgba(201, 160, 0, 0.35); stroke-width: 1.5; }
.plot .beam-soft { fill: rgba(255, 212, 59, 0.16); }
.plot .glow { fill: rgba(255, 212, 59, 0.3); }
.plot .body-light { fill: #ffd43b; stroke: var(--ink); stroke-width: 3; }
.plot .body-dark { fill: var(--ink); }
.plot .body-sun { fill: #ffb703; stroke: var(--ink); stroke-width: 3; }
.plot .ray { stroke: #e09f00; stroke-width: 5; stroke-linecap: round; }
.plot .arrow { stroke: #e09f00; stroke-width: 5; stroke-dasharray: 10 8; }
.plot .arrow-head { fill: #e09f00; }
.plot .window { fill: #fff; stroke: #4e68a3; stroke-width: 4; }
.plot .reflector { fill: none; stroke: var(--field-edge); stroke-width: 9; stroke-linecap: round; }
.plot .flag { fill: var(--ink); }
.plot .diffusion { fill: #fff; stroke: var(--ancien); stroke-width: 3; stroke-dasharray: 6 5; }
.plot .fov { fill: rgba(78, 104, 163, 0.08); stroke: #4e68a3; stroke-width: 2; stroke-dasharray: 8 6; }
.plot .shoulders { fill: #a5d8ff; stroke: var(--ink); stroke-width: 3; }
.plot .head { fill: #e7f4ff; stroke: var(--ink); stroke-width: 3; }
.plot .nose { fill: var(--ink); }
.plot .decor { fill: url(#plot-hatch); stroke: var(--ancien); stroke-width: 3; }
.plot .badge-n circle { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.plot .badge-n text { font: 700 16px var(--font); fill: var(--ink); }
.plot.is-editable .lx { cursor: grab; touch-action: none; }
.plot.is-editable .lx.is-dragging { cursor: grabbing; }
.plot .lx:focus { outline: none; }
/* Élément choisi ou atteint au clavier : le bleu « tu es ici », plus de pastille noire. */
.plot .lx:focus .badge-n circle, .plot .lx.is-selected .badge-n circle { fill: var(--here); stroke: #fff; stroke-width: 4; }
.plot .lx:focus .badge-n text, .plot .lx.is-selected .badge-n text { fill: #fff; }
.plot-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.plot-palette .btn { min-height: 36px; font-size: var(--fs-xs); padding: 0 12px; }
.le-item.is-selected { border-color: var(--here); box-shadow: inset 4px 0 0 var(--tape-prepa), var(--shadow-card); }
.setup-ed > .le { margin-top: var(--s2); }
.plot .badge-n text { font-size: 22px; }
.plot-legend { list-style: none; display: grid; gap: 2px; }
.lg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: var(--s2); align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lg-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.lg.is-light .lg-n { background: var(--tape-prepa); }
.lg-main { display: grid; gap: 4px; min-width: 0; }
.lg-note { font-size: var(--fs-sm); color: var(--ink-2); }
.seqblock .shots { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.seqblock .shot { border-right: 0; }

/* ---------- Feuille de service ---------- */
.day-chips { margin-bottom: var(--s4); }
.fchip.is-removed { border-style: dashed; color: var(--warning); }
.notice-warn { background: var(--warning-soft); color: var(--warning); font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s4); }
.fds { border-radius: var(--r-xl); padding: var(--s5); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); background: var(--card); box-shadow: var(--shadow-card); }
.fds > .sec { margin-top: var(--s2); }
.fds-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2); padding-bottom: var(--s3); border-bottom: 2px solid var(--line-strong); }
.fds-day { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; }
.fds-date { font-size: var(--fs-lg); font-weight: 600; color: var(--ink-2); }
.fds-times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.fds-time { background: var(--tint-tournage); border-radius: var(--r-md); padding: var(--s3); display: grid; gap: 2px; border-top: 6px solid var(--tape-tournage); }
.fds-time.is-empty { background: var(--wash); border-top-color: var(--line-strong); }
.fds-time-label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.fds-time-value { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fds-time.is-empty .fds-time-value { font-size: var(--fs-md); color: var(--ink-3); font-weight: 600; }
@media (max-width: 560px) { .fds { padding: var(--s3); } .fds-times { grid-template-columns: 1fr 1fr; } }
.fds-rdv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s4); font-size: var(--fs-lg); }
.fds-weather { color: var(--ink-2); font-size: var(--fs-md); }
.fds-note .rt { font-size: var(--fs-md); }
.fds-lieux { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.fds-lieu { border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: var(--s3); display: grid; gap: 4px; }
.fds-lieu-name { font-weight: 700; font-size: var(--fs-lg); }
.fds-nearby { color: var(--critical); }
.fds-table { display: table; }
@media (max-width: 760px) { .fds-table { display: block; overflow-x: auto; } }
.fds-prog { list-style: none; display: grid; }
.fds-prog li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.fds-prog li.is-milestone { background: var(--marker-soft); }
.fds-prog-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.fds-contacts { list-style: none; display: grid; gap: 4px; }
.fds-tel { margin-left: var(--s3); font-variant-numeric: tabular-nums; }
.fds-shots { color: var(--ink-2); }
.fds-urgences { font-weight: 700; color: var(--critical); border-top: 1px solid var(--line); padding-top: var(--s3); }
.fds-ed-day { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--s3); }
.call-name { padding-top: 4px; }
.offload td { vertical-align: middle; }

/* ---------- Livrables : versions et retours client ---------- */
.versions { border-top: 1px solid var(--line); padding-top: var(--s2); display: grid; gap: var(--s2); }
.version-list { list-style: none; display: grid; gap: var(--s2); }
.version { border-left: 4px solid var(--line-strong); padding: 4px 0 4px var(--s3); }
.version.is-envoyee { border-left-color: #e3a008; }
.version.is-validee { border-left-color: var(--ok); }
.version-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); }
.version-label { font-variant-numeric: tabular-nums; }
.version-head .le-tools { margin-left: auto; }
.version-head .icon-btn { width: 36px; height: 36px; }
.version-feedback { margin-top: 4px; color: var(--ink-2); font-size: var(--fs-sm); }
.versions-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }

/* ---------- Accueil : à venir pour toi, recherche, étapes ---------- */
.agenda { border-radius: var(--r-lg); padding: var(--s3) var(--s4) var(--s2); margin-bottom: var(--s5); background: var(--card); box-shadow: var(--shadow-card); }
.agenda-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--s2); }
.agenda-list { display: grid; }
.agenda-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 2px var(--s4);
  min-height: 48px; padding: 6px 0 6px var(--s3); border-top: 1px solid var(--line); border-left: 6px solid var(--tape);
  text-decoration: none; color: inherit;
}
.agenda-list > .agenda-row:first-child { border-top: 0; }
.agenda-row:hover .agenda-label { text-decoration: underline; }
.agenda-when { display: flex; flex-wrap: wrap; gap: 0 var(--s2); font-weight: 600; font-variant-numeric: tabular-nums; }
.agenda-time { color: var(--ink-2); }
.agenda-what { display: grid; min-width: 0; }
.agenda-label { font-weight: 600; overflow-wrap: anywhere; }
.agenda-dossier { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.agenda-kind { font-size: var(--fs-xs); font-weight: 700; color: var(--on-tape); background: var(--tape); border-radius: var(--r-xs); padding: 2px 9px; white-space: nowrap; }
.agenda-more { border-top: 1px solid var(--line); }
.agenda-more > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--ink-2); }
.agenda-more[open] > summary { border-bottom: 1px solid var(--line); }
@media (max-width: 640px) {
  .agenda { padding: var(--s3); }
  .agenda-row { grid-template-columns: minmax(0, 1fr) auto; }
  .agenda-when { grid-column: 1 / -1; font-size: var(--fs-sm); }
}
.home-search { position: relative; max-width: 420px; margin-bottom: var(--s5); }
.home-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.home-search .in { padding-left: 40px; }
.group-swatch { width: 8px; height: 22px; background: var(--tape); border-radius: 4px; align-self: center; flex: none; }
.drow-sub { display: flex; flex-wrap: wrap; gap: 2px var(--s2); }
.drow-kind { font-weight: 600; color: var(--ink); }
.drow-until { font-weight: 600; color: var(--ink); }

/* ---------- Nouveau dossier : type de prestation ---------- */
.kinds .field-hint { margin: 0 0 var(--s2); }
.kind-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s2); }
.choice .kind-card { height: 100%; }
.choice input { flex: none; }
.agenda-more > summary { list-style: none; gap: var(--s2); }
.agenda-more > summary::-webkit-details-marker { display: none; }
.agenda-more > summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.agenda-more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }

/* Clavier ouvert : les barres collées se libèrent pour laisser voir le champ. Sous 560 px de haut ; et au doigt, dès
   qu'un champ de texte a le focus, quelle que soit la hauteur (cases, choix et dates n'ouvrent pas le clavier). */
@media (max-height: 560px) {
  .topbar, .pbar-wrap, .tabs, .editbar { position: static; }
  html.bar-hidden .topbar, .topbar { transform: none; }
}
@media (pointer: coarse) {
  html:has(:is(textarea, [contenteditable='true'], input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit'], [type='reset'], [type='date'], [type='time'], [type='datetime-local'], [type='month'], [type='week'])):focus) :is(.topbar, .pbar-wrap, .tabs, .editbar) { position: static; transform: none; }
}

/* ---------- Rétroplanning : Gantt de tous les projets et du collectif, vue agenda ---------- */
.ph-dossier { --tape: var(--tape-dossier); --on-tape: var(--on-tape-dossier); --edge: var(--edge-dossier); --tint: var(--tint-dossier); --pale: var(--pale-dossier); }
.ph-prepa { --tape: var(--tape-prepa); --on-tape: var(--on-tape-prepa); --edge: var(--edge-prepa); --tint: var(--tint-prepa); --pale: var(--pale-prepa); }
.ph-tournage { --tape: var(--tape-tournage); --on-tape: var(--on-tape-tournage); --edge: var(--edge-tournage); --tint: var(--tint-tournage); --pale: var(--pale-tournage); }
.ph-post { --tape: var(--tape-post); --on-tape: var(--on-tape-post); --edge: var(--edge-post); --tint: var(--tint-post); --pale: var(--pale-post); }
.ph-collectif { --tape: var(--tape-collectif); --on-tape: var(--on-tape-collectif); --edge: var(--edge-collectif); --tint: var(--tint-collectif); --pale: var(--pale-collectif); }
.page-lead { margin-top: 4px; color: var(--ink-2); }
/* Choix exclusif (Gantt | Agenda, échelles) : un rail creusé ; le choix en cours est une touche blanche en relief. */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--rail); box-shadow: var(--shadow-press); }
.seg-btn { position: relative; min-height: 38px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
.seg-btn::before { content: ''; position: absolute; inset: -3px 0; } /* cible de 44 px */
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed='true'] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-raised); }
.retro-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.retro-who { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.retro-who .field-label { margin: 0; }
.retro-who .dd { min-width: 170px; }
.retro-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px var(--s4); margin-bottom: var(--s3); font-size: var(--fs-sm); color: var(--ink-2); }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-sw { width: 22px; height: 10px; border-radius: 2px; background: var(--tape); }
.lg-item:is(.ph-prepa, .ph-tournage, .ph-post, .ph-collectif) .lg-sw { box-shadow: 0 0 0 1px var(--edge); }
.lg-ms .lg-sw { width: 10px; height: 10px; margin: 0 4px; background: var(--ink); border-radius: 1px; transform: rotate(45deg); }
.lg-today .lg-sw { width: 3px; height: 16px; margin: 0 8px; border-radius: 2px; background: var(--here); }
.lg-tentative .lg-sw { background: repeating-linear-gradient(-45deg, var(--ink-3) 0 3px, transparent 3px 6px); outline: 2px dashed var(--ink-2); outline-offset: 1px; }

.page:has(> .retro) { max-width: 1180px; }
.gantt { --glabel: 236px; --row: 44px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); overflow: hidden; }
.gscroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.gscroll:focus-visible { outline-offset: -3px; }
.ggrid { position: relative; width: calc(var(--glabel) + var(--days) * var(--dw)); }
.grow { display: grid; grid-template-columns: var(--glabel) calc(var(--days) * var(--dw)); min-height: var(--row); border-bottom: 1px solid var(--line); }
.glabel {
  position: sticky; left: 0; z-index: 4; display: flex; align-items: center; gap: var(--s2); min-width: 0; padding: 0 var(--s3);
  background: var(--paper); border-right: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
}
.gtrack {
  position: relative;
  /* La frise commence un lundi : samedi et dimanche grisés. */
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--dw) * 5), rgba(17, 17, 17, 0.035) calc(var(--dw) * 5) calc(var(--dw) * 7));
}
.ghead { border-bottom: 1px solid var(--line-strong); }
.ghead .gtrack { background: none; }
.gmonths { position: relative; height: 26px; border-bottom: 1px solid var(--line); }
.gmonth {
  position: absolute; top: 0; bottom: 0; left: calc(var(--x) * var(--dw)); width: calc(var(--w) * var(--dw)); padding: 5px 8px;
  border-left: 1px solid var(--line-strong); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; overflow: clip;
}
.gmonth-t { position: sticky; left: calc(var(--glabel) + 8px); }
.gticks { position: relative; height: 30px; }
.gtick {
  position: absolute; top: 3px; bottom: 3px; left: calc(var(--x) * var(--dw)); width: calc(var(--w) * var(--dw));
  display: grid; place-content: center; text-align: center; font-size: 12px; line-height: 1.1; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.gtick.is-we { color: var(--ink-3); }
.gtick.is-today { background: var(--here); color: #fff; border-radius: 6px; font-weight: 700; }
.gtick-wd { display: block; font-size: 12px; }
.gantt[data-zoom='semaine'] .gticks { height: 36px; } /* jour et date sur deux lignes */
.gtick.is-today .gtick-wd { color: #fff; }
.gantt[data-zoom='trimestre'] .gtick.is-today { background: none; color: var(--here); }
.gantt[data-zoom='trimestre'] .gtick { place-content: center start; padding-left: 3px; border-left: 1px solid var(--line); border-radius: 0; }
.gbody { position: relative; }
.gmline { position: absolute; top: 0; bottom: 0; z-index: 1; left: calc(var(--glabel) + var(--x) * var(--dw)); border-left: 1px dashed var(--line-strong); pointer-events: none; }
/* « Aujourd'hui » passe sous les barres, pour ne jamais barrer leur texte. */
.gtoday { position: absolute; top: 0; bottom: 0; z-index: 1; left: calc(var(--glabel) + (var(--x) + 0.5) * var(--dw)); width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--here); pointer-events: none; }
.ghead-row { min-height: 42px; background: var(--wash); }
.ghead-row .glabel { background: var(--wash); }
.gtape {
  display: inline-block; padding: 3px 13px 3px 9px; background: var(--tape); color: var(--on-tape); font-size: var(--fs-sm); font-weight: 700;
  clip-path: polygon(0 8%, 3% 0, 40% 6%, 97% 0, 100% 8%, 98% 52%, 100% 100%, 60% 94%, 4% 100%, 0 92%, 2% 50%);
}
.gnone { position: sticky; left: calc(var(--glabel) + 12px); display: inline-block; margin-top: 12px; font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }

/* Bandes de gaffer collées sur la frise ; le nom déborde à droite quand la bande est trop courte. */
.gbar {
  position: absolute; top: 50%; z-index: 2; isolation: isolate; left: calc(var(--x) * var(--dw)); width: calc(var(--w) * var(--dw)); height: 26px; margin-top: -13px;
  /* Cible de 24 px au moins : une bande plus courte s'élargit autour de son milieu. */
  min-width: 24px; margin-left: min(0px, calc((var(--w) * var(--dw) - 24px) / 2));
  display: flex; align-items: center; gap: 6px; padding: 0 7px; border: 0; background: none; color: var(--on-tape);
  font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.gbar::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--tape);
  clip-path: polygon(0 6%, 100% 0, calc(100% - 2px) 34%, 100% 66%, calc(100% - 1px) 100%, 0 94%, 2px 64%, 0 32%);
}
.gbar:hover::before { filter: brightness(0.93); }
/* Liseré de la teinte de l'étape (retouches du 17 novembre : plus de contour foncé commun) : même forme déchirée, un peu
   plus grande. */
.gbar:is(.ph-prepa, .ph-tournage, .ph-post, .gcoll)::after {
  content: ''; position: absolute; inset: -1.5px; z-index: -2; background: var(--edge);
  clip-path: polygon(0 6%, 100% 0, calc(100% - 2px) 34%, 100% 66%, calc(100% - 1px) 100%, 0 94%, 2px 64%, 0 32%);
}
.gbar:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }
/* Le nom reste visible quand le début de la bande est sorti de l'écran, à gauche. */
.gbar-label { position: sticky; left: calc(var(--glabel) + 8px); display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.gbar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gbar .avatar { width: 18px; height: 18px; font-size: 9px; flex: none; }
.gcoll { --tape: var(--tape-collectif); --on-tape: var(--on-tape-collectif); --edge: var(--edge-collectif); --pale: var(--pale-collectif); }
/* Barre terminée (élément du collectif fait, étape passée) : couleur pâle de son étape, sans liseré. */
.gbar.is-done { --tape: var(--pale); --on-tape: var(--ink); }
.gbar.is-done::after { display: none; }
.gcoll.is-done .gbar-text { text-decoration: line-through; }
.gbar.ph-prepa .gbar-label, .gbar.ph-post .gbar-label { position: static; } /* un jalon peut se trouver là */
.gbar.ph-tournage, .gbar.is-tiny, .gcoll.is-out { padding: 0; }
.gcoll.is-out .gbar-label { position: absolute; left: calc(100% + 6px); max-width: 180px; color: var(--ink); }
.gcoll.is-done.is-out .gbar-label { color: var(--ink-3); }
.gbar.is-cut .gbar-label { visibility: hidden; } /* nom qui passerait sous la colonne des noms (retro.js) */
.gcoll.is-point { width: max(var(--dw), 24px); padding: 0; }
.gcoll.is-point::before { inset: 6px auto auto calc(50% - 7px); width: 14px; height: 14px; border-radius: 2px; transform: rotate(45deg); clip-path: none; }
.gcoll.is-point::after { inset: 4.5px auto auto calc(50% - 8.5px); width: 17px; height: 17px; border-radius: 3px; transform: rotate(45deg); clip-path: none; }
.gbar.ph-prepa, .gbar.ph-tournage, .gbar.ph-post { color: var(--on-tape); }
.gbar.is-tiny .gbar-label { display: none; }
/* Lot 4 : dossier en proposition (devis envoyé, aucun accepté) : bande hachurée, contour en pointillé, « à confirmer ». */
.gbar.is-tentative { outline: 2px dashed var(--edge); outline-offset: 1px; }
.gbar.is-tentative::before { background: repeating-linear-gradient(-45deg, var(--tape) 0 6px, transparent 6px 10px); }
.gbar.is-tentative::after { display: none; }
.gproj-title.is-tentative { flex-direction: column; align-items: flex-start; justify-content: center; }
.gproj-tag { font-size: 12px; font-weight: 600; font-style: italic; color: var(--ink-2); line-height: 1.2; }
.gms { position: absolute; top: 50%; z-index: 2; left: calc((var(--x) + 0.5) * var(--dw) - 12px); width: 24px; height: 24px; margin-top: -12px; }
.gms::before { content: ''; position: absolute; left: 6px; top: 6px; width: 12px; height: 12px; background: var(--ink); border-radius: 1px; transform: rotate(45deg); }
.gms-label { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.gproj-label { display: flex; align-items: center; gap: 2px; min-width: 0; }
/* Lien de 24 px de haut au moins ; le texte, sur deux lignes au plus, est coupé dans sa propre boîte (sans marge
   intérieure, sinon le haut d'une troisième ligne dépasserait). */
.gproj-title { display: flex; align-items: center; min-width: 0; min-height: 24px; color: var(--ink); font-weight: 700; text-decoration: none; }
.gproj-title-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; line-height: 1.3; } /* Lexend : lettres hautes de 1,28 fois le texte */
.gproj-title:hover { text-decoration: underline; }
.gfold { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-left: -6px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); }
.gfold:hover { background: var(--wash); }
.gfold .ico { transition: transform 0.15s ease; transform: rotate(-90deg); }
.gfold[aria-expanded='true'] .ico { transform: none; }
.gsub { min-height: calc(var(--rows, 1) * 26px + 6px); background: var(--wash); }
.gsub .glabel { background: var(--wash); }
.gsub-label { padding-left: 26px; font-weight: 500; color: var(--ink-3); }
.gmark { position: absolute; top: calc(4px + var(--y, 0) * 26px); z-index: 2; left: calc((var(--x) + 0.5) * var(--dw) - 12px); width: 24px; height: 24px; }
.gmark::before {
  content: ''; position: absolute; left: 6px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--tape); border: 2px solid var(--edge);
}
.gmark.k-tournage::before { border-radius: 2px; }
.gmark.k-calendrier::before, .gmark.k-livrable::before { border-radius: 1px; transform: rotate(45deg); }
.gmark.is-done::before { background: var(--pale); border-color: var(--pale); }
.gmark.is-late::before { box-shadow: 0 0 0 2px var(--critical); }
.gmark:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }
@media (max-width: 640px) {
  .gantt { --glabel: 124px; --row: 46px; border-radius: var(--r-md); margin: 0 calc(-1 * var(--s2)); }
  .glabel { padding: 0 var(--s2); font-size: var(--fs-xs); }
  .gproj-title { font-size: var(--fs-xs); }
  .gsub-label { padding-left: 4px; }
  .retro-who { margin-left: 0; }
}

/* ---------- Élément du collectif ---------- */
.og-form { display: grid; gap: var(--s3); }
.og-dates { align-items: end; }
.og-delete { margin-right: auto; color: var(--critical); }
.og-show { display: grid; gap: var(--s3); }
.og-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s4); margin: 0; }
.og-facts dt { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.og-facts dd { margin: 0; }

/* ---------- Vue agenda (page Rétroplanning et section Planning) ---------- */
.agenda-cal { padding: var(--s3) var(--s4) var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.ag-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.ag-month { min-width: 11ch; text-align: center; font-size: var(--fs-xl); font-weight: 700; }
.ag-today { margin-left: auto; }
/* Retouches du 17 novembre. Ordinateur : grille légère (traits --line), pastilles avec texte, « +N » discret. Le jour de
   tournage : carré arrondi de 40 px autour du rond de la date (pointillé à confirmer, pâle une fois passé) ; aujourd'hui
   choisi : rond bleu plein ; aujourd'hui : chiffre bleu ; jour choisi : rond bleu clair. Plus de bandes sur plusieurs jours. */
.ag-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ag-wd { padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--wash); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); }
.ag-day {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; min-height: 96px; padding: 5px;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); text-align: left; color: var(--ink); cursor: pointer;
}
.ag-day:hover { background: var(--wash); }
.ag-day.is-out { background: var(--wash); }
.ag-box { display: inline-grid; place-items: center; flex: none; align-self: flex-start; width: 40px; height: 40px; border: 2px solid transparent; border-radius: 12px; }
.ag-box.is-shoot-ok { border-color: var(--edge-tournage); }
.ag-box.is-shoot-tbc { border-color: var(--edge-tournage); border-style: dashed; }
.ag-box.is-shoot-done { border-color: var(--pale-tournage); }
.ag-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.ag-day.is-out .ag-num { color: var(--ink-3); }
.ag-day.is-today .ag-num { color: var(--here-ink); font-weight: 800; }
.ag-day.is-sel .ag-num { background: var(--select); color: var(--ink); }
.ag-day.is-today.is-sel .ag-num { background: var(--here); color: #fff; }
.ag-chips { display: grid; gap: 2px; min-width: 0; }
/* Un repère : aplat de l'étape cerclé de sa teinte ; à confirmer : creux, anneau de 2 px ; fait : pâle, sans anneau. */
.ag-chip { display: block; padding: 1px 6px; border-radius: 5px; background: var(--tape); color: var(--on-tape); box-shadow: inset 0 0 0 1px var(--edge); font-size: 12px; font-weight: 600; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-chip.st-tbc { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--edge); }
.ag-chip.st-done { background: var(--pale); color: var(--ink-2); box-shadow: none; text-decoration: line-through; }
.ag-chip.is-late { box-shadow: inset 0 0 0 2px var(--critical); }
.ag-more { font-size: 12px; font-weight: 600; color: var(--ink-3); }
/* Légende repliée sous la grille. */
.ag-legend { margin-top: var(--s3); font-size: var(--fs-sm); color: var(--ink-2); }
.ag-legend > summary { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; }
.ag-legend > summary::before { content: ''; width: 0; height: 0; margin-right: 8px; border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform 0.15s ease; }
.ag-legend[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .ag-legend > summary::before { transition: none; } }
.ag-legend-list { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px var(--s4); margin-top: var(--s1); }
.ag-legend-list > li { display: inline-flex; align-items: center; gap: 6px; }
.ag-legend-list > li.ag-legend-phases { flex-basis: 100%; flex-wrap: wrap; gap: 8px var(--s3); }
.ag-legend-phase { display: inline-flex; align-items: center; gap: 6px; }
.ag-key { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--tape); box-shadow: inset 0 0 0 1px var(--edge); }
.ag-key.st-tbc { background: transparent; box-shadow: inset 0 0 0 2px var(--edge); }
.ag-key.st-done { background: var(--pale); box-shadow: none; }
.ag-key-box { flex: none; width: 18px; height: 18px; border: 2px solid var(--edge-tournage); border-radius: 6px; }
.ag-key-box.is-shoot-tbc { border-style: dashed; }
.ag-key-disc { flex: none; width: 18px; height: 18px; border-radius: 50%; }
.ag-key-disc.is-today { background: var(--here); }
.ag-key-disc.is-sel { background: var(--select); }
/* Liste du jour : barre de la couleur de l'étape, sous-titre « dossier, étape », étiquette sur la teinte claire. */
.ag-list { margin-top: var(--s4); }
.ag-list-title { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); font-size: var(--fs-lg); font-weight: 700; }
.ag-items { list-style: none; display: grid; }
.ag-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); padding: 8px 0 8px 10px; border-left: 5px solid var(--tape); border-bottom: 1px solid var(--line-strong); }
.ag-item.is-tentative { border-left-style: dashed; border-left-color: var(--edge); }
.ag-item.is-done { border-left-color: var(--pale); }
.ag-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.ag-what { display: grid; min-width: 0; }
.ag-label { font-weight: 600; overflow-wrap: anywhere; color: inherit; }
.ag-open { min-height: 32px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; text-decoration: underline; cursor: pointer; }
.ag-sub { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.ag-title { color: inherit; }
.ag-tbc { font-size: var(--fs-xs); font-style: italic; color: var(--ink-2); }
.ag-tag { padding: 2px 8px; border-radius: var(--r-pill); background: var(--tint); font-size: var(--fs-xs); font-weight: 600; color: var(--ink); white-space: nowrap; }
.ag-item.is-done .ag-label { color: var(--ink-3); text-decoration: line-through; }
.ag-item.is-late .ag-label { color: var(--critical); }
.ag-items.no-time .ag-item { grid-template-columns: minmax(0, 1fr) auto; }
.ag-items.no-time .ag-time { display: none; }
.planning-more { margin-top: var(--s4); font-size: var(--fs-sm); }
@media (max-width: 640px) {
  /* Téléphone : la carte mange presque toute la marge de la page (cases d'au moins 48 px à 360 px) ; plus de lignes de
     grille ; points de 8 px sous la date, trois au plus, sans « +N » (le détail est dans la liste du jour). */
  .agenda-cal { margin-inline: calc(4px - var(--s4)); padding: var(--s2) 4px var(--s3); }
  .ag-head, .ag-legend, .ag-list { padding-inline: var(--s2); }
  /* « Revenir à aujourd'hui » passe sous le mois quand la place manque (360 px, phase 2, lot 4). */
  .ag-head { flex-wrap: wrap; row-gap: var(--s1); }
  .ag-month { font-size: var(--fs-lg); }
  .ag-grid { border: 0; }
  .ag-wd { padding: 4px 0; border: 0; background: none; text-align: center; font-size: 12px; }
  .ag-day { align-items: center; gap: 2px; min-height: 58px; padding: 3px 0 4px; border: 0; background: none; }
  .ag-day:hover, .ag-day.is-out { background: none; }
  .ag-box { align-self: center; }
  .ag-num { font-size: 15px; }
  .ag-chips { display: flex; justify-content: center; gap: 3px; height: 8px; }
  .ag-chip { flex: none; width: 8px; height: 8px; padding: 0; border-radius: 50%; font-size: 0; line-height: 0; }
  .ag-chip.is-late { box-shadow: inset 0 0 0 1px var(--edge); }
  .ag-more { display: none; }
  .ag-item { grid-template-columns: 44px minmax(0, 1fr); }
  .ag-tag { grid-column: 2; justify-self: start; }
}

/* ---------- v1.3, lot 2 : en-tête du dossier replié, menu « ⋯ », section dans la barre « Sommaire » ---------- */
/* Ordinateur : titre et étape, infos dessous, actions à droite. Téléphone : titre et étape, puis le volet
   « Dates, lieux, client » et les actions sur une ligne ; « Exporter en PDF » passe dans le menu « ⋯ ». */
.dhead { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'top bar' 'facts bar' 'notes notes'; column-gap: var(--s5); align-items: end; }
.dhead-top { grid-area: top; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-width: 0; }
.dhead-top .back { flex-basis: 100%; margin-bottom: 0; }
.dhead-title { min-width: 0; }
.dhead-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dhead-bar { grid-area: bar; display: flex; align-items: center; gap: var(--s2); }
.dhead .dhead-facts { grid-area: facts; }
.dhead .dhead-notices { grid-area: notes; }
.disclosure {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 var(--s2) 0 0;
  border: 0; background: none; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); text-align: left;
}
.disclosure:hover { color: var(--ink); }
.disclosure-ico { width: 18px; height: 18px; transform: rotate(-90deg); transition: transform 0.15s ease; }
.disclosure[aria-expanded='true'] .disclosure-ico { transform: none; }
@media (min-width: 761px) {
  .dhead-more, .menu.is-phone-only, .menu-item.is-phone-only { display: none; }
}
@media (max-width: 760px) {
  .page { padding-top: 4px; }
  .dhead { display: block; margin-bottom: 6px; }
  .dhead-top { align-items: baseline; gap: 2px var(--s2); }
  .dhead-top .back { display: none; }
  .dhead-title { font-size: 21px; line-height: 1.12; letter-spacing: -0.02em; }
  .dhead-status .pill { font-size: 12px; line-height: 1.35; padding: 1px 8px; }
  .dhead-bar { justify-content: space-between; margin-top: 4px; }
  .dhead-bar .disclosure { position: relative; min-height: 40px; }
  .dhead-bar .disclosure::before { content: ''; position: absolute; inset: -2px 0; }
  /* En-tête replié : touches de 40 px à l'œil, cible de 44 px gardée par une zone invisible autour. */
  .dhead-actions .btn { min-height: 40px; }
  .dhead-actions .btn::before { content: ''; position: absolute; inset: -2px 0; }
  .dhead-actions .menu-btn { height: 40px; }
  .dhead-actions { flex-wrap: nowrap; }
  .dhead .dhead-facts { margin-top: 6px; }
  .dhead .dhead-facts[data-open='false'] { display: none; }
  .dhead-export { display: none; }
  .menu-btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dhead-actions .menu-btn { width: var(--tap); padding: 0; }
}
/* Là où la barre « Sommaire » existe, elle porte le nom de la section : la bande au-dessus du contenu disparaît. */
@media (max-width: 999px) {
  .shead .shead-tape { display: none; }
}
@media (max-width: 640px) {
  .shead { margin-bottom: 6px; }
  .shead-desc { display: none; }
  .shead:not(:has(.shead-actions)) { display: none; }
}

/* ---------- v1.3, lot 2 : une seule barre « Mise en forme », champs en 16 px au doigt ---------- */
/* Placée au-dessus du champ enrichi actif (richbar.js), elle reste collée en haut tant que le champ est à l'écran. */
.rt-bar { position: sticky; top: var(--topbar-h, 61px); z-index: 6; display: flex; gap: var(--s1); padding: var(--s1) 0; background: var(--bg) var(--bg-grain); }
.rt-btn {
  position: relative; display: inline-grid; place-items: center; min-width: var(--tap); height: 38px; padding: 0 var(--s2);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); color: var(--ink); font-size: 16px;
  box-shadow: 0 2px 0 var(--line-strong);
}
.rt-btn::before { content: ''; position: absolute; inset: -4px 0; } /* cible de 44 px */
.rt-btn:hover { border-color: #b3bbc8; }
.rt-btn strong { font-weight: 800; }
.rt-btn em { font-style: italic; font-family: Georgia, 'Times New Roman', serif; font-weight: 600; }
.rt-btn .ico { width: 18px; height: 18px; }
@media (max-width: 999px) { .rt-bar { top: calc(var(--topbar-h, 52px) + var(--pbar-h, 66px)); } }
/* Barre du haut masquée en descendant (760 px ou moins) : seule la barre « Sommaire » reste au-dessus. */
@media (max-width: 760px) { html.bar-hidden .rt-bar { top: var(--pbar-h, 66px); } }
@media (pointer: coarse) {
  /* En dessous de 16 px, l'iPhone zoome à chaque saisie. */
  :is(input, textarea).in:not(.in-title) { font-size: 16px; }
  /* Au doigt, la barre ne se montre que pendant la saisie : les autres barres sont décollées, elle monte tout en haut. */
  html:has(textarea:focus) .rt-bar { top: 0; }
}

/* ---------- v1.3, lot 2 : accueil, groupe « Modèles » replié ---------- */
.drows[data-open='false'] { display: none; }
.group-toggle { font: inherit; font-weight: 700; color: var(--ink); gap: var(--s2); margin-block: -10px; }
.group-toggle-text { display: inline-flex; align-items: baseline; gap: var(--s2); }

/* ---------- v1.3, lot 2 : Rétroplanning, réglages repliés sur téléphone ---------- */
@media (min-width: 761px) {
  .retro-settings-toggle { display: none; }
  .retro-settings { display: contents; }
  .retro-tools .retro-legend { order: 1; flex-basis: 100%; margin-bottom: 0; }
}
@media (max-width: 760px) {
  .retro-settings {
    flex-basis: 100%; display: grid; gap: var(--s3); justify-items: start;
    padding: var(--s3); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card);
  }
  .retro-settings[data-open='false'] { display: none; }
  .retro-settings .retro-who { margin-left: 0; }
  .retro-settings .retro-legend { margin-bottom: 0; }
  .retro-today { margin-left: auto; }
}
/* Sur téléphone, la phrase d'introduction s'efface comme les descriptions des sections : l'Agenda monte dans le premier écran. */
@media (max-width: 640px) { .retro .page-lead { display: none; } }

/* ---------- v1.3, lot 3 : feuille envoyée, changements depuis l'envoi, « J'ai lu ma convocation » ---------- */
.fds-sent { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin: var(--s3) 0; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--wash); font-size: var(--fs-sm); }
.fds-sent.is-sent { background: var(--card); }
.fds-sent p { margin: 0; font-weight: 600; }
.fds-changed { margin-bottom: var(--s3); border-color: var(--critical-edge); background: var(--critical-soft); }
.fds-changed .callout-label { color: var(--critical); }
.fds-changed ul { margin: var(--s1) 0 0; padding-left: 1.2em; display: grid; gap: 2px; }
.fds-mine { display: grid; gap: var(--s2); justify-items: start; margin-bottom: var(--s4); padding: var(--s3) var(--s4); border: 2px solid var(--here); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.fds-mine p { margin: 0; }
.fds-mine.is-lu { border-color: transparent; }
.fds-mine.is-a_relire .fds-mine-state { color: var(--critical); font-weight: 700; }
.fds-read { white-space: nowrap; font-size: var(--fs-sm); }
.agenda-item { display: grid; gap: 0; }
.agenda-read { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--critical-soft); font-size: var(--fs-sm); font-weight: 600; }

/* ---------- v1.3, lot 3 : conflits de planning (admins) ---------- */
.team-conflict { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--critical); font-size: var(--fs-sm); font-weight: 600; }
.team-conflict .ico { flex: none; margin-top: 2px; }
/* Conflits : une carte blanche, le titre en rouge avec son pictogramme (le mot « Conflits » dit l'état). */
.retro-conflicts { flex-basis: 100%; padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); font-size: var(--fs-sm); }
.retro-conflicts-toggle { color: var(--critical); }
@media (min-width: 761px) { .retro-conflicts-toggle { display: none; } }
@media (max-width: 760px) {
  .retro-conflicts[data-open='false'] { display: none; }
  .retro-conflicts-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* le bouton porte déjà le titre */
}
.retro-conflicts-title { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); font-size: var(--fs-md); color: var(--critical); }
.retro-conflicts ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* ---------- v1.3, lot 4 : Tarifs, clients, devis ---------- */
.in-affix { display: flex; align-items: stretch; }
.in-affix .in { min-width: 0; }
.in-affix .affix { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--field-edge); background: var(--wash); color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.in-affix .affix:first-child { border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.in-affix .affix:last-child { border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.in-affix .affix:first-child + .in { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.in-affix .in:has(+ .affix) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.in-num { font-variant-numeric: tabular-nums; }
.tarifs .sec + .sec { margin-top: var(--s5); }
.tarifs .sec > .field + .field, .tarif-grid + .field { margin-top: var(--s3); }
.tarif-grid { display: grid; gap: var(--s3); grid-template-columns: 1fr; margin-top: var(--s3); align-items: end; }
.tarif-grid.is-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .tarif-grid, .tarif-grid.is-pairs { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.tiers, .fees { display: grid; gap: var(--s3); margin: var(--s3) 0; }
.tier-row, .fee-row { display: grid; gap: var(--s2); align-items: end; padding: var(--s3); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.tier-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
.tier-row > .field:first-child { grid-column: 1 / -1; }
.tier-limit { margin: 0; min-height: var(--tap); display: flex; align-items: center; }
.fee-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
.fee-row > .field:first-child { grid-column: 1 / 3; }
.fee-row > .icon-btn { grid-column: 3; grid-row: 1; align-self: end; }
.fee-row > .check { grid-column: 1 / -1; }
@media (min-width: 761px) {
  .tier-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .tier-row > .field:first-child { grid-column: auto; }
  .fee-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto 44px; align-items: center; }
  .fee-row > * { grid-column: auto !important; grid-row: auto !important; }
}
.clients .page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.client-list { display: grid; gap: var(--s3); }
.client { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.client p { margin: 0; }
.client-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--s2); }
.client-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); min-height: var(--tap); }
.client-name { font-size: var(--fs-lg); font-weight: 700; margin: 0; }
.client-tools { display: inline-flex; gap: 4px; }
.client-address { white-space: pre-line; }
.client-sub { margin: var(--s2) 0 0; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.client-contacts { display: grid; gap: 4px; justify-items: start; }
.client-contact { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); }
.client-dossiers { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: var(--fs-sm); }
.client-dossier-state { display: block; color: var(--ink-3); }
[data-billing-profile] > .field, [data-billing-profile] > .vat-box { margin-top: var(--s3); }
.vat-box { display: grid; gap: var(--s3); }
.vat-box > .field-hint { margin-top: calc(-1 * var(--s2)); }
/* Section « Devis et facturation » */
.devis { display: grid; gap: var(--s4); }
.devis .sec { margin: 0; }
.quote-state { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); border-top: 6px solid var(--tape, var(--tape-prepa)); }
.quote-state p { margin: 0; }
.quote-state-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.quote-state-head .sec-title { margin: 0; }
.quote-state .is-changed { display: flex; gap: 6px; align-items: flex-start; color: var(--critical); font-weight: 600; font-size: var(--fs-sm); }
.quote-issues ul, .quote-notes { margin: 4px 0 0; padding-left: 1.2em; font-size: var(--fs-sm); }
.quote-actions, .quote-tools { display: flex; flex-wrap: wrap; gap: var(--s2); }
.quote-tools { margin: var(--s2) 0; }
.quote-archive { display: grid; gap: var(--s2); justify-items: start; padding: var(--s3); border-radius: var(--r-md); background: var(--critical-soft); font-size: var(--fs-sm); }
.badge.is-ok { background: var(--ok-soft, #e6f4ea); }
.badge.is-warn { background: var(--critical-soft); color: var(--critical); }
.badge.is-info { background: var(--marker-soft); }
.quote-settings .quote-urgency { display: grid; gap: var(--s2); margin-top: var(--s3); justify-items: start; }
.quote-settings .quote-urgency p { margin: 0; }
.quote-pages { display: grid; gap: var(--s3); }
@media (min-width: 900px) { .quote-pages { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); align-items: start; } }
.quote-page, .tracking { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border: 1.5px solid transparent; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.quote-page.is-stray { border-color: var(--critical); }
/* Page d'une personne (retouches du 17 novembre) : une chemise à sa couleur d'encre. L'onglet porte son initiale et son
   nom (passe à la ligne s'il est long) ; la carte, blanche, est bordée en haut d'un trait de 3 px à sa couleur. */
.quote-page.has-tab, .tracking.has-tab { display: grid; gap: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.has-tab > .quote-page-tab { justify-self: start; max-width: 100%; margin: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 4px 6px; border-radius: var(--r-tab) var(--r-tab) 0 0; background: var(--c); color: var(--on-c);
  font-size: var(--fs-md); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.quote-tab-dot { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--c); font-size: 11.5px; }
.quote-page-tab.is-neutral { background: var(--wash); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); padding-left: 14px; }
.has-tab > .quote-page-body { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); background: var(--card);
  border-radius: 0 var(--r-lg) var(--r-lg) var(--r-lg); border-top: 3px solid var(--c, var(--line-strong)); box-shadow: var(--shadow-card); }
.quote-page.is-stray.has-tab > .quote-page-body { border-top-color: var(--critical); box-shadow: inset 0 0 0 1.5px var(--critical-edge), var(--shadow-card); }
.has-tab .quote-page-head { justify-content: flex-end; }
.cover-kicker .quote-page-tab { display: inline-flex; margin-left: 8px; padding: 2px 10px; border-radius: 10px 10px 0 0; background: var(--c); color: var(--on-c); font-weight: 700; }
.cover-kicker .quote-page-tab.is-neutral { background: var(--wash); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.quote-page-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.quote-page-head h3 { margin: 0; font-size: var(--fs-md); }
.quote-page-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-rows { display: grid; gap: 2px; }
.quote-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s2); align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.quote-row > .quote-detail { grid-column: 1; color: var(--ink-3); }
.quote-row > .quote-amount { grid-column: 2; grid-row: 1; }
.quote-row.is-remise .quote-amount { color: var(--ink-2); }
.quote-row.has-tools { grid-template-columns: minmax(0, 1fr) 44px; align-items: center; padding: 0; }
.quote-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s2); align-items: baseline; width: 100%; min-height: var(--tap); padding: 6px 4px; border: 0; background: none; text-align: left; font: inherit; font-size: var(--fs-sm); color: inherit; cursor: pointer; border-radius: var(--r-sm); }
.quote-line:hover { background: var(--wash); }
.quote-line > .quote-amount { grid-column: 2; grid-row: 1; }
.quote-line > .quote-detail, .quote-line > .quote-note { grid-column: 1; }
.quote-detail, .quote-note { font-size: var(--fs-xs); color: var(--ink-3); }
.quote-note { font-style: italic; }
.quote-label .badge { margin-left: 6px; }
.quote-amount { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.quote-sums { display: grid; gap: 2px; padding-top: var(--s2); border-top: 2px solid var(--ink-2); font-variant-numeric: tabular-nums; }
.quote-sum { display: flex; justify-content: space-between; gap: var(--s2); font-size: var(--fs-sm); }
.quote-sum.is-strong { font-weight: 700; font-size: var(--fs-md); }
.quote-mention { margin: 0; }
.quote-total { display: grid; gap: 4px; margin-top: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--tint, var(--tint-prepa)); font-variant-numeric: tabular-nums; }
.quote-discount { max-width: 220px; }
.quote-rights { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.quote-rights li, .quote-versions li, .tracking-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); font-size: var(--fs-sm); }
.quote-rights li > span:first-child, .tracking-list li > span:first-child { flex: 1 1 200px; }
.quote-versions, .tracking-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tracking-list .is-cancelled { text-decoration: line-through; color: var(--ink-3); }
.tracking-rest { margin: 0; font-weight: 700; }
.choice-list { display: grid; gap: var(--s2); }
.choice-btn { display: grid; gap: 2px; padding: var(--s3); border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: var(--card); text-align: left; font: inherit; cursor: pointer; box-shadow: 0 3px 0 var(--line-strong); }
.choice-btn:hover { border-color: var(--here); background: var(--select-soft); }
.choice-btn:active { transform: translateY(3px); box-shadow: none; }
.quote-rows.with-tools > .quote-row:not(.has-tools) { padding: 6px 48px 6px 4px; }
/* Alertes de facturation de l'accueil : repliées sur téléphone, comme les conflits du Rétroplanning */
.billing-wrap { margin-bottom: var(--s4); }
.billing-alerts { padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); font-size: var(--fs-sm); }
.billing-alerts-title { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); font-size: var(--fs-md); color: var(--ink); }
.billing-alerts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.billing-alerts li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.billing-alerts li:first-child { border-top: 0; }
.billing-alerts .alert-tag { margin-right: var(--s2); vertical-align: 1px; }
.billing-alerts-toggle { color: var(--ink); }
@media (min-width: 761px) { .billing-alerts-toggle { display: none; } }
@media (max-width: 760px) {
  .billing-alerts[data-open='false'] { display: none; }
  .billing-alerts-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .billing-wrap { margin-bottom: var(--s3); }
}

/* ---------- Onglet Facturation (v1.3, lot 5) ---------- */
.bl-section { display: grid; gap: var(--s3); }
.bl-section > .muted { margin: 0; }
.bl-rows { list-style: none; margin: 0; padding: 0 var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.bl-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.bl-row:first-child { border-top: 0; }
.bl-main { display: grid; gap: 2px; min-width: 0; }
.bl-main > a, .bl-title { font-weight: 600; }
.bl-sub { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.bl-side { display: grid; justify-items: end; gap: 4px; flex: none; }
.bl-amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bl-row.is-annulee .bl-amount { text-decoration: line-through; color: var(--ink-3); }
.bl-total { margin: 0; font-weight: 700; font-size: var(--fs-lg); }
.bl-late { color: var(--critical); }
.bl-filter { max-width: 320px; }
.bl-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bl-alerts > li { padding: 10px 14px; border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow-card); overflow-wrap: anywhere; }
.bl-alerts .alert-tag { margin-right: var(--s2); vertical-align: 1px; }
.billing-alerts-more { margin: var(--s2) 0 0; font-size: var(--fs-sm); }

/* Facturation › Chiffre d'affaires : le tableau défile de côté dans son cadre, la colonne des mois reste en place. */
.ca { display: grid; gap: var(--s4); }
.ca-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); }
.ca-year { display: inline-flex; align-items: center; gap: var(--s1); }
.ca-year-label { min-width: 4ch; text-align: center; font-weight: 700; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.ca-who { min-width: 200px; margin: 0; }
/* Retouches du 17 novembre : carte du total, « Mois par mois » (colonnes, bulle du mois choisi), « Par type de
   prestation », puis le tableau détaillé, replié. */
.ca-hero, .ca-card { max-width: 760px; padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.ca-hero { display: grid; gap: 6px; justify-items: start; }
.ca-hero p { margin: 0; }
.ca-total { font-size: 42px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: proportional-nums; }
.ca-total-sub { color: var(--ink-2); }
.ca-hero .ca-gap { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; }
.ca-gap.is-up { background: var(--gain-soft); color: var(--gain); }
.ca-gap.is-down { background: var(--critical-soft); color: var(--critical); }
.ca-gap.is-flat { background: var(--wash); color: var(--ink-2); }
.ca-upcoming { color: var(--ink-2); font-size: var(--fs-sm); }
.ca-card { display: grid; gap: var(--s3); }
.ca-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); }
.ca-card-title { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.ca-legend { list-style: none; display: flex; gap: var(--s4); margin: 0; padding: 0; font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ca-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ca-swatch { width: 10px; height: 10px; border-radius: 3px; }
.ca-swatch.is-cur, .ca-bar.is-cur { background: var(--ca-cur); }
.ca-swatch.is-prev, .ca-bar.is-prev { background: var(--ca-prev); }
/* « Qui » sur une personne : l'année à sa couleur d'encre, l'année précédente en version pâle ; la bulle reste blanche. */
.ca-months.is-person .ca-swatch.is-cur, .ca-months.is-person .ca-bar.is-cur { background: var(--c); }
.ca-months.is-person .ca-swatch.is-prev, .ca-months.is-person .ca-bar.is-prev { background: var(--c); opacity: 0.32; }
@supports (color: color-mix(in srgb, red 50%, white)) {
  .ca-months.is-person .ca-swatch.is-prev, .ca-months.is-person .ca-bar.is-prev { background: color-mix(in srgb, var(--c) 32%, #fff); opacity: 1; }
}
/* Le graphique : une zone en haut pour la bulle, puis les repères, les traits fins et les douze colonnes-boutons. */
.ca-chart { --zone: 104px; --plot: 168px; --axis: 44px; position: relative; padding-top: var(--zone); }
.ca-plot { position: relative; display: grid; grid-template-columns: var(--axis) minmax(0, 1fr); }
.ca-axis { position: relative; height: var(--plot); }
.ca-tick { position: absolute; right: 5px; transform: translateY(50%); font-size: 12px; line-height: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ca-lines { position: absolute; left: var(--axis); right: 0; top: 0; height: var(--plot); pointer-events: none; }
.ca-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.ca-line.t0 { background: var(--line-strong); }
.ca-tick.t0, .ca-line.t0 { bottom: 0; }
.ca-tick.t1, .ca-line.t1 { bottom: 33.333%; }
.ca-tick.t2, .ca-line.t2 { bottom: 66.667%; }
.ca-tick.t3, .ca-line.t3 { bottom: 100%; }
.ca-cols { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); touch-action: pan-y; }
.ca-col { display: grid; grid-template-rows: var(--plot) 34px; justify-items: center; min-width: 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: inherit; cursor: pointer; }
.ca-col:focus-visible { outline: 3px solid var(--here); outline-offset: -3px; }
.ca-bars { display: flex; align-items: flex-end; gap: 2px; height: var(--plot); }
.ca-bar { width: 8px; height: calc(var(--v, 0) * 100%); border-radius: 3px 3px 0 0; }
.ca-bar.is-some { min-height: 3px; }
/* Initiale du mois ; le mois choisi : petite pastille bleu clair ; le mois en cours : trait bleu fin, à peine plus large
   que la lettre, décollé d'elle. */
.ca-letter { position: relative; align-self: start; min-width: 18px; height: 18px; margin-top: 5px; padding: 0 5px; border-radius: 9px; font-size: 12px; font-weight: 600; line-height: 18px; text-align: center; }
.ca-col[aria-pressed='true'] .ca-letter { background: var(--select); color: var(--ink); }
.ca-col.is-now .ca-letter::after { content: ''; position: absolute; left: 50%; top: calc(100% - 1px); width: 11px; height: 2px; margin-left: -5.5px; border-radius: 1px; background: var(--here); }
.ca-col.is-now[aria-pressed='true'] .ca-letter::after { top: calc(100% + 2px); } /* sous la pastille, sans la toucher */
.ca-col.is-future .ca-letter { color: var(--ink-3); }
/* La bulle : posée au-dessus de la colonne choisie, gardée dans la carte, sa pointe sur la colonne. */
.ca-bubble { position: absolute; top: 0; left: var(--left, 0px); z-index: 2; display: grid; justify-items: start; gap: 2px; max-width: 100%; padding: 8px 12px 9px; border: 1px solid var(--pop-edge); border-radius: 12px; background: #fff; box-shadow: var(--shadow-pop); pointer-events: none; }
.ca-bubble p { margin: 0; white-space: nowrap; }
.ca-bubble-month { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--select); font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.ca-bubble-amount { font-size: 20px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ca-bubble-amount.is-future { font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); }
.ca-bubble-prev { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ca-bubble-tip { position: absolute; left: calc(var(--tip, 50%) - 7px); bottom: -7.5px; width: 14px; height: 14px; border-right: 1px solid var(--pop-edge); border-bottom: 1px solid var(--pop-edge); border-bottom-right-radius: 3px; background: #fff; transform: rotate(45deg); }
/* Par type de prestation : barres d'une seule couleur, la plus grande d'abord ; les types à zéro, atténués. */
.ca-kind-list { list-style: none; display: grid; gap: var(--s3); margin: 0; padding: 0; }
.ca-kind { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px var(--s3); }
.ca-kind-label { font-weight: 600; overflow-wrap: anywhere; }
.ca-kind-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ca-kind-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--wash); overflow: hidden; }
.ca-kind-fill { display: block; width: calc(var(--v, 0) * 100%); height: 100%; border-radius: 4px; background: var(--ca-cur); }
.ca-kinds.is-person .ca-kind-fill { background: var(--c); }
.ca-kind.is-zero { color: var(--ink-3); }
.ca-kind.is-zero .ca-kind-label { font-weight: 500; }
.ca-table-box > summary { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; }
.ca-table-box > summary::before { content: ''; width: 0; height: 0; margin-right: 8px; border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform 0.15s ease; }
.ca-table-box[open] > summary { margin-bottom: var(--s2); }
.ca-table-box[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .ca-table-box > summary::before { transition: none; } }
@media (max-width: 640px) {
  /* Téléphone : les cartes mangent presque toute la marge de la page (colonnes de 24 px au moins à 360 px). */
  .ca-hero, .ca-card { margin-inline: calc(4px - var(--s4)); padding: var(--s3) var(--s4); }
  .ca-months { padding-inline: 10px; }
  .ca-months .ca-card-head { padding-inline: 6px; }
  .ca-chart { --zone: 100px; --plot: 150px; --axis: 40px; }
}
.ca-scroll { overflow-x: auto; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.ca-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ca-table th, .ca-table td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.ca-table thead th { font-weight: 600; color: var(--ink-2); background: var(--card); }
.ca-table th:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--card); box-shadow: 1px 0 0 var(--line); }
.ca-table td[data-kind='total'] { font-weight: 600; }
.ca-table tr.is-future > * { color: var(--ink-3); }
.ca-table tfoot tr[data-row='total'] > * { font-weight: 700; border-top: 2px solid var(--ink); }
.ca-table tfoot tr[data-row='gap'] > * { color: var(--ink-2); }
.ca-table tr.is-upcoming > * { font-style: italic; color: var(--ink-2); border-top: 1px dashed var(--line-strong); }
.ca-notes p { margin: 0 0 4px; font-size: var(--fs-sm); }

/* Lien d'acceptation (v1.3, lot 6) */
.quote-link { display: grid; gap: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--line-strong); }
.quote-link p { margin: 0; display: flex; gap: 6px; align-items: flex-start; }
.quote-online { margin: 0; display: flex; gap: 6px; align-items: center; font-weight: 600; color: var(--ok); }
.link-dialog .in { font-family: var(--mono, monospace); font-size: var(--fs-sm); }

/* Page du client (v1.3, lot 6) : le devis seul, puis la réponse ; aucune barre de l'appli. */
.cq-preview {
  display: flex; flex-wrap: wrap; gap: 2px var(--s3); align-items: baseline; margin: 0 0 var(--s4); padding: var(--s2) var(--s3);
  background: var(--marker-soft); border: 1px solid var(--marker-line); border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.4;
}
.cq-preview a { margin-left: auto; font-weight: 600; }
.cq-head { display: grid; gap: 4px; }
.cq-kicker { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-3); }
.cq-title { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.cq-status { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
.cq-status p { margin: 0; }
.cq-status .is-ok { color: var(--ok); font-weight: 700; }
.cq-status .is-no { color: var(--critical); font-weight: 700; }
.cq-page .cq-sheets { margin-top: var(--s4); }
.cq-answer {
  max-width: 600px; margin: var(--s5) auto 0; padding: var(--s4); display: grid; gap: var(--s3);
  background: var(--card); border: 2px solid transparent; border-radius: var(--r-xl); box-shadow: var(--shadow-card);
}
.cq-answer:focus { outline: none; }
.cq-answer:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }
.cq-answer-title { margin: 0; font-size: var(--fs-xl); font-weight: 700; }
.cq-answer textarea.in { resize: vertical; min-height: 4.5em; }
.cq-answer .in[aria-invalid="true"] { border-color: var(--critical); }
.cq-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cq-legal { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.cq-error { margin: 0; color: var(--critical); font-weight: 600; font-size: var(--fs-sm); }
.cq-answer.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.cq-answer.is-no { border-color: var(--line-strong); }
.cq-done { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.cq-answer.is-ok .cq-done { color: var(--ok); }
.cq-reason { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cq-dead {
  max-width: 520px; margin: 12vh auto 0; display: grid; justify-items: center; gap: var(--s3);
  text-align: center; font-size: var(--fs-lg);
}
.cq-dead p { margin: 0; }

/* Agenda partagé (v1.3, lot 7) : indisponibilités du profil, boutons du Rétroplanning */
.retro-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.retro-actions .lbl-short { display: none; }
@media (max-width: 520px) {
  /* Libellés courts ; avec Lexend, plus large, les boutons passent sur deux rangées à 360 px plutôt que de sortir de l'écran. */
  .retro-actions { flex-wrap: wrap; gap: 10px 6px; max-width: 100%; }
  .retro-actions .btn { flex: 1 1 auto; min-height: 38px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
  .retro-actions .btn .ico { display: none; }
  .retro-actions .lbl-long { display: none; }
  .retro-actions .lbl-short { display: inline; }
}
.unav-list { list-style: none; margin: 0 0 var(--s3); padding: 0; display: grid; gap: var(--s2); }
.unav-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow-card); }
.unav-when { font-weight: 600; }
.unav-empty { margin: 0 0 var(--s3); }
.unav-note { color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; flex: 1 1 140px; }
.unav-item .icon-btn { margin-left: auto; }
.unav-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); align-items: start; }
.unav-form > .field + .field { margin-top: 0; }
/* Une date garde sa largeur propre : sans ceci, à 360 px, la seconde sortait de la marge de la page. */
.unav-form > .field { min-width: 0; }
.unav-form .in { width: 100%; min-width: 0; }
.unav-form .btn { align-self: center; justify-self: start; margin-top: 22px; }
.unav-error { margin: var(--s2) 0 0; color: var(--critical); font-weight: 600; font-size: var(--fs-sm); }
@media (max-width: 520px) { .unav-form .btn { margin-top: 0; } }
.find-date .checks { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.find-results { display: grid; gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line); }
.find-title { margin: var(--s2) 0 0; font-size: var(--fs-md); font-weight: 700; }
.find-list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }


/* ---------- Écrans d'accès de la version serveur (phase 2) ----------
   Connexion, lien reçu, installation, double authentification. Maquette A : logo en grand, carte blanche au centre,
   et sous la carte, l'encadré « Oubli ». Clavier ouvert (hauteur réduite) : moins d'air au-dessus du logo. */
.page:is([data-route='login'], [data-route='activate'], [data-route='install'], [data-route='mfa']) { padding: 0; }
.access { max-width: 440px; margin: 0 auto; padding: 72px 20px var(--s5); display: flex; flex-direction: column; gap: 28px; }
.access-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.access-logo { display: flex; align-items: flex-end; gap: 3px; }
.access-bars { display: inline-flex; align-items: flex-end; gap: 3px; }
.access-bars > span { width: 11px; border-radius: 5px 5px 0 0; }
.access-bars > span:nth-child(1) { height: 19px; background: var(--tape-dossier); }
.access-bars > span:nth-child(2) { height: 25px; background: var(--tape-prepa); }
.access-bars > span:nth-child(3) { height: 31px; background: var(--tape-tournage); }
.access-name { margin-left: 8px; font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.access-card { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5) 20px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.access-card .field + .field { margin-top: 0; }
.access-title { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.access .in { min-height: 48px; padding: 10px 12px; font-size: 16px; }
.access .pw > .in { min-height: 46px; }
.access-submit { margin-top: 6px; min-height: 50px; font-size: 16px; }
.access-error { margin: 0; color: var(--critical); font-weight: 600; font-size: 14px; }
.access-error[hidden] { display: none; }
.access-note { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 14px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow-card); }
.access-note p { margin: 0; font-size: 14px; color: var(--ink); }
.access-tag { flex: none; padding: 2px 9px; border-radius: var(--r-xs); background: var(--todo); box-shadow: 0 2px 0 var(--todo-edge); font-weight: 700; font-size: 13px; }
@media (max-height: 520px) { .access { padding-top: var(--s5); gap: var(--s4); } }

/* Mot de passe avec « Afficher » : un seul contour, celui du champ, avec le bouton dedans. */
.pw { display: flex; align-items: center; padding-right: 4px; border: 1px solid var(--field-edge); border-radius: var(--r-sm); background: var(--card); }
.pw:focus-within { outline: 3px solid var(--here); outline-offset: 1px; border-color: var(--here); }
.pw > .in { flex: 1; min-width: 0; border: 0; background: transparent; }
.pw > .in:focus { outline: none; }
.pw-toggle { flex: none; border-color: transparent; background: var(--wash); box-shadow: none; }
.pw-toggle:hover { border-color: transparent; background: var(--wash); }
.pw-toggle:active { transform: none; box-shadow: none; }

/* Logo moyen (lien reçu, installation) et en barre (mise en place de la double authentification). */
.access.is-mid { padding-top: 56px; gap: var(--s5); }
.access-brand.is-mid .access-bars > span, .access-brand.is-bar .access-bars > span { border-radius: 4px 4px 0 0; }
.access-brand.is-mid .access-bars > span { width: 9px; }
.access-brand.is-mid .access-bars > span:nth-child(1) { height: 15px; }
.access-brand.is-mid .access-bars > span:nth-child(2) { height: 20px; }
.access-brand.is-mid .access-bars > span:nth-child(3) { height: 25px; }
.access-brand.is-mid .access-name { margin-left: 7px; font-size: 25px; }
.access-brand.is-bar .access-bars { gap: 2px; }
.access-brand.is-bar .access-bars > span { width: 8px; }
.access-brand.is-bar .access-bars > span:nth-child(1) { height: 14px; }
.access-brand.is-bar .access-bars > span:nth-child(2) { height: 18px; }
.access-brand.is-bar .access-bars > span:nth-child(3) { height: 22px; }
.access-brand.is-bar .access-name { margin-left: 6px; font-size: 20px; }
.access-lead { margin: 0; color: var(--ink-2); }
.access-lead strong { color: var(--ink); overflow-wrap: anywhere; }
.access-small { font-size: var(--fs-sm); }
.access-hint { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--wash); font-size: var(--fs-sm); color: var(--ink); }
.access-foot { margin: 0; padding: 0 var(--s2); font-size: var(--fs-sm); color: var(--ink-2); text-align: center; }
.access-foot.access-left { padding: 0; text-align: left; }
.access-intro { display: flex; flex-direction: column; gap: 6px; }
.access-link { min-height: 48px; margin-top: 6px; }
.access-tag-dead { align-self: flex-start; background: var(--critical-soft); color: var(--critical); box-shadow: none; }
.access-dead { gap: 14px; }
.access-dead .access-title { font-size: 24px; }
.access-textbtn {
  align-self: center; min-height: var(--tap); padding: 0 var(--s2); border: 0; border-radius: var(--r-sm); background: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.access-textbtn:hover { color: #000; }
.access-textbtn:disabled { color: var(--on-off); cursor: not-allowed; }
/* Code à 6 chiffres : grand, centré, espacé. */
.access .in.in-code { min-height: 60px; padding: 8px 14px; border-radius: 12px; font-size: 30px; font-weight: 600; letter-spacing: 0.18em; text-align: center; }
.access .in.in-code::placeholder { color: var(--on-off); }
.access .in.in-code-setup { min-height: 54px; font-size: 26px; }
.access .in.in-install-code { font-size: 18px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* Nouveau mot de passe : la longueur, suivie pendant la frappe (jaune tant qu'il manque des caractères). */
.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: var(--s1); }
.pw-meter-bar { flex: 1; display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--rail); box-shadow: inset 0 1px 2px rgba(107, 64, 40, 0.2); }
.pw-meter-fill { width: 0; background: var(--todo); transition: width 0.15s ease; }
.pw-meter[data-ok='true'] .pw-meter-fill { background: var(--tape-collectif); }
.pw-meter-text { flex: none; font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Installation : trois cartes, les vérifications disent leur état avec des mots. */
.access.install { padding: 40px 18px 32px; gap: 20px; }
.access.install .access-brand { align-items: flex-start; }
.install-form { display: flex; flex-direction: column; gap: 20px; }
.install-card { padding: 18px var(--s4); gap: 14px; }
.install-step { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.install-checks { margin: 0; padding: 0; list-style: none; }
.install-check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 6px 0; border-bottom: 1px solid var(--line); }
.install-check:last-child { border-bottom: 0; }
.install-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.install-hint { display: block; font-size: var(--fs-sm); color: var(--ink-2); }
.install-state { flex: none; padding: 2px 9px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; }
.install-state[data-state='ok'] { background: var(--ok-soft); color: var(--ok); }
.install-state[data-state='bad'] { background: var(--critical-soft); color: var(--critical); }
.install-state[data-state='look'] { background: var(--warning-soft); color: var(--warning); }
.install-form .access-submit { min-height: 52px; margin-top: 0; }

/* Mise en place de la double authentification : barre avec « Se déconnecter », trois étapes numérotées. */
.access.mfa-setup { padding: 0 0 32px; gap: 0; }
.access-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 12px 0 var(--s4); box-shadow: 0 1px 0 rgba(107, 64, 40, 0.07); }
.access-head .access-textbtn { color: var(--ink-2); text-decoration: none; }
.access-body { display: flex; flex-direction: column; gap: 18px; padding: 20px 18px 0; }
.mfa-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.mfa-step { display: flex; gap: var(--s3); padding: var(--s4); background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.mfa-num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--todo); font-weight: 700; }
.mfa-step-text { margin: 4px 0 0; }
.mfa-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.mfa-step-body .field-label { margin-top: 4px; font-size: var(--fs-md); font-weight: 400; color: var(--ink); }
.mfa-keybox { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s3); border-radius: 12px; background: var(--wash); }
.mfa-key { font-size: 17px; font-weight: 600; letter-spacing: 0.06em; word-spacing: 0.2em; line-height: 1.5; overflow-wrap: anywhere; user-select: all; }
.mfa-open { min-height: 46px; }

/* ---------- Admin › Membres, version serveur (maquette « Membres A ») : liste compacte, fiche de chaque compte ---------- */
.mb-list { margin: 0; padding: 4px 14px; list-style: none; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.mb-list > li + li { border-top: 1px solid var(--line); }
.mb-row { display: flex; align-items: center; gap: var(--s3); min-height: 66px; padding: 6px 0; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); }
a.mb-row:hover .mb-name-text { text-decoration: underline; text-underline-offset: 3px; }
.mb-row .avatar { flex: none; }
.mb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mb-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-weight: 700; }
.mb-name-text { overflow-wrap: anywhere; }
.mb-line { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.mb-chevron { flex: none; color: var(--ink-2); }
.mb .le-foot { margin-top: var(--s3); }
.mb-archived { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); padding: 6px 0 var(--s3); }
.mb-archived .mb-row { min-height: 52px; flex: 1 1 200px; }
.mb-page { display: flex; flex-direction: column; gap: 14px; }
.mb-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; }
.mb-back:hover { color: var(--ink); }
.mb-head { display: flex; align-items: center; gap: var(--s3); }
.mb-head .avatar { flex: none; width: 44px; height: 44px; font-size: 16px; }
.mb-head-text { min-width: 0; display: flex; flex-direction: column; }
.mb-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.mb-card { display: flex; flex-direction: column; gap: 14px; padding: 18px var(--s4); background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.mb-card .field + .field { margin-top: 0; }
.mb-card-title { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.mb-email { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-height: var(--tap); }
.mb-email-text { font-weight: 600; overflow-wrap: anywhere; }
.mb-role .dd { max-width: 60%; }
.mb-mfa { display: flex; flex-direction: column; gap: 6px; padding-top: var(--s3); border-top: 1px solid var(--line); }
.mb-mfa .btn { align-self: flex-start; }

/* Lien montré une seule fois et mot de passe redemandé. */
.once-link { background: var(--wash); font-size: 14px; }
.once-until { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--warning-soft); color: var(--ink); font-size: var(--fs-sm); }
.reauth-lead { margin: 0; color: var(--ink-2); }

/* ---------- Admin › Journal (maquette « Journal A ») ---------- */
.jr { display: flex; flex-direction: column; gap: var(--s3); }
.jr-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.jr-chip {
  min-height: 36px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: var(--card);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); cursor: pointer; position: relative;
}
.jr-chip::before { content: ''; position: absolute; inset: -4px -2px; } /* cible de 44 px */
.jr-chip[aria-pressed='true'] { border-color: var(--here); background: var(--tint-tournage); font-weight: 700; }
.jr-who .dd-trigger { min-height: 36px; font-size: var(--fs-sm); }
.jr-day { margin: 6px 0 0; font-size: var(--fs-md); font-weight: 700; color: var(--ink-2); }
.jr-list { margin: 0; padding: 2px 14px; list-style: none; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.jr-item { display: flex; gap: var(--s3); padding: var(--s3) 0; }
.jr-item + .jr-item { border-top: 1px solid var(--line); }
.jr-time { flex: none; width: 46px; font-weight: 700; font-variant-numeric: tabular-nums; }
.jr-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.jr-tag { padding: 1px 7px; border-radius: 6px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.jr-tag[data-tone='connexions'] { background: var(--tint-tournage); }
.jr-tag[data-tone='refusee'] { background: var(--critical-soft); color: var(--critical); }
.jr-tag[data-tone='comptes'] { background: var(--tint-prepa); }
.jr-tag[data-tone='securite'] { background: var(--tint-post); }
.jr-tag[data-tone='reglages'] { background: var(--tint-dossier); }
.jr-tag[data-tone='prestas'] { background: var(--tint-collectif); }
.jr-meta { font-size: var(--fs-xs); color: var(--ink-3); }
.jr-more { align-self: center; }

/* ---------- Mon profil › Connexion et sécurité (version serveur) ---------- */
.security { display: flex; flex-direction: column; gap: 14px; }
.security .sec-title { margin: 0; }
.security > p { margin: 0; }
.security strong { color: var(--ink); overflow-wrap: anywhere; }
.sec-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--wash); }
.sec-box .field + .field { margin-top: 0; }
.sec-box > .btn { align-self: flex-start; }
.sec-box-title { margin: 0; font-size: var(--fs-md); font-weight: 700; }
.sec-box .pw, .sec-box .in { background: var(--card); }
.sec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: var(--tap); }
.sec-row-main { flex: 1 1 180px; display: flex; flex-direction: column; }
.sec-logout { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.mfa-change .mfa-key { font-size: 16px; }

/* ---------- Phase 2, lot 2 : « Depuis ton dernier passage » (maquette A + C) ---------- */
/* La liste en tête de la Vue d'ensemble ; le sommaire en tire ses repères, la pilule « Sommaire » un point bleu. */
.news { display: flex; flex-direction: column; gap: 10px; }
.news-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.news-title { margin: 0; font-size: 17px; font-weight: 700; }
.news-since, .news-note { font-size: 13px; color: var(--ink-2); }
.news-list { list-style: none; margin: 0; padding: 4px 14px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-card); }
.news-list li + li { border-top: 1px solid var(--line); }
.news-line { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.news-line .avatar { flex: none; }
.news-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.news-tag { align-self: flex-start; padding: 1px 7px; border-radius: 6px; background: var(--tint); font-size: 12.5px; font-weight: 700; }
.news-chev { flex: none; width: 16px; height: 16px; color: var(--ink-2); stroke-width: 2.5; }
.news-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.news-foot .btn { flex: none; }
.dnav-new { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--today-ink); font-size: 13px; font-weight: 700; }
.dnav-new::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--here); }
.dnav-new.is-count { padding: 1px 8px; border-radius: 6px; background: var(--today-bg); }
.dnav-new.is-count::before { content: none; }
.dnav-newslead { margin: 0 8px var(--s3); padding: 12px 14px; border-radius: 16px; background: var(--today-bg); color: var(--today-ink); font-size: 14px; font-weight: 600; }
.pbar-open { position: relative; }
.pbar-dot { position: absolute; top: 7px; right: 9px; width: 12px; height: 12px; box-sizing: border-box; border: 2px solid var(--card); border-radius: 50%; background: var(--here); }


/* ---------- Phase 2, lot 3 : les fichiers (maquettes A + C, E, E2, E3, E4) ---------- */
/* Menu « ⋯ » : une ligne d'en-tête (nom, taille, auteur), des éléments avec leur icône. */
.menu-caption { margin: 0; padding: 8px var(--s3) 6px; font-size: var(--fs-xs); color: var(--ink-2); overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.menu-item { display: flex; align-items: center; gap: 10px; }
.menu-item .ico { flex: none; width: 18px; height: 18px; }

/* Documents : une ligne par fichier (pastille de la famille, nom, taille et auteur, « Ouvrir » ou « Télécharger », « ⋯ »). */
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.doc-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0; border-top: 1px solid var(--line); }
.doc-list:first-child > .doc-row:first-child { border-top: 0; }
.thumbs + .doc-list { margin-top: var(--s3); }
.doc-ico { flex: none; width: 40px; height: 46px; box-sizing: border-box; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; border-radius: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.fam-pdf { background: var(--critical-soft); color: var(--critical); }
.fam-word { background: var(--today-bg); color: var(--today-ink); }
.fam-sheet, .fam-svg { background: var(--ok-soft); color: var(--ok); }
.fam-slides { background: var(--tint-dossier); color: var(--cat-orange); }
.fam-zip { background: var(--warning-soft); color: var(--warning); }
.fam-font { background: var(--tint-post); color: var(--cat-indigo); }
.fam-other { background: var(--wash); color: var(--cat-chocolat); }
.doc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.doc-caption { font-size: var(--fs-xs); color: var(--ink-2); }
.doc-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: var(--fs-xs); color: var(--ink-2); }
.doc-act { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 6px; font-size: 14px; font-weight: 600; color: var(--ink); text-underline-offset: 3px; }
.doc-act .ico { margin: 0; }
.doc-row .menu { flex: none; }
.doc-row .menu-btn { color: var(--ink); }
.doc-row .menu-btn .ico { stroke-width: 3.4; }
.doc-figure { padding: 4px 12px; border-radius: var(--r-md); background: var(--wash); }
.doc-figure > .doc-row { border-top: 0; }

/* « Fichiers du dossier » : des vignettes carrées, comme la maquette. */
.thumbs-files .thumb { width: 112px; }
.thumbs-files .thumb img, .thumbs-files .up-box { width: 112px; height: 112px; }

/* Envois en cours : la vignette se remplit à sa place (anneau, pourcentage), la croix arrête l'envoi. */
.up-box { position: relative; display: grid; place-items: center; width: 96px; height: 72px; overflow: hidden; background: var(--wash); }
.thumbs-lg .up-box { width: 168px; height: 112px; }
.mood-img.up-tile .up-box { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.up-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.up-tile.is-waiting .up-box { border: 2px dashed var(--line-strong); box-sizing: border-box; }
.up-wait { position: relative; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.up-ring { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 4px rgba(107, 64, 40, 0.25); }
.up-ring-svg { position: absolute; inset: 4px; width: 44px; height: 44px; transform: rotate(-90deg); }
.up-track, .up-arc { fill: none; stroke-width: 4; }
.up-track { stroke: var(--line); }
.up-arc { stroke: var(--here); stroke-linecap: round; }
.up-tile.is-done .up-arc { stroke: var(--ok); }
.up-pct { position: relative; font-size: 12px; font-weight: 700; color: var(--ink); }
.up-pct .ico { width: 18px; height: 18px; color: var(--ok); }
.up-tile .up-stop { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.95); box-shadow: 0 1px 3px rgba(107, 64, 40, 0.3); }
.mood-img.up-tile { position: relative; }
.mood-img.up-tile .thumb-name { padding: 6px var(--s3); font-size: var(--fs-sm); }
.up-bar { display: block; width: 100%; height: 6px; margin: 4px 0 2px; border: 0; border-radius: 3px; appearance: none; background: var(--line); overflow: hidden; }
.up-bar::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.up-bar::-webkit-progress-value { background: var(--here); border-radius: 3px; }
.up-bar::-moz-progress-bar { background: var(--here); border-radius: 3px; }

/* Une ligne d'avancée, un encadré pour ce qui n'est pas parti. */
.up-status { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.up-status[hidden] { display: none; }
.up-line { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.up-line strong { color: var(--ink); }
.up-fail { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px var(--s3); align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--critical-soft); }
.up-fail-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.up-fail-text { display: flex; flex-direction: column; min-width: 0; }
.up-fail-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-width: 0; }
.up-fail-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-tag { flex: none; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; }
.up-tag.badge-crit { background: var(--card); color: var(--critical); }
.up-tag.badge-warn { background: var(--warning-soft); color: var(--warning); }
.up-lead { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.up-fail-why { font-size: var(--fs-sm); font-weight: 600; color: var(--critical); overflow-wrap: anywhere; }
.up-fail-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s2); }

/* « Supprimer plusieurs… » : une case sur ce qu'on peut supprimer, la barre du bas (nombre, poids, actions). */
.thumb.is-pickable { cursor: pointer; }
.thumb.is-pickable:has(.pick-box:checked) { outline: 3px solid var(--here); outline-offset: -1px; }
.thumb .pick-box { position: absolute; top: 6px; left: 6px; z-index: 1; width: 24px; height: 24px; margin: 0; accent-color: var(--here); }
.thumb-name { display: block; }
.doc-pick { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; }
label.doc-pick { cursor: pointer; }
.doc-pick .pick-box { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--here); }
.pick-bar-wrap { position: sticky; bottom: 8px; z-index: 16; margin-top: var(--s4); }
html:has(.editbar:not([hidden])) .pick-bar-wrap { bottom: 72px; }
.pick-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px var(--s3); padding: 12px var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-pop); }
.pick-count { margin: 0; font-weight: 700; }
.pick-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--s2); }
.pick-all { color: var(--here-ink); }

/* Admin › Réglages › « Serveur et fichiers » (planche F) : une carte par sujet. */
.server-panel { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s4); }
.server-panel .sec { margin: 0; }
.server-panel .sec-title { margin: 0 0 var(--s2); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: 9px 0; border-top: 1px solid var(--line); }
.check-row:first-child { border-top: 0; }
.check-label { min-width: 0; overflow-wrap: anywhere; }
.check-row .badge { flex: none; }
.limit-field { margin-top: var(--s3); }
.limit-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); }
.in-num { width: 96px; flex: none; }
.limit-unit { font-weight: 600; }
.server-panel .form-foot { align-items: center; margin-top: var(--s4); }
.field-msg.is-error { color: var(--critical); }
.server-panel .field-msg:empty { display: none; }
.test-rows { list-style: none; margin: var(--s3) 0 0; padding: 6px var(--s3); border-radius: var(--r-md); background: var(--wash); }
.test-rows[hidden] { display: none; }
.test-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px var(--s3); padding: 4px 0; }
.test-size { flex: none; }
.test-status { flex: 1 1 0; min-width: 0; font-weight: 700; color: var(--ink-2); text-align: right; overflow-wrap: anywhere; }
/* Lot 4 : la barre d'un envoi en cours (largeur posée par la page dans --v, entre 0 et 1), et le téléchargement. */
.test-bar { flex: 1 1 100%; height: 8px; border-radius: 4px; background: var(--rail); overflow: hidden; }
.test-bar-fill { display: block; height: 100%; width: calc(var(--v, 0) * 100%); border-radius: 4px; background: var(--key); }
.test-download { border-top: 1px solid var(--line-strong); margin-top: 2px; padding-top: 6px; font-weight: 700; }
.test-status.is-ok { color: var(--ok); }
.test-status.is-no { color: var(--critical); }
.test-out { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); margin-top: var(--s3); }
.test-out:empty { display: none; }
.test-result { margin: 0; font-weight: 700; }

/* Prestas : la place des fichiers à 80 % ou plus (admins, planche G). */
.files-alert { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); padding: 12px var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-card); }
.files-alert .badge { flex: none; }
.files-alert-text { flex: 1 1 auto; min-width: 0; margin: 0; }
.files-alert-link { flex: none; font-weight: 700; color: var(--ink); }

/* ---------- Phase 2, lot 4 : « Je suis indisponible ce jour-là » (agenda du Rétroplanning) ---------- */
/* Sous la liste d'un jour à venir : le bouton, ou « Tu es indisponible ce jour-là » (rien dans le mois : choix de
   Sacha, 18 novembre). */
.ag-off { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s3); }
.ag-off-state { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; font-weight: 600; }
.ag-off-state .ico, .ag-off .btn .ico { color: var(--me-off); }
.ag-off-link { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 600; }
@media (max-width: 640px) {
  .ag-off { flex-direction: column; align-items: flex-start; }
}

/* ---------- Phase 2, lot 4 : « Mon agenda dans mon téléphone » (planche A) et le lien d'un membre (planche D) ---------- */
.agenda-link { display: grid; gap: var(--s3); }
.al-head, .mb-agenda-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.al-lead { margin: 0; color: var(--ink-2); }
.al-once { margin: 0; font-weight: 600; }
.al-status { margin: 0; overflow-wrap: anywhere; }
.al-url { width: 100%; min-width: 0; font-size: var(--fs-sm); text-overflow: ellipsis; }
.al-help { display: grid; gap: var(--s2); padding: var(--s3); border-radius: var(--r-md); background: var(--wash); font-size: var(--fs-sm); }
.al-help p { margin: 0; overflow-wrap: anywhere; }
.al-help-title { font-weight: 700; }
.al-error { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.al-error p { margin: 0; }
.mb-agenda-none { font-weight: 600; color: var(--ink-2); }

/* Export PDF : aperçu en pages A4 à l'écran, puis impression (une page par bloc, en-tête et pied répétés).
   Refonte visuelle : même langage que l'appli, adapté à l'A4. Lexend embarquée, titres de blocs en onglets de classeur
   aux couleurs d'étape (texte foncé), coins arrondis ; des filets fins à la place des ombres ; lisible imprimé en noir
   et blanc (couleurs claires, texte foncé, jamais la couleur seule) ; montants en chiffres tabulaires. */

.export-tools { max-width: 760px; }
.export-version { margin-top: var(--s2); }
.print-help { max-width: 794px; margin: 0 auto var(--s4); padding: var(--s3) var(--s4); background: var(--marker-soft); border: 1px solid var(--marker-line); border-radius: var(--r-md); }
.print-root {
  --fs-xs: 10.5px; --fs-sm: 11.5px; --fs-md: 12.5px; --fs-lg: 14px; --fs-xl: 17px; --fs-2xl: 22px; --fs-3xl: 27px;
  --s3: 10px; --s4: 13px; --s5: 18px;
  margin: var(--s6) calc(-1 * var(--s4)) 0; padding: var(--s5) var(--s4); background: var(--off); border-radius: var(--r-lg);
  display: grid; justify-items: center; gap: 24px; font-size: var(--fs-md); line-height: 1.45;
}
.sheet {
  width: 100%; max-width: 794px; min-height: 1123px; background: #fff; border-collapse: collapse; table-layout: fixed;
  box-shadow: 0 1px 2px rgba(107, 64, 40, 0.12), 0 10px 30px rgba(107, 64, 40, 0.12);
}
.sheet > thead > tr > td, .sheet > tfoot > tr > td, .sheet > tbody > tr > td { padding: 0 48px; }
.sheet > tbody > tr > td { vertical-align: top; height: 100%; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 26px 0 10px; border-bottom: 2px solid var(--ink-2); font-size: 11px; }
.sheet-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12px; }
.sheet-brand img { height: 22px; width: auto; max-width: 90px; object-fit: contain; }
.sheet-ref { color: var(--ink-3); text-align: right; overflow-wrap: anywhere; }
.sheet-foot { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0 22px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--ink-3); }
.sheet-conf { color: var(--critical); }
.sheet-body { padding: 22px 0 28px; }
.sheet-cover { margin-bottom: 26px; }
.sheet-title { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 14px; overflow-wrap: anywhere; }
.sheet-block { display: inline-block; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.015em; margin-bottom: 16px; padding-bottom: 4px; border-bottom: 3px solid var(--ink-2); }
.sheet .kv { font-size: var(--fs-md); }
.p-sec { margin-top: 20px; }
.p-sub { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 8px; }
.p-lead { font-size: var(--fs-lg); margin-bottom: 10px; }
.p-gap { margin-top: 14px; }
.p-muted { color: var(--ink-3); font-size: var(--fs-sm); }
.p-empty { color: var(--ink-3); font-style: italic; }
.p-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; }
/* Tableaux : en-tête clair (teinte de l'étape, texte foncé, filet foncé dessous), coins arrondis, filets fins. */
.p-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.p-table th { background: var(--tint, var(--wash)); color: var(--ink); text-align: left; padding: 6px 8px; font-weight: 700; border-bottom: 1.5px solid var(--ink-2); }
.p-table th:first-child { border-top-left-radius: 8px; }
.p-table th:last-child { border-top-right-radius: 8px; }
.p-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-strong); vertical-align: top; }
.p-table tr:nth-child(even) td { background: var(--wash); }
.p-shots { list-style: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; }
.p-shot { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.p-box { width: 16px; height: 16px; margin-top: 1px; border: 2px solid var(--ink-2); border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 700; line-height: 1; }
.p-shot.is-done .p-box { background: var(--tint-tournage); color: var(--ink); }
.p-shot-title { font-weight: 600; }
.p-shot.is-done .p-shot-title { text-decoration: line-through; color: var(--ink-3); }
.p-note { margin-bottom: 14px; }
.p-note-who { font-weight: 700; margin-bottom: 4px; }
.p-alert-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; font-weight: 700; font-size: 11px; }
/* Dans les pages : des filets fins à la place des ombres (à l'écran comme à l'impression). */
.sheet :is(.tl-item, .tl-ms, .num-item, .pcard, .gcol, .tile, .box, .kv, .synth, .card, .callout, .alert, .ltc, .shots, .contacts,
  .lieu, .seqblock, .fds, .le-item, .notice, .mood-img, .swatch-card, .plot-wrap, .quote-page:not(.has-tab), .quote-page-body) { box-shadow: none; border: 1px solid var(--line-strong); }
.sheet .alert-tag { box-shadow: none; border: 1px solid currentColor; }
.sheet .alert-tag.is-todo { border-color: var(--todo-edge); }
.sheet .people { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sheet .pcard-initials { font-size: 30px; }
.sheet .pcard-photo:not(:has(img)) { aspect-ratio: 16 / 10; }
.print-foot-wrap { display: none; }
.sheet .gear { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sheet .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sheet .tl-item { grid-template-columns: 92px 1fr; }
.sheet .boxes { grid-template-columns: 1fr 1fr; }
.sheet .callout { padding: 12px 16px; }

/* v1.1 : chaque page porte la couleur de son étape (bande sous l'en-tête) ; couverture avec sommaire.
   Refonte visuelle : le titre du bloc est un onglet de classeur (coins du haut arrondis) posé sur un filet de la couleur de l'étape. */
.sheet-head { border-bottom: 3px solid var(--tape, var(--ink-2)); }
.sheet-block.tape {
  display: flex; width: 100%; margin-bottom: 18px; padding: 0; background: none; clip-path: none;
  font-size: var(--fs-xl); border-bottom: 3px solid var(--tape-dark, var(--ink-2));
}
.sheet-tab {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 18px 5px; border-radius: 12px 12px 0 0;
  background: var(--tape, var(--tape-dossier)); color: var(--on-tape, var(--ink)); box-shadow: inset 0 0 0 1px rgba(107, 64, 40, 0.18);
}
.sheet-title .marker { background: none; padding: 0; }
/* Le petit titre au-dessus du grand (« Dossier de préparation », « Devis ») : un onglet aussi. */
.cover-kicker .sheet-tab { padding: 4px 14px 3px; font-size: var(--fs-sm); font-weight: 700; }
.cover-kicker:has(.sheet-tab) { display: flex; margin-bottom: 12px; border-bottom: 2px solid var(--tape-dark, var(--ink-2)); }
.quote-sheet { --tape: var(--tape-prepa); --on-tape: var(--on-tape-prepa); --tint: var(--tint-prepa); --tape-dark: var(--edge-prepa); }
.sheet-cover { padding-top: 34px; }
.cover-kicker { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.cover-toc { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); }
.toc-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; }
.toc-group { break-inside: avoid; }
.toc-glabel { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.toc-swatch { width: 22px; height: 12px; background: var(--tape); border-radius: 6px 6px 0 0; box-shadow: inset 0 0 0 1px rgba(107, 64, 40, 0.25); }
.toc-list { padding-left: 24px; display: grid; gap: 4px; }
.toc-list li::marker { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }

.p-meta .spec { background: var(--wash); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 7px; color: var(--ink-2); }
.p-tasks td:first-child { white-space: nowrap; }
.p-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.p-swatch { display: grid; gap: 1px; font-size: var(--fs-sm); break-inside: avoid; }
.p-swatch .swatch { display: block; height: 54px; margin-bottom: 5px; border-radius: 10px; background: var(--sw, var(--off)); border: 1px solid rgba(107, 64, 40, 0.18); }
.p-mood { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.p-mood figure { break-inside: avoid; margin: 0; }
.p-mood img, .p-thumbs img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.p-mood figcaption { margin-top: 3px; font-size: var(--fs-xs); color: var(--ink-3); }
.p-lieux { display: grid; gap: 14px; }
.p-lieu { border: 1px solid var(--line-strong); border-left: 5px solid var(--tape-dark, var(--ink-2)); border-radius: 12px; padding: 12px 14px; break-inside: avoid; }
.p-lieu-name { font-size: var(--fs-lg); font-weight: 700; }
.p-lieu .p-meta { margin: 3px 0 8px; }
.p-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
/* Phase 2, lot 3 : un document par son nom et sa taille ; une image qui n'est pas arrivée, son nom à sa place. */
.p-doc { margin: 8px 0 0; }
.p-files { margin: 6px 0 0; padding-left: 16px; }
.p-missing { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 6px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: var(--fs-xs); color: var(--ink-2); text-align: center; overflow-wrap: anywhere; }
.p-setup + .p-setup { margin-top: 26px; }
.p-plot { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; break-inside: avoid; }
.p-plot .plot-legend { font-size: var(--fs-sm); }
.p-figure { margin: 10px 0 0; }
.p-figure img { max-width: 100%; max-height: 280px; border-radius: 10px; }
.p-seq { margin-top: 14px; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.p-seq-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 7px 10px; background: var(--strip, var(--wash)); border-bottom: 1px solid var(--line-strong); break-after: avoid; }
.p-seq-notes { padding: 6px 10px 0; font-size: var(--fs-sm); color: var(--ink-2); }
.p-seq .p-shots { padding: 0 10px; }
.p-shot.has-frame { grid-template-columns: 18px minmax(0, 1fr) 96px; }
.p-shot > img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.p-total { margin-top: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.p-versions { margin-top: 10px; break-inside: avoid; }
.p-version-list { padding-left: 18px; display: grid; gap: 6px; }
.p-fds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.p-fds + .p-fds { margin-top: 28px; }
.p-fds .fds-time-value { font-size: 20px; }
.p-fds .fds-time { padding: 8px 10px; }
.p-fds .sec { margin-top: 2px; }

/* Devis (v1.3, lot 4) : récapitulatif puis une page par personne */
.quote-doc .quote-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0; }
.quote-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; margin: 12px 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; }
.quote-meta > div { min-width: 0; }
.quote-meta .is-wide { grid-column: 1 / -1; }
.quote-meta dt { font-size: var(--fs-xs); color: var(--ink-3); }
.quote-meta dd { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.quote-party .p-sub { font-size: var(--fs-sm); margin-bottom: 4px; }
.quote-party-body { display: grid; gap: 2px; margin: 0; font-size: var(--fs-sm); }
.quote-party-line { display: block; }
.quote-recap, .quote-lines, .quote-rights-table { margin: 12px 0; }
.p-table .p-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-table th.p-amount { text-align: right; }
.quote-recap tfoot td { font-weight: 700; border-top: 2px solid var(--ink-2); border-bottom: 0; background: var(--tint, var(--wash)); }
.quote-recap tfoot td:first-child { border-bottom-left-radius: 8px; }
.quote-recap tfoot td:last-child { border-bottom-right-radius: 8px; }
.quote-doc .quote-sums { max-width: 340px; margin: 8px 0 12px auto; }
.quote-doc .quote-mention { font-size: var(--fs-xs); color: var(--ink-2); }
.quote-legal, .quote-accept-ref, .quote-rights-text { font-size: var(--fs-sm); margin: 12px 0; }
.quote-doc > .quote-party { margin: 12px 0; }
.quote-accept { margin-top: 16px; padding: 12px 14px; border: 1.5px solid var(--ink-2); border-radius: 14px; break-inside: avoid; }
.quote-accept p { margin: 0 0 6px; }
.quote-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.quote-sign-box { min-height: 56px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: var(--fs-xs); color: var(--ink-3); }
.quote-sign-box:last-child { grid-column: 1 / -1; min-height: 96px; }
.quote-conditions { margin: 4px 0 12px; padding-left: 1.2em; font-size: var(--fs-sm); }
.quote-draft { padding: 8px 12px; border: 2px dashed var(--critical); border-radius: 12px; color: var(--critical); font-weight: 700; }
.quote-doc .quote-number { font-size: 26px; }

@media (max-width: 860px) {
  .quote-doc .quote-parties { grid-template-columns: 1fr; }
  .quote-doc .p-table { display: table; font-size: var(--fs-xs); }
  .quote-doc .p-table th, .quote-doc .p-table td { padding: 6px 5px; }
  .print-root { margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); border-radius: 0; padding: 12px 8px; }
  .sheet { min-height: 0; }
  .sheet > thead > tr > td, .sheet > tfoot > tr > td, .sheet > tbody > tr > td { padding: 0 16px; }
  .sheet .people, .sheet .gear, .sheet .tiles { grid-template-columns: 1fr 1fr; }
  .p-shots, .sheet .boxes { grid-template-columns: 1fr; }
  .p-table { display: block; overflow-x: auto; }
  .toc-groups, .p-plot { grid-template-columns: 1fr; }
  .p-swatches, .p-mood, .p-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Pas de marge de page : le navigateur n'y ajoute ni date ni adresse ; l'en-tête et le pied de chaque page
   viennent du tableau (thead/tfoot répétés), les marges latérales du rembourrage des cellules. */
@page { size: A4; margin: 0; }

@media print {
  html, body, .page, .export { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .banners, .topbar, .no-print, .toasts, .editbar, dialog { display: none !important; }
  .page { max-width: none; margin: 0; padding: 0; }
  .export { max-width: none; }
  .print-root { display: block; margin: 0; padding: 0; background: none; border-radius: 0; }
  .sheet { width: 100%; max-width: none; min-height: 0; box-shadow: none; break-before: page; }
  .sheet:first-child { break-before: auto; }
  .sheet > thead > tr > td, .sheet > tfoot > tr > td, .sheet > tbody > tr > td { padding: 0 15mm; }
  .sheet-head { padding: 10mm 0 2.5mm; }
  .sheet-foot { padding: 2.5mm 0 8mm; }
  .sheet .people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet .gear { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .p-shots, .sheet .boxes { grid-template-columns: 1fr 1fr; }
  .p-table { display: table; }
  .toc-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-plot { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .p-swatches, .p-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .p-mood { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .p-fds + .p-fds { break-before: page; margin-top: 0; }
  /* La largeur d'une feuille A4 (environ 794 px) déclenche les règles du téléphone : le devis reprend ses deux colonnes. */
  .quote-doc .quote-parties { grid-template-columns: 1fr 1fr; }
  .quote-doc .quote-sign { break-inside: avoid; }
  /* Un devis par feuille dans le cas courant : lignes et intertitres plus serrés qu'à l'écran. */
  .quote-doc .p-table th, .quote-doc .p-table td { padding: 4px 6px; }
  .quote-doc .p-sub { margin: 10px 0 4px; }
  .quote-doc .quote-legal, .quote-doc .quote-accept-ref, .quote-doc .quote-rights-text, .quote-doc .quote-meta,
  .quote-doc .quote-parties, .quote-doc .quote-lines, .quote-doc .quote-recap, .quote-doc .quote-rights-table { margin: 8px 0; }
  .p-fds .fds-times { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tl-item, .tl-ms, .num-item, .pcard, .gcol, .tile, .box, .p-shot, .p-table tr, .alert, .callout, .p-note, .kv > div { break-inside: avoid; }
  .sheet-block, .p-sub, h3, h4 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
  /* Le pied du tableau ne sert plus qu'à réserver la place ; le vrai pied est fixé en bas de chaque page. */
  .sheet-foot { visibility: hidden; }
  .print-foot-wrap { display: block; }
  .print-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 16px; padding: 2.5mm 15mm 8mm; font-size: 10.5px; color: var(--ink-3); background: #fff; }
  .print-foot::before { content: ''; position: absolute; left: 15mm; right: 15mm; top: 0; border-top: 1px solid var(--line); }
  /* Plus aucune ombre sur papier : des filets fins. */
  .sheet *, .sheet *::before, .sheet *::after { box-shadow: none !important; }
}
