/* ETB ENERGIES — composants d'interface.
 * Mobile d'abord (téléphone), puis tablette (≥ 720 px) et PC (≥ 1024 px).
 * Tokens : etb.css. Aucune couleur en dur ici, sauf transparences. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--font-text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--link); }
a:hover { color: var(--ink); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--primary); text-wrap: balance; }
h1 { font-weight: 800; font-size: 32px; line-height: 1; }
h2 { font-weight: 700; font-size: 24px; line-height: 1.1; }
h3 { font-weight: 700; font-size: 19px; line-height: 1.15; }
p { margin: 0; text-wrap: pretty; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.cond { font-family: var(--font-display); font-weight: 700; }
.num { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 8px); flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Icônes (SVG en ligne, trait 1,8) ---------- */
.ic { display: inline-flex; flex: none; width: 20px; height: 20px; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Boutons (charte, page 08) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font: 600 15px/1 var(--font-text); text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primary:hover { color: var(--on-primary); border-color: var(--primary); opacity: .92; }
.btn--action { background: var(--action); border-color: var(--action); color: var(--on-action-text); } /* texte de 15 px : encre (4,56:1) */
.btn--action:hover { color: var(--on-action-text); border-color: var(--action); filter: brightness(1.05); }
.btn--outline { background: transparent; border-color: var(--primary); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--sunk); border-color: transparent; }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: transparent; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn--lg { min-height: 56px; padding: 0 22px; font-size: 17px; }
.btn--block { width: 100%; }
.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }

/* ---------- Pastilles, étiquettes ---------- */
.dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--m-c, var(--ink-3)); }
.trade { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px; padding: 2px 9px; border-radius: 999px;
  background: var(--sunk); color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--info { background: var(--info-soft); color: var(--info); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--urgent { background: var(--action); color: var(--on-action-text); }
.pill--outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.pill--dark { background: var(--primary); color: var(--on-primary); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  font: 700 12px/1 var(--font-text); letter-spacing: .02em;
}
.avatar--lg { width: 40px; height: 40px; font-size: 15px; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 13px; color: var(--ink-3); }
.input, .select, .textarea {
  /* max-width : une liste « largeur auto » (Technicien des Statistiques, du Suivi) avec un nom
     long reste dans l'écran (320 px) au lieu d'élargir la page */
  width: 100%; max-width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font: 400 16px/1.35 var(--font-text); /* 16 px : pas de zoom automatique sur iPhone */
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.error { font-size: 13px; color: var(--danger); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 14.5px/1 var(--font-text); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.segmented { display: inline-flex; align-self: flex-start; padding: 3px; gap: 3px; border-radius: calc(var(--radius) + 3px); background: var(--sunk); }
.segmented > button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--ink-2); font: 600 14px/1 var(--font-text); cursor: pointer;
}
.segmented > button[aria-pressed="true"], .segmented > button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px; }
.card--flat { box-shadow: none; border: 1px solid var(--line-soft); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 3px solid var(--primary); }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* Liste des clients rangée (lot 15 B) : Entreprises, Copropriétés (une sous-section par syndic), Particuliers */
.client-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.client-group__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
.client-group__head > :is(h2, h3) { min-width: 0; overflow-wrap: anywhere; }
.client-group--1 > .client-group__head { padding-bottom: 6px; border-bottom: 2px solid var(--line-soft); }
.client-group--2 { padding-left: 12px; border-left: 3px solid var(--line-soft); }
.client-group__count { font-family: var(--font-text); font-size: 14px; font-weight: 500; color: var(--ink-3); }

/* Compteurs du tableau de bord (ex-« Tableau de bord ») */
.kpi {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 14px 16px; border-left: 4px solid var(--m-c, var(--primary));
}
.kpi__n { font: 800 34px/1 var(--font-display); color: var(--primary); }
.kpi__label { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.kpi--alert { border-left-color: var(--action); }
.kpi--alert .kpi__n { color: var(--danger); }

/* ---------- Tuile de planning ----------
 * Couleur du métier (filet + pastille), technicien en pastille d'initiales.
 * .is-urgent : bord hachuré graphite / orange. .is-late : bordure orange. */
.tile {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 8px 12px 8px 14px; border-radius: 5px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
  border: 0; border-left: 4px solid var(--m-c, var(--ink-3));
  font: 400 13.5px/1.3 var(--font-text); cursor: pointer; text-align: left; color: var(--ink); width: 100%;
}
.tile__top { display: flex; align-items: center; gap: 6px; }
.tile__time { font: 700 15px/1 var(--font-display); color: var(--primary); }
.tile__type { font-size: 12px; font-weight: 600; color: var(--m-t, var(--ink-3)); text-transform: uppercase; letter-spacing: .08em; }
.tile__obj { font-weight: 600; }
.tile__addr { color: var(--ink-3); font-size: 12.5px; }
.tile__meta { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 2px; }
.tile.is-urgent { padding-right: 18px; }
.tile.is-urgent::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 7px;
  background: repeating-linear-gradient(-45deg, var(--action) 0 5px, var(--graphite) 5px 10px);
}
.tile.is-late { box-shadow: inset 0 0 0 1.5px var(--action), var(--shadow); }
.tile.is-done { background: var(--surface-2); }
.tile.is-done .tile__obj::before { content: "✓ "; color: var(--ok); }
.tile.is-done .tile__type { color: var(--ink-3); } /* fond gris : la couleur du métier reste sur le filet (contraste 5,8:1) */
.tile.is-cancelled { opacity: .55; }
.tile.is-cancelled .tile__obj { text-decoration: line-through; }

/* ---------- Carte de tournée (technicien) ---------- */
.tour {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 16px; border-top: 4px solid var(--m-c, var(--primary)); position: relative; overflow: hidden;
}
.tour.is-urgent::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: repeating-linear-gradient(-45deg, var(--action) 0 6px, var(--graphite) 6px 12px);
}
.tour__head { display: flex; align-items: baseline; gap: 10px; }
.tour__time { font: 800 30px/1 var(--font-display); color: var(--primary); }
.tour__obj { font: 700 20px/1.15 var(--font-display); color: var(--ink); }
.tour__addr { font-size: 16px; font-weight: 500; }
.tour__access { font-size: 14px; color: var(--ink-2); background: var(--sunk); border-radius: var(--radius); padding: 8px 10px; }
.tour__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tour__actions .btn { flex-direction: column; gap: 4px; min-height: 60px; font-size: 13px; padding: 6px; }
/* Fiche retirée (réattribuée, corbeille) ou annulée : grisée, sans actions */
.tour.is-withdrawn { background: var(--surface-2); box-shadow: none; border-top-color: var(--line); }
.tour.is-withdrawn .tour__time, .tour.is-withdrawn .tour__obj, .tour.is-withdrawn .tour__addr { color: var(--ink-2); }
.tour.is-withdrawn .tour__obj { text-decoration: line-through; }

/* ---------- Déroulé guidé (mode intervention) ---------- */
.progress { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 4px; }
.progress > span { height: 5px; border-radius: 3px; background: var(--line); }
.progress > span.is-done { background: var(--ok); }
.progress > span.is-current { background: var(--primary); }
.phase { display: flex; flex-direction: column; gap: 10px; }
.phase__head { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 3px solid var(--primary); }
.phase__head .eyebrow { color: var(--ink); }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.step__time { font: 700 16px/1.2 var(--font-display); color: var(--ink-2); }
.step__title { font-weight: 700; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos > * { aspect-ratio: 1; border-radius: var(--radius); background: var(--sunk); object-fit: cover; }

/* ---------- Coque de l'application ----------
 * Téléphone : barre du haut + barre d'onglets en bas + bouton d'action flottant.
 * PC (≥ 1024 px) : barre latérale graphite. */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--graphite); color: var(--papier);
}
.topbar__title { flex: 1; min-width: 0; font: 700 20px/1 var(--font-display); }
.topbar .btn--ghost { color: var(--papier); }
.topbar .btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 60px; padding: 4px 2px; color: var(--ink-3); text-decoration: none; font-size: 12.5px; font-weight: 600;
  text-align: center; line-height: 1.15;
}
.tabbar a[aria-current="page"] { color: var(--primary); }
.tabbar a[aria-current="page"] .ic { color: var(--action); }
.fab {
  position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 21;
  width: 56px; height: 56px; border-radius: 16px; border: 0;
  display: grid; place-items: center;
  background: var(--action); color: var(--on-action); box-shadow: var(--shadow-lg); cursor: pointer;
}
.fab .ic { width: 26px; height: 26px; }
.rail { display: none; }

@media (min-width: 1024px) {
  .shell { flex-direction: row; }
  .topbar, .tabbar, .fab { display: none; }
  .rail {
    position: sticky; top: 0; height: 100dvh; flex: none; width: 248px;
    display: flex; flex-direction: column; gap: 6px; padding: 24px 14px;
    background: var(--graphite); color: var(--papier);
  }
  .rail__brand { padding: 0 10px 20px; }
  .rail a {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
    border-radius: var(--radius); color: #C9CBCC; text-decoration: none; font-weight: 600;
  }
  .rail a:hover { background: rgba(255, 255, 255, .06); color: var(--papier); }
  .rail a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: var(--papier); }
  .rail a[aria-current="page"] .ic { color: var(--action); }
  .rail__new { margin: 0 0 14px; }
  .rail .avatar { background: var(--papier); color: var(--graphite); }
  .rail__foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 14px; }
  .main { padding: 28px 32px 48px; }
}

/* Bandeau de synchronisation (hors ligne / en attente d'envoi) */
.sync {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: var(--radius); background: var(--info-soft); color: var(--info); font-size: 14px; font-weight: 600;
}
.sync--offline { background: var(--sunk); color: var(--ink-2); }
.sync--offline::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }

/* ---------- Messages, fenêtres ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--graphite); color: var(--papier); box-shadow: var(--shadow-lg); font-size: 15px; }
.toast button { margin-left: auto; background: none; border: 0; color: #F08A73; font: 700 15px/1 var(--font-text); cursor: pointer; min-height: 44px; min-width: 44px; padding: 0 6px; margin-block: -10px; } /* orange clair de la charte : 6,5:1 sur graphite */
.toast--error { background: var(--alert-fixed); }
.toast--error button { color: var(--papier); text-decoration: underline; }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }

.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(17, 19, 21, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-height: 92dvh; overflow: auto;
  background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
@media (min-width: 720px) {
  .sheet-bg { align-items: center; }
  .sheet { width: min(560px, 92vw); border-radius: 14px; padding: 20px 24px; }
  .sheet::before { display: none; }
}

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 16px; color: var(--ink-3); }

/* ---------- Page de connexion ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; background: var(--graphite); color: var(--papier); }
.auth__box { width: min(420px, 100%); margin: auto; padding: 32px 20px; display: flex; flex-direction: column; gap: 28px; }
.auth__card { background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.auth__tag { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.1; color: var(--papier); }
.auth .flux-band { height: 6px; }

/* ---------- Grilles de mise en page ---------- */
.grid { display: grid; gap: var(--gap, 12px); align-items: start; grid-template-columns: repeat(auto-fill, minmax(var(--min, 240px), 1fr)); }

