/* éKlair Flash dans le site (agent F) : outils A et B (récit occupant), C (récit propriétaire).
   Toutes les règles sous .flash, puis .flash-a, .flash-b, .flash-c. Valeurs de tokens.css (charte v1.0).
   Les pages lient ce seul fichier. */

/* ================================================================ commun */
.flash {
  /* hauteur de l'en-tête collant du site (mesurée par outils.ts), pour le tableau et les dessins collants */
  --flash-haut: 63px;
  --pad-x: clamp(16px, 4vw, 48px);
  /* Empilé (téléphone, tablette, écran bas) : une colonne, dans l'ordre de lecture ci-dessous.
     Tableau de bord (W10, plus bas) : tout l'outil dans un écran. */
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 56px) var(--pad-x);
  scroll-margin-top: var(--flash-haut);
  color: var(--fg-1);

  & button, & input, & select { font: inherit; color: inherit; }

  .gauche { display: contents; }
  .gauche > .flash-tete { order: 1; }
  .bande { order: 2; }
  .planche-dessin, .b-graphe { order: 3; }
  .planche-pied { order: 4; }
  .gauche > .champs { order: 5; }
  .b-details { order: 6; }
  .histoire-diagnostic-o33 { order: 7; }
  .decret { order: 8; }
  .seuil-hote { order: 9; }
  .detail-calcul { order: 10; }

  .flash-tete { max-width: 720px; }
  .flash-tete h2 .a-confirmer { vertical-align: middle; transform: translateY(-.12em); }
  .flash-tete h2 { margin: 10px 0 0; font: 400 clamp(34px, 5vw, 51px)/var(--lh-h1) var(--font-display); text-transform: uppercase; letter-spacing: var(--track-heading); color: var(--heading); padding-top: 0.12em; }
  .chapeau { margin: 8px 0 0; font: italic 400 clamp(19px, 2.2vw, 22px)/var(--lh-dek) var(--font-dek); color: var(--fg-1); max-width: 40ch; }
  .flash-tete p.texte { margin: 10px 0 0; max-width: 60ch; color: var(--fg-2); font-size: 15px; }
  .cas-fictif { margin: 10px 0 0; font: 400 11px/1.5 var(--font-mono); letter-spacing: .04em; color: var(--ek-laiton); max-width: 70ch; }

  .etiquette { font: 400 var(--t-meta)/1.4 var(--font-mono); letter-spacing: var(--track-meta); text-transform: uppercase; color: var(--fg-2); }

  /* Champs : règle de géomètre */
  .champs { display: grid; gap: 16px; align-content: start; margin: 0; }
  .champ { display: grid; gap: 6px; }
  .champ-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .champ-tete label, .champ-tete .nom { font: 500 14px/1.3 var(--font-body); color: var(--fg-1); }
  .valeur { display: inline-flex; align-items: baseline; gap: 4px; font: 400 20px/1 var(--font-mono); color: var(--heading); }
  .valeur input { width: 9ch; padding: 0 0 2px; border: 0; border-bottom: 1px dashed var(--rule-strong); background: transparent; text-align: right; font: inherit; font-variant-numeric: tabular-nums; }
  .valeur input:focus { border-bottom-color: var(--ek-laiton); outline: none; }
  .valeur .unite { font-size: 12px; color: var(--fg-2); }
  .aide { font: 400 12px/1.4 var(--font-body); color: var(--fg-2); opacity: .86; margin: 0; }

  input[type="range"].regle { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
  input[type="range"].regle::-webkit-slider-runnable-track { height: 28px; background:
    linear-gradient(var(--rule-strong), var(--rule-strong)) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 10%) 0 50% / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 2%) 0 50% / 100% 7px no-repeat; }
  input[type="range"].regle::-moz-range-track { height: 28px; background:
    linear-gradient(var(--rule-strong), var(--rule-strong)) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 10%) 0 50% / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 2%) 0 50% / 100% 7px no-repeat; }
  input[type="range"].regle::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 28px; border: 0; border-radius: 1px; background:
    linear-gradient(var(--ek-laiton), var(--ek-laiton)) 50% 0 / 2px 100% no-repeat,
    conic-gradient(from 135deg at 50% 0, var(--ek-laiton) 0 90deg, transparent 0) 50% 0 / 14px 7px no-repeat; }
  input[type="range"].regle::-moz-range-thumb { width: 14px; height: 28px; border: 0; border-radius: 1px; background:
    linear-gradient(var(--ek-laiton), var(--ek-laiton)) 50% 0 / 2px 100% no-repeat; }
  input[type="range"].regle:focus-visible { outline-offset: 4px; }

  select.ville { height: var(--control-h); padding: 0 32px 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23F3F4EE' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; -webkit-appearance: none; appearance: none; font: 400 15px/1 var(--font-body); }

  /* Puces : choix exclusifs */
  .puces { display: flex; flex-wrap: wrap; gap: 6px; }
  .puces button { min-height: 32px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--r-pill); background: transparent; font: 500 13px/1 var(--font-body); cursor: pointer; transition: background var(--d-ui) var(--ease), border-color var(--d-ui) var(--ease); }
  .puces button[aria-pressed="true"] { background: var(--heading); color: var(--bg); border-color: var(--heading); }
  .puces button:active { transform: translateY(1px); }
  .puces.dpe button { min-width: 34px; padding: 0 8px; font-family: var(--font-mono); }
  .puces.dpe button[aria-pressed="true"] { outline: 2px solid var(--heading); outline-offset: 1px; background: var(--dpe); color: var(--dpe-ink); border-color: var(--dpe); }
  .puces.petites button { min-height: 28px; padding: 0 10px; font-size: 12px; }

  /* Rangée de chiffres */
  /* La bande : chiffre principal, appel à l'action, autres chiffres, constat */
  .rangee { border-top: 1px solid var(--rule-strong); padding-top: 12px; min-width: 0; }
  .bande { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
  .rangee > .etiquette { display: block; margin: 0; }
  .rangee-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 32px; width: 100%; }
  .chiffre { min-width: 0; }
  .chiffre .n { display: block; font: 400 32px/1.1 var(--font-display); color: var(--heading); font-variant-numeric: tabular-nums; }
  .chiffre .n.laiton { color: var(--figure); font-size: clamp(32px, 4.4vw, 44px); }
  .chiffre .p { display: block; margin-top: 4px; font: 400 11px/1.45 var(--font-mono); color: var(--fg-2); max-width: 26ch; }
  .constat { margin: 0; max-width: 78ch; font-size: 15px; min-height: 1.6em; }
  .constat strong { font-weight: 500; color: var(--heading); }

  /* Dessin (collant tant que l'outil est empilé) et commandes dessous */
  .planche-dessin { position: sticky; top: var(--flash-haut); z-index: 2; margin: 0 calc(-1 * var(--pad-x)); background: var(--ek-paper); overflow: hidden; box-shadow: 0 10px 18px -12px rgba(0,0,0,.6); }
  .dessin { display: block; width: 100%; height: auto; max-height: 46vh; margin: 0 auto; }
  .planche-pied { display: grid; gap: 16px; }
  .commandes { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px; }
  .groupe { display: grid; gap: 8px; }
  .travaux-effet { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--fg-2); max-width: 52ch; }

  /* Seuil e-mail */
  .seuil { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); margin-top: 20px; padding: clamp(18px, 2.4vw, 28px); background: var(--surface); border-radius: var(--r); }
  .seuil-fermer { display: none; position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--r); background: transparent; font: 400 20px/1 var(--font-body); cursor: pointer; }
  .seuil-fermer:hover { border-color: var(--fg-1); }
  .seuil h3 { margin: 0; font: 400 24px/1.2 var(--font-display); text-transform: uppercase; color: var(--heading); padding-top: .12em; }
  .seuil ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
  .seuil li { display: grid; grid-template-columns: 6px 1fr; gap: 12px; align-items: baseline; font-size: 15px; }
  .seuil li::before { content: ""; width: 6px; height: 6px; background: var(--ek-laiton); transform: translateY(-2px); }
  .seuil li .a-confirmer { margin-left: 4px; vertical-align: 1px; }
  /* le badge de site.css garde un texte clair sur fond laiton clair : encre sombre ici pour le contraste */
  .a-confirmer { color: var(--ek-ink); background: var(--ek-laiton); }
  /* pot de miel du seuil en ligne : invisible pour les personnes */
  .seuil-pot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  .seuil form { display: grid; gap: 14px; align-content: start; }
  .seuil label { display: grid; gap: 6px; font: 500 13px/1.3 var(--font-body); }
  .seuil input[type="email"], .seuil input[type="text"] { height: var(--control-h); padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--bg); font-size: 15px; min-width: 0; }
  .seuil .case { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font: 400 12.5px/1.45 var(--font-body); color: var(--fg-2); }
  .seuil .case input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--ek-laiton); }
  .accroche { margin: 14px 0 0; font: italic 400 19px/1.35 var(--font-dek); max-width: 40ch; }
  .accroche .n { font: normal 400 19px/1 var(--font-mono); color: var(--ek-laiton); white-space: nowrap; }
  .seuil-erreur { margin: 0; font: 500 13px/1.4 var(--font-body); color: var(--ek-alert); }
  .seuil-proto { margin: 0; font: 400 11px/1.5 var(--font-mono); color: var(--fg-2); }
  .bouton { height: var(--control-h); min-height: 0; padding: 0 18px; border: 0; border-radius: var(--r); background: var(--cta); color: var(--cta-ink); font: 500 14px/1 var(--font-body); cursor: pointer; justify-self: start; transition: background var(--d-ui) var(--ease); }
  .bouton:hover { background: var(--cta-hover); }
  .bouton:active { transform: translateY(1px); }
  .bouton-ligne { height: 36px; min-height: 0; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: transparent; font: 500 13px/1 var(--font-body); cursor: pointer; }
  .merci { margin: 0; font: italic 400 18px/1.4 var(--font-dek); }
  .envoi { display: grid; gap: 12px; min-width: 0; outline: none; }
  .envoi details { border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 10px 14px; min-width: 0; }
  .envoi summary { cursor: pointer; font: 500 14px/1.4 var(--font-body); }
  .envoi-corps { margin-top: 10px; font-size: 14px; min-width: 0; }
  .envoi-corps p { margin: 0 0 8px; }
  .envoi-corps ul { display: block; margin: 0 0 8px; padding-left: 18px; list-style: disc; }
  .envoi-corps ul li { display: list-item; font-size: 14px; }
  .envoi-corps ul li::before { content: none; }
  .envoi-sujet { font: 400 12px/1.5 var(--font-mono); color: var(--fg-2); }
  .envoi table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .envoi th, .envoi td { padding: 5px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
  .envoi th { font-weight: 400; color: var(--fg-2); padding-right: 12px; }
  .envoi td { font-family: var(--font-mono); font-size: 12.5px; }
  .envoi pre { margin: 10px 0 0; padding: 10px; max-height: 220px; overflow: auto; background: var(--bg); border-radius: var(--r); font: 400 11px/1.45 var(--font-mono); color: var(--fg-2); white-space: pre; }
  .lien-retour { justify-self: start; padding: 0; border: 0; background: none; font: 500 12.5px/1.4 var(--font-body); color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  /* Détail du calcul : replié par défaut ; dans le tableau de bord, il s'ouvre en panneau au-dessus de l'outil */
  .detail-calcul { border-top: 1px solid var(--rule); padding-top: 10px; min-width: 0; }
  .detail-calcul > summary { display: inline-flex; gap: 10px; align-items: baseline; cursor: pointer; list-style: none; font: 500 13px/1.3 var(--font-body); color: var(--fg-2); }
  .detail-calcul > summary::-webkit-details-marker { display: none; }
  .detail-calcul > summary::after { content: "+"; font-family: var(--font-mono); }
  .detail-calcul[open] > summary::after { content: "−"; }
  .detail-calcul > summary:hover { color: var(--fg-1); }
  .detail-corps { display: grid; gap: 12px; margin-top: 12px; }
  .detail-lignes { display: grid; gap: 6px; margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.45; color: var(--fg-1); }
  .detail-lignes strong { font-weight: 500; color: var(--heading); }
  .mention { margin: 0; font: 400 11px/1.5 var(--font-mono); color: var(--fg-2); letter-spacing: .02em; max-width: 90ch; }

  /* Dessins : JetBrains Mono, Craie sur papier de plan */
  .dessin text { font-family: var(--font-mono); fill: var(--ek-chalk); }
  .grille line { stroke: rgba(243, 244, 238, 0.12); stroke-width: 1; }
  .dalle { stroke: rgba(243, 244, 238, 0.8); stroke-width: 1.5; pointer-events: none; }
  .sol { stroke: var(--ek-chalk); stroke-width: 1.5; }
  .sol-hachures line { stroke: rgba(243, 244, 238, 0.35); }
  .cote line, .cote path { stroke: rgba(243, 244, 238, 0.7); stroke-width: 1; fill: none; }
  .cote.laiton line, .cote.laiton path { stroke: var(--ek-laiton); }
  .cote text { font-size: 11px; }
  .cote.laiton text { fill: var(--ek-laiton) !important; }
  .etage-nom { font-size: 10px; fill-opacity: 0.7; }
  .cartouche rect { fill: none; stroke: rgba(243, 244, 238, 0.55); stroke-width: 1; }
  .cartouche line { stroke: rgba(243, 244, 238, 0.35); }
  .cartouche text { font-size: 9px; letter-spacing: 0.08em; fill-opacity: 0.8; }
  .legende text { font-size: 10px; fill-opacity: 0.8; }

  /* Chiffre principal et appel à l'action, plus grands, en tête de l'outil */
  .principal .chiffre .n { font-size: clamp(52px, 6.2vw, 88px); line-height: 1.02; }
  .principal .chiffre .p { margin-top: 6px; font-size: 12px; max-width: 46ch; }
  .cta { height: 52px; padding: 0 26px; font-size: 16px; }

  @media (max-width: 899px) {
    .seuil { grid-template-columns: 1fr; }
    .chiffre .n { font-size: 26px; }
    .rangee-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
  }

  /* ---------------------------------------------------------- tableau de bord (W10)
     Tout l'outil tient entre l'en-tête du site et le bas de l'écran : à gauche le titre et les saisies,
     en haut la bande des chiffres, au centre et à droite le dessin, le graphique, la maquette.
     Le seuil e-mail devient un panneau ouvert par l'appel à l'action. Même requête que TABLEAU (outils.ts). */
  @media (min-width: 1200px) and (min-height: 700px) {
    --pad-x: clamp(20px, 2vw, 40px);
    --pad-y: clamp(10px, 1.3vh, 18px);
    --gx: clamp(18px, 1.6vw, 32px);
    --gy: clamp(9px, 1.15vh, 16px);
    display: grid;
    max-width: none;
    height: calc(100vh - var(--flash-haut) - 12px);
    padding: var(--pad-y) var(--pad-x);
    gap: var(--gy) var(--gx);
    grid-template-columns: clamp(300px, 19vw, 360px) minmax(0, 1fr) clamp(300px, 24vw, 460px);
    grid-template-rows: auto minmax(0, 1fr) auto;

    .gauche { grid-area: gauche; display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 20px); min-height: 0; overflow-y: auto; scrollbar-width: thin; }
    .flash-tete h2 { margin-top: 6px; font-size: clamp(26px, 3.5vh, 40px); line-height: 1.04; }
    .flash-tete p.texte { margin-top: 10px; font-size: 14.5px; line-height: 1.45; color: var(--fg-1); }
    .cas-fictif { margin-top: 8px; }
    .champs { gap: clamp(8px, 1.5vh, 14px); }
    .champ { gap: 2px; }

    .bande { grid-area: bande; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; grid-template-areas: "pri chi cta"; gap: 0 clamp(28px, 3vw, 56px); align-items: end; padding-top: 14px; }
    .principal { grid-area: pri; }
    .rangee-chiffres { grid-area: chi; gap: 12px clamp(18px, 2vw, 36px); padding-bottom: 4px; }
    .cta { grid-area: cta; align-self: center; }
    .principal .chiffre .n { font-size: clamp(46px, 6.6vh, 76px); }
    .principal .chiffre .p { max-width: 44ch; }
    .rangee-chiffres .chiffre .n { font-size: clamp(24px, 3.2vh, 32px); }
    .rangee-chiffres .chiffre .p { max-width: 50ch; }

    .planche-dessin { grid-area: dessin; position: relative; top: auto; z-index: auto; min-height: 0; margin: 0; border-radius: var(--r); box-shadow: none; }
    .planche-dessin .dessin { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; }
    .planche-pied { grid-area: pied; align-self: start; min-width: 0; }
    .detail-calcul { grid-area: mention; align-self: end; padding-top: 8px; }
    .detail-calcul > .detail-corps { position: absolute; z-index: 5; right: var(--pad-x); bottom: calc(var(--pad-y) + 34px); width: min(640px, calc(100% - 2 * var(--pad-x))); max-height: calc(100% - 2 * var(--pad-y) - 44px); overflow-y: auto; margin: 0; padding: 18px 22px; background: var(--surface); border-radius: var(--r); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .8), 0 0 0 1px var(--rule-strong); }

    .seuil-hote { position: absolute; z-index: 6; top: var(--pad-y); right: var(--pad-x); display: none; width: min(840px, calc(100% - 2 * var(--pad-x))); max-height: calc(100% - 2 * var(--pad-y)); overflow-y: auto; border-radius: var(--r); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .8), 0 0 0 1px var(--rule-strong); }
    .seuil-hote.ouvert { display: block; }
    .seuil-hote .seuil { margin: 0; padding-right: 56px; }
    .seuil-fermer { display: block; }
  }
  @media (prefers-reduced-motion: reduce) {
    &, & *, & *::before, & *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  }
}

