/* ═══════════════════════════════════════════════════════════════
   CENTER™ — Fiche Terrain Intelligente
   Stealth Luxury / Supercar Cockpit Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Fond & surfaces — alignés madior.io ── */
  --bg: #1e1e22;
  --surface: #26262c;
  --surface-2: #2e2e34;

  /* ── Brand copper — identique madior.io ── */
  --cu: #d4a574;
  --cu-l: #e8c9a0;
  --cu-d: #8a6a52;
  --cu-g: rgba(212, 165, 116, 0.08);
  --cu-glow: rgba(212, 165, 116, 0.12);

  /* ── Accent ── */
  --ac: #007aff;
  --ac-l: #4da3ff;
  --ac-d: #0056b3;

  /* ── Surfaces composants ── */
  --c1: rgba(30, 30, 34, 0.85);
  --c2: rgba(38, 38, 44, 0.9);
  --c3: rgba(46, 46, 52, 0.6);

  /* ── Bordures — subtiles comme madior.io ── */
  --bd: rgba(255, 255, 255, 0.08);
  --bd-h: var(--cu);
  --line: rgba(255, 255, 255, 0.06);

  /* ── Texte — aligné madior.io ── */
  --tx: #e8e8ec;
  --t1: #f4f4f8;
  --t2: #8a8a94;
  --t3: #5a5a64;

  /* ── Statuts ── */
  --ok: #34d399;
  --ok-b: rgba(52, 211, 153, 0.05);
  --wa: #fbbf24;
  --wa-b: rgba(251, 191, 36, 0.05);
  --er: #f87171;
  --er-b: rgba(248, 113, 113, 0.05);
  --in: #60a5fa;
  --in-b: rgba(96, 165, 250, 0.05);

  /* ── Rayons & ombres — allégées comme madior.io ── */
  --r: 6px;
  --rl: 10px;
  --sh: 0 8px 32px rgba(0, 0, 0, 0.45);
  --inner-sh: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass: blur(12px) saturate(110%);
  --glass-l: blur(6px);

  /* ── Typo — Poppins + Inter comme madior.io ── */
  --f: 'Inter', -apple-system, sans-serif;
  --f-d: 'Poppins', sans-serif;
  --m: 'JetBrains Mono', monospace;

  /* ── Easing madior.io ── */
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  font-family: var(--f);
  background: var(--bg);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}
/* ── Grille 40×40 identique madior.io ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(212, 165, 116, 0.06), transparent 55%),
    var(--bg);
  background-size:
    40px 40px,
    40px 40px,
    100% 100%,
    100% 100%;
  pointer-events: none;
}
/* Texture grain subtile */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ── tsparticles container ── */
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* ══════════════════════════════════════════
   LIGHT MODE — [data-theme="light"]
   ══════════════════════════════════════════ */
[data-theme='light'] {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f0ede8;
  --cu: #b8875a;
  --cu-l: #a0764e;
  --cu-d: #6b4e30;
  --cu-g: rgba(184, 135, 90, 0.08);
  --cu-glow: rgba(184, 135, 90, 0.12);
  --c1: rgba(255, 255, 255, 0.85);
  --c2: rgba(245, 242, 238, 0.9);
  --c3: rgba(240, 237, 232, 0.6);
  --bd: rgba(0, 0, 0, 0.08);
  --line: rgba(0, 0, 0, 0.06);
  --tx: #1a1a1e;
  --t1: #0d0d12;
  --t2: #5a5a64;
  --t3: #8a8a94;
  --sh: 0 8px 32px rgba(0, 0, 0, 0.08);
  --inner-sh: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
/* Lisibilité mode clair — titres/labels carte : var(--t3) ~2.3:1 sur blanc (sous WCAG AA)
   → var(--t2) ~5.6:1 (conforme AA). Couvre le ruban COUCHES 2D et le ruban 3D (#r3d). */
[data-theme='light'] .rp-wms-title,
[data-theme='light'] .rp-field-label,
[data-theme='light'] .ctrl-label {
  color: var(--t2);
}
[data-theme='light'] body::before {
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(184, 135, 90, 0.04), transparent 55%),
    var(--bg);
  background-size:
    40px 40px,
    40px 40px,
    100% 100%,
    100% 100%;
}
[data-theme='light'] #tsparticles {
  opacity: 0.5;
}
[data-theme='light'] header {
  background: rgba(250, 248, 245, 0.95);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] header::after {
  background: linear-gradient(90deg, transparent, rgba(184, 135, 90, 0.15), transparent);
}
[data-theme='light'] .logo-i {
  color: #fff;
  box-shadow: 0 0 16px rgba(184, 135, 90, 0.2);
}
[data-theme='light'] #S {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .cd {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .cd:hover {
  border-color: var(--cu);
}
[data-theme='light'] .si {
  background: var(--surface-2);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--tx);
}
[data-theme='light'] .si::placeholder {
  color: var(--t3);
}
[data-theme='light'] .tab-nav {
  background: rgba(240, 237, 232, 0.96);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .tab-btn {
  color: var(--t3);
}
[data-theme='light'] .tab-btn.act {
  background: rgba(184, 135, 90, 0.08);
  color: var(--cu);
  border-color: rgba(184, 135, 90, 0.15);
}
[data-theme='light'] .ribbon-tabs {
  background: rgba(250, 248, 245, 0.96);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .ribbon-tab {
  color: var(--t3);
}
[data-theme='light'] .ribbon-tab.act {
  color: var(--cu);
  background: rgba(184, 135, 90, 0.06);
}
[data-theme='light'] .ribbon-panel {
  background: rgba(250, 248, 245, 0.94);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .rp-toggle {
  color: var(--t2);
}
[data-theme='light'] .rp-radio {
  color: var(--t2);
}
[data-theme='light'] .bt-p {
  background: linear-gradient(180deg, var(--cu), var(--cu-d));
  color: #fff;
}
[data-theme='light'] .bt-g {
  background: rgba(0, 0, 0, 0.02);
  color: var(--t2);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme='light'] .bt-g:hover {
  border-color: var(--cu);
  color: var(--cu);
}
[data-theme='light'] .madior-nav {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .madior-modal {
  background: rgba(255, 255, 255, 0.95);
}
[data-theme='light'] .map-legend {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .mode-toggle {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .mode-btn {
  color: var(--t3);
}
[data-theme='light'] .mode-btn.act {
  background: rgba(184, 135, 90, 0.06);
  color: var(--cu);
}
[data-theme='light'] .sg {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .sg-i:hover,
.sg-i.act {
  background: rgba(184, 135, 90, 0.05);
}
[data-theme='light'] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}
[data-theme='light'] ::-webkit-scrollbar-thumb:hover {
  background: var(--cu);
}
/* Light — documents & fichiers */
[data-theme='light'] .doc-item,
[data-theme='light'] .doc-item-wrap {
  background: rgba(245, 242, 238, 0.6);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .doc-item:hover,
[data-theme='light'] .doc-item-wrap:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}
[data-theme='light'] .doc-drop {
  border-color: rgba(184, 135, 90, 0.2);
  background: rgba(184, 135, 90, 0.02);
}
[data-theme='light'] .doc-drop:hover {
  border-color: var(--cu);
  background: rgba(184, 135, 90, 0.04);
}
[data-theme='light'] .doc-drop-status--info {
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.2);
}
[data-theme='light'] .doc-drop-status--warn {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.25);
}
[data-theme='light'] .doc-drop-status--err {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.2);
}
/* Light — EC boxes, risk, layers */
[data-theme='light'] .ec-box {
  background: rgba(245, 242, 238, 0.6);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme='light'] .rk {
  border-color: rgba(0, 0, 0, 0.06);
  border-left-color: var(--wa);
}
[data-theme='light'] .ly-band.act {
  background: rgba(184, 135, 90, 0.08);
  border-color: rgba(184, 135, 90, 0.2);
}
[data-theme='light'] .ly-tag {
  color: rgba(0, 0, 0, 0.45);
}
[data-theme='light'] .rp-filter-clear:hover {
  color: var(--tx);
  background: rgba(0, 0, 0, 0.06);
}
/* Light — measure tips & vent */
[data-theme='light'] .measure-tip {
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--cu) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme='light'] .vent-tooltip,
.vent-tooltip .leaflet-tooltip-content-wrapper {
  background: rgba(255, 255, 255, 0.97) !important;
  color: var(--tx) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}
/* Light — neo FAB */
[data-theme='light'] .neo-fab {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 242, 238, 0.98));
  border-color: rgba(184, 135, 90, 0.15);
  color: var(--cu);
}
/* Light — sliders */
[data-theme='light'] input[type='range'] {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme='light'] input[type='range']::-webkit-slider-thumb {
  border-color: #fff;
}
/* Light — hdr tags */
[data-theme='light'] .hdr-tag {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--t2);
}
[data-theme='light'] .hdr-ver {
  background: rgba(184, 135, 90, 0.06);
  border-color: rgba(184, 135, 90, 0.12);
}
/* Light — popups 3D */
[data-theme='light'] .popup3d .maplibregl-popup-content {
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--tx) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Scrollbar — global (carte légendes, panneaux secondaires) : discret */
::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cu);
}

/* Sprint 42 (M18, 2026-05-16) — Scrollbar visible sur la sidebar #S (390 px de
   contenu dense, ~3× la hauteur visible). Le scrollbar 3 px global était invisible
   sur fond sombre → user pensait que l'onglet Terrain était "tronqué". Cuivre
   discret + 8 px de largeur = clair sans dénaturer le design. */
