/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  background: #eef1f5;
  color: #1e293b;
}

/* ══════════════════════════════════════════════════════
   HEADER ANAP
══════════════════════════════════════════════════════ */
.app-header { flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,.35); z-index: 900; }

.hdr-row1 { display: flex; height: 50px; }

.hdr-logo-panel {
  background: #fff; display: flex; align-items: center; padding: 0 14px;
  border-right: 3px solid #D41220; flex-shrink: 0;
}
.anap-logo-img { height: 40px; width: auto; }

.hdr-title-band {
  flex: 1; background: linear-gradient(to right, #C8174A, #E8601A);
  display: flex; align-items: center; gap: 10px; padding: 0 20px;
}
.hdr-title-icon { opacity: .75; color: #fff; flex-shrink: 0; }
.hdr-title-text {
  color: #fff; font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.hdr-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

/* ── Ligne 2 : fil d'Ariane ── */
.hdr-row2 {
  background: #1a2940; display: flex; align-items: stretch;
  padding: 0 16px; height: 44px; gap: 0;
}
.hdr-ctx-cols { display: flex; align-items: center; gap: 0; flex: 1; overflow: hidden; }
.hdr-ctx-col {
  display: flex; flex-direction: column; justify-content: center; padding: 0 14px;
  cursor: default; transition: background .15s; min-width: 0; overflow: hidden;
}
.hdr-ctx-sep { color: #4b5563; font-size: 14px; display: flex; align-items: center; }
.ctx-label { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: #9ca3af; }
.ctx-val   { font-size: 11.5px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-sub   { font-size: 10px; color: #6b7280; font-family: monospace; }
.ctx-active .ctx-label { color: #93c5fd; }
.ctx-active .ctx-val   { color: #fff; }
.ctx-dim .ctx-val, .ctx-dim .ctx-sub { opacity: .4; }

.btn-hdr {
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 5px; padding: 4px 12px; font-size: 11.5px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  transition: background .15s;
}
.btn-hdr:hover { background: rgba(255,255,255,.2); }

.btn-hdr-next {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.55);
  font-weight: 700;
  letter-spacing: .3px;
}
.btn-hdr-next:hover:not(:disabled) { background: rgba(255,255,255,.38); }
.btn-hdr-next:disabled { opacity: .38; cursor: not-allowed; }

/* ── Engrenage étape 6 ── */
.step-num.step-gear { display: flex; align-items: center; justify-content: center; }
.stepper-item[data-step="6"] .step-gear { background: #9ca3af; }
.stepper-item[data-step="6"].active .step-gear { background: #C8174A; }
.stepper-item[data-step="6"].done .step-gear { background: #059669; }

/* ══════════════════════════════════════════════════════
   STEPPER
══════════════════════════════════════════════════════ */
.stepper {
  display: flex; align-items: center;
  background: #fff; border-bottom: 1px solid #e2e8f0;
  padding: 0 16px; height: 44px; flex-shrink: 0;
  overflow-x: auto; gap: 0;
}
.stepper-item {
  display: flex; align-items: center; gap: 7px;
  padding: 0 14px; height: 100%; cursor: default;
  font-size: 12.5px; color: #94a3b8; font-weight: 500;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.stepper-item .step-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.stepper-item.active { color: #1e293b; border-bottom-color: #C8174A; cursor: default; }
.stepper-item.active .step-num { background: #C8174A; color: #fff; }
.stepper-item.done { color: #374151; cursor: pointer; }
.stepper-item.done .step-num { background: #059669; color: #fff; }
.stepper-item.done:hover { color: #C8174A; }
.stepper-item[data-step="6"] { cursor: pointer; }
.stepper-item[data-step="6"]:hover { color: #C8174A; }
.step-sep { color: #d1d5db; font-size: 12px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   CONTENU PRINCIPAL
══════════════════════════════════════════════════════ */
.main-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.step-panel { display: none; flex: 1; overflow: hidden; flex-direction: column; padding: 16px 20px; gap: 14px; }
.step-panel.active { display: flex; }
/* Étapes avec carte ou contenu non-scrollable : pas de overflow-y */
#step-2.active, #step-5.active { overflow: hidden; }
/* Étapes formulaire : scrollable */
#step-1.active, #step-3.active, #step-4.active { overflow-y: auto; }

/* ── Bannière reprise ── */
.resume-banner {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 10px 16px; display: none; align-items: center; gap: 12px;
  font-size: 13px; color: #1e40af; flex-shrink: 0;
}
.resume-name { font-weight: 700; }

/* ── Carte intro page de garde ── */
.intro-card {
  display: flex; gap: 18px; align-items: flex-start;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd; border-radius: 10px;
  padding: 20px 22px; margin-bottom: 16px; flex-shrink: 0;
}
.intro-icon {
  flex-shrink: 0; width: 48px; height: 48px;
  background: #0369a1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.intro-body { flex: 1; min-width: 0; }
.intro-lead {
  font-size: 13.5px; color: #0c4a6e; line-height: 1.55;
  margin: 0 0 14px; padding-bottom: 12px;
  border-bottom: 1px solid #bae6fd;
}
.intro-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 700px) { .intro-grid { grid-template-columns: 1fr; } }
.intro-item {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12.5px; color: #1e40af; line-height: 1.5;
}
.intro-item svg { flex-shrink: 0; margin-top: 2px; color: #0369a1; }

.prefill-banner {
  background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px;
  padding: 10px 16px; display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #166534; flex-shrink: 0; flex-wrap: wrap;
  margin: 0 0 12px 0;
}
.prefill-banner svg { flex-shrink: 0; color: #16a34a; }
.prefill-warn {
  width: 100%; margin-top: 6px; padding: 5px 10px;
  background: #fef9c3; border: 1px solid #fde047; border-radius: 5px;
  font-size: 11.5px; color: #854d0e; display: flex; align-items: center; gap: 6px;
}
.prefill-warn svg { flex-shrink: 0; color: #ca8a04; }

/* ══════════════════════════════════════════════════════
   COMPOSANTS COMMUNS
══════════════════════════════════════════════════════ */
.panel-header { flex-shrink: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.panel-header h2 { font-size: 18px; font-weight: 700; color: #1e293b; margin-right: auto; }
.panel-desc { font-size: 13px; color: #64748b; margin-top: 3px; width: 100%; }

.card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.lookup-card { max-width: 640px; }

.inp {
  width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; color: #1e293b; background: #fff; outline: none;
  transition: border-color .15s;
}
.inp:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.15); }

.field-label { font-size: 12px; font-weight: 600; color: #374151; display: block; margin-bottom: 5px; }
.req { color: #ef4444; }

.btn {
  padding: 8px 18px; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent; transition: all .15s; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary  { background: #C8174A; color: #fff; border-color: #C8174A; }
.btn-primary:hover:not(:disabled) { background: #a31038; border-color: #a31038; }
.btn-outline  { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-outline:hover:not(:disabled) { border-color: #9ca3af; background: #f9fafb; }

.step-actions {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; flex-shrink: 0;
}

/* ── Info grid (étape 1) ── */
.info-grid { display: flex; flex-direction: column; gap: 8px; }
.info-row  { display: flex; gap: 12px; font-size: 13px; }
.info-label{ min-width: 130px; color: #6b7280; font-weight: 500; flex-shrink: 0; }
.info-val  { color: #1e293b; }

/* ══════════════════════════════════════════════════════
   ÉTAPE 2 — CARTE RNB
══════════════════════════════════════════════════════ */
.map2-layout { flex: 1; display: flex; gap: 12px; min-height: 0; overflow: hidden; }
.map2-main   { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.map2-sidebar { width: 240px; flex-shrink: 0; overflow-y: auto; }

.map-hint-bar {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px 6px 0 0;
  padding: 5px 12px; font-size: 12px; color: #475569; flex-shrink: 0;
}

#rnb-map { flex: 1; border-radius: 0 0 8px 8px; border: 1px solid #e2e8f0; border-top: none; position: relative; }

.map-layer-toggle {
  position: absolute; top: 10px; right: 10px; z-index: 400;
  display: flex; background: #fff; border: 1px solid #d1d5db; border-radius: 7px;
  overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.map-layer-btn-item {
  padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: #fff; border: none; color: #6b7280; transition: all .15s;
}
.map-layer-btn-item:hover { background: #f9fafb; color: #374151; }
.map-layer-btn-item.active { background: #1e293b; color: #fff; }

.sidebar-empty { padding: 24px 12px; font-size: 12.5px; color: #9ca3af; text-align: center; }
.sidebar-bat-card { padding: 4px 0; }
.sbc-title { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #9ca3af; margin-bottom: 6px; }
.sbc-rnb   { font-family: monospace; font-size: 13px; font-weight: 700; color: #1e40af; margin-bottom: 10px; }
.sbc-row   { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.sbc-ok    { margin-top: 10px; font-size: 12px; color: #059669; font-weight: 600; }

.etab-pin { background: transparent; border: none; }

.map-instruction-banner {
  display: flex; align-items: flex-start; gap: 8px;
  background: #1e3a5f; color: #fff;
  border-radius: 8px; padding: 10px 14px;
  font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  max-width: 260px; margin: 8px;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════
   ÉTAPE 3 — QUESTIONNAIRE
══════════════════════════════════════════════════════ */
.q-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.q-bloc-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: #6b7280; margin-bottom: 12px;
  padding-bottom: 6px; border-bottom: 1px solid #e2e8f0;
}
.q-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid #f1f5f9; gap: 12px;
}
.q-row:last-child { border-bottom: none; }
.q-row .field-label { margin-bottom: 0; flex: 1; }
.q-row .inp { flex-shrink: 0; }
.q-row select.inp { width: auto; max-width: 210px; }
.q-row-col { flex-direction: column; align-items: flex-start; }
.field-val-ro { font-weight: 600; color: #1e40af; font-size: 13.5px; }

/* ── Bandeau RT ── */
.rt-banner {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 7px;
  padding: 8px 12px; margin-top: 8px;
}
.rt-banner-label { font-size: 12.5px; font-weight: 700; color: #0369a1; }
.rt-banner-desc  { font-size: 11.5px; color: #0c4a6e; margin-top: 2px; line-height: 1.4; }

/* ── Valeurs R ── */
.r-values-hint {
  font-size: 11.5px; color: #6b7280; margin-top: 8px; margin-bottom: 6px;
  padding: 6px 10px; background: #f8fafc; border-radius: 5px; border-left: 3px solid #93c5fd;
}
.r-values-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.r-field { display: flex; flex-direction: column; gap: 3px; }
.r-field .field-label { font-size: 11px; margin-bottom: 0; }
.r-field .r-inp { font-size: 13px; padding: 6px 8px; }
.r-field .r-inp[readonly] { background: #f3f4f6; color: #6b7280; }
.r-ref { font-size: 10px; color: #9ca3af; }

/* ── RT vitrage ── */
.rt-vit-info {
  font-size: 11.5px; color: #374151; background: #fafafa;
  border: 1px solid #e5e7eb; border-radius: 5px; padding: 5px 10px; margin-top: 6px;
}
.btn-link-blue {
  background: none; border: none; color: #3b82f6; cursor: pointer; font-size: 11.5px;
  font-weight: 600; padding: 0 4px; text-decoration: underline;
}
.btn-link-blue:hover { color: #1d4ed8; }

/* ── Toggle switch ── */
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; user-select: none; }
.toggle-switch input { opacity: 0; width: 40px; height: 22px; position: absolute; cursor: pointer; z-index: 2; margin: 0; }
.toggle-track {
  width: 40px; height: 22px; background: #d1d5db; border-radius: 11px;
  transition: background .2s; position: relative;
}
.toggle-track::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-track { background: #3b82f6; }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }

/* ── Chips niveaux ── */
.etage-chip {
  display: flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer;
  background: #f9fafb; border: 1.5px solid #e5e7eb; border-radius: 6px; padding: 5px 10px;
  transition: all .15s; user-select: none;
}
.etage-chip:hover { border-color: #93c5fd; background: #f0f9ff; }
.etage-chip.checked { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; font-weight: 600; }
.etage-chip input { display: none; }

/* ── Occultation ── */
.occ-desc {
  font-size: 11.5px; color: #6b7280; margin-top: 5px; padding: 5px 8px;
  background: #f8fafc; border-radius: 4px; min-height: 24px;
}
.occ-efficacite {
  font-size: 12px; color: #374151; margin-top: 6px; padding: 5px 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 5px;
}
.radio-label { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; cursor: pointer; }
.radio-label input { margin-top: 2px; accent-color: #3b82f6; }

/* ══════════════════════════════════════════════════════
   ÉTAPE 4 — SIMULATION
══════════════════════════════════════════════════════ */
.sim-status-bar {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: #1e40af;
}
.sim-spinner {
  width: 18px; height: 18px; border: 2px solid #bfdbfe;
  border-top-color: #3b82f6; border-radius: 50%; flex-shrink: 0;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.kpi-row { display: flex; gap: 12px; flex-wrap: wrap; }
.kpi-card {
  flex: 1; min-width: 160px; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.kpi-icon  { font-size: 20px; margin-bottom: 4px; }
.kpi-val   { font-size: 24px; font-weight: 800; line-height: 1.1; }
.kpi-label { font-size: 11.5px; color: #6b7280; margin-top: 3px; }
.kpi-sub   { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.kpi-note  { width: 100%; margin-top: 6px; padding: 9px 13px; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; font-size: 12px; color: #78350f; line-height: 1.5; }

.sim-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.sim-chart-card { min-width: 0; position: relative; }
.chart-title { font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 8px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  background: #f8fafc; color: #475569; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .3px; padding: 7px 10px; border-bottom: 1px solid #e2e8f0; text-align: left;
}
.data-table td { padding: 6px 10px; border-bottom: 1px solid #f1f5f9; }
.data-table tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════════════════
   ÉTAPE 5 — MESURES
══════════════════════════════════════════════════════ */
.mesures-layout { flex: 1; display: flex; gap: 14px; min-height: 0; overflow: hidden; }
.mesures-left  { flex: 1; overflow-y: auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mesures-right { width: 360px; flex-shrink: 0; }

.mesure-cat-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: #6b7280; padding: 10px 4px 4px;
}

.mesure-row {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 10px 12px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.mesure-row:hover { border-color: #93c5fd; background: #fafbff; }
.mesure-row.selected { border-color: #3b82f6; background: #eff6ff; }

.mesure-cb-wrap { flex-shrink: 0; }
.mesure-cb { width: 16px; height: 16px; accent-color: #3b82f6; cursor: pointer; }
.mesure-info { flex: 1 1 auto; min-width: 0; }
.mesure-label { font-size: 12px; font-weight: 600; color: #1e293b; line-height: 1.3; }
.mesure-desc  { font-size: 10.5px; color: #6b7280; margin-top: 2px; }
.mesure-note-urba { display: none; } /* contenu déplacé en infobulle .urba-warn-btn */

/* Bouton ⚠ orange infobulle urbanisme */
.urba-warn-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: #f59e0b; color: #fff;
  font-size: 9px; font-weight: 800; line-height: 1;
  cursor: help; vertical-align: middle; margin-left: 3px;
  border: none; padding: 0; flex-shrink: 0;
}
.urba-warn-btn:hover { background: #d97706; }

/* Infobulle flottante — positionnée en JS pour éviter le clipping overflow */
#urba-tip-box {
  display: none; position: fixed; z-index: 9999;
  max-width: 340px;
  background: #fffbeb; border: 1.5px solid #fde68a;
  border-radius: 8px; padding: 10px 13px;
  font-size: 11.5px; line-height: 1.55; color: #78350f;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  #urba-tip-box { background: #1c1a10; border-color: #7c5a00; color: #fcd34d; }
}

/* Colonne coût dans la rangée mesure */
.mesure-cout {
  display: flex; flex-direction: column; align-items: flex-end;
  flex-shrink: 0; min-width: 80px; text-align: right;
  border-left: 1px solid #e2e8f0; padding-left: 10px; margin-left: 2px;
}
.mesure-cout-val  { font-size: 12px; font-weight: 700; color: #1e293b; }
.mesure-cout-lab  { font-size: 10px; color: #9ca3af; }
.mesure-cout-elec { font-size: 10.5px; color: #d97706; font-weight: 600; margin-top: 2px; }

.mesure-stats { display: flex; gap: 12px; flex-shrink: 0; }
.mstat { display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.mstat-val { font-size: 13px; font-weight: 700; }
.mstat-lab { font-size: 10px; color: #9ca3af; }

/* Badge "?" surchauffe aggravée */
.surchauffe-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
  cursor: pointer; vertical-align: middle; margin-left: 3px;
  flex-shrink: 0; border: none; padding: 0;
  transition: background .15s;
}
.surchauffe-help:hover { background: #b91c1c; }

.mesures-recap { height: 100%; overflow-y: auto; }
.recap-title { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.recap-empty { font-size: 12.5px; color: #9ca3af; }
.recap-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.recap-hint { font-size: 11.5px; color: #6b7280; margin-top: 8px; }

.recap-kpi-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.recap-kpi { background: #f8fafc; border-radius: 8px; padding: 8px 10px; text-align: center; }
.recap-kpi-val   { font-size: 20px; font-weight: 800; }
.recap-kpi-lab   { font-size: 11px; color: #6b7280; }
.recap-kpi-delta { font-size: 11.5px; font-weight: 600; margin-top: 2px; }

.recap-permeab {
  display: flex; align-items: flex-start; gap: 6px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 7px;
  padding: 7px 10px; font-size: 12px; color: #1e40af; margin-bottom: 10px;
}
.recap-permeab strong { font-weight: 700; }
.recap-permeab-delta {
  display: inline-block; margin-left: 6px;
  background: #059669; color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
}
.recap-permeab-syn {
  display: inline-block; margin-left: 5px;
  background: #7c3aed; color: #fff; font-size: 10px; font-weight: 600;
  padding: 1px 5px; border-radius: 4px; cursor: help;
}

.recap-couts-title { font-size: 11.5px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.recap-couts-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.recap-couts-table tbody tr:hover { background: #f8fafc; }
.rc-label { color: #374151; padding: 3px 4px 3px 0; line-height: 1.3; }
.rc-val   { text-align: right; font-weight: 600; white-space: nowrap; padding: 3px 0 3px 8px; }
.rc-elec  { text-align: right; color: #d97706; font-weight: 600; white-space: nowrap; padding: 3px 0 3px 8px; }
.rc-sep td { padding: 4px 0; border-top: 1px solid #e2e8f0; }
.rc-sub   { color: #6b7280; }
.rc-sub .rc-val { font-weight: 400; }
.rc-total { border-top: 2px solid #374151; }
.rc-total .rc-val { font-size: 13px; }

/* ══════════════════════════════════════════════════════
   ÉTAPE 5 — CONFIGURATION DES COÛTS
══════════════════════════════════════════════════════ */
.couts-config-wrap { padding: 0 20px 8px; flex-shrink: 0; }

.btn-couts-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 5px 14px; font-size: 12.5px; font-weight: 600; color: #475569;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-couts-toggle:hover { background: #e2e8f0; border-color: #cbd5e1; }
.couts-arrow { font-size: 11px; color: #94a3b8; }

.couts-config-panel {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  margin-top: 8px; padding: 14px 16px;
}
.couts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.couts-group { }
.couts-group-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: #64748b; margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}
.couts-field-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 3px 0;
}
.couts-label { font-size: 12px; color: #374151; flex: 1; }
.couts-input-wrap { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.couts-input {
  width: 72px; padding: 2px 6px; font-size: 12px; text-align: right;
  border: 1px solid #d1d5db; border-radius: 4px; color: #1e293b;
}
.couts-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px #dbeafe; }
.couts-unit { font-size: 10.5px; color: #9ca3af; min-width: 60px; }
.couts-footer { text-align: right; margin-top: 10px; padding-top: 8px; border-top: 1px solid #e2e8f0; }

/* ── Ventilo-convecteurs (mesure active) ── */
.active-cooling-row { border-color: #c7d2fe !important; }
.active-cooling-row:hover { border-color: #818cf8 !important; background: #f5f3ff !important; }
.active-cooling-row.selected { border-color: #6366f1 !important; background: #eef2ff !important; }

.vc-detail {
  margin-top: 8px; padding: 8px 10px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 11.5px;
}
.vc-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0; gap: 12px;
}
.vc-detail-row span { color: #374151; }
.vc-detail-row strong { color: #1e293b; white-space: nowrap; }
.vc-detail-sub { opacity: .8; }
.vc-detail-sub span { color: #6b7280; }

.recap-vc-bloc {
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 6px;
  padding: 8px 10px; margin-top: 8px; font-size: 12px;
}
.recap-vc-title { font-weight: 700; color: #4338ca; margin-bottom: 5px; font-size: 11.5px; text-transform: uppercase; }
.recap-vc-row { display: flex; justify-content: space-between; padding: 2px 0; }

/* ══════════════════════════════════════════════════════
   ÉTAPE 4 — SÉLECTEUR DE SCÉNARIO CLIMATIQUE
══════════════════════════════════════════════════════ */
.scenario-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px;
  padding: 8px 16px; margin: 0 20px 10px; flex-shrink: 0;
  font-size: 12.5px;
}
.scenario-label { font-weight: 700; color: #0369a1; white-space: nowrap; display: flex; align-items: center; gap: 4px; }

/* ── Icône aide contextuelle ─────────────────────────────────────────────── */
.tip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  background: #dbeafe; color: #1d4ed8; font-size: 9.5px; font-weight: 800;
  cursor: help; position: relative; border: 1px solid #bfdbfe;
  line-height: 1; z-index: 500; /* crée un contexte d'empilement au-dessus du bandeau */
}
.tip-icon::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-40%);
  background: #1e293b; color: #f1f5f9; border-radius: 7px;
  padding: 9px 12px; font-size: 11px; font-weight: 400; line-height: 1.55;
  width: 260px; white-space: normal; text-align: left;
  pointer-events: none; opacity: 0; transition: opacity .15s;
  z-index: 9999; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.tip-icon::before {
  content: '';
  position: absolute; bottom: calc(100% + 3px); left: 40%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1e293b;
  pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 9999;
}
.tip-icon:hover::after, .tip-icon:hover::before, .tip-icon:focus::after, .tip-icon:focus::before { opacity: 1; }
.scenario-presets { display: flex; gap: 4px; }
.scenario-btn {
  padding: 3px 11px; border-radius: 20px; border: 1.5px solid #bae6fd;
  background: #fff; color: #0369a1; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.scenario-btn:hover  { background: #e0f2fe; }
.scenario-btn.active { background: #0284c7; color: #fff; border-color: #0284c7; }
.scenario-custom { display: flex; align-items: center; gap: 5px; }
.scenario-input {
  width: 60px; padding: 3px 6px; font-size: 12px; text-align: right;
  border: 1px solid #bae6fd; border-radius: 4px; color: #1e293b;
}
.scenario-hint { font-size: 11.5px; color: #d97706; font-weight: 600; }
.scenario-ref  { font-size: 10.5px; color: #64748b; margin-left: auto; }
.scenario-sep  { width: 1px; height: 22px; background: #cbd5e1; margin: 0 4px; }

/* Slider seuil de confort */
.tc-slider-wrap { display: flex; align-items: center; gap: 5px; }
.tc-bound { font-size: 11px; color: #6b7280; white-space: nowrap; }
.tc-slider {
  -webkit-appearance: none; appearance: none;
  width: 100px; height: 4px; border-radius: 2px;
  background: #bae6fd; outline: none; cursor: pointer;
}
.tc-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #0284c7; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tc-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #0284c7; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tc-val-display {
  font-size: 13px; font-weight: 700; color: #0284c7;
  min-width: 38px; text-align: left;
}

/* ── note sources coûts ── */
.couts-sources {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px;
  padding: 7px 12px; margin-top: 10px; font-size: 11.5px; color: #78350f; line-height: 1.5;
}
.couts-sources strong { color: #92400e; }

/* ══════════════════════════════════════════════════════
   ÉTAPE 2 — MULTI-SÉLECTION POLYGONES
══════════════════════════════════════════════════════ */
.sbc-multi-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: #d1fae5; color: #065f46; font-size: 11.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 6px;
}
.sbc-ids {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px;
}
.sbc-ids span {
  font-size: 10.5px; font-family: monospace; color: #059669;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 4px;
  padding: 1px 6px;
}
.sbc-note {
  font-size: 10.5px; color: #d97706; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 4px; padding: 3px 7px;
  margin: 4px 0;
}

/* ══════════════════════════════════════════════════════
   ÉTAPE 5 — VOLET COÛTS
══════════════════════════════════════════════════════ */
.volet-couts {
  flex-shrink: 0;
  background: #fff;
  border: 1.5px solid #c7d2fe;
  border-radius: 10px;
  margin: 0 0 8px;
  overflow: hidden;
}
.volet-couts-header {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(to right, #4f46e5, #7c3aed);
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 9px 16px;
}
.volet-couts-body { padding: 12px 16px; }

.vcouts-table {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px; margin-bottom: 10px;
}
.vcouts-table th {
  background: #f8fafc; color: #475569;
  font-size: 11px; text-transform: uppercase; letter-spacing: .3px;
  padding: 6px 10px; border-bottom: 2px solid #e2e8f0; text-align: left;
}
.vcouts-table td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.vcouts-table tr:last-child td { border-bottom: none; }
.th-num, .td-num { text-align: right; white-space: nowrap; }
.td-label { max-width: 260px; color: #1e293b; font-weight: 500; }
.td-tva { color: #6b7280; font-size: 11.5px; }
.td-elec { color: #dc2626; font-weight: 600; }
.td-dim  { color: #9ca3af; }

.vcouts-total td {
  padding-top: 10px; border-top: 2px solid #e2e8f0 !important;
  font-size: 13px; background: #f8fafc;
}

.vcouts-elec-param {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #374151;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px;
  padding: 6px 12px; margin-bottom: 8px;
}
.vcouts-elec-note { font-size: 11px; color: #9ca3af; }

.vcouts-note {
  font-size: 11px; color: #6b7280;
  border-top: 1px solid #f1f5f9; padding-top: 8px; margin-top: 4px;
}

/* ── Stat T° pic dans les rangées mesure ── */
.mstat-sub-val {
  font-size: 11px; font-weight: 600; line-height: 1;
  margin-top: -1px;
}

/* ── Détail modèle thermique (parois) ── */
.parois-detail-wrap {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; margin-bottom: 10px; overflow: hidden;
}
.parois-detail-body {
  padding: 14px 18px;
  border-top: 1px solid #e2e8f0;
  max-height: 420px;
  overflow-y: auto;
}
.parois-summary {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  padding-bottom: 10px;
}
.psumm-item { display: flex; flex-direction: column; min-width: 130px; }
.psumm-lbl { font-size: 11px; color: #64748b; margin-bottom: 1px; }
.psumm-item strong { font-size: 14px; color: #1e293b; }
.parois-note {
  font-size: 11.5px; color: #64748b;
  border-top: 1px solid #f1f5f9; padding-top: 8px; margin-top: 8px;
  font-style: italic;
}

/* ── Volet 6 Coûts ── */
.couts-filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.couts-filter-label { font-size: 12px; color: #64748b; font-weight: 600; }
.vcouts-cat-header {
  background: #f1f5f9; font-size: 11px; font-weight: 700;
  color: #64748b; text-transform: uppercase; letter-spacing: .04em;
  padding: 5px 10px;
}
.vcouts-row-sel { background: #f0fdf4; }

/* ══════════════════════════════════════════════════════
   ÉTAPE 6 — PARAMÈTRES
══════════════════════════════════════════════════════ */
.params-scroll {
  flex: 1; overflow-y: auto; padding: 0 20px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.params-card { padding: 14px 18px; }
.params-card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #374151; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid #e2e8f0;
}
.params-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px;
}
.params-field-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 5px 0; border-bottom: 1px solid #f1f5f9;
}
.params-label { font-size: 12px; color: #374151; flex: 1; }
.params-input-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.params-input {
  width: 72px; padding: 3px 6px; font-size: 12px; text-align: right;
  border: 1px solid #cbd5e1; border-radius: 4px;
}
.params-input:focus { outline: none; border-color: #3b82f6; }
.params-unit { font-size: 10.5px; color: #9ca3af; min-width: 55px; }
.params-reset-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 0;
}
.params-source {
  font-size: 10.5px; color: #9ca3af; flex: 1;
}

/* ══════════════════════════════════════════════════════
   UTILITAIRES
══════════════════════════════════════════════════════ */
.sim-table-card { margin-top: 0; }

/* ── Disclaimer simulation ─────────────────────────────────────────────── */
.sim-disclaimer {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 12px 0 0;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: #78350f;
}
.sim-disclaimer svg { color: #d97706; margin-top: 1px; }
@media (prefers-color-scheme: dark) {
  .sim-disclaimer { background: #1c1a10; border-color: #7c5a00; color: #fcd34d; }
  .sim-disclaimer svg { color: #fbbf24; }
}
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Warning ITI + Indices BT ──────────────────────────────────────────── */
.warn-banner {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fff7ed; border: 1px solid #fb923c; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 12px;
  font-size: 13px; color: #9a3412; line-height: 1.45;
}
.bt-coef-badge {
  font-size: 10px; font-weight: 600; padding: 1px 5px;
  background: #f1f5f9; border-radius: 4px; margin-left: 4px;
  vertical-align: middle;
}
