/* Lodia — composants (design v2). S'appuie uniquement sur tokens.css. Voir design/direction-v2.md. */

/* ---------- Socle ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: 72px; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 var(--fs-md)/1.55 var(--font-sans); font-feature-settings: "kern"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; color: var(--text); }
h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: var(--fs-md); font-weight: 650; letter-spacing: -.01em; }
@media (min-width: 900px) { h1 { font-size: 2rem; } h2 { font-size: 1.1875rem; } }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding-left: 1.2em; }
a { color: var(--brand-text); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration-color: currentColor; } }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
input, textarea, select, button { font: inherit; color: inherit; }
button, a, summary, [role="button"], label { touch-action: manipulation; }
button, .btn, summary, .tab, .nav-link { -webkit-user-select: none; user-select: none; }
svg.ico { flex: none; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* Utilitaires */
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.eyebrow { font: 500 var(--fs-sm)/1.3 var(--font-sans); color: var(--text-3); letter-spacing: 0; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); line-height: 1.5; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s5); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid > *, .row > *, .spread > *, .stack > * { min-width: 0; }
.narrow { max-width: 600px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Logo ---------- */
.logo { font: 800 1.375rem/1 var(--font-display); letter-spacing: -.035em; color: var(--text); text-decoration: none; display: inline-flex; align-items: baseline; gap: 2px; min-height: var(--tap); align-items: center; }
.logo i { font-style: normal; color: var(--brand); }
.logo b { width: .42em; height: .42em; border-radius: 2px 2px 50% 50%; background: var(--ai); display: inline-block; transform: translateY(.18em); align-self: center; }
.logo-client { font-size: 1.125rem; letter-spacing: -.02em; }

/* ---------- Coque de l'application ---------- */
.shell { min-height: 100dvh; }
.main-col { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: var(--z-nav); background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1180px; margin: 0 auto; }
.topbar-in > :last-child:not(:first-child) { margin-left: auto; }
.topbar-note { font-size: var(--fs-sm); color: var(--text-2); text-align: right; }
.topbar-end { margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; transition: background-color var(--dur-1), transform var(--dur-1) var(--ease-out); }
.icon-btn:active { transform: scale(.96); }
.content { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding-block: var(--s5) calc(96px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: var(--s5); }
.content-narrow { max-width: 680px; }
.is-public .content { padding-bottom: var(--s8); }
.preview-ribbon { margin: 0; padding: 6px 16px; font-size: var(--fs-xs); text-align: center; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--line); }

/* Barre du bas (téléphone) */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 4px max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px)); }
.bottomnav > a, .bottomnav > button { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 500 .6875rem/1.1 var(--font-sans); color: var(--text-2); text-decoration: none; border: 0; background: none; cursor: pointer; border-radius: var(--r-md); transition: color var(--dur-1), transform var(--dur-1) var(--ease-out); }
.bottomnav > a:active, .bottomnav > button:active { transform: scale(.94); }
.bottomnav svg { width: 22px; height: 22px; }
.bottomnav [aria-current="page"] { color: var(--brand-text); font-weight: 650; }
.bottomnav [aria-current="page"] svg { stroke-width: 2.1; }