@media print {
  .rail, .topbar, .tabbar, .fab, .toasts { display: none !important; }
  body { background: #fff; }
}

/* =====================================================================
   Étape 4 : planning, fiche, historique
   ===================================================================== */
a.tile { text-decoration: none; }
a.tile:hover { color: var(--ink); box-shadow: 0 0 0 1.5px var(--line), var(--shadow); }
.avatar--xs { width: 22px; height: 22px; font-size: 10px; }
.sync--warn { background: var(--danger-soft); color: var(--danger); }
/* Compteur à zéro : effacé sans transparence, le texte reste lisible (I10) */
.kpi.is-zero { box-shadow: none; border-left-color: var(--line); background: transparent; }
.kpi.is-zero .kpi__n { color: var(--ink-3); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 519px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field.is-filled .input, .field.is-filled .textarea, .field.is-filled .select { border-color: var(--ventilation); background: color-mix(in srgb, var(--ok-soft) 50%, var(--surface)); }
.filters .select { width: auto; min-height: 44px; flex: 1 1 160px; }

/* Barre d'outils du planning */
.plan-toolbar { --gap: 8px; }
.plan-date { width: auto; min-height: 44px; }
.plan-label { font: 600 14px/1.2 var(--font-text); color: var(--ink-3); text-align: right; }
.plan-chips .chip { min-height: 36px; padding: 0 10px; font-size: 13.5px; }
/* Technicien masqué : contour pointillé, texte ardoise (6:1) plutôt qu'une transparence illisible */
.plan-chips .chip[aria-pressed="false"] { background: transparent; color: var(--ink-3); border-style: dashed; }
.plan-chips .chip[aria-pressed="false"] .avatar { background: var(--ink-3); color: var(--surface); }
.plan-chips .chip .muted { font-weight: 500; }
.plan-chips .chip[aria-pressed="true"] .muted { color: inherit; opacity: .8; }
.plan-chips .chip[aria-pressed="true"] .avatar { background: var(--on-primary); color: var(--primary); }
.plan-we { --gap: 6px; font-size: 14px; }
@media (max-width: 719px) { .plan-label { text-align: left; } }

/* Bandeau « À planifier » */
.plan-tray { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; border: 2px dashed transparent; }
.plan-tray.is-over { border-color: var(--action); }
.plan-tray__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-tray__list { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.plan-tray__list .tile { flex: 0 0 230px; scroll-snap-align: start; }

/* Vue semaine */
.wk-scroll { overflow-x: auto; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
/* N1 : la grille tient dans la largeur ; les objets longs passent à la ligne (plus de max-content) */
.wk { --techw: 170px; --dayw: 170px; display: grid; grid-template-columns: var(--techw) repeat(var(--days), minmax(var(--dayw), 1fr)); min-width: calc(var(--techw) + var(--days) * var(--dayw)); }
.wk__corner, .wk__day { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 3px solid var(--primary); }
.wk__day { font: 700 15px/1 var(--font-display); color: var(--primary); padding: 12px 10px; text-align: left; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.wk__day.is-today { color: var(--chauffage-texte); }
.wk__tech { position: sticky; left: 0; z-index: 1; display: flex; align-items: flex-start; gap: 8px; padding: 10px; background: var(--surface); border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); font-size: 13.5px; line-height: 1.3; }
.wk__tech.is-none { color: var(--ink-3); }
.wk__cell { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 92px; padding: 6px 6px 30px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); background: var(--surface-2); }
.wk__cell.is-today { background: color-mix(in srgb, var(--action) 5%, var(--surface-2)); }
.wk__cell.is-none { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 8px, var(--bg) 8px 16px); }
.wk__cell .tile { font-size: 12.5px; padding: 6px 8px 6px 10px; }
.wk__add { position: absolute; right: 4px; bottom: 4px; width: 28px; height: 24px; display: grid; place-items: center; border-radius: var(--radius); color: var(--ink-3); opacity: .55; }
.wk__add:hover, .wk__cell:hover .wk__add { opacity: 1; background: var(--sunk); color: var(--ink); }
.wk__cell.is-over, .dv__col.is-over { outline: 2px solid var(--action); outline-offset: -2px; background: color-mix(in srgb, var(--action) 8%, var(--surface)); }

/* Vue jour : axe horaire, colonne par technicien */
.dv-scroll { overflow: auto; max-height: calc(100dvh - 260px); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.dv { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(180px, 1fr)); grid-template-rows: auto var(--h); min-width: max-content; }
.dv__corner, .dv__head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 3px solid var(--primary); }
.dv__head { display: flex; align-items: center; gap: 6px; padding: 10px; font-weight: 700; font-size: 14px; min-width: 0; }
.dv__axis { position: relative; border-right: 1px solid var(--line-soft); }
.dv__axis span { position: absolute; right: 6px; transform: translateY(-50%); font: 600 11.5px/1 var(--font-text); color: var(--ink-3); }
.dv__axis span:first-child { transform: none; top: 2px !important; }
.dv__col { position: relative; border-right: 1px solid var(--line-soft); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px calc(var(--pph) / 2)); }
.dv__col.is-none { background-color: var(--surface-2); }
.dv__tile { position: absolute; overflow: hidden; cursor: grab; }
.dv__now { position: absolute; left: 0; right: 0; height: 2px; background: var(--action); z-index: 2; pointer-events: none; }
.dv__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--action); }

/* Agenda (téléphone, technicien) */
.agenda__day { font: 700 19px/1.1 var(--font-display); color: var(--primary); padding-bottom: 6px; border-bottom: 3px solid var(--primary); }
.agenda__day.is-today { color: var(--action); border-color: var(--action); }

/* Glisser-déposer */
.tile.is-dragging { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); transform-origin: 0 0; opacity: .95; }
.plan-board .tile, .plan-tray .tile { touch-action: pan-x pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Fiche */
.fiche { max-width: 920px; }
.fiche__head { display: flex; flex-direction: column; gap: 6px; padding-left: 14px; border-left: 5px solid var(--m-c, var(--primary)); }
.fiche__head h1 { font-size: 28px; }
.fiche__bar { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 5; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 10px 12px; }
@media (min-width: 1024px) { .fiche__bar { bottom: 16px; } }
.fiche details summary::-webkit-details-marker { color: var(--ink-3); }
.paste-os { border: 1.5px dashed var(--line); box-shadow: none; }

/* Historique */
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 3px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.timeline__item { position: relative; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.timeline__item::before { content: ""; position: absolute; left: -22px; top: 16px; width: 11px; height: 11px; border-radius: 50%; background: var(--line); border: 2px solid var(--bg); }
.timeline__item.is-current::before { background: var(--action); }
.changes { margin: 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.changes del { color: var(--ink-3); }
.changes ins { text-decoration: none; font-weight: 600; }
body[data-screen="fiche"] .fab, body[data-screen="devis"] .fab, body[data-screen="facture"] .fab, body[data-screen="ventes"] .fab, body[data-screen="stats"] .fab { display: none; }

/* =====================================================================
   Étape 5 : mode intervention, hors ligne
   ===================================================================== */
.netbar { position: sticky; top: 56px; z-index: 19; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 12px; background: var(--info-soft); color: var(--info); font-size: 13.5px; font-weight: 600; }
.netbar.is-offline { background: var(--graphite); color: var(--papier); }
.netbar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--action); }
.netbar__err { border: 0; border-radius: 999px; padding: 3px 10px; background: var(--alert-fixed); color: #fff; font: 700 12.5px/1 var(--font-text); cursor: pointer; }
.netbar a { color: inherit; }
@media (min-width: 1024px) { .netbar { top: 0; } }

.mission { max-width: 760px; margin: 0 auto; }
.mission__head { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 16px; border-top: 4px solid var(--m-c, var(--primary)); }
.mission__head h1 { font-size: 26px; }

.progress--labels { position: sticky; top: 56px; z-index: 6; background: var(--bg); padding: 8px 0; }
.progress--labels a { display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 600; text-align: center; }
.progress--labels a > span { height: 5px; border-radius: 3px; background: var(--line); }
.progress--labels a.is-done { color: var(--ok); }
.progress--labels a.is-done > span { background: var(--ok); }
.progress--labels a.is-current { color: var(--primary); }
.progress--labels a.is-current > span { background: var(--primary); }
@media (min-width: 1024px) { .progress--labels { top: 0; } }

.phase-card .phase__head { border-bottom-width: 3px; }
.phase-card .phase__head h2 { font-size: 21px; }
/* Rapport en deux parties (travaux, dépannage, lot 13) : les conclusions après les étapes ; limite de photos */
.part2-end { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.part2__title { font-size: 17px; color: var(--ink); }
.photo-limit { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--ink-2); }
.photo-btns .photo-limit { align-self: center; }
.phase__n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font: 800 15px/1 var(--font-display); flex: none; }

.step-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--m-c, var(--primary)); }
.step__heure { width: 112px; flex: none; font-family: var(--font-display); font-weight: 700; }
.chip--sm { min-height: 34px; padding: 0 11px; font-size: 13px; }
.pill__x { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; padding: 0 0 0 4px; cursor: pointer; min-height: 24px; }

.photos .photo { position: relative; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; background: var(--sunk); aspect-ratio: 1; cursor: zoom-in; }
.photos .photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__time { position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); padding: 1px 6px; border-radius: 999px; background: rgba(17, 19, 21, .7); color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo__pending { position: absolute; right: 4px; top: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--action); color: #fff; }
.photo-full { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: var(--radius); background: var(--sunk); }

.supplies { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.supplies li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius); background: var(--surface); font-size: 14.5px; }

