/* === Fontshare — Satoshi 400 Regular · 500 Medium · 700 Bold · 900 Black === */
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@900,700,500,400&display=swap');

/*
 * ─── Mapping couleurs (anciens tokens → nouveaux tokens) ─────────────────────
 *
 * Variables CSS supprimées → remplacées par :
 *   --bleu (#1a4f7a)          → --color-primary (#01696f)
 *   --bleu-clair (#2980b9)    → --color-primary-hover (#015459)
 *   --fond (#f4f6f9)          → --color-bg (#f6f7f5)
 *   --blanc (#ffffff)         → --color-surface
 *   --gris-bord (#dde3ea)     → --color-border (oklch alpha-blended)
 *   --gris-texte (#555e6d)    → --color-text-secondary (#4a5552)
 *   --vert (#1a7a4a)          → --color-success (#1a6b3a)
 *   --vert-bg (#eaf5ee)       → --color-success-bg (#eef7f2)
 *   --vert-bord (#a3d9b8)     → --color-success-border (oklch)
 *   --rouge (#b03030)         → --color-error (#8b2020)
 *   --rouge-bg (#fdf0f0)      → --color-error-bg
 *   --rouge-bord (#e8b0b0)    → --color-error-border (oklch)
 *   --ardoise (#34495e)       → --color-neutral-verdict (#3d5066)
 *   --ardoise-bg (#eaecee)    → --color-neutral-bg (#edf0f4)
 *   --ardoise-bord (#aab4be)  → --color-neutral-border (oklch)
 *   --orange (#b85c00)        → --color-warning (#7a4f00)
 *   --orange-bg (#fff5e6)     → --color-warning-bg (#fdf5e6)
 *   --orange-bord (#f0c88a)   → --color-warning-border (oklch)
 *   --rayon (6px)             → --radius-sm (0.375rem) · --radius-md (0.5rem)
 *   --ombre                   → --shadow (tone-matched vert pétrole)
 *
 * Radius split (Étape 2) :
 *   --radius-sm : 0.375rem (6px) — inputs, boutons, badges, notes inline
 *   --radius-md : 0.5rem  (8px) — cartes, panneaux, blocs, verdicts
 *
 * Couleurs hardcodées purgées (14 valeurs, ~28 occurrences) :
 *   #2c3340              → var(--color-text)
 *   #eef2f7              → var(--color-surface-2) ou var(--color-primary-subtle)
 *   #e8f0f7              → var(--color-primary-subtle)
 *   #e8ecf0              → var(--color-surface-offset)
 *   #fafbfc              → var(--color-surface-2)
 *   #f0f3f7              → var(--color-surface-2)
 *   #f4f6f9              → var(--color-bg)
 *   #eaecee              → var(--color-surface-offset)
 *   #eef4fa              → var(--color-primary-subtle)
 *   #b5cfe3              → var(--color-primary-border)
 *   #c5d0dc              → var(--color-primary-border)
 *   #b8c2cc              → var(--color-border)
 *   #5c3000              → var(--color-warning)
 *   rgba(41,128,185,…)   → var(--color-focus-ring) / rgba(1,105,111,…)
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ─── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  /* Accent — vert pétrole */
  --color-primary:          #01696f;
  --color-primary-hover:    #015459;
  --color-primary-subtle:   oklch(from #01696f l c h / 0.08);
  --color-primary-border:   oklch(from #01696f l c h / 0.20);
  --color-focus-ring:       rgba(1, 105, 111, 0.18);

  /* Surfaces */
  --color-bg:               #f6f7f5;
  --color-surface:          #ffffff;
  --color-surface-2:        #f0f2f0;
  --color-surface-offset:   #e8ecea;

  /* Borders — toujours alpha-blended */
  --color-border:           oklch(from #01696f l c h / 0.12);
  --color-border-strong:    oklch(from #01696f l c h / 0.25);

  /* Texte */
  --color-text:             #1a1f1e;
  --color-text-secondary:   #4a5552;
  --color-text-muted:       #7a8986;
  --color-text-on-primary:  #ffffff;

  /* Sémantique — verdict Globale */
  --color-success:          #1a6b3a;
  --color-success-bg:       #eef7f2;
  --color-success-border:   oklch(from #1a6b3a l c h / 0.25);

  /* Sémantique — verdict Élément par élément */
  --color-neutral-verdict:  #3d5066;
  --color-neutral-bg:       #edf0f4;
  --color-neutral-border:   oklch(from #3d5066 l c h / 0.25);

  /* Sémantique — avertissement / hors périmètre */
  --color-warning:          #7a4f00;
  --color-warning-bg:       #fdf5e6;
  --color-warning-border:   oklch(from #7a4f00 l c h / 0.25);

  /* Sémantique — erreur formulaire */
  --color-error:            #8b2020;
  --color-error-bg:         #fdf0f0;
  --color-error-border:     oklch(from #8b2020 l c h / 0.25);

  /* Ombre tone-matched vert pétrole */
  --shadow:                 0 2px 8px rgba(1, 105, 111, 0.10);

  /* Radius — sm : inline elements / md : cartes et panneaux */
  --radius-sm:              0.375rem;
  --radius-md:              0.5rem;

  /* Typographie — tailles nommées */
  --text-xs:                0.75rem;    /* 12px — captions, th tableau */
  --text-sm:                0.875rem;   /* 14px — corps compact */
  --text-xl:                1.75rem;    /* 28px — display, verdict uniquement */
}

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

body {
  font-family: 'Satoshi', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── En-tête ───────────────────────────────────────────────────────────────── */
header {
  background: var(--color-surface-2);
  color: var(--color-text);
  padding: 24px;
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.10);
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .02em;
}

header .subtitle {
  margin-top: .25rem;
  font-size: .95rem;
  color: var(--color-text-secondary);
}

/* ─── Mise en page principale ───────────────────────────────────────────────── */
main {
  max-width: 780px;
  width: 100%;
  margin-block: 32px;
  margin-inline: auto;
  padding: 0 24px 48px;
  flex: 1;
}

/* ─── Pied de page ──────────────────────────────────────────────────────────── */
footer {
  background: var(--color-surface-offset);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.10);
  padding: .85rem 24px;
  font-size: .8rem;
  color: var(--color-text-muted);
  text-align: center;
}

footer a {
  color: var(--color-primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ─── Formulaire ────────────────────────────────────────────────────────────── */
#rtex-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 2rem;
}

.form-section {
  padding: 1.5rem 1.75rem;
}

.form-section + .form-section {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.form-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid oklch(from var(--color-text) l c h / 0.15);
  display: inline-block;
}

/* Champs */
.field {
  margin-bottom: 1.2rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .35rem;
  color: var(--color-text);
}

.field input[type="number"],
.field select {
  width: 100%;
  max-width: 340px;
  padding: .55rem .8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color .15s, box-shadow .15s;
}

.field input[type="number"]:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.hint {
  display: block;
  margin-top: .3rem;
  font-size: .75rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Bloc déductions SHON */
.shon-deductions {
  margin-left: 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid oklch(from var(--color-text) l c h / 0.12);
}

.deduction-row {
  margin-bottom: .9rem;
}

.deduction-row label {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: .3rem;
  color: var(--color-text);
}

.deduction-row input[type="number"] {
  width: 100%;
  max-width: 220px;
  padding: .45rem .7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  background: var(--color-surface);
}

.deduction-row input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.ratio-hab-display {
  margin: .4rem 0 .3rem;
  padding: .45rem .75rem;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--color-text-secondary);
}

.shon-effective-display {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .5rem 0 .6rem;
  padding: .55rem .8rem;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.shon-effective-display strong {
  font-size: 1rem;
}

.hint-inline {
  font-size: .75rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* Groupe de radios */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 400;
  cursor: pointer;
}

.radio-label input[type="radio"] {
  margin-top: .2rem;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

/* Case à cocher */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .88rem;
  cursor: pointer;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  color: var(--color-warning);
}

.checkbox-label input[type="checkbox"] {
  margin-top: .15rem;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--color-warning);
}

/* Bouton calculer */
.form-footer {
  padding: 1.25rem 1.75rem;
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-border);
}

#btn-calculer {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  border: none;
  padding: .7rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .15s, transform .1s;
}

#btn-calculer:hover  { background: var(--color-primary-hover); }
#btn-calculer:active { transform: scale(.98); }

/* ─── Résultats ─────────────────────────────────────────────────────────────── */
#resultats.hidden { display: none; }

/* Verdict */
.verdict {
  border-radius: var(--radius-md);
  padding: 1.4rem 1.75rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.verdict.globale {
  background: var(--color-success-bg);
  border-color: var(--color-success);
}

.verdict.elements {
  background: var(--color-neutral-bg);
  border-color: var(--color-neutral-verdict);
}

.verdict.hors-perimetre {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
}

.verdict.scinde {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
}

.verdict-titre {
  font-size: var(--text-xl);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .02em;
  margin-bottom: .35rem;
}

.verdict.globale        .verdict-titre { color: var(--color-success); }
.verdict.elements       .verdict-titre { color: var(--color-neutral-verdict); }
.verdict.hors-perimetre .verdict-titre { color: var(--color-warning); }
.verdict.scinde         .verdict-titre { color: var(--color-primary); }

.verdict-sous {
  font-size: .88rem;
  color: var(--color-text);
  line-height: 1.5;
}

/* Détail verdict scindé */
.verdict-scinde-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  position: relative;
}

.verdict-scinde-detail::after {
  content: '';
  position: absolute;
  top: .75rem;
  bottom: .75rem;
  left: 50%;
  transform: translateX(-0.5px);
  width: 1px;
  background: oklch(from var(--color-text) l c h / 0.10);
  pointer-events: none;
}

.scinde-part {
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
}

.scinde-avant {
  background: var(--color-neutral-bg);
  border-color: var(--color-neutral-verdict);
}

.scinde-apres {
  background: var(--color-success-bg);
  border-color: var(--color-success);
}

.scinde-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: .25rem;
}

.scinde-volet {
  display: block;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .01em;
}

.scinde-avant .scinde-volet { color: var(--color-neutral-verdict); }
.scinde-apres .scinde-volet { color: var(--color-success); }

.scinde-source {
  display: block;
  font-size: .72rem;
  color: var(--color-text-muted);
  margin-top: .2rem;
  font-style: italic;
}

@media (max-width: 480px) {
  .verdict-scinde-detail { grid-template-columns: 1fr; }
}

.row-scinde { background: var(--color-surface-2); }

.verdict-note {
  margin-top: .75rem;
  padding: .6rem .9rem;
  background: var(--color-warning-bg);
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--color-warning);
  line-height: 1.5;
}

/* Blocs résultats */
.bloc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.75rem;
  margin-bottom: 1.25rem;
}

.bloc h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: .9rem;
  padding-bottom: .45rem;
  border-bottom: 2px solid var(--color-primary-hover);
  display: inline-block;
}

.source-note {
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-style: italic;
}

/* Tableau des conditions */
.conditions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.conditions-table th {
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .55rem .8rem;
  text-align: left;
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.12);
}