/* Panneau « Plus » (popover natif) */
.sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text); padding: 8px max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-2); }
.sheet::backdrop { background: color-mix(in srgb, #0b1316 45%, transparent); }
.sheet:popover-open { display: flex; flex-direction: column; gap: var(--s3); animation: sheet-in 260ms var(--ease-drawer); }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 4px auto 4px; }
.sheet nav { display: flex; flex-direction: column; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }

/* Liens de navigation (barre latérale, panneau) */
.nav-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--tap); padding: 0 10px; border-radius: var(--r-md); border: 0; background: none; color: var(--text-2); font: 500 var(--fs-ui) var(--font-sans); text-decoration: none; text-align: left; cursor: pointer; transition: background-color var(--dur-1), color var(--dur-1); }
.nav-link svg { color: var(--text-3); }
.nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 650; }
.nav-link[aria-current="page"] svg { color: currentColor; }
@media (hover: hover) and (pointer: fine) { .nav-link:not([aria-current]):hover { background: var(--surface-2); color: var(--text); } .icon-btn:hover { background: var(--surface-2); color: var(--text); } }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); background: linear-gradient(to right, var(--surface) calc(var(--sidebar) - 1px), var(--line) calc(var(--sidebar) - 1px), var(--line) var(--sidebar), transparent var(--sidebar)); }
  .sidebar { display: flex; flex-direction: column; gap: var(--s3); position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: var(--s4) var(--s3); background: var(--surface); border-right: 1px solid var(--line); scrollbar-width: none; }
  .sidebar-head { padding: 0 6px; }
  .sidebar-nav { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s2); }
  .nav-group { display: flex; flex-direction: column; gap: 2px; }
  .nav-title { font: 600 var(--fs-xs)/1 var(--font-sans); color: var(--text-3); padding: 0 10px 6px; }
  .sidebar-foot { margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
  .who { font-size: var(--fs-sm); color: var(--text-2); padding: 0 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .is-app .topbar, .is-app .bottomnav { display: none; }
  .is-app .content { padding: var(--s7) var(--s6) var(--s8); }
}
@media (max-width: 1023.98px) { .sheet .nav-link { min-height: 48px; font-size: var(--fs-md); } }
@media (min-width: 1024px) { .sheet { display: none !important; } }
.is-public .bottomnav { display: none; }

/* Recherche / barre de commande */
.search-btn { display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 40px; padding: 0 8px 0 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font: 500 var(--fs-sm) var(--font-sans); cursor: pointer; transition: border-color var(--dur-1); }
.search-btn .kbd { margin-left: auto; }
@media (hover: hover) and (pointer: fine) { .search-btn:hover { border-color: var(--line-2); color: var(--text); } }
.kbd { font: 500 var(--fs-xs)/1.4 var(--font-mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--text-2); background: var(--surface); }
button.kbd { cursor: pointer; min-height: 36px; padding: 0 10px; }
.cmdk { position: fixed; inset: 0; z-index: var(--z-cmdk); background: color-mix(in srgb, #0b1316 40%, transparent); padding: max(10vh, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 12px max(12px, env(safe-area-inset-left, 0px)); }
.cmdk-panel { max-width: 620px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); overflow: hidden; }
.cmdk-search { display: flex; align-items: center; gap: var(--s3); padding: 6px 10px 6px 16px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.cmdk-search input { flex: 1; min-width: 0; min-height: 48px; border: 0; background: none; outline: 0; font-size: 16px; color: var(--text); }
.cmdk-list { padding: 6px; max-height: min(60vh, 460px); overflow: auto; overscroll-behavior: contain; }
.cmdk-list ul { list-style: none; padding: 0; margin: 0; }
.cmdk-group { font: 600 var(--fs-xs)/1 var(--font-sans); color: var(--text-3); padding: 12px 10px 6px; }
.cmd { display: flex; gap: 10px; align-items: center; min-height: var(--tap); padding: 0 10px; border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: var(--fs-ui); }
.cmd svg { color: var(--text-3); }
.cmd:hover, .cmd:focus-visible { background: var(--surface-2); outline-offset: -2px; }

/* Sélecteur de bailleur (maquettes) */
.picker { display: inline-flex; align-items: center; min-height: var(--tap); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 var(--fs-sm) var(--font-sans); max-width: 100%; padding: 0; }
.picker select { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; min-height: var(--tap); padding: 0 28px 0 12px; max-width: 46vw; text-overflow: ellipsis; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.cmdk-btn { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 500 var(--fs-sm) var(--font-sans); cursor: pointer; }
@media (max-width: 520px) { .cmdk-btn .label, .cmdk-btn .kbd { display: none; } }
.topbar-in > .logo { flex: none; }
.topbar-in > .picker { flex: 0 1 auto; min-width: 0; }
.topbar-in > .picker select { max-width: 100%; width: 100%; }
.topbar-in > .cmdk-btn { flex: none; }
.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- En-tête de page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3) var(--s4); }
.page-head .stack { gap: 6px; }
.page-head p { color: var(--text-2); max-width: 62ch; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: var(--fs-sm); color: var(--text-2); text-decoration: none; }
.back svg { width: 16px; height: 16px; }

/* ---------- Boutons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid transparent; font: 600 var(--fs-ui)/1.2 var(--font-sans); letter-spacing: -.005em; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-1), color var(--dur-1); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(20, 34, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-2); box-shadow: 0 1px 2px rgba(20, 34, 42, .04); }
.btn-ghost { background: transparent; color: var(--brand-text); padding: 0 var(--s3); }
.btn-ai { background: var(--ai-soft); color: var(--ai); border-color: var(--ai-line); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-block { width: 100%; min-height: 48px; font-size: var(--fs-md); }
.btn:disabled { background: var(--surface-2); color: var(--text-2); border-color: var(--line-strong); border-style: dashed; box-shadow: none; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover { background: var(--brand-hover); }
  .btn-secondary:not(:disabled):hover { border-color: var(--line-strong); background: var(--surface-2); }
  .btn-ghost:not(:disabled):hover { background: var(--brand-soft); }
  .btn-ai:not(:disabled):hover { border-color: var(--ai); }
}
.btn .arrow { transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .btn:hover .arrow { transform: translateX(2px); } }

/* ---------- Cartes et surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); box-shadow: var(--shadow-1); }
@media (min-width: 640px) { .card { padding: var(--s5); } }
.card-flat { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.card > .btn, .card > a.btn { align-self: flex-start; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.card .table-wrap { box-shadow: none; }
section > h2:first-child { margin-bottom: 2px; }

/* Détails repliables (formulaires secondaires, sections) */
details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: var(--tap); font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 1.75px solid var(--text-3); border-bottom: 1.75px solid var(--text-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--dur-2) var(--ease-out); margin-right: 4px; }
details[open] > summary::after { transform: rotate(225deg) translate(-1px, -1px); }
details.card { gap: 0; padding-block: var(--s2); }
details.card[open] { padding-bottom: var(--s4); }
@media (min-width: 640px) { details.card { padding-block: var(--s2); } details.card[open] { padding-bottom: var(--s5); } }
details.card-flat > summary { min-height: 40px; }

/* ---------- Pastilles de statut : forme + couleur + texte ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: var(--r-pill); font: 600 var(--fs-xs)/1.6 var(--font-sans); white-space: nowrap; vertical-align: middle; color: var(--muted); background: var(--muted-soft); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.info { color: var(--info); background: var(--info-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.risk { color: var(--risk); background: var(--risk-soft); }
.pill.muted { color: var(--muted); background: var(--muted-soft); }
.pill.short { color: var(--short); background: var(--short-soft); }
.pill.ai { color: var(--ai); background: var(--ai-soft); }
.pill.ai::before { width: 7px; height: 7px; border-radius: 2px 2px 50% 50%; }
/* Type de bail : petit tampon carré */
.lease { display: inline-flex; align-items: center; font: 600 var(--fs-xs)/1 var(--font-mono); letter-spacing: .04em; padding: 4px 6px; border-radius: 4px; border: 1px solid currentColor; }
.lease.hab { color: var(--info); } .lease.com { color: var(--brand-text); } .lease.pro { color: var(--muted); } .lease.cd { color: var(--short); }
/* v1.2 : le texte du bail (<article class="lease">, aperçu et page de signature) ne doit pas hériter du badge .lease ci-dessus
   (inline-flex : tout le bail sur une seule ligne, page de 1 300 px de large sur téléphone ; vu par le parcours de bout en bout). */
article.lease { display: block; font: inherit; letter-spacing: normal; padding: 0; border: 0; border-radius: 0; color: inherit; overflow-wrap: anywhere; }

/* ---------- Encart « l'IA propose » ---------- */
.ai:not(.pill) { border: 1px solid var(--ai-line); background: var(--ai-soft); border-radius: var(--r-lg); padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.ai-head { display: flex; align-items: center; gap: var(--s2); color: var(--ai); font: 650 var(--fs-sm)/1.2 var(--font-sans); }
.ai-head::before { content: ""; width: 9px; height: 9px; border-radius: 2px 2px 50% 50%; background: currentColor; flex: none; }
.ai-head svg { display: none; }
.ai p { color: var(--text); font-size: var(--fs-ui); }
.ai .row .btn { min-height: var(--tap); }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field > .label { font: 600 var(--fs-sm)/1.3 var(--font-sans); color: var(--text); }
.field .hint, .hint { font-size: var(--fs-sm); color: var(--text-3); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 400 16px/1.4 var(--font-sans); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.input::placeholder { color: var(--text-3); opacity: 1; }
select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus, .input:focus-visible { outline: 0; border-color: var(--brand); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--risk); }
.error { font-size: var(--fs-sm); color: var(--risk); }
@media (hover: hover) and (pointer: fine) { .input:not(:focus):hover { border-color: var(--text-3); } }
.check { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.check-inline { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; line-height: 1.35; }
.check-inline input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); flex: none; }
.choice { display: grid; gap: var(--s2); }
.choice label { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; cursor: pointer; transition: border-color var(--dur-1), background-color var(--dur-1), box-shadow var(--dur-1); }
.choice input { accent-color: var(--brand); width: 20px; height: 20px; margin: 0; flex: none; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
@media (hover: hover) and (pointer: fine) { .choice label:not(:has(input:checked)):hover { border-color: var(--line-strong); } }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font: 650 var(--fs-lg)/1.3 var(--font-display); letter-spacing: -.01em; padding: 0; margin-bottom: var(--s3); }
.form-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: var(--s1); overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs button { flex: none; min-height: var(--tap); padding: 0 var(--s3); border: 0; background: none; color: var(--text-2); font: 600 var(--fs-sm) var(--font-sans); border-bottom: 2px solid transparent; cursor: pointer; transition: color var(--dur-1), border-color var(--dur-2); }
.tabs button[aria-selected="true"] { color: var(--brand-text); border-color: var(--brand); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); overscroll-behavior-x: contain;
  background-image: linear-gradient(to right, var(--surface), var(--surface)), linear-gradient(to right, var(--surface), var(--surface)), linear-gradient(to right, rgba(20, 34, 42, .08), transparent), linear-gradient(to left, rgba(20, 34, 42, .08), transparent);
  background-position: left center, right center, left center, right center; background-repeat: no-repeat; background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%; background-attachment: local, local, scroll, scroll; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-ui); }