#S {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 165, 116, 0.35) transparent;
}
#S::-webkit-scrollbar {
  width: 8px;
}
#S::-webkit-scrollbar-thumb {
  background: rgba(212, 165, 116, 0.28);
  border-radius: 4px;
  border: 1px solid rgba(212, 165, 116, 0.1);
}
#S::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 165, 116, 0.55);
}

/* HEADER */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 48px;
  background: rgba(30, 30, 34, 0.95);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 200;
}
header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 165, 116, 0.2), transparent);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-i {
  width: 32px;
  height: 32px;
  background: linear-gradient(145deg, var(--cu), var(--cu-d));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  font-family: var(--m);
  color: #000;
  box-shadow: 0 0 16px rgba(212, 165, 116, 0.25);
  will-change: transform;
}
.logo h1 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--f-d);
  background: linear-gradient(135deg, var(--cu-l), var(--cu));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo span {
  font-size: 8px;
  color: var(--t3);
  font-weight: 500;
  display: block;
  margin-top: 1px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* ═══ Navigation inter-modules ═══ */
.madior-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.madior-nav-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--t2);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.2s var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.madior-nav-item:hover {
  background: rgba(212, 165, 116, 0.08);
  color: var(--cu-l);
}
.madior-nav-item.active {
  background: rgba(212, 165, 116, 0.12);
  color: var(--cu);
  box-shadow: 0 0 12px rgba(212, 165, 116, 0.1);
}
.madior-nav-icon {
  font-size: 13px;
}
.madior-nav-label {
  font-size: 9px;
}
@media (max-width: 1100px) {
  .madior-nav-label {
    display: none;
  }
  .madior-nav-item {
    padding: 5px 8px;
  }
}

/* ═══ Modales (calculs, attestations) ═══ */
.madior-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.madior-modal {
  background: var(--c1);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--sh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.madior-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(212, 165, 116, 0.04);
}
.madior-modal-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--cu-l);
  letter-spacing: 0.04em;
}
.madior-modal-header button {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  font-size: 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.madior-modal-header button:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--er);
}
.madior-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 70vh;
  font-size: 12px;
  line-height: 1.6;
  color: var(--tx);
}
.madior-modal-body h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 16px 0 8px;
  color: var(--cu-l);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.madior-modal-body .att-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.madior-modal-body .att-label {
  color: var(--t2);
}
.madior-modal-body .att-value {
  font-weight: 600;
  font-family: var(--m);
  font-size: 11px;
}
.madior-modal-body .att-ok {
  color: var(--ok);
}
.madior-modal-body .att-warn {
  color: var(--wa);
}
.madior-modal-body .att-miss {
  color: var(--er);
}
.madior-modal-body .progress-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}
.madior-modal-body .progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.madior-modal-body .pf-ok {
  background: var(--ok);
}
.madior-modal-body .pf-warn {
  background: var(--wa);
}
.madior-modal-body .pf-low {
  background: var(--er);
}

.hdr-r {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hdr-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 8px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.hdr-ver {
  padding: 3px 10px;
  background: rgba(212, 165, 116, 0.04);
  border: 1px solid rgba(212, 165, 116, 0.1);
  border-radius: 3px;
  font-size: 8px;
  font-weight: 700;
  color: var(--cu);
  font-family: var(--m);
  letter-spacing: 0.12em;
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  margin-right: 3px;
  box-shadow: 0 0 4px rgba(52, 211, 153, 0.4);
  animation: dotPulse 3s ease infinite;
}
@keyframes dotPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* LAYOUT — Cockpit floating sidebar */
#L {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100vh - 34px);
  margin-top: 34px;
  position: relative;
}
/* bottom:32px (et non 8px) — 2026-06-11 : la barre .madior-coords-bar
   (position:absolute;bottom:0;height:24px) occupe les 24 px du bas. Avec
   bottom:8px la sidebar (z-index 1100 > 800) descendait PAR-DESSUS la barre
   → chevauchement visuel en bas. 32px = 24px (barre) + 8px → même respiration
   qu'en haut (top:8px), bas et haut équilibrés, plus de chevauchement. */
#S {
  position: absolute;
  top: 8px;
  left: 8px;
  bottom: 32px;
  width: 390px;
  z-index: 1100;
  background: rgba(38, 38, 44, 0.92);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--sh);
}
main {
  grid-column: 1;
  position: relative;
}
@media (max-width: 900px) {
  #S {
    position: relative;
    top: 0;
    left: 0;
    bottom: auto;
    width: 100%;
    height: 50vh;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--line);
  }
  #L {
    grid-template-rows: 50vh 50vh;
  }
}

/* CARDS — Carbon glass modules */
.cd {
  background: rgba(30, 30, 34, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  padding: 18px;
  box-shadow: var(--inner-sh);
  transition:
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.cd:hover {
  border-color: var(--cu);
  transform: translateY(-1px);
}
.cd.cd-accent {
  border-color: rgba(212, 165, 116, 0.25);
}
.cd.cd-info {
  border-color: rgba(96, 165, 250, 0.2);
}
.cd.cd-ok {
  border-color: rgba(52, 211, 153, 0.2);
}
.ch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ct {
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t2);
}
.cb {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(212, 165, 116, 0.05);
  color: var(--cu);
  border: 1px solid rgba(212, 165, 116, 0.12);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--m);
}
.cb-info {
  background: var(--in-b);
  color: var(--in);
  border-color: rgba(96, 165, 250, 0.15);
}
.cb-ok {
  background: var(--ok-b);
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.15);
}

/* INPUTS — Precision instruments */
.ig {
  position: relative;
}
.si {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--tx);
  font-size: 12px;
  font-family: var(--f);
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.si:focus {
  border-color: var(--cu);
}
.si::placeholder {
  color: var(--t3);
}
.si-i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  pointer-events: none;
}
.si.si-mono {
  font-family: var(--m);
  font-variant-numeric: tabular-nums slashed-zero;
}
.si.si-bare {
  padding-left: 10px;
}
.si.si-sm {
  width: 60px;
  padding: 6px 8px;
  text-align: center;
  font-family: var(--m);
  font-variant-numeric: tabular-nums;
}

.sg {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(38, 38, 44, 0.98);
  backdrop-filter: var(--glass-l);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh);
  display: none;
}
.sg-i {
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.sg-i:last-child {
  border-bottom: none;
}
.sg-i:hover,
.sg-i.act {
  background: rgba(212, 165, 116, 0.05);
}
.sg-l {
  font-size: 12px;
  color: var(--tx);
}
.sg-c {
  font-size: 10px;
  color: var(--t3);
  margin-top: 2px;
}

/* BUTTONS — Tactile switches */
.bt {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 9px;
  font-weight: 700;
  font-family: var(--f);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.15s,
    background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.bt-p {
  background: linear-gradient(180deg, #f0f0f0, #d8d8d8);
  color: #080808;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.bt-p:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.bt-p:active {
  transform: translateY(0);
  background: #ccc;
}
.bt-g {
  background: rgba(255, 255, 255, 0.02);
  color: var(--t2);
}
.bt-g:hover {
  border-color: var(--cu);
  color: var(--cu);
}
.bt-s {
  padding: 4px 8px;
  font-size: 8px;
}
.bt-act {
  background: var(--cu-g) !important;
  color: var(--cu) !important;
  border-color: rgba(212, 165, 116, 0.2) !important;
}
.bt-full {
  width: 100%;
  justify-content: center;
}
.bt-flex {
  flex: 1;
  justify-content: center;
}

/* BADGES */
.rb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.bd-h {
  background: var(--er-b);
  color: var(--er);
  border: 1px solid rgba(248, 113, 113, 0.1);
}
.bd-m {
  background: var(--wa-b);
  color: var(--wa);
  border: 1px solid rgba(251, 191, 36, 0.1);
}
.bd-l {
  background: var(--ok-b);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.1);
}
/* 2026-06-12 — badge « À déterminer » : la donnée réglementaire (zone
   sismique / aléa argiles) n'a pas été chargée (analyse ⚙ coupée ou non
   encore fetchée). N'affirme NI requise NI non-requise. Orange neutre. */
.bd-w {
  background: rgba(212, 165, 116, 0.12);
  color: #d4a574;
  border: 1px solid rgba(212, 165, 116, 0.3);
}
.bd-i {
  background: var(--in-b);
  color: var(--in);
  border: 1px solid rgba(96, 165, 250, 0.1);
}
.bd-p {
  background: var(--cu-g);
  color: var(--cu);
  border: 1px solid rgba(212, 165, 116, 0.1);
}

/* DATA */
.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 12px;
  font-size: 11px;
}
.kk {
  color: var(--t3);
  font-weight: 500;
}
.kv-v {
  color: var(--tx);
  font-family: var(--m);
  font-variant-numeric: tabular-nums;
}

/* EC BOXES — Precision dials */
.ec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.ec-box {
  background: rgba(30, 30, 34, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 8px;
  text-align: center;
  transition:
    border-color 0.2s,
    transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ec-box:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.ec-ico {
  font-size: 22px;
  margin-bottom: 4px;
}
.ec-lbl {
  font-size: 7px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 4px;
  font-weight: 700;
}
.ec-val {
  font-size: 15px;
  font-weight: 500;
  color: var(--tx);
  font-family: var(--m);
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: -0.02em;
}
.ec-sub {
  font-size: 8px;
  color: var(--t3);
  margin-top: 3px;
  font-family: var(--m);
}

/* Détail neige — panneau sous les cases EC1 (index) */
.ec-neige-detail {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  font-size: 11px;
  line-height: 1.45;
}
.ec-neige-lead {
  margin: 0 0 8px;
  color: var(--t2);
  font-size: 11px;
}
.ec-neige-zone {
  color: var(--cu-l);
  font-size: 14px;
}
.ec-neige-dep {
  color: var(--t3);
  font-weight: 400;
}
.ec-neige-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  margin: 0;
}
.ec-neige-dl dt {
  margin: 6px 0 0;
  color: var(--t3);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ec-neige-dl dd {
  margin: 0;
  font-family: var(--m);
  font-size: 12px;
  color: var(--tx);
  font-variant-numeric: tabular-nums;
}
.ec-neige-dl .ec-neige-sk {
  margin-top: 8px;
}
.ec-neige-sk-val {
  font-size: 14px !important;
  font-weight: 600;
  color: var(--cu-l) !important;
}
.ec-neige-hint {
  color: var(--t3);
  font-size: 9px;
  font-family: var(--f);
  font-weight: 400;
}
.ec-neige-note {
  margin: 10px 0 0;
  font-size: 10px;
  color: var(--t2);
}
.ec-neige-note code {
  font-family: var(--m);
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.2);
}
.ec-neige-legal {
  margin: 10px 0 0;
  font-size: 9px;
  color: var(--t3);
  line-height: 1.4;
}
.ec-neige-standalone-link {
  color: var(--cu);
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
}
.ec-neige-standalone-link:hover {
  text-decoration: underline;
}
[data-theme='light'] .ec-neige-note code {
  background: rgba(0, 0, 0, 0.06);
}

.alt-bar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}
.alt-val {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--m);
  background: linear-gradient(135deg, var(--cu-l), var(--cu));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.alt-unit {
  font-size: 12px;
  color: var(--t3);
  font-weight: 400;
}

/* LAYERS — v3 horizontal band */
/* ── Climatique layer toggles (harmonisés avec Géorisques ly-band) ── */
.rp-ly {
  gap: 4px !important;
  font-size: 9px;
}
.rp-ly .rp-icon {
  display: none;
}
.rp-ly-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.rp-ly span:last-child {
  font-size: 9px;
}
.rp-ly.rp-toggle:has(input:checked) .rp-ly-dot {
  box-shadow: 0 0 5px currentColor;
}
.rp-ly input[type='checkbox'] {
  display: none;
}

.ly-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t3);
  white-space: nowrap;
  padding: 2px 6px;
  user-select: none;
}
.ly-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.ly-band {
  gap: 4px !important;
}
.ly-band .rp-icon {
  font-size: 8px;
  line-height: 1;
}
.ly-band span:last-child {
  font-size: 9px;
}
.ly-band.act {
  background: rgba(212, 165, 116, 0.1);
  border-color: rgba(212, 165, 116, 0.25);
}
.ly-band.act .rp-icon {
  opacity: 1;
}
.ly-band input[type='checkbox'] {
  display: none;
}

