:root {
  /* Identité Perfora (lot U1, docs/MAQUETTES_U1.md §1.3) : bleu nuit, violet (actions), orange (point, Signaler). */
  --nuit: #1A1F3B; --nuit-2: #232947; --orange: #F5A524;
  --bg: #F5F6FA; --card: #fff; --ink: #1A2238; --muted: #5B6478; --line: #E3E6EE;
  --blue: #5B57E0; --blue-soft: #EEEDFC; --red: #c2410c; --red-soft: #fdece4;
  --amber: #a16207; --amber-soft: #fbf3dc; --green: #15803d; --green-soft: #e3f4e8;
  --radius: 14px; --tabs-h: 62px; --top-h: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: var(--top-h) 0 calc(var(--tabs-h) + var(--safe-b) + 76px);
}
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 4px 0 12px; }
h2 { font-size: 1.02rem; margin: 22px 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pad { padding: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.hidden { display: none !important; }

/* barre haute */
.top {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--nuit); color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.12rem; letter-spacing: -.02em; color: #fff; }
.brand-txt { white-space: nowrap; }
.point { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-left: 2px; }
.top .sync { background: rgba(255,255,255,.1); color: #fff; }
.site { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.1); color: #fff; border-radius: 99px; padding: 5px 10px;
  font: inherit; font-size: .8rem; font-weight: 600; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
@media (max-width: 520px) { .brand-txt { display: none; } }
.net { font-size: .75rem; padding: 3px 8px; border-radius: 99px; background: rgba(21,128,61,.25); color: #B9F0CB; }
.net.off { background: rgba(245,165,36,.22); color: #FFD89A; }
.who {
  margin-left: auto; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; border-radius: 99px;
  padding: 6px 12px; font: inherit; font-size: .85rem; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* navigation */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: flex;
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--card); border-top: 1px solid var(--line);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: .72rem; color: var(--muted);
}
.tabs a .ic { font-size: 1.25rem; line-height: 1; }
.tabs a.on { color: var(--blue); font-weight: 600; box-shadow: inset 0 3px 0 var(--blue); }
.only-desktop { display: none !important; }

main { max-width: 880px; margin: 0 auto; padding: 14px 14px 0; outline: none; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabs-h) + var(--safe-b) + 14px); z-index: 19;
  background: var(--orange); color: var(--nuit); font-weight: 700; padding: 14px 20px; border-radius: 99px;
  box-shadow: 0 6px 18px rgba(245, 165, 36, .35);
}

@media (min-width: 900px) {
  body { padding: var(--top-h) 0 40px 220px; }
  .tabs {
    inset: var(--top-h) auto 0 0; width: 220px; height: auto; flex-direction: column;
    border-top: 0; border-right: 1px solid var(--line); padding: 12px 8px;
  }
  .tabs a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: .95rem; padding: 10px 12px; border-radius: 10px; }
  .tabs a.on { background: var(--blue-soft); box-shadow: none; }
  .only-mobile { display: none !important; }
  .only-desktop { display: flex !important; }
  main { padding: 22px 28px 0; }
  .fab { bottom: 24px; right: 28px; }
}

/* cartes et listes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
a.card, .card.link { display: block; color: inherit; }
a.card:active { background: #fafaf8; }
.card .t { font-weight: 650; }
.card .s { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.list-empty { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: inherit; display: block; }
.tile b { display: block; font-size: 1.6rem; }
.tile span { font-size: .85rem; color: var(--muted); }
.tile.red b { color: var(--red); } .tile.amber b { color: var(--amber); } .tile.blue b { color: var(--blue); }

.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; }
.dot.indisponible { background: var(--red); } .dot.degrade, .dot.anomalie { background: #d97706; } .dot.inconnu { background: #9ca3af; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .93rem; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }

/* boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.actions .btn { flex: 1 1 auto; }

/* formulaires */
label.f { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .92rem; }
label.f .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=datetime-local],
input[type=email], input[type=password], input[type=url], input[type=tel], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font: inherit; color: inherit;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 9px 14px; min-height: 40px; border-radius: 99px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: .92rem; user-select: none;
}
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.chip.indisponible input:checked + span { background: var(--red); border-color: var(--red); }
.chip.degrade input:checked + span, .chip.anomalie input:checked + span { background: #d97706; border-color: #d97706; }

.check { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 14px; font-weight: 600; }
.check input { width: 22px; height: 22px; }

details.more { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 12px; }
details.more summary { padding: 12px 0; cursor: pointer; font-weight: 600; }
details.more[open] { padding-bottom: 12px; }

.picker-results { display: grid; gap: 6px; margin-top: 8px; }
.picker-results button { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; }
.picked { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--blue-soft); }

