/* Hallmark · checked · theme: carnet de terrain (custom) · genre modern-minimal · scope app · v2.0.0 */
/* built: Hallmark · redesign: full · wiring kept (app.js / maison3d.js intacts) */

/* ─── Shell & rail ─────────────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  height: 100dvh;
  padding: var(--s5) var(--s4) var(--s4);
  border-right: 1px solid var(--line-strong);
  background: var(--nav-bg);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) var(--s2);
  text-decoration: none;
}

.wordmark__icone {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 11px;
  box-shadow: 0 6px 16px -8px rgb(20 21 13 / 0.45);
}

/* En-tête de marque sur téléphone (le rail devient la barre d'onglets du bas) */
.topbar {
  display: none;
}

.wordmark__main {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wordmark__ia {
  color: var(--accent-text);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding-top: 0;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  padding: 0 var(--s3);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink-faint);
  font-weight: 500;
  font-size: var(--text-base);
  transition: background-color 0.14s var(--ease), color 0.14s var(--ease);
}

.nav__link svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav__link:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.nav__link[aria-current="page"] {
  background: var(--paper-2);
  color: var(--ink);
}

.nav__link[aria-current="page"] svg {
  color: var(--accent-text);
}

.rail__foot {
  margin-top: auto;
  display: grid;
  gap: var(--s3);
  padding: var(--s3) var(--s2) 0;
  border-top: 1px solid var(--line);
}

.rail__provider {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  line-height: 1.45;
}

.rail__note {
  font-size: var(--text-xs);
  color: var(--ink-faint);
  line-height: 1.45;
}

body.is-anon .nav,
body.is-anon .rail__foot {
  display: none;
}

.main {
  min-width: 0;
  padding: var(--s7) var(--s6) var(--s8);
}

#view {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  display: grid;
  gap: var(--s5);
  align-content: start;
}

#view > * {
  margin-top: 0;
}

.view-enter {
  animation: rise 0.4s var(--ease) both;
}

/* Changement d'onglet : la vue glisse depuis le côté de l'onglet choisi */
.view-enter--droite { animation: glisse-droite 0.42s var(--ease) both; }
.view-enter--gauche { animation: glisse-gauche 0.42s var(--ease) both; }
@keyframes glisse-droite { from { opacity: 0; transform: translateX(min(14vw, 64px)); } to { opacity: 1; transform: none; } }
@keyframes glisse-gauche { from { opacity: 0; transform: translateX(max(-14vw, -64px)); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .view-enter--droite, .view-enter--gauche { animation: none; }
}

/* ─── Barre de chargement & squelettes ─────────────────────────────────── */

.loadbar {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}

.loadbar span {
  display: block;
  height: 100%;
  background: var(--ring);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
}

.loadbar.is-on span {
  transform: scaleX(0.72);
  transition: transform 9s cubic-bezier(0.1, 0.6, 0.2, 1);
}

.loadbar.is-done span {
  transform: scaleX(1);
  transition: transform 0.18s ease;
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skeleton--title {
  height: 2.4rem;
  width: min(60%, 16rem);
}

.skeleton--card {
  height: 10rem;
  border-radius: var(--radius-lg);
}

.skeleton--row {
  height: 4.5rem;
}

/* ─── Masthead ─────────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  padding-bottom: 0;
  margin-bottom: 0;
}

.masthead__lead {
  min-width: 0;
}

.masthead h1 {
  font-size: var(--text-4xl);
  letter-spacing: -0.025em;
}

.masthead__eyebrow {
  color: var(--ink-faint);
  font-size: var(--text-sm);
  margin-bottom: var(--s1);
}

.lede {
  max-width: 52ch;
  margin-top: var(--s2);
  color: var(--ink-faint);
  font-size: var(--text-base);
}

/* ─── Panels & sections ────────────────────────────────────────────────── */

.panel {
  border: 1px solid var(--line-strong);
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--s5);
  min-width: 0;
}

.panel h3 {
  margin: var(--s4) 0 var(--s2);
}

.panel h3:first-child {
  margin-top: 0;
}

.panel--empty {
  display: grid;
  gap: var(--s4);
  justify-items: start;
  padding: var(--s6) var(--s5);
  border: 1.5px dashed var(--line-strong);
  background: transparent;
}

.panel--empty h1,
.panel--empty h2 {
  font-size: var(--text-2xl);
}

.panel--empty p {
  max-width: 52ch;
  color: var(--ink-soft);
}

.section {
  margin-top: 0;
  min-width: 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding-bottom: var(--s2);
  margin-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
}

.section__head h2 {
  font-size: var(--text-xl);
}

.section__head p {
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

#audit-panel .section + .section {
  margin-top: var(--s6);
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s5);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background-color 0.12s var(--ease);
}

.btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hard);
}

.btn:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn--primary {
  background: var(--acid);
  color: var(--acid-ink);
  border-color: var(--ink);
}

.btn--primary:hover:not(:disabled) {
  background: var(--acid);
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn--ghost:hover:not(:disabled) {
  box-shadow: var(--shadow-hard);
}

.btn--danger {
  border-color: var(--orange);
  color: var(--orange);
}

.btn--danger:hover:not(:disabled) {
  background: var(--orange-wash);
  box-shadow: 3px 3px 0 var(--orange);
}

.btn--small {
  min-height: 40px;
  padding: 0 var(--s4);
  font-size: var(--text-sm);
}

.btn--big {
  min-height: 56px;
  font-size: 1rem;
}

.btn--wide {
  width: 100%;
}

.btn--block {
  width: 100%;
  justify-content: center;
  gap: 10px;
}

.link {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.link:hover {
  text-decoration-thickness: 2px;
}

/* ─── Forms ────────────────────────────────────────────────────────────── */

.form {
  display: grid;
  gap: var(--s5);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4) var(--s5);
}

.form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: var(--s2);
  min-width: 0;
}

.field--wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: var(--text-sm);
  color: var(--ink-faint);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s4);
  border: 1px solid var(--paper-3);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.14s var(--ease);
}

.panel .field input,
.panel .field select,
.panel .field textarea {
  background: var(--paper);
}

.field textarea {
  min-height: 5rem;
  padding: var(--s3) var(--s4);
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ring);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-faint);
  opacity: 0.8;
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  padding-top: var(--s2);
}

.check {
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

.check input {
  width: 20px;
  height: 20px;
  margin-top: 0.15rem;
  accent-color: var(--ring);
  flex: none;
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--paper-2);
}

.seg button {
  min-height: 44px;
  padding: 0 var(--s4);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-faint);
  font: 500 var(--text-base) var(--font-body);
  cursor: pointer;
}

.seg button[aria-pressed="true"] {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

/* ─── Tables & étiquettes ──────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

.ledger th,
.ledger td {
  text-align: left;
  padding: var(--s3);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.ledger th {
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--ink-faint);
  white-space: nowrap;
}

.ledger tbody tr {
  transition: background-color 0.12s ease;
}

.ledger tbody tr:hover {
  background: var(--paper-2);
}

.etiquette {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  border-radius: var(--radius);
  font-weight: 700;
  text-align: center;
  color: var(--ink);
}

.etiquette--a { background: var(--dpe-a); color: #fff; }
.etiquette--b { background: var(--dpe-b); color: #07140a; }
.etiquette--c { background: var(--dpe-c); color: #10130a; }
.etiquette--d { background: var(--dpe-d); color: #14130a; }
.etiquette--e { background: var(--dpe-e); color: #1a1500; }
.etiquette--f { background: var(--dpe-f); color: #1a1206; }
.etiquette--g { background: var(--dpe-g); color: #fff; }

/* ─── Chips de statut ──────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.chip--cree { background: var(--paper-2); color: var(--ink-soft); border-color: var(--line); }
.chip--en_analyse { background: var(--paper-3); color: var(--ink); border-color: var(--line-strong); }
.chip--pre_rempli { background: var(--acid); color: var(--acid-ink); border-color: var(--ink); }
.chip--en_validation { background: var(--acid); color: var(--acid-ink); border-color: var(--ink); }
.chip--valide { background: var(--sage-wash); color: var(--sage); border-color: var(--sage); }
.chip--rejete { background: var(--orange-wash); color: var(--orange); border-color: var(--orange); }

/* ─── Toolbar ──────────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.toolbar .field {
  min-width: 14rem;
  flex: 1;
}

.toolbar .field--filter {
  flex: 0 0 12rem;
}

/* ─── Stepper (étapes de l'audit) ──────────────────────────────────────── */

.stepper {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--s2);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  margin: 0;
  background: var(--paper-2);
  border-radius: var(--radius);
  scroll-snap-type: x proximity;
}