.conditions-table td {
  padding: .75rem .8rem;
  vertical-align: top;
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 400;
}

.conditions-table tbody tr:last-child td {
  border-bottom: none;
}

.row-ok   { background: var(--color-success-bg); }
.row-nok  { background: var(--color-error-bg); }
.row-hors { background: var(--color-warning-bg); }

.source {
  font-size: .75rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.ratio-label {
  font-size: .8rem;
  color: var(--color-text-muted);
}

.seuil {
  font-size: .8rem;
  color: var(--color-text-muted);
}

/* Badges état */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge.ok   { background: var(--color-success-bg);  color: var(--color-success);        border: 1px solid var(--color-success-border); }
.badge.nok  { background: var(--color-error-bg);    color: var(--color-error);          border: 1px solid var(--color-error-border); }
.badge.hors { background: var(--color-warning-bg);  color: var(--color-warning);        border: 1px solid var(--color-warning-border); }

/* DL calcul détaillé */
.calcul-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem 1.25rem;
  font-size: var(--text-sm);
  align-items: baseline;
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.10);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: var(--color-text-secondary);
}

.calcul-detail dt {
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  padding-top: .1rem;
}

.calcul-detail dd {
  line-height: 1.6;
}

.calcul-detail dd + dt {
  padding-top: .6rem;
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.10);
  margin-top: .1rem;
}

