:root {
  --bg: #f3f4f1; --panel: #ffffff; --ink: #1d2422; --muted: #66706c; --line: #dfe3df;
  --nav: #18201e; --nav-ink: #c9d2ce; --accent: #d9531e; --accent-2: #1f6f8b; --ok: #2f7d4f; --warn: #b7791f;
  --bad: #b42318; --chip: #eef1ee; --radius: 10px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); }
button, select, input { font: inherit; }
button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
button:hover { border-color: #b9c1bc; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
button.primary:disabled { opacity: .5; cursor: wait; }
button.ghost, .btnlike.ghost { background: transparent; }
button.danger { color: var(--bad); }
.btnlike { display: inline-block; border: 1px solid var(--line); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
input, select { border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; background: #fff; color: var(--ink); }
input[type=number] { width: 7em; }
.top { height: 52px; display: flex; align-items: center; gap: 18px; padding: 0 16px; background: var(--nav); color: #fff; }
.brand { font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.brand small { font-weight: 400; color: var(--nav-ink); margin-left: 8px; }
.logo { color: var(--accent); }
.project-name { flex: 1; padding: 4px 8px; border-radius: 6px; color: #fff; outline: none; min-width: 120px; }
.project-name:focus { background: #26302d; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.top-actions button, .top-actions .btnlike { color: #fff; border-color: #3a4542; }
.top-actions select { background: #26302d; color: #fff; border-color: #3a4542; }
.engine { font-size: 12px; padding: 3px 8px; border-radius: 12px; background: #26302d; color: var(--nav-ink); white-space: nowrap; }
.engine.ok { background: #1f4d33; color: #b8f0cc; }
.engine.ko { background: #5a1d17; color: #ffd0c9; }
.layout { display: flex; height: calc(100vh - 52px); }
.steps { width: 210px; background: var(--nav); padding: 10px 8px; display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.steps button { text-align: left; background: transparent; color: var(--nav-ink); border: none; padding: 9px 10px; border-radius: 7px; display: flex; gap: 10px; align-items: center; }
.steps button b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #26302d; font-size: 12px; }
.steps button.active { background: #26302d; color: #fff; }
.steps button.active b { background: var(--accent); color: #fff; }
main { flex: 1; overflow: auto; position: relative; }
.view { display: none; padding: 16px; min-height: 100%; }
.view.active { display: block; }
#view-map { padding: 0; height: 100%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card-h { font-weight: 650; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-h.small { font-size: 13px; margin: 8px 0; }
.card-h .sub, .sub { font-weight: 400; color: var(--muted); font-size: 12px; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; } .wrap { flex-wrap: wrap; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.note { color: var(--muted); font-size: 12px; margin: 6px 0; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0; }
.empty { padding: 60px; text-align: center; color: var(--muted); }

/* Carte */
.map-wrap { position: relative; height: 100%; }
#map { position: absolute; inset: 0; }
.map-panel { position: absolute; top: 12px; left: 12px; width: 330px; max-height: calc(100% - 24px); overflow: auto; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.search { display: flex; gap: 6px; } .search input { flex: 1; }
.geo-results div { padding: 5px 6px; cursor: pointer; border-radius: 5px; font-size: 13px; }
.geo-results div:hover { background: var(--chip); }
.layers { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; }
.layers .lbl { font-weight: 600; margin-top: 6px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .4px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.binfo { font-size: 12.5px; margin: 8px 0; }
.binfo table { width: 100%; border-collapse: collapse; }
.binfo td { padding: 2px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.binfo td:first-child { color: var(--muted); width: 45%; }

/* Modèle */
.model-grid { display: grid; grid-template-columns: 390px 1fr 1fr; gap: 12px; height: calc(100vh - 84px); }
.model-grid .card { overflow: auto; }
.block-list { display: grid; gap: 4px; margin-bottom: 8px; }
.block-list div { padding: 6px 8px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; display: flex; justify-content: space-between; }
.block-list div.sel { border-color: var(--accent); background: #fff5f0; }
.block-list div .k { font-size: 11px; color: var(--muted); }
#plan { width: 100%; height: 55%; min-height: 320px; background: #fbfcfa; border: 1px solid var(--line); border-radius: 8px; touch-action: none; }
#three { width: 100%; height: 60%; min-height: 320px; border-radius: 8px; overflow: hidden; background: #e9ecea; }
.geo-summary { font-size: 12.5px; margin-top: 8px; }
.legend3d { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; margin-top: 6px; }
.legend3d i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin-left: auto; }
.seg button { border: none; border-radius: 0; padding: 4px 10px; font-size: 12.5px; }
.seg button.on { background: var(--ink); color: #fff; }

/* Formulaires */
.form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 56%); gap: 6px 10px; align-items: center; font-size: 13px; }
.form .full { grid-column: 1 / -1; }
.f-label { display: flex; align-items: center; gap: 6px; }
.f-ctrl { display: flex; align-items: center; gap: 6px; justify-content: flex-end; min-width: 0; }
.f-ctrl input:not([type=checkbox]), .f-ctrl select { width: 100%; min-width: 0; }
.f-label { flex-wrap: wrap; }
.unit { color: var(--muted); font-size: 12px; min-width: 2.5em; }
.badge { font-size: 10.5px; padding: 1px 6px; border-radius: 9px; cursor: pointer; white-space: nowrap; user-select: none; border: 1px solid transparent; }
.badge.input { background: #e6f0fa; color: #1f4e79; }
.badge.measured { background: #e3f4e8; color: #1e6b3b; }
.badge.database { background: #f1ebfa; color: #5b3a8c; }
.badge.default { background: #fff4dd; color: #8a5a00; border-color: #f0d9a8; }
.section-t { font-weight: 650; font-size: 13px; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }

/* Paramètres */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border-radius: 18px; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.param-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.layer-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.layer-table td, .layer-table th { padding: 3px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.layer-table input[type=number] { width: 5.5em; }
.layer-table select { max-width: 190px; }
.ru { font-family: var(--mono); font-size: 12px; background: var(--chip); padding: 6px 8px; border-radius: 6px; margin-top: 6px; }
.sched { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 1px; font-size: 10px; user-select: none; }
.sched div { height: 16px; display: grid; place-items: center; }
.sched .c { background: #e9ecea; cursor: pointer; }
.sched .c.on { background: var(--accent-2); }

/* Météo */
.weather-grid { display: grid; grid-template-columns: 360px 1fr; gap: 12px; }
.grow { min-width: 0; }
.wlist div { padding: 7px 8px; border-radius: 6px; cursor: pointer; border: 1px solid var(--line); margin-bottom: 5px; font-size: 13px; }
.wlist div.sel { border-color: var(--accent); background: #fff5f0; }
.wlist small { color: var(--muted); display: block; }

/* KPI */
.kpis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; min-width: 130px; }
.kpi .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 11.5px; color: var(--muted); }
.kpis.big .kpi .v { font-size: 24px; }
.plot { width: 100%; height: 320px; }
.plot.tall { height: 380px; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span2 { grid-column: span 2; }
.table-wrap { overflow: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { background: #f7f8f6; position: sticky; top: 0; }
.good { color: var(--ok); font-weight: 600; } .badv { color: var(--bad); font-weight: 600; } .warnv { color: var(--warn); font-weight: 600; }

/* Simulation */
.checklist { display: grid; gap: 4px; margin-bottom: 12px; font-size: 13px; }
.checklist div::before { content: "•"; margin-right: 6px; }
.checklist .ok::before { content: "✔"; color: var(--ok); }
.checklist .ko::before { content: "✖"; color: var(--bad); }
.checklist .wa::before { content: "!"; color: var(--warn); font-weight: 700; }
.progress { height: 6px; background: var(--chip); border-radius: 3px; margin: 12px 0; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.status { font-size: 13px; color: var(--muted); }
.msg { font-family: var(--mono); font-size: 11.5px; padding: 3px 6px; border-left: 3px solid var(--line); margin: 2px 0; white-space: pre-wrap; }
.msg.severe, .msg.fatal { border-color: var(--bad); background: #fff3f1; }
.msg.warning { border-color: var(--warn); }

/* Optim */
.opt-grid { display: grid; grid-template-columns: 420px 1fr; gap: 12px; }
.var-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px 30px; gap: 6px; align-items: center; margin: 4px 0; font-size: 12.5px; }
.var-row input { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { background: var(--chip); padding: 3px 8px; border-radius: 14px; font-size: 12.5px; cursor: pointer; }

/* Hypothèses */
.hyp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hyp-list li { margin: 4px 0; font-size: 13px; }
#toast { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 6px; z-index: 99; }
#toast div { background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13px; max-width: 460px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
#toast div.err { background: var(--bad); }
@media (max-width: 1200px) { .model-grid { grid-template-columns: 1fr; height: auto; } .res-grid, .hyp-grid, .opt-grid, .weather-grid { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

table.data.text td, table.data.text th { text-align: left; white-space: normal; }
.opt-grid > *, .res-grid > *, .weather-grid > *, .model-grid > * { min-width: 0; }
.var-row select, .var-row input { min-width: 0; width: 100%; }

button.icon { font-size: 16px; padding: 4px 10px; line-height: 1; }
button:disabled { opacity: .4; cursor: default; }
button.small { padding: 3px 8px; font-size: 12px; }
.report { background: #f3f8f4; border: 1px solid #cfe3d5; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 12.5px; }
.report ul { margin: 6px 0 0 16px; padding: 0; } .report li { margin: 3px 0; }
dialog#keysDlg { border: none; border-radius: 12px; padding: 0; width: min(720px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog#keysDlg::backdrop { background: rgba(20,25,23,.45); }
.dlg-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 4px 16px 16px; max-height: 75vh; overflow: auto; }
table.keys { width: 100%; border-collapse: collapse; font-size: 13px; } table.keys td { padding: 5px 4px; border-bottom: 1px solid var(--line); } table.keys td:first-child { width: 42%; white-space: nowrap; }
kbd { background: #f4f5f3; border: 1px solid #cfd4d0; border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font: 12px var(--mono); }

/* ---- indicateurs d'activité ---- */
.activity { display: inline-flex; align-items: center; gap: 8px; background: #3a2a12; color: #ffd9a8; border: 1px solid #7a4e17; border-radius: 16px; padding: 4px 12px 4px 8px; font-size: 12.5px; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; animation: actglow 1.6s ease-in-out infinite; }
.activity .act-label { overflow: hidden; text-overflow: ellipsis; } .activity .act-time { font-family: var(--mono); opacity: .8; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,217,168,.3); border-top-color: #ffb366; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes actglow { 0%,100% { box-shadow: 0 0 0 0 rgba(217,83,30,.0); } 50% { box-shadow: 0 0 0 4px rgba(217,83,30,.25); } }
.busy { display: flex; gap: 22px; align-items: center; padding: 22px; margin: 12px 0; border-radius: 12px; background: linear-gradient(135deg, #fff7f1, #f1f7f9); border: 1px solid #f0d9c9; }
.busy-anim { position: relative; width: 74px; height: 74px; flex-shrink: 0; }
.busy-anim .ring { position: absolute; inset: 0; border-radius: 50%; border: 4px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent); animation: spin 1.1s linear infinite; }
.busy-anim .ring.r2 { inset: 10px; border-top-color: var(--accent-2); border-right-color: transparent; border-left-color: var(--accent-2); animation-duration: 1.6s; animation-direction: reverse; }
.busy-anim .house { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: var(--ink); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
.busy-txt { flex: 1; min-width: 0; }
.busy-title { font-weight: 650; font-size: 16px; display: flex; align-items: baseline; gap: 2px; }
.dots i { display: inline-block; width: 5px; height: 5px; margin-left: 3px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,80%,100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.busy-sub { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.busy-bar { height: 8px; background: #e9ecea; border-radius: 4px; overflow: hidden; position: relative; }
.busy-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #f08a4b); border-radius: 4px; transition: width .4s; }
.busy-bar.indet > div { position: absolute; width: 35%; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { left: -35%; } 100% { left: 100%; } }
.busy-time { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
button.primary.running { position: relative; padding-left: 34px; }
button.primary.running::before { content: ""; position: absolute; left: 11px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
.vals-preview { font-size: 12px; margin: 2px 0 6px; color: var(--muted); } .vals-preview.err { color: var(--bad); }
.vals-preview b { color: var(--ink); font-weight: 600; }
.helpbox { background: #f4f7f8; border: 1px solid #dbe6ea; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: #384441; margin: 6px 0 10px; }
.helpbox b { color: var(--ink); }
.var-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 8px 0; }
.var-card .grid2 { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 8px; align-items: center; font-size: 13px; }
.var-card input[type=text], .var-card input[type=number] { width: 100%; }
tr.ref td { background: #fff7f1; font-weight: 600; }
.activity[hidden], [hidden] { display: none !important; }
button.primary.running:disabled { opacity: 1; cursor: progress; }

/* ---------- vue 3D : barre d'outils, soleil, masque ---------- */
#view3dRoot { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.v3host { display: flex; flex-direction: column; min-height: 0; }
.view3d-card .v3host { height: auto; }
.v3bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.v3bar .seg { margin-left: 0; }
#view3dRoot #three { flex: none; height: 52vh; min-height: 320px; }
.model-grid.big3d #view3dRoot #three { height: 64vh; }
button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sunbar { display: grid; gap: 4px; background: #fbf7ec; border: 1px solid #eadfbf; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; }
.sunrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sunrow .sl { width: 3.4em; color: var(--muted); }
.sunrow input[type=range] { flex: 1 1 160px; min-width: 120px; accent-color: #e0a000; }
.sunrow b { min-width: 6.5em; }
.sunrow .chips { display: inline-flex; gap: 4px; }
.maskbox { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.maskbox .kpi b { display: block; font-size: 18px; } .maskbox .kpi span { font-size: 11.5px; color: var(--muted); }
.legend3d .ramp { display: inline-flex; align-items: center; gap: 6px; }
.legend3d .ramp i { height: 10px; display: inline-block; border-radius: 3px; }
.model-grid.big3d { grid-template-columns: 300px 1fr; }
.model-grid.big3d .plan-card { display: none; }
/* ---------- photovoltaïque ---------- */
.pv-grid { display: grid; grid-template-columns: minmax(420px, 560px) 1fr; gap: 12px; }
.pv-grid .pv-left { max-height: calc(100vh - 96px); overflow: auto; }
.pv-grid .pv-right { display: flex; flex-direction: column; min-height: calc(100vh - 96px); }
.pv-grid .pv-right .v3host { flex: 1 1 auto; }
.pv-grid .pv-right #view3dRoot #three { height: 62vh; }
.pv-grid .span2 { grid-column: 1 / -1; }
.sub-t { font-weight: 600; margin: 14px 0 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
table.pvtab tr.sel td { background: #eef3fb; }
td.ok { color: #2f7d4f; } td.wa { color: #b7791f; } td.ko { color: #c0392b; font-weight: 600; }
details.cec { margin-top: 8px; font-size: 12.5px; } details.cec summary { cursor: pointer; color: var(--accent); margin-bottom: 6px; }
.cec-res { max-height: 220px; overflow: auto; margin: 6px 0; }
.cec-item { display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px; border-radius: 5px; cursor: pointer; }
.cec-item:hover { background: #eef3fb; } .cec-item .k { color: var(--muted); white-space: nowrap; }
.custom-mod { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.empty.small { padding: 24px; font-size: 13px; }
@media (max-width: 1200px) { .pv-grid { grid-template-columns: 1fr; } .pv-grid .pv-right { position: static; min-height: 480px; } }

/* ---------- projets, comptes ---------- */
.sbadge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.12); color: #c9d1cd; white-space: nowrap; }
.sbadge.on { background: #2f7d4f; color: #fff; }
.userchip { position: relative; } .userchip .umenu { position: absolute; right: 0; top: 34px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; gap: 4px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.15); min-width: 200px; }
.userchip .umenu[hidden] { display: none; } .userchip .umenu button { color: var(--ink); text-align: left; }
dialog.bigdlg { border: none; border-radius: 12px; padding: 0; width: min(1200px, 96vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.bigdlg::backdrop { background: rgba(20,25,23,.45); }
.pgrid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; min-height: 60vh; }
.plist { display: grid; gap: 4px; max-height: 62vh; overflow: auto; align-content: start; }
.pitem { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; display: grid; }
.pitem.sel { border-color: var(--accent); background: #fff5f0; } .pitem .k { font-size: 11px; color: var(--muted); }
.vchip { background: #eef3fb; color: #1f3d6e; border-radius: 9px; padding: 1px 7px; font-size: 11px; white-space: nowrap; }
table.vtab tr.cur td { background: #f0f7f2; }
.login-ov { position: fixed; inset: 0; background: linear-gradient(135deg, #1d2422, #2c3a36); display: grid; place-items: center; z-index: 1000; }
.login-card { background: #fff; border-radius: 14px; padding: 28px 30px; width: min(380px, 92vw); display: grid; gap: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-card .brand { font-size: 20px; font-weight: 700; } .login-card input { padding: 9px 10px; font-size: 14px; }
@media (max-width: 900px) { .pgrid { grid-template-columns: 1fr; } }

.setupbar { background: #fff7e8; border: 1px solid #f0d9a8; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; display: grid; gap: 6px; }
.installbox { display: grid; gap: 6px; margin: 8px 0; }

/* ---- éditeur de plan photovoltaïque */
[hidden] { display: none !important; }
#pvPlanWrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.pvtools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 2px 0 8px; }
.pvtools .grp { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.pvtools .grp button { border: none; border-radius: 0; padding: 5px 9px; font-size: 12.5px; background: transparent; display: inline-flex; gap: 5px; align-items: center; }
.pvtools .grp button + button { border-left: 1px solid var(--line); }
.pvtools .grp button.on { background: #1f3d6e; color: #fff; }
.pvtools .grp button kbd { font: 10px/1 ui-monospace, monospace; opacity: .55; border: 1px solid currentColor; border-radius: 3px; padding: 1px 3px; }
.pvtools select { font-size: 12.5px; padding: 4px 6px; }
.pvtools .lab { font-size: 11.5px; color: var(--muted, #6b746f); margin-left: 4px; }
.pvplanhost { flex: 1 1 auto; min-height: 480px; position: relative; }
.pvsvg { width: 100%; height: 100%; min-height: 480px; display: block; border: 1px solid var(--line); border-radius: 10px; outline: none; cursor: crosshair; user-select: none; touch-action: none; }
.pvsvg:focus { border-color: #8fa7cf; }
.pvstatus { font-size: 12px; color: #5b6560; padding: 6px 2px 0; min-height: 18px; }
.pv-zone { fill: rgba(31, 61, 110, .05); stroke: #3c64a8; stroke-width: 1.3; stroke-dasharray: 6 4; cursor: move; }
.pv-zone.sel { fill: rgba(31, 61, 110, .09); stroke: #1f3d6e; stroke-width: 2; stroke-dasharray: none; }
.pv-usable { fill: none; stroke: #3c64a8; stroke-width: .8; stroke-dasharray: 2 3; opacity: .6; }
.pv-mods { cursor: move; }
.pv-mod { stroke: #fff; stroke-width: .6; }
.pv-mods:not(.sel) .pv-mod { opacity: .78; }
.pv-mod.free { fill-opacity: .9; }
.pv-mod.picked { stroke: #111; stroke-width: 2; }
.pv-ghost { fill: rgba(255,255,255,0.01); pointer-events: all; stroke: #9aa39f; stroke-width: 1; stroke-dasharray: 2 2; cursor: pointer; }
.pv-ghost:hover { fill: rgba(47, 125, 79, .15); stroke: #2f7d4f; }
.pv-wire { fill: none; stroke-width: 1.6; stroke-linejoin: round; opacity: .95; pointer-events: none; }
.pv-plus { stroke: #fff; stroke-width: 1; pointer-events: none; }
.pv-slabel { font: 600 10px Inter, sans-serif; fill: #1d2422; paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.pv-blabel { font: 11px Inter, sans-serif; fill: #59625d; text-anchor: middle; pointer-events: none; }
.pv-dim { font: 11px Inter, sans-serif; fill: #1f3d6e; paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.pv-vtx { fill: #fff; stroke: #1f3d6e; stroke-width: 1.6; cursor: grab; }
.pv-rot { fill: #1f3d6e; stroke: #fff; stroke-width: 2; cursor: alias; }
.pv-draw { fill: rgba(31, 61, 110, .06); stroke: #1f3d6e; stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
.pv-draw-rect { fill: rgba(31, 61, 110, .08); stroke: #1f3d6e; stroke-width: 1.5; pointer-events: none; }
.pv-box { fill: rgba(224, 160, 0, .1); stroke: #e0a000; stroke-width: 1; stroke-dasharray: 3 2; pointer-events: none; }
.pv-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: #4a524e; }
.pv-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.strlist { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.strlist td, .strlist th { padding: 3px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.strlist tr { cursor: pointer; }
.strlist tr.on td { background: #eef2f9; }
.strlist .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.strlist select { font-size: 12px; padding: 1px 3px; }
.strlist .ko { color: #b3261e; } .strlist .wa { color: #a86b00; }
.pvsum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.pvsum div { background: #f5f7f6; border-radius: 8px; padding: 6px 8px; }
.pvsum b { display: block; font-size: 15px; color: #1d2422; } .pvsum span { font-size: 11px; color: #6b746f; }
.fieldcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.fieldcard { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; background: #fff; }
.fieldcard.on { border-color: #1f3d6e; box-shadow: 0 0 0 2px rgba(31,61,110,.15); }
.fieldcard .t { font-weight: 600; font-size: 13px; } .fieldcard .m { font-size: 11.5px; color: #6b746f; }
.fieldcard .st { font-size: 11px; margin-top: 3px; } .fieldcard .st.ok { color: #2f7d4f; } .fieldcard .st.wa { color: #a86b00; } .fieldcard .st.ko { color: #b3261e; }
details.sec { border-top: 1px solid var(--line); padding: 6px 0; }
details.sec > summary { font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.sec > summary::before { content: '▸'; font-size: 11px; color: #6b746f; transition: transform .15s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec > summary .k { font-weight: 400; font-size: 11.5px; color: #6b746f; margin-left: auto; }
.pvtools .grp button .ic { display: inline-flex; }
.pvtools .grp button { padding: 5px 8px; }

/* ---- lumière : conformité, rendus */
.badges { white-space: normal; }
.cbadge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin: 1px 3px 1px 0; white-space: nowrap; border: 1px solid; }
.cbadge.ok { color: #22603c; background: #e8f3ec; border-color: #b9dcc6; }
.cbadge.ko { color: #9b1d20; background: #fbecea; border-color: #efc3bf; }
.cbadge.na { color: #6b746f; background: #f3f4f1; border-color: #dfe3df; }
.render-wrap { position: relative; margin-top: 6px; }
.render-img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line); cursor: crosshair; }
.render-tip { position: absolute; background: rgba(29,36,34,.88); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 5px; pointer-events: none; }
.fc-legend { margin: 8px 0 4px; }
.fc-legend .bar { height: 12px; border-radius: 6px; border: 1px solid var(--line); }
.fc-legend .ticks { display: flex; justify-content: space-between; font-size: 11px; color: #4a524e; margin-top: 2px; }
.render-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.render-thumbs img { width: 120px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.render-thumbs img.on { border-color: #1f3d6e; }
