/* audit-immo · styles applicatifs par-dessus le design system.
   Source : maquettes docs/design/*.html (blocs <style> consolidés, classes .hero
   dédoublonnées en .home-hero / .rep-hero). Tokens : voir ds.css — jamais de couleur en dur. */
@import url("ds-16wRuqo.css");

/* =============================================================
   LAYOUT GLOBAL
   ============================================================= */
body {
  background-color: var(--bg);
  background-image: radial-gradient(1200px 560px at 80% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 56%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1; }
.footer { margin-top: auto; }

/* nav responsive : icônes seules sur petit écran */
@media (max-width: 760px) {
  .nav-link .lbl { display: none; }
  .nav-in { gap: 8px; }
  .nav-links { gap: 2px; }
}

/* flashes */
.flash {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-radius: var(--r-md); margin: 16px 0 0;
  font-size: var(--t-sm); font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--fg-2);
}
.flash .ic { flex: none; }
.flash.success { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); border-color: color-mix(in srgb, var(--pos) 32%, transparent); }
.flash.error { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); border-color: color-mix(in srgb, var(--neg) 32%, transparent); }
.flash.warning { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }

/* spinner (audit en cours) */
.spin {
  display: inline-block; width: .8em; height: .8em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: ai-spin .7s linear infinite; vertical-align: -1px;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* prose (pages légales) */
.prose { max-width: 70ch; line-height: 1.65; }
.prose h2 { margin: 1.8em 0 .5em; font-size: var(--t-h3); }
.prose p, .prose li { color: var(--fg-2); font-size: var(--t-body); }
.prose ul { padding-left: 1.2em; }

/* =============================================================
   HOME (maquette Home.html)
   ============================================================= */
.home-hero { position: relative; padding: 64px 0 40px; overflow: hidden; }
.home-hero .hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
@media (max-width: 920px) { .home-hero .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
.home-hero h1 { font-size: clamp(36px, 5.2vw, 62px); letter-spacing: -.04em; line-height: 1.0; margin: 18px 0 20px; font-weight: 800; }
.home-hero h1 em { font-style: normal; color: var(--accent); }
.home-hero .sub { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 50ch; }
.home-hero .sub b { color: var(--fg-2); font-weight: 600; }

.paste { display: flex; gap: 10px; margin: 30px 0 14px; max-width: 560px; }
.paste .input { flex: 1; padding: 15px 16px; }
@media (max-width: 480px) { .paste { flex-direction: column; } }
.cred { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: var(--t-xs); color: var(--muted); }
.cred .chip { background: transparent; border-color: var(--line); }
.cred .src { font-size: 11px; }

/* carte preview flottante */
.preview-card { position: relative; }
.preview-card .glow { position: absolute; inset: -30px -10px -10px; background: radial-gradient(closest-side, var(--accent-soft), transparent 70%); filter: blur(20px); z-index: 0; pointer-events: none; }
.mini { position: relative; z-index: 1; padding: 0; overflow: hidden; }
.mini-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.mini-biz { display: flex; align-items: center; gap: 11px; }
.mini-biz .ic-wrap { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.mini-biz h4 { font-size: 14px; }
.mini-biz p { font-size: 11.5px; color: var(--muted); }
.mini-body { padding: 18px; display: grid; gap: 16px; }
.mini-gauges { display: flex; justify-content: space-around; }
.mini-gauges .gauge svg { width: 64px; height: 64px; }
.mini-gauges .gv { font-size: 15px; }
.mini-gauges .gl { font-size: 10px; }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.mini-kpi { background: var(--surface); padding: 12px 14px; }
.mini-kpi .l { font-size: 10px; color: var(--muted); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.mini-kpi .v { font-family: var(--font-mono); font-weight: 700; font-size: 17px; }

/* sections home */
.sect { padding: 56px 0; }
.sect-label { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.sect-label h2 { font-size: 28px; letter-spacing: -.025em; }
.sect-label .line { flex: 1; height: 1px; background: var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 24px; position: relative; }
.step .n { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; margin-bottom: 16px; }
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { font-size: var(--t-sm); color: var(--muted); line-height: 1.6; }
.step .ic-big { position: absolute; top: 20px; right: 20px; color: var(--line-2); }
.step .ic-big .ic { width: 26px; height: 26px; }

.profiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 820px) { .profiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .profiles { grid-template-columns: 1fr; } }
.profile { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.profile .pic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); transition: var(--dur-2); }
.profile:hover .pic { background: var(--accent-soft); border-color: var(--accent-line); }
.profile h3 { font-size: 16px; }
.profile p { font-size: var(--t-sm); color: var(--muted); }
.profile .arr { margin-top: auto; color: var(--faint); align-self: flex-end; transition: var(--dur-2); }
.profile:hover .arr { color: var(--accent); transform: translateX(3px); }

.pricing { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; align-items: stretch; }
@media (max-width: 760px) { .pricing { grid-template-columns: 1fr; } }
.price-main { padding: 32px; display: flex; flex-direction: column; }
.price-main .amt { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 18px; }
.price-main .amt .big { font-family: var(--font-mono); font-size: 46px; font-weight: 800; letter-spacing: -.03em; }
.price-feats { display: grid; gap: 12px; margin: 6px 0 22px; }
.price-feats div { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); }
.price-feats .ic { color: var(--accent); width: 17px; height: 17px; }
.price-side { padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 8px; background: var(--surface-2); }

.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--line); }
.faq details summary { padding: 20px 4px; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 600; font-size: 16px; }
.faq details summary::-webkit-details-marker { display: none; }
.faq details summary .ic { color: var(--muted); transition: transform var(--dur-2); }
.faq details[open] summary .ic { transform: rotate(180deg); color: var(--accent); }
.faq details .a { padding: 0 4px 22px; color: var(--muted); font-size: var(--t-body); line-height: 1.65; max-width: 64ch; }