.calcul-detail dd + dt ~ dd {
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.10);
  padding-top: .6rem;
}

.note-usage {
  display: block;
  font-size: .78rem;
  color: var(--color-text-secondary);
  margin-top: .15rem;
  font-style: italic;
}

/* Bloc erreurs — fond neutre, seule la bordure est colorée */
.erreurs {
  background: var(--color-surface);
  border-left: 3px solid var(--color-error);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  color: var(--color-error);
}

.erreurs h2 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: .5rem;
}

.erreurs ul {
  padding-left: 1.25rem;
  font-size: var(--text-xs);
}

.erreurs li { margin-bottom: .25rem; }

/* Erreur au niveau du champ */
.field.error input[type="number"],
.field.error select {
  border-color: var(--color-error);
  border-left-width: 3px;
}

.error-message {
  display: block;
  margin-top: .25rem;
  font-size: var(--text-xs);
  color: var(--color-error);
  line-height: 1.4;
}

/* ─── Cartes bâtiment ──────────────────────────────────────────────────────── */
.batiment-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  margin-bottom: 1rem;
  overflow: hidden;
}

.batiment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1.25rem;
  background: var(--color-surface-offset);
  border-bottom: 1px solid var(--color-border);
}

.batiment-num {
  font-weight: 600;
  font-size: .95rem;
  color: var(--color-text);
  letter-spacing: .02em;
}