/* Filter wrap */
.rp-filter-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.rp-filter-wrap .rp-filter {
  padding-right: 18px;
}
.rp-filter-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--t3);
  font-size: 12px;
  cursor: pointer;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
}
.rp-filter-clear:hover {
  color: var(--tx);
  background: rgba(255, 255, 255, 0.1);
}

.ri {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--r);
  margin-bottom: 3px;
  font-size: 11px;
  transition: all 0.15s;
}
.ri:hover {
  border-color: #222;
}
.ri a {
  color: var(--cu);
  text-decoration: none;
  font-weight: 600;
}
.ri a:hover {
  text-decoration: underline;
}
.ri-c {
  font-size: 8px;
  color: var(--t3);
  font-family: var(--m);
}

/* RISK */
.rk {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 5px;
  border-left: 2px solid var(--wa);
  transition: background 0.15s;
}
.rk:hover {
  background: rgba(255, 255, 255, 0.02);
}
.rk h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rk-d {
  font-size: 10px;
  color: var(--t2);
  line-height: 1.5;
}

/* HINTS */
.ht {
  font-size: 10px;
  color: var(--t3);
  line-height: 1.5;
}
.ht code {
  font-family: var(--m);
  font-size: 9px;
  color: var(--cu);
  background: rgba(212, 165, 116, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(212, 165, 116, 0.08);
}
.mt-sm {
  margin-top: 6px;
}
.mt-md {
  margin-top: 8px;
}
.mt-lg {
  margin-top: 12px;
}

/* SPINNER */
.sp {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--cu);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--cu, #4f8cff);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.emp {
  text-align: center;
  padding: 14px;
  color: var(--t3);
  font-size: 11px;
}

/* BSS */
.bss-item {
  padding: 8px 12px;
  border-left: 2px solid var(--cu-d);
  margin-bottom: 4px;
  background: transparent;
  border-radius: 0 var(--r) var(--r) 0;
  cursor: pointer;
  transition: background 0.15s;
}
.bss-item:hover {
  background: rgba(212, 165, 116, 0.04);
}
.bss-item h5 {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--tx);
}
.bss-item .bss-d {
  font-size: 9px;
  color: var(--t3);
  margin-top: 1px;
}
.bss-item .bss-link {
  font-size: 8px;
  color: var(--cu);
  margin-top: 2px;
  display: inline-block;
}

/* TABS — Segment control */
/* Sprint 42 (M18, 2026-05-16) — Fond .tab-nav passé à 0.96 alpha + backdrop-filter
   pour éviter que le contenu scrollé en dessous transparaisse à travers la barre
   d'onglets sticky (zIndex 10 mais alpha 0.6 → texte des cards visible AU-DESSUS
   du tab "TERRAIN" lors du scroll). Le sticky est conservé pour navigation rapide. */
.tab-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 2px;
  background: rgba(30, 30, 34, 0.96);
  backdrop-filter: var(--glass-l);
  border: 1px solid var(--line);
  border-radius: var(--r);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}
.tab-btn {
  padding: 6px 2px;
  border: none;
  background: transparent;
  color: var(--t3);
  font-size: 8px;
  font-weight: 700;
  font-family: var(--f);
  border-radius: 4px;
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.tab-btn:hover {
  color: var(--tx);
  background: rgba(255, 255, 255, 0.03);
}
.tab-btn.act {
  background: rgba(212, 165, 116, 0.06);
  color: var(--cu);
  border: 1px solid rgba(212, 165, 116, 0.1);
}
.tab-btn.has-data::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ok);
  margin-left: 3px;
  vertical-align: middle;
}
.tab-btn {
  cursor: grab;
  user-select: none;
}
.tab-btn.tab-dragging {
  opacity: 0.85;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  cursor: grabbing;
  border-radius: 4px;
  background: rgba(212, 165, 116, 0.12);
  color: var(--cu);
  border: 1px solid rgba(212, 165, 116, 0.2);
}
.tab-placeholder {
  border: 1px dashed rgba(212, 165, 116, 0.3);
  border-radius: 4px;
  flex-shrink: 0;
  background: rgba(212, 165, 116, 0.03);
}
.tab-pane {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.tab-pane.act {
  display: flex;
  animation: fadeIn 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.emp-tab {
  text-align: center;
  padding: 48px 20px;
  color: var(--t3);
  font-size: 11px;
  line-height: 1.7;
}
.emp-tab-title {
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 2px;
  font-size: 12px;
}

/* Collapse */
.cd-collapse .cd-body {
  display: none;
}
.cd-toggle {
  cursor: pointer;
  user-select: none;
}
.cd-toggle::after {
  content: '▾';
  float: right;
  font-size: 9px;
  color: var(--t3);
  transition: transform 0.2s;
}
.cd-collapse .cd-toggle::after {
  content: '▸';
}

/* MAP */
#mapWrap {
  position: absolute;
  inset: 0;
}
#map2d,
#map3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
}
#map3d {
  display: none;
}
.leaflet-popup-content-wrapper {
  background: rgba(38, 38, 44, 0.97) !important;
  backdrop-filter: var(--glass-l) !important;
  color: var(--tx) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--sh) !important;
  font-family: var(--f) !important;
  font-size: 11px !important;
}
.leaflet-popup-tip {
  background: rgba(38, 38, 44, 0.96) !important;
  border: 1px solid var(--line) !important;
}
.leaflet-popup-close-button {
  color: var(--t3) !important;
}
.vent-tooltip .leaflet-tooltip-content-wrapper,
.vent-tooltip {
  background: rgba(38, 38, 44, 0.97) !important;
  backdrop-filter: var(--glass-l) !important;
  color: var(--tx) !important;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  box-shadow: var(--sh) !important;
  font-family: var(--f) !important;
  padding: 8px 10px !important;
}
.vent-tooltip::before {
  border-right-color: rgba(38, 38, 44, 0.96) !important;
}

/* Leaflet controls override — minimal black */
.leaflet-control-zoom,
.leaflet-control-attribution {
  display: none !important;
}
.leaflet-bar a {
  background: rgba(38, 38, 44, 0.9) !important;
  color: var(--t2) !important;
  border: 1px solid var(--line) !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  font-size: 14px !important;
}
.leaflet-bar a:hover {
  background: rgba(46, 46, 52, 0.95) !important;
  color: var(--cu) !important;
}

/* ═══ MAP RIBBON — AutoCAD-style tabbed ribbon ═══ */
.ribbon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  overflow: visible;
}

