/* Design A « Clair et net » de la démo solaire (brief 69, D1 ; choisi par Clément le 24/11).
   Maquette : .saas/pending-briefs/maq-A (A-hub.html, A-nouvelle.html). Il complète le style
   commun du noyau : 1. variables, 2. composants, 3. écrans. Les couleurs et la police sont
   celles de la maquette ; elles passent devant les variables du réglage (html:root). */

/* 1. Variables ------------------------------------------------------------ */

@font-face { font-family: "Inter"; font-weight: 400; src: url("/static/tenant/fonts/Inter-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 500; src: url("/static/tenant/fonts/Inter-Medium.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 600; src: url("/static/tenant/fonts/Inter-SemiBold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 700; src: url("/static/tenant/fonts/Inter-Bold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 800; src: url("/static/tenant/fonts/Inter-ExtraBold.woff2") format("woff2"); font-display: swap; }

html:root {
  /* Couleurs de la maquette A. */
  --base: #101828;
  --accent: #3538cd;
  --accent-strong: #2d31a6;
  --accent-soft: #eef2ff;
  --accent-text: #ffffff;
  --box: #f2f4f7;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #101828;
  --muted: #667085;
  --nav: #475467;
  --line: #e6e8ec;
  --line-strong: #d0d5dd;
  --ok: #027a48;
  --ok-soft: #ecfdf3;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  /* Bandeaux d'avertissement et d'information : ceux d'avant. */
  --warn: #8A4F00;
  --warn-soft: #FBEFD9;
  --info: #1F4A73;
  --info-soft: #E5EEF7;
  --focus: #3538cd;
  --tenant-font: "Inter";
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  /* Forme. */
  --radius: 16px;
  --radius-row: 12px;
  --radius-small: 10px;
  --control: 2.75rem;
  --content: 1120px;
  --reading: 46rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  /* Brief 79, P : jetons du design system Radar Solaire (tokens.json) qui manquaient. */
  --radius-pill: 99px;
  --shadow-hover: 0 4px 12px rgba(53, 56, 205, 0.10);
  --font-sans: "Inter", -apple-system, "Helvetica Neue", sans-serif;
}

/* 2. Composants ----------------------------------------------------------- */

html { font-size: 16px; }
body {
  font-family: "Inter", -apple-system, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 1rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { color: var(--text); line-height: 1.25; }
/* Titre de page 30 px, poids 800 ; sous-titre gris 16 px. */
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 20px; }
h1 + .sub, h1 + .lead, h1 + .muted { margin-top: -14px; }
h1 + .steps { margin-top: 0; }
h2 { font-size: 18px; font-weight: 800; margin: 40px 0 14px; }
h3 { font-size: 1.05rem; font-weight: 700; margin: var(--space-5) 0 var(--space-2); }
p { margin: 0 0 var(--space-3); }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-strong); }
.muted { color: var(--muted); }
.lead, .sub { font-size: 16px; color: var(--muted); max-width: var(--reading); margin: 6px 0 var(--space-5); }
.number, .num { font-variant-numeric: tabular-nums; }
.number { font-weight: 700; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* En-tête blanc de 64 px : logo carré dégradé et nom, menu en pilules, identifiant à droite. */
header.top {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 32px;
  padding: 0 40px;
  min-height: 64px;
}
header.top .brand { display: flex; align-items: center; gap: 8px; margin-right: 0; color: var(--text); font-size: 18px; font-weight: 800; text-decoration: none; white-space: nowrap; }
header.top .brand::before { content: ""; width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #f59e0b, #ef4444); flex: none; }
header.top nav { display: flex; flex-wrap: wrap; gap: 6px; }
header.top nav a { padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--nav); text-decoration: none; border: 0; white-space: nowrap; }
header.top nav a:hover { background: var(--box); color: var(--text); }
header.top nav a.current { background: var(--accent-soft); color: var(--accent); border: 0; font-weight: 600; }
/* Brief 84, objectif 4 : la pastille d'un devis ouvert par son client, à côté de « Devis ». */
.menu-badge { display: inline-block; min-width: 1.25rem; margin-left: var(--space-1); padding: 0 var(--space-1); border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-text); font-size: 12px; line-height: 1.25rem; text-align: center; font-weight: 700; }
header.top form, header.top .who { margin: 0 0 0 auto; font-size: 14px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
header.top button.link { color: var(--muted); font-size: 14px; font-weight: 400; min-height: 44px; text-decoration: none; }
header.top button.link:hover { color: var(--text); background: none; text-decoration: underline; }

main { max-width: 1120px; margin: 0 auto; padding: 36px 40px 60px; }
main.narrow { max-width: 30rem; }

/* Boutons : principal plein, texte blanc gras, rayon 10 px, flèche ; secondaire blanc bordé. */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control);
  padding: 0 18px;
  border-radius: var(--radius-small);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  margin-top: var(--space-3);
}
button:hover, .button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
/* La flèche des boutons qui mènent plus loin (maquette : « Commencer → »). */
button[type="submit"]:not(.secondary):not(.danger):not(.quiet):not(.link):not(.small)::after,
a.button:not(.secondary):not(.danger):not(.quiet):not(.small)::after { content: "\2192"; }
button.secondary, .button.secondary { background: #ffffff; color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow); }
button.secondary:hover, .button.secondary:hover { background: var(--box); color: var(--text); border-color: var(--line-strong); }
button.danger, .button.danger { background: var(--bad); border-color: var(--bad); color: #ffffff; }
button.danger:hover, .button.danger:hover { background: #912018; border-color: #912018; }
button.quiet, .button.quiet { background: #ffffff; border-color: var(--line-strong); color: var(--bad); }
button.quiet:hover, .button.quiet:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
button.small, .button.small { min-height: var(--control); padding: 0 14px; margin-top: 0; font-size: 14px; }
button.link { background: none; border: none; color: var(--accent); padding: 0; margin: 0; min-height: 0; font-weight: 600; text-decoration: underline; }
button.link:hover { background: none; color: var(--accent-strong); }
button:disabled, button[aria-disabled="true"], .button[aria-disabled="true"] {
  background: var(--box); border-color: var(--line); color: var(--muted); cursor: not-allowed; box-shadow: none;
}
button:disabled::after { content: none; }
.actions { gap: var(--space-3); }
.actions button, .actions .button { margin-top: 0; }

/* Lien de retour « ← Études », en haut de chaque sous-page. */
a.back, .back-link { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; color: var(--accent); margin: 0 0 18px; text-decoration: none; min-height: 32px; }
a.back:hover, .back-link:hover { text-decoration: underline; }
p.back { margin: var(--space-5) 0 0; font-size: 15px; }
p.back a { font-weight: 600; }

/* Champs de saisie : bordure #d0d5dd, rayon 10 px, 16 px pour que le téléphone ne zoome pas. */
label { font-weight: 700; margin: var(--space-4) 0 8px; color: var(--text); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-small);
  font: inherit;
  font-size: 16px;
  background: #ffffff;
  color: var(--text);
}
input::placeholder { color: #98a2b3; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }
.hint { color: var(--muted); font-size: 14px; margin: var(--space-2) 0 0; }
.field-error { color: var(--bad); font-weight: 600; font-size: 15px; margin: var(--space-2) 0 0; }

/* Case à cocher grande, et sa ligne entière cliquable. */
input[type=checkbox], input[type=radio] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); flex: none; margin: 0; }
label.check, .check-row {
  display: flex; align-items: flex-start; gap: var(--space-3);
  min-height: var(--control); padding: var(--space-3);
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius-small); background: #ffffff; font-weight: 500; cursor: pointer;
}
label.check:hover, .check-row:hover { background: var(--box); }

/* Groupe de cases : un cadre fin aux couleurs des cartes. */
fieldset { border: 1px solid var(--line); border-radius: var(--radius-row); padding: var(--space-2) var(--space-4) var(--space-4); margin: var(--space-4) 0 0; min-width: 0; }
fieldset > legend { font-weight: 700; padding: 0 6px; }

/* Carte : blanche, bordure #e6e8ec, rayon 16 px, ombre légère. */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: var(--space-5);
}
.card > :first-child, .card > link:first-child + * { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.address-search > label { margin-top: 0; }
.box { background: var(--box); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }

/* Bandeau d'état. */
.banner { border-radius: var(--radius-row); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); border: 1px solid var(--line); border-left: 5px solid var(--info); background: var(--info-soft); color: var(--text); }
.banner.info { background: var(--info-soft); border-left-color: var(--info); }
.banner.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.banner.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.banner.ok { background: var(--ok-soft); border-left-color: var(--ok); }