.sign-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); min-height: 120px; }
.sign-img { max-width: 100%; max-height: 110px; object-fit: contain; background: #fff; border-radius: var(--radius); border: 1px solid var(--line-soft); }
.sheet--sign { max-height: 100dvh; }
@media (min-width: 720px) { .sheet--sign { width: min(760px, 96vw); } }
.sign-summary { white-space: pre-line; font-size: 17px; line-height: 1.45; padding: 12px; background: var(--sunk); border-radius: var(--radius); max-height: 30dvh; overflow: auto; }
.sigpad-wrap { position: relative; }
.sigpad { display: block; width: 100%; height: min(46dvh, 320px); border-radius: var(--radius); border: 1.5px solid var(--line); background: #fff; touch-action: none; cursor: crosshair; }
.sigpad-line { position: absolute; left: 24px; right: 24px; bottom: 28%; border-bottom: 1.5px dashed #B9BCC0; pointer-events: none; }
.sigpad-hint { position: absolute; left: 24px; bottom: calc(28% + 6px); font-size: 12px; color: #5F6368; pointer-events: none; } /* ardoise sur blanc : 6,05:1 */
@media (orientation: landscape) and (max-height: 500px) { .sigpad { height: 58dvh; } .sign-summary { display: none; } }

.missing { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
/* Signature : la zone de dessin reste visible sans défiler (récapitulatif limité en hauteur) */
.sheet--sign { -webkit-user-select: none; user-select: none; }
.sheet--sign input, .sheet--sign select { -webkit-user-select: text; user-select: text; }
.sheet--sign .sign-summary { max-height: 15dvh; font-size: 15px; padding: 8px 10px; }
.sheet--sign .sigpad { height: min(34dvh, 300px); }
.sheet--sign h2 { font-size: 20px; }
/* Annotation des photos */
.photo__annot { position: absolute; left: 4px; top: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--graphite); color: #fff; }
.sheet--annot { -webkit-user-select: none; user-select: none; }
@media (min-width: 720px) { .sheet--annot { width: min(960px, 96vw); } }
.annot-wrap { display: flex; justify-content: center; background: var(--sunk); border-radius: var(--radius); padding: 4px; }
.annot { display: block; touch-action: none; cursor: crosshair; border-radius: 4px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }

/* ---------- Étape 6 : adresses, catalogue, clients, sites ---------- */
.suggest-wrap { position: relative; }
.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg, var(--shadow));
  max-height: 300px; overflow-y: auto;
}
.suggest__item { padding: 10px; min-height: var(--tap); border-radius: calc(var(--radius) - 2px); cursor: pointer; }
.suggest__item[aria-selected="true"], .suggest__item:hover { background: var(--sunk); }
.suggest__src { padding: 4px 10px 2px; font-size: 11px; color: var(--ink-3); text-align: right; }

.segmented--scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented--scroll > button { white-space: nowrap; }
.seg-count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--sunk); font-size: 12px; font-weight: 700; }
.seg-count.is-warn { background: var(--action); color: var(--on-action-text); }

.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-group { margin-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.cat-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; align-items: center;
  width: 100%; padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow);
  font: inherit;
}
.cat-row:hover { box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); }
.cat-row.is-review { box-shadow: inset 4px 0 0 var(--action), var(--shadow); }
.cat-row.is-off { opacity: .6; }
.cat-row__main { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.cat-row__main .muted { font-size: 13px; }
.cat-row__num { display: flex; flex-direction: column; font-size: 14px; }
.cat-row__num .label { font-size: 11px; font-weight: 600; color: var(--ink-3); }
@media (min-width: 900px) {
  .cat-row { grid-template-columns: minmax(0, 1fr) 100px 100px 80px 80px; }
  .cat-row__main { grid-column: auto; }
  .cat-row__num { text-align: right; align-items: flex-end; }
}
.margin-box { padding: 10px 12px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); font-size: 14px; }
.margin-box.is-low { background: var(--danger-soft); color: var(--danger); }
.margin-box .muted { color: var(--ink-3); }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-line; }
.contact { padding: 8px 0; border-top: 1px solid var(--line-soft); }
.contact:first-of-type { border-top: 0; padding-top: 0; }
.contact .row { margin-top: 6px; }
.contact-edit { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.contact-edit > :nth-child(3), .contact-edit > :nth-child(4) { grid-column: span 1; }
.contact-edit > button { grid-row: 1; grid-column: 3; }
@media (min-width: 720px) { .contact-edit { grid-template-columns: 1.3fr 1fr 1fr 1.3fr auto; } .contact-edit > button { grid-row: auto; grid-column: auto; } }
button.tile { width: 100%; text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; }

/* Le lieu, vu par le technicien : équipements et dernières interventions */
.site-info { display: flex; flex-direction: column; gap: 8px; }
.site-info__eq { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius); background: var(--sunk); }
.site-info__hist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.site-info__hist li { padding-left: 12px; border-left: 3px solid var(--line); }

/* ---------- Étape 7 : devis, factures, encaissements ---------- */
.money-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; min-width: 140px; border: 0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.money-kpi strong { font: 700 22px/1.1 var(--font-display); color: var(--primary); }
.money-kpi .label { font-size: 12px; }
.money-kpi.is-alert { box-shadow: inset 0 0 0 2px var(--action), var(--shadow); }
.money-kpi.is-alert strong { color: var(--action); }
div.money-kpi { cursor: default; }

.doc-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.doc-row:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); }
.doc-row.is-late { box-shadow: inset 4px 0 0 var(--action), var(--shadow); }
.doc-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-row__main .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row__num { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 13px; flex: none; }
.doc-row__num strong { font-size: 16px; }
.docs-card .doc-row { box-shadow: none; border: 1px solid var(--line-soft); }
/* Lot 14 : « Facturée hors application le jj/mm/aaaa », la note, « Annuler la facturation externe » */
.ext-billed { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.ext-billed .pill { white-space: normal; }
.ext-billed__meta { min-width: 0; overflow-wrap: anywhere; }

.lines { display: flex; flex-direction: column; gap: 8px; }
.line { position: relative; display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }
.line > :first-child { flex: 1; min-width: 0; }
.line--titre { background: var(--sunk); }
.line--titre .input { font-weight: 700; }
.line--article { flex-wrap: wrap; }
.line--article .line__main { flex: 1 1 100%; }
.line--article.is-zero { box-shadow: inset 3px 0 0 var(--action); }
.line__des { min-height: var(--tap); resize: none; overflow: hidden; }
.line__nums { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.line__tools { display: flex; gap: 2px; align-self: flex-end; }
.line--article .line__tools { position: absolute; top: -12px; right: 8px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.line--article .line__main { padding-right: 0; }
.mini { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.mini .input, .mini .select { min-height: 40px; padding: 6px 8px; }
.mini--total { justify-content: flex-end; align-items: flex-end; }
.line__total { font: 700 16px/40px var(--font-display); color: var(--ink); }
/* Taux de TVA différent de celui du client : repère discret sous la désignation */
.line__note { display: block; margin-top: 4px; font-size: 12px; color: var(--info); }
.line__note::before { content: "● "; }
.line__note[hidden] { display: none; }
/* Ligne calculée (facture d'acompte, déduction d'un acompte) : non modifiable */
.line--fixed { background: var(--sunk); }
.line--fixed .line__main .pre { white-space: pre-line; }
.line--fixed .line__nums { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 900px) { .line--fixed .line__nums { flex: 0 0 220px; grid-template-columns: 70px 1fr; } }
.period-row { flex-wrap: wrap; align-items: center; }
.period-row > .grow { flex: 1 1 260px; min-width: 0; }
@media (min-width: 900px) {
  .line--article { flex-wrap: nowrap; }
  .line--article .line__main { flex: 1 1 auto; }
  .line__nums { flex: 0 0 520px; grid-template-columns: 70px 80px 100px 70px 80px 1fr; }
  .line--article .line__tools { position: static; box-shadow: none; align-self: center; }
}
.totals { display: flex; flex-direction: column; gap: 4px; margin-left: auto; width: min(100%, 360px); }
.totals__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.totals__ttc { padding-top: 6px; border-top: 2px solid var(--primary); font-size: 17px; }
.totals__ttc strong { font: 800 20px/1 var(--font-display); color: var(--primary); }
.plain-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }

/* Aperçu du document (le PDF à la charte arrive à l'étape 8) */
.paper { color-scheme: light; display: flex; flex-direction: column; gap: 16px; padding: 22px; background: var(--blanc); color: var(--graphite); border-radius: var(--radius-lg); box-shadow: var(--shadow); font-size: 13.5px; }
.paper .muted, .paper .label { color: var(--ardoise); }
.paper__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 3px solid var(--graphite); }
.paper__brand { font: 800 26px/1 var(--font-display); letter-spacing: .02em; }
.paper__brand span { margin-left: 6px; font: 600 11px/1 var(--font-text); letter-spacing: .3em; }
.paper__title { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.paper__title strong { font: 800 22px/1 var(--font-display); }
.paper__parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.paper__parties .label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.paper__table { display: flex; flex-direction: column; }
.paper__tr { display: grid; grid-template-columns: minmax(0, 1fr) 70px 80px 50px 90px; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--beton); }
.paper__tr > :not(:first-child) { text-align: right; }
.paper__th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ardoise); border-bottom: 2px solid var(--graphite); }
.paper__titre { grid-template-columns: 1fr; font-weight: 700; padding-top: 12px; }
.paper__texte { grid-template-columns: 1fr; color: var(--ardoise); }
.paper__totals .totals__ttc { border-top-color: var(--graphite); }
.paper__totals .totals__ttc strong { color: var(--graphite); }
.paper__mentions { font-size: 12px; color: var(--ardoise); display: flex; flex-direction: column; gap: 2px; }
.paper__foot { padding-top: 10px; border-top: 1px solid var(--beton); font-size: 11px; color: var(--ardoise); }
@media (max-width: 599px) {
  .paper { padding: 14px; }
  .paper__tr { grid-template-columns: minmax(0, 1fr) 90px; }
  .paper__tr > :nth-child(2), .paper__tr > :nth-child(3), .paper__tr > :nth-child(4) { display: none; }
  .paper__titre, .paper__texte { grid-template-columns: 1fr; }
}