/* ── Tab header bar ── */
.ribbon-tabs {
  display: flex;
  align-items: center;
  height: 34px;
  background: rgba(30, 30, 34, 0.96);
  backdrop-filter: var(--glass-l);
  border-bottom: 1px solid var(--line);
  padding: 0 10px;
  gap: 0;
  position: relative;
  z-index: 10;
}
/* ── Ribbon inline logo ── */
a.ribbon-logo,
.ribbon-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 10px;
  flex-shrink: 0;
  width: 390px;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
}
.ribbon-logo .logo-i {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--cu), var(--cu-d));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  font-family: var(--f-d);
}
.ribbon-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
/* Logo ruban : 01_LOGOS/MADIOR/madior.jpg — plus large que madior-nav.png */
.ribbon-logo-img--madior {
  height: 34px;
  width: auto;
  max-width: 120px;
  max-height: 40px;
}
.ribbon-logo-txt {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--f-d);
  color: var(--tx);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ribbon-tab {
  background: none;
  border: none;
  color: var(--t3);
  font-size: 9px;
  font-weight: 700;
  font-family: var(--f);
  cursor: pointer;
  padding: 0 14px;
  height: 100%;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.12s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.ribbon-tab:hover {
  color: var(--t1);
  background: rgba(255, 255, 255, 0.03);
}
.ribbon-tab.act {
  color: var(--cu);
  border-bottom-color: var(--cu);
  background: rgba(212, 165, 116, 0.06);
}
/* Opacity slider pushed to right */
.ribbon-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
}
.ribbon-opa-label {
  font-size: 8px;
  color: var(--t3);
  font-weight: 600;
  white-space: nowrap;
}
.ribbon-range {
  width: 80px;
  height: 3px;
  accent-color: var(--cu);
}
/* ── Ribbon inline elements (moved from header) ── */
.ribbon-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 8px;
  flex-shrink: 0;
}
.ribbon-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--t2);
}
.ribbon-user .user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ribbon-user #logoutBtn {
  font-size: 10px;
  padding: 2px 6px;
  min-width: auto;
  line-height: 1;
}
.ribbon-user-cluster {
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}
.madior-account-root {
  position: relative;
  display: flex;
  align-items: center;
  max-width: min(380px, 42vw);
}
.neo-mode-badge {
  display: flex;
  align-items: center;
  max-width: 92px;
  flex-shrink: 0;
}
.ribbon-user-sep {
  width: 1px;
  height: 14px;
  background: var(--line);
  opacity: 0.55;
  flex-shrink: 0;
}
.madior-account-wrap {
  position: relative;
}
.madior-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--t1);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--f);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.madior-account-btn--large {
  gap: 10px;
  padding: 5px 12px 5px 10px;
  border-radius: 8px;
  min-height: 30px;
  align-items: center;
}
.madior-account-btn:hover {
  background: rgba(212, 165, 116, 0.12);
  border-color: rgba(212, 165, 116, 0.35);
}
.madior-account-btn--guest {
  opacity: 0.95;
}
.madior-account-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 1px;
  text-align: left;
}
.madior-account-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--t3);
  line-height: 1.2;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.madior-account-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.22);
}
.madior-account-dot--off {
  background: var(--t3);
  box-shadow: none;
}
.madior-account-avatar {
  border-radius: 50%;
  background: rgba(212, 165, 116, 0.22);
  color: var(--cu);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.madior-account-avatar--ribbon {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.madior-account-avatar--hero {
  width: 52px;
  height: 52px;
  font-size: 18px;
  border: 2px solid rgba(212, 165, 116, 0.35);
}
.madior-account-avatar--guest-ico {
  background: rgba(255, 255, 255, 0.06);
  font-size: 17px;
  line-height: 1;
}
.madior-account-photo {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(212, 165, 116, 0.35);
  background: rgba(30, 30, 34, 0.9);
}
.madior-account-photo.madior-account-avatar--ribbon {
  width: 32px;
  height: 32px;
}
.madior-account-photo.madior-account-avatar--hero {
  width: 52px;
  height: 52px;
}
.madior-account-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 260px;
  font-size: 11px;
  font-weight: 700;
}
.madior-account-chev {
  opacity: 0.45;
  font-size: 9px;
  flex-shrink: 0;
  line-height: 1;
  margin-left: 2px;
}
/* position/top/right souvent imposés en JS (fixed, premier plan) ; repli ci-dessous */
.madior-account-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12000;
  min-width: 280px;
  max-width: min(380px, 94vw);
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(22, 22, 26, 0.98);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.madior-account-popover--rich {
  min-width: 300px;
}
.madior-account-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(212, 165, 116, 0.04);
}
.madior-account-hero--guest {
  background: rgba(255, 255, 255, 0.02);
}
.madior-account-hero-text {
  min-width: 0;
  flex: 1;
}
.madior-account-hero-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.25;
}
.madior-account-hero-email {
  font-size: 12px;
  color: var(--t2);
  margin-top: 4px;
  word-break: break-all;
}
.madior-account-pill {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--t3);
  background: rgba(0, 0, 0, 0.15);
}
.madior-account-pill--ok {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}
.madior-account-pop-lead {
  margin: 0;
  padding: 14px 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--t2);
  border-bottom: 1px solid var(--line);
}
.madior-account-section {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.madior-account-section:last-of-type {
  border-bottom: none;
}
.madior-account-section--muted {
  background: rgba(0, 0, 0, 0.12);
}
.madior-account-sec-title {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cu);
  margin-bottom: 10px;
}
.madior-account-proj-card {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
.madior-account-proj-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 8px;
}
.madior-account-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 11px;
  color: var(--t2);
}
.madior-account-dl dt {
  color: var(--t3);
  font-weight: 600;
  margin: 0;
}
.madior-account-dl dd {
  margin: 0;
  font-weight: 500;
}
.madior-account-proj-empty {
  margin: 0;
  font-size: 11px;
  color: var(--t3);
  line-height: 1.45;
}
.madior-account-loc-txt {
  margin: 0;
  font-size: 11px;
  color: var(--t2);
  line-height: 1.45;
}
.madior-account-hint {
  margin: 0 0 12px;
  font-size: 10px;
  color: var(--t3);
  line-height: 1.45;
}
.madior-account-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.madior-account-pop-link {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--cu);
  text-decoration: none;
}
.madior-account-pop-link:hover {
  text-decoration: underline;
}
.madior-account-pop-link--tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}
.madior-account-pop-link--tile:hover {
  border-color: rgba(212, 165, 116, 0.4);
  background: rgba(212, 165, 116, 0.08);
  text-decoration: none;
}
.madior-account-tile-ico {
  font-size: 20px;
  line-height: 1;
}
.madior-account-pop-link--primary {
  padding: 11px 14px;
  text-align: center;
  border-radius: 8px;
  margin: 0 18px 10px;
  background: rgba(212, 165, 116, 0.16);
  border: 1px solid rgba(212, 165, 116, 0.38);
  font-size: 12px;
  font-weight: 700;
}
.madior-account-pop-link--primary:hover {
  text-decoration: none;
  background: rgba(212, 165, 116, 0.24);
}
.madior-account-pop-link--block {
  display: block;
}
.madior-account-pop-link--tile-wide {
  margin: 0 18px 16px;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
}
.madior-account-benefits {
  margin: 0 18px 14px;
  padding-left: 20px;
  font-size: 11px;
  color: var(--t2);
  line-height: 1.55;
}
.madior-account-logout {
  margin: 4px 18px 18px;
  width: calc(100% - 36px);
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--f);
}
.madior-account-logout:hover {
  background: rgba(248, 113, 113, 0.15);
}
.madior-account-section--profile {
  background: rgba(212, 165, 116, 0.05);
}
.madior-account-section--menu {
  padding-bottom: 16px;
}
.madior-account-section--compact {
  padding-top: 10px;
  padding-bottom: 14px;
}
.madior-account-hint--tight {
  margin: 0 0 10px;
}
.madior-account-profile-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  font-size: 11px;
}
.madior-account-profile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}
.madior-account-profile-k {
  flex: 0 0 auto;
  color: var(--t3);
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.madior-account-profile-v {
  color: var(--t1);
  word-break: break-all;
  font-weight: 500;
}
.madior-account-ver {
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
}
.madior-account-ver--ok {
  color: #6ee7b7;
}
.madior-account-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.madior-account-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: inherit;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.madior-account-menu-item:hover {
  background: rgba(212, 165, 116, 0.1);
  border-color: rgba(212, 165, 116, 0.25);
  text-decoration: none;
}
.madior-account-menu-ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}
.madior-account-menu-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.madior-account-menu-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--t1);
}
.madior-account-menu-desc {
  font-size: 10px;
  color: var(--t3);
  line-height: 1.35;
}
.madior-account-menu-chev {
  flex-shrink: 0;
  opacity: 0.35;
  font-size: 14px;
  line-height: 1;
  margin-top: 2px;
}
.madior-account-menu--guest .madior-account-menu-item {
  opacity: 0.92;
}
.madior-account-portal-link {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--cu);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
}
.madior-account-portal-link:hover {
  text-decoration: underline;
  background: rgba(212, 165, 116, 0.08);
}
[data-theme='light'] .madior-account-popover {
  background: rgba(252, 252, 254, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
[data-theme='light'] .madior-account-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}
[data-theme='light'] .madior-account-section--muted {
  background: rgba(0, 0, 0, 0.03);
}
[data-theme='light'] .madior-account-proj-card {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme='light'] .madior-account-hero {
  background: rgba(212, 165, 116, 0.08);
}
[data-theme='light'] .madior-account-section--profile {
  background: rgba(212, 165, 116, 0.06);
}
[data-theme='light'] .madior-account-profile-card {
  background: rgba(0, 0, 0, 0.03);
}
[data-theme='light'] .madior-account-menu-item {
  background: rgba(0, 0, 0, 0.02);
}
[data-theme='light'] .madior-account-menu-ico {
  background: rgba(0, 0, 0, 0.06);
}
.ribbon-link {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--f);
  color: var(--cu);
  text-decoration: none;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  letter-spacing: 0.05em;
  transition: all 0.15s;
  border-radius: 4px;
}
.ribbon-link:hover {
  background: rgba(212, 165, 116, 0.1);
  color: var(--cu-l);
}
/* Sprint 42 (M14, 2026-05-16) — état gelé (module pas encore live) :
   l'icône reste visible mais opacity réduite + cursor not-allowed + click bloqué.
   Le hover ne déclenche pas le background pour signaler clairement l'état désactivé.
   Sprint 42 (M16) : ajout .cd.is-frozen pour les cartes entières (ex: Structure dans Export). */
