/* ══════════════════════════════════════════════════════════════════════════
 * BIMREVO — REFONTE 2026-10 « instrument de géomètre »
 * Chargée en dernier : elle prime sur stylesbim.css et les <style> internes.
 *
 * Papier froid, encre, traits fins. Le bleu BIMREVO porte les actions,
 * le jaune jalon marque les relevés et les quelques actions qui font avancer le travail.
 * Pas de dégradé, pas de majuscules décoratives, pas d'ombres en couches.
 * ══════════════════════════════════════════════════════════════════════════ */
:root {
  --papier: #F3F5F4;
  --surface: #FFFFFF;
  --surface-2: #F7F8F8;
  --encre: #1C2430;
  --encre-2: #4A5462;
  --encre-3: #5F6976;
  --trait: #D6DCE1;
  --trait-2: #E6EAED;
  --bleu: #1A56E8;
  --bleu-fonce: #1243B8;
  --bleu-pale: #EAF0FD;
  --jalon: #F5C518;
  --rouge: #C8372D;
  --vert: #1E7F55;
  --ambre: #B7791F;
  --f: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 4px;
  --r-panneau: 8px;
  --ombre-panneau: 0 1px 0 rgba(28,36,48,.04), 0 6px 18px rgba(28,36,48,.08);
  --header-h: 48px;
  --barre-h: 28px;
  /* anciennes variables de l'app, réalignées */
  --blue: #1A56E8; --blue-d: #1243B8; --blue-l: #EAF0FD;
  --yellow: #F5C518; --green: #1E7F55; --red: #C8372D; --amber: #B7791F;
  --font: var(--f);
}