/* =============================================================
   DASHBOARD / LISTE DES AUDITS (maquette Dashboard.html)
   ============================================================= */
.dash-head { padding: 34px 0 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dash-head h1 { font-size: 32px; letter-spacing: -.03em; }
.dash-head p { color: var(--muted); font-size: var(--t-body); margin-top: 6px; }
.stat-row { display: flex; gap: 28px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-family: var(--font-mono); font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.stat .l { font-size: var(--t-xs); color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.search input { width: 100%; padding: 10px 14px 10px 38px; border-radius: var(--r-md); background: var(--field-bg); border: 1px solid var(--line-2); color: var(--fg); font-size: var(--t-sm); }
.search input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); font-size: var(--t-xs); font-weight: 600; color: var(--muted); cursor: pointer; transition: var(--dur-2); display: inline-flex; align-items: center; gap: 6px; }
.fchip:hover { color: var(--fg); border-color: var(--line-2); }
.fchip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.fchip .dotc { width: 7px; height: 7px; border-radius: 50%; }
.sortbtn { margin-left: auto; }

.audit-list { display: flex; flex-direction: column; gap: 10px; }
.audit-row {
  display: grid; grid-template-columns: auto 1.6fr .9fr .9fr 1fr .9fr auto; gap: 18px; align-items: center;
  padding: 16px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2), box-shadow var(--dur-2);
  position: relative; overflow: hidden; color: var(--fg);
}
.audit-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--vc, var(--line)); opacity: .9; }
.audit-row:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--sh-2); }
.ar-biz { display: flex; align-items: center; gap: 13px; min-width: 0; }
.ar-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); flex: none; }
/* vignette photo de l'annonce (remplace l'icône de profil quand disponible) */
.ar-thumb { width: 64px; height: 48px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); flex: none; position: relative; }
.ar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sold-badge { position: absolute; inset: auto 0 0 0; background: color-mix(in srgb, var(--neg) 85%, black); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 1px 0; }
.new-badge { position: absolute; inset: 0 0 auto 0; background: color-mix(in srgb, var(--pos) 78%, black); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 1px 0; }
.ar-biz h3 { font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-biz p { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* contexte socio-éco de la commune (INSEE) — sous la ligne méta */
.ar-ctx { font-size: 11px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* badges DPE / source dans la ligne méta (palette DPE alignée sur la page rapport) */
.dpe-tag { display: inline-grid; place-items: center; min-width: 17px; height: 17px; border-radius: 4px; font-weight: 800; font-size: 10px; color: #fff; vertical-align: -3px; padding: 0 2px; }
.dpe-tag[data-l="A"] { background: #16a34a; }
.dpe-tag[data-l="B"] { background: #65a30d; }
.dpe-tag[data-l="C"] { background: #ca8a04; }
.dpe-tag[data-l="D"] { background: #ea580c; }
.dpe-tag[data-l="E"] { background: #dc2626; }
.dpe-tag[data-l="F"] { background: #b91c1c; }
.dpe-tag[data-l="G"] { background: #7f1d1d; }
.src-tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface-2); font-size: 10px; font-weight: 700; color: var(--muted); vertical-align: -2px; }
.ar-col { display: flex; flex-direction: column; gap: 3px; }
.ar-col .cl { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.ar-col .cv { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }
.ar-col .cs { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.ar-end { display: flex; align-items: center; gap: 14px; }
/* boutons favori (cœur) / masquer (œil barré) — toggle fetch via le contrôleur Stimulus flag */
.ar-actions { display: flex; gap: 2px; }
.flagbtn { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--faint); cursor: pointer; transition: var(--dur-2); padding: 0; }
.flagbtn .ic { width: 16px; height: 16px; }
.flagbtn:hover { color: var(--fg); border-color: var(--line-2); background: var(--surface-2); }
.flagbtn.fav.on { color: var(--neg); }
.flagbtn.fav.on .ic { fill: currentColor; }
.flagbtn.hide.on { color: var(--accent); }
.ar-score { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--muted); }
.ar-go { color: var(--faint); transition: var(--dur-2); }
.audit-row:hover .ar-go { color: var(--accent); transform: translateX(2px); }
/* verdict flouté (non-payeur) */
.ar-blur { filter: blur(6px); pointer-events: none; user-select: none; }

@media (max-width: 900px) {
  .audit-row { grid-template-columns: auto 1.4fr 1fr auto; }
  .ar-hideable { display: none; }
}
@media (max-width: 560px) {
  .audit-row { grid-template-columns: auto 1fr auto; gap: 12px; padding: 14px; }
  .ar-cashflow { display: none; }
}

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 70px 20px; }
.empty[hidden] { display: none; }
.empty .ill { width: 76px; height: 76px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); margin-bottom: 22px; }
.empty .ill .ic { width: 34px; height: 34px; }
.empty h3 { font-size: 20px; margin-bottom: 8px; }
.empty p { color: var(--muted); font-size: var(--t-body); max-width: 42ch; margin-bottom: 22px; line-height: 1.6; }

/* =============================================================
   RAPPORT D'AUDIT (maquette Rapport d'audit.html)
   ============================================================= */
.report { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; padding-top: 28px; }
@media (max-width: 980px) { .report { gap: 20px; } .toc { display: none; } }

.toc { position: sticky; top: 76px; align-self: start; }
.toc .toc-label { font-size: var(--t-2xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 0 12px 8px; }
.toc a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); font-size: var(--t-sm); color: var(--muted); font-weight: 500; transition: var(--dur-2); }
.toc a:hover { background: var(--surface-2); color: var(--fg); }
.toc a.on, .toc a.active { background: var(--surface-2); color: var(--fg); }
.toc a.on .ic, .toc a.active .ic { color: var(--accent); }
.toc a .ic { width: 17px; height: 17px; color: var(--faint); }
.toc .toc-meta { margin-top: 18px; padding: 14px 12px; border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--muted); line-height: 1.6; }

.rep-main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }

/* onglets du rapport (cf. tabs_controller) — barre horizontale sticky, scrollable sur mobile */
.rep-tabs { position: sticky; top: 64px; z-index: 20; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px; margin: -4px 0 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r-lg); }
.rep-tabs::-webkit-scrollbar { display: none; }
.rep-tabs button { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 9px 14px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 600; font-size: var(--t-sm); cursor: pointer; transition: var(--dur-2); }
.rep-tabs button:hover { background: var(--surface-2); color: var(--fg); }
.rep-tabs button.active { background: var(--surface-2); color: var(--fg); border-color: var(--line-2); }
.rep-tabs button.active .ic { color: var(--accent); }
.rep-tabs button .ic { width: 16px; height: 16px; color: var(--faint); }
/* panneau masqué par JS — !important pour battre le display des panneaux (.panel-2b = grid).
   Scopé écran : à l'impression rien n'est masqué (tous les onglets sortent dans le PDF/print). */
@media screen { .tab-hidden { display: none !important; } }
@media print { .rep-tabs { display: none !important; } }

.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--muted); }
.crumb a:hover { color: var(--fg); }
.rep-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* hero de synthèse */
.rep-hero { position: relative; overflow: hidden; }
.rep-hero .hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; }
@media (max-width: 760px) { .rep-hero .hero-grid { grid-template-columns: 1fr; } }
.hero-left { padding: 28px 30px; }
.hero-right { padding: 28px 30px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 760px) { .hero-right { border-left: 0; border-top: 1px solid var(--line); } }
.biz { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.biz-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.biz-photo { width: 76px; height: 56px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.biz-photo img { width: 100%; height: 100%; object-fit: cover; }
.biz-ic .ic { width: 24px; height: 24px; }
.biz h1 { font-size: 21px; letter-spacing: -.02em; }
.biz p { font-size: var(--t-sm); color: var(--muted); margin-top: 2px; }
/* en-tête identité compacte de la Synthèse (la fiche détaillée vit dans « Le bien ») */
.hero-id { display: flex; align-items: center; gap: 13px; padding: 16px 30px; border-bottom: 1px solid var(--line); }
.hero-id .biz-photo.sm, .hero-id .biz-ic { flex: none; }
.biz-photo.sm { width: 58px; height: 44px; border-radius: 10px; }
.hero-id-txt h1 { font-size: 19px; letter-spacing: -.02em; }
.hero-id-txt p { font-size: var(--t-sm); color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) { .hero-id { padding: 14px 18px; } }
.scoreglob { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 14px; }
.scoreglob .num { font-size: 42px; font-weight: 800; line-height: 1; }
.scoreglob .den { font-size: 18px; color: var(--muted); font-family: var(--font-mono); }
.synth { font-size: 14.5px; line-height: 1.65; color: var(--fg-2); max-width: 46ch; }
.synth b { color: var(--fg); }

/* bloc « À retenir » — clôture opinionée de la Synthèse (phrase de décision + repères de négo) */
.takeaway .tk-line { font-size: 15.5px; font-weight: 600; line-height: 1.5; color: var(--fg); margin: 6px 0 14px; }
.nego-mini { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.nego-mini .nm { display: flex; flex-direction: column; gap: 3px; padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.nego-mini .nm-k { font-size: var(--t-xs); color: var(--muted); }
.nego-mini .nm-v { font-family: var(--font-mono); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.tk-links a { color: var(--accent); }

/* onglet Marché — carte « Contexte de la commune » (snapshot C5) : rangée de scores compacts */
.cc-scores { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-score { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.cc-score .cc-k { font-size: var(--t-xs); color: var(--muted); }
.cc-score .cc-v { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.cc-score .cc-v small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* onglet Dossier — barre proportionnelle des charges + légende (sans lib, print-safe) */
.charges-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 8px 0 14px; background: var(--surface-3); }
.charges-bar .cseg { height: 100%; }
.charges-legend { display: flex; flex-direction: column; gap: 8px; }
.charges-legend .cleg { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); }
.charges-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.charges-legend .cleg-k { color: var(--fg-2); }
.charges-legend .cleg-v { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }

.gauges-row { display: flex; justify-content: space-between; gap: 8px; }
/* overflow visible (≠ hidden) pour ne pas clipper les bulles du lexique ; les coins arrondis
   de la grille hairline sont restitués cellule par cellule (grille 2 colonnes, jusqu'à 4 KPI). */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--r-md); border: 1px solid var(--line); }
.kpi { background: var(--surface); padding: 15px 16px; }
.kpi:first-child { border-top-left-radius: calc(var(--r-md) - 1px); }
.kpi:nth-child(2) { border-top-right-radius: calc(var(--r-md) - 1px); }
.kpi:nth-last-child(2):nth-child(odd) { border-bottom-left-radius: calc(var(--r-md) - 1px); }
.kpi:last-child { border-bottom-right-radius: calc(var(--r-md) - 1px); }
.kpi .kl { font-size: var(--t-2xs); color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.kpi .kl .ic { width: 14px; height: 14px; color: var(--faint); }
.kpi .kv { font-family: var(--font-mono); font-weight: 700; font-size: 23px; letter-spacing: -.02em; line-height: 1; }
.kpi .kv small { font-size: 12px; color: var(--muted); font-weight: 500; font-family: var(--font-sans); margin-left: 3px; }
/* bulles du lexique ouvertes vers l'intérieur de la carte pour rester entièrement visibles :
   colonne droite alignée à droite, rangée du bas ouverte vers le haut. */
.kpi:nth-child(even) .lex-pop { left: auto; right: 0; }
.kpi:nth-child(n+3) .lex-pop { top: auto; bottom: calc(100% + 6px); transform: translateY(3px); }

/* sections du rapport */
.sec { scroll-margin-top: 76px; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sec-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); flex: none; }
.sec-head h2 { font-size: 20px; }
.sec-head .sec-sub { font-size: var(--t-sm); color: var(--muted); }

.panel { display: grid; gap: 18px; }
.panel-2 { grid-template-columns: 1.3fr 1fr; }
.panel-2b { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .panel-2, .panel-2b { grid-template-columns: 1fr; } }

.chart-card { padding: 20px 22px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.chart-title { font-size: var(--t-sm); font-weight: 700; }
.chart-box { position: relative; height: 230px; }
details.altdata { margin-top: 12px; }
details.altdata summary { font-size: var(--t-xs); color: var(--muted); cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.altdata summary::-webkit-details-marker { display: none; }
details.altdata[open] summary { color: var(--fg); }

.stat-list { display: flex; flex-direction: column; }
.stat-list .sl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.stat-list .sl-row:first-child { border-top: 0; }
.stat-list .sl-k { color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat-list .sl-v { font-family: var(--font-mono); font-weight: 600; }

/* échelle DPE */
.dpe { display: flex; flex-direction: column; gap: 4px; }
.dpe-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; }
.dpe-letter { font-weight: 800; font-size: 13px; text-align: center; }
.dpe-bar { height: 18px; border-radius: 4px; position: relative; }
.dpe-row.active .dpe-bar::after { content: ""; position: absolute; right: -7px; top: 50%; transform: translateY(-50%); border-left: 9px solid var(--fg); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.dpe-row.active { font-weight: 700; }
.dpe-val { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--muted); }

/* onglet « Le bien » : photo de couverture + badges DPE/GES */
.lb-photo img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--r-md); display: block; }
/* carrousel de photos (sans lib : défilement natif scroll-snap, enrichi par carousel_controller) */
.lb-gallery { position: relative; overflow: hidden; padding: 0; }
.lb-frame { position: relative; }
.lb-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: center; }
.lb-slide img { width: 100%; height: 440px; object-fit: cover; display: block; }
@media (max-width: 760px) { .lb-slide img { height: 280px; } }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); color: var(--fg); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px); transition: var(--dur-2); }
.lb-nav:hover { background: color-mix(in srgb, var(--bg) 75%, transparent); }
.lb-nav .ic { width: 18px; height: 18px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; gap: 7px; justify-content: center; }
.lb-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: #fff; opacity: .45; transition: var(--dur-2); }
.lb-dot.on { opacity: 1; }
.lb-cap { padding: 11px 16px; font-size: var(--t-xs); }
.dpe-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.dpe-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--r-pill); color: #fff; font-size: var(--t-sm); }
.dpe-badge b { font-size: 16px; font-weight: 800; }
.dpe-badge .lex { color: #fff; }

/* risques */
.risk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.risk-row:first-child { border-top: 0; }
.risk-k { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); }
.risk-k .ic { width: 18px; height: 18px; color: var(--muted); }
.sev { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); }
.sev.low { color: var(--vd-opp); background: color-mix(in srgb, var(--vd-opp) 14%, transparent); }
.sev.mid { color: var(--vd-moy); background: color-mix(in srgb, var(--vd-moy) 16%, transparent); }
.sev.high { color: var(--vd-evi); background: color-mix(in srgb, var(--vd-evi) 14%, transparent); }

