/* Cloudsail energy platform demonstration. Design language follows the Arthur twin:
   dark base, amber = needs attention, sage = healthy, red = fault. Energy series have their own hues. */
:root {
  --bg: #0a0d12; --bg-2: #10151c; --bg-3: #171d26; --bg-4: #1e2530;
  --line: rgba(236,240,244,.10); --line-2: rgba(236,240,244,.22);
  --text: #eef1f4; --text-2: #c2cad3; --muted: #8f9ba8;
  --amber: #ffb02e; --amber-2: #ffc457; --on-amber: #1a1100;
  --ok: #8fb3a1; --warn: #ffb02e; --fault: #ff6b4a; --nodata: #6b7683; --crit: #ff4d6d;
  --solar: #f6e27f; --load: #d6dbe1; --import: #7aa2f7; --export: #5ec4d6; --batt: #b48ef0; --loss: #8f9ba8;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --top-h: 52px; --gap: 10px; --radius: 4px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 13px; line-height: 1.45; }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--amber-2); }
h1, h2, h3, h4 { margin: 0; font-variation-settings: "wdth" 108; letter-spacing: .005em; }
h2 { font-size: 18px; font-weight: 750; }
h3 { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 16px 0 8px; }
h3:first-child { margin-top: 0; }
h4 { font-size: 13px; font-weight: 650; }
p { margin: 6px 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.noscript { padding: 40px; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; display: grid; grid-template-rows: var(--top-h) 1fr; }

/* ---------- top bar ---------- */
#topbar { display: flex; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg); z-index: 20; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 20px; height: 20px; color: var(--amber); }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: .02em; font-variation-settings: "wdth" 112; }
.brand-sep { color: var(--line-2); }
.brand-sub { color: var(--text-2); font-weight: 500; font-size: 14px; }
.editions { display: flex; gap: 2px; height: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.editions a { display: flex; align-items: center; padding: 0 12px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.editions a:hover { color: var(--text); }
.editions a.active { color: var(--text); border-bottom-color: var(--amber); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.mode-chip { border: 1px solid var(--amber); color: var(--amber-2); padding: 3px 9px; border-radius: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.tenant select { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 5px 8px; max-width: 230px; }

/* ---------- controls ---------- */
.btn { background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 6px 11px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--text-2); }
.btn.primary { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.btn.primary:hover { background: var(--amber-2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--amber-2); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.seg button { background: none; border: 0; padding: 5px 10px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--bg-4); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 650; border: 1px solid var(--line-2); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); } .chip.warn, .chip.medium { color: var(--warn); } .chip.fault, .chip.high { color: var(--fault); }
.chip.critical { color: var(--crit); } .chip.nodata, .chip.low { color: var(--nodata); } .chip.plain::before { display: none; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.badge.built { background: rgba(143,179,161,.16); color: var(--ok); border: 1px solid rgba(143,179,161,.4); }
.badge.demo { background: rgba(122,162,247,.14); color: #a9c2ff; border: 1px solid rgba(122,162,247,.4); }
.badge.dev { background: rgba(255,176,46,.12); color: var(--amber-2); border: 1px solid rgba(255,176,46,.4); }
.badge.planned { background: transparent; color: var(--muted); border: 1px dashed var(--line-2); }
.badge.none { color: var(--line-2); }
.tag { font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; text-transform: lowercase; cursor: help; background: none; }
.tag:hover { color: var(--text); border-color: var(--line-2); }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.note { border-left: 2px solid var(--line-2); padding: 4px 0 4px 10px; color: var(--text-2); font-size: 12px; margin: 8px 0; }
.note.warn { border-left-color: var(--amber); }
.note.fault { border-left-color: var(--fault); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- views ---------- */
#main { position: relative; min-height: 0; }
.view { position: absolute; inset: 0; min-height: 0; }

/* ---------- Enterprise ---------- */
.ent { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0,1fr) 410px; grid-template-rows: minmax(0,1fr) 252px; gap: var(--gap); padding: var(--gap); }
.stage { position: relative; grid-column: 1; grid-row: 1; min-height: 0; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 40%, #111823 0%, var(--bg) 70%); }
.stage .pane { position: absolute; inset: 0; }
.stage.split .pane-physical { right: 40%; }
.stage.split .pane-network { left: 60%; border-left: 1px solid var(--line); }
.stage .pane-label { position: absolute; left: 10px; bottom: 8px; font-size: 10.5px; color: var(--muted); pointer-events: none; z-index: 3; max-width: 70%; }
.stage canvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-bar { position: absolute; top: 10px; right: 10px; z-index: 6; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.energy-now { position: absolute; top: 10px; left: 10px; z-index: 6; padding: 10px 12px; min-width: 214px; background: rgba(16,21,28,.92); backdrop-filter: blur(4px); }
.energy-now .en-time { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; }
.en-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: baseline; padding: 2px 0; }
.en-row .sw { width: 9px; height: 9px; border-radius: 2px; }
.en-row .v { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.en-row .v small { font-size: 10.5px; color: var(--muted); margin-left: 2px; }
.en-check { margin-top: 6px; font-size: 10.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 5px; }
.pins { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.pin { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; }
.pin .dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px rgba(0,0,0,.5); background: var(--ok); }
.pin .stem { width: 1px; height: 14px; background: rgba(236,240,244,.35); }
.pin .lbl { position: absolute; bottom: 100%; margin-bottom: 3px; white-space: nowrap; font-size: 10.5px; font-weight: 650; background: rgba(10,13,18,.86); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; opacity: 0; transition: opacity .12s; pointer-events: none; }
.pins.labels .pin .lbl, .pin:hover .lbl, .pin.sel .lbl, .pin.hl .lbl { opacity: 1; }
.pin.sel .dot { width: 15px; height: 15px; box-shadow: 0 0 0 2px var(--amber-2); }
.pin.hl .dot { box-shadow: 0 0 0 2px #fff; }
.pin.dim { opacity: .35; }
.pin.warn .dot { background: var(--warn); } .pin.fault .dot { background: var(--fault); } .pin.nodata .dot { background: var(--nodata); }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-size: 12px; pointer-events: none; text-align: center; padding: 20px; }
.phys-host svg, .sld svg { width: 100%; height: 100%; display: block; }
.sld .node { cursor: pointer; }
.sld .node text { font-family: var(--sans); font-size: 13px; fill: var(--text-2); }
.sld .node .nid { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.sld .node.sel .sym { stroke: var(--amber-2) !important; stroke-width: 2.6 !important; }
.sld .node.hl .sym { stroke: #fff !important; }
.sld .node.dim, .sld .edge.dim { opacity: .28; }
.sld .edge line, .sld .edge path { stroke: rgba(236,240,244,.45); fill: none; }
.sld .edge.path line, .sld .edge.path path { stroke: var(--amber-2); }
.sld .flow { font-family: var(--mono); font-size: 11.5px; }
.sld .bus { stroke: var(--text-2); stroke-width: 5; }

.inspector { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 11px 9px; cursor: pointer; color: var(--muted); font-weight: 650; font-size: 12px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--amber); }
.tabs button .count { font-family: var(--mono); font-size: 10px; margin-left: 4px; color: var(--fault); }
.tab-body { flex: 1; min-height: 0; padding: 14px; }
.asset-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.asset-head .aid { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.tele { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tele td { padding: 4px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.tele td.v { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tele td.t { text-align: right; width: 70px; }
.path-chain { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.path-chain button { background: var(--bg-3); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; cursor: pointer; font-family: var(--mono); font-size: 11px; }
.path-chain button:hover { border-color: var(--amber-2); }
.path-chain .arr { color: var(--muted); }
.list-item { border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; margin-bottom: 7px; background: var(--bg); cursor: pointer; }
.list-item:hover { border-color: var(--line-2); }
.list-item.sel { border-color: var(--amber); }
.list-item .li-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.list-item .li-title { font-weight: 650; }
.list-item .li-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.callout { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.callout.money { border-color: rgba(255,176,46,.45); }
.basis { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line-2); font-size: 11px; color: var(--muted); }
.basis b { color: var(--amber-2); font-weight: 650; }
.big { font-family: var(--mono); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.big small { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 10px; }
.opt.rec { border-color: var(--ok); }
.audit-entry { border-left: 2px solid var(--line-2); padding: 4px 0 8px 10px; margin-left: 4px; position: relative; }
.audit-entry::before { content: ""; position: absolute; left: -5px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--line-2); }
.audit-entry.ok::before { border-color: var(--ok); }
.audit-entry.bad::before { border-color: var(--fault); }
.audit-entry.local { border-left-style: dashed; }
.hash { font-family: var(--mono); font-size: 10.5px; color: var(--muted); word-break: break-all; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; padding: 5px 6px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.data td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.flt-bottom table.data td, .tab-body table.data td.n { white-space: nowrap; }
table.data td.n, table.data th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--bg-3); }
table.data tr.sel td { background: rgba(255,176,46,.08); }

.ops { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: 250px minmax(0,1fr); grid-template-rows: minmax(0,1fr) 46px; min-height: 0; }
.ops-kpis { grid-row: 1; padding: 10px 12px; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.kpi .k { font-size: 10.5px; color: var(--muted); }
.kpi .v { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 10.5px; color: var(--muted); }
.kpi.alert .v { color: var(--fault); }
.ops-chart { grid-row: 1; position: relative; min-width: 0; padding: 8px 10px 0; display: flex; flex-direction: column; }
.ops-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.chart { position: relative; flex: 1; min-height: 0; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cs .axis text { font-family: var(--mono); font-size: 9.5px; fill: var(--muted); }
.cs .axis line, .cs .grid line { stroke: var(--line); }
.cs .zero { stroke: var(--line-2); }
.cs .cursor { stroke: var(--amber-2); stroke-width: 1; }
.chart .band { opacity: .14; }
.chart .win { fill: rgba(255,176,46,.06); }
.timeline { grid-column: 1 / span 2; grid-row: 2; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-top: 1px solid var(--line); }
.timeline .tl-time { font-family: var(--mono); font-size: 12px; min-width: 150px; }
.timeline .track { position: relative; flex: 1; height: 30px; }
.timeline input[type=range] { position: absolute; left: 0; right: 0; top: 7px; width: 100%; margin: 0; accent-color: var(--amber); }
.timeline .marks { position: absolute; inset: 0; pointer-events: none; }
.timeline .marks .day { position: absolute; top: -1px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); transform: translateX(2px); }
.timeline .marks .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.timeline .marks .am { position: absolute; bottom: 0; width: 7px; height: 7px; border-radius: 50%; transform: translateX(-3px); pointer-events: auto; cursor: pointer; }

/* ---------- Fleet ---------- */
.flt { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0,1fr) 430px; grid-template-rows: minmax(0,1fr) 230px; gap: var(--gap); padding: var(--gap); }
.flt-list { grid-row: 1 / span 2; display: flex; flex-direction: column; min-height: 0; }
.flt-list .head, .flt-detail .head, .flt-bottom .head { padding: 12px 14px 8px; border-bottom: 1px solid var(--line); flex: none; }
.flt-list .body { flex: 1; min-height: 0; padding: 10px; }
.site-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 10px; margin-bottom: 8px; background: var(--bg); cursor: pointer; display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; }
.site-card:hover { border-color: var(--line-2); }
.site-card.sel { border-color: var(--amber); }
.site-card .rank { font-family: var(--mono); color: var(--muted); font-size: 12px; grid-row: 1 / span 3; padding-top: 1px; }
.site-card .sc-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.site-card .sc-name { font-weight: 650; }
.site-card .sc-why { font-size: 12px; color: var(--text-2); }
.site-card .sc-meta { font-size: 11px; color: var(--muted); }
.flt-map { grid-column: 2; grid-row: 1; position: relative; min-height: 0; overflow: hidden; }
.flt-map svg { width: 100%; height: 100%; display: block; }
.flt-map .land { fill: #141b24; stroke: rgba(236,240,244,.18); stroke-width: .8; }
.flt-map .site { cursor: pointer; }
.flt-map .site text { font-size: 11px; fill: var(--text-2); font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.flt-map .site.sel circle.ring { stroke: var(--amber-2); stroke-width: 2; }
.flt-map .map-note { position: absolute; left: 10px; bottom: 8px; font-size: 10.5px; color: var(--muted); }
.flt-map .map-legend { position: absolute; right: 10px; top: 10px; padding: 8px 10px; font-size: 11px; background: rgba(16,21,28,.92); }
.flt-map .map-legend div { display: flex; align-items: center; gap: 6px; }
.flt-map .map-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.flt-detail { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; min-height: 0; }
.flt-detail .body { flex: 1; min-height: 0; padding: 14px; }
.flt-bottom { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; min-height: 0; }
.flt-bottom .body { flex: 1; min-height: 0; padding: 0 10px 10px; }
.mini-chart { position: relative; height: 140px; margin: 6px 0 4px; }
.mini-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mini-chart.short { height: 96px; }

/* ---------- Community ---------- */
.com { position: absolute; inset: 0; display: grid; grid-template-columns: 300px minmax(0,1fr); gap: var(--gap); padding: var(--gap); }
.com-rail { display: flex; flex-direction: column; min-height: 0; }
.com-rail .body { flex: 1; min-height: 0; padding: 14px; }
.step { display: grid; grid-template-columns: 26px 1fr; gap: 8px; margin-bottom: 16px; }
.step .num { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.step.done .num { border-color: var(--ok); color: var(--ok); }
.step.cur .num { border-color: var(--amber); color: var(--amber-2); }
pre.cmd { background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 8px; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; word-break: break-all; margin: 6px 0; color: var(--text-2); }
.drop { display: block; border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 12px; text-align: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.drop.over { border-color: var(--amber); color: var(--text); }
.com-main { min-height: 0; padding: 0; display: flex; flex-direction: column; }
.com-main .head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.com-main .body { flex: 1; min-height: 0; padding: 14px 16px; }
.cards { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: var(--gap); }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.card.c4 { grid-column: span 4; } .card.c6 { grid-column: span 6; } .card.c8 { grid-column: span 8; } .card.c12 { grid-column: span 12; } .card.c3 { grid-column: span 3; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 6px; text-align: center; margin-top: 4px; }
.flow .node { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px 4px; }
.flow .node.off { border-style: dashed; color: var(--muted); }
.flow .node .v { font-family: var(--mono); font-size: 15px; }
.flow .arrow { font-family: var(--mono); color: var(--muted); font-size: 11px; }

/* ---------- Compare ---------- */
.cmp { position: absolute; inset: 0; padding: var(--gap); }
.cmp .body { height: 100%; padding: 18px 22px; }
.ed-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--gap); margin: 12px 0 18px; }
.ed-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.ed-card h2 { font-size: 20px; }
.ed-card .for { color: var(--text-2); }
.ed-card .state { font-size: 12px; color: var(--muted); }
.ed-card .why { flex: 1; }
.matrix th:not(:first-child), .matrix td:not(:first-child):not(:last-child) { text-align: center; }
.matrix td.grp { font-weight: 700; color: var(--text-2); text-transform: uppercase; font-size: 11px; letter-spacing: .07em; padding-top: 16px; border-bottom-color: var(--line-2); }
.matrix td.note-cell { color: var(--muted); font-size: 11.5px; max-width: 340px; }

/* ---------- Home ---------- */
.home { position: absolute; inset: 0; overflow-y: auto; background: radial-gradient(ellipse at 50% 0%, #141c27 0%, var(--bg) 60%); }
.home-in { max-width: 1120px; margin: 0 auto; padding: 48px 24px 40px; }
.home .kicker { color: var(--amber-2); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; margin: 0; }
.home h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; margin: 8px 0 10px; }
.home .lead { font-size: 17px; color: var(--text-2); max-width: 640px; }
.home-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 30px; }
.big-btn { padding: 11px 20px; font-size: 15px; text-decoration: none; }
.home-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-card { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.home-card.sig { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(255,176,46,.25), 0 12px 40px rgba(0,0,0,.35); }
.home-card h2 { font-size: 24px; }
.home-card .for { color: var(--text-2); margin: 0; }
.home-card .state { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.home-card .hc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.home-card .hc-actions a { text-decoration: none; }
.sig-tag { position: absolute; top: -10px; left: 16px; background: var(--amber); color: var(--on-amber); font-size: 10.5px; font-weight: 750; letter-spacing: .05em; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; }
.home-contact { margin-top: 26px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; }
.home-contact h2 { font-size: 18px; }
.home-contact .big-btn { text-decoration: none; }
.home-note { margin-top: 26px; font-size: 12.5px; color: var(--muted); max-width: 820px; border-left: 2px solid var(--amber); padding-left: 12px; }
@media (max-width: 900px) { .home-cards { grid-template-columns: 1fr; } .home { position: relative; } }

/* ---------- overlays ---------- */
.tour { position: fixed; left: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); z-index: 40; padding: 14px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.55); border-color: var(--line-2); }
.tour .t-step { font-family: var(--mono); font-size: 11px; color: var(--amber-2); }
.tour h4 { font-size: 15px; margin: 4px 0 6px; }
.tour .t-text { color: var(--text-2); }
.tour .t-meta { font-size: 11.5px; color: var(--muted); margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.tour .t-nav { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.tour-picker { display: grid; gap: 8px; margin-top: 8px; }
.source { position: fixed; right: 16px; top: calc(var(--top-h) + 16px); width: min(380px, calc(100vw - 32px)); z-index: 45; padding: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.55); border-color: var(--line-2); max-height: calc(100vh - var(--top-h) - 40px); overflow-y: auto; }
.source .close { float: right; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--bg-3); border: 1px solid var(--line-2); padding: 9px 14px; border-radius: var(--radius); z-index: 50; max-width: min(560px, calc(100vw - 32px)); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.tooltip { position: fixed; z-index: 60; pointer-events: none; background: rgba(10,13,18,.95); border: 1px solid var(--line-2); padding: 5px 8px; border-radius: 3px; font-size: 11.5px; max-width: 280px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .ent { grid-template-columns: minmax(0,1fr) 360px; }
  .flt { grid-template-columns: 300px minmax(0,1fr) 380px; }
}
@media (max-width: 1080px) {
  body { overflow: auto; }
  #app { position: static; display: block; min-height: 100%; }
  #topbar { position: sticky; top: 0; height: auto; min-height: var(--top-h); flex-wrap: wrap; padding: 8px 12px; gap: 8px 12px; }
  .editions { order: 3; width: 100%; height: 36px; }
  .top-right { margin-left: auto; }
  .view { position: relative; inset: auto; }
  .ent, .flt, .com, .cmp { position: relative; inset: auto; display: flex; flex-direction: column; }
  .stage { height: 62vh; min-height: 360px; }
  .stage.split .pane-physical { right: 0; bottom: 50%; }
  .stage.split .pane-network { left: 0; top: 50%; border-left: 0; border-top: 1px solid var(--line); }
  .inspector { max-height: none; }
  .inspector .tab-body { max-height: 70vh; }
  .ops { display: flex; flex-direction: column; }
  .ops-kpis { border-right: 0; border-bottom: 1px solid var(--line); }
  .ops-chart { height: 220px; }
  .timeline { height: 52px; }
  .flt-map { height: 52vh; min-height: 320px; }
  .flt-list .body, .flt-detail .body, .flt-bottom .body { max-height: 70vh; }
  .com-main .body, .com-rail .body { max-height: none; overflow: visible; }
  .cards .card { grid-column: span 12 !important; }
  .ed-cards { grid-template-columns: 1fr; }
  .cmp .body { overflow-x: auto; }
}
@media (max-width: 640px) {
  .brand-sub, .brand-sep { display: none; }
  .mode-chip { font-size: 9.5px; padding: 2px 6px; }
  .tenant select { max-width: 150px; }
  .energy-now { min-width: 0; padding: 5px 8px; top: 6px; left: 6px; font-size: 11px; }
  .energy-now .en-row .v { font-size: 12px; }
  .energy-now .en-check, .energy-now .en-time, .energy-now .tag { display: none; }
  .stage-bar { top: auto; bottom: 6px; right: 6px; left: 6px; justify-content: flex-start; gap: 5px; }
  .stage .pane-label { display: none; }
  .timeline .marks .day { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr 1fr; }
  .timeline .tl-time { min-width: 0; font-size: 11px; }
  .matrix td.note-cell { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