th { text-align: left; font: 600 var(--fs-xs)/1.3 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 10px var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
th:first-child { border-top-left-radius: calc(var(--r-lg) - 1px); } th:last-child { border-top-right-radius: calc(var(--r-lg) - 1px); }
td { padding: 12px var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child, th:first-child { padding-left: var(--s4); } td:last-child, th:last-child { padding-right: var(--s4); }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td.num, td .num { white-space: nowrap; }
td a { font-weight: 600; }
td b { font-weight: 650; }
@media (hover: hover) and (pointer: fine) { tbody tr { transition: background-color var(--dur-1); } tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); } }
@media (max-width: 639.98px) { table { font-size: var(--fs-sm); } td, th { padding-inline: 10px; } td { min-width: 96px; } td:first-child { min-width: 168px; } }

/* Listes de lignes (accueil, créneaux, lots) */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list > li:last-child { border-bottom: 0; }
ul.stack:not(.link-list):not(.list) { list-style: none; padding-left: 0; }
ul.stack.small { padding-left: 1.1em; list-style: disc; }
.card > ul.stack > li.spread, .card ul > li.spread { padding: 8px 0; border-bottom: 1px solid var(--line); }
.card ul > li.spread:last-child { border-bottom: 0; }

/* ---------- Accueil : actions du jour ---------- */
.hello { display: flex; flex-direction: column; gap: 4px; }
.hello .date { font-size: var(--fs-sm); color: var(--text-3); }
.hello p { color: var(--text-2); }
.actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.action { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3) var(--s4); align-items: center; padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.action-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.action.is-ai .action-ico { background: var(--ai-soft); color: var(--ai); }
.action.is-risk .action-ico { background: var(--risk-soft); color: var(--risk); }
.action.is-info .action-ico { background: var(--info-soft); color: var(--info); }
.action-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.action-title { font: 650 var(--fs-md)/1.35 var(--font-sans); color: var(--text); }
.action-ctx { font-size: var(--fs-sm); color: var(--text-2); }
.action .btn { grid-column: 2; justify-self: start; }
.action .tag { align-self: flex-start; margin-bottom: 2px; }
@media (min-width: 640px) { .action { grid-template-columns: auto minmax(0, 1fr) auto; padding: var(--s4) var(--s5); } .action .btn { grid-column: auto; justify-self: end; } }
.kpis { display: grid; gap: 1px; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); padding: var(--s4); display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: var(--fs-sm); color: var(--text-2); }
.kpi-value { font: 700 1.625rem/1.1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-value.risk { color: var(--risk); }
@media (min-width: 900px) { .kpi { padding: var(--s5); } .kpi-value { font-size: 2rem; } }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-ui); text-decoration: none; min-height: var(--tap); }
.link-arrow svg { width: 18px; height: 18px; transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .link-arrow:hover svg { transform: translateX(3px); } }