/* barre de négociation */
.nego { padding: 22px; }
.nego-scale { position: relative; height: 56px; margin: 26px 0 10px; }
.nego-track { position: absolute; top: 26px; left: 0; right: 0; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--vd-opp), var(--vd-moy), var(--vd-evi)); opacity: .85; }
.nego-pt { position: absolute; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.nego-pt i { width: 3px; height: 30px; background: var(--fg); border-radius: 2px; }
.nego-pt.ghost i { background: var(--muted); height: 22px; margin-top: 4px; }
.nego-lab { position: absolute; font-size: var(--t-2xs); white-space: nowrap; }
.nego-lab .v { font-family: var(--font-mono); font-weight: 700; font-size: var(--t-xs); display: block; }

/* mode notarial : bannière + toggle */
.notarial-banner { display: none; }
.notarial .notarial-banner { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: var(--t-sm); color: var(--accent); }
.notarial .notarial-banner .ic { color: var(--accent); }

.toggle-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface-2); font-size: var(--t-sm); font-weight: 600; color: var(--fg-2); cursor: pointer; transition: var(--dur-2); }
.toggle-pill:hover { border-color: var(--accent-line); }
.toggle-pill[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.toggle-pill .sw { width: 30px; height: 17px; border-radius: 999px; background: var(--surface-3); position: relative; transition: var(--dur-2); }
.toggle-pill .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); transition: var(--dur-2); }
.toggle-pill[aria-pressed="true"] .sw { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.toggle-pill[aria-pressed="true"] .sw::after { left: 15px; background: var(--accent); }

/* lexique : terme avec définition au survol/focus (CSS pur, markup .lex existant) */
.lex { position: relative; border-bottom: 1px dashed var(--line-2); cursor: help; outline: none; }
.lex:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.lex .lex-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: max-content;
  max-width: 260px; padding: 10px 12px; font-size: var(--t-xs); font-weight: 400; line-height: 1.45;
  color: var(--fg-2); background: var(--surface-3); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); box-shadow: var(--sh-2); opacity: 0; visibility: hidden;
  transform: translateY(-3px); transition: opacity var(--dur-2), transform var(--dur-2) var(--ease); pointer-events: none;
}
.lex:hover .lex-pop, .lex:focus .lex-pop, .lex:focus-within .lex-pop { opacity: 1; visibility: visible; transform: translateY(0); }
@media print { .lex { border-bottom: 0; } .lex .lex-pop { display: none !important; } }