.ribbon-link.is-frozen,
.bt.is-frozen {
  opacity: 0.4;
  cursor: not-allowed !important;
  filter: saturate(0.6);
}
.ribbon-link.is-frozen:hover,
.bt.is-frozen:hover {
  background: transparent !important;
  opacity: 0.45;
}
.cd.is-frozen {
  opacity: 0.55;
  filter: saturate(0.7);
  position: relative;
  transition: opacity 0.15s;
}
.cd.is-frozen:hover {
  opacity: 0.7;
}
.cd.is-frozen .bt[disabled] {
  cursor: not-allowed !important;
  pointer-events: none;
}
.badge-soon {
  display: inline-flex;
  align-items: center;
  height: 14px;
  padding: 0 5px;
  margin-left: 5px;
  font: 700 7px/1 var(--f);
  letter-spacing: 0.08em;
  color: var(--cu);
  background: rgba(212, 165, 116, 0.15);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 3px;
  text-transform: uppercase;
}

/* ── Suite MADIOR dropdown (Sprint 42 M15) ──
   Remplace les 5 icônes modules (Structure/Center/Géotech/Diagnostic/Thermique)
   par un seul bouton + menu déroulant. Économise l'espace ribbon (5×120px → 130px)
   et présente l'écosystème complet d'un coup d'œil. */
.suite-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}
.suite-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font: 700 9px/1 var(--f);
  letter-spacing: 0.05em;
  color: var(--cu);
  padding: 0 10px;
  height: 100%;
  border-radius: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}
.suite-toggle:hover {
  background: rgba(212, 165, 116, 0.1);
  color: var(--cu-l);
}
.suite-toggle[aria-expanded='true'] {
  background: rgba(212, 165, 116, 0.15);
  color: var(--cu-l);
}
.suite-toggle-icon {
  font-size: 12px;
  opacity: 0.9;
}
.suite-toggle-arrow {
  font-size: 9px;
  opacity: 0.7;
  transition: transform 0.2s;
}
.suite-toggle[aria-expanded='true'] .suite-toggle-arrow {
  transform: rotate(180deg);
}

.suite-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 300px;
  z-index: 1050;
  background: rgba(28, 28, 32, 0.98);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  animation: suite-menu-in 0.15s ease-out;
}
@keyframes suite-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.suite-menu[hidden] {
  display: none;
}
.suite-menu-header {
  font: 700 8px/1 var(--f);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--t3);
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.suite-menu-footer {
  font: 400 9px/1.4 var(--f);
  color: var(--t3);
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  text-align: center;
}
.suite-menu-footer strong {
  color: var(--cu);
  font-weight: 700;
}

.suite-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--tx);
  font: 500 11px/1.3 var(--f);
  transition: background 0.12s;
}
.suite-item:hover:not(.is-frozen) {
  background: rgba(212, 165, 116, 0.08);
}
.suite-item.is-frozen {
  cursor: not-allowed;
}
.suite-item.is-frozen:hover {
  background: rgba(255, 255, 255, 0.02);
}
.suite-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.suite-item.is-frozen .suite-icon {
  filter: saturate(0.4);
}
.suite-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.suite-name {
  font-weight: 600;
  color: var(--tx);
  letter-spacing: 0.02em;
}
.suite-item.is-frozen .suite-name {
  color: var(--t2);
}
.suite-desc {
  font-size: 9px;
  color: var(--t3);
  line-height: 1.2;
}
.suite-item .badge-soon {
  margin-left: auto;
}

[data-theme='light'] .suite-menu {
  background: rgba(255, 255, 255, 0.98);
}
[data-theme='light'] .suite-toggle {
  color: var(--cu-d);
}
[data-theme='light'] .suite-toggle:hover {
  background: rgba(184, 135, 90, 0.1);
}
[data-theme='light'] .suite-item:hover:not(.is-frozen) {
  background: rgba(184, 135, 90, 0.08);
}
[data-theme='light'] .suite-item.is-frozen:hover {
  background: rgba(0, 0, 0, 0.02);
}
.ribbon-badge {
  font-size: 8px;
  font-weight: 600;
  font-family: var(--f);
  color: var(--t3);
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.ribbon-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cu);
  display: inline-block;
}
[data-theme='light'] .ribbon-logo-txt {
  color: var(--tx);
}
[data-theme='light'] .ribbon-sep {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme='light'] .ribbon-link {
  color: var(--cu);
}
[data-theme='light'] .ribbon-link:hover {
  background: rgba(184, 135, 90, 0.1);
}
[data-theme='light'] .ribbon-badge {
  color: var(--t3);
}

/* ── Ribbon panel (full-width, horizontal) ── */
.ribbon-panel {
  display: none;
  background: rgba(30, 30, 34, 0.94);
  backdrop-filter: var(--glass-l);
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-left: 408px;
  position: relative;
  z-index: 1;
  animation: ribbonSlide 0.12s var(--ease);
}
.ribbon-panel.act {
  display: block;
}
@keyframes ribbonSlide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Group row inside panel (horizontal flex) ── */
.rp-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ── Toggle button: icon + text (checkbox hidden) ── */
.rp-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  color: var(--t2);
  transition: all 0.12s;
  white-space: nowrap;
  user-select: none;
}
.rp-toggle:hover {
  background: rgba(212, 165, 116, 0.08);
  color: var(--t1);
}
.rp-toggle input[type='checkbox'] {
  display: none;
}
.rp-toggle input[type='checkbox']:checked ~ span {
  color: var(--cu);
}
.rp-toggle input[type='checkbox']:checked ~ .rp-icon {
  filter: drop-shadow(0 0 4px rgba(212, 165, 116, 0.5));
}
.rp-toggle:has(input:checked) {
  background: rgba(212, 165, 116, 0.12);
  box-shadow: inset 0 -2px 0 var(--cu);
}
.rp-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Radio button group (fond de carte) ── */
.rp-radio {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  color: var(--t2);
  transition: all 0.12s;
  white-space: nowrap;
  user-select: none;
}
.rp-radio:hover {
  background: rgba(212, 165, 116, 0.08);
  color: var(--t1);
}
.rp-radio input[type='radio'] {
  display: none;
}
.rp-radio:has(input:checked) {
  background: rgba(212, 165, 116, 0.14);
  color: var(--cu);
  box-shadow: inset 0 -2px 0 var(--cu);
}

/* ── Separator ── */
.rp-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  flex-shrink: 0;
  margin: 0 6px;
}

/* ── Inline field (altitude) ── */
.rp-field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rp-field-label {
  font-size: 9px;
  color: var(--t3);
  font-weight: 600;
  white-space: nowrap;
}
.rp-num-input {
  width: 56px;
  padding: 3px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #fff;
  font-size: 10px;
  font-family: var(--m);
  outline: none;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.rp-num-input:focus {
  border-color: var(--cu);
}

/* ── WMS section inside Couches panel ── */
.rp-wms-section {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.rp-wms-title {
  font-size: 8px;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.rp-filter {
  width: 100px;
  padding: 3px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--tx);
  font-size: 9px;
  font-family: var(--m);
  outline: none;
}
.rp-filter:focus {
  border-color: var(--cu);
}
.rp-wms-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin-top: 4px;
  padding: 2px 0;
}
.rp-wms-list--fond {
  margin-top: 0;
  padding: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px 4px;
}
.rp-fond-geol {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

/* Badge count */
.tb-badge {
  display: inline-block;
  background: var(--cu);
  color: #000;
  font-size: 7px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 2px;
  vertical-align: middle;
  min-width: 12px;
  text-align: center;
}

/* ── Keep ctrl-row for WMS list items ── */
.ctrl-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s;
}
.ctrl-row:hover {
  color: var(--cu-l);
}
.ctrl-row input[type='radio'],
.ctrl-row input[type='checkbox'] {
  accent-color: var(--cu);
  width: 12px;
  height: 12px;
}
.ctrl-row label {
  cursor: pointer;
  flex: 1;
  font-weight: 500;
}
.ctrl-sep {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin: 5px 0;
  padding-top: 5px;
}
.ctrl-label {
  font-size: 9px;
  color: var(--t3);
  font-weight: 500;
}
.ctrl-input {
  width: 64px;
  padding: 3px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--tx);
  font-size: 10px;
  font-family: var(--m);
  outline: none;
  font-variant-numeric: tabular-nums;
}
.ctrl-input:focus {
  border-color: var(--cu);
}

/* 3D/2D toggle (ribbon inline) */
.rp-mode-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin-right: 2px;
}
/* Legacy .mode-toggle removed from DOM — kept as fallback */
.mode-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1002;
  display: flex;
  background: rgba(38, 38, 44, 0.88);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh);
}
.mode-btn {
  padding: 7px 16px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--f);
  cursor: pointer;
  border: none;
  color: var(--t3);
  background: transparent;
  transition: all 0.15s;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mode-btn.act {
  background: rgba(212, 165, 116, 0.06);
  color: var(--cu);
}
.mode-btn:hover:not(.act) {
  background: rgba(255, 255, 255, 0.02);
}

/* Measurement tooltips */
.measure-tip {
  background: rgba(38, 38, 44, 0.92) !important;
  color: var(--cu) !important;
  border: 1px solid var(--line) !important;
  border-radius: 3px !important;
  padding: 2px 6px !important;
  font-family: var(--m) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  white-space: nowrap;
}
.measure-tip::before {
  border-right-color: rgba(38, 38, 44, 0.92) !important;
}