/* Pastilles d'état arrondies : terminée (vert), en cours (indigo), échec (rouge). */
.tag, .pill { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; line-height: 1.4; background: var(--box); color: var(--text); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--accent-soft); color: var(--accent); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

/* Tableau, dans une carte. */
.table-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--radius-row); background-color: #ffffff; box-shadow: var(--shadow); }
th { background: #f9fafb; color: var(--muted); font-size: 13px; font-weight: 600; }
th, td { padding: 12px 16px; border-bottom-color: var(--line); }
td .actions { flex-wrap: nowrap; }
.amount, td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Icône simple (prise, éclair, panneau), posée là où elle aide à comprendre. */
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Frise d'étapes (pv_study/_steps.html) : 4 barres de 6 px, la barre active indigo, les noms dessous. */
.steps { margin: 18px 0 26px; }
.steps-group { display: none; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.steps li { display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.3; min-height: 0; }
.steps li::before { content: ""; display: block; height: 6px; border-radius: 9px; background: var(--line); }
.steps li.done::before, .steps li.current::before { background: var(--accent); }
.steps li.current { color: var(--text); font-weight: 700; }
.steps li .step-mark { display: none; }
.steps li .step-sub { display: none; }
.steps-compact, .steps-bar { display: none; }
.journey-note { border: 1px solid var(--line); border-left: 5px solid var(--ok); background: var(--ok-soft); border-radius: var(--radius-row); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.next-step { color: var(--muted); max-width: var(--reading); }

/* Fenêtre de confirmation : un écran à elle, ce qui part, deux boutons. */
.confirm { max-width: 40rem; border-left: 5px solid var(--bad); }
.confirm h1 { margin-top: 0; }
.confirm ul { padding-left: 1.2rem; margin: var(--space-2) 0 var(--space-4); }
.confirm li { margin: var(--space-1) 0; }
.confirm .actions { margin-top: var(--space-4); }

/* Ce qui ne se fait pas encore : bouton grisé et sa phrase. */
.blocked { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: 15px; }

/* Bloc repliable : le « Voir plus » souligné se voit cliquable. */
details > summary::after { color: var(--accent); font-weight: 600; }

/* 3. Écrans --------------------------------------------------------------- */

ul.plain { list-style: none; padding-left: 0; margin: 0; }
ul.plain.card { padding: var(--space-2) var(--space-5); }
ul.plain li { padding: var(--space-3) 0; }
.flags li { border-bottom: 1px solid var(--line); }
.flags li:last-child { border-bottom: 0; }

/* Page « Études » (maquette A-hub) : deux cartes de mode sans image (brief 76, A2), puis « Mes études » en cartes. */
.hub-title { margin-top: 0; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
a.mode { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
a.mode:hover { border-color: var(--line-strong); color: var(--text); }
.mode .txt { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mode .txt b { font-size: 20px; font-weight: 800; }
.mode .txt > span { color: var(--muted); font-size: 15px; }
.mode .txt .mode-button { margin-top: 14px; align-self: flex-start; background: var(--accent); color: #ffffff; font-weight: 700; padding: 12px 18px; border-radius: var(--radius-small); font-size: 15px; }
a.mode:hover .mode-button { background: var(--accent-strong); }
/* Brief 72b, O7: an example shown to a new account says so; the houses of the account have their title. */
.example-badge { align-self: flex-start; background: #f2f4f7; color: #475467; font-size: 12px; font-weight: 700; line-height: 16px; padding: 2px 8px; border-radius: 999px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); flex-wrap: wrap; margin: 40px 0 14px; }
.list-head h2 { margin: 0; }
.find-study { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0; }
.find-study input[type="search"] { width: 14rem; max-width: 100%; min-height: var(--control); padding: 0.3rem 0.75rem; font-size: 16px; }
.find-study button { margin-top: 0; }

/* Une étude d'une liste : une carte cliquable (adresse et date, état, panneaux, production). */
.study-rows { display: flex; flex-direction: column; gap: 10px; }
a.study-row { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-row); padding: 16px 18px; display: grid; grid-template-columns: 1fr auto auto auto; gap: 24px; align-items: center; color: var(--text); text-decoration: none; }
a.study-row:hover { border-color: var(--line-strong); color: var(--text); }
a.study-row:hover .study-address { color: var(--accent); text-decoration: underline; }
.study-row .study-address { font-weight: 700; display: block; }
.study-row small { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; font-weight: 400; }
.study-row .fig { font-weight: 700; text-align: right; }
.study-row .fig small { font-weight: 400; }
.study-rows .empty { color: var(--muted); }

/* Page « Étudier une maison » (maquette A-nouvelle). */
.start { max-width: none; }
.start .card label { margin-top: 0; }
.start .allowance { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* Les chiffres de l'étude, en grand. */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin: var(--space-4) 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); box-shadow: var(--shadow); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; }
.wide-tile { grid-column: span 2; }
.tile-value { font-size: 1.5rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.tile-label { color: var(--muted); font-size: 14px; }

figure { margin: var(--space-4) 0; }
figure img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-row); background: var(--surface); }
figcaption { color: var(--muted); font-size: 14px; margin-top: var(--space-2); }

.hero { display: grid; grid-template-columns: 3fr 2fr; gap: var(--space-5); align-items: start; margin: var(--space-4) 0; }
.hero-figure { margin: 0; }
.hero-side { display: flex; flex-direction: column; gap: var(--space-3); }
.hero-side p { margin: 0; }
.hero-kicker { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; font-size: 13px; }
.tile-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.tile-value.big { font-size: 1.9rem; }
.notes summary { cursor: pointer; font-weight: 600; min-height: var(--control); display: flex; align-items: center; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin: var(--space-3) 0 var(--space-4); }
.page-actions form { margin: 0; }
.page-actions button, .page-actions .button { margin-top: 0; }

/* Choix des bâtiments, sur l'image et dans la liste. */
.choice { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-5); align-items: start; }
.choice-map svg { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-row); background: #eef2f6; display: block; }
.candidate { cursor: pointer; }
.candidate polygon { fill: var(--accent); fill-opacity: 0.4; stroke: #ffffff; stroke-width: 0.4; }
.candidate:hover polygon, .candidate:focus polygon { fill-opacity: 0.75; }
.candidate text { fill: #ffffff; font-size: 4px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; pointer-events: none; paint-order: stroke; stroke: var(--base); stroke-width: 0.6px; }
.choice-list form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.choice-list li { margin-bottom: var(--space-2); }

/* Les bâtiments d'une maison : comptés (accent), non comptés (gris), numérotés. */
.group-part polygon, .house-building.is-on polygon { fill: var(--accent); fill-opacity: 0.5; stroke: #ffffff; stroke-width: 0.4; }
.group-question polygon { fill: #C98A1A; fill-opacity: 0.5; stroke: #ffffff; stroke-width: 0.4; }
.group-left_out polygon, .house-building polygon { fill: #7C8794; fill-opacity: 0.45; stroke: #ffffff; stroke-width: 0.4; }
.group-part text, .group-question text, .group-left_out text { fill: #ffffff; font-size: 4px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; pointer-events: none; paint-order: stroke; stroke: var(--base); stroke-width: 0.6px; }

/* Une figure en deux vues : côte à côte, l'une sous l'autre quand la largeur manque. */
.pair { display: flex; flex-wrap: wrap; gap: var(--space-4); margin: var(--space-4) 0 var(--space-2); }
.pair figure { flex: 1 1 20rem; min-width: 0; margin: 0; }
.pair img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: var(--radius-row); }
@media print { .pair figure { flex-basis: 100%; break-inside: avoid; } }

/* L'écran des réglages : des cartes numérotées ① ② ③ ④. */
.setup-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin: 0 0 20px; }
.setup-step > h2 { margin: 0 0 var(--space-3); font-size: 18px; }
.setup-step > h2:last-child { margin-bottom: 0; }
.setup-number { background: var(--accent); width: 1.75rem; height: 1.75rem; font-size: 14px; font-weight: 700; }
.setup-hint { font-weight: 600; }
.parameter-block { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-row); margin: var(--space-4) 0; padding: var(--space-3) var(--space-5) var(--space-5); }
.parameter-block legend { font-weight: 700; color: var(--text); font-size: 1.05rem; padding: 0 var(--space-2); }
.parameter { margin: var(--space-4) 0; max-width: var(--reading); }
.parameter label { display: block; margin-bottom: var(--space-1); }
.parameter input[type="text"] { max-width: 20rem; }
.parameter select { max-width: 100%; }
.parameter p { margin: var(--space-1) 0; }
.parameter-error input, .parameter-error select { border-color: var(--bad); }
.box > h2:first-child, .box > h3:first-child { margin-top: 0; }
.parameters-summary { margin: var(--space-4) 0; }
.parameters-summary ul { margin: 0; columns: 2 22rem; column-gap: var(--space-6); }
.parameters-summary ul.plain li { padding: var(--space-1) 0; break-inside: avoid; }
.setting-field { border-radius: var(--radius-small); border-color: var(--line-strong); }

.totals td { text-align: right; }
.totals .grand td { font-weight: 700; border-top: 2px solid var(--text); }
input.narrow { max-width: 7rem; padding-left: 0.6rem; padding-right: 0.6rem; }

/* Recherche de zone : rangs et carte aux couleurs du design. */
main .house-rank span, main .zone-dot span { background: var(--accent); border-radius: 6px; }
main .zone-map { border-radius: var(--radius-row); }
@media (max-width: 720px) {
  main .house-table tr.house-card { border-color: var(--line); border-radius: var(--radius-row); box-shadow: var(--shadow); }
}

/* Étude déjà équipée de panneaux (brief 71, P1) : bandeau, date de la photo, case. */
.equipped-notice { background: #fffaeb; border: 1px solid #fec84b; border-radius: var(--radius); box-shadow: var(--shadow); color: #101828; padding: 16px 20px; margin: 0 0 var(--space-5); }
.equipped-notice > :first-child { margin-top: 0; }
.equipped-notice > :last-child { margin-bottom: 0; }
.equipped-notice h2, .equipped-notice h3, .equipped-notice strong { color: #101828; }
.equipped-notice h2, .equipped-notice h3 { font-size: 16px; margin: 0 0 4px; }
.photo-date { color: #667085; font-size: 14px; margin: var(--space-2) 0; }
.equipped-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
/* Brief 76, A3: the question and its button, then « Refaire le calcul », each its own form. */
.equipped-toggle form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0; }
.equipped-toggle p { margin: 0; font-weight: 500; }
.equipped-toggle button { margin-top: 0; }

/* Téléphone : tout se fait au pouce sur 390 px ; le menu passe sur sa propre ligne. */
@media (max-width: 700px) {
  header.top { flex-wrap: wrap; gap: 0 14px; padding: 12px 16px; min-height: 0; }
  header.top nav { order: 3; width: 100%; padding: 6px 0 0; }
  /* Brief 79 : quatre entrées (« Prospects » en plus) tiennent sur une ligne à 390 px (règle 32). */
  header.top nav a { padding: 8px 10px; }
  header.top .who-name { display: none; }
  main { padding: 22px 16px 40px; }
  h1 { font-size: 24px; }
  h2 { margin-top: var(--space-6); }
  .card, .setup-step { padding: var(--space-4); }
  .parameter-block { padding: var(--space-2) var(--space-3) var(--space-4); }
  .modes { grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 14px; }
  a.study-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
  a.study-row > div:first-child { flex: 1 1 100%; }
  .study-row .fig { text-align: left; }
  .find-study { width: 100%; }
  .find-study input[type="search"] { flex: 1; width: auto; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .wide-tile { grid-column: span 2; }
  .tile-value { font-size: 1.25rem; }
  .tile-value.big { font-size: 1.45rem; }
  .hero { grid-template-columns: 1fr; }
  .choice { grid-template-columns: 1fr; }
  .page-actions > *, .confirm .actions > * { flex: 1 1 100%; }
  .page-actions button, .page-actions .button, .confirm .actions button, .confirm .actions .button { width: 100%; }
}

/* Brief 29: the action of a finished study stays at the bottom of the screen, on a computer
   and on a phone, and hides nothing (the page keeps room under its last line). */
.sticky-action { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom)); background: #ffffff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.08); }
.sticky-action p { margin: 0; }
.sticky-action form { margin: 0; }
.sticky-action button { margin-top: 0; }
main:has(.sticky-action) { padding-bottom: 6rem; }
@media (max-width: 700px) { .sticky-action { justify-content: space-between; } .sticky-action form { flex: 0 0 auto; } }

/* Brief 29: a title and its one main action on the same line. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 0.5rem; }

/* Rapport d'une étude : chaque bloc repliable est une carte du design A. */
details.fold { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
details.fold[open] > summary { border-bottom-color: var(--line); }
details.fold > summary { padding: 0.4rem 24px; }
details.fold > summary h2 { font-size: 18px; font-weight: 800; }
.fold-body { padding: 0.75rem 24px 24px; }
.fold-count { background: var(--box); }
@media (max-width: 700px) {
  details.fold > summary { padding: 0.4rem var(--space-4); }
  .fold-body { padding: 0.5rem var(--space-4) var(--space-4); }
}

/* 4. Suivi des prospects ---------------------------------------------------- */
/* Brief 79, P : les classes du design system Radar Solaire (docs/design-system/radar-solaire/components/bundle.css),
   noms inchangés, pour l'écran « Prospects » (piste A2), sa fiche latérale et la page « votre toit ». */

.tile-sub { color: var(--muted); font-size: 13px; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }

/* Score « chances de signer ». */
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score.high { background: var(--ok-soft); color: var(--ok); }
.score.mid { background: var(--warn-soft); color: var(--warn); }
.score.low { background: var(--box); color: var(--muted); }

/* Carte prospect. */
.prospect-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); box-shadow: var(--shadow); padding: var(--space-3); display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; }
.prospect-card:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.prospect-card[aria-current="true"] { border: 2px solid var(--accent); }
.prospect-card .thumb { height: 84px; border-radius: var(--radius-small); object-fit: cover; width: 100%; background: var(--box); }
.prospect-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.prospect-card .addr { font-size: 14px; font-weight: 700; margin: 0; }
.prospect-card .meta { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.prospect-card .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prospect-card .next { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--box); font-size: 13px; color: var(--muted); }
.prospect-card .next .due { color: var(--bad); font-weight: 600; }
.prospect-card .next a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* Colonnes du suivi. */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(236px, 1fr); gap: var(--space-3); overflow-x: auto; align-items: start; padding-bottom: 6px; }
.kanban-col { background: var(--box); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kanban-col > h2 { display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 0; font-size: 13px; font-weight: 700; }
.kanban-col .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface); color: var(--nav); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.kanban-col.folded { padding: var(--space-3); flex-direction: row; justify-content: space-between; font-size: 13px; font-weight: 700; }
.kanban-col.folded.signed { background: var(--ok-soft); color: var(--ok); }
.kanban-col.folded.installed { background: var(--accent-soft); color: var(--accent); }

/* Fiche latérale. */
.drawer { background: var(--surface); border-left: 1px solid var(--line); width: min(420px, 100%); display: flex; flex-direction: column; }
.drawer .tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }
.drawer .tabs a { padding: 10px 2px; font-size: 14px; color: var(--nav); text-decoration: none; border-bottom: 2px solid transparent; }
.drawer .tabs a[aria-current="page"] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.meter { height: 8px; border-radius: var(--radius-pill); background: var(--box); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); }

@media (max-width: 700px) {
  .kanban { grid-auto-flow: row; grid-auto-columns: auto; }
  .drawer { position: fixed; inset: auto 0 0 0; width: 100%; max-height: 88vh; border-left: 0; border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.12); overflow-y: auto; }
}

/* Mise en place de l'écran « Prospects » : le fil, la barre de recherche, les cartes-liens, les colonnes repliées
   l'une sous l'autre à droite, la fiche posée sur la page (à droite sur ordinateur, en bas sur téléphone). */
.crumbs { color: var(--muted); font-size: 14px; margin: 0 0 var(--space-2); }
/* Sur ordinateur, le tableau prend toute la largeur : les cinq colonnes ouvertes et la pile des colonnes repliées
   tiennent dans l'écran, sans défilement de côté (règle 1). */
main:has(> .prospects) { max-width: none; }
@media (min-width: 701px) {
  .kanban { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(8.5rem, 0.6fr); overflow-x: visible; }
  /* Une colonne repliée qu'on ouvre prend la largeur des autres. */
  .kanban:has(.folded-cards:not([hidden])) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.prospect-card .head { flex-wrap: wrap; }
.prospect-card .head > span:first-child { flex: 1 1 8rem; }
.prospect-card .head > .score { flex: none; }
.prospects .page-head .button { margin-top: 0; }
.prospect-tiles { margin: var(--space-4) 0 var(--space-5); }
.prospect-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0 0 var(--space-4); }
.prospect-bar input[type="search"] { width: 18rem; max-width: 100%; min-height: var(--control); padding: 0.3rem 0.75rem; }
.prospect-bar button, .prospect-bar .button { margin-top: 0; }
.prospect-bar .button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
a.prospect-card { color: var(--text); text-decoration: none; }
a.prospect-card:hover { color: var(--text); }
.prospect-card .addr, .prospect-card .meta { display: block; }
.prospect-card .head > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.prospect-card.dragging { opacity: 0.5; }
.kanban-col.drop-here { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kanban-col .more { margin-top: 0; }
.kanban-folded { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.kanban-col.folded { flex-direction: column; }
.kanban-col.folded > h2 { margin: 0; }
.kanban-col.folded .fold-toggle { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: var(--control); cursor: pointer; font-size: 13px; font-weight: 700; }
.kanban-col.folded .fold-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.folded-cards { display: flex; flex-direction: column; gap: 10px; }
.folded-cards[hidden] { display: none; }
.prospects-empty p { margin: 0; }
.drawer-shade { position: fixed; inset: 0; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; overflow-y: auto; padding: 18px 22px; gap: 14px; box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.12); }
.drawer:focus { outline: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.drawer-close { display: inline-flex; align-items: center; justify-content: center; min-width: var(--control); min-height: var(--control); font-size: 24px; color: var(--nav); text-decoration: none; }
.drawer-title h2 { margin: 0; font-size: 20px; font-weight: 800; }
.drawer-title .meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.drawer .tabs a { min-height: var(--control); display: inline-flex; align-items: center; }
.drawer-pane { display: flex; flex-direction: column; gap: 14px; }
.drawer-pane[hidden] { display: none; }
.drawer-photo { width: 100%; border-radius: var(--radius-small); background: var(--box); }
.drawer-figures { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 0.8fr); gap: var(--space-2); }
.drawer-figures .tile { padding: var(--space-2) var(--space-3); }
.drawer-figures .tile-value { font-size: 15px; }
.drawer-score { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.drawer-reason { font-size: 13px; }
.drawer-reason-label { display: flex; justify-content: space-between; gap: var(--space-2); margin-bottom: 4px; }
.drawer-reason-label small { color: var(--muted); font-size: 12px; }
.drawer-note label, .drawer-reminder label { margin-top: 0; display: block; }
.drawer-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.drawer-actions form { margin: 0; }
.drawer-actions button, .drawer-actions .button { margin-top: 0; width: 100%; }
.drawer-more { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.drawer-more > * { flex: 1 1 10rem; }
.move-menu > summary { list-style: none; width: 100%; justify-content: center; }
.move-menu > summary::-webkit-details-marker { display: none; }
.move-menu > summary::before, .move-menu > summary::after { content: none; }
.move-menu form { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.drawer-history li { padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.drawer-history small { color: var(--muted); display: block; font-size: 13px; }
.drawer-contact { margin: 0; display: grid; gap: var(--space-2); }
.drawer-contact dt { color: var(--muted); font-size: 13px; }
.drawer-contact dd { margin: 0; font-weight: 600; }
.drawer-consents li { padding: var(--space-1) 0; }
@media (max-width: 700px) {
  .prospect-tiles { grid-template-columns: 1fr 1fr; }
  .prospect-bar input[type="search"] { flex: 1; width: auto; }
  .prospects .page-head .button { width: 100%; }
  .kanban { overflow-x: visible; }
  .drawer { top: auto; max-height: 88vh; padding: 16px; border-radius: var(--radius) var(--radius) 0 0; }
}

/* Page « votre toit » : le bloc « Vous voulez en parler ? », téléphone d'abord. */
.owner-page { max-width: var(--reading); margin: 0 auto; padding: var(--space-5) var(--space-4); }
.owner-answer { margin-top: var(--space-5); }
.owner-answer, .owner-answer * { box-sizing: border-box; }
.owner-answer h2 { margin: 0 0 var(--space-2); font-size: 18px; font-weight: 800; }
.owner-answer label:not(.check) { display: block; }
.owner-consents { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); }
.owner-answer button[type="submit"] { width: 100%; }
.owner-thanks { margin: 0; font-weight: 600; }