/* provenance compacte (symbole + infobulle native) */
.prov { cursor: help; font-size: .82em; text-decoration: none; border: 0; margin-left: .15rem; vertical-align: middle; }

/* barre de positionnement prix vs juste valeur DVF (CSS pur) */
.posbar { position: relative; height: 42px; margin: 22px 0 10px; }
.posbar .track { position: absolute; top: 26px; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--surface-3); }
.posbar .range { position: absolute; top: 23px; height: 12px; border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.posbar .central { position: absolute; top: 19px; width: 2px; height: 20px; background: var(--accent); }
.posbar .marker { position: absolute; top: 0; transform: translateX(-50%); font-size: var(--t-2xs); font-weight: 600; white-space: nowrap; color: var(--fg); }
.posbar .marker .pin { display: block; width: 0; height: 0; margin: 2px auto 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--fg); }
.posbar .marker.over { color: var(--neg); } .posbar .marker.over .pin { border-top-color: var(--neg); }
.posbar .marker.under { color: var(--pos); } .posbar .marker.under .pin { border-top-color: var(--pos); }

/* bouton remonter (toc) */
.toptop {
  position: fixed; right: 16px; bottom: 16px; z-index: 50; width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--fg); cursor: pointer; font-size: 17px; line-height: 1; opacity: 0;
  pointer-events: none; transition: opacity var(--dur-2); box-shadow: var(--sh-2);
}
.toptop.visible { opacity: 1; pointer-events: auto; }
@media print { .toptop { display: none !important; } }