/* Mode-aware visibility — ribbon */
.ribbon[data-mode='2d'] .m3d {
  display: none !important;
}
.ribbon[data-mode='3d'] .m2d {
  display: none !important;
}

/* 3D Marker */
.marker3d-wrap {
  position: relative;
  width: 28px;
  height: 40px;
  cursor: pointer;
  will-change: transform;
}
.marker3d-dot {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: var(--cu);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(212, 165, 116, 0.5);
  z-index: 2;
}
.marker3d-pulse {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: rgba(212, 165, 116, 0.15);
  border-radius: 50%;
  animation: pulse3d 2s ease-out infinite;
  z-index: 1;
}
.marker3d-spike {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 10px solid var(--cu);
  z-index: 3;
}
@keyframes pulse3d {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: 0.5;
  }
  100% {
    transform: translateX(-50%) scale(2.5);
    opacity: 0;
  }
}

/* 3D Popup */
.popup3d .maplibregl-popup-content {
  background: rgba(38, 38, 44, 0.96) !important;
  backdrop-filter: var(--glass) !important;
  color: var(--tx) !important;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  box-shadow: var(--sh) !important;
  padding: 8px 12px !important;
  font-family: var(--f) !important;
}
.popup3d .maplibregl-popup-tip {
  border-top-color: rgba(38, 38, 44, 0.96) !important;
}
/* ctrl3d removed — unified panel */

/* Sliders */
input[type='range'] {
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  background: var(--surface-2);
  border-radius: 1px;
  outline: none;
  margin: 5px 0;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--cu);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #000;
}

/* Legend stack container */
#legendStack {
  position: absolute;
  bottom: 16px;
  left: 432px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 165, 116, 0.2) transparent;
}
#legendStack::-webkit-scrollbar {
  width: 3px;
}
#legendStack::-webkit-scrollbar-thumb {
  background: rgba(212, 165, 116, 0.2);
  border-radius: 2px;
}
#legendStack .map-legend {
  pointer-events: auto;
  animation: fadeIn 0.18s ease;
}
@media (max-width: 900px) {
  #legendStack {
    left: 16px;
    bottom: 16px;
    max-width: calc(100vw - 32px);
  }
}

/* Dark mode default — slight boost for overlay visibility on dark tiles */
.leaflet-overlay-pane {
  filter: brightness(1.1) saturate(1.2);
}

/* Light theme — Leaflet tile & overlay adjustments */
[data-theme='light'] .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.98) !important;
  color: #1a1a1e !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme='light'] .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme='light'] .leaflet-bar a {
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--t2) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}
[data-theme='light'] .leaflet-bar a:hover {
  background: rgba(255, 255, 255, 0.98) !important;
  color: var(--cu) !important;
}

/* Light theme WMS layer enhancement */
[data-theme='light'] .leaflet-image-layer {
  opacity: 0.92;
  mix-blend-mode: multiply;
}

/* Map legend */
.map-legend {
  background: rgba(38, 38, 44, 0.95);
  backdrop-filter: var(--glass-l);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  padding: 12px;
  min-width: 220px;
  box-shadow: var(--sh);
}
.map-legend h4 {
  font-size: 8px;
  font-weight: 700;
  color: var(--t2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.leg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
  color: var(--tx);
}
.leg-sw {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.collapse-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.collapse-body.closed {
  max-height: 0 !important;
}

/* Project form */
.pf {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pf-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pf-lbl {
  font-size: 7px;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.pf-in {
  padding: 7px 10px !important;
  font-size: 11px !important;
  background: var(--surface) !important;
}
.pf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pf-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pf-hint {
  font-size: 9px;
  color: var(--t3);
}
select.pf-in {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%234A4A4A' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  padding-right: 24px !important;
}
.flex-row {
  display: flex;
  gap: 8px;
}
.flex-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Synthesis */
.synth-sect {
  margin-bottom: 12px;
}
.synth-sect h5 {
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--t3);
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.synth-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 10px;
}
.synth-k {
  color: var(--t3);
}
.synth-v {
  color: var(--tx);
  font-weight: 600;
  text-align: right;
  font-family: var(--m);
  font-variant-numeric: tabular-nums;
}
.synth-v.ok {
  color: var(--ok);
}
.synth-v.warn {
  color: var(--wa);
}
.synth-v.err {
  color: var(--er);
}

/* Attestations */
.att-item {
  padding: 12px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 5px;
  transition: border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.att-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2px;
}
.att-item.required::before {
  background: linear-gradient(180deg, var(--wa), var(--er));
}
.att-item.not-required::before {
  background: var(--ok);
}
.att-item.required {
  border-left: none;
}
.att-item.not-required {
  border-left: none;
  opacity: 0.55;
}
.att-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.att-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}
.att-t {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx);
}
.att-d {
  font-size: 9px;
  color: var(--t2);
  line-height: 1.5;
}
.att-ref {
  font-size: 8px;
  color: var(--t3);
  font-family: var(--m);
  margin-top: 4px;
}

/* AI Badge */
@keyframes aiPulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(0, 122, 255, 0.04);
  color: var(--ac);
  border: 1px solid rgba(0, 122, 255, 0.1);
}
.ai-badge::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ac);
  box-shadow: 0 0 4px var(--ac);
  animation: aiPulse 1.5s ease infinite;
}

/* Project form separator */
.pf-sep {
  height: 1px;
  background: #1a1a1a;
  margin: 4px 0;
}

/* ── Documents projet ─────────────────────────────────── */
.doc-drop {
  border: 1.5px dashed rgba(212, 165, 116, 0.18);
  border-radius: var(--r);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(212, 165, 116, 0.015);
}
.doc-drop:focus {
  outline: none;
}
.doc-drop:focus-visible {
  outline: 2px solid var(--cu);
  outline-offset: 2px;
}
.doc-drop:hover,
.doc-drop.dragover {
  border-color: var(--cu);
  background: rgba(212, 165, 116, 0.04);
}
.doc-drop.dragover .doc-drop-ico {
  stroke: var(--cu);
  transform: translateY(-2px);
}
.doc-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.doc-drop-ico {
  stroke: var(--t3);
  transition: all 0.2s;
}
.doc-drop-txt {
  font-size: 9.5px;
  color: var(--t2);
}
.doc-drop-link {
  color: var(--cu);
  cursor: pointer;
  pointer-events: auto;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.doc-drop-hint {
  font-size: 7.5px;
  color: var(--t3);
  letter-spacing: 0.04em;
}
.doc-drop-status {
  margin-top: 8px;
  font-size: 8.5px;
  line-height: 1.4;
  text-align: center;
  padding: 6px 10px;
  border-radius: 5px;
  pointer-events: none;
  max-width: 100%;
}
.doc-drop-status--info {
  background: rgba(96, 165, 250, 0.1);
  color: var(--in);
  border: 1px solid rgba(96, 165, 250, 0.2);
}
.doc-drop-status--warn {
  background: rgba(251, 191, 36, 0.1);
  color: var(--wa);
  border: 1px solid rgba(251, 191, 36, 0.22);
}
.doc-drop-status--err {
  background: rgba(248, 113, 113, 0.1);
  color: var(--er);
  border: 1px solid rgba(248, 113, 113, 0.22);
}
.doc-file-input {
  display: none;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.doc-list:empty {
  display: none;
}

.doc-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 5px;
  transition: all 0.15s;
  background: rgba(30, 30, 34, 0.3);
}
.doc-item:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.01);
}

.doc-ico {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--m);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.doc-ico-pdf {
  background: rgba(248, 113, 113, 0.08);
  color: var(--er);
  border: 1px solid rgba(248, 113, 113, 0.15);
}
.doc-ico-dwg {
  background: rgba(96, 165, 250, 0.08);
  color: var(--in);
  border: 1px solid rgba(96, 165, 250, 0.15);
}
.doc-ico-doc {
  background: rgba(96, 165, 250, 0.08);
  color: var(--in);
  border: 1px solid rgba(96, 165, 250, 0.15);
}
.doc-ico-xls {
  background: rgba(52, 211, 153, 0.08);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.15);
}
.doc-ico-img {
  background: rgba(251, 191, 36, 0.08);
  color: var(--wa);
  border: 1px solid rgba(251, 191, 36, 0.15);
}
.doc-ico-zip {
  background: rgba(212, 165, 116, 0.08);
  color: var(--cu);
  border: 1px solid rgba(212, 165, 116, 0.15);
}
.doc-ico-def {
  background: rgba(100, 100, 100, 0.08);
  color: var(--t2);
  border: 1px solid rgba(100, 100, 100, 0.15);
}

.doc-info {
  min-width: 0;
}
.doc-name {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}
.doc-size {
  font-size: 7.5px;
  font-family: var(--m);
  color: var(--t3);
}
.doc-cat {
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.doc-cat-pc {
  background: rgba(248, 113, 113, 0.06);
  color: var(--er);
  border: 1px solid rgba(248, 113, 113, 0.12);
}
.doc-cat-geo {
  background: rgba(251, 191, 36, 0.06);
  color: var(--wa);
  border: 1px solid rgba(251, 191, 36, 0.12);
}
.doc-cat-structure {
  background: rgba(168, 85, 247, 0.06);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.12);
}
.doc-cat-cctp {
  background: rgba(96, 165, 250, 0.06);
  color: var(--in);
  border: 1px solid rgba(96, 165, 250, 0.12);
}
.doc-cat-archi {
  background: rgba(52, 211, 153, 0.06);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.12);
}
.doc-cat-dpgf {
  background: rgba(212, 165, 116, 0.06);
  color: var(--cu);
  border: 1px solid rgba(212, 165, 116, 0.12);
}
.doc-cat-other {
  background: rgba(100, 100, 100, 0.06);
  color: var(--t2);
  border: 1px solid rgba(100, 100, 100, 0.12);
}