.warn { background: var(--amber-soft); color: #713f12; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-top: 10px; }
.info { background: var(--blue-soft); color: #1e3a8a; border-radius: 10px; padding: 10px 12px; font-size: .9rem; }

.sticky-save { position: sticky; bottom: calc(var(--tabs-h) + var(--safe-b) + 8px); margin-top: 18px; }
@media (min-width: 900px) { .sticky-save { bottom: 16px; } }

/* listes internes */
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.lines li:first-child { border-top: 0; }
.lines li.off { color: var(--muted); text-decoration: line-through; }

.bar { height: 10px; border-radius: 99px; background: var(--blue); min-width: 4px; }
.barrow { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; font-size: .9rem; margin: 6px 0; }

.journal-item { font-size: .86rem; padding: 8px 0; border-top: 1px solid var(--line); }
.journal-item code { background: var(--bg); padding: 0 4px; border-radius: 4px; }

.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.seg a { white-space: nowrap; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .9rem; }
.seg a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* fenêtres (bas d'écran sur mobile) */
dialog.sheet {
  border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 18px 18px 0 0;
  margin: auto auto 0; background: var(--card); color: var(--ink);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, .35); }
dialog.sheet form { padding: 18px 16px calc(16px + var(--safe-b)); overflow-y: auto; max-height: 92vh; }
dialog.sheet .sheet-actions { display: flex; gap: 8px; margin-top: 18px; }
dialog.sheet .sheet-actions .btn { flex: 1; }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 18px; } }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + var(--safe-b) + 80px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw;
}
#toast.show { opacity: 1; }

video.scan { width: 100%; border-radius: 10px; background: #000; }

/* photos */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.thumbs:empty { display: none; }
.thumbs button { position: relative; padding: 0; border: 0; background: none; cursor: pointer; }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; display: block; border: 1px solid var(--line); }
.thumbs .rm { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; line-height: 22px; text-align: center; }