.step {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  min-height: 44px;
  padding: 0 var(--s4);
  border-radius: var(--radius);
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: center;
  transition: color 0.14s var(--ease), background-color 0.14s var(--ease);
}

.step:hover:not(:disabled) {
  color: var(--ink);
}

.step[aria-selected="true"] {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.step:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.step__num {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  margin-right: var(--s2);
  color: var(--ink-faint);
}

/* ─── En-tête de dossier ───────────────────────────────────────────────── */

.audit-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s5);
  align-items: start;
  padding-bottom: 0;
  margin: 0;
}

.audit-head__ref {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-faint);
  margin-bottom: var(--s2);
}

.audit-head h1 {
  font-size: var(--text-3xl);
  letter-spacing: -0.01em;
}

.audit-head__meta {
  margin-top: var(--s3);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.audit-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  justify-content: flex-end;
}

/* ─── Definition list ──────────────────────────────────────────────────── */

.deflist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4) var(--s6);
}

.deflist > div {
  border-top: 1px solid var(--line);
  padding-top: var(--s2);
  min-width: 0;
}

.deflist dt {
  font-size: var(--text-xs);
  color: var(--ink-faint);
  margin-bottom: var(--s1);
}

.deflist dd {
  font-size: var(--text-base);
  overflow-wrap: break-word;
}

/* ─── Upload photos ────────────────────────────────────────────────────── */

.dropzone {
  display: grid;
  gap: var(--s2);
  justify-items: center;
  text-align: center;
  padding: var(--s6) var(--s5);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.14s var(--ease), border-color 0.14s var(--ease);
}

.dropzone:hover,
.dropzone.is-over {
  background: var(--paper-2);
  border-color: var(--ring);
}

.dropzone strong {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
}

.dropzone span {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  max-width: 40ch;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s4);
}

.photos {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
  margin-top: var(--s5);
}

@media (min-width: 560px) {
  .photos {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.photo {
  display: grid;
  gap: var(--s1);
  min-width: 0;
}

.photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-2);
}

.photo figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.photo figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Runner d'analyse ─────────────────────────────────────────────────── */

.runner {
  display: grid;
  gap: var(--s5);
  padding: var(--s6) var(--s5);
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius-lg);
}

.runner__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}

.runner__title {
  font-size: var(--text-2xl);
}

.runner__time {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.runner__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--paper-3);
  overflow: hidden;
}

.runner__bar-fill {
  height: 100%;
  background: var(--ring);
  border-radius: 999px;
  transform: scaleX(0.02);
  transform-origin: left center;
  transition: transform 0.4s linear;
}

.runner__phases {
  display: grid;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--ink-faint);
}

.runner__phases li {
  display: flex;
  gap: var(--s3);
  align-items: baseline;
}

.runner__phases li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  flex: none;
}

.runner__phases li.is-done {
  color: var(--ink);
}

.runner__phases li.is-done::before {
  background: var(--ring);
  border-color: var(--ring);
}

.runner__phases li.is-active {
  color: var(--ink);
}

.runner__phases li.is-active::before {
  background: var(--acid);
  border-color: var(--ring);
  animation: pulse 1.4s ease-in-out infinite;
}

.runner__note {
  font-size: var(--text-sm);
  color: var(--ink-faint);
  max-width: 62ch;
}

/* ─── DPE — signature ──────────────────────────────────────────────────── */

.dpe {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: var(--s5);
  align-items: stretch;
}

.dpe__letter {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1;
  padding: var(--s4);
  border-radius: var(--radius-lg);
}

.dpe__letter strong {
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 8.5rem);
  line-height: 0.82;
  font-weight: 700;
}

.dpe__letter span {
  font-size: var(--text-xs);
}

