:root {
  --fond: #f3f4f6;
  --surface: #ffffff;
  --texte: #111827;
  --doux: #6b7280;
  --bord: #e5e7eb;
  --accent: #2563eb;
  --accent-doux: #dbeafe;
  --danger: #dc2626;
  --coffret: #e9ecef;
  --module: #fbfbfa;
  --module-bord: #c9ccd1;
  --rail: #9ca3af;
  --f-eclairage: #f59e0b;
  --f-prises: #3b82f6;
  --f-volets: #10b981;
  --f-chauffage: #ef4444;
  --f-specialise: #8b5cf6;
  --f-differentiel: #374151;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0f1115; --surface: #181b21; --texte: #e5e7eb; --doux: #9ca3af; --bord: #2a2f37;
    --accent: #60a5fa; --accent-doux: #1e3a5f; --coffret: #23272e; --module: #e8e8e5; --module-bord: #8b9099; --rail: #4b5563;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0f1115; --surface: #181b21; --texte: #e5e7eb; --doux: #9ca3af; --bord: #2a2f37;
  --accent: #60a5fa; --accent-doux: #1e3a5f; --coffret: #23272e; --module: #e8e8e5; --module-bord: #8b9099; --rail: #4b5563;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--texte); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }

.entete { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 5; }
.entete h1 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-right: auto; }
.entete h1 svg { width: 20px; height: 20px; fill: #f59e0b; }
.etat { color: var(--doux); font-size: 13px; }

.bouton { border: 1px solid var(--bord); background: var(--surface); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.bouton:hover { border-color: var(--accent); }
.bouton.petit { padding: 4px 10px; font-size: 14px; }
.bouton.discret { background: transparent; }
.bouton.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--bord)); width: 100%; margin-top: 4px; }
.bouton:disabled { opacity: .35; cursor: default; }

.colonnes { display: grid; grid-template-columns: minmax(220px, 280px) minmax(320px, 1fr) minmax(380px, 1.25fr); gap: 16px; padding: 16px; align-items: start; max-width: 1600px; margin: 0 auto; }
.colonne { min-width: 0; }
.apercu { position: sticky; top: 64px; }
.titre-colonne { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 2px 10px; min-height: 30px; }
.titre-colonne h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 600; }
#col-detail .titre-colonne h2 { text-transform: none; letter-spacing: 0; color: var(--texte); font-size: 19px; }
.titre-colonne .sous { color: var(--doux); font-size: 13px; }
.actions-titre { display: flex; gap: 4px; }

.liste-pieces { list-style: none; margin: 0 0 18px; padding: 0; background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; overflow: hidden; }
.liste-pieces li + li { border-top: 1px solid var(--bord); }
.element { display: flex; flex-direction: column; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; cursor: pointer; border-left: 3px solid transparent; }
.element:hover { background: color-mix(in srgb, var(--accent-doux) 45%, transparent); }
.element.actif { background: var(--accent-doux); border-left-color: var(--accent); }
.element .nom { font-weight: 600; }
.element .sous, .sous { color: var(--doux); font-size: 13px; }
.vide-liste { color: var(--doux); padding: 10px 14px; list-style: none; }

.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.carte h3 { font-size: 14px; margin-bottom: 10px; }
.champ { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--doux); margin-bottom: 10px; }
.champ:last-child { margin-bottom: 0; }
.champ input, .champ select, #ajout-equip, .nomenclature input { border: 1px solid var(--bord); border-radius: 8px; padding: 8px 10px; background: var(--fond); color: var(--texte); font-size: 15px; width: 100%; }
.champ input:focus, .champ select:focus, .nomenclature input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deux .champ { margin-bottom: 0; }
.avec-unite { display: flex; align-items: center; gap: 6px; color: var(--doux); }
.case { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 14px; }
.aide { color: var(--doux); font-size: 13px; margin: 8px 2px 0; }