/* Barre de progression (formulaires une question par écran) */
.progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width var(--dur-3) var(--ease-out); }

/* Photo d'abord : vignette de bien dessinée (pas de photo réelle) */
.thumb { aspect-ratio: 16 / 10; max-width: 100%; border-radius: var(--r-xl); background: radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--ai) 22%, transparent), transparent 55%), linear-gradient(165deg, var(--brand-soft), var(--surface-2) 70%); position: relative; overflow: hidden; border: 1px solid var(--line); }
.thumb::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: color-mix(in srgb, var(--ok) 16%, var(--surface-2)); }
.thumb::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 14%; height: 50%; background: var(--surface); clip-path: polygon(0 40%, 50% 0, 100% 40%, 100% 100%, 0 100%); box-shadow: var(--shadow-1); }
.thumb.sm { width: 64px; flex: none; border-radius: var(--r-sm); aspect-ratio: 4 / 3; }
.thumb.shop::after { left: 18%; right: 18%; height: 44%; clip-path: polygon(0 16%, 100% 16%, 100% 100%, 0 100%); }

/* Toast « Annuler plutôt que confirmer » */
.toast { animation: toast-in var(--dur-2) var(--ease-out); position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: var(--z-toast); background: var(--text); color: var(--bg); border-radius: var(--r-lg); padding: 10px 10px 10px var(--s4); display: flex; gap: var(--s4); align-items: center; box-shadow: var(--shadow-2); font-size: var(--fs-ui); max-width: calc(100% - 32px); }
@media (min-width: 1024px) { .toast { bottom: 24px; } }
.toast button { background: none; border: 0; color: var(--bg); font: 700 var(--fs-sm) var(--font-sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 36px; padding: 0 8px; }

/* Bandeau des maquettes (navigation entre écrans, hors produit) */
.proto { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: var(--fs-xs); }
.proto-in { display: flex; gap: var(--s2); align-items: center; overflow-x: auto; padding-block: 6px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1180px; margin: 0 auto; scrollbar-width: none; }
.proto a, .proto button { flex: none; color: var(--text-2); text-decoration: none; padding: 4px 8px; border-radius: var(--r-sm); border: 0; background: none; font: inherit; cursor: pointer; }
.proto a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 650; }

/* ---------- États ---------- */
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s linear infinite; }
.sk-line { height: 12px; } .sk-title { height: 20px; width: 60%; } .sk-thumb { width: 64px; aspect-ratio: 4/3; }
.banner { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); font-size: var(--fs-ui); line-height: 1.5; }
.banner ul { width: 100%; }
.banner.warn { background: var(--warn-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.banner.risk { background: var(--risk-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--risk) 40%, transparent); }
.banner.info { background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s3); padding: var(--s7) var(--s4); border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--text-2); background: transparent; }
.empty.card-flat { background: transparent; }
.empty p { max-width: 46ch; }
.empty::before { content: ""; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c5d73' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 7a1.5 1.5 0 0 1 1.5-1.5h4l2 2h8a1.5 1.5 0 0 1 1.5 1.5v9A1.5 1.5 0 0 1 19 19.5H5A1.5 1.5 0 0 1 3.5 18z'/%3E%3C/svg%3E") center / 22px no-repeat; }
.empty:has(.glyph)::before { display: none; }
.empty .glyph { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; }
.reason { font-size: var(--fs-xs); color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.reason::before { content: ""; width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 2px; flex: none; }

/* Terme juridique expliqué au survol / à l'appui (principe 10) */
.term { border-bottom: 1px dotted currentColor; cursor: help; position: relative; }
.term:focus-visible { outline-offset: 4px; }
.term .tip { display: none; position: absolute; left: 0; bottom: calc(100% + 8px); width: min(260px, calc(100vw - 48px)); background: var(--text); color: var(--bg); padding: var(--s3); border-radius: var(--r-md); font: 400 var(--fs-xs)/1.45 var(--font-sans); text-transform: none; letter-spacing: 0; box-shadow: var(--shadow-2); z-index: var(--z-sheet); }
.term:hover .tip, .term:focus .tip, .term:focus-within .tip, .term.open .tip { display: block; animation: rise var(--dur-1) var(--ease-out); }
.term.edge .tip { left: auto; right: 0; }

/* Listes de contrôle */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.checklist li { display: flex; gap: var(--s3); align-items: center; padding: var(--s3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.checklist .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.checklist li.ok .dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.checklist li.ok { color: var(--text-2); }
.source { background: color-mix(in srgb, var(--ai) 22%, transparent); border-radius: 3px; padding: 0 2px; outline: 2px solid transparent; transition: outline-color var(--dur-1); }
.source.lit { outline-color: var(--ai); }
.swatch { width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--line-strong); padding: 0; cursor: pointer; }
.offline { position: sticky; top: env(safe-area-inset-top, 0px); z-index: var(--z-sticky); }
.done-tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: var(--surface); animation: pop var(--dur-2) var(--ease-out); }
.toast.warn .done-tick { background: var(--warn); }

/* Lien d'évitement (clavier) */
.sr-skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--brand); color: var(--brand-ink); padding: 10px 14px; border-radius: var(--r-md); }
.sr-skip:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.card-link { display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; }
.card-link:hover { border-color: var(--line-strong); }