/* ================================================================ A : le bâtiment-graphique */
.flash-a {
  .regrouper[aria-pressed="true"] { border-color: var(--ek-laiton); color: var(--ek-laiton); }
  .semaine-bloc { display: grid; gap: 10px; }
  .semaine-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
  .semaine { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .jour { display: grid; gap: 6px; justify-items: stretch; }
  .jour-barre { position: relative; height: 112px; border: 1px solid var(--rule-strong); border-radius: 2px; cursor: ns-resize; touch-action: none; background:
    repeating-linear-gradient(0deg, var(--rule) 0 1px, transparent 1px 20%); }
  .jour-barre:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .jour-rempli { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: rgba(178, 106, 63, 0.5); border-top: 2px solid var(--ek-copper); transition: height var(--d-ui) var(--ease); }
  .jour.actif .jour-rempli { background: rgba(178, 106, 63, 0.85); }
  .jour-pc { position: absolute; left: 6px; top: 6px; font: 400 12px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
  .jour-pic { position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; background: var(--ek-laiton); display: none; }
  .jour.pic .jour-pic { display: block; }
  .jour button { height: 28px; border: 0; border-radius: var(--r); background: transparent; font: 500 12px/1 var(--font-mono); letter-spacing: var(--track-meta); text-transform: uppercase; cursor: pointer; }
  .jour.actif button { background: var(--heading); color: var(--bg); }

  .affiner { border-top: 1px solid var(--rule); padding-top: 14px; }
  .affiner summary { cursor: pointer; font: 500 14px/1.3 var(--font-body); list-style: none; display: flex; justify-content: space-between; }
  .affiner summary::-webkit-details-marker { display: none; }
  .affiner summary::after { content: "+"; font-family: var(--font-mono); }
  .affiner[open] summary::after { content: "−"; }
  .affiner .champs { margin-top: 14px; }

  .niveau { fill: none; stroke: rgba(243, 244, 238, 0.55); stroke-width: 1; }
  .poste { fill: none; stroke: var(--ek-wood); stroke-width: 1; transition: opacity 500ms var(--ease); }
  .regroupe .poste { opacity: 0.18; }
  .personne { fill: var(--ek-copper); }
  .surplus { fill: url(#flash-a-hachures); transition: opacity 500ms var(--ease); opacity: 0.55; }
  .regroupe .surplus { opacity: 1; }
  .coupe { fill: none; stroke: var(--ek-laiton); stroke-width: 2; stroke-dasharray: 6 4; }
  .surplus-chiffre { font-family: var(--font-display) !important; font-size: 30px; fill: var(--ek-laiton) !important; }
  .surplus-euros { font-size: 12px; fill: var(--ek-laiton) !important; }

  @media (max-width: 899px) { .jour-barre { height: 84px; } }
  @media (min-width: 1200px) and (min-height: 700px) {
    grid-template-areas: "gauche bande bande" "gauche dessin pied" "gauche dessin mention";
    .planche-pied { gap: clamp(12px, 2vh, 20px); }
    .jour-barre { height: clamp(90px, 18vh, 200px); }
  }
}

/* ================================================================ B : le point de bascule */
.flash-b {
  .b-graphe { position: sticky; top: var(--flash-haut); z-index: 2; min-width: 0; margin: 0 calc(-1 * var(--pad-x)); padding: 8px var(--pad-x); background: var(--bg); box-shadow: 0 10px 18px -12px rgba(0, 0, 0, .55); }
  .b-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: start; min-width: 0; }

  .b-recap { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--rule-strong); border-radius: var(--r); }
  .b-recap p { margin: 0; font: 400 13px/1.55 var(--font-mono); color: var(--fg-1); }

  .b-graphe-cadre { height: 34vh; min-height: 220px; border-radius: var(--r); overflow: hidden; background: var(--ek-paper); }
  .b-graphe-cadre svg, .b-elevations svg { display: block; width: 100%; height: 100%; }
  .b-verdict { margin: 8px 0 0; min-height: 1.4em; font: italic 400 19px/1.4 var(--font-dek); color: var(--fg-1); }

  .b-elevations { height: 210px; border-radius: var(--r); overflow: hidden; background: var(--ek-paper); }
  .g-bat { transform-box: fill-box; transform-origin: 50% 100%; transition: transform var(--d-scene) var(--ease); }

  .g-tick { font: 400 10.5px var(--font-mono); fill: var(--ek-chalk); fill-opacity: .62; }
  .g-meta { font: 400 10.5px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; fill: var(--ek-chalk); fill-opacity: .78; }
  .g-cote { font: 500 15px var(--font-mono); fill: var(--ek-chalk); }
  .g-fin { font: 400 14px var(--font-mono); fill: var(--ek-chalk); }

  .b-depart { min-width: 0; }
  .b-depart .etiquette { margin: 0; }
  .b-puces-cout { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .b-puces-cout li { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 14px; border: 1px solid var(--rule-strong); border-radius: var(--r-pill); font: 500 13px/1.3 var(--font-body); }
  .b-puces-cout li .m { font: 400 13px/1.3 var(--font-mono); }
  .b-puces-cout li .h { font: 400 10px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); opacity: .78; }
  .b-puces-cout li.gain { border-color: var(--ek-laiton); }

  .b-lien { justify-self: start; padding: 0; border: 0; background: none; font: 500 12.5px/1.4 var(--font-body); color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .b-mois output { font-size: 16px; }
  .valeur output { font-variant-numeric: tabular-nums; }

  @media (max-width: 899px) {
    .b-details { grid-template-columns: minmax(0, 1fr); }
    .b-verdict { margin-top: 6px; font-size: 15px; }
  }
  @media (min-width: 1200px) and (min-height: 700px) {
    grid-template-areas: "gauche bande bande" "gauche graphe details" "gauche graphe mention";
    .b-graphe { grid-area: graphe; position: relative; top: auto; z-index: auto; display: flex; flex-direction: column; min-height: 0; margin: 0; padding: 0; background: none; box-shadow: none; }
    .b-graphe-cadre { flex: 1 1 auto; height: auto; min-height: 0; }
    .b-details { grid-area: details; grid-template-columns: minmax(0, 1fr); gap: clamp(12px, 2vh, 20px); align-content: start; }
    .b-elevations { height: clamp(180px, 30vh, 320px); }
    .b-champs .puces button { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
  }
  @media (prefers-reduced-motion: reduce) { .g-bat { transition: none; } }
}

/* ================================================================ C : les étages vides */
.flash-c {
  .relouer[aria-pressed="true"] { border-color: var(--ek-laiton); color: var(--ek-laiton); }
  .scenario { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: end; }

  /* Règle de marché : bande des loyers de la ville, repère du loyer en place */
  .marche { position: relative; height: 70px; margin-top: 4px; }
  .marche .regle { position: absolute; inset: auto 0 0 0; }
  .marche-bande { position: absolute; left: 0; width: 0; bottom: 30px; height: 18px; border: 1px solid var(--rule-strong); border-bottom: 0; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--fg-1) 8%, transparent) 0 2px, transparent 2px 6px); }
  .marche-bande span { position: absolute; right: 0; bottom: calc(100% + 3px); font: 400 10px/1.3 var(--font-mono); white-space: nowrap; color: var(--fg-2); }
  .marche-repere { position: absolute; bottom: 0; width: 0; height: 52px; border-left: 1px dashed color-mix(in srgb, var(--fg-1) 70%, transparent); }
  .marche-repere span { position: absolute; right: 4px; bottom: 34px; font: 400 10px/1 var(--font-mono); white-space: nowrap; color: var(--fg-2); }
  .marche-repere.gauche span { right: auto; left: 4px; }

  /* Décret tertiaire */
  .decret { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--rule-strong); }
  .decret-texte { margin: 12px 0 16px; font-size: 15px; max-width: 46ch; }
  .decret-texte strong { font-weight: 500; }
  .echelle-dpe { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 360px; }
  .echelle-dpe span { position: relative; height: 30px; display: grid; place-items: center; border-radius: 2px; font: 500 13px/1 var(--font-mono); }
  .echelle-dpe span.actuelle { outline: 2px solid var(--heading); outline-offset: 2px; }
  .echelle-dpe span.cible::after { content: ""; position: absolute; top: -10px; width: 6px; height: 6px; background: var(--ek-laiton); }
  .trajectoire { width: 100%; height: auto; color: var(--fg-1); }
  .trajectoire text { font-family: var(--font-mono); font-size: 10px; fill: currentColor; }

  /* Étages */
  .etage { cursor: pointer; outline: none; }
  .etage .cadre { fill: transparent; stroke: rgba(243, 244, 238, 0.55); stroke-width: 1; }
  .etage .loue { fill: #1F4D3A; transition: opacity 400ms var(--ease); }
  .etage .vacant { opacity: 0; transition: opacity 400ms var(--ease); }
  .etage.est-vacant .loue { opacity: 0; }
  .etage.est-vacant .vacant { opacity: 1; }
  /* Jérémy, 22 octobre : étage occupé par le propriétaire, sauge pleine, sans loyer */
  .etage .occupe, .occupe-pastille { fill: #8FA394; fill-opacity: 0.4; }
  .etage .occupe { opacity: 0; transition: opacity 400ms var(--ease); }
  .etage.est-occupe .loue { opacity: 0; }
  .etage.est-occupe .occupe { opacity: 1; }
  .etage .reloue { fill: #1F4D3A; transform-box: fill-box; transform-origin: left center; transform: scaleX(0); transition: transform 300ms var(--ease); }
  .relouer-on .etage.est-vacant .reloue { transform: scaleX(1); transition: transform 800ms var(--ease) var(--retard, 0ms); }
  .etage .lisere, .etage .teinte { fill: var(--ek-laiton); opacity: 0; transition: opacity 250ms var(--ease); }
  .relouer-on .etage.est-vacant .lisere { opacity: 1; transition: opacity 500ms var(--ease) calc(var(--retard, 0ms) + 300ms); }
  .relouer-on .etage.est-vacant .teinte { opacity: 0.2; transition: opacity 500ms var(--ease) calc(var(--retard, 0ms) + 300ms); }
  .etage .info.reloue-txt { font-weight: 500; }
  .etage:hover .cadre, .etage:focus-visible .cadre { stroke: var(--ek-laiton); stroke-width: 2; }
  .etage .info { font-size: 10.5px; }
  .etage .info.perdu { fill: var(--ek-laiton) !important; }
  .meneaux line { stroke: rgba(243, 244, 238, 0.13); stroke-width: 1; pointer-events: none; }
  .consigne { font-size: 10px; letter-spacing: 0.1em; fill-opacity: 0.75; }

  @media (max-width: 899px) {
    .scenario, .decret { grid-template-columns: minmax(0, 1fr); }
  }
  @media (min-width: 1200px) and (min-height: 700px) {
    /* C porte aussi la maquette et le décret : la hauteur de l'écran est un minimum, l'outil grandit
       plutôt que de couper la maquette si l'écran est bas (1440×900 : voir le rapport W10). */
    height: auto;
    min-height: calc(100vh - var(--flash-haut) - 12px);
    .gauche { overflow: visible; }
    grid-template-columns: clamp(300px, 19vw, 360px) minmax(0, 0.85fr) minmax(0, 1.15fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "gauche bande bande" "gauche dessin o33" "gauche dessin decret" "gauche pied pied" "gauche mention mention";
    .planche-pied { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: var(--gx); align-items: end; }
    .scenario { gap: var(--gx); }
    #flash-c-travaux button { min-height: 28px; padding: 0 10px; font-size: 12px; }
    .commandes { align-items: center; }
    .decret { grid-area: decret; margin: 0; padding-top: 6px; gap: clamp(16px, 1.6vw, 28px); }
    .trajectoire { max-height: clamp(96px, 14vh, 150px); }
    .mention { max-width: none; }
    .decret-texte { margin: 8px 0 10px; font-size: 14px; }
    .echelle-dpe span { height: 24px; }
    /* La maquette O33 (posée avant .decret par la page) prend sa case : texte à gauche, maquette à droite */
    > .histoire-diagnostic-o33.dans-flash { grid-area: o33; min-height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; }
    .histoire-diagnostic-o33 .stop-o33 { height: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px clamp(16px, 1.6vw, 28px); }
    .stop-o33 > .stop-modele { aspect-ratio: auto; height: 100%; min-height: 0; }
    .stop-o33 .stop-tete-ligne { flex-direction: column; align-items: flex-start; gap: 10px; }
    .stop-o33 .stop-surtitre { margin-bottom: 4px; }
    .stop-o33 .stop-titre { font-size: clamp(24px, 3.2vh, 32px); }
    .stop-o33 .stop-texte { margin-top: 6px; font-size: 13.5px; line-height: 1.45; }
    .stop-o33 > .stop-barre { margin-top: 0; }
    .stop-o33 .stop-bouton { padding: 0 12px; font-size: 13px; }
    .stop-o33 .stop-legende { gap: 4px 12px; font-size: 12.5px; }
    .stop-o33 .stop-legende span { gap: 6px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .etage .reloue, .etage .lisere { transition: none; }
  }
}

/* ================================================================ page diagnostic (mode clair) */
/* Les trois outils sur une page : bandes blanche, Brume, blanche. Les dessins gardent leur papier de plan. */
.diagnostic-bande { background: var(--bg); scroll-margin-top: 63px; }
.diagnostic-bande.brume { --bg: var(--ek-mist); }
body:not(.mode-dark) .flash select.ville { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230F2A1F' stroke-width='1.5'/%3E%3C/svg%3E"); }
