/* solaire-studio-re.css — Studio solaire, phase 2 (6 nov. 2026) : étapes « Analyser la maison » et « Design », palette de modules
   et glisser-déposer, marges par type d'arête, adresse et bâtiment retenus, tableau des pans v2. Règles .re-studio-* seulement,
   chargées après styles-re.css (fichier à part : styles-re.css est modifié en parallèle par un autre chantier). */

/* Étapes dans le bandeau */
.re-studio-etapes { display: flex; align-items: center; gap: 4px; background: var(--r26-bg, #f3f5f9); border: 1px solid var(--r26-line, #e2e8f0); border-radius: 12px; padding: 3px; flex: none; }
.re-studio-etapes button { font: inherit; font-size: 12px; font-weight: 700; border: 0; background: transparent; color: var(--r26-ink-2, #475569); padding: 6px 10px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.re-studio-etapes button i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: #cbd5e1; color: #0f172a; display: grid; place-items: center; font-size: 10.5px; }
.re-studio-etapes button.on { background: #0b1b2b; color: #fff; } .re-studio-etapes button.on i { background: #f59e0b; color: #1f1300; }
.re-studio-etapes button:disabled { opacity: .45; cursor: not-allowed; } .re-studio-etapes .sep { color: var(--r26-ink-3, #94a3b8); font-weight: 700; }
.re-studio-kpis > div.alerte b { color: #b45309; }

/* Scène : point retenu, choix du toit, glisser-déposer */
.re-studio-2d { touch-action: none; }
.re-studio-canvas.choix-toit { cursor: crosshair; }
.re-studio-point { position: absolute; z-index: 4; width: 0; height: 0; pointer-events: none; }
.re-studio-point i { position: absolute; left: -9px; top: -24px; width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #ef4444; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.re-studio-point.hors i { background: #f59e0b; }
.re-studio-choix { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); z-index: 8; background: rgba(15,23,42,.93); color: #fff; border: 1px solid #facc15; border-radius: 14px; padding: 10px 14px; display: grid; gap: 4px; text-align: center; max-width: min(560px, calc(100% - 40px)); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.re-studio-choix b { color: #fde68a; font-size: 13px; } .re-studio-choix span { font-size: 12px; opacity: .9; }
.re-studio-choix button { justify-self: center; margin-top: 4px; font: inherit; font-size: 11.5px; font-weight: 700; background: transparent; color: #e2e8f0; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.re-studio-ov .face.hors { fill: rgba(148,163,184,.12); }
.re-studio-ov .face.alerte { fill: rgba(245,158,11,.16); }
.re-studio-ov .face.cible-ok { fill: rgba(34,197,94,.16); } .re-studio-ov .face.cible-ko { fill: rgba(239,68,68,.12); }
.re-studio-dnd-label { position: absolute; z-index: 7; pointer-events: none; background: rgba(15,23,42,.93); color: #fff; border-radius: 10px; padding: 7px 10px; font-size: 12px; display: grid; gap: 2px; max-width: 300px; border-left: 4px solid #22c55e; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.re-studio-dnd-label.ko { border-left-color: #ef4444; } .re-studio-dnd-label span { opacity: .85; font-size: 11.5px; }
.re-studio-dnd-actif, .re-studio-dnd-actif * { cursor: grabbing !important; user-select: none; }
.re-studio-fantome { position: fixed; z-index: 1100; pointer-events: none; transform: translate(-50%, -50%); transition: opacity .12s; }
.re-studio-fantome .img { width: 34px; height: 58px; border-radius: 4px; background: linear-gradient(135deg, #0b2140, #1e3a68); border: 1.5px solid #e2e8f0; box-shadow: 0 8px 20px rgba(0,0,0,.4); position: relative; overflow: hidden; }
.re-studio-fantome .img:after { content: ""; position: absolute; inset: 3px; background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(255,255,255,.2) 7px 8px), repeating-linear-gradient(0deg, transparent 0 7px, rgba(255,255,255,.2) 7px 8px); }
.re-studio-fantome.cache { opacity: 0; }
.re-studio-fantome.retour { transition: left .3s ease-in, top .3s ease-in, opacity .3s ease-in; opacity: .2; }
.re-studio-toast.err { background: #991b1b; }
.re-studio-legende i.m { border-color: rgba(255,255,255,.7); border-style: dashed; border-width: 1px; }

/* Panneau droit : adresse et bâtiment retenus */
.re-studio-adr .ligne { display: grid; grid-template-columns: 78px 1fr; gap: 8px; font-size: 12px; padding: 3px 0; align-items: baseline; }
.re-studio-adr .ligne span { color: var(--r26-ink-3, #94a3b8); font-size: 11px; } .re-studio-adr .ligne b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re-studio-adr .ligne b.ok { color: #047857; } .re-studio-adr .ligne b.warn { color: #b45309; }
.re-studio-adr .note { font-size: 11.5px; color: var(--r26-ink-2, #475569); margin: 4px 0; } .re-studio-adr .note.warn { color: #b45309; }
.re-studio-adr .re-studio-lien { margin-top: 6px; }

/* Tableau des pans v2 */
.re-studio-pans-v2 { padding-left: 10px !important; padding-right: 10px !important; }
.re-studio-cmp { letter-spacing: 0; text-transform: none; font-weight: 700; color: var(--r26-ink-2, #475569); font-size: 10.5px; background: var(--r26-bg, #f3f5f9); border-radius: 6px; padding: 2px 6px; }
.re-studio-vide { display: grid; gap: 6px; font-size: 12px; color: var(--r26-ink-2, #475569); background: var(--r26-bg, #f3f5f9); border: 1px dashed var(--r26-line, #e2e8f0); border-radius: 12px; padding: 12px; }
.re-studio-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.re-studio-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--r26-ink-3, #94a3b8); font-weight: 700; padding: 3px 4px; border-bottom: 1px solid var(--r26-line, #e2e8f0); }
.re-studio-table td { padding: 5px 4px; border-bottom: 1px solid var(--r26-line, #eef2f7); vertical-align: top; white-space: nowrap; }
.re-studio-table td:first-child { white-space: normal; } .re-studio-table td small { display: block; color: var(--r26-ink-3, #94a3b8); font-size: 10px; }
.re-studio-table tr { cursor: pointer; } .re-studio-table tr.hov td, .re-studio-table tr:hover td { background: #f1f5f9; } .re-studio-table tr.sel td { background: #e0f2fe; }
.re-studio-table .num { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #f59e0b; color: #1f1300; font-size: 10px; font-weight: 800; margin-right: 5px; vertical-align: -3px; }
.re-studio-table b.barre { text-decoration: line-through; color: #b91c1c; }
.re-studio-badge { display: inline-block; margin-left: 5px; font-size: 9.5px; font-weight: 800; border-radius: 6px; padding: 1px 5px; vertical-align: 1px; white-space: nowrap; }
.re-studio-badge.orange { background: #ffedd5; color: #9a3412; } .re-studio-badge.rouge { background: #fee2e2; color: #991b1b; } .re-studio-badge.gris { background: #f1f5f9; color: #475569; } .re-studio-badge.bleu { background: #e0f2fe; color: #075985; }
.re-studio-mois12 { display: block; margin-top: 3px; } .re-studio-mois12 rect { fill: #f59e0b; opacity: .8; }
.re-studio-note { font-size: 10.5px; color: var(--r26-ink-3, #94a3b8); margin-top: 8px; line-height: 1.35; }
.re-studio-avert { font-size: 11px; color: var(--r26-ink-2, #475569); margin-top: 8px; } .re-studio-avert summary { cursor: pointer; font-weight: 700; } .re-studio-avert div { margin: 3px 0 0 10px; }
.re-studio-side .actions { display: flex; gap: 8px; } .re-studio-side .actions .re-btn { flex: 1; }

/* Palette de modules */
.re-studio-module { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--r26-line, #e2e8f0); border-radius: 12px; background: var(--r26-bg, #f3f5f9); margin-bottom: 6px; touch-action: none; user-select: none; }
.re-studio-module.actif { cursor: grab; border-color: #93c5fd; background: #eff6ff; box-shadow: 0 2px 8px rgba(29,78,216,.12); } .re-studio-module.actif:active { cursor: grabbing; }
.re-studio-module .img { width: 30px; height: 50px; border-radius: 3px; background: linear-gradient(135deg, #0b2140, #1e3a68); border: 1px solid #94a3b8; position: relative; overflow: hidden; }
.re-studio-module .img:after { content: ""; position: absolute; inset: 2px; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(255,255,255,.18) 6px 7px), repeating-linear-gradient(0deg, transparent 0 6px, rgba(255,255,255,.18) 6px 7px); }
.re-studio-module .txt b { font-size: 12.5px; display: block; } .re-studio-module .txt span { font-size: 10.5px; color: var(--r26-ink-3, #94a3b8); display: block; margin-top: 2px; }
.re-studio-module .poignee { font-size: 18px; color: #1d4ed8; line-height: 1; }
.re-studio-astuce { font-size: 10.5px; color: var(--r26-ink-3, #94a3b8); align-self: end; line-height: 1.3; }

/* Marges */
.re-studio-marges .grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.re-studio-marges .pan .grille { grid-template-columns: repeat(3, 1fr); margin-top: 6px; }
.re-studio-marges label { display: grid; gap: 3px; font-size: 10.5px; color: var(--r26-ink-2, #475569); font-weight: 600; }
.re-studio-marges input[type=number] { font: inherit; font-size: 12.5px; font-weight: 700; width: 100%; box-sizing: border-box; border: 1px solid var(--r26-line, #e2e8f0); border-radius: 8px; padding: 6px 7px; background: var(--r26-card, #fff); color: inherit; }
.re-studio-marges .propre { display: flex; align-items: center; gap: 6px; grid-template-columns: none; margin-top: 8px; font-size: 11.5px; }

/* Production mensuelle */
.re-studio-prod div.alerte b { color: #b45309; }
.re-studio-prod-mois { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; align-items: end; height: 54px; margin-top: 8px; }
.re-studio-prod-mois div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 2px; }
.re-studio-prod-mois i { display: block; width: 100%; background: linear-gradient(180deg, #fbbf24, #f59e0b); border-radius: 3px 3px 0 0; min-height: 2px; }
.re-studio-prod-mois span { font-size: 9px; color: var(--r26-ink-3, #94a3b8); }

/* Tablette : panneau droit plus étroit */
@media (max-width: 1100px) { .re-studio-etapes button { padding: 6px 7px; } .re-studio-marges .grille { grid-template-columns: repeat(2, 1fr); } }

/* Bandeau compact : étape 1 sans indicateurs de pose ; le reste se resserre sous 1 700 px */
.re-studio.etape-maison .re-studio-kpis, .re-studio.etape-maison .re-studio-conso { display: none; }
@media (max-width: 1700px) { .re-studio-brand span { display: none; } .re-studio-adresse { width: 160px; } .re-studio-kpis > div { min-width: 74px; padding: 6px 9px; } .re-studio-conso label { display: none; } }
@media (max-width: 1450px) { .re-studio-brand > div:last-child { display: none; } .re-studio-brand { padding-right: 8px; } .re-studio-kpis > div.sun { display: none; } .re-studio-etapes button { font-size: 11.5px; } }
:root[data-theme="dark"] .re-studio-module, :root[data-theme="dark"] .re-studio-etapes, :root[data-theme="dark"] .re-studio-vide { background: #132238; border-color: #1e2d44; }
:root[data-theme="dark"] .re-studio-module.actif { background: #16304f; border-color: #1d4ed8; }
:root[data-theme="dark"] .re-studio-table tr.hov td, :root[data-theme="dark"] .re-studio-table tr:hover td { background: #16253a; } :root[data-theme="dark"] .re-studio-table tr.sel td { background: #12324f; }