/* ---------- Étape 9 : statistiques ---------- */
.money-kpi .hint { font-size: 12px; }
.now-bar { padding: 10px 14px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.now-bar .pill { text-decoration: none; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; height: 200px; padding-top: 4px; border-bottom: 1.5px solid var(--primary); }
.months__col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.months__n { font: 700 12px/1 var(--font-display); color: var(--ink-3); min-height: 12px; }
.months__bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.months__bars span { width: min(14px, 40%); min-height: 1px; border-radius: 2px 2px 0 0; }
.months__label { font-size: 11px; color: var(--ink-3); white-space: nowrap; transform: translateY(18px); height: 0; }
.months + * { margin-top: 18px; }
.months { margin-bottom: 20px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; color: var(--ink); text-decoration: none; }
.hbar__label { grid-row: span 2; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.hbar__track { height: 10px; border-radius: 5px; background: var(--sunk); overflow: hidden; }
.hbar__fill { display: block; height: 100%; border-radius: 5px; }
.hbar__text { font-size: 12px; color: var(--ink-3); }
a.hbar:hover .hbar__label { text-decoration: underline; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel__step { display: flex; align-items: baseline; gap: 10px; }
.funnel__n { min-width: 36px; text-align: right; font: 800 24px/1 var(--font-display); }
.dl--stats dd strong { font: 700 17px/1.2 var(--font-display); color: var(--primary); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 6px 8px; border-bottom: 1.5px solid var(--primary); white-space: nowrap; }
.table td { padding: 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table .r { text-align: right; }
@media (max-width: 599px) { .months__col:nth-child(even) .months__label { visibility: hidden; } .months { height: 170px; } }

/* Éditeur de devis et factures : raccourcis de facturation */
.quick-lines { display: flex; flex-direction: column; gap: 6px; }
.chip--quick { gap: 6px; height: auto; min-height: 40px; padding: 8px 14px; text-align: left; line-height: 1.25; justify-content: flex-start; max-width: 100%; }
.chip--quick > .ic { flex: none; }
.chip--quick .muted { font-weight: 500; white-space: nowrap; }
.quick-star { color: var(--chauffage-texte); }
.quick-row { display: flex; align-items: stretch; gap: 6px; }
.quick-row > .cat-row { flex: 1; min-width: 0; }
.quick-row__move { display: flex; flex-direction: column; justify-content: center; gap: 2px; }

/* Lot 10 C : lots de raccourcis, fiche à lier, périmètre d'assurance, relevés, imputations */
.chip--bundle { border-style: dashed; }
.chip--quick .qty { font-weight: 700; }
.bundle-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.bundle-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bundle-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px 44px; gap: 8px; align-items: center; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.link-row__main { min-width: 0; overflow-wrap: anywhere; }
.link-row.is-blocked { background: var(--sunk); }
.link-row .btn { flex: none; }
.insurance-warn { align-items: flex-start; font-weight: 500; }
.insurance-warn > .ic { flex: none; margin-top: 2px; }
.readings-chart { width: 100%; height: auto; display: block; overflow: visible; }
.readings-chart .axis { stroke: var(--line); stroke-width: 1; }
.readings-chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.readings-chart .line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.readings-chart .dot { fill: var(--surface); stroke: var(--primary); stroke-width: 2.5; }
.readings-chart .dot.is-notable { stroke: var(--danger); fill: var(--danger); }
.readings-chart text { fill: var(--ink-3); font: 500 11px/1 var(--font-text); }
.readings-chart .val { fill: var(--ink); font-weight: 700; }
.gap-notable { color: var(--danger); font-weight: 700; }
.chart-wrap { position: relative; border-radius: var(--radius); }
.chart-wrap:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.chart-tip { position: absolute; z-index: 2; min-width: 150px; padding: 6px 10px; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-size: 13px; pointer-events: none; white-space: nowrap; }
.pay-imputation { color: var(--ink-2); }
.table tr.is-total td { font-weight: 700; border-top: 1.5px solid var(--line); }
.line__note--warn { color: var(--danger); }
.link-row__note { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.link-row__lines { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; min-height: 32px; font-size: 13.5px; }
.readings-chart text.val { font-size: 12.5px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.fiche-why { display: block; font-size: 13px; color: var(--danger); margin-top: 2px; }

/* Barre d'actions sur téléphone : « Aperçu PDF » en icône seule, rien ne dépasse */
@media (max-width: 519px) {
  .fiche__bar .bar-label { display: none; }
  .fiche__bar .btn--lg { padding-inline: 14px; }
  .fiche__bar { gap: 6px; padding: 8px 10px; }
  .fiche__bar > .stack { min-width: 0; }
}
@media (max-width: 379px) { .fiche__bar { flex-wrap: wrap; } .fiche__bar .btn--lg { flex: 1 1 auto; } }

/* =====================================================================
   Lot 1 : hors ligne fiable (envois, mise à jour, chargement)
   ===================================================================== */
.netbar__btn { border: 0; border-radius: 999px; padding: 4px 10px; background: var(--surface); color: var(--ink); font: 700 12.5px/1.25 var(--font-text);
  cursor: pointer; text-decoration: none; text-align: left; }
.netbar a.netbar__btn { color: var(--ink); }
.netbar__muted { font-weight: 500; opacity: .8; }
.netbar-reason { display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-weight: 600; }
/* Lot 3 : ma saisie en entier dans un conflit, à relire ou copier */
.conflict__mine { max-height: 40vh; overflow: auto; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface-2); }
.updatebar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px;
  background: var(--graphite); color: var(--papier); font-size: 14px; font-weight: 600; }
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; overflow: hidden; pointer-events: none; }
.loadbar::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--action); animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .loadbar::after { animation: none; left: 0; width: 100%; opacity: .6; } }

/* =====================================================================
   Lot 6 : journal (RGPD)
   ===================================================================== */
.journal { display: flex; flex-direction: column; margin: 0; padding: 0; }
.journal__dates { flex: 1 1 320px; flex-wrap: nowrap; min-width: 0; }
.journal__dates .input { flex: 1 1 0; min-width: 0; }
.journal__row { display: grid; grid-template-columns: 128px 150px 190px minmax(0, 1fr) 120px; gap: 4px 12px; align-items: baseline;
  padding: 10px 4px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.journal__at { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.journal__who { font-weight: 600; overflow-wrap: anywhere; }
.journal__what .pill { white-space: normal; }
.journal__detail { overflow-wrap: anywhere; }
.journal__ip { font-variant-numeric: tabular-nums; font-size: 12.5px; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .journal__row { grid-template-columns: auto minmax(0, 1fr); }
  .journal__at { grid-column: 1; }
  .journal__who { grid-column: 2; text-align: right; }
  .journal__what, .journal__detail { grid-column: 1 / -1; }
  .journal__ip { grid-column: 1 / -1; text-align: left; }
  .journal__ip:empty { display: none; }
}

/* =====================================================================
   Lot 7b : ergonomie du gérant, réglages communs
   ===================================================================== */
/* Panneau de saisie touché sur le fond : il reste ouvert, avec un petit rappel (I2) */
.sheet.is-nudged { animation: sheet-nudge .28s ease; }
@keyframes sheet-nudge { 35% { transform: scale(1.012); } }
@media (prefers-reduced-motion: reduce) { .sheet.is-nudged { animation: none; } }

/* Glisser-déposer : aucun texte sélectionné, même depuis le bandeau (N8) */
body.is-plan-dragging, body.is-plan-dragging * { -webkit-user-select: none; user-select: none; cursor: grabbing; }

/* Vue semaine : colonnes resserrées quand la place manque, cinq jours visibles (N1) */
.wk__cell .tile__top { flex-wrap: wrap; row-gap: 2px; }
.wk__cell .tile__obj, .wk__tech strong { overflow-wrap: anywhere; }
@media (max-width: 1365px) {
  .wk { --techw: 132px; --dayw: 124px; }
  .wk__tech { flex-direction: column; gap: 4px; padding: 8px; }
  .wk__cell { padding: 5px 5px 30px; }
  .wk__cell .tile { padding: 6px 6px 6px 8px; }
}
@media (max-width: 1099px) { .wk { --techw: 112px; --dayw: 118px; } }
@media (max-width: 799px) { .wk { --techw: 104px; --dayw: 116px; } }
/* Semaine avec le week-end : 7 colonnes dans la même largeur (1920 px : 150 + 7 × 150 = 1200 px
   pour 1216 visibles ; 1366 px : 112 + 7 × 132 = 1036 pour 1054). Plus étroit, la grille défile. */
.wk.wk--7 { --techw: 150px; --dayw: 150px; }
@media (max-width: 1599px) {
  .wk.wk--7 { --techw: 112px; --dayw: 132px; }
  .wk--7 .wk__tech { flex-direction: column; gap: 4px; padding: 8px; }
  .wk--7 .wk__cell { padding: 5px 5px 30px; }
  .wk--7 .wk__cell .tile { padding: 6px 6px 6px 8px; }
}
@media (max-width: 1099px) { .wk.wk--7 { --techw: 104px; --dayw: 118px; } }

/* Téléphone : filtres et bandeau repliables (N8) */
.plan-fold { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 0; border: 0; background: none;
  color: var(--ink); font: 600 15px/1.2 var(--font-text); cursor: pointer; text-align: left; flex-wrap: wrap; }
.plan-fold > .ic:first-child { transition: transform .15s; }
.plan-fold[aria-expanded="true"] > .ic:first-child { transform: rotate(90deg); }
.plan-fold .muted { font-weight: 500; font-size: 13.5px; }
.plan-fold strong { font-weight: 700; }
@media (max-width: 719px) {
  .plan-toolbar .plan-date { flex: 1 1 140px; }
  .plan-tray { padding: 4px 12px; }
  .plan-tray__head .btn--action { display: none; } /* le bouton « + » flottant fait la même chose */
  .plan-filters { --gap: 4px; }
}

/* Téléphone, semaine : un bloc par jour, les techniciens en lignes (N8) */
.wkl { display: flex; flex-direction: column; gap: 16px; }
.wkl__day { display: flex; flex-direction: column; }
.wkl__head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 0 6px; border: 0; border-bottom: 3px solid var(--primary);
  background: none; color: var(--primary); font: 700 19px/1.1 var(--font-display); text-align: left; cursor: pointer; }
.wkl__head .muted { font: 500 13.5px/1 var(--font-text); }
.wkl__day.is-today .wkl__head { color: var(--chauffage-texte); border-color: var(--action); }
.wkl__row { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px; border-bottom: 1px solid var(--line-soft); }
.wkl__tech { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14.5px; }
.wkl__tech .muted { font-size: 13px; white-space: nowrap; }
.wkl__row.is-none .wkl__tech strong { color: var(--ink-3); }
.wkl__tiles { display: flex; flex-direction: column; gap: 6px; }

/* Le bouton « + » flottant ne cache plus la dernière tuile : marge en bas (N8) */
@media (max-width: 1023px) {
  body[data-role="admin"] .main { padding-bottom: calc(152px + env(safe-area-inset-bottom)); }
  body[data-screen="fiche"] .main, body[data-screen="devis"] .main, body[data-screen="facture"] .main,
  body[data-screen="ventes"] .main, body[data-screen="stats"] .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* Statistiques : sur quoi porte un délai, sous le chiffre (N7) */
.dd-note { display: block; margin-top: 2px; }

/* =====================================================================
   Lot 7a : ergonomie du technicien (audit du 30/09/2026)
   ===================================================================== */
/* N9 : ce qui ne se modifie pas se voit (fond gris, bord pointillé, « lecture seule ») */
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--sunk); border-style: dashed; color: var(--ink-2); -webkit-text-fill-color: var(--ink-2); opacity: 1; cursor: not-allowed;
}
.field.is-readonly > label::after, .field.is-readonly > .label::after { content: " · lecture seule"; font-weight: 500; color: var(--ink-3); }
.chip:disabled { cursor: default; }
.chip:disabled:not([aria-pressed="true"]) { opacity: .55; }
/* N9 : un panneau ouvert, les messages passent en haut de l'écran et ne cachent plus ses boutons */
body:has(.sheet-bg) .toasts { top: calc(8px + env(safe-area-inset-top)); bottom: auto; }

/* I7 : cibles tactiles de 44 px au moins, 48 px pour les boutons principaux du mode intervention */
.mission .btn--sm, .sheet .btn--sm { min-height: 44px; }
.mission .btn--icon, .mission .btn--icon.btn--sm { width: 44px; min-height: 44px; }
.btn--main { min-height: 48px; padding: 0 16px; }
.mission .chip, .mission .chip--sm, .sheet .chip, .fiche .chip { min-height: 44px; }
.progress--labels a { min-height: 44px; }
.mesure-add > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.pill.mesure { padding-right: 0; }
.mesure .pill__x { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; margin: -10px 0 -10px -6px; font-size: 22px; }
.mesures { --gap: 10px; }
.supplies li { min-height: 48px; padding-block: 2px; }
.supplies li .btn--icon { margin-right: -6px; }
.netbar__err, .netbar__btn { position: relative; }
.netbar__err::after, .netbar__btn::after { content: ""; position: absolute; inset: -12px -4px; } /* zone d'appui agrandie, bandeau inchangé */
.swatch { width: 44px; height: 44px; }
.sheet--annot .segmented > button { min-height: 44px; }
/* Fiche ouverte par le technicien (onglets Fiche, Rapport, Historique) : mêmes 44 px */
body[data-role="technicien"] .fiche .btn--sm, body[data-role="technicien"] .fiche .segmented > button { min-height: 44px; }

/* Carte d'étape : heure et outils sur une ligne, titre en entier dessous (N9) */
.step__bar { flex-wrap: nowrap; --gap: 8px; }
.step__tools { flex-wrap: nowrap; --gap: 8px; }
.step__titre { display: block; min-height: var(--tap); resize: none; overflow: hidden; line-height: 1.35; font-weight: 600; }
.step__titre-box .suggest-wrap { width: 100%; }
.step__add { --gap: 8px; }
.photo-btns { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.new-step { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.new-step > .label, .new-step > .btn--primary, .new-step > .photo-limit { grid-column: 1 / -1; }
.btn[aria-busy="true"] { cursor: progress; }
/* I5 : photos en cours de compression */
.photo-busy {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  background: var(--graphite); color: var(--papier); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 15px; white-space: nowrap;
}
.photo-busy::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .photo-busy::before { animation: none; } }
@media (min-width: 1024px) { .photo-busy { bottom: 80px; } }

/* H12 : tournée (n° d'OS, accès copiable) */
.tour__ref { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.tour__access { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.tour__access .btn { min-height: 44px; margin-left: -12px; }

/* I3 : signature ; on signe tout de suite, sans clavier ouvert d'office */
.sigpad:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Paysage sur téléphone : la zone prend toute la hauteur, champs et boutons à droite (la règle
   d'origine était écrasée par .sheet--sign .sigpad : 133 px de haut) */
@media (orientation: landscape) and (max-height: 500px) {
  .sheet.sheet--sign { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .sheet--sign::before { display: none; }
  .sheet--sign .sign { display: grid; grid-template-columns: minmax(0, 1fr) 236px; grid-template-rows: auto auto auto 1fr auto; gap: 8px 12px; height: 100%; }
  .sheet--sign .sign > * { grid-column: 2; }
  .sheet--sign .sign-summary { display: none; }
  .sheet--sign .sign__title { grid-row: 1; font-size: 18px; }
  .sheet--sign .sign__who { grid-row: 2; flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .sheet--sign .sign__who > .grow { min-width: 0 !important; }
  .sheet--sign .sign > .error { grid-row: 3; }
  .sheet--sign .sign__actions { grid-row: 5; flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .sheet--sign .sign__actions > .grow { display: none; }
  .sheet--sign .sigpad-wrap { grid-column: 1; grid-row: 1 / -1; }
  .sheet--sign .sigpad { height: calc(100dvh - 16px - env(safe-area-inset-bottom)); }
}

/* =====================================================================
   Lot 8 : tuile complète, historique lisible, journal d'activité, suivi
   ===================================================================== */
/* Tuile : localisation et contact sur place (gérant) ; chaque ligne coupée proprement, le texte
   entier dans le nom accessible et l'infobulle */
.tile__place, .tile__contact { display: flex; align-items: flex-start; gap: 4px; min-width: 0; color: var(--ink-2); font-size: 12.5px; }
.tile__place .ic, .tile__contact .ic { flex: none; margin-top: 2px; color: var(--ink-3); }
/* Deux lignes au plus : le numéro (espaces insécables) ne se coupe pas, le nom passe dessous */
.tile__place > span, .tile__contact > span { min-width: 0; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.tile--compact .tile__addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile--compact .tile__obj { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.tile--compact .tile__meta .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Tuile de hauteur fixe (vue jour) : les lignes gardent leur hauteur, celles qui ne tiennent pas sont masquées (fitTiles) */
.tile > * { flex-shrink: 0; }
.tile--compact .tile__obj.is-1line { -webkit-line-clamp: 1; line-clamp: 1; }
/* Type d'intervention (« RECH. FUITE ») dans une tuile étroite (vue jour, fiches en même temps) : il
   passe sous l'heure s'il ne tient pas à côté, puis se coupe avec « … » ; l'heure reste entière */
.tile__top { min-width: 0; flex-wrap: wrap; row-gap: 1px; }
.tile__time { flex-shrink: 0; }
.tile__type { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Une ligne qui ne se coupe pas n'élargit jamais une colonne de la semaine (N1) */
.wk__cell { min-width: 0; }

/* Menu du gérant (11 entrées) : il tient sur un écran de 1366 × 768 (fenêtre d'environ 650 px de
   haut) ; plus bas encore, il défile au lieu de cacher son pied */
@media (min-width: 1024px) {
  .rail { overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 1024px) and (max-height: 820px) and (pointer: fine) { /* souris : la tablette garde ses cibles de 44 px */
  .rail { gap: 2px; padding-block: 14px; }
  .rail__brand { padding-bottom: 10px; }
  .rail__new { margin-bottom: 8px; }
  .rail a { min-height: 40px; }
}

/* Historique : différences en clair, vignettes, version consultée */
.changes li { overflow-wrap: anywhere; }
.diff-thumb { display: inline-block; margin-left: 6px; vertical-align: middle; line-height: 0; }
.diff-thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; background: var(--sunk); }
.photo__gone { position: absolute; right: 4px; top: 4px; padding: 1px 6px; border-radius: 999px; background: var(--alert-fixed); color: #fff; font-size: 11px; font-weight: 600; }
.photos .photo--gone { display: grid; place-items: center; padding: 8px; text-align: center; font-size: 12.5px; color: var(--ink-3); border: 1.5px dashed var(--line); cursor: default; }
.version-view .phase { padding-top: 6px; }
.version-view .photos { grid-template-columns: repeat(auto-fill, minmax(110px, 160px)); }
.version-view .step:last-child { border-bottom: 0; }

/* Journal d'activité (gérant) */
.activity { display: flex; flex-direction: column; margin: 0; padding: 0; }
.activity__row { display: grid; grid-template-columns: 128px 180px 170px minmax(0, 1fr); gap: 4px 12px; align-items: baseline;
  padding: 10px 4px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.activity__at { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.activity__who { font-weight: 600; overflow-wrap: anywhere; }
.activity__who .muted { font-weight: 500; }
.activity__what .pill { white-space: normal; }
.activity__detail { overflow-wrap: anywhere; }
.activity__diff, .activity__note { display: block; margin-top: 2px; }
.activity__diff { color: var(--ink-2); }
@media (max-width: 899px) {
  .activity__row { grid-template-columns: auto minmax(0, 1fr); }
  .activity__at { grid-column: 1; }
  .activity__who { grid-column: 2; text-align: right; }
  .activity__what, .activity__detail { grid-column: 1 / -1; }
}

/* Suivi des techniciens (gérant) */
.suivi__figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.suivi__bar .segmented { flex: 1 1 auto; min-width: 0; }
/* Listes de filtres : une option longue n'élargit jamais la page (téléphone) */
.activity-filters .select { min-width: 0; max-width: 100%; }
.suivi__fig { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--primary); }
.suivi__fig strong { font: 800 26px/1 var(--font-display); color: var(--primary); }
.suivi__fig span { font-size: 13px; color: var(--ink-2); }
.dl dd.is-warn { color: var(--danger); font-weight: 600; }
.suivi__day > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-height: 40px; cursor: pointer; }
.suivi__points li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 14px; overflow-wrap: anywhere; }

/* ---------- Lot 8 (partie B) ---------- */
/* Étapes : glisser-déposer par la poignée, sans sélection de texte ni menu de l'appui long. Le doigt qui balaie
   depuis la poignée fait défiler la page (pan-y) ; une fois l'appui long reconnu, sortable.js bloque le défilement */
.step-list { display: flex; flex-direction: column; gap: 12px; }
.step__handle { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; color: var(--ink-3); }
.step__handle:active { cursor: grabbing; }
.step-card.is-sorting { position: relative; z-index: 6; box-shadow: var(--shadow-lg); outline: 2px solid var(--action); outline-offset: -2px; cursor: grabbing; }
.step-card.is-grabbed { outline: 3px solid var(--focus); outline-offset: 2px; }
body.is-sorting, body.is-sorting * { user-select: none !important; -webkit-user-select: none !important; }
body.is-sorting { cursor: grabbing; }
.step__order-note { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; font-weight: 600; color: var(--danger); }
.step-order-warn { --gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }
/* Onglets de la fiche : quatre onglets, la pastille des signatures manquantes */
.fiche-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.fiche-tabs > button { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--action); color: var(--on-action-text); font: 700 12px/1 var(--font-text); }
.tab-badge[hidden] { display: none; }
/* Résumé des signatures en bas de « Après » (onglet Rapport) */
.sign-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--ok); }
.sign-summary.is-missing { border-left-color: var(--action); }
.sign-summary > .grow { flex: 1 1 14em; min-width: 0; } /* téléphone : le bouton passe dessous plutôt que d'écraser le texte */
/* « Équipement concerné » : rattachement au catalogue */
.eq-status { display: flex; align-items: center; gap: 4px; margin: 4px 0 0; }
.eq-status:empty { display: none; }
.spent { overflow-wrap: anywhere; }
/* Vue jour : les colonnes se partagent la largeur (iPad 1024 et 768 px : 3 techniciens et « Non assignées » sans défilement) */
/* (largeur minimale calculée, pas « max-content » : les noms longs des en-têtes s'abrègent au lieu d'élargir la grille) */
.dv { grid-template-columns: 56px repeat(var(--cols), minmax(128px, 1fr)); min-width: calc(56px + var(--cols) * 128px); }
.dv__head > .ellipsis { min-width: 0; }
.dv__tile.is-narrow { padding: 6px 4px 6px 6px; } /* trois créneaux ou plus en même temps : marges réduites */
/* Beaucoup de créneaux à la même heure : les tuiles, même au plus étroit, restent dans leur colonne
   (la grille ne s'élargit pas) ; le point de l'heure courante passe dans la colonne */
.dv__col { overflow-x: clip; }
.dv__now::before { left: 0; }

/* ---------- Lot 9 (partie A) ---------- */
/* Gros boutons de choix (type d'intervention, saisie progressive de la recherche de fuite) : 48 px,
   deux par ligne sur téléphone, le choix fait reste visible (aria-pressed) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 8px; }
.choices[hidden] { display: none; }
.choice {
  display: flex; align-items: center; gap: 8px; min-height: var(--tap); min-width: 0; padding: 8px 12px; border-radius: var(--radius-lg);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-align: left;
  font: 600 15px/1.2 var(--font-text); cursor: pointer; overflow-wrap: anywhere;
}
.choice > .ic { flex: none; }
.choice > span:not(.ic) { min-width: 0; }
.choice[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.choice:disabled { cursor: default; }
.choice:disabled:not([aria-pressed="true"]) { opacity: .55; }
.choice[hidden] { display: none; }
.choice--more { border-style: dashed; }
/* « Maintenance… » quand une maintenance est choisie (son nom est dans le bouton ; aria-expanded seul) */
.choice--more.is-on { border-style: solid; background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
/* Valeur plus proposée (liste changée depuis) : montrée, d'un appui pour la retirer */
.choice--legacy { border-style: dotted; }
.choice--legacy small { font-weight: 500; }
.choice__chev { margin-left: auto; padding-left: 4px; font-size: 13px; }
.choices--sm { grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); }
.choices--sm .choice { font-size: 14px; }
.typepick__more { margin-top: 8px; padding: 8px; border-radius: var(--radius-lg); background: var(--surface-2); }
/* Champ caché par les choix, encore rempli : gardé et signalé, avec « Effacer » */
.kept { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--action); font-size: 14px; }
.kept > .grow { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.kept .btn { min-height: 44px; }
/* Propositions d'un champ (localisation du sinistre) : sur des lignes qui passent à la ligne, deux
   au plus, puis « Autres lieux… » (vérification du lot 9 A) ; jamais de défilement horizontal */
.propose { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.propose .chip { min-height: 44px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.propose .chip[hidden] { display: none; }
.propose .chip--more { border-style: dashed; }
/* Suite à donner mise en avant (fuite non localisée) */
.follow-focus { padding: 10px 12px; border-radius: var(--radius); border-left: 3px solid var(--action); background: var(--surface-2); }
/* Méthodes d'une étape : celles du rapport, et « + » pour en ajouter une */
.step-methods { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-methods .btn--icon { width: 44px; min-height: 44px; }
/* Relevés d'une maintenance : une case par relevé, valeur de la visite précédente à côté */
.releves { display: grid; gap: 10px; }
.releve { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.releve__lab { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.releve__lab > label { font-weight: 600; overflow-wrap: anywhere; }
.releve__in { display: flex; align-items: center; gap: 4px; }
.releve__in .input { min-height: 48px; width: 5.5em; text-align: right; }
.releve__unit { flex: none; min-width: 2.2em; color: var(--ink-2); font-weight: 600; }
/* « ± » : valeur négative (le clavier décimal de l'iPhone n'a pas de touche moins) */
.releve__sign { width: 40px; min-height: 48px; font-size: 18px; font-weight: 700; }
/* Relevé qui ne peut pas être négatif : pas de « ± », la case reste alignée sur les autres */
.releve__sign--none { display: inline-block; flex: none; min-height: 0; }
.prev-box__basis { color: var(--ink-2); }
/* Valeur de la visite précédente : lisible sur le terrain (15 px au moins) */
.releve__prev { font-size: 15px; color: var(--ink-2); }
.releve__prev:empty { display: none; }
.releve__prev.is-gap { color: var(--danger); font-weight: 600; }
.releve__seuil { display: flex; gap: 4px; align-items: center; font-size: 14px; color: var(--danger); } /* seuil absolu franchi (lot 10 A) : signalé, sans bloquer */
.releve--other { grid-template-columns: minmax(0, 1fr) auto; }
.releve__x { width: 44px; min-height: 44px; }
.prev-box { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--info); font-size: 15px; }
/* « Il manque au rapport » : avertissements, sans blocage (maintenance sans point ni relevé) */
.missing--warn li::marker { color: var(--ink-3); }
/* Filtres des listes : jamais plus larges que l'écran, même avec un long libellé */
.filters .select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
/* Fiche : champs peu utilisés repliés */
.more-details > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; cursor: pointer; font-weight: 700; }
.more-details > summary .hint { font-weight: 500; }

/* =====================================================================
   Lot 9 (partie B) : tuile du planning (ordre, état), sous-traitants
   ===================================================================== */
/* Toujours visibles, dans cet ordre : N° OS, type, adresse (rue et ville) ; puis heure et objet,
   localisation, contact, pastilles (fitTiles en vue jour) */
.tile__os { flex-shrink: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 14px/1.15 var(--font-display); color: var(--primary); }
.tile__os.is-ref { color: var(--ink-2); font-weight: 600; } /* sans N° d'OS : la référence de la fiche */
.tile__os:empty { display: none; }
.tile__addr { color: var(--ink-2); font-weight: 500; }
.tile--compact .tile__addr { white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.tile__obj .tile__time { font: 700 14px/1 var(--font-display); color: var(--primary); }
.tile__sub { flex: 0 1 auto; min-width: 0; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 1px 7px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 600 11px/1.45 var(--font-text); }
.tile__state { display: inline-flex; gap: 2px; flex: none; }
.tile__mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--surface); }
.tile__mark--billed { background: var(--ok); }
.tile__mark--follow { background: var(--follow-text); }
.pill--follow { background: var(--surface); color: var(--follow-text); box-shadow: inset 0 0 0 1.5px var(--follow-text); }
/* Fond selon l'état : terminée (bleu pâle), facturée (vert pâle, gérant), suite à donner (orange pâle),
   facturée avec une suite (orange rayé de vert, rayures larges). Le type passe à l'ardoise foncée
   (le métier reste sur le filet) ; texte AA sur chaque fond, rayures comprises */
.tile.is-done { background: var(--tile-done); }
.tile.is-billed { background: var(--tile-billed); }
.tile.is-follow { background: var(--tile-follow); }
.tile.is-billed-follow { background: repeating-linear-gradient(135deg, var(--tile-follow) 0 14px, var(--tile-billed) 14px 28px); }
.tile.is-done .tile__type, .tile.is-billed .tile__type, .tile.is-follow .tile__type, .tile.is-billed-follow .tile__type { color: var(--ink-2); }
/* Vue jour, objet masqué faute de place : la coche « terminée » passe devant le N° OS */
.dv__tile.is-done:not(.is-billed, .is-follow, .is-billed-follow):has(> .tile__obj[hidden]) .tile__os::before { content: "✓ "; color: var(--ok); }
/* Délai dépassé : contour plus marqué, rouge foncé en clair et clair en sombre (--danger), 3:1 au
   moins sur chaque fond (blanc, bleu, vert, orange, rayé : 4,4:1 et plus en clair, 5,1:1 en sombre) */
.tile.is-late { box-shadow: inset 0 0 0 2px var(--danger), var(--shadow); }
/* … au survol aussi (« a.tile:hover » est plus spécifique : contre-relecture m5) */
a.tile.is-late:hover { box-shadow: inset 0 0 0 2px var(--danger), 0 0 0 1.5px var(--line), var(--shadow); }
/* Vue jour, tuile trop courte pour deux lignes : N° OS, type et adresse sur une seule */
.dv__tile.is-tiny { flex-direction: row; align-items: center; gap: 6px; padding-top: 3px; padding-bottom: 3px; }
.dv__tile.is-tiny > .tile__top { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; }
.dv__tile.is-tiny > .tile__top > .grow { display: none; }
.dv__tile.is-tiny > .tile__addr { flex: 1 1 0; min-width: 0; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Légende du planning (repliable) */
.plan-legend { font-size: 13.5px; }
.plan-legend > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.plan-legend > summary::-webkit-details-marker { display: none; }
.plan-legend > summary > .ic:first-child { transition: transform .15s; }
.plan-legend[open] > summary > .ic:first-child { transform: rotate(90deg); }
.plan-legend__list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; padding: 0; list-style: none; color: var(--ink-2); }
.plan-legend__list li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { position: relative; flex: none; width: 28px; height: 18px; border-radius: 4px; overflow: hidden; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); border-left: 3px solid var(--ink-3); }
.swatch.is-done { background: var(--tile-done); }
.swatch.is-billed { background: var(--tile-billed); }
.swatch.is-follow { background: var(--tile-follow); }
.swatch.is-billed-follow { background: repeating-linear-gradient(135deg, var(--tile-follow) 0 5px, var(--tile-billed) 5px 10px); }
.swatch.is-urgent::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 6px; background: repeating-linear-gradient(-45deg, var(--action) 0 4px, var(--graphite) 4px 8px); }
.swatch.is-late { box-shadow: inset 0 0 0 2px var(--danger); }
.swatch.is-cancelled { opacity: .55; }
.swatch.is-cancelled::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 1.5px; background: var(--ink); }

/* Ligne « Sous-traitants » du planning */
.avatar--st { background: var(--ink-2); color: var(--surface); }
.avatar--st .ic { width: 15px !important; height: 15px !important; }

/* Fiche : attribution (technicien ou sous-traitant) et carte « Sous-traitance » */
.assign-kind { align-self: flex-start; max-width: 100%; }
.assign-kind > button { white-space: nowrap; }
.st-card .dl { margin: 0; }
.st-card .sync { margin: 0; }
.st-realized { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.st-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.st-money > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--primary); }
.st-money strong { font: 800 20px/1.1 var(--font-display); color: var(--primary); }
.st-money .is-neg strong { color: var(--danger); }
.st-pick { display: flex; flex-direction: column; gap: 6px; max-height: min(50dvh, 360px); overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.st-pick li { display: flex; }
.st-pick button { justify-content: flex-start; text-align: left; width: 100%; }
/* Écran Sous-traitants */
.st-tile .tile__obj { font-size: 15px; }
/* Vue jour (hauteur fixe) : l'adresse passe sur une ligne avant que la tuile ne se réduise à une
   seule ; plusieurs couloirs (fiches en même temps) ou tuile d'une ligne : le sous-traitant en
   initiales, son nom entier dans l'infobulle et le nom accessible */
.dv__tile .tile__sub { max-width: 48%; }
/* Couloir étroit (deux fiches côte à côte) : pas de pastille du sous-traitant, son nom reste dans
   l'infobulle et le nom accessible */
.dv__tile.is-lane .tile__sub { display: none; }
.dv__tile.is-tiny .tile__sub { flex: none; max-width: none; font-size: 0; padding: 1px 6px; }
.dv__tile.is-tiny .tile__sub::after { content: attr(data-short); font-size: 11px; }
/* Fiches qui se chevauchent, trop nombreuses pour des couloirs lisibles : une tuile « N fiches · … »
   (N° OS en lignes), qui ouvre la liste des tuiles complètes */
.dv__group { position: absolute; left: 2px; right: 2px; z-index: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden;
  padding: 4px 8px 4px 10px; border: 0; border-left: 4px solid var(--ink-2); border-radius: 5px; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); color: var(--ink); text-align: left; cursor: pointer; font: 600 12.5px/1.25 var(--font-text); }
.dv__group:hover, .dv__group:focus-visible { box-shadow: inset 0 0 0 2px var(--ink-2), var(--shadow); }
.dv__group.is-urgent { padding-right: 14px; }
.dv__group.is-urgent::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 7px;
  background: repeating-linear-gradient(-45deg, var(--action) 0 5px, var(--graphite) 5px 10px); }
.dv__group-head { display: flex; flex-wrap: wrap; align-items: center; column-gap: 5px; min-width: 0; font: 700 13px/1.25 var(--font-display); color: var(--primary); }
.dv__group-head .ic { flex: none; }
.dv__group-head > span { white-space: nowrap; }
.dv__group-head.is-wrap .dv__group-sep { display: none; } /* heure à la ligne : pas de « · » en fin de ligne */
.dv__group-head.is-wrap > span:last-child { flex-basis: 100%; } /* … et vraiment à la ligne, même si elle tiendrait sans « · » */
.dv__group-head.is-notime > span:last-child { display: none; } /* trop bas pour l'heure à la ligne */
.dv__group-list { display: flex; flex-direction: column; min-width: 0; }
.dv__group-os { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 700 12.5px/1.3 var(--font-display); color: var(--ink-2); }
/* Une ligne par fiche : « N° OS · type court · rue » (contre-relecture) ; trop étroit : le N° OS seul */
.dv__group-os > b { font-weight: 700; color: var(--ink); }
.dv__group-type, .dv__group-rue { font: 600 12px/1.3 var(--font-text); color: var(--ink-2); }
.dv__group.is-os-only .dv__group-type, .dv__group.is-os-only .dv__group-rue { display: none; }
/* Deux couloirs regroupés : une fiche seule dans son groupe reprend toute la largeur */
.dv__tile.is-solo { left: 2px !important; width: calc(100% - 4px) !important; }
.dv__group-os.is-more { font: 600 12px/1.3 var(--font-text); color: var(--ink-3); }
.dv__group-plus { font: 600 12px/1.3 var(--font-text); color: var(--ink-3); }
.dv-group-sheet { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: min(62dvh, 560px); overflow-y: auto; }
.dv-group-sheet li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.dv-group-sheet li > .tile { width: 100%; }
/* N° OS long (semaine, « À planifier ») : sur deux lignes au plus, puis « … » ; le texte entier dans le nom accessible */
.tile--compact:not(.dv__tile) .tile__os { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
/* Historique de la fiche : avis aux sous-traitants, événements datés (pas des versions) */
.timeline__item.is-event { background: var(--surface-2); box-shadow: none; padding: 8px 14px; color: var(--ink-2); }
.timeline__item.is-event::before { width: 7px; height: 7px; left: -20px; top: 14px; }
/* … en vue jour aussi, quand la tuile a la place (fitTiles : « is-os2 ») */
.dv__tile.is-os2 .tile__os { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
/* Ligne « Sous-traitants » repliée : le nombre de fiches de chaque jour */
.wk__fold > .ic { transition: transform .15s; transform: rotate(90deg); }
.wk__fold[aria-expanded="false"] > .ic { transform: none; }
.wk__cell.is-folded { min-height: 0; }
.wk__count { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--sunk); font: 600 12.5px/1.4 var(--font-text); color: var(--ink-2); }
/* Légende : cible du doigt de 44 px sur téléphone et tablette */
@media (max-width: 1023px), (pointer: coarse) { .plan-legend > summary { min-height: 44px; } }
.tile--compact .tile__addr.is-1line { -webkit-line-clamp: 1; line-clamp: 1; }
/* Plusieurs couloirs (fiches à la même heure, fréquent dans la colonne Sous-traitants), ou en-tête
   qui ne tient pas sur une ligne (pictogrammes, nom du sous-traitant : « is-stack », fitTiles) :
   marges et textes resserrés, pour que N° OS, type et adresse tiennent sur une tuile d'une heure */
.dv__tile:is(.is-lane, .is-stack) { padding: 5px 5px 5px 7px; gap: 1px; }
.dv__tile:is(.is-lane, .is-stack).is-urgent { padding-right: 12px; }
.dv__tile:is(.is-lane, .is-stack) .tile__top { column-gap: 4px; row-gap: 0; }
.dv__tile:is(.is-lane, .is-stack) .tile__os { font-size: 12.5px; }
.dv__tile:is(.is-lane, .is-stack) .tile__type { font-size: 10.5px; letter-spacing: .04em; }
.dv__tile:is(.is-lane, .is-stack) .tile__addr { font-size: 11.5px; line-height: 1.25; }
.dv__tile:is(.is-lane, .is-stack) .tile__sub { padding: 0 5px; }
.dv__tile.is-lane .tile__sub::after { font-size: 10px; }
/* … sur deux lignes fixes : « N° OS … sous-traitant », puis « TYPE … pictogrammes de l'état » */
.dv__tile:is(.is-lane, .is-stack):not(.is-tiny) .tile__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "os who who" "type type mark"; align-items: center; }
.dv__tile:is(.is-lane, .is-stack):not(.is-tiny) .tile__os { grid-area: os; }
.dv__tile:is(.is-lane, .is-stack):not(.is-tiny) .tile__type { grid-area: type; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv__tile:is(.is-lane, .is-stack):not(.is-tiny) .tile__top > .grow { display: none; }
.dv__tile:is(.is-lane, .is-stack):not(.is-tiny) .tile__state { grid-area: mark; justify-self: end; }
/* « qui » sur les deux dernières colonnes : son nom ne prend jamais la place du type */
.dv__tile:is(.is-lane, .is-stack):not(.is-tiny) .tile__top > .tile__sub, .dv__tile:is(.is-lane, .is-stack):not(.is-tiny) .tile__top > .avatar { grid-area: who; justify-self: end; max-width: 100%; }

/* ---------- Lot 10 (partie B) ---------- */
/* Planning et carte sur téléphone : barre d'outils sur une ligne (date et vue), libellés courts
   (« Auj. », « Sem. » ; le nom accessible reste entier) ; « Week-end » et le lien vers la carte (ou
   le planning) passent sur la ligne des filtres */
.plan-short { display: none; }
.plan-fold-row { --gap: 6px; flex-wrap: nowrap; }
.plan-fold-row > .plan-fold { min-width: 0; }
.plan-fold-slot { --gap: 10px; flex: none; flex-wrap: nowrap; }
@media (max-width: 719px) {
  .plan-toolbar { --gap: 4px; }
  .plan-toolbar > .btn--icon { width: 40px; flex: none; }
  .plan-toolbar > .plan-today { padding: 0 8px; flex: none; }
  .plan-toolbar .plan-date { flex: 1 1 96px; width: 0; min-width: 96px; padding: 0 4px 0 6px; }
  /* (au toucher, tout le champ ouvre le choix de la date : pas de pictogramme, le jour entier se lit) */
  .plan-toolbar .plan-date::-webkit-calendar-picker-indicator { display: none; }
  .plan-toolbar .plan-gap { display: none; }
  .plan-toolbar .plan-mode { flex: none; align-self: center; }
  .plan-toolbar .plan-mode > button { padding: 0 10px; min-height: 38px; }
  .plan-long { display: none; }
  .plan-short { display: inline; }
}
.map-extra { --gap: 10px; flex-wrap: nowrap; }
.map-extra[hidden] { display: none; }
/* Vue jour : colonnes resserrées jusqu'à 88 px (largeur calculée par fitColumns) pour tenir dans la page ;
   au-delà, la grille défile dans son cadre (jamais la page) */
.dv { grid-template-columns: 56px repeat(var(--cols), minmax(var(--colmin, 128px), 1fr)); min-width: calc(56px + var(--cols) * var(--colmin, 128px)); }
/* Vue jour : fiche glissée hors de la liste d'un groupe ; le panneau s'efface (la fiche suit le pointeur) */
.sheet-bg.is-dragging-out { opacity: 0; pointer-events: none; transition: opacity .12s; }
/* « Réattribuer ces fiches » (compte ou sous-traitant désactivé) */
.wk__tech .plan-reassign { margin-top: 6px; max-width: 100%; padding: 0 8px; gap: 6px; font-size: 13px; white-space: normal; text-align: left; line-height: 1.15; }
.dv__head .plan-reassign, .wkl__tech .plan-reassign { flex: none; }
.reassign-src { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px 8px; margin: 0; min-width: 0; }
.reassign-src legend { font-weight: 700; padding: 0 4px; }
.reassign-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: min(40dvh, 360px); overflow-y: auto; }
.reassign-item { --gap: 10px; flex-wrap: nowrap; align-items: flex-start; min-height: 44px; padding: 8px 0; cursor: pointer; overflow-wrap: anywhere; }
.reassign-item input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; }
.reassign-item .pill--sm { min-height: 20px; padding: 1px 7px; margin-left: 6px; font-size: 12px; vertical-align: 1px; }
/* Carte « Sous-traitance » : bons tels qu'ils ont été envoyés */
.st-bons > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; font-weight: 600; }
.st-bons > summary::-webkit-details-marker { display: none; }
.st-bons > summary > .ic:first-child { transition: transform .15s; }
.st-bons[open] > summary > .ic:first-child { transform: rotate(90deg); }
.st-bons li { padding: 4px 0; overflow-wrap: anywhere; }
.st-bons li a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
/* Travail transmis : valeur actuelle dans le rapport, à côté de la valeur transmise */
.late-current { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-left: 3px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink); }
/* Catalogue, « Équipements en texte libre » : un groupe par texte, propositions, fiches à rattacher */
.free-group h2 { font-size: 18px; margin: 0; overflow-wrap: anywhere; }
.free-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.free-props { display: flex; flex-direction: column; gap: 6px; }
.free-prop { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.free-prop:has(input:checked) { border-color: var(--ink-2); box-shadow: inset 3px 0 0 var(--action); }
.free-prop > input[type=radio] { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--action); }
.free-prop .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.free-prop .muted { font-size: 13px; }
.free-prop .pill { flex: none; }
.free-prop .input { margin-top: 2px; }
.free-found { display: flex; flex-wrap: wrap; gap: 6px; }
.free-choice { margin: 0; }
.free-actions { justify-content: flex-end; }
.free-fiches > summary { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; cursor: pointer; font-weight: 600; list-style: none; }
.free-fiches > summary::-webkit-details-marker { display: none; }
.free-fiches > summary > .ic { transition: transform .15s; }
.free-fiches[open] > summary > .ic { transform: rotate(90deg); }
.free-fiches ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.free-fiche { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.free-fiche .grow { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.free-fiche .btn { flex: none; }
.free-skipped { margin: 0; padding-left: 18px; }
@media (pointer: coarse) { .free-fiche .btn { min-height: 44px; } }

/* =====================================================================
   Lot 10 D (relecture) : Paramètres → Installation
   ===================================================================== */
/* Commandes et chemins du serveur : chasse fixe, recopiables tels quels (« --connecter ») */
.cmd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .9em; padding: 1px 5px; border-radius: 4px; background: var(--sunk); color: var(--ink); overflow-wrap: anywhere; }
/* « Connecter OneDrive » et son explication */
.od-connect { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.od-connect > .btn { min-height: 44px; }
/* Journal d'activité : « À propos » replié, flèche qui tourne à l'ouverture */
.activity-about > summary .ic { transition: transform .15s; }
.activity-about[open] > summary .ic { transform: rotate(90deg); }
/* E-mails en échec : « Réessayer » à droite du texte ; sous 600 px, sous le texte */
.failed-mail { display: flex; gap: 8px; align-items: flex-start; }
.failed-mail__text { flex: 1 1 0; min-width: 0; }
.failed-mail > .btn { flex: none; min-height: 44px; }
@media (max-width: 599px) {
  .failed-mail { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .failed-mail > .btn { grid-column: 2; justify-self: start; }
}

/* =====================================================================
   Lot 11 : Paramètres → Entreprise, modifiable section par section
   ===================================================================== */
.co-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.co-head > .btn { min-height: 44px; }
/* Lecture : libellé à gauche, valeur à droite ; sous 600 px, l'un sous l'autre */
.co-list { margin: 0; display: flex; flex-direction: column; }
.co-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.co-item:last-child { border-bottom: 0; }
.co-item dt { color: var(--ink-3); font-size: 14px; }
.co-item dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.co-long { white-space: pre-line; font-weight: 500; }
.co-pill { margin-left: 8px; vertical-align: 1px; }
.co-file { display: block; font-weight: 400; margin-top: 2px; }
.co-group { margin: 0; }
.co-section > .co-group { padding-top: 6px; margin-bottom: -6px; } /* titre de groupe collé à sa liste */
@media (max-width: 599px) { .co-item { grid-template-columns: minmax(0, 1fr); } }
/* Formulaire : deux colonnes sur un écran large, textes longs, listes et cases sur toute la largeur */
.co-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px 18px; align-items: start; }
.co-fields > .field { min-width: 0; }
.co-wide { grid-column: 1 / -1; }
.co-fields > .co-group { padding-top: 6px; }
.co-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink); }
.co-check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--primary); }
.co-live:empty, .co-fields .error:empty { display: none; }
.co-live { display: flex; flex-direction: column; gap: 4px; }
.co-default { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.co-default .hint { overflow-wrap: anywhere; min-width: 0; }
.co-default > .btn { min-height: 40px; padding: 0 8px; }
.co-note { font-size: 13px; color: var(--ink-2); }
.co-note--warn { color: var(--danger); font-weight: 600; }
.co-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
/* Confirmation sur place (RGPD, franchise, identifiants, retour à une version) */
.co-confirm { border-left: 4px solid var(--danger); background: var(--danger-soft); color: var(--ink); padding: 12px 14px; border-radius: var(--radius); }
.co-confirm__title { margin: 0; font: 700 17px/1.2 var(--font-display); color: var(--danger); }
.co-confirm__title:focus { outline: none; }
.co-confirm__list { margin: 0; padding-left: 20px; }
/* Historique */
.co-hist { padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.co-hist:last-child { border-bottom: 0; padding-bottom: 0; }
.co-changes { margin: 0; padding-left: 20px; font-size: 14px; }
.co-from { text-decoration: line-through; color: var(--ink-3); }
/* Relecture du lot 11 (E17) : cibles de 44 px au téléphone et à la tablette (historique, « Revenir
   à la valeur par défaut », « Utiliser ») ; bouton « + » masqué pendant une saisie dans l'onglet,
   pour qu'il ne recouvre ni l'aide ni « Enregistrer » */
@media (max-width: 1023px), (pointer: coarse) {
  .co-section .btn--sm, .co-hist .btn, .co-default > .btn, .co-confirm .btn { min-height: 44px; }
}
body[data-editing] .fab { display: none; }
/* Confirmation et boutons du formulaire amenés à l'écran : jamais sous la barre du haut ni sous
   celle du bas (téléphone) */
.co-confirm { scroll-margin-top: 80px; }
.co-actions .btn, .co-confirm .btn { scroll-margin-bottom: 96px; }

/* Lot 12 : le PDF du rapport en tête de l'onglet Rapport (gérant et technicien), compact */
.pdf-top { padding: 12px 16px; }
.pdf-top__head { --gap: 8px; color: var(--primary); }
.pdf-top__head h2 { font-size: 19px; }

/* Lot 16 (tournées de maintenance) : case à cocher ou bouton radio avec son libellé, et blocs
   repliables (panneau des tournées de la carte, Paramètres → Tournées) */
.tour-check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.tour-check input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--primary); }
.tour-recent > summary, .tour-unplaced > summary, .tour-changes > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; font-weight: 700; }
.tour-recent > summary::-webkit-details-marker, .tour-unplaced > summary::-webkit-details-marker, .tour-changes > summary::-webkit-details-marker { display: none; }
.tour-recent > summary > .ic:first-child, .tour-unplaced > summary > .ic:first-child, .tour-changes > summary > .ic:first-child { transition: transform .15s; }
.tour-recent[open] > summary > .ic:first-child, .tour-unplaced[open] > summary > .ic:first-child, .tour-changes[open] > summary > .ic:first-child { transform: rotate(90deg); }
.user-start { font-size: 14px; overflow-wrap: anywhere; }
.user-start .ic { vertical-align: -2px; }