/* ---------- Annonce publique et candidature ---------- */
.listing-head { display: flex; flex-direction: column; gap: 6px; }
.listing-head h1 { font-size: var(--fs-2xl); }
@media (min-width: 640px) { .listing-head h1 { font-size: 2.25rem; } }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price strong { font: 700 1.75rem/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fact { background: var(--surface); padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: 2px; }
.fact .k { font-size: var(--fs-sm); color: var(--text-2); }
.fact .v { font: 650 var(--fs-lg)/1.3 var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.fact .s { font-size: var(--fs-xs); color: var(--text-3); }
.dpe { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 6px; }
.dpe span { height: 22px; display: grid; place-items: center; font: 700 var(--fs-xs)/1 var(--font-sans); color: #fff; border-radius: 4px; opacity: .35; }
.dpe span[aria-current] { opacity: 1; transform: scaleY(1.18); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px currentColor; }
.dpe .A { background: #2a7a3b; color: #2a7a3b; } .dpe .B { background: #3f8f32; color: #3f8f32; } .dpe .C { background: #6c9a1f; color: #6c9a1f; } .dpe .D { background: #8a7c00; color: #8a7c00; } .dpe .E { background: #a8620a; color: #a8620a; } .dpe .F { background: #b34714; color: #b34714; } .dpe .G { background: #b0322b; color: #b0322b; }
.dpe span { -webkit-text-fill-color: #fff; }
.apply { position: relative; }
.apply .steps-head { display: flex; flex-direction: column; gap: var(--s2); padding-bottom: var(--s2); }
.apply-nav { display: flex; justify-content: space-between; gap: var(--s3); padding-top: var(--s4); border-top: 1px solid var(--line); margin-top: var(--s2); }
.apply-nav .btn-primary { min-width: 9.5rem; }
dl { margin: 0; } dt { font-weight: 600; } dd { margin: 0 0 var(--s2); color: var(--text-2); }

/* ---------- Site produit ---------- */
.is-site .content { max-width: none; padding: 0; gap: 0; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.site-nav { display: flex; align-items: center; gap: var(--s5); margin-left: auto; }
.site-nav a:not(.btn) { color: var(--text-2); text-decoration: none; font-size: var(--fs-ui); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .site-nav a:not(.btn):hover { color: var(--text); } }
@media (max-width: 759.98px) { .site-nav a:not(.btn) { display: none; } }
.hero { padding: var(--s7) 0 var(--s7); overflow: hidden; }
.hero-grid { display: grid; gap: var(--s7); align-items: center; }
@media (min-width: 960px) { .hero { padding: 88px 0 var(--s8); } .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: var(--s7); } }
.hero h1 { font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.5rem); line-height: 1.05; letter-spacing: -.04em; font-weight: 750; max-width: 17ch; }
.hero h1 em { font-style: normal; color: var(--brand-text); }
.hero .lede { font-size: var(--fs-lg); line-height: 1.55; color: var(--text-2); max-width: 46ch; margin-top: var(--s4); }
.hero .ctas { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.hero .ctas .btn { min-height: 48px; padding: 0 var(--s5); font-size: var(--fs-md); }
.hero .fine { margin-top: var(--s3); font-size: var(--fs-sm); color: var(--text-3); }
.shot { position: relative; border-radius: var(--r-xl); padding: 6px; background: color-mix(in srgb, var(--surface) 70%, var(--line)); border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(20, 34, 42, .35), var(--shadow-1); }
.shot img { display: block; width: 100%; height: auto; border-radius: calc(var(--r-xl) - 6px); border: 1px solid var(--line); background: var(--surface); }
.shot-phone { position: absolute; right: -10px; bottom: -36px; width: 31%; max-width: 210px; padding: 5px; border-radius: 26px; background: var(--text); box-shadow: 0 24px 60px -20px rgba(20, 34, 42, .5); }
.shot-phone img { border-radius: 21px; border: 0; }
@media (max-width: 959.98px) { .shot-phone { right: 8px; bottom: -24px; width: 34%; } }
.hero-visual { position: relative; padding-bottom: var(--s5); }
.hero-visual::before { content: ""; position: absolute; inset: -12% -20% -10% 0; background: radial-gradient(50% 50% at 60% 40%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%); z-index: -1; }
.proofs { border-block: 1px solid var(--line); background: var(--surface); }
.proofs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .proofs ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.proofs li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s5) var(--s4); font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; }
.proofs li b { display: block; color: var(--text); font: 650 var(--fs-ui)/1.3 var(--font-sans); margin-bottom: 2px; }
.proofs li svg { color: var(--brand-text); margin-top: 1px; }
.section { padding: var(--s8) 0; }
@media (min-width: 900px) { .section { padding: var(--s9) 0; } }
.section-head { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s6); max-width: 680px; }
.section-head h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.1; letter-spacing: -.035em; font-weight: 750; }
.section-head p { font-size: var(--fs-lg); color: var(--text-2); }
.bento { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 900px) { .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); } .bento > :nth-child(1) { grid-column: span 4; } .bento > :nth-child(2) { grid-column: span 2; } .bento > :nth-child(3) { grid-column: span 2; } .bento > :nth-child(4) { grid-column: span 2; } .bento > :nth-child(5) { grid-column: span 2; } }
.tile { position: relative; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); overflow: hidden; }
.tile h3 { font-size: var(--fs-xl); letter-spacing: -.025em; font-weight: 700; }
.tile p { color: var(--text-2); max-width: 52ch; }
.tile .demo { margin-top: auto; padding-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.tile.tinted { background: linear-gradient(160deg, var(--brand-soft), var(--surface) 65%); }
.tile.brass { background: linear-gradient(160deg, var(--ai-soft), var(--surface) 70%); }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-sm); }
.mini-row b { font-weight: 650; }
.plans { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .plans { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.plan { position: relative; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); }
.plan h3 { font-size: var(--fs-lg); }
.plan .amount { font: 750 2.25rem/1 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.plan .amount small { font: 500 var(--fs-sm) var(--font-sans); color: var(--text-2); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-ui); color: var(--text-2); }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg { color: var(--ok); width: 18px; height: 18px; margin-top: 2px; }
.plan .btn { margin-top: auto; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 24px 48px -24px color-mix(in srgb, var(--brand) 55%, transparent); }
.plan-flag { position: absolute; top: -11px; left: 20px; font: 650 var(--fs-xs)/1 var(--font-sans); color: var(--brand-ink); background: var(--brand); padding: 5px 9px; border-radius: var(--r-pill); }
.faq { display: grid; gap: 0 var(--s7); }
@media (min-width: 900px) { .faq { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }
.faq-list details { border-bottom: 1px solid var(--line); padding: var(--s2) 0; }
.faq-list details > summary { font: 650 var(--fs-md)/1.4 var(--font-sans); padding: var(--s2) 0; }
.faq-list details p { color: var(--text-2); padding: 0 0 var(--s3); max-width: 62ch; }
.cta-band { background: var(--surface); border-block: 1px solid var(--line); }
.cta-grid { display: grid; gap: var(--s6); align-items: start; }
@media (min-width: 900px) { .cta-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s8); } }
.site-foot { padding: var(--s6) 0 calc(var(--s6) + env(safe-area-inset-bottom, 0px)); color: var(--text-2); font-size: var(--fs-sm); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.site-foot a { color: var(--text-2); }
.notice { display: flex; gap: var(--s2); align-items: center; font-size: var(--fs-sm); color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 12px; width: fit-content; max-width: 100%; }

/* ---------- Mouvement ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: none; opacity: 1; } }
/* Entrée de page : une seule chorégraphie, courte, sur le contenu principal */
.content > * { animation: rise 280ms var(--ease-out) both; }
.content > :nth-child(2) { animation-delay: 30ms; } .content > :nth-child(3) { animation-delay: 60ms; } .content > :nth-child(n+4) { animation-delay: 90ms; }
.is-site .content > * { animation: none; }
.actions > li { animation: rise 280ms var(--ease-out) both; }
.actions > li:nth-child(2) { animation-delay: 40ms; } .actions > li:nth-child(3) { animation-delay: 80ms; } .actions > li:nth-child(n+4) { animation-delay: 120ms; }
/* Carte traitée : elle se replie au lieu de disparaître d'un coup */
[data-card] { transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out), max-height var(--dur-3) var(--ease-in-out), margin var(--dur-3), padding var(--dur-3); max-height: 900px; }
[data-card].is-leaving { opacity: 0; transform: translateX(24px) scale(.98); max-height: 0; padding-block: 0; margin-block: 0; overflow: hidden; border-width: 0; }
tr[data-card].is-leaving { transform: none; }
/* Écran de formulaire : la question suivante arrive par la droite, la précédente par la gauche */
[data-step]:not([hidden]) { animation: step-in var(--dur-2) var(--ease-out); }
[data-step].from-left:not([hidden]) { animation-name: step-in-left; }
@keyframes step-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes step-in-left { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
/* La suggestion IA apparaît après le contenu qu'elle commente */
.ai:not(.pill) { animation: rise var(--dur-2) var(--ease-out) both; animation-delay: 120ms; }
[role=tabpanel]:not([hidden]) { animation: rise var(--dur-2) var(--ease-out); }
/* La barre de commande ne s'anime pas : geste de clavier fréquent. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
@media print { .sidebar, .topbar, .bottomnav, .sheet, .cmdk { display: none !important; } body { background: #fff; } }
.apply-nav [data-prev]:disabled { visibility: hidden; }
@media (max-width: 639.98px) { .facts > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 640px) { .facts > :last-child:nth-child(3n+2) { grid-column: span 2; } .facts > :last-child:nth-child(3n+1) { grid-column: 1 / -1; } }

/* Tableaux sur téléphone : une fiche par ligne (intitulés posés par lodia.js) */
@media (max-width: 639.98px) {
  .table-wrap:has(table.stacks) { background: none; border: 0; box-shadow: none; overflow: visible; }
  table.stacks, table.stacks tbody { display: block; }
  table.stacks thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stacks tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
  table.stacks td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0; border: 0; min-width: 0; grid-column: 1 / -1; text-align: right; }
  table.stacks td::before { content: attr(data-label); font: 500 var(--fs-xs)/1.4 var(--font-sans); letter-spacing: 0; color: var(--text-3); text-align: left; flex: none; max-width: 45%; }
  table.stacks td:first-child { grid-column: 1; display: block; text-align: left; font-size: var(--fs-ui); }
  table.stacks td:first-child::before { display: none; }
  table.stacks td:nth-child(2):has(> .pill:only-child) { grid-column: 2; grid-row: 1; display: block; }
  table.stacks td:nth-child(2):has(> .pill:only-child)::before { display: none; }
  table.stacks td:empty, table.stacks td[data-label=""]::before { display: none; }
  table.stacks td > form, table.stacks td > .stack { width: 100%; text-align: left; }
  table.stacks td:has(> form)::before, table.stacks td:has(> .btn)::before { display: none; }
  table.stacks td:has(> form), table.stacks td:has(> .btn) { display: block; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); }
  table.stacks td:has(> .btn) .btn { width: 100%; }
}
/* Petits indicateurs existants (carte plate : intitulé + chiffre) */
.card-flat > .eyebrow + p.num, .card-flat > .eyebrow + .num { font: 700 1.375rem/1.2 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.grid > .card-flat:has(> .eyebrow + .num) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s3) var(--s4); }
[data-out] { font: 650 var(--fs-lg)/1.35 var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); }
[data-out]:empty { display: none; }
fieldset.card-flat { padding-top: var(--s3); }
fieldset.card-flat > legend { float: left; width: 100%; font: 650 var(--fs-md)/1.3 var(--font-sans); margin-bottom: var(--s2); }
fieldset.card-flat > legend + * { clear: both; }
@media (pointer: coarse) { .btn-sm { min-height: var(--tap); } }
@media (max-width: 479.98px) { .proofs ul { grid-template-columns: 1fr; } .proofs li { padding: var(--s4) var(--s2); } }