.doc-actions {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.12s;
}
.doc-item:hover .doc-actions {
  opacity: 1;
}
.doc-act {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--t3);
  transition: all 0.1s;
}
.doc-act:hover {
  border-color: var(--line);
  color: var(--tx);
  background: rgba(255, 255, 255, 0.02);
}
.doc-act-del:hover {
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--er);
  background: rgba(248, 113, 113, 0.04);
}

.doc-empty {
  font-size: 8.5px;
  color: var(--t3);
  text-align: center;
  padding: 10px;
  font-style: italic;
}

/* ── Document item wrapper (for analysis expand) ── */
.doc-item-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 5px;
  margin-bottom: 4px;
  background: rgba(30, 30, 34, 0.3);
  transition: all 0.15s;
}
.doc-item-wrap:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.01);
}
.doc-item-wrap .doc-item {
  border: none;
  background: none;
  margin: 0;
  border-radius: 0;
}

/* ── Analysis badge ── */
.doc-analysis-badge {
  font-size: 6.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  margin-left: 2px;
}
.doc-analysis-ok {
  background: rgba(52, 211, 153, 0.06);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.12);
}
.doc-analysis-pending {
  background: rgba(251, 191, 36, 0.06);
  color: var(--wa);
  border: 1px solid rgba(251, 191, 36, 0.12);
  animation: aiPulse 1.5s ease infinite;
}
.doc-analysis-empty {
  background: rgba(100, 100, 100, 0.06);
  color: var(--t3);
  border: 1px solid rgba(100, 100, 100, 0.12);
}
.doc-analysis-error {
  background: rgba(248, 113, 113, 0.06);
  color: var(--er);
  border: 1px solid rgba(248, 113, 113, 0.12);
}

/* ── Analysis expand button ── */
.doc-act-expand {
  font-size: 8px !important;
  transition: transform 0.2s;
}
.doc-act-expanded {
  transform: rotate(180deg);
}
.doc-act-ai {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(219, 68, 55, 0.12)) !important;
  border-color: rgba(66, 133, 244, 0.25) !important;
  color: #8ab4f8 !important;
  font-weight: 600;
  font-size: 8px !important;
  letter-spacing: 0.5px;
}
.doc-act-ai:hover {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.25), rgba(219, 68, 55, 0.2)) !important;
  border-color: rgba(66, 133, 244, 0.4) !important;
  color: #aecbfa !important;
}
.doc-act-ai:disabled {
  opacity: 0.5;
  cursor: wait;
}
.doc-badge-gemini {
  font-size: 7px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.18), rgba(219, 68, 55, 0.12));
  color: #8ab4f8;
  border: 1px solid rgba(66, 133, 244, 0.2);
}

/* ── Analysis details panel ── */
.doc-analysis-details {
  padding: 0 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  animation: fadeIn 0.18s ease;
}

.doc-analysis-section {
  margin-top: 8px;
}
.doc-analysis-title {
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cu);
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(212, 165, 116, 0.08);
}
.doc-analysis-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 4px;
  padding: 2px 0;
  font-size: 9px;
  line-height: 1.4;
}
.doc-analysis-label {
  color: var(--t3);
  font-weight: 600;
  font-size: 8px;
}
.doc-analysis-item span:last-child {
  color: var(--tx);
  font-family: var(--m);
  font-size: 8.5px;
}

.doc-analysis-meta {
  font-size: 7.5px;
  color: var(--t3);
  font-family: var(--m);
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.doc-analysis-meta--err {
  color: var(--er);
  border-top-color: rgba(248, 113, 113, 0.25);
}

/* ── Détails analyse — en-tête extraction & aperçu texte ── */
.doc-analysis-section--lead {
  margin-top: 4px;
}
.doc-analysis-section--lead .doc-analysis-title {
  color: var(--ok);
  border-bottom-color: rgba(52, 211, 153, 0.15);
  letter-spacing: 0.12em;
}
.doc-analysis-filename {
  font-weight: 600;
  word-break: break-word;
}
.doc-analysis-item.doc-analysis-item--stack {
  display: block;
  padding: 5px 0;
}
.doc-analysis-item.doc-analysis-item--stack .doc-analysis-label {
  display: block;
  margin-bottom: 4px;
}
.doc-analysis-preview {
  max-height: 140px;
  overflow-y: auto;
  padding: 8px 9px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  font-size: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--tx);
  font-family: var(--m);
}
.doc-analysis-prose {
  font-size: 8.5px;
  line-height: 1.45;
  color: var(--tx);
  opacity: 0.96;
}
.doc-analysis-hint {
  font-size: 8.5px;
  line-height: 1.4;
  color: var(--t3);
}
.doc-analysis-hint strong {
  color: var(--cu);
  font-weight: 700;
}
.doc-analysis-warn {
  color: var(--wa) !important;
}

/* ── Comparison: Rapport vs Géorisques ── */
.doc-cmp-row {
  display: grid;
  grid-template-columns: 14px 70px 1fr;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
  font-size: 8.5px;
  border-radius: 3px;
}
.doc-cmp-icon {
  font-size: 9px;
  text-align: center;
  font-weight: 700;
}
.doc-cmp-label {
  color: var(--t3);
  font-weight: 600;
  font-size: 8px;
}
.doc-cmp-vals {
  display: flex;
  gap: 4px;
  align-items: center;
  font-family: var(--m);
  font-size: 8px;
}
.doc-cmp-rpt {
  color: var(--tx);
}
.doc-cmp-sep {
  color: var(--t3);
  font-size: 7px;
  opacity: 0.5;
}
.doc-cmp-geo {
  color: var(--cu);
}
.doc-cmp-detail {
  font-size: 7px;
  color: var(--t3);
  font-family: var(--m);
  padding-left: 18px;
  margin-top: -1px;
  margin-bottom: 2px;
}
.cmp-ok .doc-cmp-icon {
  color: var(--ok);
}
.cmp-warn .doc-cmp-icon {
  color: var(--wa);
}
.cmp-err .doc-cmp-icon {
  color: var(--er);
}
.cmp-err {
  background: rgba(248, 113, 113, 0.03);
  padding: 2px 4px;
}
.cmp-warn {
  background: rgba(251, 191, 36, 0.03);
  padding: 2px 4px;
}

/* Page load */
@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
body {
  animation: pageIn 0.4s ease;
}

/* Focus — S5 hardening : contraste WCAG AA, visible partout au clavier */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
[role='button']:focus-visible {
  outline: 2px solid var(--cu, #d4a574);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.25);
  border-radius: 4px;
}

/* Skip-to-content — accessibilité clavier/lecteur d'écran */
.madior-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 8px 16px;
  background: #1e1e22;
  color: #d4a574;
  border: 2px solid #d4a574;
  border-radius: 6px;
  font:
    600 13px/1 system-ui,
    sans-serif;
  z-index: 99999;
  text-decoration: none;
}
.madior-skip-link:focus {
  left: 8px;
  outline: none;
}

/* Reduced motion — respecter les préférences utilisateur */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ MADIOR IA — FAB & overlay (charger avant init du panneau JS) ═══ */
.neo-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(212, 165, 116, 0.15);
  background: linear-gradient(135deg, rgba(30, 30, 32, 0.95), rgba(20, 20, 22, 0.98));
  backdrop-filter: blur(20px);
  color: #c5a086;
  cursor: pointer;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 165, 116, 0.05);
  transition: all 0.2s ease;
  font:
    700 18px/1 'JetBrains Mono',
    monospace;
}
.neo-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(212, 165, 116, 0.1);
  border-color: rgba(212, 165, 116, 0.3);
}
.neo-fab.active {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.12), rgba(212, 165, 116, 0.04));
  border-color: rgba(212, 165, 116, 0.3);
}
.neo-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  z-index: 1150;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.neo-overlay.open {
  transform: translateX(0);
  pointer-events: auto;
}
@media (max-width: 600px) {
  .neo-overlay {
    width: 100vw;
  }
}