.btn-remove {
  background: none;
  border: 1px solid var(--color-error-border);
  color: var(--color-error);
  padding: .2rem .65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .78rem;
  font-family: inherit;
  transition: background .12s;
}

.btn-remove:hover { background: var(--color-error-bg); }

.card-fields {
  padding: 1rem 1.25rem;
}

.card-fields .field { margin-bottom: 1rem; }
.card-fields .field:last-child { margin-bottom: 0; }

/* Bouton ajout bâtiment */
.add-batiment-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: .25rem;
}

#btn-add-batiment {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  transition: background .12s, border-color .12s;
}

#btn-add-batiment:hover:not(:disabled) { background: var(--color-surface-offset); border-color: var(--color-border-strong); }

#btn-add-batiment:disabled {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  cursor: not-allowed;
}

.batiments-count {
  font-size: .82rem;
  color: var(--color-text-secondary);
}

/* Info multi-bâtiments */
.multi-info {
  margin-top: .75rem;
  padding: .55rem .9rem;
  background: var(--color-primary-subtle);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--color-primary);
}

/* Hint inline radio coût mode */
.radio-hint {
  display: block;
  font-size: .75rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: .1rem;
  padding-left: 1.6rem;
}

/* ─── Table de synthèse multi-bâtiments ─────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.multi-summary th,
.multi-summary td {
  white-space: nowrap;
}

.multi-summary td:first-child { white-space: normal; }

.prorata-note {
  font-size: .82rem;
  color: var(--color-text-secondary);
  margin-bottom: .9rem;
  line-height: 1.6;
  padding: .5rem .75rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

/* Badges verdict dans la synthèse */
.badge.verdict-globale  { background: var(--color-success-bg);   color: var(--color-success);        border: 1px solid var(--color-success-border); }
.badge.verdict-elements { background: var(--color-neutral-bg);   color: var(--color-neutral-verdict); border: 1px solid var(--color-neutral-border); }
.badge.verdict-scinde   { background: var(--color-surface-2);    color: var(--color-primary);         border: 1px solid var(--color-primary-border); }

/* ─── Détails dépliables par bâtiment ──────────────────────────────────────── */
.building-detail {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.building-detail > summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .85rem 1.25rem;
  background: var(--color-bg);
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid transparent;
  transition: background .12s;
  user-select: none;
}

.building-detail > summary::-webkit-details-marker { display: none; }

.building-detail > summary::before {
  content: '▶';
  font-size: .7rem;
  color: var(--color-text-secondary);
  transition: transform .15s;
  flex-shrink: 0;
}

.building-detail[open] > summary::before { transform: rotate(90deg); }