/* ---------- Illustrations de biens (design v2.1) ---------- */
.ill { display: block; width: 100%; height: 100%;
  --ill-sky: color-mix(in srgb, var(--brand) 12%, var(--surface)); --ill-wall: var(--surface); --ill-roof: var(--brand); --ill-win: color-mix(in srgb, var(--brand) 26%, var(--surface));
  --ill-door: var(--ai); --ill-ground: color-mix(in srgb, var(--ok) 22%, var(--surface)); --ill-leaf: color-mix(in srgb, var(--ok) 62%, var(--surface)); --ill-trunk: color-mix(in srgb, var(--ai) 55%, var(--text)); --ill-sun: color-mix(in srgb, var(--ai) 70%, var(--surface)); }
.ill.v1 { --ill-roof: color-mix(in srgb, var(--risk) 72%, var(--text)); --ill-door: var(--brand); }
.ill.v2 { --ill-roof: color-mix(in srgb, var(--short) 80%, var(--text)); --ill-door: var(--ok); }
.ill.v3 { --ill-roof: color-mix(in srgb, var(--text) 70%, var(--surface)); --ill-door: var(--risk); --ill-sky: color-mix(in srgb, var(--ai) 14%, var(--surface)); }
.ill .sky { fill: var(--ill-sky); } .ill .sun { fill: var(--ill-sun); } .ill .cloud { fill: var(--surface); opacity: .9; }
.ill .ground { fill: var(--ill-ground); } .ill .path { fill: color-mix(in srgb, var(--ill-ground) 55%, var(--surface)); }
.ill .wall { fill: var(--ill-wall); stroke: color-mix(in srgb, var(--text) 14%, transparent); stroke-width: 1; }
.ill .roof, .ill .chim { fill: var(--ill-roof); } .ill .win { fill: var(--ill-win); } .ill .mull { stroke: var(--ill-wall); stroke-width: 2; fill: none; }
.ill .door { fill: var(--ill-door); } .ill .knob { fill: var(--surface); } .ill .trunk { fill: var(--ill-trunk); }
.ill .leaf { fill: var(--ill-leaf); } .ill .leaf2 { fill: color-mix(in srgb, var(--ill-leaf) 75%, var(--text)); }
.ill .sign { fill: color-mix(in srgb, var(--brand) 85%, var(--text)); } .ill .awn { fill: var(--ill-roof); } .ill .awn2 { fill: var(--surface); opacity: .85; }
.ill .key { fill: none; stroke: var(--ai); stroke-width: 3.5; } .ill .keyt { fill: none; stroke: var(--ai); stroke-width: 3.5; stroke-linecap: round; }
.media { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--surface-2); aspect-ratio: 16 / 10; }
.media > .badge { position: absolute; left: 10px; top: 10px; }
.media-sm { width: 76px; flex: none; aspect-ratio: 4 / 3; border-radius: var(--r-md); }
.media-hero { aspect-ratio: 16 / 9; border-radius: var(--r-xl); border: 1px solid var(--line); }
@media (min-width: 640px) { .media-hero { aspect-ratio: 21 / 9; } }
.biens { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.bien { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); transition: box-shadow var(--dur-2), transform var(--dur-2) var(--ease-out); }
.bien .media { border-radius: 0; aspect-ratio: 16 / 8; }
@media (hover: hover) and (pointer: fine) { .bien:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); } }
.bien-body { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); flex: 1; }
.bien-head { display: flex; flex-direction: column; gap: 2px; }
.bien-head h3 { font-size: var(--fs-lg); letter-spacing: -.015em; }
.lots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lots li { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.bien-foot { margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, var(--brand))); transform-origin: left; animation: grow 700ms var(--ease-out) both 200ms; }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
.home-hero { display: flex; flex-direction: column; gap: var(--s4); }
.quick { display: grid; gap: var(--s2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.quick-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 88px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--text); text-decoration: none; font: 600 var(--fs-ui)/1.3 var(--font-sans); transition: transform var(--dur-1) var(--ease-out), border-color var(--dur-1); }
.quick-tile svg { padding: 7px; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); box-sizing: border-box; }
.quick-tile.is-warn svg { background: var(--warn-soft); color: var(--warn); }
.quick-tile:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .quick-tile:hover { border-color: var(--line-strong); } }
details.card { scroll-margin-top: 80px; }
.fact .v .pill { font-size: var(--fs-xs); }
.choice label svg { color: var(--text-3); width: 20px; height: 20px; }
.choice label:has(input:checked) svg { color: var(--brand-text); }
.sticky-cta { position: fixed; z-index: var(--z-sticky); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); min-height: 52px; box-shadow: var(--shadow-2); }
@media (min-width: 760px) { .sticky-cta { display: none; } }
.sticky-cta.is-away { opacity: 0; transform: translateY(12px); pointer-events: none; }
.sticky-cta { transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-out); }
.tile-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-text); }
.tile.brass .tile-ico { background: color-mix(in srgb, var(--ai) 18%, var(--surface)); color: var(--ai); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); grid-template-columns: 1fr; counter-reset: s; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { position: relative; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); }
.steps h3 { font-size: var(--fs-lg); letter-spacing: -.02em; }
.steps p { color: var(--text-2); }
.step-n { position: absolute; right: var(--s5); top: var(--s4); font: 800 2.5rem/1 var(--font-display); letter-spacing: -.04em; color: var(--surface-3); }
.types-band { padding: var(--s7) 0; background: var(--surface); border-block: 1px solid var(--line); }
.types-band h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -.03em; margin-bottom: var(--s5); }
.types { list-style: none; margin: 0; padding: 0 0 4px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.types li { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: var(--fs-ui); }
.types .media { aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.who-cell { display: flex; gap: 12px; align-items: center; }
.who-cell .media-sm { width: 64px; }
@media (max-width: 639.98px) { table.stacks td:first-child .who-cell .media-sm { width: 56px; } }

/* ---------- Site v3 : IA visible dans l'espace bailleur ---------- */
.ia-resume { margin: 0 0 var(--s5); padding: var(--s4); border-radius: var(--r-xl); background: var(--ai-soft); border: 1px solid var(--ai-line); }
.ia-resume-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s2); }
.ia-resume .ai-head { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; color: var(--ai); }
.ia-resume > p { margin: 0 0 var(--s3); line-height: 1.55; }
.veille { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.veille li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--ai-line); font-size: var(--fs-sm); color: var(--text-2); }
.veille li b { color: var(--text); font-weight: 600; }
.veille-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
@media (prefers-reduced-motion: no-preference) { .veille-dot { animation: veille 2.4s ease-in-out infinite; } }
@keyframes veille { 50% { box-shadow: 0 0 0 6px transparent; } }
.ia-encart { margin: 0 0 var(--s5); }
.ia-mode { display: inline-flex; margin: 0 0 var(--s4); white-space: normal; line-height: 1.4; }
.ia-fil { display: flex; flex-direction: column; gap: var(--s3); }
.ia-fil:empty { display: none; }
.ia-msg { max-width: 92%; padding: var(--s3) var(--s4); border-radius: var(--r-lg); line-height: 1.55; }
.ia-msg p { margin: 0 0 6px; } .ia-msg p:last-child { margin: 0; }
.ia-msg.moi { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.ia-msg.ia { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ia-rep .pill { margin-bottom: 6px; }
.ia-wait { display: inline-flex; gap: 5px; }
.ia-wait span { width: 7px; height: 7px; border-radius: 50%; background: var(--ai); opacity: .4; animation: wait 1s ease-in-out infinite; }
.ia-wait span:nth-child(2) { animation-delay: .15s; } .ia-wait span:nth-child(3) { animation-delay: .3s; }
@keyframes wait { 50% { opacity: 1; transform: translateY(-3px); } }
.ia-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.ia-row { display: flex; gap: var(--s2); } .ia-row .input { flex: 1; min-width: 0; }
.ia-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); }
.ia-gardes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-sm); color: var(--text-3); }
.ia-gardes li { display: inline-flex; align-items: center; gap: 6px; } .ia-gardes .ico { color: var(--ok); }
.cmd-ia { color: var(--ai) !important; font-weight: 600; } .cmd-ia #cmdk-ia-q { font-weight: 400; color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 599px) { .ia-row { flex-direction: column; } .ia-row .btn { width: 100%; min-height: 48px; } }
.ia-analyse { min-width: 240px; } .ia-analyse p { margin: 4px 0 0; font-size: var(--fs-sm); line-height: 1.45; }

/* v1.4 — Dossier de location structuré (fiche du bail et espace locataire) */
.dos-grille { display: grid; gap: 14px; }
@media (min-width: 960px) { .dos-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dos-groupe { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; background: var(--surface); }
.dos-groupe > summary { list-style: none; cursor: pointer; }
.dos-groupe h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 700 var(--fs-md)/1.3 var(--font-display); color: var(--text); }
.dos-groupe h3 svg { color: var(--brand-text); }
.dos-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dos-ligne { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.dos-ligne:first-child { border-top: 0; }
.dos-tete { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.dos-tete b { font-weight: 650; font-size: var(--fs-ui); line-height: 1.35; }
.dos-docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dos-docs li { display: flex; flex-direction: column; }
.dos-docs a { display: inline-flex; gap: 6px; align-items: center; color: var(--brand-text); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.dos-docs a:hover span { text-decoration: underline; }
.dos-docs small { color: var(--text-3); font-size: var(--fs-xs); padding-left: 22px; }
.dos-depot { margin: 0; }
.dos-depot label { cursor: pointer; }
.dos-loc .dos-groupe { margin-bottom: 10px; background: var(--bg); }