/* ── Typographie unique ─────────────────────────────────────────────────── */
html, body { background: var(--papier) !important; color: var(--encre); }
body, body *:not(svg):not(svg *):not(.cesium-widget *):not(code):not(pre):not(.mono):not([class*="mono"]) {
  font-family: var(--f) !important;
}
body * { text-transform: none !important; }
body *:not(.gr-brand-name) { letter-spacing: normal !important; }
.mono, code, kbd { font-family: var(--mono) !important; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--bleu) !important; outline-offset: 2px !important; }
::selection { background: var(--bleu-pale); }
* { scrollbar-width: thin; scrollbar-color: #C3CAD1 transparent; }

/* ── En-tête ───────────────────────────────────────────────────────────── */
.gr-header {
  height: var(--header-h) !important;
  background: var(--surface) !important;
  border-bottom: 1px solid var(--trait) !important;
  box-shadow: none !important;
  padding: 0 12px 0 14px !important;
}
.gr-header::after, .gr-header::before { display: none !important; }
.gr-brand-name { font-size: 15px !important; font-weight: 700 !important; letter-spacing: .06em !important; color: var(--encre) !important; }
.gr-brand-tagline { display: none !important; }
.gr-brand-cube { width: 24px !important; height: 24px !important; }

.gr-breadcrumb {
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  padding: 0 8px !important; gap: 6px !important; height: 30px;
  border-left: 1px solid var(--trait-2) !important; border-radius: 0 !important;
}
.gr-bc-item { font-size: 13px !important; color: var(--encre-2) !important; font-weight: 500 !important; }
.gr-bc-project { color: var(--encre) !important; font-weight: 600 !important; }
.gr-bc-sep { color: #B5BDC6 !important; }
.gr-bc-status { background: transparent !important; border: 0 !important; padding: 0 0 0 4px !important; font-size: 12px !important; color: var(--encre-3) !important; font-weight: 500 !important; }
.gr-bc-icon { display: none !important; }

/* Modules : groupe segmenté discret */
.gr-header-right { gap: 6px !important; }
.gr-module, .gr-btn {
  height: 32px !important; padding: 0 11px !important;
  border-radius: var(--r) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--encre-2) !important;
  font-size: 13px !important; font-weight: 500 !important;
  gap: 7px !important;
}
.gr-module svg, .gr-btn svg { width: 16px !important; height: 16px !important; stroke-width: 1.7 !important; }
.gr-module:hover, .gr-btn:hover { background: var(--surface-2) !important; color: var(--encre) !important; border-color: var(--trait-2) !important; }
.gr-module.active, .gr-module.is-active, .gr-module[aria-pressed="true"], .gr-module-primary.active,
.gr-btn.active, .gr-btn.is-active, .gr-btn[aria-pressed="true"] {
  background: var(--bleu-pale) !important; color: var(--bleu-fonce) !important; border-color: #C9D8FA !important;
}
.gr-btn-pro { color: var(--encre-2) !important; background: transparent !important; }
.gr-btn-pro svg { color: var(--jalon); fill: none; }
.gr-header-divider { background: var(--trait-2) !important; height: 22px !important; }
.gr-demo { display: none !important; }

/* ── Barre d'outils carte (gauche) ─────────────────────────────────────── */
.gr-toolbar {
  top: calc(var(--header-h) + 12px) !important; left: 12px !important;
  padding: 4px !important; border-radius: var(--r-panneau) !important;
  background: var(--surface) !important; border: 1px solid var(--trait) !important;
  box-shadow: var(--ombre-panneau) !important;
}
.gr-tool { width: 34px !important; height: 34px !important; border-radius: var(--r) !important; color: var(--encre-2) !important; }
.gr-tool:hover { background: var(--surface-2) !important; color: var(--encre) !important; }
.gr-tool.is-active { background: var(--encre) !important; color: #fff !important; }
.gr-tool.is-active::before { background: var(--jalon) !important; }
.gr-tool-label { background: var(--encre) !important; font-size: 12px !important; font-weight: 500 !important; border-radius: var(--r) !important; }
.gr-tool-label::before { background: var(--encre) !important; }
.gr-tool-group + .gr-tool-group { border-top-color: var(--trait-2) !important; }

.gr-measure-bar {
  top: var(--header-h) !important; height: 40px !important;
  background: var(--surface) !important; border-bottom: 1px solid var(--trait) !important; box-shadow: none !important;
}
.gr-measure-tool { font-size: 13px !important; font-weight: 500 !important; color: var(--encre-2) !important; border-radius: var(--r) !important; }
.gr-measure-tool:hover { background: var(--surface-2) !important; color: var(--encre) !important; }
.gr-measure-tool.active, .gr-measure-tool.is-active { background: var(--encre) !important; color: #fff !important; box-shadow: inset 0 -2px 0 var(--jalon) !important; }

/* ── IFC Studio ────────────────────────────────────────────────────────── */
#ifcViewerPanel {
  top: var(--header-h) !important; height: calc(100vh - var(--header-h) - var(--barre-h)) !important;
  background: var(--surface) !important; border-left: 1px solid var(--trait) !important; box-shadow: none !important;
}
.ifc-topbar { height: 42px !important; background: var(--surface) !important; border-bottom: 1px solid var(--trait) !important; padding: 0 10px !important; }
.ifc-topbar::after { display: none !important; }
.ifc-logo { display: none !important; }
.ifc-topbar-left .ifc-tb-sep:first-of-type { display: none !important; }
.ifc-tb-btn {
  height: 42px !important; padding: 0 10px !important; border-radius: 0 !important;
  font-size: 13px !important; font-weight: 500 !important; color: var(--encre-2) !important;
  background: transparent !important; box-shadow: inset 0 -2px 0 transparent !important;
}
.ifc-tb-btn svg { width: 15px !important; height: 15px !important; }
.ifc-tb-btn:hover { color: var(--encre) !important; background: transparent !important; box-shadow: inset 0 -2px 0 var(--trait) !important; }
.ifc-tb-btn.active { color: var(--bleu-fonce) !important; background: transparent !important; box-shadow: inset 0 -2px 0 var(--bleu) !important; font-weight: 600 !important; }
.ifc-topbar-right { border-left-color: var(--trait-2) !important; }

/* Boutons « pilule » jaunes → boutons sobres */
.ifc-drop-pill, #bimCloudDropPill, #bimTilesetPill, .ifc-save-btn, .ifc-ph-cta {
  height: 30px !important; padding: 0 10px !important; border-radius: var(--r) !important;
  background: var(--surface) !important; color: var(--encre) !important;
  border: 1px solid var(--trait) !important; box-shadow: none !important;
  font-size: 12.5px !important; font-weight: 500 !important;
}
.ifc-drop-pill:hover, #bimCloudDropPill:hover, #bimTilesetPill:hover { border-color: var(--encre-3) !important; background: var(--surface-2) !important; }
#ifcDropZone, .ifc-ph-cta { background: var(--bleu) !important; color: #fff !important; border-color: var(--bleu) !important; }
#ifcDropZone:hover, .ifc-ph-cta:hover { background: var(--bleu-fonce) !important; }
.ifc-save-btn { background: var(--encre) !important; color: #fff !important; border-color: var(--encre) !important; }
.ifc-file-pill { border-radius: var(--r) !important; background: var(--surface-2) !important; border: 1px solid var(--trait-2) !important; font-size: 12px !important; }
.ifc-vr-btn { border-radius: var(--r) !important; font-size: 12px !important; font-weight: 600 !important; }
.ifc-vr-btn:not(:disabled):hover, .ifc-vr-btn.active { background: var(--bleu) !important; border-color: var(--bleu) !important; box-shadow: none !important; }
.ifc-close-btn { border-radius: var(--r) !important; }

.ifc-main { background: var(--papier) !important; }
.ifc-panel-left, .ifc-panel-right {
  background: var(--surface) !important; border-color: var(--trait) !important;
}
.ifc-panel-title {
  font-size: 12px !important; font-weight: 600 !important; color: var(--encre-2) !important;
  padding: 12px 12px 6px !important; background: transparent !important; border: 0 !important;
}
.ifc-badge { background: var(--surface-2) !important; color: var(--encre-3) !important; border: 1px solid var(--trait-2) !important; border-radius: 10px !important; font-weight: 500 !important; }
.ifc-viewer-wrap { background: #E9EDEC !important; }
.ifc-tools-icons { border-radius: var(--r-panneau) !important; border-color: var(--trait) !important; box-shadow: var(--ombre-panneau) !important; }
.ifc-tool-icon { border-radius: var(--r) !important; color: var(--encre-2) !important; }
.ifc-tool-icon.active { background: var(--encre) !important; color: #fff !important; }
.ifc-stat-card, .ifc-stats-overlay > * { border-radius: var(--r) !important; box-shadow: none !important; border: 1px solid var(--trait) !important; background: rgba(255,255,255,.94) !important; }
.ifc-stat-label { font-size: 11px !important; color: var(--encre-3) !important; font-weight: 500 !important; }
.ifc-stat-val { font-size: 15px !important; color: var(--encre) !important; font-weight: 600 !important; }
.ifc-viewer-hint { background: rgba(255,255,255,.9) !important; border: 1px solid var(--trait-2) !important; color: var(--encre-3) !important; font-size: 11.5px !important; border-radius: var(--r) !important; box-shadow: none !important; }
.ifc-placeholder { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.ifc-ph-icon { background: transparent !important; color: var(--bleu) !important; }
.ifc-ph-title { font-size: 18px !important; font-weight: 600 !important; color: var(--encre) !important; }
.ifc-ph-sub, .ifc-ph-formats { color: var(--encre-3) !important; font-size: 13px !important; }
.ifc-loading-bar { background: var(--bleu) !important; }
.ifc-props-empty-title { color: var(--encre-2) !important; font-weight: 600 !important; }
.ifc-props-empty-sub { color: var(--encre-3) !important; }

/* Arbres couches / niveaux */
.ifc-layer-tree *, .ifc-levels-section * { font-size: 13px !important; }
.ifc-level-item.active, .ifc-layer-row.active { background: var(--bleu-pale) !important; color: var(--bleu-fonce) !important; }

/* ── Onglets Audit / QTO / Conformité / Comparaison (styles en ligne) ──── */
#ifcPanelChecker, #ifcPanelQto, #ifcPanelRecalage, #ifcPanelCompare { background: var(--papier) !important; }
#ifcViewerPanel [style*="border-radius:12px"], #ifcViewerPanel [style*="border-radius: 12px"],
#ifcViewerPanel [style*="border-radius:14px"], #ifcViewerPanel [style*="border-radius:16px"] { border-radius: var(--r-panneau) !important; }
#ifcViewerPanel [style*="box-shadow"] { box-shadow: none !important; }
#ifcViewerPanel button { border-radius: var(--r) !important; }
.audit-card, .check-card { border-radius: var(--r) !important; box-shadow: none !important; border: 1px solid var(--trait-2) !important; border-left-width: 3px !important; background: var(--surface) !important; }

/* ── Panneaux et modales génériques ────────────────────────────────────── */
.sidebar {
  top: var(--header-h) !important; bottom: var(--barre-h) !important; height: auto !important;
  background: var(--surface) !important; color: var(--encre) !important;
  border-right: 1px solid var(--trait) !important; box-shadow: var(--ombre-panneau) !important;
}
.sidebar * { color: inherit; }
.gr-sidebar-header { border-bottom: 1px solid var(--trait-2) !important; background: transparent !important; }
.gr-sidebar-title { font-size: 15px !important; font-weight: 600 !important; color: var(--encre) !important; }
.gr-sidebar-close { color: var(--encre-3) !important; background: transparent !important; }
.gr-sidebar-project { color: var(--encre-3) !important; font-size: 12.5px !important; font-weight: 500 !important; }
.category-card { background: var(--surface-2) !important; border: 1px solid var(--trait-2) !important; border-radius: var(--r-panneau) !important; box-shadow: none !important; }
.category-card:hover { border-color: var(--bleu) !important; }
.category-title { color: var(--encre) !important; font-size: 13px !important; font-weight: 600 !important; }
.category-thumb { background: #E9EDEC !important; border-radius: var(--r) !important; }
.panel-card { background: var(--surface) !important; border: 1px solid var(--trait-2) !important; box-shadow: none !important; border-radius: var(--r-panneau) !important; }
.panel-title { color: var(--encre) !important; font-weight: 600 !important; font-size: 13px !important; }
.chip { background: var(--surface-2) !important; color: var(--encre-3) !important; border: 1px solid var(--trait-2) !important; }
#pcEmptyHint, #bimEmptyHint { color: var(--encre-3) !important; font-style: normal !important; }
#bimPlacedList > div, #pcPlacedList > div { color: var(--encre) !important; }
#bimPlacedList [style*="color:#fff"], #pcPlacedList [style*="color:#fff"] { color: var(--encre) !important; }
#pcPlaceOnMapBtn, #bimPlaceOnMapBtn { background: var(--bleu) !important; box-shadow: none !important; border-radius: var(--r) !important; font-weight: 600 !important; }
.close-button { border-radius: var(--r) !important; background: var(--surface-2) !important; color: var(--encre) !important; border: 1px solid var(--trait) !important; }
.map-attrib { display: none !important; }

.layers-panel {
  background: var(--surface) !important; color: var(--encre) !important;
  border: 1px solid var(--trait) !important; border-radius: var(--r-panneau) !important; box-shadow: var(--ombre-panneau) !important;
  bottom: calc(var(--barre-h) + 12px) !important;
}
.layers-panel * { color: inherit; }
.layers-panel .panel-header { background: transparent !important; border-bottom: 1px solid var(--trait-2) !important; font-weight: 600 !important; }

/* Modales créées par les modules (styles en ligne) : coins, en-têtes plats */
[id$="Modal"] > div, [class*="modal"] > div[style*="border-radius"] { border-radius: var(--r-panneau) !important; }

/* Boutons primaires en ligne (verts « Poser sur la carte », etc.) */
button[style*="background:#16A34A"], button[style*="background: #16A34A"] { background: var(--bleu) !important; box-shadow: none !important; }

/* ── Carte : pied, crédits, contrôles swisstopo ────────────────────────── */
#viewer_container { bottom: var(--barre-h) !important; }
.cesium-viewer-fullscreenContainer { bottom: calc(var(--barre-h) + 8px) !important; right: 8px !important; }
#sw3dCredit { display: none !important; } /* crédit repris dans la barre de lecture */
#bimLecture .lec-credit { display: none; }
body[data-view="carto"] #bimLecture .lec-credit, body[data-view="split"] #bimLecture .lec-credit { display: inline; }
#bimLecture .lec-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ── Barre de lecture (signature) ──────────────────────────────────────── */
#bimLecture {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--barre-h); z-index: 9000;
  display: flex; align-items: center; gap: 18px; padding: 0 12px;
  background: var(--encre); color: #C9D1DA;
  font-size: 12px; line-height: 1; user-select: text;
}
#bimLecture .lec-vue { color: #fff; font-weight: 600; }
#bimLecture .lec-sep { width: 1px; height: 14px; background: #3A4553; }
#bimLecture .lec-coord { display: flex; gap: 14px; font-family: var(--mono) !important; font-variant-numeric: tabular-nums; color: #fff; }
#bimLecture .lec-coord b { font-family: var(--f) !important; font-weight: 500; color: var(--jalon); margin-right: 5px; }
#bimLecture .lec-coord .lec-vide { color: #6F7B89; }
#bimLecture .lec-info { color: #9AA6B3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#bimLecture .lec-droite { margin-left: auto; display: flex; gap: 14px; align-items: center; color: #8592A0; white-space: nowrap; }
#bimLecture a { color: #C9D1DA; text-decoration: none; }
#bimLecture a:hover { color: #fff; }

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  :root { --header-h: 48px; }
  .gr-module span, .gr-btn span { display: none !important; }
  .gr-module, .gr-btn { padding: 0 8px !important; }
  .gr-breadcrumb { display: none !important; }
  .gr-toolbar { top: auto !important; left: 50% !important; bottom: calc(var(--barre-h) + 10px) !important; }
  #ifcViewerPanel { min-width: 0 !important; width: 100vw !important; }
  #bimLecture { gap: 10px; font-size: 11px; }
  #bimLecture .lec-info, #bimLecture .lec-droite > span:first-child, #bimLecture .lec-droite > a { display: none; }
  body:not([data-view="carto"]):not([data-view="split"]) #bimLecture .lec-droite { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ── Passe 2 : boutons injectés, panneaux restants ─────────────────────── */
.gr-module-pano, .gr-help-btn {
  height: 32px !important; padding: 0 11px !important; border-radius: var(--r) !important;
  border: 1px solid transparent !important; background: transparent !important; box-shadow: none !important;
  color: var(--encre-2) !important; font-size: 13px !important; font-weight: 500 !important;
  display: inline-flex !important; align-items: center; gap: 7px !important;
}
.gr-module-pano svg, .gr-help-btn svg { width: 16px !important; height: 16px !important; stroke: currentColor !important; stroke-width: 1.7 !important; }
.gr-module-pano:hover, .gr-help-btn:hover { background: var(--surface-2) !important; border-color: var(--trait-2) !important; color: var(--encre) !important; }
.gr-module-pano.active { background: var(--bleu-pale) !important; color: var(--bleu-fonce) !important; border-color: #C9D8FA !important; }

/* La barre d'outils suit le menu de la carte quand il est ouvert */
body:has(.sidebar.open) .gr-toolbar { left: calc(min(300px, 100vw) + 12px) !important; }
.sidebar { width: 300px !important; }
/* Barre de mesures ouverte : les contrôles swisstopo descendent sous elle */
body.measure-bar-open #sw3d { top: 54px !important; }
.gr-measure-bar { left: 0 !important; right: 0 !important; padding-left: 12px !important; gap: 2px !important; }

/* Pied d'IFC Studio : remplacé par la barre de lecture */
.ifc-statusbar { display: none !important; }

/* Légende des couches = teintes de la maquette */
.lc-wall { background: #CFC9BE !important; } .lc-slab { background: #9DA2A4 !important; }
.lc-roof { background: #77716B !important; } .lc-col { background: #B5B9BB !important; }
.lc-beam { background: #A9AEB2 !important; } .lc-door { background: #A77B52 !important; }
.lc-win { background: #9DB8CB !important; } .lc-stair { background: #BEB9AF !important; }
.lc-space { background: #7FB59A !important; } .lc-other { background: #A9AFB5 !important; }

/* Quantitatifs */
.qto-tree-cat-head { background: var(--surface) !important; color: var(--encre) !important; border-bottom: 1px solid var(--trait) !important; border-radius: 0 !important; }
.qto-tree-cat-title { color: var(--encre) !important; font-weight: 600 !important; font-size: 14px !important; }
.qto-stat-pill { background: var(--surface-2) !important; color: var(--encre-2) !important; border: 1px solid var(--trait-2) !important; border-radius: var(--r) !important; }
.qto-stat-pill b { color: var(--encre) !important; font-family: var(--mono) !important; font-weight: 500 !important; }
.qto-tree-cat { border: 1px solid var(--trait) !important; border-radius: var(--r-panneau) !important; box-shadow: none !important; overflow: hidden; }
#qtoExportXlsxBtn, #qtoExportCsvBtn { border-radius: var(--r) !important; font-size: 12.5px !important; font-weight: 500 !important; box-shadow: none !important; }
#qtoExportXlsxBtn { background: var(--encre) !important; border-color: var(--encre) !important; color: #fff !important; }
#qtoExportCsvBtn { background: var(--surface) !important; color: var(--encre) !important; border: 1px solid var(--trait) !important; }
#ifcPanelQto td, #ifcPanelQto th { font-size: 12.5px !important; }
/* (chiffres QTO : même police que le texte, voir passe 17) */

/* Calques (panneau flottant) */
#bimLayersPanel { border-radius: var(--r-panneau) !important; border-color: var(--trait) !important; box-shadow: var(--ombre-panneau) !important; bottom: calc(var(--barre-h) + 12px) !important; left: 12px !important; }
#bimLayersHead { background: var(--surface) !important; color: var(--encre) !important; border-bottom: 1px solid var(--trait-2) !important; }
#bimLayersHead strong { font-size: 13.5px !important; font-weight: 600 !important; }

/* Pano Studio : fond encre (les photos se lisent mieux sur sombre) */
.pano-modal { background: #151B24 !important; top: var(--header-h) !important; bottom: var(--barre-h) !important; }
.pano-modal [style*="#0A0E1A"], .pano-modal [style*="#11161F"] { background-color: #151B24 !important; }

/* Connexion / compte */
.bim-modal-card { border-radius: var(--r-panneau) !important; box-shadow: 0 20px 50px rgba(28,36,48,.22) !important; border: 1px solid var(--trait) !important; }
.bim-modal-header { background: var(--surface) !important; border-bottom: 1px solid var(--trait-2) !important; }
.bim-modal-header::after { display: none !important; }
.bim-modal-brand-g { display: none !important; }
.bim-modal-brand-name { font-weight: 700 !important; color: var(--encre) !important; letter-spacing: .06em !important; }
.bim-modal-brand-sub { color: var(--encre-3) !important; }
.bim-tab.active { color: var(--bleu-fonce) !important; border-bottom-color: var(--bleu) !important; }
.bim-modal-body input, .bm-form-input { border-radius: var(--r) !important; border: 1px solid var(--trait) !important; font-size: 14px !important; }
.bim-modal-body input:focus { border-color: var(--bleu) !important; box-shadow: 0 0 0 3px var(--bleu-pale) !important; }
.bim-btn-primary, .bim-modal-body button[type="submit"] { background: var(--bleu) !important; border-radius: var(--r) !important; box-shadow: none !important; font-weight: 600 !important; }
.bim-modal-backdrop, .bm-overlay { background: rgba(28,36,48,.45) !important; backdrop-filter: none !important; }

/* Aide */
.help-modal, [class*="help-card"] { border-radius: var(--r-panneau) !important; }
[class*="help-tip"] { background: #FFF8DB !important; border-color: #F0D98A !important; }

/* Contrôles swisstopo alignés sur la nouvelle charte */
.sw3d-bar, .sw3d-pane { border-color: var(--trait) !important; border-radius: var(--r-panneau) !important; box-shadow: var(--ombre-panneau) !important; }
.sw3d-btn { font-size: 13px !important; font-weight: 500 !important; border-radius: var(--r) !important; }
.sw3d-btn[aria-expanded=true] { background: var(--encre) !important; color: #fff !important; }
.sw3d-row input:checked + .sw3d-sw { background: var(--bleu) !important; }

/* ── Passe 3 : sélecteur de vue, ordre de l'en-tête ────────────────────── */
.gr-modules { display: flex !important; align-items: center; gap: 4px !important; }
.gr-vues { display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--trait-2); border-radius: 6px; margin-right: 6px; }
.gr-vues .gr-module { height: 28px !important; border: 1px solid transparent !important; }
.gr-vues .gr-module.gr-module-primary {
  background: var(--surface) !important; color: var(--encre) !important;
  border-color: var(--trait) !important; box-shadow: 0 1px 1px rgba(28,36,48,.06) !important; font-weight: 600 !important;
}
.gr-vues .gr-module.gr-module-primary svg { color: var(--bleu); }
.gr-module-primary:not(.gr-vues *) { background: transparent !important; color: var(--encre-2) !important; }
.gr-header-right > * { order: 5; }
.gr-header-right > .gr-help-btn { order: 6; }
.gr-header-right > .gr-header-divider { order: 7; }
.gr-header-right > .gr-btn-pro { order: 8; }
.gr-header-right > #bimAuthBtn { order: 9; }
#bimLayersBtn.active, #bimLayersBtn.is-open { background: var(--bleu-pale) !important; color: var(--bleu-fonce) !important; }

/* Pano ouvert : la barre de mesures de la carte s'efface */
body:has(.pano-modal.show) .gr-measure-bar, body:has(.pano-modal.show) #measureToolsBar { display: none !important; }

/* ── Passe 4 : mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  .gr-btn { font-size: 0 !important; padding: 0 8px !important; }
  .gr-btn span, #bimAuthBtnLabel, .gr-help-btn span, .gr-module-pano span { display: none !important; }
  .gr-btn-pro { display: none !important; }
  .gr-header-divider { display: none !important; }
  /* La maquette s'ouvre aussi sur téléphone : viewer plein écran, panneaux masqués */
  #ifcViewerBtn { display: inline-flex !important; }
  .gr-vues { margin-right: 2px; }
  #ifcViewerPanel { left: 0 !important; right: 0 !important; width: 100vw !important; min-width: 0 !important; }
  #ifcResizeHandle { display: none !important; }
  .ifc-panel-left, .ifc-panel-right { display: none !important; }
  .ifc-topbar-right #bimTilesetPill, .ifc-topbar-right #bimCloudDropPill, .ifc-topbar-right .ifc-vr-btn, .ifc-topbar-right .ifc-save-btn { display: none !important; }
  .ifc-tb-btn { padding: 0 8px !important; font-size: 12.5px !important; }
  .ifc-viewer-hint { display: none !important; }
}
/* Sur téléphone on garde Maquette ET Carte (l'ancien CSS ne montrait que la vue active) */
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  .gr-vues #ifcViewerBtn, .gr-vues #bimViewCartoBtn { display: inline-flex !important; }
  .gr-modules #bimLayersBtn { display: none !important; }
}

/* ── Passe 5 : audit, conformité, panneaux flottants ───────────────────── */
.aud-tete { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 18px 22px; background: var(--surface); border-bottom: 1px solid var(--trait); flex-shrink: 0; }
.aud-score { display: flex; align-items: baseline; gap: 4px; }
.aud-score #ifcScoreVal { font-size: 44px !important; font-weight: 600 !important; line-height: 1; color: var(--encre) !important; font-variant-numeric: tabular-nums; }
.aud-score small { font-size: 14px; color: var(--encre-3); }
.aud-libelle { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--encre-2); margin-bottom: 8px; }
#ifcScoreBadge { padding: 2px 9px !important; border-radius: 10px !important; font-size: 12px !important; font-weight: 600 !important; }
.aud-barre { height: 6px; background: var(--trait-2); border-radius: 3px; overflow: hidden; }
#ifcScoreBarFill { height: 100%; width: 0; border-radius: 3px; transition: width .8s ease; }
.aud-stats { display: flex; gap: 0; margin: 0; }
.aud-stats > div { padding: 0 18px; border-left: 1px solid var(--trait-2); }
.aud-stats dt { font-size: 12px; color: var(--encre-3); margin-bottom: 2px; }
.aud-stats dd { margin: 0; font-size: 22px; font-weight: 500; color: var(--encre) !important; }
body #ifcStatClashes { color: var(--encre) !important; }

#ifcCheckerResults { display: grid !important; grid-template-columns: 300px minmax(0, 1fr) 230px; align-items: start; overflow-y: auto; }
#ifcCheckerResults[style*="display: none"], #ifcCheckerResults[style*="display:none"] { display: none !important; }
#auxToolbar { position: sticky; top: 0; border-right: 1px solid var(--trait); background: var(--surface); min-height: 100%; padding: 14px 12px !important; }
#ifcChecksList { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; align-content: start; padding: 14px 16px !important; }
/* (les tuiles en double avec l en-tête ne sont plus créées) */
#ifcChecksList > div:not(.audit-card):not(.audit-titre) { grid-column: 1 / -1; font-size: 12.5px !important; font-weight: 600 !important; color: var(--encre-2) !important; margin: 8px 0 0 !important; }
#ifcCheckerResults > div:last-child { padding: 14px 14px 0 0 !important; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
#ifcCheckerResults > div:last-child button { width: 100% !important; margin: 0 !important; font-size: 13px !important; font-weight: 500 !important; padding: 10px 12px !important; border-radius: var(--r) !important; }
#ifcCheckerResults > div:last-child button:first-child { background: var(--encre) !important; color: #fff !important; border: 1px solid var(--encre) !important; }
#bcfExportBtn { background: var(--surface) !important; color: var(--encre) !important; border: 1px solid var(--trait) !important; }
.audit-card { padding: 12px 14px !important; }
.audit-card-label { font-size: 13px !important; font-weight: 600 !important; color: var(--encre) !important; }
.audit-card-detail { font-size: 12.5px !important; color: var(--encre-2) !important; }
.audit-card-reco { font-size: 12px !important; }
.audit-card-impact { font-size: 11.5px !important; color: var(--encre-3) !important; }
.audr-title { font-size: 14px !important; font-weight: 600 !important; color: var(--encre) !important; }
.audr-subtitle { font-size: 12px !important; color: var(--encre-3) !important; }
.audr-row { border-radius: var(--r) !important; }
.audr-row-name { font-size: 13px !important; font-weight: 500 !important; color: var(--encre) !important; }
.audr-row-rules, .audr-row-pts { font-size: 12px !important; font-family: var(--mono) !important; color: var(--encre-3) !important; background: transparent !important; }
.audr-row [class*="state"], .audr-row-head > span:first-child { font-size: 11px !important; border-radius: 3px !important; }
.audr-rerun { background: var(--surface) !important; color: var(--encre) !important; border: 1px solid var(--trait) !important; box-shadow: none !important; font-weight: 500 !important; }
.audr-quick-btn { border-radius: var(--r) !important; font-size: 12px !important; }

/* Conformité : une seule action principale, le reste en secondaire */
#ifcPanelRecalage { background: var(--papier) !important; }
/* Panneaux flottants : à gauche du viewer, jamais sur le panneau de droite */
#bimAutoPanel { top: calc(var(--header-h) + 54px) !important; left: 150px !important; right: auto !important; width: 320px !important;
  border-radius: var(--r-panneau) !important; border-color: var(--trait) !important; box-shadow: var(--ombre-panneau) !important; }
#bimAutoPanel > div:first-child { background: var(--surface) !important; color: var(--encre) !important; border-bottom: 1px solid var(--trait-2); }
#bimAutoBar { background: var(--bleu) !important; }
#bimLayersPanel { left: 150px !important; }
/* Légendes de comparaison : seulement dans les vues où elles servent */
body:not([data-ifc-onglet="compare"]):not([data-ifc-onglet="viewer"]) #cmpDiffLegend,
body:not([data-ifc-onglet="compare"]):not([data-ifc-onglet="viewer"]) #cmpLegend { display: none !important; }

/* Résultats de mesure (carte) */
[id^="measure-popup-"] { border-radius: var(--r-panneau) !important; border-left-color: var(--jalon) !important; box-shadow: var(--ombre-panneau) !important; border-top: 1px solid var(--trait); border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait); font-size: 12.5px !important; }
[id^="measure-popup-"] b { font-family: var(--mono) !important; font-weight: 500 !important; }

/* ── Passe 6 : contrastes WCAG AA (axe-core) ───────────────────────────── */
#ifcDropZone, #ifcDropZone *, .ifc-ph-cta, .ifc-ph-cta * { color: #fff !important; }
#ifcFileSize, .ifc-layer-count, #ifcLayerCount, .ifc-badge, .ifc-stat-sub, .ifc-logo-sub { color: var(--encre-3) !important; }
.audr-row-pill { font-weight: 600 !important; }
.audr-pill-all { color: #14653F !important; background: #E6F3EC !important; }
.audr-pill-none { color: #8A2A23 !important; background: #FBEAE8 !important; }
.audr-pill-partial { color: #7A4E0B !important; background: #FCF1DD !important; }
.audit-card-state { background: #17734A !important; color: #fff !important; }
.audit-card-pts, .audit-card-head [class*="pts"] { color: #14653F !important; }
/* Badge de score : texte foncé sur teinte claire, quelle que soit la note */
#ifcScoreBadge[style*="#d4820a"], #ifcScoreBadge[style*="#D4820A"], #ifcScoreBadge[style*="F5A623"] { color: #7A4E0B !important; background: #FCF1DD !important; }
#ifcScoreBadge[style*="1D9E75"], #ifcScoreBadge[style*="1d9e75"] { color: #14653F !important; background: #E6F3EC !important; }
#ifcScoreBadge[style*="E24B4A"], #ifcScoreBadge[style*="e24b4a"] { color: #8A2A23 !important; background: #FBEAE8 !important; }
#ifcScoreBadge { color: var(--encre) !important; background: var(--surface-2) !important; border: 1px solid var(--trait) !important; }
.audit-card-score { color: var(--encre) !important; font-family: var(--mono) !important; font-weight: 500 !important; }
.audit-card-reco { color: var(--encre-2) !important; }

/* Relevés de mesure (carte) */
#bimReleves { position: fixed; left: 62px; bottom: calc(var(--barre-h) + 12px); z-index: 1100; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - var(--header-h) - 120px); overflow-y: auto; width: 250px; }
.bim-releve { background: var(--surface); border: 1px solid var(--trait); border-left: 3px solid var(--jalon); border-radius: var(--r-panneau); box-shadow: var(--ombre-panneau); padding: 8px 10px 9px; font-size: 12.5px; line-height: 1.7; color: var(--encre); }
.bim-releve:first-child { border-left-color: var(--encre); }
.bim-releve-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.bim-releve-tete b { font-size: 13px; font-weight: 600; font-family: var(--f) !important; }
.bim-releve-tete button { border: 0; background: none; cursor: pointer; color: var(--encre-3); font-size: 12px; padding: 2px 4px; }
.bim-releve-tete button:hover { color: var(--bleu); }
.bim-releve-fermer { font-size: 17px !important; line-height: 1; }
.bim-releve-corps b { font-family: var(--mono) !important; font-weight: 500; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { #bimReleves { left: 10px; right: 10px; width: auto; bottom: calc(var(--barre-h) + 70px); max-height: 40vh; } }

/* ── Éditeur de volume : outil de carte, sous les modales ─────────────── */
.vol-editor { z-index: 1150 !important; font-family: var(--f) !important; border-radius: var(--r-panneau) !important; border: 1px solid var(--trait) !important; box-shadow: var(--ombre-panneau) !important; }
.vol-editor::before { display: none !important; }
body[data-view="bim"] .vol-editor, body[data-view="bim"] .vol-chip { display: none !important; }
.vol-chip { font-family: var(--mono) !important; }

/* ── Palette de commandes (Ctrl K) ─────────────────────────────────────── */
.gr-btn-palette { gap: 8px !important; color: var(--encre-2) !important; border: 1px solid var(--trait) !important; background: var(--surface) !important; padding: 0 8px 0 10px !important; height: 30px; border-radius: var(--r) !important; }
.gr-btn-palette:hover { border-color: var(--encre-3) !important; color: var(--encre) !important; }
.gr-btn-palette kbd, #bimPalette kbd, #bimRaccourcis kbd { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--encre-2); background: var(--surface-2); border: 1px solid var(--trait); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; line-height: 17px; display: inline-block; min-width: 18px; text-align: center; }
@media (max-width: 1500px) { .gr-btn-palette span { display: none; } }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { .gr-btn-palette kbd { display: none; } }
#bimPalette { position: fixed; inset: 0; z-index: 10060; }
#bimPalette[hidden], #bimRaccourcis[hidden], #bimPlan[hidden] { display: none !important; }
#bimPalette .pal-fond, #bimRaccourcis .rac-fond { position: absolute; inset: 0; background: rgba(28,36,48,.28); }
#bimPalette .pal-boite { position: relative; margin: 11vh auto 0; width: min(640px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-panneau); box-shadow: 0 24px 60px rgba(28,36,48,.22); overflow: hidden; font-family: var(--f); }
#bimPalette .pal-champ { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--trait-2); color: var(--encre-3); }
#bimPalette input { flex: 1; border: 0; outline: 0; height: 52px; font: 400 16px var(--f); color: var(--encre); background: transparent; min-width: 0; }
#bimPalette input::placeholder { color: var(--encre-3); }
#bimPalette .pal-liste { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px 0; }
#bimPalette .pal-groupe { padding: 10px 16px 4px; font-size: 11.5px; font-weight: 600; color: var(--encre-3); }
#bimPalette .pal-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; font-size: 14px; color: var(--encre); border-left: 2px solid transparent; }
#bimPalette .pal-item.actif { background: var(--bleu-pale); border-left-color: var(--bleu); }
#bimPalette .pal-item.inerte { cursor: default; color: var(--encre-3); font-style: italic; }
#bimPalette .pal-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bimPalette .pal-d { font-size: 12px; color: var(--encre-3); white-space: nowrap; }
#bimPalette .pal-vide { padding: 22px 16px; color: var(--encre-3); font-size: 13.5px; line-height: 1.5; }
#bimPalette .pal-pied { display: flex; gap: 16px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--trait-2); font-size: 12px; color: var(--encre-3); background: var(--surface-2); }
#bimPalette .pal-pied kbd { margin-right: 3px; }
#bimPalette .pal-source { margin-left: auto; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { #bimPalette .pal-boite { margin-top: 64px; } #bimPalette .pal-pied span:not(.pal-source) { display: none; } }

/* ── Fiche officielle du point (altitude, parcelle) ────────────────────── */
.bim-releve-officiel { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--trait); }
.bim-releve-officiel .ro-note, .bim-releve-officiel .ro-attente { color: var(--encre-3); font-size: 11.5px; }
.bim-releve-officiel a { color: var(--bleu); font-size: 12px; }

/* ── Plan d'étage ──────────────────────────────────────────────────────── */
#bimPlan { position: fixed; z-index: 8600; right: 16px; top: calc(var(--header-h) + 58px); bottom: calc(var(--barre-h) + 16px); width: min(560px, calc(100vw - 32px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-panneau); box-shadow: 0 18px 48px rgba(28,36,48,.18); font-family: var(--f); color: var(--encre); }
#bimPlan .plan-tete { display: flex; align-items: baseline; gap: 12px; padding: 12px 14px 8px; }
#bimPlan .plan-tete b { font-size: 15px; font-weight: 600; }
#bimPlan .plan-info { font-family: var(--mono); font-size: 11.5px; color: var(--encre-3); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bimPlan .plan-fermer { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--encre-3); }
#bimPlan .plan-reglages { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0 14px 10px; font-size: 12.5px; color: var(--encre-2); border-bottom: 1px solid var(--trait-2); }
#bimPlan .plan-reglages select, #bimPlan .plan-reglages input[type=number] { font: 500 12.5px var(--f); color: var(--encre); border: 1px solid var(--trait); border-radius: var(--r); padding: 4px 6px; background: var(--surface); margin-left: 4px; }
#bimPlan .plan-reglages input[type=number] { width: 64px; font-family: var(--mono); margin-right: 4px; }
#bimPlan .plan-mn95 { display: flex; align-items: center; gap: 6px; }
#bimPlan .plan-mn95:has(input:disabled) { color: var(--encre-3); }
#bimPlan .plan-vue { flex: 1; min-height: 0; padding: 10px; background: var(--papier); }
#bimPlan .plan-vue svg { width: 100%; height: 100%; display: block; background: #fff; border: 1px solid var(--trait-2); }
#bimPlan .plan-pied { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--trait-2); }
#bimPlan .plan-legende { flex: 1; font-size: 11.5px; color: var(--encre-3); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
#bimPlan .plan-legende i { display: inline-block; width: 14px; height: 3px; margin-left: 6px; }
#bimPlan .plan-btn { font: 500 13px var(--f); border: 1px solid var(--trait); background: var(--surface); color: var(--encre); border-radius: var(--r); padding: 7px 12px; cursor: pointer; }
#bimPlan .plan-btn-1 { background: var(--encre); color: #fff; border-color: var(--encre); }
#bimPlan .plan-btn:hover { border-color: var(--encre-2); }
#ifcBtnPlan.active { background: var(--bleu-pale) !important; color: var(--bleu) !important; }

/* ── Raccourcis clavier ────────────────────────────────────────────────── */
#bimRaccourcis { position: fixed; inset: 0; z-index: 10055; font-family: var(--f); }
#bimRaccourcis .rac-boite { position: relative; margin: 12vh auto 0; width: min(760px, calc(100vw - 32px)); max-height: 76vh; overflow: auto; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-panneau); box-shadow: 0 24px 60px rgba(28,36,48,.22); }
#bimRaccourcis .rac-tete { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--trait-2); }
#bimRaccourcis .rac-tete b { font-size: 15px; font-weight: 600; }
#bimRaccourcis .rac-tete button { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--encre-3); }
#bimRaccourcis .rac-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 24px; padding: 12px 18px 18px; }
#bimRaccourcis h3 { font-size: 12px; font-weight: 600; color: var(--encre-3); margin: 6px 0 6px; }
#bimRaccourcis dl { margin: 0; }
#bimRaccourcis dl > div { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; font-size: 13px; }
#bimRaccourcis dt { min-width: 52px; display: flex; gap: 3px; }
#bimRaccourcis dd { margin: 0; color: var(--encre-2); }

/* ── Message bref ──────────────────────────────────────────────────────── */
#bimMsg { position: fixed; left: 50%; bottom: calc(var(--barre-h) + 18px); transform: translate(-50%, 12px); z-index: 10070; background: var(--encre); color: #fff; font: 500 13px var(--f); padding: 9px 14px; border-radius: var(--r); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
#bimMsg.vu { opacity: 1; transform: translate(-50%, 0); }

/* ── Carnet de points (sous la pile de relevés) ────────────────────────── */
#bimCarnet { position: fixed; left: 62px; bottom: calc(var(--barre-h) + 12px); z-index: 1101; width: 250px; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; background: var(--encre); color: #fff; border-radius: var(--r-panneau); font: 500 12px var(--f); box-sizing: border-box; }
#bimCarnet[hidden] { display: none; }
#bimCarnet span { flex: 1; }
#bimCarnet button { border: 0; background: rgba(255,255,255,.12); color: #fff; font: 500 12px var(--f); padding: 4px 8px; border-radius: var(--r); cursor: pointer; }
#bimCarnet button:hover { background: rgba(255,255,255,.22); }
#bimCarnet button[data-vider] { background: none; color: #B8C0CA; padding: 4px 2px; }
body:has(#bimCarnet:not([hidden])) #bimReleves { bottom: calc(var(--barre-h) + 54px); }
body[data-view="bim"] #bimCarnet { display: none; }

/* ── Propriétés : bloc mesuré et psets du type ─────────────────────────── */
.ifc-pset-type { font-weight: 400; color: var(--encre-3); font-size: 11px; }
.ifc-prop-val.mono { font-family: var(--mono) !important; font-size: 12px !important; }

/* ── Badge géoréférencement ────────────────────────────────────────────── */
.geo-badge { border-left: 3px solid var(--jalon) !important; max-width: 230px; }
.geo-badge .geo-l { font-family: var(--mono); font-size: 12.5px; line-height: 1.45; color: var(--encre); margin: 2px 0 3px; }
.geo-badge .geo-poser { margin-top: 7px; width: 100%; border: 1px solid var(--trait); background: var(--surface); color: var(--bleu); font: 500 12px var(--f); padding: 6px 8px; border-radius: var(--r); cursor: pointer; }
.geo-badge .geo-poser:hover { border-color: var(--bleu); }

/* ── Boîte de coupe ────────────────────────────────────────────────────── */
#bimBoite { position: absolute; z-index: 30; left: 12px; bottom: 44px; width: 300px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-panneau); box-shadow: var(--ombre-panneau); font-family: var(--f); color: var(--encre); padding: 10px 12px 10px; }
#bimBoite[hidden] { display: none !important; }
#bimBoite .bx-tete { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
#bimBoite .bx-tete b { font-size: 13.5px; font-weight: 600; }
#bimBoite .bx-tete .mono { flex: 1; font-size: 11.5px; color: var(--encre-3); }
#bimBoite .bx-x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--encre-3); line-height: 1; }
#bimBoite .bx-l { display: grid; grid-template-columns: 74px 1fr 1fr; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--trait-2); }
#bimBoite .bx-n { font-size: 12px; color: var(--encre-2); }
#bimBoite .bx-r { display: flex; flex-direction: column; font-size: 10.5px; color: var(--encre-3); gap: 1px; }
#bimBoite input[type=range] { width: 100%; accent-color: var(--bleu); margin: 0; }
#bimBoite .bx-pied { display: flex; gap: 6px; margin-top: 8px; }
#bimBoite .bx-pied button { flex: 1; font: 500 12px var(--f); border: 1px solid var(--trait); background: var(--surface); color: var(--encre); padding: 6px; border-radius: var(--r); cursor: pointer; }
#bimBoite .bx-pied button:first-child { background: var(--encre); color: #fff; border-color: var(--encre); }
#ifcBtnBoite.active { background: var(--bleu-pale) !important; color: var(--bleu) !important; }

/* ── Arborescence IFC ──────────────────────────────────────────────────── */
.arb-bascule { display: flex; gap: 2px; margin: 8px 10px 4px; padding: 2px; background: var(--surface-2); border: 1px solid var(--trait-2); border-radius: var(--r); }
.arb-bascule button { flex: 1; border: 0; background: none; font: 500 12.5px var(--f); color: var(--encre-2); padding: 5px 4px; border-radius: 3px; cursor: pointer; }
.arb-bascule button[aria-selected="true"] { background: var(--surface); color: var(--encre); box-shadow: 0 1px 2px rgba(28,36,48,.08); }
#bimArbre { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#bimArbre[hidden] { display: none !important; }
#bimArbre .arb-recherche { margin: 4px 10px 6px; font: 400 12.5px var(--f); border: 1px solid var(--trait); border-radius: var(--r); padding: 6px 8px; color: var(--encre); background: var(--surface); }
#bimArbre .arb-corps { flex: 1; overflow: auto; padding-bottom: 8px; }
#bimArbre .arb-l { display: flex; align-items: center; gap: 4px; min-height: 26px; padding-right: 6px; font-size: 12.5px; color: var(--encre); cursor: pointer; white-space: nowrap; }
#bimArbre .arb-l:hover { background: var(--surface-2); }
#bimArbre .arb-l.sel { background: var(--bleu-pale); color: var(--bleu-fonce); }
#bimArbre .arb-l.cache .arb-t { color: var(--encre-3); text-decoration: line-through; text-decoration-color: rgba(95,105,118,.5); }
#bimArbre .arb-f { width: 16px; height: 16px; border: 0; background: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--encre-3); cursor: pointer; flex-shrink: 0; }
#bimArbre .arb-f svg { transition: transform .12s; }
#bimArbre .arb-f.ouvert svg { transform: rotate(90deg); }
#bimArbre .arb-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#bimArbre .arb-t b { font-weight: 600; color: var(--encre-2); margin-right: 2px; }
#bimArbre .arb-ch { color: var(--encre-3); font-size: 11px; margin-left: 4px; }
#bimArbre .arb-n { font-family: var(--mono); font-size: 11px; color: var(--encre-3); }
#bimArbre .arb-o { border: 0; background: none; padding: 2px; color: var(--encre-3); cursor: pointer; opacity: .55; display: inline-flex; }
#bimArbre .arb-l:hover .arb-o, #bimArbre .arb-l.cache .arb-o { opacity: 1; }
#bimArbre .arb-sous .arb-t { color: var(--encre-2); font-size: 12px; }
#bimArbre .arb-vide { padding: 14px 12px; color: var(--encre-3); font-size: 12.5px; }

/* ── Exigences IDS ─────────────────────────────────────────────────────── */
#bimIds { margin: 14px 18px 4px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-panneau); padding: 12px 14px; font-family: var(--f); color: var(--encre); }
#bimIds .ids-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#bimIds .ids-tete > div:first-child { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
#bimIds .ids-tete b { font-size: 14px; font-weight: 600; }
#bimIds .ids-tete span { font-size: 12px; color: var(--encre-3); }
#bimIds .ids-btns { display: flex; gap: 6px; }
#bimIds .ids-btns button, #bimIds .ids-btns label, #bimIds .ids-actions button { font: 500 12.5px var(--f); border: 1px solid var(--trait); background: var(--surface); color: var(--encre); padding: 6px 10px; border-radius: var(--r); cursor: pointer; }
#bimIds .ids-prim { background: var(--encre) !important; color: #fff !important; border-color: var(--encre) !important; }
#bimIds .ids-bilan { margin-top: 12px; font-size: 12.5px; color: var(--encre-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
#bimIds .ids-score { margin-left: auto; font-weight: 600; }
#bimIds .ids-score.vert { color: var(--vert); } #bimIds .ids-score.rouge { color: var(--rouge); }
#bimIds .ids-spec { border-top: 1px solid var(--trait-2); padding: 7px 0 5px; }
#bimIds .ids-spec summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; list-style: none; }
#bimIds .ids-spec summary::-webkit-details-marker { display: none; }
#bimIds .ids-pastille { width: 9px; height: 9px; border-radius: 50%; background: var(--vert); flex-shrink: 0; }
#bimIds .ids-spec.ko .ids-pastille { background: var(--rouge); }
#bimIds .ids-nom { flex: 1; }
#bimIds .ids-chiffres { font-size: 12px; color: var(--encre-3); }
#bimIds .ids-desc { margin: 4px 0 2px 17px; font-size: 12px; color: var(--encre-3); }
#bimIds .ids-ko { list-style: none; margin: 4px 0 2px 17px; padding: 0; max-height: 220px; overflow: auto; }
#bimIds .ids-ko li { display: flex; gap: 10px; padding: 4px 0; font-size: 12.5px; cursor: pointer; border-bottom: 1px dashed var(--trait-2); }
#bimIds .ids-ko li:hover .ids-el { color: var(--bleu); }
#bimIds .ids-el { min-width: 120px; font-weight: 500; }
#bimIds .ids-raison { color: var(--rouge); }
#bimIds .ids-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
#bimIds .ids-err { color: var(--rouge); font-size: 12.5px; margin: 10px 0 0; }
/* IDS : bandeau pleine largeur au-dessus des trois colonnes de l'audit */
#ifcCheckerResults > #bimIds { grid-column: 1 / -1; margin: 14px 18px 0; }
#bimIds .ids-ko li { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; }
#bimIds .ids-spec summary { padding-right: 4px; }
.ifc-prop-val.mono { white-space: normal; overflow-wrap: anywhere; text-align: right; font-size: 11.5px !important; }

/* ── Contrôle général : en-tête des propriétés, barre IFC, vue divisée ──── */
.ifc-prop-classe { font-family: var(--mono) !important; font-size: 11px !important; color: var(--encre-3) !important; margin-top: 3px; overflow-wrap: anywhere; }
.ifc-vr-btn:disabled { display: none !important; }        /* sans casque, pas de bouton mort */
@media (max-width: 1600px) { #bimTilesetPill span, #bimCloudDropPill span { display: none; } }
.ifc-drop-pill:focus-visible, .ifc-tool-icon:focus-visible, .arb-l:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
/* Vue divisée : la maquette garde de la place pour la 3D */
body[data-view="split"] #ifcPanelLeft, body[data-view="split"] #ifcModelStats { display: none !important; }
body[data-view="split"] .ifc-main { position: relative; }
body[data-view="split"] #ifcPanelRight { position: absolute !important; right: 54px; top: 8px; max-height: calc(100% - 16px); width: 250px !important; z-index: 25; box-shadow: var(--ombre-panneau); border: 1px solid var(--trait); border-radius: var(--r-panneau); overflow: auto; display: none !important; }
body[data-view="split"]:has(#ifcPropsContent[style*="block"]) #ifcPanelRight { display: block !important; }
body[data-view="split"] .ifc-topbar-right .ifc-drop-pill span, body[data-view="split"] #ifcSaveBtnLabel, body[data-view="split"] .ifc-file-size { display: none; }
body[data-view="split"] .ifc-topbar { flex-wrap: nowrap; overflow: hidden; }
body[data-view="split"] .ifc-tb-btn span { display: none; }

/* ── Terminer une mesure (indispensable au doigt) ──────────────────────── */
#bimTerminer { position: fixed; z-index: 1180; left: 50%; transform: translateX(-50%); top: calc(var(--header-h) + 14px); display: inline-flex; align-items: baseline; gap: 8px; border: 0; background: var(--encre); color: #fff; font: 600 14px var(--f); padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 18px rgba(28,36,48,.25); cursor: pointer; min-height: 44px; }
#bimTerminer small { font-weight: 400; font-size: 12px; color: #B8C0CA; }
#bimTerminer[hidden] { display: none; }
@media (pointer: coarse) { #bimTerminer small { display: none; } }

/* ── Téléphone : outils de mesure disponibles, audit et Pano lisibles ──── */
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  #toggleMeasureBar, #measure-volume { display: inline-flex !important; }
  .gr-measure-bar { display: none; }
  body.measure-bar-open .gr-measure-bar { display: flex !important; position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(var(--barre-h) + 66px) !important; overflow-x: auto; border-radius: var(--r-panneau) !important; z-index: 1150; }
  #ifcCheckerResults { grid-template-columns: minmax(0, 1fr) !important; }
  #ifcCheckerResults > div:last-child { position: static !important; padding: 0 14px 14px !important; }
  .aud-tete { grid-template-columns: auto minmax(0, 1fr) !important; gap: 12px 16px !important; }
  .aud-tete .aud-stats { grid-column: 1 / -1; }
  #ifcModelStats .ifc-stat-card:first-child { display: none !important; }
  .ifc-topbar { flex-wrap: wrap; }
  .ifc-topbar-left { order: 2; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .pano-main { flex-direction: column !important; }
  .pano-sidebar { width: 100% !important; max-width: none !important; max-height: 30vh; border-right: 0 !important; border-bottom: 1px solid rgba(255,255,255,.08); }
  .pano-stage { min-height: 0; flex: 1; }
  .pano-brand-sub, .pano-tabs-sep { display: none !important; }
  .pano-tab span { white-space: nowrap; }
}

.pano-upload-cta, .pano-topbar-right button { white-space: nowrap; }

/* ── Tablette : audit sur deux colonnes, onglets IFC sur leur propre ligne ─ */
@media (max-width: 1180px) {
  #ifcCheckerResults { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) !important; }
  #ifcCheckerResults > div:last-child { grid-column: 1 / -1; position: static !important; flex-direction: row !important; flex-wrap: wrap; padding: 0 18px 18px !important; }
  #ifcCheckerResults > div:last-child button { width: auto !important; }
  .ifc-topbar { flex-wrap: wrap; }
  .ifc-topbar-left { order: 2; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ifc-topbar-left::-webkit-scrollbar { display: none; }
}
#bimLecture .lec-vue { white-space: nowrap; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  #ifcCheckerResults { grid-template-columns: minmax(0, 1fr) !important; }
}
#bimIds .ids-spec.av .ids-pastille { background: var(--ambre); }

/* ── Contrastes AA relevés par axe (textes secondaires) ─────────────────── */
#sw3d small, #sw3d .sw3d-h, #sw3d .sw3d-field span, #sw3d input[type=date], #sw3d button[data-q] { color: var(--encre-3) !important; }
.bim-guid-text, .ifc-pset-title, .cmp-existing-sub { color: var(--encre-3) !important; }
#ifcPanelQto [style*="color:#bbb"], #ifcPanelQto th, .qto-tree-type-body th { color: var(--encre-3) !important; }
#ifcPanelRecalage [style*="color:#aaa"], #ifcPanelRecalage [style*="color: rgb(170"] { color: var(--encre-3) !important; }
.cmp-inline-subtitle > strong:nth-child(1) { color: var(--vert) !important; }
.cmp-inline-subtitle > strong:nth-child(2) { color: var(--rouge) !important; }
#cmpExistingUse { background: var(--vert) !important; border-color: var(--vert) !important; }
body[data-view="carto"] #bimPlan { display: none !important; }
#ifcPanelRecalage [style*="color:#bbb"], #ifcPanelRecalage [style*="color:#999"] { color: var(--encre-3) !important; }
#ifcPanelRecalage [style*="background:#1D9E75"] { background: var(--vert) !important; }
#recIfcStatus { color: var(--vert) !important; }
/* barre IFC repliée sur deux lignes : la hauteur suit ; colonnes empilées sans « sticky » */
@media (max-width: 1180px) {
  .ifc-topbar { height: auto !important; min-height: 42px; padding: 4px 10px !important; row-gap: 2px; }
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  #auxToolbar { position: static !important; min-height: 0 !important; border-right: 0 !important; border-bottom: 1px solid var(--trait); }
  #ifcCheckerResults > * { min-width: 0; }
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* téléphone : simple flux vertical, pas de grille (les colonnes se chevauchaient) */
  #ifcCheckerResults:not([style*="display: none"]):not([style*="display:none"]) { display: block !important; }
  #ifcCheckerResults > * { width: auto !important; }
}
.ifc-viewer-hint { display: inline-flex !important; gap: 14px; }
#bimIds .ids-fichier { color: var(--encre-3); font-size: 12px; }

/* ── Passe 9 : onglets « chaîne de contrôle » et retour du jaune jalon ────
 * Le jaune revient, mais seulement là où l'on agit : l'onglet ouvert,
 * la vue active, « Ouvrir IFC », « Ouvrir une maquette » et le lancement
 * du contrôle de conformité. Texte encre sur jaune (contraste 10:1).      */
.ifc-topbar { height: 52px !important; background: var(--papier) !important; padding: 0 10px 0 0 !important; align-items: stretch !important; }
.ifc-topbar-left { align-items: stretch !important; gap: 0 !important; height: 100%; }
.ifc-topbar-right { align-items: center !important; }
.ifc-tb-btn.ong {
  position: relative; display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: center !important;
  gap: 1px !important; height: 100% !important; min-width: 128px; padding: 0 16px !important;
  background: transparent !important; box-shadow: none !important; border: 0 !important; border-right: 1px solid var(--trait-2) !important;
  color: var(--encre-2) !important; text-align: left; cursor: pointer;
}
.ifc-tb-btn.ong:first-of-type { border-left: 0 !important; }
.ong .ong-nom { font-size: 13px; font-weight: 600; color: inherit; line-height: 1.2; white-space: nowrap; display: inline !important; }
.ong .ong-etat { display: flex !important; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 400; color: var(--encre-3); line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ong .ong-txt { display: inline !important; }
.ong .ong-jauge { display: inline-block; width: 30px; height: 4px; border-radius: 2px; background: var(--trait); overflow: hidden; }
.ong .ong-jauge[hidden] { display: none !important; }
.ong .ong-jauge i { display: block; height: 100%; background: var(--encre-3); }
.ong[data-niveau="bon"] .ong-jauge i { background: var(--vert); }
.ong[data-niveau="moyen"] .ong-jauge i { background: var(--ambre); }
.ong[data-niveau="faible"] .ong-jauge i { background: var(--rouge); }
.ifc-tb-btn.ong:hover { background: rgba(255,255,255,.6) !important; color: var(--encre) !important; box-shadow: none !important; }
/* l'onglet ouvert : une fiche blanche posée sur la feuille, fanion jaune en tête */
.ifc-tb-btn.ong.active {
  background: var(--surface) !important; color: var(--encre) !important; box-shadow: none !important; font-weight: 600 !important;
  margin-bottom: -1px; z-index: 1;
}
.ifc-tb-btn.ong.active::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--jalon); }
.ifc-tb-btn.ong.active .ong-etat { color: var(--encre-2); }
.ifc-tb-btn.ong:focus-visible { outline-offset: -3px !important; }

/* sélecteur de vue de l'en-tête : la vue active en encre, icône jaune */
.gr-vues .gr-module.gr-module-primary { background: var(--encre) !important; color: #fff !important; border-color: var(--encre) !important; box-shadow: none !important; }
.gr-vues .gr-module.gr-module-primary svg { color: var(--jalon) !important; }

/* les trois actions qui font avancer le travail */
#ifcDropZone, .ifc-ph-cta, #recLancerBtn:not(:disabled), .cf-btn-go:not(:disabled) {
  background: var(--jalon) !important; color: var(--encre) !important; border-color: #D9AE0F !important; font-weight: 600 !important;
}
#ifcDropZone svg { stroke: var(--encre) !important; }
#ifcDropZone:hover, .ifc-ph-cta:hover, #recLancerBtn:not(:disabled):hover { background: #E5B710 !important; }
.ifc-placeholder:hover .ifc-ph-cta { background: #E5B710 !important; color: var(--encre) !important; }

/* vue divisée et écrans étroits : l'état reste, les marges se resserrent */
body[data-view="split"] .ifc-tb-btn.ong span.ong-nom, body[data-view="split"] .ifc-tb-btn.ong span.ong-etat { display: flex !important; }
body[data-view="split"] .ifc-tb-btn.ong { min-width: 0; padding: 0 10px !important; }
@media (max-width: 1180px) {
  .ifc-tb-btn.ong { min-width: 0; padding: 0 12px !important; }
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  .ifc-topbar { height: auto !important; }
  .ifc-topbar-left { overflow-x: auto; scrollbar-width: none; height: 52px; flex: 1 1 100%; }
  .ifc-tb-btn.ong { flex: 0 0 auto; padding: 0 12px !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .ifc-tb-btn.ong.active::before { animation: ongFanion .18s ease-out; transform-origin: left; }
  @keyframes ongFanion { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ── Passe 10 : Conformité en quatre étapes ─────────────────────────────── */
:root { --cf-w: 440px; }
@media (max-width: 1180px) { :root { --cf-w: 380px; } }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { :root { --cf-w: 100vw; } }
#ifcPanelRecalage { width: var(--cf-w) !important; padding: 0 !important; border-left: 1px solid var(--trait) !important; bottom: var(--barre-h) !important; box-shadow: none !important; }
.cf { padding: 16px 16px 24px; display: grid; gap: 12px; color: var(--encre); }
.cf-tete h2 { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.3; }
.cf-tete p { font-size: 13px; color: var(--encre-3); margin: 3px 0 0; line-height: 1.45; }
.cf-etape { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-panneau); padding: 12px 14px 14px; display: grid; gap: 10px; }
.cf-et-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cf-et-h h3 { font-size: 14px; font-weight: 600; margin: 0; flex: none; }
.cf-num { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--encre); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.cf-statut { margin-left: auto; font-size: 12.5px !important; font-weight: 500 !important; color: var(--encre-3); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-depot { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px dashed #B9C2CC; border-radius: var(--r); background: var(--surface-2); cursor: pointer; min-width: 0; }
.cf-depot:hover, .cf-depot.survol { border-color: var(--bleu); background: var(--bleu-pale); }
.cf-ico { flex: none; width: 36px; height: 36px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--trait-2); color: var(--bleu); display: inline-flex; align-items: center; justify-content: center; }
.cf-ico svg { width: 20px; height: 20px; }
.cf-dep-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cf-dep-t b, .cf-info b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cf-dep-t small, .cf-info small { font-size: 12px; color: var(--encre-3); display: block; }
.cf-info { text-align: right; max-width: 45%; min-width: 0; }
.cf-depot:has(.cf-info[style*="block"]) .cf-dep-t small { display: none; }
.cf-lien { justify-self: start; border: 0; background: none; padding: 2px 0; font: 500 12.5px var(--f); color: var(--bleu-fonce); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.cf-aide { font-size: 12.5px; color: var(--encre-3); line-height: 1.5; margin: 0; }
.cf-btn { min-height: 40px; border-radius: var(--r); font: 600 13.5px var(--f); cursor: pointer; padding: 0 14px; width: 100%; }
.cf-btn-1 { background: var(--bleu) !important; color: #fff !important; border: 1px solid var(--bleu) !important; }
.cf-btn-1:hover { background: var(--bleu-fonce) !important; }
.cf-sec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cf-btn-2 { min-height: 36px; font-size: 13px; font-weight: 500; background: var(--surface) !important; color: var(--encre) !important; border: 1px solid var(--trait) !important; padding: 0 6px; }
.cf-btn-2:hover { border-color: var(--encre-3) !important; }
.cf-btn-3 { background: var(--encre) !important; color: #fff !important; border: 0 !important; }
.cf-btn-go { min-height: 44px; font-size: 14px; }
.cf-btn-go:disabled { background: var(--surface-2) !important; color: var(--encre-3) !important; border: 1px solid var(--trait-2) !important; cursor: not-allowed; }
.cf-tol { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-tol label { font-size: 13px; font-weight: 600; }
.cf-tol-in { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--encre-3); }
.cf-tol-in input { width: 64px; height: 34px; border: 1px solid var(--trait); border-radius: var(--r); padding: 0 8px; font: 600 14px var(--f); text-align: right; color: var(--encre); font-variant-numeric: tabular-nums; }
.cf-tol-q { display: inline-flex; margin-left: auto; border: 1px solid var(--trait); border-radius: var(--r); overflow: hidden; }
.cf-tol-q button { border: 0; background: var(--surface); padding: 0 11px; height: 32px; font: 500 13px var(--f); color: var(--encre-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.cf-tol-q button + button { border-left: 1px solid var(--trait); }
.cf-tol-q button[aria-pressed="true"] { background: var(--encre); color: #fff; }
.cf-prog { display: grid; gap: 6px; font-size: 12.5px; }
.cf-prog-b { height: 4px; background: var(--trait-2); border-radius: 2px; overflow: hidden; }
#recProgressBar { height: 100%; width: 0; background: var(--bleu); transition: width .4s; }
#recProgressDetail { color: var(--encre-3); font-size: 12px; }
.cf-service { font-size: 12.5px; color: var(--encre-3); line-height: 1.5; margin: 2px 2px 0; }
.cf-service a, .cf-echec a { color: var(--bleu-fonce); }
.cf-echec { font-size: 12.5px; line-height: 1.5; padding: 10px 12px; border-radius: var(--r); background: #FFF6E0; border: 1px solid #F0D58A; color: #5C4300; }
.cf-res { display: grid; gap: 12px; }
.cf-score { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-panneau); padding: 14px; }
.cf-anneau { position: relative; width: 84px; height: 84px; }
.cf-anneau svg { width: 84px; height: 84px; transform: rotate(-90deg); }
#recScoreCircle { transition: stroke-dashoffset 1s, stroke .4s; }
.cf-anneau > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cf-anneau b { font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cf-anneau small { font-size: 11px; color: var(--encre-3); }
.cf-sc-l { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cf-badge { font-size: 12px !important; font-weight: 600 !important; padding: 2px 9px !important; border-radius: 999px !important; }
.cf-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.cf-kpi dt { font-size: 12px; color: var(--encre-3); }
.cf-kpi dd { margin: 2px 0 0; font-size: 15px !important; font-weight: 700 !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-liste { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-panneau); overflow: hidden; }
.cf-li-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--trait-2); }
.cf-li-h h3 { font-size: 14px; font-weight: 600; margin: 0; }
.cf-li-h span { font-size: 12px; color: var(--encre-3); }
.cf-li-cols, .cf-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 76px 64px 96px; column-gap: 8px; align-items: center; }
.cf-li-cols { padding: 6px 14px; font-size: 12px; color: var(--encre-3); background: var(--surface-2); border-bottom: 1px solid var(--trait-2); }
#recEcartsList { max-height: 46vh; overflow-y: auto; }
.cf-ligne { width: 100%; border: 0; border-bottom: 1px solid var(--trait-2); background: var(--surface); padding: 9px 14px; text-align: left; font: 13px var(--f); color: var(--encre); cursor: pointer; row-gap: 4px; }
.cf-ligne:hover { background: var(--surface-2); }
.cf-l-nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-l-type { color: var(--encre-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-l-ec { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-l-st { text-align: right; }
.cf-l-st i { font-style: normal; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.cf-l-barre { grid-column: 1 / -1; height: 3px; background: var(--trait-2); border-radius: 2px; overflow: hidden; }
.cf-l-barre b { display: block; height: 100%; }
.cf-l-det { grid-column: 1 / -1; font-size: 12px; color: var(--encre-3); }
.cf-ligne.ok .cf-l-ec { color: var(--vert); } .cf-ligne.ok i { background: #E3F2EA; color: var(--vert); } .cf-ligne.ok .cf-l-barre b { background: var(--vert); }
.cf-ligne.av .cf-l-ec { color: #8A5A00; } .cf-ligne.av i { background: #FFF1CC; color: #6E4A00; } .cf-ligne.av .cf-l-barre b { background: #D9A21B; }
.cf-ligne.ko .cf-l-ec { color: var(--rouge); } .cf-ligne.ko i { background: #FBE6E4; color: #9E2A22; } .cf-ligne.ko .cf-l-barre b { background: var(--rouge); }
.cf-ligne.ns { color: var(--encre-3); } .cf-ligne.ns i { background: var(--surface-2); color: var(--encre-3); }
.cf-legende { position: absolute; left: 12px; bottom: 12px; z-index: 20; background: rgba(255,255,255,.96); border: 1px solid var(--trait); border-radius: var(--r-panneau); padding: 10px 12px; box-shadow: var(--ombre-panneau); font-size: 12.5px; color: var(--encre); min-width: 150px; }
.cf-lg-t { font-weight: 600; margin-bottom: 6px; }
.cf-legende ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.cf-legende li { display: flex; align-items: center; gap: 8px; }
.cf-legende li i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.cf-legende button { width: 100%; height: 30px; border: 1px solid var(--trait); background: var(--surface); border-radius: var(--r); font: 500 12.5px var(--f); color: var(--encre-2); cursor: pointer; }
@media (max-width: 480px) {
  .cf { padding: 12px 12px 20px; }
  .cf-li-cols, .cf-ligne { grid-template-columns: minmax(0, 1fr) 64px 92px; }
  .cf-l-type, .cf-li-cols span:nth-child(2) { display: none; }
  .cf-score { grid-template-columns: 72px 1fr; }
  .cf-anneau, .cf-anneau svg { width: 72px; height: 72px; }
  .cf-tol-q { margin-left: 0; }
}

/* ── Passe 11 : propriétés lisibles ───────────────────────────────────── */
.ifc-panel-right { font-size: 13px; }
.ifc-prop-header { padding: 12px 14px 10px !important; }
.ifc-prop-type { font-size: 12px !important; font-weight: 600 !important; color: var(--bleu-fonce) !important; }
.ifc-prop-name { font-size: 15px !important; font-weight: 700 !important; color: var(--encre) !important; line-height: 1.3 !important; overflow-wrap: anywhere; }
.ifc-prop-classe { font-family: var(--f) !important; font-size: 12px !important; color: var(--encre-3) !important; }
.ifc-pset-title { font-size: 12px !important; font-weight: 600 !important; color: var(--encre-2) !important; padding: 12px 14px 4px !important; background: transparent !important; border: 0 !important; overflow-wrap: anywhere; }
.ifc-prop-row { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; padding: 5px 14px !important; border-bottom: 1px solid var(--trait-2) !important; }
.ifc-prop-key { font-size: 12.5px !important; color: var(--encre-3) !important; overflow-wrap: anywhere; min-width: 0; }
.ifc-prop-val { font-size: 13px !important; color: var(--encre) !important; font-weight: 500 !important; text-align: right; overflow-wrap: anywhere; max-width: 100%; }
.ifc-prop-val.num { font-family: var(--f) !important; font-variant-numeric: tabular-nums; font-weight: 600 !important; white-space: nowrap; overflow-wrap: normal; }
/* une valeur longue (L × l × h) passe sous son libellé plutôt que de se casser */
.ifc-mesure.large { grid-template-columns: 1fr; row-gap: 2px; }
.ifc-mesure.large .ifc-prop-val.num { text-align: left; white-space: normal; }

/* ── Passe 12 : IFC Studio au téléphone ────────────────────────────────── */
.m-fermer, .m-calques { display: none; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* la vue 3D d'abord : cartes d'information réduites à l'essentiel */
  #ifcModelStats { top: 8px !important; left: 8px !important; right: 60px; gap: 6px !important; }
  #ifcModelStats > .ifc-stat-card:not(.geo-badge) { display: none !important; }
  #bimGeorefBadge { padding: 6px 8px !important; display: flex !important; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 100%; }
  #bimGeorefBadge .geo-l, #bimGeorefBadge .ifc-stat-sub { display: none !important; }
  #bimGeorefBadge .ifc-stat-label { margin: 0 !important; font-size: 12.5px !important; font-weight: 600 !important; color: var(--encre) !important; }
  #bimGeorefBadge .geo-poser { margin: 0 !important; height: 32px; font-size: 13px !important; }

  /* feuilles du bas */
  body.m-props #ifcPanelRight, body.m-gauche #ifcPanelLeft {
    display: block !important; position: fixed !important; left: 0 !important; right: 0 !important; width: auto !important; max-width: none !important;
    bottom: var(--barre-h) !important; top: auto !important; height: min(56vh, 520px) !important; z-index: 1100 !important;
    background: var(--surface) !important; border: 0 !important; border-top: 1px solid var(--trait) !important;
    border-radius: 12px 12px 0 0 !important; box-shadow: 0 -10px 30px rgba(28,36,48,.18) !important;
    overflow-y: auto !important; overscroll-behavior: contain; padding-top: 0 !important;
  }
  body.m-props #ifcPanelRight .m-fermer, body.m-gauche #ifcPanelLeft .m-fermer {
    display: block; position: sticky; top: 0; z-index: 2; margin-left: auto; width: 100%; height: 44px; border: 0; border-bottom: 1px solid var(--trait-2);
    background: var(--surface); color: var(--bleu-fonce); font: 600 14px var(--f); text-align: right; padding: 0 16px; cursor: pointer;
  }
  body.m-props #ifcPanelRight .m-fermer::before, body.m-gauche #ifcPanelLeft .m-fermer::before {
    content: ""; position: absolute; left: 50%; top: 7px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--trait);
  }
  body.m-props #ifcPanelRight .ifc-panel-title:first-of-type { display: none; }
  .m-calques {
    display: inline-flex; align-items: center; gap: 8px; position: absolute; left: 10px; bottom: 12px; z-index: 25;
    height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--trait); background: var(--surface); color: var(--encre);
    font: 600 13.5px var(--f); box-shadow: var(--ombre-panneau); cursor: pointer;
  }
  .m-calques svg { width: 18px; height: 18px; color: var(--bleu); }
  .m-calques[hidden] { display: none; }
  body.m-props .m-calques, body.m-gauche .m-calques { display: none; }
  /* lisibilité au doigt */
  .ifc-layer-item, .ifc-level-item { min-height: 40px; font-size: 14px !important; }
  .ifc-prop-key { font-size: 13px !important; } .ifc-prop-val { font-size: 14px !important; }
  .ifc-prop-row { padding: 7px 16px !important; }
  .ifc-pset-title { padding: 14px 16px 4px !important; font-size: 13px !important; }
  .ifc-gizmo { display: none !important; }
}

/* Conformité : un fichier lu remplace le texte d'invite dans sa zone de dépôt */
.cf-depot:has(.cf-info[style*="block"]) .cf-dep-t { display: none; }
.cf-depot:has(.cf-info[style*="block"]) .cf-info { text-align: left; max-width: none; flex: 1; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* fenêtres de calage, calques, retouche : feuilles du bas, jamais coupées */
  #bimAutoPanel, #bimLayersPanel, #bimAlignPanel, #bimNudgePanel, #bimTilesPanel {
    left: 0 !important; right: 0 !important; top: auto !important; bottom: var(--barre-h) !important; width: auto !important; max-width: none !important;
    max-height: 62vh !important; overflow-y: auto !important; border-radius: 12px 12px 0 0 !important; z-index: 9500 !important;
    box-shadow: 0 -10px 30px rgba(28,36,48,.2) !important;
  }
  #heatmapLegend.cf-legende { bottom: 64px; }
}

/* ── Quantitatifs : chiffres alignés, tableau tenable au téléphone ─────── */
.qto-items-table td, .qto-items-table th { font-family: var(--f) !important; font-variant-numeric: tabular-nums; }
.qto-items-table td:nth-child(n+4), .qto-items-table th:nth-child(n+4) { text-align: right; white-space: nowrap; }
.qto-td-storey { white-space: nowrap; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  .qto-th-guid, .qto-td-guid, .qto-items-table th:nth-child(6), .qto-items-table td:nth-child(6) { display: none; }
  .qto-items-table { font-size: 13px; }
  .qto-items-table td, .qto-items-table th { padding: 8px 6px !important; }
  .qto-td-name { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* aide à la navigation : au doigt, d'autres gestes */
@media (pointer: coarse) { .ifc-viewer-hint { display: none !important; } }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { .ifc-viewer-hint { display: none !important; } }

/* ── Passe 13 : tablette, deux rangées nettes dans IFC Studio ──────────── */
@media (max-width: 1180px) {
  .ifc-topbar { height: auto !important; flex-wrap: wrap !important; padding: 0 !important; align-items: stretch !important; }
  .ifc-topbar-right { order: 1; width: 100%; min-height: 44px; padding: 0 10px !important; justify-content: flex-end; gap: 6px; border-left: 0 !important; border-bottom: 1px solid var(--trait-2); background: var(--surface); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ifc-topbar-left { order: 2; width: 100%; height: 52px !important; flex: 1 1 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .ifc-topbar-left::-webkit-scrollbar, .ifc-topbar-right::-webkit-scrollbar { display: none; }
  /* Conformité : la 3D garde la place, les panneaux latéraux s'effacent */
  body[data-ifc-onglet="recalage"] #ifcPanelLeft, body[data-ifc-onglet="recalage"] #ifcPanelRight, body[data-ifc-onglet="recalage"] #ifcModelStats { display: none !important; }
}

/* ── Passe 14 : retours de la relecture indépendante ───────────────────── */
.num, dd.num { font-family: var(--f) !important; font-variant-numeric: tabular-nums; }
/* une seule aide (en-tête), une seule connexion (en-tête) */
#ifcHelpBtn, .gr-bc-cta-link { display: none !important; }
/* la carte « Sélectionné » répète le panneau Propriétés */
#ifcSelCard { display: none !important; }
/* outils 3D inutilisables sans maquette */
body:not(.a-modele) #ifcViewerTools .ifc-tool-icon, body:not(.a-modele) .ifc-viewer-toolbar .ifc-tool-icon { opacity: .35; pointer-events: none; }
/* Audit : cartes plus calmes, l'exclusion est un bouton explicite */
.audit-card { cursor: default !important; }
.audit-card-impact { display: none !important; }
.audit-card-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; min-height: 26px; }
.audit-card-pied .audit-card-state { background: transparent !important; color: var(--encre-3) !important; font-size: 12px !important; font-weight: 600 !important; padding: 0 !important; }
.audit-card-excl { border: 0; background: none; padding: 4px 0; font: 500 12.5px var(--f); color: var(--encre-3); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; margin-left: auto; }
.audit-card-excl:hover { color: var(--encre); }
.audit-card-disabled { opacity: 1 !important; background: var(--surface-2) !important; }
.audit-card-disabled .audit-card-label, .audit-card-disabled .audit-card-detail { color: var(--encre-3) !important; }
.audit-card-label { font-size: 13.5px !important; }
.audit-card-detail, .audit-card-reco { font-size: 12.5px !important; }
.audit-card-score { font-size: 12px !important; }
.audr-row-pill { font-size: 12px !important; }
/* textes trop petits relevés à 8-10 px */
.ifc-stat-sub, .ifc-props-empty-sub, .ifc-layer-count, .ifc-badge, #ifcLayerCount, .geo-badge .ifc-stat-sub { font-size: 12px !important; }
.ifc-stat-label { font-size: 12px !important; }
.ifc-file-pill, #ifcFileSize { font-size: 12px !important; }
/* Quantitatifs : étage en texte, compteur détaché */
.qto-td-storey, .qto-items-table tbody td.qto-td-storey { color: var(--encre-2) !important; text-align: left !important; font-weight: 400 !important; }
/* Comparaison : pastilles de couleur au lieu de signes + − ~ = */
.cmpb-tab-icon, .cmpb-status { display: inline-block !important; width: 9px !important; height: 9px !important; min-width: 0 !important; padding: 0 !important; border-radius: 50% !important; font-size: 0 !important; vertical-align: middle; flex: none; }
.cmpb-tab-added .cmpb-tab-icon, .cmpb-status-added { background: var(--vert) !important; }
.cmpb-tab-deleted .cmpb-tab-icon, .cmpb-status-deleted { background: var(--rouge) !important; }
.cmpb-tab-modified .cmpb-tab-icon, .cmpb-status-modified { background: #D9A21B !important; }
.cmpb-tab-unchanged .cmpb-tab-icon, .cmpb-status-unchanged { background: #B5BDC6 !important; }
/* barre de lecture : jamais coupée en deux lignes */
#bimLecture, #bimLecture * { white-space: nowrap; }
#bimLecture .lec-info { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 600px) { #bimLecture .lec-coord, #bimLecture .lec-sys, #bimLecture .lec-sep { display: none !important; } }
/* plan d'étage : chaque entrée de légende reste avec sa couleur */
.plan-legende > * { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.plan-legende { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px !important; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* feuille Propriétés : moins haute, sous les fenêtres et les outils */
  body.m-props #ifcPanelRight { height: min(42vh, 420px) !important; z-index: 60 !important; }
  body.m-gauche #ifcPanelLeft { z-index: 60 !important; }
  /* une fenêtre de calage à la fois : la feuille Calques attend */
  body:has(#bimAutoPanel:not([style*="display: none"]):not([style*="display:none"])) #bimLayersPanel { display: none !important; }
  /* boîte de coupe, plan : la feuille Propriétés se range */
  body:has(#bimBoite:not([hidden])) #ifcPanelRight, body:has(#bimPlan:not([hidden])) #ifcPanelRight { display: none !important; }
}
.ifc-prop-ifc { display: block; font-size: 11px; color: var(--encre-3); font-weight: 400; }
#bimTilesBtn.cf-lien { border: 0 !important; background: none !important; box-shadow: none !important; padding: 2px 0 !important; min-height: 0 !important; width: auto !important; }
.help-liens { display: inline-flex; gap: 16px; }
/* Aide au téléphone : les rubriques deviennent une bande défilante en tête */
@media (max-width: 760px) {
  #helpModal .help-modal { grid-template-rows: auto 1fr !important; }
  #helpModal .help-sidebar { display: flex !important; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px !important; border-right: 0 !important; border-bottom: 1px solid var(--trait-2) !important; scrollbar-width: none; }
  #helpModal .help-brand, #helpModal .help-toc-section { display: none !important; }
  #helpModal .help-toc { display: contents !important; }
  #helpModal .help-toc li { flex: none; list-style: none; }
  #helpModal .help-toc-btn { white-space: nowrap; border: 1px solid var(--trait) !important; border-radius: 999px !important; padding: 6px 12px !important; font-size: 13px !important; width: auto !important; }
  #helpModal .help-toc-btn.active { background: var(--encre) !important; color: #fff !important; border-color: var(--encre) !important; }
  #helpModal { z-index: 12000 !important; }
}
/* Couches 3D ouvert : la barre d'outils de la carte s'efface pour ne pas le couvrir */
body:has(#sidebar.open) .gr-toolbar { opacity: 0; pointer-events: none; }
/* Comparaison : boutons icône standard, sélecteur et curseurs à leur taille */
.cmp-state-btn, .cmp-remove, .cmp-toggle { width: 32px !important; height: 32px !important; min-width: 32px; padding: 0 !important; border-radius: var(--r) !important; background: var(--surface) !important; color: var(--encre-2) !important; border: 1px solid var(--trait) !important; display: inline-flex !important; align-items: center; justify-content: center; box-shadow: none !important; flex: none !important; }
.cmp-state-btn:hover, .cmp-remove:hover, .cmp-toggle:hover { border-color: var(--encre-3) !important; color: var(--encre) !important; }
.cmp-mode-row { display: inline-flex !important; width: auto !important; border: 1px solid var(--trait); border-radius: var(--r); overflow: hidden; gap: 0 !important; padding: 0 !important; background: var(--surface) !important; }
.cmp-mode-btn { flex: none !important; width: auto !important; padding: 0 14px !important; height: 32px; border: 0 !important; border-radius: 0 !important; background: var(--surface) !important; color: var(--encre-2) !important; font: 500 13px var(--f) !important; }
.cmp-mode-btn.cmp-mode-active, .cmp-mode-btn.active { background: var(--encre) !important; color: #fff !important; }
.cmp-slider-row { max-width: 360px; }
.cmp-slider-row input[type=range] { max-width: 240px; }
/* un seul moyen de fermer le tiroir Projet : la croix en tête */
#sidebar #closeBtn { display: none !important; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* Quantitatifs : le tableau défile dans sa carte plutôt que de couper les colonnes */
  .qto-tree-type-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .qto-items-table td:nth-child(3), .qto-items-table th:nth-child(3) { white-space: nowrap; }
  #helpModal .help-foot > span:last-child { display: none; }
}
#ifcDropZone span, .ifc-ph-cta span, #ifcDropZone, .ifc-ph-cta { color: var(--encre) !important; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* une fenêtre de calage ouverte en bas : le panneau Conformité garde de quoi défiler au-dessus */
  body:has(#bimAutoPanel:not([style*="display: none"]):not([style*="display:none"])) #ifcPanelRecalage .cf,
  body:has(#bimAlignPanel:not([style*="display: none"]):not([style*="display:none"])) #ifcPanelRecalage .cf,
  body:has(#bimNudgePanel:not([style*="display: none"]):not([style*="display:none"])) #ifcPanelRecalage .cf { padding-bottom: 64vh; }
}

/* ── Plan d'étage : tranche du nuage scanné ────────────────────────────── */
.plan-legende[hidden], .plan-nuage-info[hidden] { display: none !important; }
.plan-nuage-info { font-size: 12.5px; color: var(--encre-2); padding: 0 14px 8px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.plan-legende .pt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.plan-legende-nuage { flex-basis: 100%; }
.plan-nuage input:disabled + *, .plan-nuage:has(input:disabled) { color: var(--encre-3); }

/* ── Passe 15 : premier contact et navigation au pouce ─────────────────── */
.ph-exemple { margin-top: 10px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--trait); background: var(--surface); color: var(--encre); font: 600 14px var(--f); cursor: pointer; }
.ph-exemple:hover { border-color: var(--encre-3); }
#mNav, #mFeuille, .m-outils { display: none; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  :root { --barre-h: calc(60px + env(safe-area-inset-bottom, 0px)); }
  /* la barre de lecture (coordonnées au curseur) cède la place à la navigation */
  #bimLecture { display: none !important; }
  #mNav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: var(--barre-h); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 9100; background: var(--surface); border-top: 1px solid var(--trait); }
  #mNav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 500 12px var(--f); color: var(--encre-3); cursor: pointer; position: relative; }
  #mNav button svg { width: 22px; height: 22px; }
  #mNav button.actif { color: var(--encre); font-weight: 600; }
  #mNav button.actif::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--jalon); }
  /* en-tête : le logo et l'état du projet, le reste est dans la barre du bas */
  .gr-header-right > .gr-modules, .gr-header-right #bimPaletteBtn, .gr-header-right .gr-help-btn, .gr-header-right #helpBtn,
  .gr-header-right #bimAuthBtn, .gr-header-right .gr-module-pano, .gr-header-right #panoStudioBtn, .gr-header-right .gr-btn-pro { display: none !important; }
  .gr-breadcrumb { display: flex !important; border-left: 0 !important; min-width: 0; }
  .gr-breadcrumb .gr-bc-item:not(.gr-bc-project) , .gr-breadcrumb .gr-bc-sep { display: none !important; }
  .gr-bc-project { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* vue 3D : plus de colonne d'icônes muettes, un bouton « Outils » nommé */
  #ifcViewerTools, .ifc-viewer-toolbar { display: none !important; }
  .ifc-topbar-right .ifc-close-btn { display: none !important; }
  .m-outils { display: inline-flex; left: auto !important; right: 10px; }
  .m-outils[hidden] { display: none !important; }
  body.m-props .m-outils, body.m-gauche .m-outils { display: none !important; }
  /* feuille du bas */
  #mFeuille { display: block; position: fixed; inset: 0; z-index: 12500; }
  #mFeuille .mf-voile { position: absolute; inset: 0; background: rgba(28,36,48,.35); }
  #mFeuille .mf-carte { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto; background: var(--surface); border-radius: 14px 14px 0 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 30px rgba(28,36,48,.2); }
  #mFeuille .mf-tete { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; position: sticky; top: 0; background: var(--surface); }
  #mFeuille .mf-tete b { font-size: 16px; }
  #mFeuille .mf-tete button { border: 0; background: none; font: 600 14px var(--f); color: var(--bleu-fonce); padding: 8px 0 8px 16px; }
  #mFeuille .mf-ligne { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 16px; border: 0; border-top: 1px solid var(--trait-2); background: none; text-align: left; font: 500 15px var(--f); color: var(--encre); text-decoration: none; cursor: pointer; }
  #mFeuille .mf-ligne small { display: block; font-size: 12.5px; color: var(--encre-3); font-weight: 400; margin-top: 2px; }
  #mFeuille .mf-ico { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r); background: var(--surface-2); color: var(--encre-2); }
  #mFeuille .mf-ico svg { width: 20px; height: 20px; }
  #mFeuille .mf-ligne.actif .mf-ico { background: var(--encre); color: #fff; }
  #mFeuille .mf-ligne.danger { color: var(--rouge); }
  #mFeuille .mf-t { flex: 1; }
  #mFeuille .mf-etat { font-size: 12.5px; font-weight: 600; color: var(--encre); padding: 3px 9px; border-radius: 999px; background: #FFF1CC; }
  /* rappel des gestes */
  #mGestes { position: absolute; left: 12px; right: 12px; top: auto; bottom: 76px; z-index: 30; background: rgba(28,36,48,.9); color: #fff; font: 500 14px/1.45 var(--f); padding: 10px 14px; border-radius: var(--r-panneau); text-align: center; pointer-events: none; }
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* en-tête : on garde où l'on en est (« Non enregistré », nom du projet) à côté du logo */
  .gr-header .gr-header-left .gr-breadcrumb { display: flex !important; align-items: center; padding-left: 10px !important; }
  .gr-header .gr-breadcrumb #grBcWorkspace, .gr-header .gr-breadcrumb .gr-bc-sep, .gr-header .gr-breadcrumb .gr-bc-status { display: none !important; }
  .gr-header .gr-breadcrumb #grBcProject { display: inline !important; font-size: 14px !important; }
}
/* au doigt, les raccourcis clavier n'ont rien à faire dans la recherche */
@media (pointer: coarse) { #bimPalette kbd, #bimPalette .pal-pied > span:not(.pal-source) { display: none !important; } #bimPalette .pal-pied { justify-content: flex-end; } }

/* ── Passe 16 : moins d'information à la fois ──────────────────────────── */
@media (min-width: 769px) {
  /* Propriétés : le panneau n'apparaît que lorsqu'un élément est sélectionné */
  body:not(:has(#ifcPropsContent[style*="block"])) #ifcPanelRight { display: none !important; }
}
/* « Modèle actif » répète l'onglet Vue 3D */
#ifcModelStats > .ifc-stat-card:not(.geo-badge):not(#ifcSelCard) { display: none !important; }
/* l'aide à la navigation s'efface après la première manipulation */
body.a-navigue .ifc-viewer-hint { display: none !important; }

/* ── Comparaison : la 3D à gauche, les différences à droite ─────────────── */
#ifcPanelCompare { position: fixed !important; right: 0; bottom: var(--barre-h); width: var(--cf-w) !important; flex: none !important; z-index: 8001; border-left: 1px solid var(--trait); overflow-y: auto !important; }
body[data-ifc-onglet="compare"] #ifcPanelRight, body[data-ifc-onglet="compare"] #ifcModelStats { display: none !important; }
@media (max-width: 1180px) { body[data-ifc-onglet="compare"] #ifcPanelLeft { display: none !important; } }

/* ── Passe 17 : comparaison lisible dans 440 px ─────────────────────── */
#ifcPanelCompare .cmp-status:empty { display: none; }
#ifcPanelCompare .cmp-state-head { flex-wrap: wrap; row-gap: 2px; }
#ifcPanelCompare .cmp-state-name { flex: 1 0 100%; order: 3; margin: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--encre); }
#ifcPanelCompare .cmpb-tabs { flex-wrap: wrap; overflow: visible; gap: 4px; }
#ifcPanelCompare .cmpb-tab { flex: 0 0 auto; min-width: 0; }
#ifcPanelCompare .cmpb-tab-label { display: inline !important; max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap; }
#ifcPanelCompare .cmp-state-head { display: flex !important; flex-wrap: wrap !important; }
#ifcPanelCompare .cmp-state-name { flex-basis: 100% !important; max-width: 100% !important; }
body[data-ifc-onglet="compare"] .ifc-viewer-hint { display: none !important; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* au téléphone : la 3D reste visible en haut, la comparaison monte du bas */
  body[data-ifc-onglet="compare"] #ifcPanelCompare { top: auto !important; height: 56vh !important; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(16,24,40,.14); }
  #ifcPanelCompare .cmp-inline-states { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  #ifcPanelCompare .cmp-state { margin: 0 !important; min-width: 0; }
  #ifcPanelCompare .cmp-inline-subtitle { display: none; }
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  body[data-ifc-onglet="compare"] #ifcMainArea { margin-right: 0 !important; margin-bottom: calc(56vh - var(--barre-h, 0px)) !important; }
}
#ifcBtnSplit { display: none !important; } /* doublon de l onglet Comparaison */
/* barre Mesures ouverte (bureau) : la colonne d'outils et « Terminer » passent dessous */
@media (min-width: 769px) {
  body.measure-bar-open .gr-toolbar { top: calc(var(--header-h) + 56px) !important; }
  body.measure-bar-open #bimTerminer { top: calc(var(--header-h) + 58px); }
}
.ifc-meas-fin { position: absolute; left: 50%; transform: translateX(-50%); bottom: 64px; z-index: 30; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--encre); color: #fff; font: 600 14px var(--f); box-shadow: 0 6px 18px rgba(28,36,48,.25); cursor: pointer; }
.ifc-meas-fin::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--jalon); margin-right: 8px; vertical-align: 1px; }
/* Quantitatifs : colonnes identiques d'un tableau à l'autre */
.qto-items-table.qto-cols { table-layout: fixed; width: 100%; }
.qto-cols col.qc-nom { width: auto; }
.qto-cols col.qc-etage { width: 22%; }
.qto-cols col.qc-n { width: 15%; }
.qto-cols td.qto-td-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qto-cols th, .qto-cols td { padding-left: 6px !important; padding-right: 6px !important; }
.qto-cols th:nth-child(n+3), .qto-cols td:nth-child(n+3) { text-align: right !important; white-space: nowrap; }
.qto-cols th:nth-child(2), .qto-cols td:nth-child(2) { text-align: left !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { .qto-cols col.qc-etage { width: 24%; } .qto-cols col.qc-n { width: 17%; } .qto-items-table.qto-cols th:nth-child(6), .qto-items-table.qto-cols td:nth-child(6) { display: table-cell; } }
.qto-cols td, .qto-cols th { font-family: var(--f) !important; font-variant-numeric: tabular-nums; letter-spacing: 0 !important; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { .qto-cols th .ql { display: none; } .qto-cols th:nth-child(n+3)::before { content: none; } }
/* confirmation dans l'appli */
.bim-confirm { position: fixed; inset: 0; z-index: 20000; background: rgba(16,24,40,.32); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bim-confirm-carte { background: var(--surface, #fff); color: var(--encre); border-radius: 14px; padding: 20px; max-width: 400px; width: 100%; box-shadow: 0 18px 48px rgba(16,24,40,.25); font: 14px/1.45 var(--f); }
.bim-confirm-carte b { display: block; font-size: 16px; margin-bottom: 6px; overflow-wrap: anywhere; }
.bim-confirm-carte p { margin: 0 0 16px; color: var(--encre-2); }
.bim-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.bim-confirm-actions button { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--trait); background: var(--surface, #fff); color: var(--encre); font: 600 14px var(--f); cursor: pointer; }
.bim-confirm-actions button.danger { background: #B42318; border-color: #B42318; color: #fff; }
.bim-confirm-actions button.ok { background: var(--encre); border-color: var(--encre); color: #fff; }
.bim-auth-raison { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #FFF8DB; border-left: 3px solid var(--jalon); color: var(--encre); font: 13px/1.45 var(--f); overflow-wrap: anywhere; }
.profil-note:empty { display: none; } .profil-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #FFF8DB; color: var(--encre); font: 13px/1.4 var(--f); }
.cf-raison { margin: 0 0 8px; color: var(--encre-2); font: 13px/1.4 var(--f); } .cf-raison::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--jalon); margin-right: 7px; vertical-align: 1px; } .cf-btn:disabled { opacity: .45; cursor: not-allowed; }
.ong-suite-d { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
.ong-suite-g { -webkit-mask-image: linear-gradient(to left, #000 82%, transparent); mask-image: linear-gradient(to left, #000 82%, transparent); }
.ong-suite-d.ong-suite-g { -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); }
.ids-note { margin: 10px 0 0; color: var(--encre-2); font: 13px/1.45 var(--f); } .ids-lien { border: 0; background: none; padding: 0; color: var(--bleu); font: inherit; text-decoration: underline; cursor: pointer; }
/* « Ouvrir IFC » reste là sur tous les onglets ; jaune seulement tant qu'aucune maquette n'est ouverte */
#ifcDropZone { display: inline-flex !important; }
body.a-modele #ifcDropZone { background: var(--surface, #fff) !important; border: 1px solid var(--trait) !important; font-weight: 500 !important; }
body.a-modele #ifcDropZone:hover { background: var(--surface-2) !important; }
/* Audit : d'abord ce qu'il faut corriger */
.audit-titre { font: 600 15px var(--f); color: var(--encre); margin: 2px 0 10px; grid-column: 1 / -1; }
.audit-bravo { margin: 0 0 12px; color: var(--encre-2); font: 14px/1.45 var(--f); grid-column: 1 / -1; }
.audit-card-sec { display: block; font: 500 11px var(--f); color: var(--encre-3); margin-bottom: 2px; }
.audit-card-reco { color: var(--encre-2) !important; }
.audit-ok { grid-column: 1 / -1; margin-top: 14px; border: 1px solid var(--trait); border-radius: 12px; background: var(--surface, #fff); }
.audit-ok summary { cursor: pointer; padding: 12px 14px; font: 600 14px var(--f); color: var(--encre); list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; box-sizing: border-box; }
.audit-ok summary::-webkit-details-marker { display: none; }
.audit-ok summary::after { content: "Afficher"; margin-left: auto; font-weight: 500; font-size: 13px; color: var(--bleu); }
.audit-ok[open] summary::after { content: "Masquer"; }
.audit-ok-pt { width: 8px; height: 8px; border-radius: 50%; background: #1D9E75; }
.audit-ok ul { list-style: none; margin: 0; padding: 0 14px 8px; }
.audit-ok li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--trait-2); font: 13.5px/1.35 var(--f); color: var(--encre); }
.audit-ok li small { display: block; color: var(--encre-3); font-size: 12px; margin-top: 2px; }
.audit-ok li b { font-weight: 500; color: #1D9E75; white-space: nowrap; font-variant-numeric: tabular-nums; }
#ifcChecksList > .audit-titre { display: block !important; font-size: 15px !important; color: var(--encre) !important; margin: 0 0 2px !important; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* au téléphone : d'abord ce qu'il faut corriger, les réglages ensuite */
  #ifcCheckerResults:not([style*="display: none"]):not([style*="display:none"]) { display: flex !important; flex-direction: column; }
  #ifcCheckerResults > #ifcChecksList { order: 1; }
  #ifcCheckerResults > div:last-child { order: 2; }
  #ifcCheckerResults > #bimIds { order: 3; }
  #ifcCheckerResults > #auxToolbar { order: 4; }
}
.audit-card { min-height: 0 !important; height: auto !important; } .audit-card-pied { margin-top: 6px !important; }

/* ── Passe 17 bis : écran vide = une seule chose à faire ─────────────────
 * Sans maquette, rien d'autre que « Choisir un fichier » et « Essayer avec
 * l'exemple » : ni panneaux vides à 0, ni outils inertes, ni sous-titres. */
body:not(.a-modele) #ifcPanelLeft,
body:not(.a-modele) #ifcViewerTools,
body:not(.a-modele) .ifc-viewer-hint,
body:not(.a-modele) #bimCloudDropPill,
body:not(.a-modele)[data-ifc-onglet="viewer"] #ifcDropZone,
body:not(.a-modele) .ifc-tb-btn.ong .ong-etat { display: none !important; }
/* nuage : un seul bouton (le nuage tuilé s'ouvre depuis la Conformité) */
#bimTilesetPill { display: none !important; }
/* le × d'IFC Studio basculait vers la carte : le sélecteur de vue suffit */
.ifc-topbar-right .ifc-close-btn { display: none !important; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* téléphone : le badge géoréférencé devient une pastille, la 3D reste dégagée */
  #bimGeorefBadge { padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; min-width: 0 !important; width: auto !important; }
  #bimGeorefBadge .ifc-stat-label, #bimGeorefBadge .geo-l, #bimGeorefBadge .ifc-stat-sub { display: none !important; }
  #bimGeorefBadge .geo-poser { margin: 0 !important; min-height: 40px; padding: 0 14px !important; border-radius: 999px !important; background: var(--surface, #fff) !important; border: 1px solid var(--trait) !important; box-shadow: 0 2px 10px rgba(16,24,40,.12) !important; font: 600 13px var(--f) !important; color: var(--encre) !important; width: auto !important; }
  #bimGeorefBadge .geo-poser::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--jalon); margin-right: 7px; vertical-align: 1px; }
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* téléphone, maquette : l'en-tête ne portait que le logo. Il disparaît,
     le logo passe à gauche de « Ouvrir IFC » : la 3D gagne une rangée */
  body[data-view="bim"] { --header-h: 0px; }
  body[data-view="bim"] .gr-header { display: none !important; }
  body[data-view="bim"] .ifc-topbar-right::before { content: ""; width: 26px; height: 26px; flex: 0 0 26px; margin-right: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpolygon points='24,0 48,12 24,24 0,12' fill='%23F5C518'/%3E%3Cpolygon points='0,12 24,24 24,48 0,36' fill='%231A56E8'/%3E%3Cpolygon points='24,24 48,12 48,36 24,48' fill='%230E3FAA'/%3E%3C/svg%3E") center / contain no-repeat; }
  body[data-view="bim"] .ifc-topbar-right { padding-left: 12px !important; }
  body[data-view="bim"] .ifc-topbar-right .ifc-tb-sep { display: none !important; }
}
/* panneaux latéraux fermés : pas d ombre portée sur le bord de l écran */
.adm-sidebar:not(.show), .pv-sidebar:not(.show):not(.open) { box-shadow: none !important; }
.help-toc-section { color: #5B6573 !important; }

/* ── Le bilan : la réponse à « elle est bonne, ma maquette ? » ─────────── */
#bimBilan { position: absolute; top: 12px; left: 12px; z-index: 25; font: 14px/1.4 var(--f); color: var(--encre); }
#bimBilan[hidden], body:not([data-ifc-onglet="viewer"]) #bimBilan { display: none !important; }
#bimBilan .bl-carte { width: 316px; background: var(--surface, #fff); border: 1px solid var(--trait); border-radius: 16px; box-shadow: 0 10px 30px rgba(16,24,40,.14); padding: 14px 14px 12px; }
#bimBilan .bl-pastille { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 5px; border-radius: 999px; border: 1px solid var(--trait); background: var(--surface, #fff); box-shadow: 0 4px 14px rgba(16,24,40,.12); font: 600 13px var(--f); color: var(--encre); cursor: pointer; }
#bimBilan .bl-mini { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--encre); color: #fff; font: 700 12px var(--f); box-shadow: inset 0 0 0 2.5px var(--jalon); }
#bimBilan.replie .bl-carte { display: none; }
#bimBilan.replie .bl-pastille { display: inline-flex; }
.bl-tete { display: flex; align-items: center; gap: 12px; }
.bl-anneau { position: relative; width: 68px; height: 68px; flex: 0 0 68px; }
.bl-anneau svg { width: 100%; height: 100%; }
.bl-anneau b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 24px/1 var(--f); letter-spacing: -.02em; }
.bl-fond { fill: none; stroke: var(--trait-2, #E8EBEF); stroke-width: 7; }
.bl-note { fill: none; stroke: var(--encre); stroke-width: 7; stroke-linecap: round; animation: bl-trace .9s cubic-bezier(.2,.7,.2,1) both; }
.bl-gain { fill: none; stroke: var(--jalon); stroke-width: 7; opacity: .95; }
@keyframes bl-trace { from { stroke-dasharray: 0 999; } }
@media (prefers-reduced-motion: reduce) { .bl-note { animation: none; } }
.bl-titre { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.bl-titre b { font-size: 16px; font-weight: 650; }
.bl-titre span { color: var(--encre-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-x { align-self: flex-start; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--encre-2); cursor: pointer; display: grid; place-items: center; }
.bl-x:hover { background: var(--surface-2); }
.bl-sous { margin: 12px 0 6px; font-size: 12.5px; color: var(--encre-2); }
.bl-liste { list-style: none; margin: 0; padding: 0; }
.bl-liste li + li { border-top: 1px solid var(--trait-2, #EEF0F3); }
.bl-liste button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 2px; min-height: 44px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; border-radius: 8px; }
.bl-liste button:hover { background: var(--surface-2); }
.bl-l { flex: 1; min-width: 0; font-weight: 550; }
.bl-l small { display: block; font-weight: 400; font-size: 12px; color: var(--encre-3); margin-top: 1px; }
.bl-pts { flex: 0 0 auto; font: 700 12.5px var(--f); color: var(--encre); background: #FFF4C2; border-radius: 999px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.bl-suite { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.bl-suite button { flex: 1 1 auto; min-height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--trait); background: var(--surface, #fff); color: var(--encre); font: 550 12.5px var(--f); cursor: pointer; white-space: nowrap; }
.bl-suite button:first-child { background: var(--encre); border-color: var(--encre); color: #fff; }
.bl-suite button:hover { border-color: var(--encre-3); }
#bimBilan button:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
/* le badge géoréférencé fait doublon avec « Voir sur la carte » */
body.a-bilan #bimGeorefBadge { display: none !important; } /* classe posée par bilan.js : un :has() sur body recalculait tout le style à chaque image de la carte */
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  #bimBilan { top: 8px; left: 8px; right: 8px; }
  #bimBilan .bl-carte { width: auto; max-height: 52vh; overflow-y: auto; }
  #bimBilan.replie { right: auto; }
  body.m-props #bimBilan { display: none !important; }
}
.bl-suite { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); } .bl-suite button { padding: 0 6px !important; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* téléphone : le bilan tient en haut, le centre de la 3D reste touchable */
  #bimBilan .bl-suite, #bimBilan .bl-sous { display: none !important; }
  #bimBilan .bl-carte { padding: 10px 12px 6px; }
  #bimBilan .bl-anneau { width: 52px; height: 52px; flex-basis: 52px; }
  #bimBilan .bl-anneau b { font-size: 19px; }
  #bimBilan .bl-liste button { min-height: 44px; padding: 6px 2px; }
  #bimBilan .bl-l small { display: none; }
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  /* carte au téléphone : chaque outil porte son nom, comme la barre du bas */
  .gr-toolbar { padding: 4px 6px !important; }
  .gr-toolbar .gr-tool-group { flex-direction: row !important; gap: 2px !important; }
  .gr-toolbar .gr-tool { width: auto !important; min-width: 56px; height: 52px !important; flex-direction: column !important; gap: 3px; padding: 4px 6px !important; display: inline-flex !important; align-items: center; justify-content: center; }
  .gr-toolbar .gr-tool .gr-tool-label { position: static !important; display: block !important; opacity: 1 !important; visibility: visible !important; transform: none !important; background: none !important; color: inherit !important; padding: 0 !important; font: 500 11px/1 var(--f) !important; box-shadow: none !important; white-space: nowrap; pointer-events: none; }
  .gr-toolbar .gr-tool .gr-tool-label::before { display: none !important; }
  .gr-toolbar .gr-tool.is-active .gr-tool-label { color: #fff !important; }
  /* en-tête de la maquette au téléphone : textes lisibles */
  #ifcDropZone, #ifcFileInfo, #ifcFileInfo * { font-size: 12.5px !important; }
  #ifcDropZone { min-height: 36px; padding: 0 12px !important; }
}
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { #ifcDropZone span, #ifcDropZone * { font-size: 12.5px !important; } body.measure-bar-open .gr-measure-bar { bottom: calc(var(--barre-h) + 78px) !important; } }
/* ── Téléphone couché : la hauteur est le luxe, tout se tasse ─────────── */
@media (max-height: 500px) and (pointer: coarse) {
  :root { --barre-h: calc(44px + env(safe-area-inset-bottom, 0px)) !important; }
  #mNav button { flex-direction: row !important; gap: 6px; font-size: 12px; }
  #mNav button svg { width: 18px; height: 18px; }
  .ifc-tb-btn.ong .ong-etat { display: none !important; }
  .ifc-tb-btn.ong { min-height: 38px !important; height: 38px !important; }
  #bimPlan { top: 6px !important; bottom: calc(var(--barre-h) + 6px) !important; left: 8px !important; right: 8px !important; width: auto !important; }
  #bimPlan .bp-legende, #bimPlan [class*="legende"] { display: none !important; }
  #mGestes { bottom: 64px !important; left: 25% !important; right: 25% !important; font-size: 13px !important; }
}

/* ── Premiers pas : un geste à la fois ──────────────────────────────────── */
#bimPremiersPas { position: fixed; z-index: 9150; left: 50%; transform: translateX(-50%); bottom: calc(var(--barre-h) + 18px); width: min(360px, calc(100vw - 16px)); box-sizing: border-box; background: var(--encre); color: #fff; border-radius: 16px; padding: 12px 14px 12px; box-shadow: 0 14px 36px rgba(16,24,40,.28); font: 14px/1.45 var(--f); }
#bimPremiersPas[hidden] { display: none; }
#bimPremiersPas b { display: block; font-size: 16px; font-weight: 650; margin: 2px 0 2px; }
#bimPremiersPas p { margin: 0; color: #D5DAE1; font-size: 13.5px; }
.pp-tete { display: flex; justify-content: space-between; align-items: center; }
.pp-n { font-size: 12px; color: var(--jalon); font-weight: 600; }
.pp-tete button { border: 0; background: none; color: #B8C0CA; font: 500 13px var(--f); min-height: 32px; padding: 0 4px; cursor: pointer; }
.pp-points { display: flex; gap: 5px; margin-top: 10px; }
.pp-points i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.18); }
.pp-points i.ok { background: var(--jalon); }
.pp-points i.ici { background: linear-gradient(90deg, var(--jalon) 40%, rgba(255,255,255,.18) 40%); }
#bimPremiersPas.pp-bravo { background: #12372A; }
#bimPremiersPas.pp-bravo b::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3DDC97; margin-right: 8px; vertical-align: 2px; }
.pp-actions { display: flex; gap: 8px; margin-top: 10px; }
.pp-actions button { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font: 600 13.5px var(--f); cursor: pointer; }
.pp-actions button:first-child { background: var(--jalon); border-color: var(--jalon); color: var(--encre); }
#bimPremiersPas button:focus-visible { outline: 2px solid var(--jalon); outline-offset: 2px; }
/* la chose à toucher : un anneau jaune qui respire */
.pp-cible { position: relative; outline: 3px solid var(--jalon) !important; outline-offset: 3px; border-radius: 10px; animation: pp-respire 1.4s ease-in-out infinite; }
@keyframes pp-respire { 50% { outline-color: rgba(245,197,24,.35); outline-offset: 6px; } }
@media (prefers-reduced-motion: reduce) { .pp-cible { animation: none; } }
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  #bimPremiersPas { bottom: calc(var(--barre-h) + 70px); }
  body.m-props #bimPremiersPas { bottom: calc(var(--barre-h) + 8px); }
}
#bimSolCharge { position: fixed; z-index: 1190; top: calc(var(--header-h) + 64px); left: 50%; transform: translateX(-50%); background: var(--surface, #fff); color: var(--encre); border: 1px solid var(--trait); border-radius: 999px; padding: 7px 14px; font: 500 13px var(--f); box-shadow: 0 4px 14px rgba(16,24,40,.12); pointer-events: none; } #bimSolCharge[hidden] { display: none; } #bimSolCharge::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--jalon); margin-right: 8px; animation: sol-pulse 1.2s ease-in-out infinite; vertical-align: 1px; } @keyframes sol-pulse { 50% { opacity: .3; } } @media (prefers-reduced-motion: reduce) { #bimSolCharge::before { animation: none; } }