/* planche de QR codes */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 14px; }
.qr-label { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px dashed #bbb; border-radius: 10px; padding: 8px; break-inside: avoid; }
.qr-label svg { flex: none; }
@media print {
  body { padding: 0 !important; background: #fff; }
  .top, .tabs, .fab, #toast, .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); gap: 4mm; margin: 0; }
  .qr-label { border-color: #999; page-break-inside: avoid; }
}

/* voyant de synchronisation */
.sync { border: 0; border-radius: 99px; padding: 4px 10px; font: inherit; font-size: .75rem; background: var(--bg); color: var(--muted); cursor: pointer; white-space: nowrap; }
.sync.ok { background: var(--green-soft); color: var(--green); }
.sync.wait { background: var(--amber-soft); color: var(--amber); }
.sync.err { background: var(--red-soft); color: var(--red); }

.maj { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--top-h) + 8px); z-index: 60; display: flex; gap: 10px; align-items: center; width: max-content; max-width: 92vw; white-space: nowrap;
  background: var(--ink); color: #fff; padding: 8px 8px 8px 14px; border-radius: 12px; font-size: .9rem; box-shadow: 0 6px 18px rgba(0,0,0,.2); }

/* Écran de connexion : ni onglets, ni bouton Signaler, ni voyants */
body.ecran-connexion .tabs, body.ecran-connexion #fab, body.ecran-connexion #sync, body.ecran-connexion #site, body.ecran-connexion #who { display: none !important; }
/* Lot U1 : connexion en deux panneaux (docs/MAQUETTES_U1.md §1 bis) */
body.ecran-connexion { padding: 0; background: #fff; }
body.ecran-connexion .top { display: none; }
body.ecran-connexion main { max-width: none; padding: 0; }
.connexion { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.cnx-gauche { background: var(--nuit); color: #fff; padding: 22px 34px; display: flex; flex-direction: column; }
.cnx-logo { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.cnx-logo .point { width: 7px; height: 7px; }
.cnx-puce { align-self: flex-start; margin-top: 46px; background: var(--blue-soft); color: #4F46C8; font-size: .72rem; letter-spacing: .02em; padding: 5px 12px; border-radius: 99px; }
.cnx-gauche h1 { font-size: 2.6rem; line-height: 1.15; margin: 64px 0 18px; letter-spacing: -.02em; }
.cnx-sous { color: #A9B2D6; max-width: 400px; }
.cnx-recette { margin-top: auto; background: var(--nuit-2); border: 1px solid #2E3556; border-radius: 10px; padding: 12px 14px; color: #A9B2D6; max-width: 400px; font-size: .92rem; }
.cnx-droite { display: flex; align-items: center; justify-content: center; padding: 34px; }
.cnx-form { width: 100%; max-width: 360px; }
.cnx-sur { font-size: .7rem; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.cnx-form h2 { font-size: 1.75rem; margin: 10px 0 14px; letter-spacing: -.01em; }
.cnx-intro { color: var(--muted); margin: 0 0 8px; }
.cnx-ok { margin-top: 24px; box-shadow: 0 6px 16px rgba(91, 87, 224, .25); }
.cnx-liens { margin: 16px 0; font-size: .9rem; display: flex; flex-direction: column; gap: 10px; }
.cnx-liens .cnx-discret { color: #8A93AB; }
@media (max-width: 760px) {
  .connexion { grid-template-columns: 1fr; min-height: 0; }
  .cnx-gauche { padding: 16px 20px 18px; }
  .cnx-puce { margin-top: 16px; }
  .cnx-gauche h1 { font-size: 1.7rem; margin: 16px 0 6px; }
  .cnx-sous, .cnx-long { display: none; }
  .cnx-recette { margin-top: 10px; padding: 6px 10px; font-size: .78rem; }
  .cnx-droite { align-items: flex-start; padding: 22px 20px; }
}
.btn.block { width: 100%; }

/* Fichiers joints : vignette en cours de chargement ou absente hors ligne */
.thumbs img.attente { background: var(--line); min-height: 64px; }
.thumbs img.absente { background: var(--bg); outline: 1px dashed var(--line); }

/* Lot R2 : fiche intervention en étapes */
.frise { display: flex; gap: 6px; margin: 12px 0 4px; }
.frise span { flex: 1; text-align: center; font-size: .82rem; font-weight: 600; padding: 7px 4px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.frise span.fait { background: #dcfce7; color: #166534; }
.frise span.cour { background: var(--blue); color: #fff; }
/* R8 : jauges d'abonnement */
.jauge { height: 8px; border-radius: 99px; background: #eef1f5; overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--amber); }
/* R9 : semaine en demi-journées */
.sem-grille { display: grid; gap: 2px; font-size: .72rem; margin-bottom: 12px; }
.sem-grille .h { color: var(--muted); text-align: center; padding: 2px 0; font-weight: 600; }
.sem-grille .grp { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; text-transform: uppercase; border-bottom: 1px solid var(--line); margin-top: 6px; padding-bottom: 2px; }
.sem-grille .n { padding: 4px 4px 4px 0; font-size: .82rem; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sem-grille .n.discret { color: var(--muted); font-style: italic; }
.sem-grille .c { min-height: 38px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 2px; display: flex; flex-direction: column; gap: 2px; }
.sem-grille .c.ab { background: repeating-linear-gradient(45deg, #f1efe8, #f1efe8 4px, #fff 4px, #fff 8px); color: var(--muted); align-items: center; justify-content: center; font-size: .7rem; }
.sem-grille .c.trop { border-color: var(--amber); }
.sem-grille .c.survol, .sem-a-planifier.survol { outline: 2px dashed var(--blue); }
.k { display: block; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 4px; padding: 1px 4px; font-size: .7rem; line-height: 1.2; color: var(--ink); text-decoration: none; cursor: grab; }
.k span { color: var(--muted); }
.k.cr { border-left-color: var(--red); } .k.ra { border-left-color: var(--amber); } .k.pl { border-left-color: var(--green); }
.conflit { color: var(--red); font-size: .75rem; }
.ap-ligne { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ap-ligne .k { min-width: 86px; }
@media print {
  body.impression-semaine main > *:not(#view), body.impression-semaine #view > *:not(.sem-grille) { display: none !important; }
  body.impression-semaine .sem-grille { font-size: 9pt; }
}
@page { size: auto; }
/* R4 : petites courbes (12 mois) */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; flex: 1; }
.spark i { display: block; flex: 1; background: var(--blue); opacity: .75; border-radius: 3px 3px 0 0; min-height: 2px; }
.spark.gris i { background: var(--muted); }
.spark i.vide { background: var(--line); }
/* R5 : étapes d'une pièce (demandée → … → remise) */
.suivi-piece { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.suivi-piece span { font-size: .75rem; padding: 2px 7px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.suivi-piece span.fait { background: var(--green-soft); color: var(--green); }
.suivi-piece span.cour { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
section.etape { margin-top: 14px; }
section.etape > h2 { margin-top: 6px; }
details.etape { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 12px; }
details.etape summary { padding: 11px 0; cursor: pointer; }
details.etape[open] { padding-bottom: 12px; }
.etape-actions { margin-top: 18px; }
h3.sous { font-size: .95rem; margin: 18px 0 8px; color: var(--muted); text-transform: none; }
.acts .chip.rare { display: none; }
.acts.tout .chip.rare { display: inline-block; }
.chip-plus { border: 1px dashed var(--line); background: transparent; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; }
.acts.tout .chip-plus { display: none; }
.chip.arret input:checked + span { background: var(--red); border-color: var(--red); }
.chip.mal input:checked + span { background: #d97706; border-color: #d97706; }

/* ---------- Lot U1 : sections pliables, onglets, balayage (docs/MAQUETTES_U1.md §3 – §5) ---------- */
details.pli { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
details.pli > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; min-height: 48px; }
details.pli > summary::-webkit-details-marker { display: none; }
details.pli > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; display: inline-block; }
details.pli[open] > summary::before { transform: rotate(90deg); }
details.pli > summary .pli-t { flex: 1; }
.pli-n { color: var(--muted); font-weight: 600; font-size: .9rem; }
.pli-c { padding: 0 14px 12px; }
.pli-c > .card { box-shadow: none; }
.pli-c > .card:last-child { margin-bottom: 0; }
.plis-tous { text-align: right; font-size: .85rem; color: var(--muted); margin: -4px 0 8px; }
button.lien { border: 0; background: none; padding: 4px 2px; color: var(--blue); font: inherit; cursor: pointer; }

nav.ong { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin: 4px 0 14px; position: sticky; top: var(--top-h); background: var(--bg); z-index: 5; }
nav.ong::-webkit-scrollbar { display: none; }
nav.ong a { padding: 10px 12px; white-space: nowrap; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; }
nav.ong a.on { color: var(--blue); border-bottom-color: var(--blue); }
.ong-n { font-size: .78rem; background: var(--line); color: var(--muted); border-radius: 99px; padding: 1px 7px; margin-left: 2px; }
nav.ong a.on .ong-n { background: var(--blue-soft); color: var(--blue); }

.sw { position: relative; margin-bottom: 10px; }
.sw > .card { margin-bottom: 0; position: relative; z-index: 1; transition: transform .15s ease-out; touch-action: pan-y; }
.sw-fond { position: absolute; inset: 0; border-radius: var(--radius); display: flex; justify-content: space-between; align-items: center; padding: 0 18px; font-weight: 700; visibility: hidden; }
.sw.vers-d .sw-fond { visibility: visible; background: var(--blue); color: #fff; }
.sw.vers-g .sw-fond { visibility: visible; background: var(--amber-soft); color: var(--amber); }
.sw.vers-d .sw-lg, .sw.vers-g .sw-ld { visibility: hidden; }
.sw.sw-attente > .card { opacity: .55; }
.sw-boutons { display: none; }
@media (hover: hover) and (pointer: fine) {
  .sw-boutons { position: absolute; right: 10px; bottom: 10px; z-index: 2; gap: 6px; }
  .sw:hover .sw-boutons { display: flex; }
}
#toast-annuler { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + var(--safe-b) + 80px); z-index: 60; display: none; align-items: center; gap: 16px;
  background: var(--nuit); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 8px 22px rgba(0,0,0,.25); font-size: .92rem; }
#toast-annuler.show { display: flex; }
#toast-annuler button { border: 0; background: none; color: var(--orange); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 4px; }
@media (min-width: 900px) { #toast-annuler { bottom: 90px; } }
.squelette { background: linear-gradient(90deg, var(--line), #eef0f5, var(--line)); border-radius: 8px; height: 14px; margin: 8px 0; }
@media (prefers-reduced-motion: reduce) {
  details.pli > summary::before, .sw > .card { transition: none; }
}

/* ---------- Lot U2 : parc (docs/MAQUETTES_U2.md §1) ---------- */
.chip-filtre { display: inline-flex; align-items: center; gap: 4px; background: var(--blue-soft); color: #4F46C8; border-radius: 99px; padding: 4px 10px; font-size: .82rem; font-weight: 600; }
details.comp { margin: -6px 0 10px 18px; }
details.comp > summary { cursor: pointer; color: var(--muted); font-size: .85rem; padding: 4px 0; list-style: none; }
details.comp > summary::-webkit-details-marker { display: none; }
details.comp[open] > summary { color: var(--blue); }
details.comp > .card { margin-bottom: 6px; }

/* ---------- Lot U3 : poste PC (docs/MAQUETTES_U3.md) ---------- */
@media (min-width: 900px) and (max-width: 1099px) { main { max-width: 1000px; } }
@media (min-width: 1100px) {
  main { max-width: 1600px; }
  .split { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .split.split-tableau { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .split-liste { position: sticky; top: calc(var(--top-h) + 10px); max-height: calc(100vh - var(--top-h) - 24px); overflow: auto; padding-right: 4px; }
  .split-fiche { min-width: 0; }
  .split-fiche > .list-empty { margin-top: 48px; }
  .split-liste a.card.sel, .split-liste .sw:has(a.sel) > .card, .split-liste tr.sel td { box-shadow: inset 3px 0 0 var(--blue); background: var(--blue-soft); }
  .accueil-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .split-liste .actions { flex-wrap: wrap; }
}
.vue-choix { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.vue-choix a { padding: 4px 10px; font-size: .85rem; color: var(--muted); }
.vue-choix a.on { background: var(--blue); color: #fff; }
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--card); }
table.tbl th.tri::after { content: ' ▾'; } table.tbl th.tri.inv::after { content: ' ▴'; }
table.tbl td { padding: 7px 8px; border-bottom: 1px solid #F0F1F5; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.tbl tr[data-ligne] { cursor: pointer; }
table.tbl tr[data-ligne]:hover td { background: #F8F8FD; }
table.tbl td.coche, table.tbl th.coche { width: 28px; cursor: default; }
.barre-lot { position: sticky; top: calc(var(--top-h) + 4px); z-index: 6; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--nuit); color: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.barre-lot .btn { min-height: 32px; }
.cal { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cal table { border-collapse: collapse; width: 100%; font-size: .82rem; }
.cal th, .cal td { border-bottom: 1px solid #F0F1F5; padding: 6px 4px; text-align: center; white-space: nowrap; }
.cal th:first-child, .cal td:first-child { text-align: left; padding-left: 10px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.cal .pt { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); cursor: pointer; }
.cal .pt.retard { background: var(--red); } .cal .pt.estime { background: repeating-linear-gradient(45deg, var(--blue), var(--blue) 3px, var(--blue-soft) 3px, var(--blue-soft) 6px); }
.cal tr.charge td { font-weight: 700; background: var(--bg); } .cal td.plein { color: var(--red); }
.cal tr.zone td { background: var(--bg); font-weight: 600; color: var(--muted); text-align: left; }
#impression { display: none; }
@media print {
  body.impression-bon > *:not(#impression) { display: none !important; }
  body.impression-bon #impression { display: block; }
  body.impression-bon { padding: 0; background: #fff; }
  .bon { page-break-after: always; font-size: 11pt; color: #000; }
  .bon:last-child { page-break-after: auto; }
}
.bon { padding: 10mm 12mm; }
.bon-tete { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #1A1F3B; padding-bottom: 6px; margin-bottom: 8px; }
.bon table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.bon td, .bon th { border: 1px solid #999; padding: 5px 6px; text-align: left; vertical-align: top; }
.bon .ligne-vide { height: 22px; }

/* ---------- Lot L : « Autre » + Préciser (champ visible seulement si « Autre » est choisi) ---------- */
.precision { display: none; margin-top: 8px; }
.chips:has(input[value="autre"]:checked) + .precision, select:has(option[value="autre"]:checked) + .precision { display: block; }