/* GPU — only promote layers that actually animate frequently */
.marker3d-wrap,
.radar-ring,
.radar-core,
.sp {
  will-change: transform;
}
/* Reduce repaints on off-screen tab content */
.tab-pane:not(.act) {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* ═══════════════════════════════════════════════════════════════
   MAP CONTROLS — Google Maps / Earth inspired
   ═══════════════════════════════════════════════════════════════ */

/* ── Compass ── */
.madior-compass {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 800;
  width: 48px;
  height: 48px;
  cursor: pointer;
  background: rgba(30, 30, 34, 0.85);
  border: 1px solid var(--bd);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: var(--glass-l);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.madior-compass:hover {
  border-color: var(--cu);
  box-shadow: 0 2px 16px rgba(212, 165, 116, 0.15);
}
.compass-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compass-n {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  font: 700 8px/1 var(--f);
  color: var(--cu);
  letter-spacing: 0.05em;
  user-select: none;
}

/* ── Map buttons (Street View, IGN, Export) ── */
.madior-map-btn {
  position: absolute;
  z-index: 800;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: rgba(30, 30, 34, 0.85);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: var(--glass-l);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: 16px;
  line-height: 1;
  user-select: none;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}
.madior-map-btn:hover {
  border-color: var(--cu);
  background: rgba(30, 30, 34, 0.95);
  box-shadow: 0 2px 12px rgba(212, 165, 116, 0.12);
}

.madior-sv-btn {
  top: 68px;
  right: 12px;
}
.madior-ign-btn {
  top: 110px;
  right: 12px;
}
.madior-export-btn {
  top: 152px;
  right: 12px;
}

/* ── Coordinates bar (bottom) ──
   Sprint 42 (M9, 2026-05-16) — fix chevauchement texte/icônes :
   gap:0 + padding minimal causait des superpositions visuelles entre alt
   (⛰ — m), zoom (z6) et scale (168.3 km). Solution : flex gap:8px +
   réduction padding interne (évite le double-spacing avec les |) +
   line-height:1.2 pour respiration verticale + height 24px. */
/* 2026-06-12 — mode mesure : les marqueurs (adresse, séismes, dossiers),
   popups et tracés vectoriels deviennent transparents aux clics pour que
   chaque clic atteigne LA CARTE (sinon : premier point de mesure perdu si
   on clique sur la popup d'adresse ou une pastille séisme). Classe posée /
   retirée par __measureStart/_cleanup (index.html). */
.measuring .leaflet-marker-pane,
.measuring .leaflet-popup-pane,
.measuring .leaflet-overlay-pane path.leaflet-interactive {
  pointer-events: none !important;
}

.madior-coords-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  background: rgba(20, 20, 24, 0.88);
  border-top: 1px solid var(--bd);
  font: 600 10px/1.2 var(--m);
  color: var(--t2);
  user-select: none;
  backdrop-filter: var(--glass-l);
  overflow: hidden;
}
.madior-coords-bar .coords-lat,
.madior-coords-bar .coords-lon,
.madior-coords-bar .coords-alt,
.madior-coords-bar .coords-z,
.madior-coords-bar .coords-scale {
  padding: 0 10px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.madior-coords-bar .coords-lat {
  color: var(--cu-l);
}
.madior-coords-bar .coords-lon {
  color: var(--cu-l);
}
.madior-coords-bar .coords-alt {
  color: #7ecba1;
  font-variant-emoji: text;
}
.madior-coords-bar .coords-z {
  color: var(--ac-l);
  min-width: 36px;
  justify-content: center;
}
.madior-coords-bar .coords-scale {
  color: var(--t2);
  min-width: 60px;
  justify-content: flex-end;
}
.madior-coords-bar .coords-sep {
  color: var(--t3);
  font-size: 9px;
  padding: 0 2px;
  flex-shrink: 0;
  opacity: 0.6;
}
.madior-coords-bar .coords-altfield {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
  color: var(--t2);
  font-size: 9px;
  font-weight: 600;
}
.madior-coords-bar .coords-altfield input {
  width: 54px;
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bd);
  border-radius: 3px;
  color: var(--cu-l);
  font: 600 10px/1 var(--m);
  text-align: center;
  padding: 0 2px;
  outline: none;
}
.madior-coords-bar .coords-altfield input:focus {
  border-color: var(--cu);
  background: rgba(255, 255, 255, 0.14);
}

/* Responsive : sur petit écran, masquer les séparateurs et compacter */
@media (max-width: 720px) {
  .madior-coords-bar {
    font-size: 9px;
    height: 22px;
  }
  .madior-coords-bar .coords-lat,
  .madior-coords-bar .coords-lon,
  .madior-coords-bar .coords-alt,
  .madior-coords-bar .coords-z,
  .madior-coords-bar .coords-scale {
    padding: 0 6px;
  }
  .madior-coords-bar .coords-sep {
    padding: 0 1px;
  }
}

/* ── Services de proximité ── */
.madior-prox-panel {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cu-d) transparent;
}
.prox-cat {
  margin-bottom: 6px;
}
.prox-cat-title {
  font: 600 10px/1 var(--f);
  color: var(--cu);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.prox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  font: 400 11px/1.3 var(--f);
  color: var(--tx);
  border-radius: 3px;
  transition: background 0.15s;
}
.prox-item:hover {
  background: var(--cu-g);
}
.prox-item .prox-icon {
  font-size: 13px;
  flex-shrink: 0;
}
.prox-item .prox-dist {
  margin-left: auto;
  font: 500 9px/1 var(--m);
  color: var(--t3);
  white-space: nowrap;
}
.prox-section-header {
  font: 700 9px/1 var(--f);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 8px;
  margin: 6px 0 4px;
  border-radius: 4px;
  user-select: none;
}
.prox-section-header:first-child {
  margin-top: 0;
}

/* ── Light theme adjustments for map controls ── */
[data-theme='light'] .madior-compass,
[data-theme='light'] .madior-map-btn {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
[data-theme='light'] .madior-compass:hover,
[data-theme='light'] .madior-map-btn:hover {
  border-color: var(--cu);
  box-shadow: 0 2px 12px rgba(212, 165, 116, 0.2);
}
[data-theme='light'] .compass-n {
  color: var(--cu-d);
}
[data-theme='light'] .madior-coords-bar {
  background: rgba(255, 255, 255, 0.92);
  border-top-color: rgba(0, 0, 0, 0.08);
}
[data-theme='light'] .madior-coords-bar .coords-lat,
[data-theme='light'] .madior-coords-bar .coords-lon {
  color: var(--cu-d);
}
[data-theme='light'] .madior-coords-bar .coords-z {
  color: var(--ac-d);
}
[data-theme='light'] .madior-coords-bar .coords-scale {
  color: #666;
}
[data-theme='light'] .madior-coords-bar .coords-sep {
  color: #ccc;
}
[data-theme='light'] .madior-coords-bar .coords-alt {
  color: #2a9d5c;
}
[data-theme='light'] .madior-coords-bar .coords-altfield input {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--cu-d);
}

/* ── Site Data cards (ribbon panel) ── */
.sd-panels {
  scrollbar-width: thin;
  scrollbar-color: var(--bd) transparent;
}
.sd-card {
  min-width: 220px;
  max-width: 280px;
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid var(--bd);
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
}
.sd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border-bottom: 1px solid var(--bd);
  font-size: 10px;
  font-weight: 700;
  color: var(--t2);
}
.sd-card-body {
  padding: 6px 8px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bd) transparent;
}
[data-theme='light'] .sd-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
}

/* ── Proximity panel placeholder (empty state) ── */
#proxResults:empty::before {
  content: 'Sélectionnez un lieu sur la carte pour afficher les services BTP & Ingénierie (5 km / 30 km)';
  display: block;
  padding: 10px 8px;
  color: var(--t3);
  font-size: 10px;
  font-style: italic;
}
/* ── Données Site placeholder (empty cards) ── */
.sd-card-body:empty::before {
  content: '—';
  display: block;
  padding: 6px;
  color: var(--t3);
  font-size: 10px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile & Tablette
   ══════════════════════════════════════════════════════════════ */

/* ── Tablette & grand mobile (≤ 900px) ── */
@media (max-width: 900px) {
  /* Logo: réduit, masque le texte long */
  a.ribbon-logo,
  .ribbon-logo {
    width: auto;
    padding: 0 6px;
  }
  .ribbon-logo-txt {
    display: none;
  }
  /* Ribbon panel: enlève la marge fixe */
  .ribbon-panel {
    margin-left: 0;
  }
  /* Onglets: scrollable horizontal */
  .ribbon-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ribbon-tabs::-webkit-scrollbar {
    display: none;
  }
  .ribbon-tab {
    padding: 0 10px;
    font-size: 8.5px;
    flex-shrink: 0;
  }
  /* Slider opacité: label masqué, slider réduit */
  .ribbon-opa-label {
    display: none;
  }
  .ribbon-range {
    width: 56px;
  }
  /* Site Data cards: défilement horizontal conservé, taille min réduite */
  .sd-card {
    min-width: 180px;
    max-width: 240px;
  }
}

/* ── Mobile portrait (≤ 600px) ── */
@media (max-width: 600px) {
  /* Logo icône seulement */
  a.ribbon-logo,
  .ribbon-logo {
    width: 36px;
    padding: 0 4px;
  }
  .ribbon-logo-img {
    width: 22px;
    height: 22px;
  }
  .ribbon-logo-img--madior {
    max-width: 88px;
    height: 28px;
  }
  /* Onglets encore plus compacts */
  .ribbon-tab {
    padding: 0 7px;
    font-size: 8px;
    letter-spacing: 0.06em;
  }
  /* Panel plein largeur */
  .ribbon-panel {
    margin-left: 0;
    padding: 6px 8px;
  }
  /* ribbon-right masqué sur petit écran */
  .ribbon-right {
    display: none;
  }
  /* Site Data: cartes empilées verticalement */
  .sd-panels {
    flex-direction: column !important;
    overflow-x: unset !important;
  }
  .sd-card {
    min-width: 100% !important;
    max-width: 100% !important;
  }
  .sd-card-body {
    max-height: 100px;
  }
  /* Proximity panel pleine hauteur */
  .madior-prox-panel {
    max-height: 200px;
  }
  /* Panneau latéral (sidebar) plein écran */
  #S {
    position: relative;
    top: 0;
    left: 0;
    bottom: auto;
    width: 100% !important;
    height: auto !important;
    border-radius: 0;
  }
  /* Carte en dessous */
  #M {
    position: relative !important;
    height: 55vh !important;
  }
  /* Badges ribbon moins larges */
  .ribbon-badge {
    display: none;
  }
  .ribbon-link {
    padding: 0 6px;
    font-size: 8px;
  }
  /* Zone import documents : cible tactile un peu plus haute */
  .doc-drop {
    min-height: 76px;
    padding: 18px 12px;
  }
}

/* ── Très petit mobile (≤ 380px) ── */
@media (max-width: 380px) {
  .ribbon-tab {
    padding: 0 5px;
    font-size: 7.5px;
  }
  .ribbon-logo-img {
    width: 18px;
    height: 18px;
  }
  .ribbon-logo-img--madior {
    max-width: 72px;
    height: 24px;
  }
}
