/* ============ Couleurs : clair par défaut ============ */
:root {
  --bg: #f3f4f1;
  --bg2: #e9ebe6;
  --surface: #ffffff;
  --surface2: #f6f7f4;
  --text: #1b232b;
  --muted: #56616d;
  --line: #dde1dc;
  --line2: #c9cfc9;
  --primary: #1d4d78;
  --primary-hover: #163d60;
  --primary-ink: #ffffff;
  --primary-soft: #e2ecf5;
  --accent: #a84d07;
  --accent-soft: #fcefe1;
  --warn: #8f4a06;
  --warn-soft: #fff4d6;
  --warn-line: #e9b44c;
  --ok: #146c43;
  --ok-soft: #e1f3e8;
  --hot: #b93a0b;
  --hot-soft: #fde6dc;
  --warm: #8a5a00;
  --warm-soft: #fbf0cf;
  --cold: #22599a;
  --cold-soft: #e0ebf8;
  --lost: #6b737b;
  --lost-soft: #eceeef;
  --side: #17222d;
  --side-text: #d9e1e8;
  --side-muted: #93a3b2;
  --side-on: #253546;
  --shadow: 0 8px 26px rgba(25, 35, 45, .08);
  --shadow-strong: 0 14px 40px rgba(25, 35, 45, .18);
  --radius: 14px;

  /* surlignage des informations extraites */
  --h-nom: #ece3fb;     --h-nom-l: #7c4ddb;
  --h-tel: #daf2e3;     --h-tel-l: #15904a;
  --h-email: #d6eff2;   --h-email-l: #0c7f8b;
  --h-commune: #dfe9fb; --h-commune-l: #2a5fd6;
  --h-travaux: #fde6d2; --h-travaux-l: #d0600a;
  --h-qte: #fadbe8;     --h-qte-l: #c6246c;
  --h-delai: #fbefc4;   --h-delai-l: #b07b00;
  --h-budget: #e3f2d3;  --h-budget-l: #4b7a10;
  --h-photos: #e8eaec;  --h-photos-l: #5d6670;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161b; --bg2: #161c22; --surface: #1a2128; --surface2: #212a32;
    --text: #e6ebef; --muted: #a3afba; --line: #2c3741; --line2: #3b4854;
    --primary: #74ade2; --primary-hover: #93c1ec; --primary-ink: #0c1621; --primary-soft: #1b2c3d;
    --accent: #f29343; --accent-soft: #3a2615;
    --warn: #f3c26a; --warn-soft: #34290f; --warn-line: #9a7426;
    --ok: #5fcb98; --ok-soft: #14301f;
    --hot: #ff9469; --hot-soft: #3d2016;
    --warm: #ecc15c; --warm-soft: #33290f;
    --cold: #86b9ef; --cold-soft: #182b40;
    --lost: #a2abb3; --lost-soft: #262e35;
    --side: #0c1116; --side-text: #dbe3ea; --side-muted: #8797a6; --side-on: #1d2a37;
    --shadow: 0 8px 26px rgba(0, 0, 0, .35); --shadow-strong: 0 14px 40px rgba(0, 0, 0, .55);
    --h-nom: rgba(150, 110, 240, .22);  --h-nom-l: #b598f5;
    --h-tel: rgba(40, 180, 100, .2);    --h-tel-l: #5fd394;
    --h-email: rgba(20, 170, 185, .2);  --h-email-l: #4fd0dc;
    --h-commune: rgba(70, 120, 235, .24); --h-commune-l: #8db0f5;
    --h-travaux: rgba(240, 130, 40, .22); --h-travaux-l: #f6a25a;
    --h-qte: rgba(230, 60, 130, .22);   --h-qte-l: #f286b5;
    --h-delai: rgba(225, 175, 30, .22); --h-delai-l: #efc552;
    --h-budget: rgba(120, 180, 40, .22); --h-budget-l: #a5d46a;
    --h-photos: rgba(160, 170, 180, .2); --h-photos-l: #b5bec7;
  }
}
:root[data-theme="dark"] {
  --bg: #11161b; --bg2: #161c22; --surface: #1a2128; --surface2: #212a32;
  --text: #e6ebef; --muted: #a3afba; --line: #2c3741; --line2: #3b4854;
  --primary: #74ade2; --primary-hover: #93c1ec; --primary-ink: #0c1621; --primary-soft: #1b2c3d;
  --accent: #f29343; --accent-soft: #3a2615;
  --warn: #f3c26a; --warn-soft: #34290f; --warn-line: #9a7426;
  --ok: #5fcb98; --ok-soft: #14301f;
  --hot: #ff9469; --hot-soft: #3d2016;
  --warm: #ecc15c; --warm-soft: #33290f;
  --cold: #86b9ef; --cold-soft: #182b40;
  --lost: #a2abb3; --lost-soft: #262e35;
  --side: #0c1116; --side-text: #dbe3ea; --side-muted: #8797a6; --side-on: #1d2a37;
  --shadow: 0 8px 26px rgba(0, 0, 0, .35); --shadow-strong: 0 14px 40px rgba(0, 0, 0, .55);
  --h-nom: rgba(150, 110, 240, .22);  --h-nom-l: #b598f5;
  --h-tel: rgba(40, 180, 100, .2);    --h-tel-l: #5fd394;
  --h-email: rgba(20, 170, 185, .2);  --h-email-l: #4fd0dc;
  --h-commune: rgba(70, 120, 235, .24); --h-commune-l: #8db0f5;
  --h-travaux: rgba(240, 130, 40, .22); --h-travaux-l: #f6a25a;
  --h-qte: rgba(230, 60, 130, .22);   --h-qte-l: #f286b5;
  --h-delai: rgba(225, 175, 30, .22); --h-delai-l: #efc552;
  --h-budget: rgba(120, 180, 40, .22); --h-budget-l: #a5d46a;
  --h-photos: rgba(160, 170, 180, .2); --h-photos-l: #b5bec7;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
h1, h2, h3 { font-family: 'Barlow', 'Inter', sans-serif; line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: .005em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.kicker { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

.demo-bar { background: #0b1117; color: #cfd8e0; font-size: 12.5px; text-align: center; padding: 6px 12px; letter-spacing: .02em; }
.demo-bar a { color: #ffd29a; margin-left: 12px; }

/* ============ Boutons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.06); }
:root[data-theme="dark"] .btn-ok, :root[data-theme="dark"] .btn-accent { color: #0d1418; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-ok, :root:not([data-theme="light"]) .btn-accent { color: #0d1418; } }
.btn-small { min-height: 38px; padding: 7px 14px; font-size: 14px; border-radius: 9px; }
.btn-big { min-height: 52px; padding: 12px 26px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font-weight: 500; }

/* ============ Structure de l'application ============ */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - 30px); }
.side {
  position: sticky; top: 0; height: 100vh; align-self: start;
  background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; padding: 20px 14px 18px; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 2px 6px; }
.brand-mark { width: 42px; height: 42px; border-radius: 11px; background: #e07a1f; color: #1a1209; display: grid; place-items: center; flex: none; }
.brand-text { font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 18px; line-height: 1.15; }
.brand-text small { display: block; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 11.5px; color: var(--side-muted); margin-top: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  color: var(--side-text); text-decoration: none; font-weight: 500; font-size: 14.5px;
}
.side-nav a:hover { background: rgba(255, 255, 255, .06); }
.side-nav a.is-on { background: var(--side-on); color: #fff; box-shadow: inset 3px 0 0 #e07a1f; }
.side-nav a span { flex: 1; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e07a1f; color: #1a1209; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.badge-amber { background: #f2c14e; }
.badge.is-zero { display: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sim-date { font-size: 12.5px; color: var(--side-muted); padding: 0 8px; }
.sim-date b { display: block; color: var(--side-text); font-weight: 600; font-size: 13.5px; }
.theme-btn {
  display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  color: var(--side-text); border-radius: 9px; padding: 8px 10px; cursor: pointer; font-size: 13px; min-height: 38px;
}
.theme-btn:hover { background: rgba(255, 255, 255, .1); }

.main { padding: 28px 34px 70px; min-width: 0; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.view-title { font-size: 30px; font-weight: 700; }
.section-title { font-size: 21px; margin: 30px 0 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-title { font-size: 19px; margin-bottom: 12px; }
.card-head { margin-bottom: 14px; }
.card-head .card-title { margin-bottom: 4px; }

.tabbar { display: none; }

/* ============ Accueil ============ */
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 34px; align-items: center; margin-bottom: 30px; }
.hero h1 { font-size: clamp(30px, 3.3vw, 44px); font-weight: 700; line-height: 1.1; margin-bottom: 16px; }
.lead { font-size: 17px; color: var(--muted); max-width: 620px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 14px; }
.hero-note { font-size: 13px; color: var(--muted); }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 3.1; object-fit: cover; object-position: 50% 30%; border-radius: 18px; box-shadow: var(--shadow-strong); }
.hero-photo figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: right; }

.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; position: relative; }
.step h3 { font-size: 17px; margin: 8px 0 4px; }
.step p { font-size: 13.5px; color: var(--muted); }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.step-key { border-color: var(--ok); background: var(--ok-soft); }
.step-key .step-n { background: var(--ok); color: #fff; }
.step-key p { color: var(--text); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; margin-bottom: 22px; }
.try-list { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.try-list li::marker { color: var(--accent); font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: 'Barlow', sans-serif; font-size: 30px; font-weight: 700; line-height: 1.15; margin: 4px 0 2px; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-tag { display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 1px 7px; }
.kpis-row { margin-bottom: 18px; }
.kpis-row .kpi { background: var(--surface); box-shadow: var(--shadow); }

.truth { border: 2px solid var(--primary); }
.truth-head { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: center; margin-bottom: 18px; }
.truth-head h2 { font-size: 26px; margin-bottom: 6px; }
.truth-photo { margin: 0; }
.truth-photo img { width: 100%; aspect-ratio: 1 / .82; object-fit: cover; object-position: 50% 75%; border-radius: 12px; }
.truth-photo figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; text-align: center; }
.truth-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.truth-item { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.truth-item h3 { font-size: 16.5px; margin-bottom: 6px; }
.truth-item p { font-size: 14px; color: var(--muted); }
.truth-key { background: var(--ok-soft); border-color: var(--ok); }
.truth-key p { color: var(--text); }

/* ============ Puces ============ */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.6; border: 1px solid transparent; }
.st-nouvelle { background: var(--primary-soft); color: var(--primary); }
.st-attente { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.st-envoye { background: var(--cold-soft); color: var(--cold); }
.st-relance { background: var(--accent-soft); color: var(--accent); }
.st-gagne { background: var(--ok-soft); color: var(--ok); }
.st-perdu { background: var(--lost-soft); color: var(--lost); }
.q-chaud { background: var(--hot-soft); color: var(--hot); }
.q-tiede { background: var(--warm-soft); color: var(--warm); }
.q-froid { background: var(--cold-soft); color: var(--cold); }
.chip-plain { background: var(--surface2); color: var(--muted); border-color: var(--line); }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ============ Boîte de réception ============ */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.inbox-list { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.filter { flex: 1; border: 1px solid var(--line2); background: var(--surface); border-radius: 8px; padding: 7px 6px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); min-height: 36px; }
.filter b { font-weight: 700; color: var(--text); margin-left: 2px; }
.filter.is-on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.filter.is-on b { color: var(--primary-ink); }
.msg-list { list-style: none; margin: 0; padding: 6px; display: grid; gap: 4px; }
.msg {
  width: 100%; text-align: left; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px;
  padding: 12px 10px; border-radius: 10px; border: 1.5px solid transparent; background: transparent; cursor: pointer;
}
.msg:hover { background: var(--surface2); }
.msg.is-on { background: var(--primary-soft); border-color: var(--primary); }
.msg.is-unread .msg-from { font-weight: 700; }
.ch-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.ch-email { background: var(--primary-soft); color: var(--primary); }
.ch-form { background: var(--accent-soft); color: var(--accent); }
.ch-whatsapp { background: var(--ok-soft); color: var(--ok); }
.ch-sms { background: var(--warm-soft); color: var(--warm); }
.msg-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.msg-from { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg-subj { display: block; font-size: 13.5px; font-weight: 500; margin: 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-body { display: block; min-width: 0; }
.msg-prev { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.empty-list { padding: 24px 16px; color: var(--muted); text-align: center; font-size: 14px; }

.inbox-detail { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.back-btn { display: none; }
.detail-head { display: flex; gap: 14px; align-items: flex-start; }
.detail-head .ch-ico { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.detail-head h2 { font-size: 22px; }
.detail-meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.detail-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.stepper { display: flex; gap: 0; list-style: none; margin: 16px 0 0; padding: 0; counter-reset: st; }
.stepper li { flex: 1; position: relative; font-size: 12.5px; color: var(--muted); text-align: center; padding-top: 30px; font-weight: 500; }
.stepper li::before {
  counter-increment: st; content: counter(st); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; background: var(--surface2); border: 2px solid var(--line2); display: grid; place-items: center; font-size: 12px; font-weight: 700; z-index: 1;
}
.stepper li::after { content: ''; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--line2); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--text); }
.stepper li.done::before { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper li.done::after, .stepper li.cur::after { background: var(--ok); }
.stepper li.cur { color: var(--primary); font-weight: 700; }
.stepper li.cur::before { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.bubble { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface2); }
.bubble-atelier { background: var(--primary-soft); border-color: transparent; margin-left: 40px; }
.bubble-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.form-rows { display: grid; gap: 4px; }
.form-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.form-row > span:first-child { color: var(--muted); }
.form-empty { color: var(--muted); font-style: italic; }
.attach { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.att { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; color: var(--muted); max-width: 100%; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.att svg { flex: none; }

.x { border-radius: 3px; transition: background-color .4s, box-shadow .4s; }
.analysed .x { padding: 0 2px; background: var(--hb); box-shadow: inset 0 -2px 0 var(--hl); }
.x-nom { --hb: var(--h-nom); --hl: var(--h-nom-l); }
.x-tel { --hb: var(--h-tel); --hl: var(--h-tel-l); }
.x-email { --hb: var(--h-email); --hl: var(--h-email-l); }
.x-commune { --hb: var(--h-commune); --hl: var(--h-commune-l); }
.x-travaux { --hb: var(--h-travaux); --hl: var(--h-travaux-l); }
.x-qte { --hb: var(--h-qte); --hl: var(--h-qte-l); }
.x-delai { --hb: var(--h-delai); --hl: var(--h-delai-l); }
.x-budget { --hb: var(--h-budget); --hl: var(--h-budget-l); }
.x-photos { --hb: var(--h-photos); --hl: var(--h-photos-l); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; background: var(--hb); box-shadow: inset 0 -2px 0 var(--hl); display: inline-block; }

.analyse-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 2px dashed var(--line2); background: var(--surface); }
.analyse-cta p { max-width: 520px; }
.analyse-cta h3 { font-size: 18px; margin-bottom: 4px; }

.run { border: 2px solid var(--primary); }
.run h3 { font-size: 18px; margin-bottom: 12px; }
.run-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.run-steps li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--muted); }
.run-steps li .ri { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); flex: none; display: grid; place-items: center; }
.run-steps li.on { color: var(--text); font-weight: 600; }
.run-steps li.on .ri { border-color: var(--primary); border-top-color: transparent; animation: spin .7s linear infinite; }
.run-steps li.ok { color: var(--text); }
.run-steps li.ok .ri { background: var(--ok); border-color: var(--ok); color: #fff; }
.bar { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .35s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pop { animation: pop .45s ease both; }

/* Qualification */
.qualif { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; border-left: 6px solid var(--qc); }
.qualif.q-chaud, .qualif.q-tiede, .qualif.q-froid { background: var(--surface); color: var(--text); }
.qualif.q-chaud { --qc: var(--hot); }
.qualif.q-tiede { --qc: var(--warm); }
.qualif.q-froid { --qc: var(--cold); }
.q-badge { display: grid; justify-items: center; gap: 2px; min-width: 104px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--qc) 14%, transparent); color: var(--qc); }
.q-badge small { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.q-badge b { font-family: 'Barlow', sans-serif; font-size: 24px; line-height: 1.1; }
.q-reason { font-size: 15px; font-weight: 500; }
.q-crit { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.q-crit span { display: inline-flex; align-items: center; gap: 5px; }
.q-crit .yes { color: var(--ok); }
.q-crit .no { color: var(--warn); }
.q-edit { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-title h3 { font-size: 18px; }
.sec-title .small { color: var(--muted); }

.fiche { display: grid; gap: 8px; }
.f-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: center; }
.f-row label { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.f-row label i { width: 10px; height: 10px; border-radius: 3px; background: var(--hb); box-shadow: inset 0 -2px 0 var(--hl); flex: none; }
.field {
  width: 100%; border: 1px solid var(--line2); background: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: 14px; min-height: 38px; min-width: 0;
}
.field:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
textarea.field { resize: vertical; line-height: 1.55; font-size: 14.5px; }
textarea.auto { resize: none; overflow: hidden; line-height: 1.45; font-size: 14px; }
.fiche textarea.auto, .dl textarea.auto { padding-top: 8px; padding-bottom: 8px; }
#repTxt.auto, #qTxt.auto { font-size: 14.5px; line-height: 1.55; min-height: 120px; }
.field.is-missing { background: var(--warn-soft); border-color: var(--warn-line); border-width: 1.5px; }
.field.is-missing::placeholder { color: var(--warn); font-weight: 600; opacity: 1; }
.field.is-optional::placeholder { color: var(--muted); font-style: italic; opacity: 1; }
.field[readonly] { background: var(--surface2); }
.field-inline { width: auto; display: inline-block; margin-left: 6px; }

.miss-ok { display: flex; gap: 8px; align-items: center; background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.miss-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.miss-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; padding: 8px 10px; border-radius: 9px; }
.miss-list li svg { flex: none; margin-top: 2px; }
.miss-ess { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.miss-ess svg { color: var(--warn); }
.miss-pre { background: var(--surface2); border: 1px solid var(--line); }
.miss-pre svg { color: var(--muted); }
.miss-list b { font-weight: 600; }
.miss-sub { display: block; font-size: 12.5px; color: var(--muted); }
.miss-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 4px 0 6px; }
.advice { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; background: var(--accent-soft); color: var(--text); border-radius: 9px; padding: 9px 11px; margin-bottom: 10px; }
.advice svg { color: var(--accent); flex: none; margin-top: 2px; }
.q-box label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Devis */
.devis-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; }
.devis-head span { display: block; color: var(--muted); font-size: 12px; }
.devis-head b { font-weight: 600; overflow-wrap: anywhere; }
.dl { display: grid; gap: 6px; }
.dl-row, .dl-head { display: grid; grid-template-columns: minmax(0, 1fr) 128px 104px 112px 36px; gap: 8px; align-items: center; }
.dl-head { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 0 2px 2px; }
.dl-head span:nth-child(n+2) { text-align: right; }
.dl-row { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 6px; align-items: start; }
.dl-row > .dl-qte, .dl-row > .dl-pu, .dl-row > .dl-tot, .dl-row > .dl-x { margin-top: 0; }
.dl-tot { min-height: 38px; }
.dl-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dl-lab { display: none; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.dl-cell .field { min-height: 36px; padding: 6px 8px; }
.dl-qte .field, .dl-pu .field { text-align: right; }
.dl-in { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.dl-unit { font-size: 12.5px; color: var(--muted); white-space: nowrap; min-width: 38px; }
.dl-tot { justify-content: flex-end; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-del { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.dl-del:hover { color: var(--hot); border-color: var(--hot); }
.dl-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.dl-add select { flex: 1 1 260px; width: auto; }
.devis-note { font-size: 13px; color: var(--muted); margin-top: 10px; display: flex; gap: 7px; align-items: flex-start; }
.devis-note svg { flex: none; margin-top: 2px; }
.devis-foot { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; margin-top: 14px; align-items: start; }
.budget-cmp { font-size: 13.5px; border-radius: 10px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--line); }
.budget-cmp b { font-weight: 600; }
.budget-cmp.in { background: var(--ok-soft); border-color: transparent; }
.budget-cmp.out { background: var(--warn-soft); border-color: var(--warn-line); }
.totals { display: grid; gap: 6px; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.totals .ttc { font-family: 'Barlow', sans-serif; font-size: 22px; font-weight: 700; border-top: 2px solid var(--line2); padding-top: 8px; margin-top: 2px; }
.totals select { width: auto; min-height: 32px; padding: 3px 6px; font-size: 13.5px; }
.totals .acompte { font-size: 13px; color: var(--muted); }
.devis-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Validation */
.validate {
  position: sticky; bottom: 12px; z-index: 6; background: var(--surface); border: 2px solid var(--primary);
  border-radius: 14px; box-shadow: var(--shadow-strong); padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: center;
}
.v-act { display: grid; gap: 10px; justify-items: end; }
.validate h3 { font-size: 16.5px; display: flex; align-items: center; gap: 8px; }
.validate h3 svg { color: var(--primary); flex: none; }
.validate p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14.5px; font-weight: 600; cursor: pointer; background: var(--primary-soft); border-radius: 9px; padding: 6px 12px 6px 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.validate-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sent-banner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; background: var(--ok-soft); border: 1.5px solid var(--ok); border-radius: 12px; padding: 14px 16px; }
.sent-banner > svg { color: var(--ok); margin-top: 2px; }
.sent-banner h3 { font-size: 17px; margin-bottom: 4px; }
.sent-banner p { font-size: 14px; }
.sent-banner.wait { background: var(--warn-soft); border-color: var(--warn-line); }
.sent-banner.wait > svg { color: var(--warn); }
.sent-banner .btn-row { margin-top: 10px; }
.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 45%, transparent); } }

/* ============ Suivi ============ */
.time-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.time-ctrl b { color: var(--text); }
.relances { margin-bottom: 8px; }
.rel-group-title { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.rel-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface2); margin-bottom: 10px; }
.rel-item.due { border-left: 5px solid var(--accent); }
.rel-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; }
.rel-top h4 { margin: 0; font-size: 15.5px; font-weight: 600; }
.rel-top p { font-size: 13.5px; color: var(--muted); }
.rel-msg { margin-top: 10px; }
.rel-preview { font-size: 13.5px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line2); border-radius: 9px; padding: 8px 10px; margin-top: 10px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rel-planned { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--surface); }
.rel-planned span { color: var(--muted); }
.rel-empty { font-size: 14px; color: var(--muted); padding: 8px 0; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-width: 0; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.col-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.col-head .count { font-size: 12.5px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.col-sum { font-size: 12.5px; color: var(--muted); margin: -4px 0 10px; }
.col-cards { display: grid; gap: 8px; }
.col-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 14px 6px; border: 1px dashed var(--line2); border-radius: 10px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.kcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kcard-name { font-weight: 600; font-size: 14.5px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--text); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.kcard-name:hover { color: var(--primary); text-decoration-color: currentColor; }
.kcard-work { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.kcard-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.kcard-amount { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.kcard-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kcard-note.hot { color: var(--accent); font-weight: 600; }
.kcard select { margin-top: 8px; font-size: 13px; min-height: 34px; padding: 4px 8px; }

/* ============ Paramètres ============ */
.settings { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.set-side { display: grid; gap: 18px; }
.price-table { display: grid; gap: 6px; }
.pt-cat { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin: 12px 0 2px; }
.pt-cat:first-child { margin-top: 0; }
.pt-row, .pt-head { display: grid; grid-template-columns: minmax(0, 1fr) 92px 112px 36px; gap: 8px; align-items: center; }
.pt-head { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pt-row .field { min-height: 36px; padding: 6px 8px; }
.pt-price { position: relative; }
.pt-price .field { padding-right: 34px; text-align: right; }
.pt-price span { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); pointer-events: none; }
.pt-row.is-new { animation: flash 1.2s ease; border-radius: 8px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tone-list { display: grid; gap: 8px; }
.tone { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.tone input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); }
.tone b { display: block; font-size: 14.5px; }
.tone small { color: var(--muted); font-size: 12.5px; }
.tone:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.set-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; margin-bottom: 12px; }
.set-line .field-inline { margin-left: 0; }
.set-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ Fenêtre et message ============ */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-back { position: absolute; inset: 0; background: rgba(8, 12, 16, .55); }
.modal-box { position: relative; background: var(--surface); color: var(--text); border-radius: 16px; width: min(640px, 100%); max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; padding: 24px; box-shadow: var(--shadow-strong); animation: pop .25s ease both; }
.modal-box.wide { width: min(820px, 100%); }
.modal-box h2 { font-size: 22px; margin: 0 36px 14px 0; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.modal-body { font-size: 14.5px; display: grid; gap: 12px; overflow: auto; min-height: 0; flex: 1 1 auto; margin: 0 -6px; padding: 0 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); flex: none; }
.sum-table { display: grid; gap: 6px; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.sum-table div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.sum-table span { color: var(--muted); }
.sum-table b { font-weight: 600; overflow-wrap: anywhere; }
.mail-preview { white-space: pre-wrap; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; max-height: 220px; overflow: auto; overflow-wrap: anywhere; }
.demo-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 12px; }
.demo-note svg { color: var(--warn); flex: none; margin-top: 2px; }

/* Aperçu du devis (document) */
.doc { background: #fff; color: #1b232b; border: 1px solid #d5d9dd; border-radius: 6px; padding: 26px 26px 22px; font-size: 13px; position: relative; overflow: hidden; }
.doc-stamp { position: absolute; top: 18px; right: -40px; transform: rotate(35deg); background: #c25e0a; color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .12em; padding: 4px 48px; }
.doc-top { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.doc-top h3 { font-size: 19px; color: #1d4d78; }
.doc-top p { color: #56616d; font-size: 12.5px; }
.doc-client { background: #f4f6f8; border-radius: 6px; padding: 10px 12px; min-width: 200px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc th { text-align: left; background: #1d4d78; color: #fff; padding: 7px 8px; font-weight: 600; }
.doc td { padding: 7px 8px; border-bottom: 1px solid #e3e6e9; vertical-align: top; }
.doc td.n, .doc th.n { text-align: right; white-space: nowrap; }
.doc-tot { margin: 12px 0 0 auto; width: min(280px, 100%); display: grid; gap: 4px; }
.doc-tot div { display: flex; justify-content: space-between; gap: 10px; }
.doc-tot .t { font-weight: 700; font-size: 15px; border-top: 2px solid #1d4d78; padding-top: 6px; }
.doc-foot { margin-top: 16px; color: #56616d; font-size: 11.5px; }
.doc-wrap { overflow-x: auto; }

.toast {
  position: fixed; left: 50%; top: 40px; transform: translate(-50%, -16px); opacity: 0; pointer-events: none; z-index: 60;
  background: #121a22; color: #f1f4f6; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-strong);
  width: max-content; max-width: min(620px, calc(100vw - 32px)); transition: opacity .25s, transform .25s; border: 1px solid rgba(255, 255, 255, .12);
  border-left: 4px solid #e07a1f;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Écrans moyens ============ */
@media (max-width: 1280px) {
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .devis-foot { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .main { padding: 24px 22px 60px; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .truth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============ Tablette et téléphone ============ */
@media (max-width: 900px) {
  .app { display: block; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 10px; }
  .side-nav, .sim-date { display: none; }
  .side-foot { margin: 0; }
  .theme-btn span { display: none; }
  .theme-btn { width: 40px; height: 40px; justify-content: center; padding: 0; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-text { font-size: 17px; }
  .main { padding: 18px 16px 100px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 5px 2px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; border-radius: 10px; }
  .tabbar a.is-on { color: var(--primary); background: var(--primary-soft); }
  .tabbar .badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 19px; height: 19px; font-size: 11px; }
  .toast { top: 10px; }
  .validate { bottom: 78px; }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero-photo img { aspect-ratio: 16 / 10; }

  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-list { position: static; max-height: none; }
  .inbox.has-sel .inbox-list { display: none; }
  .inbox:not(.has-sel) .inbox-detail { display: none; }
  .back-btn { display: inline-flex; justify-self: start; }
    #v-demandes.has-sel .view-head { display: none; }

  .truth-head { grid-template-columns: minmax(0, 1fr); }
  .truth-photo { max-width: 320px; }
  .truth-photo img { aspect-ratio: 4 / 3; }
  .truth-photo figcaption { text-align: left; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .view-title { font-size: 25px; }
  .demo-bar { font-size: 12px; padding: 6px 10px; }
  .demo-links { display: block; }
  .demo-bar a { margin: 0 6px; }
  .hero h1 { font-size: 29px; }
  .lead { font-size: 16px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 2px 12px; padding: 12px 14px; }
  .step h3 { margin: 4px 0 0; }
  .step p { grid-column: 2; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: center; }
  .kpi-value { grid-column: 2; grid-row: 1 / span 3; font-size: 26px; text-align: right; margin: 0; }
  .truth-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }

  .detail-head h2 { font-size: 19px; }
  .stepper li { font-size: 0; padding-top: 26px; }
  .stepper li.cur { font-size: 11.5px; }
  .bubble-atelier { margin-left: 16px; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .qualif { grid-template-columns: auto minmax(0, 1fr); }
  .q-edit { grid-column: 1 / -1; }
  .q-badge { min-width: 86px; }
  .f-row { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .analyse-cta .btn { flex: 1 1 100%; }

  .devis-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dl-head { display: none; }
  .dl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 34px; grid-template-areas: "des des des del" "qte pu tot tot"; padding: 8px; }
  .dl-des { grid-area: des; }
  .dl-qte { grid-area: qte; }
  .dl-pu { grid-area: pu; }
  .dl-tot { grid-area: tot; }
  .dl-x { grid-area: del; }
  .dl-qte, .dl-pu, .dl-tot { flex-direction: column; align-items: stretch; gap: 2px; }
  .dl-des { flex-direction: column; align-items: stretch; gap: 2px; }
  .dl-unit { display: none; }
  .dl-tot { align-items: flex-end; justify-content: flex-end; }
  .dl-lab { display: block; }
  .dl-unit { min-width: 0; }

  .validate { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 8px; }
  .validate p { display: none; }
  .v-act { justify-items: stretch; gap: 8px; }
  .check { justify-self: start; }
  .validate-btns { justify-content: stretch; }
  .validate-btns .btn { flex: 1 1 0; padding: 10px 12px; }
  .devis-actions .btn, .btn-row .btn { flex: 1 1 auto; }

  .rel-top { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .pt-row, .pt-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .pt-head { display: none; }
  .pt-row .pt-des { grid-column: 1 / -1; }
  .sum-table div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .modal { padding: 10px; align-items: end; }
  .modal-box { padding: 20px 16px; max-height: 90vh; }
  .modal-actions .btn { flex: 1 1 auto; }
  .doc { padding: 18px 14px; }
  .doc table { font-size: 12px; }
}