.dpe--a .dpe__letter { background: var(--dpe-a); color: #fff; }
.dpe--b .dpe__letter { background: var(--dpe-b); color: #07140a; }
.dpe--c .dpe__letter { background: var(--dpe-c); color: #10130a; }
.dpe--d .dpe__letter { background: var(--dpe-d); color: #14130a; }
.dpe--e .dpe__letter { background: var(--dpe-e); color: #1a1500; }
.dpe--f .dpe__letter { background: var(--dpe-f); color: #1a1206; }
.dpe--g .dpe__letter { background: var(--dpe-g); color: #fff; }
.dpe--na .dpe__letter { background: var(--paper-2); color: var(--ink-faint); }

.dpe__data {
  display: grid;
  gap: var(--s4);
  align-content: start;
}

.dpe__consumption {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dpe__caption {
  color: var(--ink-faint);
  font-size: var(--text-sm);
  max-width: 52ch;
}

/* ─── Notices ──────────────────────────────────────────────────────────── */

.notice {
  border: 1px solid var(--warn-line);
  border-left: 3px solid var(--warn-line);
  background: var(--warn-box);
  color: var(--warn-text);
  padding: var(--s4);
  font-size: var(--text-sm);
  border-radius: var(--radius);
}

.notice--neutral {
  border-color: var(--line-strong);
  border-left-color: var(--line-strong);
  background: var(--paper-2);
  color: var(--ink-soft);
}

.notice ul {
  margin: var(--s2) 0 0;
  padding-left: var(--s4);
}

/* ─── Recommandations ──────────────────────────────────────────────────── */

.recs {
  display: grid;
  gap: var(--s4);
}

.rec {
  display: grid;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
}

.rec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}

.rec__index {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.rec__title {
  font-weight: 600;
  font-size: var(--text-lg);
}

.rec__desc {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  max-width: 76ch;
}

.rec__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

.rec__facts span {
  font-family: var(--font-mono);
  color: var(--ink);
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s3) var(--s4);
}

.rec-grid .field--wide {
  grid-column: 1 / -1;
}

/* ─── Validation — récapitulatif ───────────────────────────────────────── */

.summary {
  display: grid;
  gap: var(--s5);
}

.summary__stamp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s5);
  border-radius: var(--radius-lg);
  background: var(--acid);
  color: var(--acid-ink);
}

.summary__stamp strong {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
}

.summary__stamp span {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ─── Tableau de bord ──────────────────────────────────────────────────── */

.hero {
  display: grid;
  gap: var(--s4);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s5);
}

.hero__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
}

.hero__label {
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

.hero__num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

.hero__stats strong {
  color: var(--ink);
  font-weight: 600;
}

.rowlist {
  display: grid;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rowlist__item {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-height: 72px;
  padding: var(--s3) var(--s4);
  text-decoration: none;
  color: var(--ink);
  border-top: 1px solid var(--line);
  transition: background-color 0.14s var(--ease);
  animation: rise 0.4s var(--ease) both;
}

.rowlist__item:first-child {
  border-top: 0;
}

.rowlist__item:nth-child(2) { animation-delay: 0.04s; }
.rowlist__item:nth-child(3) { animation-delay: 0.08s; }
.rowlist__item:nth-child(4) { animation-delay: 0.12s; }
.rowlist__item:nth-child(n + 5) { animation-delay: 0.16s; }

.rowlist__item:hover {
  background: var(--paper-2);
}

.rowlist__item:active {
  background: var(--paper-3);
}

.rowlist__body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rowlist__title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rowlist__meta {
  color: var(--ink-faint);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rowlist__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ring);
  flex: none;
}

.rowlist__chev {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.letter {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  background: var(--paper-2);
  color: var(--ink-faint);
}

.letter--a { background: var(--dpe-a); color: #fff; }
.letter--b { background: var(--dpe-b); color: #07140a; }
.letter--c { background: var(--dpe-c); color: #10130a; }
.letter--d { background: var(--dpe-d); color: #14130a; }
.letter--e { background: var(--dpe-e); color: #1a1500; }
.letter--f { background: var(--dpe-f); color: #1a1206; }
.letter--g { background: var(--dpe-g); color: #fff; }

/* ─── Page méthode ─────────────────────────────────────────────────────── */

.prose {
  max-width: 70ch;
  display: grid;
  gap: var(--s4);
}

.prose h2 {
  font-size: var(--text-2xl);
  margin-top: var(--s5);
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: var(--s5);
  display: grid;
  gap: var(--s2);
}

.prose code {
  background: var(--paper-2);
  padding: 1px 4px;
  border-radius: var(--radius);
}

.steps-method {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
  margin-top: var(--s4);
}

.method-item {
  border-top: 1px solid var(--ink);
  padding-top: var(--s3);
  border-radius: var(--radius);
}

.method-item h3 {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-bottom: var(--s2);
  color: var(--ink-faint);
}

.method-item p {
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

/* ─── Toasts & modal ───────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  right: var(--s5);
  bottom: var(--s5);
  display: grid;
  gap: var(--s2);
  z-index: 40;
  max-width: min(26rem, calc(100vw - 2rem));
}

.toast {
  padding: var(--s3) var(--s4);
  background: var(--ink);
  color: var(--paper);
  border-left: 3px solid var(--acid);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  font-size: var(--text-sm);
  animation: rise 0.2s ease both;
}

.toast--error {
  background: var(--orange);
  border-left-color: var(--ink);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: var(--s5);
  background: var(--scrim);
}

.modal[hidden] {
  display: none;
}

.modal__card {
  width: min(30rem, 100%);
  padding: var(--s5);
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: var(--s4);
  animation: rise 0.3s var(--ease) both;
}

.modal__card h2 {
  font-size: var(--text-2xl);
}

.modal__card p {
  color: var(--ink-soft);
}

.modal__actions {
  display: flex;
  gap: var(--s2);
  justify-content: flex-end;
}

/* ─── Simulation 3CL & scénarios ───────────────────────────────────────── */

.barres {
  list-style: none;
  padding: 0;
  margin: var(--s3) 0;
  display: grid;
  gap: var(--s2);
}

.barres li {
  display: grid;
  grid-template-columns: 11rem 1fr 9rem;
  gap: var(--s3);
  align-items: center;
  font-size: var(--text-sm);
}

.barre {
  height: 0.6rem;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--ink) var(--p), var(--line) var(--p));
}

.sc-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  gap: var(--s4);
  margin: var(--s4) 0;
}

.sc-ligne {
  display: grid;
  gap: var(--s2);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sc-liste {
  margin: var(--s3) 0;
}

.sc-liste li {
  overflow-wrap: anywhere;
  margin-bottom: var(--s2);
}

.hint {
  font-size: var(--text-sm);
  color: var(--ink-faint);
  margin: var(--s2) 0;
}

.xml-ademe {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: flex-end;
  margin-top: var(--s4);
}

.xml-ademe .field {
  flex: 1 1 14rem;
}

.sim-form,
.sim-pdf {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: flex-end;
}

.sim-form .field,
.sim-pdf .field {
  flex: 1 1 16rem;
}

.sim-form .field__hint {
  flex-basis: 100%;
}

.sim-resultat #maison3d {
  margin: var(--s3) 0 var(--s4);
}

.sim-pdf {
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}

/* ─── Utilities ────────────────────────────────────────────────────────── */

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
}

.spread {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.muted {
  color: var(--ink-faint);
}

.small {
  font-size: var(--text-sm);
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.separateur {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--ink-soft);
  font-size: 13px;
}

.separateur::before,
.separateur::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.view-enter > *,
.section,
.panel {
  min-width: 0;
}

/* ─── Responsive — tablette & mobile ───────────────────────────────────── */

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    height: var(--tabbar-h);
    padding: 6px var(--s4) env(safe-area-inset-bottom, 0px);
    flex-direction: row;
    align-items: center;
    gap: 0;
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--nav-bg);
  }

  .wordmark,
  .rail__foot,
  .nav__link--desktop {
    display: none;
  }

  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin: 0 0 var(--s5);
    color: var(--ink);
    text-decoration: none;
  }

  .topbar .wordmark__icone {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .topbar .wordmark__main {
    font-size: 1.5rem;
  }

  .nav {
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    margin: 0;
  }

  .nav__link {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 72px;
    min-height: 52px;
    padding: 0;
    font-size: 0.6875rem;
    border-radius: var(--radius);
  }

  .nav__link:hover,
  .nav__link[aria-current="page"] {
    background: transparent;
  }

  .nav__link[aria-current="page"] {
    color: var(--accent-text);
  }

  .nav__link--new {
    min-width: 52px;
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: var(--acid);
    color: var(--acid-ink);
  }

  .nav__link--new:hover,
  .nav__link--new[aria-current="page"] {
    background: var(--acid);
    color: var(--acid-ink);
  }

  .nav__link--new[aria-current="page"] svg {
    color: var(--acid-ink);
  }

  .nav__link--new span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  body.is-anon .rail {
    display: none;
  }

  .main {
    padding: max(var(--s5), env(safe-area-inset-top, 0px)) var(--s4) calc(var(--tabbar-h) + var(--s6));
  }

  body.is-anon .main {
    padding-bottom: var(--s6);
  }

  .form-grid,
  .form-grid--3,
  .deflist,
  .steps-method,
  .rec-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-head__actions {
    justify-content: flex-start;
  }

  .dpe {
    grid-template-columns: minmax(0, 1fr);
  }

  .dpe__letter {
    max-width: 180px;
  }

  .toasts {
    right: var(--s4);
    left: var(--s4);
    bottom: calc(var(--tabbar-h) + var(--s3));
    max-width: none;
  }

  .form__actions .btn,
  .upload-actions .btn {
    flex: 1 1 100%;
    min-height: 56px;
  }

  .toolbar .field--filter {
    flex: 1 1 100%;
  }

  .hide-mobile {
    display: none;
  }
}

@media (max-width: 640px) {
  .barres li {
    grid-template-columns: 1fr;
    gap: var(--s1);
  }
}

@media (min-width: 901px) {
  .show-mobile {
    display: none;
  }
}

/* ─── Print ────────────────────────────────────────────────────────────── */

@media print {
  .rail,
  .stepper,
  .toasts,
  .modal,
  .btn,
  .dropzone {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .main {
    padding: 0;
  }

  body {
    background: var(--white);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .rowlist__item,
  .runner__phases li.is-active::before {
    animation: none;
  }
}

/* Titres de section : le titre garde sa ligne, la mention passe dessous si besoin */
.section__head { flex-wrap: wrap; row-gap: var(--s1); }
.section__head h2 { flex: 0 1 auto; min-width: min(100%, 12ch); }

/* ─── Téléphone : aucun défilement horizontal ──────────────────────────── */
@media (max-width: 640px) {
  /* Étapes de l'audit : cinq colonnes, numéro au-dessus du libellé */
  .stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; overflow: visible; gap: 2px; }
  .step { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 2px; white-space: normal; text-align: center; font-size: var(--text-xs); line-height: 1.2; }
  .step__num { margin: 0; }

  /* Tableaux en fiches : une ligne = une carte, chaque valeur précédée de son intitulé */
  .table-wrap { overflow: visible; }
  .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tr { display: block; width: 100%; }
  .ledger tr { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
  .ledger tbody tr:hover { background: none; }
  .ledger th[scope="row"] { display: block; padding: var(--s2) 0; border: 0; font-size: var(--text-base); font-weight: 600; color: var(--ink); white-space: normal; }
  .ledger td { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 4px 0; border: 0; text-align: right; }
  .ledger td[data-label]::before { content: attr(data-label); color: var(--ink-faint); font-size: var(--text-xs); text-align: left; }
  .ledger td[colspan] { display: block; text-align: left; }
}

/* ─── Envoi des photos : suivi photo par photo ─────────────────────────── */
.dropzone.is-busy { opacity: 0.55; pointer-events: none; }
.envoi { display: grid; gap: var(--s3); margin-top: var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.envoi__tete { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.envoi__tete span { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink-faint); }
.envoi__barre { height: 8px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.envoi__barre span { display: block; height: 100%; width: 0; background: var(--acid); border-radius: 999px; transition: width 0.25s linear; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08); }
.envoi__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.envoi__ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--s3); align-items: center; padding: 8px 10px; border-radius: var(--radius); background: var(--paper-2); font-size: var(--text-sm); }
.envoi__nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envoi__etat { color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.envoi__mini { grid-column: 1 / -1; height: 3px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.envoi__mini span { display: block; height: 100%; width: 0; background: var(--ink-soft); transition: width 0.2s linear; }
.envoi__ligne.is-actif { background: var(--paper-3); }
.envoi__ligne.is-actif .envoi__etat { color: var(--ink); }
.envoi__ligne.is-ok .envoi__etat { color: var(--sage, #2f7a3a); }
.envoi__ligne.is-ok .envoi__mini span { background: var(--sage, #2f7a3a); }
.envoi__ligne.is-ko .envoi__etat { color: var(--orange, #b4441c); white-space: normal; text-align: right; }
.envoi__ligne.is-ko .envoi__mini span { background: var(--orange, #b4441c); }
.envoi__note { margin: 0; font-size: var(--text-xs); color: var(--ink-faint); }
.envoi .btn { justify-self: start; }

.runner__msg { margin: 0; font-weight: 500; color: var(--ink); min-height: 1.4em; }
.runner__phases li.is-active::before { background: var(--acid); border-color: var(--ink); animation: pulsation 1.2s ease-in-out infinite; }
@keyframes pulsation { 50% { transform: scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .runner__phases li.is-active::before { animation: none; } }

/* ─── DPE trouvés à une adresse : le pro choisit le logement ───────────── */
.dpe-adresse { margin-top: var(--s5); display: grid; gap: var(--s3); }
.dpe-adresse h3 { font-size: var(--text-base); }
.candidats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.candidat { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.candidat:hover:not(:disabled) { border-color: var(--ink); background: var(--paper-2); }
.candidat:disabled { opacity: .6; cursor: progress; }
.candidat__lettre { min-width: 2.1em; font-size: 1.1rem; padding: .25em .4em; }
.candidat__info { display: grid; gap: 2px; min-width: 0; }
.candidat__info strong { font-weight: 600; font-size: var(--text-base); }
.candidat__info span { font-size: var(--text-xs); color: var(--ink-faint); }
.candidat__action { font-size: var(--text-sm); font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.sim-candidats { grid-column: 1 / -1; display: grid; gap: var(--s3); }
.sim-candidats:empty { display: none; }
.sim-candidats__titre { margin: 0; font-weight: 600; }
.sim-candidats__titre:empty { display: none; }

/* ─── Qualification RGE vérifiée ───────────────────────────────────────── */
.rge { display: grid; gap: var(--s2); padding: var(--s4); border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--paper-2); margin-bottom: var(--s3); }
.rge--ok { border-color: color-mix(in srgb, var(--dpe-a) 55%, var(--line)); background: color-mix(in srgb, var(--dpe-a) 8%, var(--white)); }
.rge--ko { border-color: var(--orange); }
.rge__statut { margin: 0; font-weight: 700; font-size: var(--text-sm); color: var(--dpe-a); }
.rge--ko .rge__statut { color: var(--orange); }
.rge__entreprise { margin: 0; font-family: var(--font-display); font-size: var(--text-lg, 1.15rem); font-weight: 600; }
.rge__entreprise span { display: block; font-family: var(--font-body); font-size: var(--text-xs); font-weight: 400; color: var(--ink-faint); }
.rge__quals { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rge__quals li { display: grid; gap: 1px; padding: 8px 10px; border-radius: var(--radius); background: var(--white); font-size: var(--text-sm); }
.rge__quals span { font-size: var(--text-xs); color: var(--ink-faint); }

/* ─── Questionnaire « maison sans DPE » ────────────────────────────────── */
.sans-dpe { margin-top: var(--s5); }
.sans-dpe > summary { cursor: pointer; font-weight: 600; padding: var(--s2) 0; }
details.panel.sans-dpe > summary { font-family: var(--font-display); font-size: var(--text-lg, 1.1rem); }
.questionnaire { display: grid; gap: var(--s4); margin-top: var(--s3); }
.questionnaire fieldset { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4); margin: 0; min-width: 0; }
.questionnaire legend { padding: 0 6px; font-weight: 600; font-size: var(--text-sm); }
.questionnaire select { width: 100%; }