@media print {
  .report { grid-template-columns: 1fr; }
  .chart-box { height: 200px; }
}

/* =============================================================
   AUTH (maquette Connexion.html)
   ============================================================= */
.auth-wrap { flex: 1; display: grid; grid-template-columns: 1fr 1fr; max-width: 1100px; margin: 0 auto; width: 100%; padding: 48px 28px; gap: 56px; align-items: center; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; gap: 32px; } .auth-aside { display: none; } }

.auth-aside .eyebrow { margin-bottom: 16px; }
.auth-aside h1 { font-size: 38px; letter-spacing: -.03em; line-height: 1.05; margin-bottom: 18px; }
.auth-aside h1 em { font-style: normal; color: var(--accent); }
.auth-aside p { color: var(--muted); font-size: var(--t-body); line-height: 1.6; max-width: 42ch; margin-bottom: 26px; }
.auth-points { display: grid; gap: 14px; }
.auth-points div { display: flex; align-items: center; gap: 11px; font-size: var(--t-sm); color: var(--fg-2); }
.auth-points .ic { color: var(--accent); flex: none; }

.auth-card { padding: 30px; max-width: 420px; width: 100%; justify-self: center; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; margin-bottom: 24px; }
.auth-tabs a, .auth-tabs button { flex: 1; padding: 9px; border: none; background: none; border-radius: var(--r-sm); font: inherit; font-weight: 600; font-size: var(--t-sm); color: var(--muted); cursor: pointer; transition: var(--dur-2); text-align: center; }
.auth-tabs .on { background: var(--surface); color: var(--fg); box-shadow: var(--sh-1); }
.auth-form { display: grid; gap: 16px; }
.auth-form .field label { display: flex; align-items: center; justify-content: space-between; }
.auth-form .field label a { font-size: var(--t-xs); color: var(--accent); font-weight: 500; }
.inp-ic { position: relative; }
.inp-ic .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.inp-ic .input { padding-left: 40px; }
.auth-foot { text-align: center; font-size: var(--t-sm); color: var(--muted); margin-top: 18px; }
.auth-foot a { color: var(--accent); font-weight: 600; }
.bonus { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font-size: var(--t-sm); font-weight: 600; }