/* Lot 17 : suivi des mesures (vue d'ensemble, détail d'un site, rapport annuel). État général :
   Bon (vert), À surveiller (orange des suites à donner), Dégradé (rouge) ; mêmes jetons en sombre */
.mes-appr { font-weight: 700; }
.mes-appr--bon { background: var(--ok-soft); color: var(--ok); }
.mes-appr--a_surveiller { background: var(--tile-follow); color: var(--follow-text); }
.mes-appr--degrade { background: var(--danger-soft); color: var(--danger); }
.mes-appr--big { font: 800 18px/1 var(--font-display); padding: 7px 12px; letter-spacing: .02em; }
.mes-warn { color: var(--follow-text); font-weight: 700; }
.mes-trend { white-space: nowrap; }
.mes-trend--degradation { color: var(--danger); font-weight: 700; }
.mes-trend--amelioration { color: var(--ok); font-weight: 600; }
.mes-kpi--warn { border-left-color: var(--follow-text); }
.mes-kpi--warn .kpi__n { color: var(--follow-text); }
.mes-filters .select { min-height: 44px; }
.mes-filters .chip { min-height: 44px; }
/* Téléphone et tablette : cartes ; ordinateur (1100 px et plus) : tableau */
.mes-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.mes-card { display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; border-left: 4px solid var(--line); }
.mes-card--degrade { border-left-color: var(--danger); }
.mes-card--a_surveiller { border-left-color: var(--follow-text); }
.mes-card--bon { border-left-color: var(--ok); }
.mes-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mes-card__name { font: 700 19px/1.2 var(--font-display); overflow-wrap: anywhere; }
.mes-card__sub { font-size: 13px; overflow-wrap: anywhere; }
.mes-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.mes-facts dt { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.mes-facts dd { margin: 0; font-size: 14px; font-weight: 600; }
.mes-table { display: none; padding: 4px 8px; }
.mes-table td { vertical-align: top; }
.mes-table__site { white-space: normal !important; min-width: 200px; }
.mes-table__site .muted { font-size: 13px; }
@media (min-width: 1100px) {
  .mes-cards { display: none; }
  .mes-table { display: block; }
}
.mes-summary .label { font-size: 12px; }
.mes-facts-grid { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mes-fact { display: flex; flex-direction: column; gap: 2px; }
.mes-fact strong { font: 700 20px/1.15 var(--font-display); }
.mes-fact.is-alert strong { color: var(--danger); }
.mes-fact.is-warn strong { color: var(--follow-text); }
.mes-comment { margin: 0; padding: 8px 12px; border-left: 3px solid var(--plomberie); background: var(--sunk); border-radius: var(--radius); }
.mes-dates { font-size: 14px; }
.mes-stats { font-size: 14px; }
.mes-seuil { color: var(--danger); font-weight: 600; }
.mes-values > summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--link); }
.mes-conso strong { font: 800 28px/1.1 var(--font-display); color: var(--primary); }
.mes-list li { overflow-wrap: anywhere; }
.mes-anoms li { padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.mes-anoms li:last-child { border-bottom: 0; }
.mes-chart .readings-chart .line { stroke: var(--plomberie); }
.mes-chart .readings-chart .dot { stroke: var(--plomberie); }
.mes-chart .readings-chart .dot.is-notable { stroke: var(--danger); fill: var(--danger); }
.mes-chart .readings-chart .line.mes-context { stroke: var(--line); stroke-width: 2; }
.mes-chart .readings-chart .dot.mes-context { stroke: var(--line); }
.mes-chart .readings-chart .dot.mes-context.is-notable { stroke: var(--danger); fill: var(--danger); opacity: .6; }
.mes-seuil-line { stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 6 5; }
.readings-chart text.mes-seuil-text { fill: var(--danger); font-weight: 700; }
/* Relecture du lot 17 : état affiché et, dessous, l'état proposé s'il est pire ; appréciation à revoir */
.mes-appr-cell { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mes-appr-cell .hint { font-size: 12px; white-space: nowrap; }
.mes-stale { display: inline-flex; align-items: center; gap: 6px; color: var(--follow-text); font-weight: 600; font-size: 14px; }

/* =====================================================================
   Lot 18 : contrats à plusieurs types de visite, fréquences « N visites par an »
   ===================================================================== */
/* Sélecteur à choix multiples : la consigne sous le titre */
.typepick__hint { display: block; margin-top: 2px; }
/* Fiche à plusieurs types : un volet repliable par type (mobile d'abord) */
.volet { padding: 0; overflow: hidden; }
.volet > summary { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 52px; padding: 10px 40px 10px 14px; cursor: pointer;
  list-style: none; background: var(--surface-2); border-left: 4px solid var(--info); }
.volet > summary::-webkit-details-marker { display: none; }
.volet > summary::after { content: '▾'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.volet:not([open]) > summary::after { content: '▸'; }
.volet__title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.volet__said { font-size: 14px; min-width: 0; }
.volet__body { padding: 12px 14px 14px; }
.volet + .volet { margin-top: 0; }
/* Contrat : fréquence « N visites par an », aperçu des dates et des changements */
.season-box .input[type="number"] { width: 80px; }
.season-box .select { min-width: 0; max-width: 100%; }
.contract-preview { display: flex; flex-direction: column; gap: 4px; }
.season-preview { overflow-wrap: anywhere; }
.contract-changes { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-weight: 600; }
.contract-changes.is-warn { color: var(--danger); }

/* =====================================================================
   Lot 20 : avis aux résidents (gérant)
   ===================================================================== */
.avis-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.avis-card { display: flex; flex-direction: column; gap: 4px; height: 100%; color: var(--ink); text-decoration: none; border-left: 4px solid var(--plomberie); min-width: 0; }
.avis-card__title { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.avis-card__what { font-family: var(--font-display); font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.avis-card__when { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 600; overflow-wrap: anywhere; }
.avis-card__when .ic { flex: none; margin-top: 2px; }
.avis-card__where, .avis-card__client { font-size: 14px; overflow-wrap: anywhere; }
.avis-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 1100px) {
  .avis-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); }
  .avis-side { position: sticky; top: 12px; }
}
.avis-step h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.avis-step__n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 15px; flex: none; }
.avis-shortcuts { align-items: center; }
.avis-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.avis-dates .field[hidden], .avis-step .field[hidden] { display: none; }
.avis-zip { flex-wrap: wrap; align-items: flex-start; }
.avis-zip > .field { flex: 1 1 160px; min-width: 0; }
.avis-live { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--sunk); font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.avis-error { display: inline-flex; align-items: flex-start; gap: 6px; color: var(--danger); font-family: var(--font-text); font-weight: 600; font-size: 15px; }
.avis-error .ic { flex: none; margin-top: 2px; }
.avis-actions { flex-wrap: wrap; }
.avis-actions .btn { flex: 1 1 auto; }
/* Aperçu : la feuille en petit, mêmes textes que le PDF (fond clair dans les deux thèmes, comme le papier) */
.avis-preview { display: flex; flex-direction: column; gap: 8px; background: #FFFFFF; color: #1A1C1E; border: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.avis-preview .hint, .avis-preview .muted { color: #4A4F55; }
.avis-preview p { margin: 0; }
.avis-preview__kicker { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #1F63A8; }
.avis-preview__title { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.05; text-transform: uppercase; }
.avis-preview__band { height: 4px; background: linear-gradient(90deg, #E0573C 0 25%, #2F7FCE 25% 50%, #2B9A6C 50% 75%, #3AA3C4 75%); }
.avis-preview__phrase { padding: 8px 10px; background: #F2F4F7; border-left: 4px solid #2F7FCE; font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 1.15; }
.avis-preview__when { padding: 8px 10px; border: 2px solid #1A1C1E; font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2; }
.avis-preview .avis-error { color: #B83E26; }
.avis-preview__facts { display: grid; gap: 4px; margin: 0; font-size: 14px; }
.avis-preview__facts div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 6px; }
.avis-preview__facts dt { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #4A4F55; padding-top: 2px; }
.avis-preview__facts dd { margin: 0; }
.avis-preview__advice { margin: 0; padding-left: 1.2em; font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.avis-preview__contact { padding: 8px 10px; background: #1F2328; color: #FFFFFF; font-weight: 600; font-size: 14px; }
