:root {
  --marine: #003142;
  --turquoise: #00989A;
  --fond: #f3f6f8;
  --carte: #ffffff;
  --trait: #d8e0e6;
  --texte: #16262e;
  --discret: #5f717b;
  --rouge: #b93a2b;
  --orange: #b8650f;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.45; color: var(--texte); background: var(--fond); display: flex; flex-direction: column; }
h1 { font-size: 1.5rem; margin: 0; color: var(--marine); }
h2 { font-size: 1.1rem; margin: 0 0 .25rem; color: var(--marine); }
h3 { font-size: 1rem; margin: 1.1rem 0 .4rem; color: var(--marine); }
p { margin: .3rem 0; }
a { color: var(--turquoise); }

.entete { background: var(--marine); color: #fff; display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; padding-top: calc(.55rem + env(safe-area-inset-top)); flex-wrap: wrap; }
.marque { color: #fff; text-decoration: none; font-weight: bold; letter-spacing: .06em; }
.marque span { color: #5fd3d4; font-weight: normal; }
.entete nav { display: flex; gap: .25rem; flex: 1; }
.entete nav a { color: #cfe3e8; text-decoration: none; padding: .4rem .8rem; border-radius: 6px; }
.entete nav a.actif { background: rgba(255,255,255,.14); color: #fff; }
.etat { border: 0; border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; color: #fff; background: #4a6672; cursor: pointer; }
.etat.vert { background: #1f7a52; } .etat.bleu { background: #1f618d; } .etat.orange { background: var(--orange); }

main { flex: 1; min-height: 0; }
.page { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.titre-page select { width: auto; }
.titre-page { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
.retour { text-decoration: none; font-size: .9rem; }
.discret { color: var(--discret); font-size: .85rem; }
.aide { color: var(--discret); font-size: .85rem; }
.alerte { color: var(--orange); font-size: .9rem; }

button, .bouton, select, input, textarea { font: inherit; }
button, .bouton { border: 1px solid var(--trait); background: #fff; color: var(--marine); border-radius: 6px; padding: .5rem .9rem; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .bouton:hover { border-color: var(--turquoise); }
button:disabled { opacity: .5; cursor: default; }
.primaire { background: var(--turquoise); border-color: var(--turquoise); color: #fff; font-weight: bold; }
.danger { color: var(--rouge); border-color: #e6c3be; }
.petit { padding: .25rem .6rem; font-size: .8rem; }
.lien { border: 0; background: none; color: var(--turquoise); padding: .3rem 0; }
.boutons { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.boutons.gauche { justify-content: flex-start; margin: 0 0 1rem; }
input, select, textarea { border: 1px solid var(--trait); border-radius: 6px; padding: .5rem .6rem; background: #fff; color: var(--texte); width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--turquoise); outline-offset: 1px; }
input[type="range"] { padding: 0; border: 0; accent-color: var(--turquoise); }
label { display: block; }
label > span { display: block; font-size: .82rem; color: var(--discret); margin-bottom: .2rem; }

.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 1rem; text-decoration: none; color: inherit; display: block; }
.carte a { text-decoration: none; color: inherit; display: block; margin-bottom: .5rem; }
a.carte:hover, .carte:has(a:hover) { border-color: var(--turquoise); }
.badge { display: inline-block; font-size: .72rem; background: #e3f3f3; color: #00696b; border-radius: 999px; padding: .1rem .6rem; margin-bottom: .4rem; }
.vide { background: var(--carte); border: 1px dashed var(--trait); border-radius: 10px; padding: 2rem 1.2rem; text-align: center; color: var(--discret); grid-column: 1 / -1; }
.vide p:first-child { color: var(--marine); font-weight: bold; }

.onglets { display: flex; gap: .25rem; border-bottom: 2px solid var(--trait); margin-bottom: 1rem; overflow-x: auto; }
.onglets a { padding: .55rem .9rem; text-decoration: none; color: var(--discret); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.onglets a.actif { color: var(--marine); font-weight: bold; border-bottom-color: var(--turquoise); }

.formulaire { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.formulaire .plein { grid-column: 1 / -1; margin: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.photos figure { margin: 0; background: var(--carte); border: 1px solid var(--trait); border-radius: 8px; padding: .4rem; display: grid; gap: .35rem; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; background: #e8edf0; }

.filtres { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filtres input { flex: 2 1 200px; } .filtres select { flex: 1 1 150px; width: auto; } .filtres button { flex: 0 0 auto; }
.produits { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.produit { text-align: left; display: flex; flex-direction: column; gap: .2rem; padding: .7rem; border-radius: 10px; }
.produit img, .produit .sans-image { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.produit .nom { font-size: .82rem; color: var(--texte); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pastille { display: inline-block; color: #fff; font-size: .7rem; border-radius: 999px; padding: .08rem .55rem; align-self: flex-start; font-weight: normal; }
.liste { display: grid; gap: .4rem; max-height: 52vh; overflow-y: auto; margin: .6rem 0; }
.ligne { display: grid; grid-template-columns: 52px 1fr auto; gap: .7rem; align-items: center; border: 1px solid var(--trait); border-radius: 8px; padding: .4rem .6rem; background: #fff; }
.ligne img, .ligne .sans-image { width: 52px; height: 52px; object-fit: contain; }
.puces { display: flex; gap: .35rem; flex-wrap: wrap; margin: .6rem 0 0; }
.puces button { padding: .2rem .7rem; font-size: .82rem; border-radius: 999px; }
.puces button.actif { background: var(--marine); color: #fff; border-color: var(--marine); }

.reglage { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; }
.reglage input { width: 5.5rem; }
.defile { overflow-x: auto; background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; margin-bottom: .8rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { background: #eaf0f3; color: var(--marine); font-size: .8rem; white-space: nowrap; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { border-bottom: 0; }
input.prix { width: 6.5rem; text-align: right; padding: .3rem .4rem; }

#modale { position: fixed; inset: 0; background: rgba(0, 30, 42, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; z-index: 20; }
#modale[hidden] { display: none; }
.boite { background: #fff; border-radius: 12px; padding: 1.1rem 1.2rem; width: 100%; max-width: 440px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
.boite.large { max-width: 780px; }
.boite h3:first-child { margin-top: 0; }
.fiche { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; }
.fiche-image img, .fiche-image .sans-image { width: 100%; aspect-ratio: 1; object-fit: contain; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .6rem; }
.cles { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: .25rem .8rem; margin: .4rem 0; font-size: .88rem; }
.cles dt { color: var(--discret); } .cles dd { margin: 0; overflow-wrap: anywhere; }
details { border-top: 1px solid var(--trait); padding: .45rem 0; }
summary { cursor: pointer; color: var(--marine); font-weight: bold; }
.docs { padding-left: 1.1rem; }
.message { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); background: var(--marine); color: #fff; padding: .6rem 1.1rem; border-radius: 8px; z-index: 40; max-width: 90vw; }

/* éditeur de plan */
body.plein-ecran { height: 100dvh; overflow: hidden; }
body.plein-ecran main { display: flex; flex-direction: column; }
.editeur { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #dfe6ea; }
.ed-barre { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; background: #fff; border-bottom: 1px solid var(--trait); overflow-x: auto; white-space: nowrap; }
.ed-barre button, .ed-barre select { padding: .4rem .7rem; font-size: .88rem; width: auto; }
.ed-barre button.actif { background: var(--marine); color: #fff; border-color: var(--marine); }
.ed-titre { color: var(--marine); max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.ed-outils { display: flex; gap: .3rem; margin: 0 auto; }
.ed-actions { display: flex; gap: .3rem; }
.ed-bandeau { background: #fff8e8; border-bottom: 1px solid #ecd9a8; padding: .4rem .8rem; font-size: .88rem; }
.ed-bandeau button { padding: .2rem .7rem; font-size: .82rem; margin-left: .5rem; }
.ed-corps { flex: 1; min-height: 0; display: flex; }
.ed-zone { flex: 1; min-width: 0; position: relative; }
.ed-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.ed-panneau { width: 290px; background: #fff; border-left: 1px solid var(--trait); padding: .8rem; overflow-y: auto; display: grid; gap: .6rem; align-content: start; }
.ed-panneau h3 { margin: 0; }
.ed-panneau .produit { border: 0; padding: 0; font-size: .88rem; display: block; }
.ed-panneau .info { font-size: .88rem; }
.ed-panneau b { color: var(--marine); float: right; }

@media (max-width: 760px) {
  .page { padding: .75rem; }
  .fiche { grid-template-columns: 1fr; } .fiche-image { max-width: 180px; }
  .trio { grid-template-columns: 1fr; }
  .ed-corps { flex-direction: column; }
  .ed-panneau { width: auto; max-height: 38vh; border-left: 0; border-top: 1px solid var(--trait); }
  .ed-outils { margin: 0; }
  body.plein-ecran .entete { display: none; }
  .ed-barre { padding-top: calc(.4rem + env(safe-area-inset-top)); }
}

/* devis */
.section-devis { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: .8rem; margin-bottom: .8rem; }
.titre-section { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; }
.titre-section input { flex: 1 1 220px; font-weight: bold; color: var(--marine); }
.titre-section [data-sous] { font-weight: bold; color: var(--marine); white-space: nowrap; }
.section-devis .defile { border: 0; margin: 0; }
table.lignes td { padding: .35rem .4rem; }
table.lignes td.des { min-width: 260px; display: grid; gap: .25rem; }
table.lignes input, table.lignes textarea { padding: .3rem .45rem; font-size: .88rem; }
table.lignes .ref { font-weight: bold; width: 60%; }
table.lignes .court { width: 4.6rem; text-align: right; }
table.lignes td:nth-child(3) .court { text-align: left; }
tr.ecart [data-c="marge"] { background: #fff3dc; border-color: #e0b660; }
tr.sans-prix [data-c="pv"] { border-color: var(--orange); }
.totaux { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: .8rem 1rem; max-width: 440px; margin-left: auto; }
.totaux dl { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1.2rem; margin: 0; }
.totaux dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totaux .fort { font-weight: bold; color: var(--marine); }

.barre-apercu { max-width: 210mm; margin: 1rem auto .6rem; padding: 0 .5rem; display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.feuille { background: #fff; color: #1b1b1b; max-width: 210mm; min-height: 297mm; margin: 0 auto 2rem; padding: 12mm 9mm 22mm; box-shadow: 0 2px 14px rgba(0, 0, 0, .15); font-size: 10pt; position: relative; overflow-x: auto; }
.feuille h1 { font-size: 12.5pt; margin: 9mm 0 4mm; }
.d-tete { display: grid; grid-template-columns: 38mm 1fr auto; gap: 4mm; align-items: start; }
.d-tete img { width: 100%; margin-top: 4mm; }
.d-ref { text-align: left; } .d-ref strong { font-size: 12.5pt; color: var(--marine); display: inline-block; margin-bottom: 2mm; }
.d-parties { display: grid; grid-template-columns: 1fr 1.25fr; gap: 6mm; margin-top: 7mm; }
.d-parties > div { border: 1px solid #d9dee2; padding: 3mm; min-height: 20mm; }
.d-parties .d-client { background: #e4e9ec; border-color: var(--marine); }
.d-table { font-size: 9.5pt; } .d-table th { background: #0d2c3b; color: #fff; font-size: 9.5pt; }
.d-table td, .d-table th { border-bottom: 0; padding: 2mm 2.5mm; }
.d-table tbody tr:not(.d-section) td { border-bottom: 1px solid #e3e7ea; }
.d-section td { background: #b3c0c7; font-weight: bold; }
.d-detail { color: #444; }
.d-table tr { break-inside: avoid; }
.d-bas { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10mm; margin-top: 8mm; break-inside: avoid; }
.d-banque { border: 1px solid #b3c0c7; padding: 3mm; margin-bottom: 6mm; }
.d-signature { border: 1px solid #1b1b1b; padding: 3mm; height: 40mm; max-width: 85mm; }
.d-totaux { border: 1px solid #0d2c3b; font-size: 10pt; margin-bottom: 6mm; }
.d-totaux td { border-bottom: 0; padding: 1.6mm 2.5mm; }
.d-totaux tr:first-child td { font-weight: bold; }
.d-totaux tr.fort td { background: #0d2c3b; color: #fff; font-weight: bold; }
.d-pied { position: absolute; left: 0; right: 0; bottom: 8mm; text-align: center; font-size: 7pt; color: #333; }
@media (max-width: 700px) { .feuille > * { min-width: 170mm; } }
@media print {
  @page { size: A4; margin: 12mm 9mm 20mm; }
  html, body { height: auto; background: #fff; display: block; }
  .entete, .barre-apercu, .message { display: none !important; }
  .feuille { box-shadow: none; margin: 0; padding: 0; max-width: none; min-height: 0; overflow: visible; position: static; }
  .feuille > * { min-width: 0; }
  .d-table thead { display: table-header-group; }
  .d-pied { position: static; margin-top: 12mm; }
}

.avec-bouton { display: flex !important; gap: .4rem; font-size: 1rem !important; color: inherit !important; margin: 0 !important; } .avec-bouton button { white-space: nowrap; }
.lecture { background: #eef7f7; border: 1px solid #b9dede; border-radius: 10px; padding: .8rem 1rem; margin-bottom: .8rem; }

/* espace client */
.e-etat { background: #fff6e0; border: 1px solid #ecd9a8; border-radius: 8px; padding: .5rem .8rem; }
.e-etat.ok { background: #e4f4ec; border-color: #a9d8bf; color: #17603f; }
.e-etat.ko { background: #fbe9e6; border-color: #e6c3be; color: var(--rouge); }
.d-signe { margin-top: 2mm; font-size: 9pt; } .d-signe img { display: block; max-height: 20mm; max-width: 70mm; }
#bloc-espace { margin-top: 1rem; display: grid; gap: .6rem; }
body.espace { display: block; height: auto; }
body.espace section { margin: 1.6rem 0; scroll-margin-top: 1rem; }
body.espace h2 { font-size: 1.25rem; margin-bottom: .6rem; }
.e-intro { background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: 1.2rem; }
.e-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.e-nav a { border: 1px solid var(--trait); border-radius: 999px; padding: .35rem .9rem; text-decoration: none; color: var(--marine); background: #fff; }
.e-nav a.fort { background: var(--turquoise); border-color: var(--turquoise); color: #fff; font-weight: bold; }
.e-bloc { background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: 1.1rem 1.2rem; }
.e-plan { margin: 0 0 1rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: .8rem; }
.e-plan figcaption { font-weight: bold; color: var(--marine); margin-bottom: .5rem; }
.e-plan img { width: 100%; border: 1px solid var(--trait); border-radius: 6px; min-height: 80px; background: #f0f3f5; }
.e-legende { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; }
.e-fiches { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .7rem; align-items: start; }
.e-fiche { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: .6rem .8rem; }
.e-fiche summary { display: grid; grid-template-columns: 72px 1fr; gap: .8rem; align-items: center; font-weight: normal; color: var(--texte); list-style: none; }
.e-fiche summary::-webkit-details-marker { display: none; }
.e-fiche summary img, .e-fiche summary .sans-image { width: 72px; height: 72px; object-fit: contain; }
.e-fiche ul { padding-left: 1.1rem; font-size: .88rem; }
.e-coche { display: flex; gap: .6rem; align-items: flex-start; margin: .8rem 0; }
.e-coche input { width: auto; margin-top: .25rem; } .e-coche span { font-size: 1rem; color: var(--texte); margin: 0; }
#trace { width: 100%; max-width: 700px; aspect-ratio: 700 / 220; border: 1px dashed var(--marine); border-radius: 8px; background: #fff; touch-action: none; display: block; }
@media print { body.espace .page { display: none; } }

.e-bloc .discret { overflow-wrap: anywhere; }

/* accès, chantiers, partenaires */
.entete nav { overflow-x: auto; white-space: nowrap; }
.connexion { position: fixed; inset: 0; background: var(--marine); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 60; }
.connexion form { background: #fff; border-radius: 14px; padding: 1.6rem; width: 100%; max-width: 340px; display: grid; gap: 1rem; }
.connexion img { width: 70%; margin: 0 auto .4rem; }
.connexion input { font-size: 1.3rem; text-align: center; letter-spacing: .2em; }
.code { font-size: 2rem; font-weight: bold; letter-spacing: .18em; text-align: center; color: var(--marine); background: #eef7f7; border-radius: 10px; padding: .8rem; user-select: all; }
.carte.gauche { text-align: left; font: inherit; cursor: pointer; }
.taches { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .35rem; }
.taches li { display: grid; grid-template-columns: auto 1fr auto auto; gap: .5rem; align-items: center; }
.taches li:has(.e-coche) { display: block; border-bottom: 1px solid var(--trait); padding: .15rem 0; }
.taches .e-coche { margin: .35rem 0; } .taches .e-coche input { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; }
.coche { width: 1.5rem; height: 1.5rem; border: 2px solid var(--trait); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; }
.coche.ok { background: #1f7a52; border-color: #1f7a52; color: #fff; }
.jauge { width: 110px; height: 8px; background: #e3e9ed; border-radius: 99px; overflow: hidden; display: inline-block; margin-right: .5rem; vertical-align: middle; }
.jauge span { display: block; height: 100%; background: var(--turquoise); }

/* factures */
.badge.rouge { background: #fbe9e6; color: var(--rouge); } .badge.vert { background: #e4f4ec; color: #17603f; }
.barre-apercu.reglements ul { padding-left: 1.1rem; }

/* ---------- coque du logiciel : bandeau à gauche, comme l'Assistante juridique ---------- */
:root { --side: 250px; }
body:not(.espace) { display: block; height: 100vh; overflow: hidden; background: #eef2f4; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; transition: grid-template-columns .15s; }
.app.reduit { --side: 64px; }
.side { background: var(--marine); color: #cfe1e5; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side .marque { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.08); text-decoration: none; letter-spacing: 0; font-weight: normal; }
.side .marque img { height: 24px; flex: none; }
.side .marque .pr { font-size: 11px; line-height: 1.25; color: #9fc3c8; white-space: nowrap; }
.side .marque .pr b { display: block; color: #fff; font-size: 13px; }
.side nav { flex: 1; display: block; overflow-y: auto; overflow-x: hidden; padding: 10px; white-space: normal; }
.side .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #6f98a1; margin: 14px 10px 6px; white-space: nowrap; }
.side .grp:first-child { margin-top: 4px; }
.side .it { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; color: #cfe1e5; font-size: 14px; padding: 9px 12px; border-radius: 7px; cursor: pointer; text-align: left; white-space: nowrap; text-decoration: none; margin: 1px 0; }
.side .it:hover { background: rgba(255,255,255,.07); color: #fff; border: 0; }
.side .it.on { background: var(--turquoise); color: #fff; font-weight: bold; }
.side .it .bdg { margin-left: auto; background: rgba(255,255,255,.18); border-radius: 9px; font-size: 10.5px; padding: 1px 7px; font-weight: bold; font-style: normal; color: #fff; }
.side .it .bdg.r { background: #d9483b; }
.side .pied { border-top: 1px solid rgba(255,255,255,.08); padding: 10px; display: grid; gap: 2px; }
.side .moi { display: flex; align-items: center; gap: 10px; padding: 4px 6px 8px; white-space: nowrap; overflow: hidden; }
.side .avt { width: 32px; height: 32px; border-radius: 50%; background: var(--turquoise); color: #fff; font-weight: bold; font-size: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.side .moi .n { color: #fff; font-weight: bold; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; } .side .moi .r { font-size: 11px; color: #9fc3c8; }
.side .etat { margin: 0 6px 6px; justify-self: start; }
.app.reduit .side .marque .pr, .app.reduit .side .grp, .app.reduit .side .it span, .app.reduit .side .it .bdg, .app.reduit .side .moi > div:last-child, .app.reduit .side .etat { display: none; }
.app.reduit .side .marque { justify-content: center; padding: 0; } .app.reduit .side .marque img { height: auto; width: 50px; } .app.reduit .side .it { justify-content: center; padding: 10px 0; }
.principal { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tb { flex: none; height: 40px; display: flex; align-items: center; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--trait); }
.tb .fil { font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--discret); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.principal main { flex: 1; min-height: 0; overflow: auto; }
body.plein-ecran .principal main { overflow: hidden; }
.page { max-width: 1180px; }

/* fiche + discussion côte à côte */
.f2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 4px; align-items: start; }
.f2:has(.dchat.mini) { grid-template-columns: minmax(0, 1fr) 46px; }
.f2 > .dchat { position: sticky; top: 12px; height: calc(100vh - 70px); margin: 12px 12px 0 0; }
.dchat { position: relative; display: flex; flex-direction: column; border: 1px solid #cfe0e3; border-left: 4px solid var(--turquoise); background: #e9f6f6; border-radius: 8px; overflow: hidden; min-height: 320px; }
.dchat .dc-bt { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(255,255,255,.2); border: 0; color: #fff; border-radius: 5px; width: 26px; height: 26px; padding: 0; cursor: pointer; font-size: 15px; }
.dchat .ct { flex: none; background: var(--turquoise); color: #fff; padding: 10px 42px 10px 14px; font-weight: bold; font-size: 13.5px; }
.dchat .ct span { display: block; font-weight: normal; font-size: 11.5px; color: #e3f6f6; margin-top: 2px; }
.dchat .fil { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.dchat .m { flex: none; max-width: 88%; padding: 7px 10px; border-radius: 10px; background: #fff; border: 1px solid #d6e4e6; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; align-self: flex-start; }
.dchat .m.moi { align-self: flex-end; background: #d7efef; border-color: #b7dcdd; } .dchat .m.prive { border-left: 4px solid #6a3fa0; }
.dchat .m .q { font-size: 10.5px; color: #5d6e75; margin-bottom: 2px; } .dchat .m .q b { color: var(--marine); float: none; } .dchat .m .pv { font-size: 10.5px; color: #6a3fa0; margin-top: 3px; }
.dchat .vide { border: 0; background: none; color: #7d8a91; font-size: 12px; text-align: center; padding: 10px; font-weight: normal; }
.dchat form { flex: none; padding: 8px 10px; border-top: 1px solid #cfe0e3; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.dchat textarea { min-height: 70px; resize: vertical; font-size: 13px; }
.dchat .ch-pied { display: flex; gap: 8px; align-items: center; font-size: 12px; } .dchat .ch-pied label { display: flex; gap: 4px; align-items: center; } .dchat .ch-pied input { width: auto; }
.dchat .ch-at { display: none; position: absolute; left: 0; right: 0; bottom: 100%; background: #fff; border: 1px solid var(--trait); border-radius: 8px; box-shadow: 0 4px 14px rgba(6,49,66,.18); max-height: 184px; overflow: auto; z-index: 3; }
.dchat .ch-at.on { display: block; } .dchat .ch-at div { padding: 6px 10px; cursor: pointer; font-size: 13px; } .dchat .ch-at div:hover { background: #e3f3f3; }
.dchat .men { color: var(--turquoise); font-weight: bold; } .dchat .men.moi { background: #fff4d6; color: #8a5a00; border-radius: 4px; padding: 0 2px; }
.dchat.mini > *:not(.dc-bt) { display: none; } .dchat.mini { min-height: 160px; align-items: center; background: #fff; }
.dchat.mini .dc-bt { position: static; transform: rotate(180deg); background: var(--turquoise); margin-top: 8px; }
.dchat.mini::after { content: "Discussion"; writing-mode: vertical-rl; color: var(--marine); font-weight: bold; font-size: 12px; margin-top: 14px; }
.dchat.en-fiche { height: 420px; margin-top: 1rem; } .dchat.en-fiche.mini { height: auto; min-height: 0; flex-direction: row; gap: 10px; padding: 6px; } .dchat.en-fiche.mini::after { writing-mode: horizontal-tb; margin: 0; align-self: center; } .dchat.en-fiche.mini .dc-bt { margin: 0; transform: rotate(90deg); }
.bulle { display: inline-block; background: #d9483b; color: #fff; border-radius: 10px; font-size: 11px; font-weight: bold; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

/* la discussion reste à droite, dépliable ; elle ne passe dessous que sur téléphone */
@media (max-width: 1200px) { .f2 { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 760px) {
  .f2, .f2:has(.dchat.mini) { grid-template-columns: minmax(0, 1fr); }
  .f2 > .dchat { position: relative; top: 0; height: 460px; margin: 0 12px 20px; }
  .f2 > .dchat.mini { height: auto; min-height: 0; flex-direction: row; gap: 10px; padding: 6px; } .f2 > .dchat.mini::after { writing-mode: horizontal-tb; margin: 0; align-self: center; } .f2 > .dchat.mini .dc-bt { margin: 0; transform: rotate(90deg); }
}
@media (max-width: 1000px) {
  .app, .app.reduit { --side: 64px; }
  .side .marque .pr, .side .grp, .side .it span, .side .it .bdg, .side .moi > div:last-child, .side .etat, #b-reduire { display: none; }
  .side .marque { justify-content: center; padding: 0; } .side .marque img { height: auto; width: 50px; } .side .it { justify-content: center; padding: 10px 0; }
}
@media (max-width: 700px) {
  body:not(.espace) { height: 100dvh; }
  .app, .app.reduit { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100dvh; }
  .side { flex-direction: row; align-items: center; padding-top: env(safe-area-inset-top); }
  .side .marque { height: 48px; border: 0; padding: 0 10px; }
  .side nav { display: flex; flex: 1; min-width: 0; padding: 4px; overflow-x: auto; gap: 2px; }
  .side .it { width: auto; padding: 8px 10px; }
  .side .pied { border: 0; padding: 4px 6px; display: flex; } .side .moi, .side .grp { display: none !important; }
  .tb { display: none; }
  body.plein-ecran .side { display: none; }
}
@media print {
  body:not(.espace) { height: auto; overflow: visible; }
  .app { display: block; height: auto; } .side, .tb, .dchat { display: none !important; }
  .principal, .principal main { display: block; overflow: visible; height: auto; }
  .f2 { display: block; }
}

.side .it.actif { color: #7fe0c0; }

/* enregistrement explicite */
.barre-enreg { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: .7rem 0; margin-top: .8rem; background: linear-gradient(to bottom, rgba(238,242,244,0), #eef2f4 35%); z-index: 5; }
.barre-enreg #etat-enreg { font-size: .85rem; color: var(--discret); } .barre-enreg #etat-enreg.en-cours { color: var(--orange); }
.barre-enreg .primaire { padding: .6rem 1.6rem; }
.onglets { scrollbar-width: none; } .onglets::-webkit-scrollbar { display: none; }

.f2 > * { min-width: 0; }
.titre-page > h1 { min-width: 0; overflow-wrap: anywhere; }

/* listes en lignes */
.page.large { max-width: none; }
table.tableau tbody tr { cursor: pointer; } table.tableau tbody tr:hover, table.tableau tbody tr:focus { background: #f1f8f8; outline: none; }
table.tableau td { vertical-align: middle; } table.tableau .badge { margin: 0; white-space: nowrap; }
/* la fiche occupe exactement sa colonne, à côté de la discussion */
.f2 > .page { width: 100%; max-width: none; margin: 0; }

.ed-sep { width: 1px; align-self: stretch; background: var(--trait); margin: 0 .3rem; }

.ed-choix { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-bottom: .3rem; }
.ed-choix .discret { margin-left: .5rem; } .ed-choix .discret:first-child { margin-left: 0; }
.ed-choix button { margin: 0; } .ed-choix button.actif { background: var(--marine); color: #fff; border-color: var(--marine); }

/* ---------- page client : présentation en tête ---------- */
body.vitrine { background: #f3f6f8; }
.v-hero { background: linear-gradient(125deg, #003142 0%, #0a4a5f 62%, #00787a 100%); color: #fff; padding: 2.2rem 1rem 4.2rem; border-bottom: 5px solid var(--turquoise); }
.v-large { max-width: 1060px; margin: 0 auto; }
.v-marque { display: flex; align-items: flex-end; gap: .7rem; margin-bottom: 1.6rem; }
.v-marque img { height: 34px; } .v-marque span { font-size: 1.05rem; letter-spacing: .32em; text-transform: uppercase; color: #8fe0e0; padding-bottom: .1rem; }
.v-sur { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: #9fd4d6; margin: 0 0 .5rem; }
.v-hero h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.5rem); line-height: 1.15; margin: 0 0 .5rem; text-wrap: balance; }
.v-pour { font-size: 1.05rem; color: #dcecee; margin: 0 0 1.3rem; }
.v-presentation { max-width: 62ch; color: #e6f1f2; margin: 0 0 1.5rem; }
.v-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; }
.v-chiffres div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-top: 3px solid #5fd3d4; border-radius: 8px; padding: .7rem .9rem; }
.v-chiffres b { display: block; font-size: 1.45rem; line-height: 1.15; } .v-chiffres span { font-size: .82rem; color: #cfe6e8; }
.v-page { max-width: 1060px; margin-top: -2.6rem; }
.v-offre { background: #fff; border: 1px solid var(--trait); border-radius: 14px; padding: 1.1rem 1.3rem; box-shadow: 0 8px 26px rgba(0, 49, 66, .12); display: grid; gap: .8rem; margin-top: 0 !important; }
.v-offre > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.2rem; }
.v-offre strong { font-size: 1.7rem; color: var(--marine); } .v-offre .e-nav { margin: 0; } .v-offre .e-etat { margin: 0; }
body.vitrine section h2 { display: flex; align-items: center; gap: .7rem; font-size: 1.3rem; }
.v-num { width: 2rem; height: 2rem; border-radius: 50%; background: var(--turquoise); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; flex: none; }
.v-solution { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(200px, 1fr); gap: 1rem; align-items: start; }
.v-solution .e-bloc { font-size: 1.02rem; line-height: 1.6; }
.v-resume { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.v-resume li { background: #fff; border: 1px solid var(--trait); border-left: 4px solid var(--turquoise); border-radius: 8px; padding: .5rem .8rem; display: flex; align-items: baseline; gap: .6rem; }
.v-resume b { font-size: 1.35rem; color: var(--marine); min-width: 1.6rem; }
.v-atouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: .8rem; }
.v-atouts div { background: #fff; border: 1px solid var(--trait); border-top: 3px solid var(--marine); border-radius: 10px; padding: .9rem 1rem; }
.v-atouts h3 { margin: 0 0 .3rem; font-size: 1rem; } .v-atouts p { margin: 0; color: #33464f; }
@media (max-width: 700px) { .v-solution { grid-template-columns: 1fr; } .v-hero { padding-top: 1.4rem; } }
@media print { .v-hero { display: none; } }

/* ---------- vue 3D ---------- */
.v3d { position: fixed; inset: 0; z-index: 70; background: #e8eef1; display: flex; flex-direction: column; }
.v3d-barre { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; background: var(--marine); color: #fff; flex-wrap: wrap; padding-top: calc(.5rem + env(safe-area-inset-top)); }
.v3d-barre strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.v3d-barre button { padding: .4rem .8rem; font-size: .88rem; }
.v3d-scene { flex: 1; min-height: 0; position: relative; }
.v3d-scene canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; cursor: grab; }
.v3d-attente { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--discret); margin: 0; padding: 1rem; text-align: center; }
.v3d-legende { position: absolute; left: 50%; bottom: 3.2rem; transform: translateX(-50%); width: min(640px, 92vw); background: rgba(0, 49, 66, .92); color: #fff; border-radius: 12px; padding: .8rem 1.1rem; display: grid; gap: .2rem; box-shadow: 0 8px 26px rgba(0,0,0,.25); }
.v3d-legende strong { font-size: 1.05rem; } .v3d-legende span { color: #dcecee; } .v3d-legende i { font-style: normal; font-size: .75rem; color: #8fe0e0; }
.v3d-aide { position: absolute; left: 0; right: 0; bottom: .6rem; text-align: center; font-size: .78rem; color: var(--discret); pointer-events: none; }
@media print { .v3d { display: none; } }

.v3d-legende[hidden] { display: none; }

.pastille .picto { width: 1.05em; height: 1.05em; vertical-align: -0.18em; margin-right: .25em; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* vue 3D : fiche d'un équipement, fonctionnement de la solution */
.v3d-fiche { position: absolute; top: 3.6rem; right: .8rem; bottom: 2.4rem; width: min(360px, 92vw); background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 49, 66, .25); padding: 1rem 1.1rem; overflow-y: auto; z-index: 3; font-size: .92rem; }
.v3d-fiche[hidden] { display: none; }
.v3d-fermer { position: absolute; top: .5rem; right: .5rem; border: 0; background: #eef2f4; border-radius: 50%; width: 2rem; height: 2rem; padding: 0; }
.v3d-famille { font-weight: bold; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; color: var(--turquoise); margin: 0 2.2rem .5rem 0; }
.v3d-fiche img { display: block; max-width: 60%; max-height: 130px; margin: .3rem auto .6rem; object-fit: contain; }
.v3d-fiche h3 { margin: 0; font-size: 1.1rem; } .v3d-nom { color: var(--discret); margin: .1rem 0 .4rem; }
.v3d-fiche h4 { margin: .9rem 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--marine); }
.v3d-fiche p { margin: 0; } .v3d-fiche ul { margin: 0; padding-left: 1.1rem; }
.v3d-fiche dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .7rem; margin: 0; } .v3d-fiche dt { color: var(--discret); } .v3d-fiche dd { margin: 0; }
.v3d-astuce { margin-top: .9rem !important; color: var(--discret); font-size: .85rem; }
@media (max-width: 700px) { .v3d-fiche { top: auto; left: .5rem; right: .5rem; width: auto; bottom: 2.2rem; max-height: 55vh; } }

/* vue 3D : habillage */
.v3d { background: linear-gradient(180deg, #dfe9ee 0%, #eef3f5 45%, #f8fafb 100%); }
.v3d-barre { box-shadow: 0 2px 12px rgba(0, 49, 66, .25); position: relative; z-index: 4; }
.v3d-barre button { border-radius: 999px; border: 0; }
.v3d-legende { bottom: 2.6rem; border-radius: 14px; padding: 0 1.2rem .8rem; overflow: hidden; backdrop-filter: blur(6px); background: rgba(0, 43, 58, .9); gap: .35rem; z-index: 2; }
.v3d-progres { height: 4px; background: rgba(255,255,255,.14); margin: 0 -1.2rem .7rem; } .v3d-progres span { display: block; height: 100%; width: 0; background: #5fd3d4; }
.v3d-legende strong { font-size: 1.1rem; } .v3d-legende .v3d-texte { color: #dcecee; line-height: 1.5; }
.v3d-commandes { display: flex; align-items: center; gap: .4rem; margin-top: .3rem; } .v3d-commandes i { font-style: normal; font-size: .78rem; color: #8fe0e0; }
.v3d-commandes button { background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; } .v3d-commandes button:hover { background: rgba(255,255,255,.24); }
.v3d-aide { bottom: .5rem; }

/* page client : interlocuteur dans l'en-tête */
.v-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; align-items: center; }
.v-contact { width: 250px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 1.3rem 1.1rem 1.1rem; text-align: center; backdrop-filter: blur(4px); margin-bottom: 1.3rem; }
.v-contact img { width: 124px; height: 124px; border-radius: 50%; object-fit: cover; border: 3px solid #5fd3d4; display: block; margin: 0 auto .8rem; }
.v-contact p { margin: 0; } .v-contact-sur { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; color: #9fd4d6; }
.v-contact-nom { font-size: 1.25rem; font-weight: bold; color: #fff; margin-top: .15rem !important; }
.v-contact-role { font-size: .85rem; color: #cfe6e8; line-height: 1.35; margin-bottom: .8rem !important; }
.v-contact a { display: block; color: #fff; text-decoration: none; font-weight: bold; background: rgba(255,255,255,.1); border-radius: 999px; padding: .4rem .6rem; margin-top: .4rem; font-size: .92rem; overflow-wrap: anywhere; }
.v-contact a:hover { background: rgba(255,255,255,.2); }
@media (max-width: 860px) {
  .v-tete { grid-template-columns: 1fr; gap: 0; }
  .v-contact { width: auto; display: grid; grid-template-columns: 76px 1fr; column-gap: .9rem; text-align: left; align-items: center; padding: .9rem; }
  .v-contact img { width: 76px; height: 76px; margin: 0; grid-row: 1 / span 5; align-self: start; }
  .v-contact a { text-align: center; }
}

/* visite animée : correction du texte */
.v3d-saisie { width: 100%; box-sizing: border-box; background: rgba(255,255,255,.96); color: #12303a; border: 0; border-radius: 8px; padding: .5rem .6rem; font: inherit; }
input.v3d-saisie { font-weight: bold; } textarea.v3d-saisie { resize: vertical; line-height: 1.45; }
.v3d-commandes .v3d-valider { background: #00989a; } .v3d-commandes .v3d-valider:hover { background: #00adb0; }

/* éditeur de plan : famille d'outils « Dessin » */
.ed-famille { position: relative; } .ed-famille summary { list-style: none; cursor: pointer; border: 1px solid var(--trait); border-radius: 8px; padding: .45rem .8rem; background: #fff; white-space: nowrap; user-select: none; }
.ed-famille summary::-webkit-details-marker { display: none; } .ed-famille summary.actif { background: var(--marine); color: #fff; border-color: var(--marine); }
.ed-famille > div { position: absolute; top: calc(100% + .3rem); left: 0; z-index: 30; background: #fff; border: 1px solid var(--trait); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 49, 66, .18); padding: .35rem; display: grid; gap: .25rem; min-width: 11rem; }
.ed-famille > div button { text-align: left; width: 100%; }
/* vue 3D : textes de la visite */
.v3d-fiche.v3d-textes { width: min(440px, 94vw); }
.v3d-etape input, .v3d-etape textarea { width: 100%; box-sizing: border-box; font: inherit; border: 1px solid #cfd8dc; border-radius: 6px; padding: .4rem .5rem; margin-top: .25rem; }
.v3d-etape input { font-weight: bold; } .v3d-etape textarea { resize: vertical; line-height: 1.4; }
.v3d-pied { position: sticky; bottom: -1rem; background: #fff; display: flex; gap: .4rem; justify-content: flex-end; padding: .7rem 0 .2rem; margin-top: .8rem; border-top: 1px solid #e3e9ec; }

.v3d-rediger { width: 100%; background: var(--turquoise); color: #fff; border: 0; border-radius: 8px; padding: .55rem .8rem; font-weight: bold; margin-top: .3rem; }
.v3d-rediger:disabled { opacity: .7; }

.ed-famille summary { font-weight: normal; font-size: .88rem; padding: .4rem .7rem; border-radius: 6px; color: var(--marine); }
.ed-famille > div { position: fixed; top: 0; left: 0; z-index: 60; }

.v3d-coche { display: flex; align-items: center; gap: .45rem; font-size: .88rem; margin: .2rem 0 .1rem; cursor: pointer; } .v3d-coche input { width: auto; margin: 0; }

.v3d-barre select { border-radius: 999px; border: 0; padding: .4rem .7rem; font-size: .88rem; background: #fff; color: var(--marine); max-width: 15rem; width: auto; }