/* =============================================================
   COMPTE (maquette Compte.html)
   ============================================================= */
.acc-head { padding: 36px 0 26px; }
.acc-head h1 { font-size: 32px; letter-spacing: -.03em; }
.acc-head .who { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: var(--t-body); color: var(--muted); }
.acc-head .who .badge { font-size: var(--t-xs); font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); }

.acc-top { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }
@media (max-width: 820px) { .acc-top { grid-template-columns: 1fr; } }

.credit-card { padding: 26px; position: relative; overflow: hidden; }
.credit-card .balance { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 16px; }
.credit-card .balance .b { font-family: var(--font-mono); font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--accent); }
.credit-card .balance .u { font-size: 16px; color: var(--muted); }
.credit-card .meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.credit-card .meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; }
.credit-card .sub { font-size: var(--t-sm); color: var(--muted); }
.credit-card .cta { margin-top: 20px; }

.moves { padding: 24px 26px; }
.moves h3 { font-size: var(--t-h4); margin-bottom: 6px; }
.amt-pos { color: var(--accent); font-weight: 700; }
.amt-neg { color: var(--neg); font-weight: 700; }

.acc-sub-label { font-size: var(--t-2xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 36px 0 14px; }
.acc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .acc-cols { grid-template-columns: 1fr; } }
.danger-card { border-color: color-mix(in srgb, var(--neg) 35%, var(--line)); }
.danger-card h3 { color: var(--neg); }
.btn-danger { background: transparent; color: var(--neg); border: 1px solid color-mix(in srgb, var(--neg) 45%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--neg) 12%, transparent); }