.building-detail[open] > summary {
  border-bottom-color: var(--color-border);
  background: var(--color-surface-2);
}

.building-detail > summary:hover { background: var(--color-surface-offset); }

.summary-label {
  font-weight: 700;
  font-size: .95rem;
  color: var(--color-primary);
}

.summary-shon {
  font-size: .8rem;
  color: var(--color-text-secondary);
  margin-left: auto;
}

.building-detail-body {
  padding: 1.25rem;
}

/* Les blocs à l'intérieur d'un détail n'ont pas de box-shadow redondant */
.building-detail-body .bloc {
  box-shadow: none;
  border-color: var(--color-border);
}

.building-detail-body .verdict {
  margin-bottom: 1rem;
}

/* ─── Bâtiments accolés ─────────────────────────────────────────────────────── */

/* Case à cocher accolés — variante primaire */
.checkbox-label.checkbox-accoles {
  background: var(--color-primary-subtle);
  border-color: var(--color-primary-border);
  color: var(--color-primary);
}
.checkbox-label.checkbox-accoles input[type="checkbox"] {
  accent-color: var(--color-primary);
}

/* Panel de choix (résultats) */
.accoles-choix-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-choix-accoles {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.btn-choix-accoles:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  box-shadow: 0 2px 8px rgba(1, 105, 111, 0.15);
}

.btn-choix-accoles strong {
  font-size: .95rem;
  color: var(--color-primary);
}

.btn-choix-accoles span {
  font-size: .82rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

/* Sous-panneau changement d'usage */
.chgt-usage-detail {
  margin-left: 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--color-warning-border);
  margin-top: .5rem;
}

/* Note art. 14 — variante informative, neutre */
.verdict-note.verdict-note-info {
  background: var(--color-surface-offset);
  border: 1px solid oklch(from var(--color-text) l c h / 0.12);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.verdict-note-source {
  display: block;
  margin-top: .3rem;
  font-size: .75rem;
  font-style: italic;
  opacity: .8;
}

/* Note cas 3 dans le tableau de synthèse */
.accoles-cas3-note {
  margin-top: .85rem;
  padding: .6rem .9rem;
  background: var(--color-surface-offset);
  border: 1px solid oklch(from var(--color-text) l c h / 0.12);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.accoles-cas3-note .source {
  display: block;
  margin-top: .2rem;
  font-style: italic;
  color: var(--color-text-muted);
}

/* Bannière ensemble dans les résultats */
.accoles-ensemble-banner {
  padding: .85rem 1.1rem;
  background: var(--color-surface-offset);
  border: 1px solid oklch(from var(--color-text) l c h / 0.12);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  header { padding: 16px; }

  main {
    padding: 0 16px 32px;
    margin-block: 16px;
  }

  footer { padding: .85rem 16px; }

  .form-section  { padding: 1.1rem 1rem; }
  .form-footer   { padding: 1rem; }
  .bloc          { padding: 1rem; }

  .field input[type="number"],
  .field select { max-width: 100%; }

  /* Tableau conditions — scroll horizontal sur mobile */
  .conditions-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: .8rem;
  }
  .conditions-table th,
  .conditions-table td { padding: .55rem .55rem; }

  .calcul-detail {
    grid-template-columns: 1fr;
  }

  .calcul-detail dt {
    border-top: 1px solid oklch(from var(--color-text) l c h / 0.10);
    padding-top: .6rem;
  }
  .calcul-detail dt:first-child { border-top: none; padding-top: 0; }
  .calcul-detail dd + dt { border-top: none; margin-top: 0; }
  .calcul-detail dd + dt ~ dd { border-top: none; padding-top: 0; }

  .accoles-choix-buttons { grid-template-columns: 1fr; }
}

/* ─── Breakpoint 375px — petits mobiles ─────────────────────────────────────── */
@media (max-width: 375px) {
  main { padding-inline: 12px; }

  .verdict { padding: 1rem 1.25rem; }

  .bloc { padding: .75rem 1rem; }

  .form-section { padding: 1rem .75rem; }
  .form-footer  { padding: .75rem 1rem; }

  .card-fields  { padding: .75rem 1rem; }

  .building-detail-body { padding: 1rem .75rem; }
}