.compteur-ligne { flex-direction: row; align-items: center; justify-content: space-between; color: var(--texte); font-size: 15px; }
.compteur-ligne .libelle small { display: block; color: var(--doux); font-size: 12px; }
.compteur { display: inline-flex; align-items: center; border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; background: var(--fond); }
.compteur button { border: 0; background: none; width: 38px; height: 38px; font-size: 20px; cursor: pointer; color: var(--accent); }
.compteur button:hover { background: var(--accent-doux); }
.compteur input { width: 46px; border: 0; background: none; text-align: center; font-weight: 600; font-size: 16px; -moz-appearance: textfield; }
.compteur input::-webkit-inner-spin-button { -webkit-appearance: none; }
.compteur.petit button { width: 30px; height: 30px; font-size: 17px; }
.compteur.petit span { min-width: 22px; text-align: center; font-weight: 600; }

.equipements { list-style: none; margin: 0 0 10px; padding: 0; }
.equipement { padding: 8px 0; border-bottom: 1px solid var(--bord); }
.equipement:last-child { border-bottom: 0; }
.ligne-equip { display: flex; align-items: center; gap: 10px; }
.ligne-equip .nom { margin-right: auto; }
.supprimer { border: 0; background: none; color: var(--doux); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.supprimer:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.extra { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.mini { font-size: 13px; color: var(--doux); display: inline-flex; align-items: center; gap: 6px; }
.mini input, .mini select { border: 1px solid var(--bord); border-radius: 6px; padding: 4px 6px; background: var(--fond); width: 90px; }
.mini input[data-prop="nom"] { width: 140px; }

.conseils { border-color: color-mix(in srgb, #f59e0b 45%, var(--bord)); background: color-mix(in srgb, #f59e0b 7%, var(--surface)); }
.conseils ul { margin: 0; padding-left: 18px; font-size: 14px; }

.puces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.puce { border-left: 4px solid var(--c, var(--bord)); padding: 6px 10px; background: var(--fond); border-radius: 6px; font-size: 14px; display: flex; flex-direction: column; cursor: default; }
.puce span { color: var(--doux); font-size: 13px; }

/* Couleurs des familles */
.famille-eclairage { --c: var(--f-eclairage); }
.famille-prises { --c: var(--f-prises); }
.famille-volets { --c: var(--f-volets); }
.famille-chauffage { --c: var(--f-chauffage); }
.famille-specialise { --c: var(--f-specialise); }
.genre-differentiel { --c: var(--f-differentiel); }
.genre-contacteur, .genre-parafoudre { --c: #64748b; }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }

/* Aperçu du coffret */
.coffret { background: var(--coffret); border: 1px solid var(--bord); border-radius: 14px; padding: 14px 12px 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.rangee { display: grid; grid-template-columns: repeat(var(--modules), minmax(0, 1fr)); position: relative; margin-bottom: 10px; }
.rangee::before { content: ""; position: absolute; left: -4px; right: -4px; top: 27px; height: 8px; background: var(--rail); border-radius: 2px; opacity: .55; }
.rangee.hors { outline: 2px dashed var(--danger); outline-offset: 3px; border-radius: 4px; }
.module { position: relative; display: flex; flex-direction: column; min-width: 0; transition: opacity .15s; }
.module .corps { position: relative; height: 62px; background: var(--module); border: 1px solid var(--module-bord); border-top: 5px solid var(--c, var(--module-bord)); border-radius: 3px; margin: 0 .5px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 3px; color: #1f2937; }
.module .calibre { font-size: clamp(8px, 1.4vw, 11px); font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.module .levier { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); width: min(10px, 55%); height: 20px; background: #374151; border-radius: 2px; box-shadow: inset 0 -8px 0 #1f2937; }
.genre-differentiel .corps { background: #f1f2f0; }
.genre-differentiel .levier { width: 14px; background: #1d4ed8; box-shadow: inset 0 -8px 0 #1e3a8a; }
.module .test { position: absolute; right: 4px; bottom: 4px; font-size: 8px; width: 12px; height: 12px; border-radius: 50%; background: #fbbf24; color: #78350f; display: grid; place-items: center; font-weight: 700; }
.genre-contacteur .levier { height: 10px; top: 30px; background: #64748b; box-shadow: none; }
.genre-parafoudre .levier { width: 18px; height: 14px; background: #9ca3af; box-shadow: none; }
.module.vide .corps { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0,0,0,.04) 5px 10px); border-style: dashed; border-top-width: 1px; opacity: .55; }
.module .etiquette { font-size: clamp(7px, 1.05vw, 10px); line-height: 1.15; text-align: center; padding: 3px 1px 0; min-height: 38px; color: var(--texte); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; word-break: break-word; hyphens: auto; }
.module[data-circuit], .module[data-differentiel] { cursor: pointer; }
.module.attenue { opacity: .35; }
.module.actif .corps { box-shadow: 0 0 0 2px var(--accent); }
.module:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--doux); margin: 10px 2px; }
.alerte { margin: 8px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 14px; border: 1px solid var(--bord); background: var(--surface); }
.alerte.erreur { border-color: color-mix(in srgb, var(--danger) 45%, var(--bord)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.alerte.attention { border-color: color-mix(in srgb, #f59e0b 50%, var(--bord)); background: color-mix(in srgb, #f59e0b 8%, var(--surface)); }
.alerte.info { color: var(--doux); }

.nomenclature { width: 100%; border-collapse: collapse; font-size: 14px; }
.nomenclature th { text-align: left; color: var(--doux); font-weight: 500; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--bord); }
.nomenclature td { padding: 6px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.nomenclature tfoot td { font-weight: 600; border-bottom: 0; }
.nomenclature .nombre { text-align: right; font-variant-numeric: tabular-nums; width: 40px; }
.nomenclature input { padding: 5px 8px; font-size: 14px; min-width: 90px; }
.nomenclature .groupe td { font-weight: 600; background: var(--fond); font-size: 13px; }
.nomenclature.circuits td:last-child { color: var(--doux); }

.bulle { position: absolute; z-index: 20; max-width: 280px; background: #111827; color: #f9fafb; border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; }
.bulle .sous { color: #cbd5e1; }

.onglets-mobile { display: none; }

@media (max-width: 1100px) {
  .colonnes { grid-template-columns: minmax(200px, 250px) 1fr; }
  .apercu { grid-column: 1 / -1; position: static; }
}
@media (max-width: 720px) {
  .entete { padding: 10px 16px; }
  #imprimer { display: none; }
  .onglets-mobile { display: flex; position: sticky; top: 49px; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--bord); }
  .onglets-mobile button { flex: 1; border: 0; background: none; padding: 10px 0; color: var(--doux); border-bottom: 2px solid transparent; font-weight: 500; }
  .onglets-mobile button.actif { color: var(--accent); border-bottom-color: var(--accent); }
  .colonnes { display: block; padding: 12px 16px; }
  .colonne { display: none; }
  body[data-colonne="pieces"] #col-pieces, body[data-colonne="detail"] #col-detail, body[data-colonne="apercu"] #col-apercu { display: block; }
  .coffret { padding: 10px 6px 4px; }
  .module .corps { height: 50px; }
  .module .levier { top: 19px; height: 16px; }
  .rangee::before { top: 22px; }
}

@media print {
  .entete, .onglets-mobile, #col-pieces, #col-detail, .bulle { display: none !important; }
  .colonnes { display: block; padding: 0; }
  .apercu { position: static; }
  body { background: #fff; }
}

/* Zones (étages, bâtiments) */
.liste-pieces .zone { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; background: var(--fond); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.liste-pieces .zone .compte { font-weight: 500; margin-right: auto; }
.ajout-zone { border: 0; background: none; color: var(--accent); font-size: 18px; line-height: 1; width: 28px; height: 24px; border-radius: 6px; cursor: pointer; }
.ajout-zone:hover { background: var(--accent-doux); }
.vide-liste.petit { font-size: 13px; padding: 6px 14px; }
.zones-edit { list-style: none; margin: 0 0 10px; padding: 0; }
.zones-edit li { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.zones-edit input { flex: 1; min-width: 0; border: 1px solid var(--bord); border-radius: 8px; padding: 6px 10px; background: var(--fond); }
.zones-edit .sous { min-width: 30px; text-align: right; }

/* Analyse de l'installation */
#analyser.actif { background: var(--accent); color: #fff; border-color: var(--accent); }
#resume-modules { margin-left: auto; }
.module .repere { position: absolute; top: -9px; right: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--coffret); z-index: 1; }
.repere.erreur, .badge-rangee.erreur { background: var(--danger); }
.repere.attention, .badge-rangee.attention { background: #f59e0b; }
.repere.conseil, .badge-rangee.conseil { background: #3b82f6; }
.badge-rangee.ok { background: #10b981; }
.badge-rangee { position: absolute; left: -8px; top: -12px; z-index: 2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 9px; line-height: 15px; cursor: help; }
.analyse { margin-top: 12px; background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 12px 14px; }
.analyse-tete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.analyse-tete .sous { margin-right: auto; }
.analyse section { margin-top: 10px; }
.analyse h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.analyse ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.constat { width: 100%; text-align: left; border: 1px solid var(--bord); border-left: 4px solid var(--n); background: var(--fond); border-radius: 8px; padding: 7px 10px; font-size: 14px; cursor: pointer; }
.constat.erreur { --n: var(--danger); }
.constat.attention { --n: #f59e0b; }
.constat.conseil { --n: #3b82f6; }
.constat:hover, .constat.choisi { border-color: var(--n); background: color-mix(in srgb, var(--n) 8%, var(--surface)); }
.ok-ligne { margin: 0; font-size: 14px; color: #10b981; }
.ok-ligne::before { content: "✓ "; }

/* ---- Version 2 : en-tête, projets, menus ---- */
.entete { flex-wrap: nowrap; }
.entete h1 { margin-right: 0; }
.espace { flex: 1; }
#choix-projet { border: 1px solid var(--bord); border-radius: 8px; padding: 5px 8px; background: var(--fond); max-width: 200px; font-weight: 600; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-liste { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; min-width: 210px; display: flex; flex-direction: column; }
.menu-liste.droite { left: auto; right: 0; }
.menu-liste button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu-liste button:hover { background: var(--accent-doux); }
.danger-texte { color: var(--danger); }
.bouton.principal { background: var(--accent); color: #fff; border-color: var(--accent); }
.lien { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; font-size: inherit; }
.bandeau { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; background: color-mix(in srgb, #f59e0b 14%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, #f59e0b 40%, var(--bord)); font-size: 14px; }
.bandeau span { flex: 1; min-width: 220px; }
.alerte.ok { border-color: color-mix(in srgb, #10b981 40%, var(--bord)); background: color-mix(in srgb, #10b981 8%, var(--surface)); }

/* Pièce : « Au tableau » */
.case.discrete { margin: -2px 0 12px; font-size: 13px; color: var(--doux); }
.puce .haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.choix-id { border: 1px solid var(--bord); border-radius: 6px; padding: 2px 4px; background: var(--surface); font-size: 13px; max-width: 130px; }
.choix-id.force { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.reglages-circuit { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.reglages-circuit select { border: 1px solid var(--bord); border-radius: 6px; padding: 2px 4px; background: var(--surface); font-size: 13px; }
.jeton { font-size: 12px; background: var(--accent-doux); color: var(--texte); border-radius: 10px; padding: 2px 8px; }
.sous-titre { font-size: 13px; margin: 14px 0 6px; color: var(--doux); }
#ajout-module { border: 1px solid var(--bord); border-radius: 8px; padding: 8px 10px; background: var(--fond); width: 100%; font-size: 15px; }
.nom-module { border: 1px solid var(--bord); border-radius: 6px; padding: 4px 8px; background: var(--fond); width: 100%; }
.mini input[type="checkbox"] { width: auto; }
.mini input[data-prop="largeur"] { width: 54px; }
.genre-extra, .genre-telerupteur, .genre-minuterie { --c: #0ea5e9; }
.genre-extra .levier { width: 16px; height: 12px; top: 28px; background: #94a3b8; box-shadow: none; border-radius: 3px; }

/* Vue Circuits */
.defilant { overflow-x: auto; }
.tete-id { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; }
.tete-id h3 { margin: 0; }
.tete-id .sous { margin-left: auto; }
.tete-id select { border: 1px solid var(--bord); border-radius: 6px; padding: 2px 4px; background: var(--surface); width: auto; }
.table-circuits { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-circuits th { text-align: left; color: var(--doux); font-weight: 500; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--bord); }
.table-circuits td { padding: 6px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.nom-circuit { border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; background: transparent; font-weight: 600; width: calc(100% - 20px); min-width: 120px; }
.nom-circuit:hover, .nom-circuit:focus { border-color: var(--bord); background: var(--fond); }
.lieux { display: block; padding-left: 22px; font-size: 12px; }
.longueur { width: 58px; border: 1px solid var(--bord); border-radius: 6px; padding: 3px 6px; background: var(--fond); }
.bon { color: #059669; } .limite { color: #d97706; font-weight: 600; } .mauvais { color: var(--danger); font-weight: 700; }
.prix { width: 80px !important; min-width: 0 !important; }

/* Bilan */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.chiffres > div { display: flex; flex-direction: column; }
.grand { font-size: 24px; font-weight: 700; }
.jauge { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.barre { position: relative; height: 12px; background: var(--fond); border-radius: 6px; overflow: visible; border: 1px solid var(--bord); }
.rempli { position: absolute; left: 0; top: 0; bottom: 0; background: #10b981; border-radius: 6px; }
.rempli.limite { background: #f59e0b; } .rempli.mauvais { background: var(--danger); }
.seuil { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--texte); }
.val { text-align: right; font-variant-numeric: tabular-nums; }

/* Historique */
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bord); }
.versions li:last-child { border-bottom: 0; }
.versions li > span { display: flex; flex-direction: column; }
.ligne-form { display: flex; gap: 8px; }
.ligne-form input { flex: 1; border: 1px solid var(--bord); border-radius: 8px; padding: 7px 10px; background: var(--fond); }

/* Vues larges (schéma, étiquettes) : le détail prend aussi la place de l'aperçu */
@media (min-width: 1101px) {
  body[data-large="1"] .colonnes { grid-template-columns: minmax(220px, 280px) 1fr; }
  body[data-large="1"] #col-apercu { display: none; }
}

/* Schéma unifilaire */
.schema { display: block; max-width: none; font-family: system-ui, sans-serif; }
.schema .trait { stroke: var(--texte); stroke-width: 1.4; fill: none; }
.schema .epais { stroke-width: 3; }
.schema .boite { fill: var(--surface); stroke: var(--texte); stroke-width: 1.2; }
.schema .boite.id { fill: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.schema rect[class*="famille-"] { stroke: var(--c); stroke-width: 2; }
.schema text { fill: var(--texte); font-size: 12px; }
.schema .petit { font-size: 10.5px; }
.schema .mini { font-size: 9px; }
.schema .gras { font-weight: 700; }
.schema .doux { fill: var(--doux); }
.schema-carte { padding: 8px; }

/* Étiquettes : dimensions réelles en mm */
.etiquettes { display: flex; flex-direction: column; gap: 4mm; padding: 2mm; }
.bande { display: flex; align-items: stretch; }
.bande .num { width: 6mm; font-size: 8pt; color: var(--doux); display: flex; align-items: center; }
.etiq { box-sizing: border-box; height: 13mm; border: 0.2mm solid #555; border-left-width: 0; border-top: 1.2mm solid var(--c, #bbb); background: #fff; color: #111; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 0.5mm; overflow: hidden; flex: none; }
.bande .etiq:nth-child(2) { border-left-width: 0.2mm; }
.etiq .haut { font-size: 6.5pt; font-weight: 700; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.etiq .bas { font-size: 6pt; line-height: 1.1; }
.etiq.vide { border-top-color: #ddd; }

/* Impression */
#impression { display: none; }
@media print {
  body[data-impression] > *:not(#impression) { display: none !important; }
  body[data-impression] #impression { display: block; }
  #impression h1 { font-size: 16pt; margin: 0 0 2mm; }
  #impression h2 { font-size: 12pt; margin: 6mm 0 2mm; page-break-after: avoid; }
  #impression .page-schema { page-break-before: always; }
  #impression .page-schema svg { width: 100%; height: auto; }
  #impression .coffret { break-inside: avoid; }
  #impression .module.attenue { opacity: 1; }
  #impression .badge-rangee, #impression .repere { display: none; }
  #impression table { font-size: 9pt; }
  body[data-impression="etiquettes"] .etiq { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 10mm; }
}
@media (max-width: 720px) {
  .titre-long { display: none; }
  #choix-projet { max-width: 130px; }
  .etat { display: none; }
}
.bandeau[hidden] { display: none; }
.nombre, .val, .table-circuits td:nth-child(4), .table-circuits td:nth-child(5) { white-space: nowrap; }
@media (max-width: 720px) {
  .entete { gap: 6px; padding: 8px 12px; }
  #menu-impression { display: none; }
}