/* =============================================================
   NOUVEL AUDIT (maquette Nouvel audit.html)
   ============================================================= */
.na-wrap { max-width: 760px; margin: 0 auto; padding: 40px 28px 0; width: 100%; }
.na-head { margin-bottom: 26px; }
.na-head h1 { font-size: 32px; letter-spacing: -.03em; }
.na-head p { color: var(--muted); font-size: var(--t-body); margin-top: 6px; }
.na-card { padding: 28px; }
.na-card .field { margin-bottom: 20px; }
.na-card .field:last-of-type { margin-bottom: 0; }
.input-lg { padding: 15px 16px; font-size: var(--t-body); }
.src-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cost { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.cost .ci { display: flex; align-items: center; gap: 9px; font-size: var(--t-sm); }
.cost .ci .num { font-weight: 700; }
.na-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* =============================================================
   PARAMÈTRES (maquette Parametres.html)
   ============================================================= */
.pa-wrap { max-width: 920px; margin: 0 auto; padding: 36px 28px 0; width: 100%; }
.pa-head h1 { font-size: 32px; letter-spacing: -.03em; }
.pa-head p { color: var(--muted); font-size: var(--t-body); margin-top: 6px; max-width: 60ch; }
.notice { display: flex; gap: 11px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); margin: 22px 0 28px; font-size: var(--t-sm); color: var(--fg-2); line-height: 1.55; }
.notice .ic { color: var(--accent); flex: none; margin-top: 1px; }
.pa-section { margin-bottom: 18px; }
.pa-card { padding: 22px 24px; }
.pa-card .ph { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.pa-card .ph .pic { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.pa-card .ph h3 { font-size: var(--t-h4); }
.pa-card .psub { font-size: var(--t-sm); color: var(--muted); margin: 0 0 8px 44px; }
.pa-rows { margin-top: 8px; }
.pa-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.pa-row .k { color: var(--fg-2); }
.pa-row .v { font-family: var(--font-mono); font-weight: 700; }
.pa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .pa-grid { grid-template-columns: 1fr; } }
.badge-ro { font-size: var(--t-2xs); font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); background: var(--chip-bg); border: 1px solid var(--line); color: var(--muted); margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }

/* =============================================================
   PAGES MARCHÉ (/ou-investir, /marche/{slug})
   ============================================================= */
.rank-card { padding: 22px 24px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--fg); }
.rank-row:first-of-type { border-top: 0; }
.rank-row:hover .rk-name { color: var(--accent); }
.rk-pos { font-family: var(--font-mono); font-weight: 700; font-size: var(--t-xs); color: var(--faint); width: 18px; flex: none; }
.rk-name { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--dur-2); }
.rk-val { margin-left: auto; font-family: var(--font-mono); font-weight: 700; }

.city-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .city-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .city-grid { grid-template-columns: 1fr; } }
.city-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; color: var(--fg); }
.city-card .cc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.city-card h3 { font-size: 17px; letter-spacing: -.01em; }
.city-card .cc-dept { font-size: var(--t-2xs); color: var(--faint); font-family: var(--font-mono); }
.city-card .cc-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: var(--t-xs); }
.city-card .cc-kpis .k { color: var(--muted); }
.city-card .cc-kpis .v { font-family: var(--font-mono); font-weight: 700; font-size: var(--t-sm); }
.city-card .cc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* gros score avec libellé (tension / attractivité) */
.score-big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; }
.score-big .num { font-size: 40px; font-weight: 800; line-height: 1; }
.score-big .den { font-size: 16px; color: var(--muted); font-family: var(--font-mono); }

/* =============================================================
   PAGES GÉNÉRIQUES (tarifs, contact, légal)
   ============================================================= */
.page-wrap { max-width: 880px; margin: 0 auto; padding: 40px 28px 0; width: 100%; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 32px; letter-spacing: -.03em; }
.page-head p { color: var(--muted); font-size: var(--t-body); margin-top: 6px; max-width: 60ch; }
