:root {
  --bg: #0b0f0d;
  --side: #090c0b;
  --panel: #111714;
  --panel-2: #151c18;
  --seam: #212a25;
  --seam-2: #2e3a33;
  --text: #eae5d8;
  --muted: #8c938a;
  --dim: #5f675f;
  --gold: #d9a441;
  --gold-ink: #1a1408;
  --hydro: #16a0a6;
  --geo: #d0643a;
  --wind: #8c7be0;
  --solar: #b98c18;
  --thermal: #6b736d;
  --grid: #8c938a;
  --good: #5aa86a;
  --warn: #d9a441;
  --r: 10px;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
body { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- sidebar ---------- */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--seam); padding: 22px 14px 18px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; }
.mark { width: 30px; height: 30px; flex: none; }
.brand b { display: block; letter-spacing: .32em; font-size: 17px; font-weight: 700; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; letter-spacing: .01em; }
.tibeb { height: 14px; margin: 18px 8px 8px; border-top: 1px solid var(--seam); border-bottom: 1px solid var(--seam); }
.tibeb svg { display: block; width: 100%; height: 100%; }
.nav-group { margin-top: 20px; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 0 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; position: relative; border: 1px solid transparent; }
.nav a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); flex: none; }
.nav a:hover { color: var(--text); background: #121815; }
.nav a.active { color: var(--text); background: #18201c; border-color: #26302a; }
.nav a.active::before { background: var(--gold); }
.nav a.active::after { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--gold); }
.nav .badge { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--gold); border: 1px solid #3c3018; background: #1e190f; border-radius: 9px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--seam); font-size: 11px; color: var(--dim); line-height: 1.5; }
.side-foot .ed { color: var(--muted); }

/* ---------- main ---------- */
main { min-width: 0; padding: 0 28px 32px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 16px 0 14px; background: linear-gradient(var(--bg) 82%, rgba(11,15,13,0)); border-bottom: 1px solid var(--seam); }
.title h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; margin: 0; }
.title p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.search { position: relative; width: min(340px, 34vw); }
.search input { width: 100%; height: 36px; border-radius: 8px; border: 1px solid var(--seam); background: var(--panel); padding: 0 34px 0 34px; outline: none; }
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: #4a3a1a; }
.search .icon { position: absolute; left: 11px; top: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 8px; top: 8px; font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--seam-2); border-radius: 4px; padding: 1px 6px; background: var(--panel-2); }
.results { position: absolute; top: 42px; left: 0; right: 0; background: #121915; border: 1px solid var(--seam-2); border-radius: 10px; padding: 6px; max-height: 360px; overflow: auto; box-shadow: 0 18px 50px rgba(0,0,0,.55); display: none; }
.results.open { display: block; }
.results button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: baseline; background: none; border: 0; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.results button:hover, .results button.sel { background: #1b231f; }
.results .k { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); width: 64px; flex: none; }
.results .t { flex: 1; }
.results .s { color: var(--muted); font-size: 12px; }
.results .empty { padding: 10px; color: var(--muted); }
.btn { height: 36px; border-radius: 8px; border: 1px solid var(--seam-2); background: var(--panel); padding: 0 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #46564c; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 700; }
.btn-gold:hover { filter: brightness(1.06); border-color: var(--gold); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
[hidden] { display: none !important; }

section { scroll-margin-top: 84px; padding-top: 26px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.sec-head h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0; }
.sec-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.sec-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.panel { background: var(--panel); border: 1px solid var(--seam); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.panel h3 { margin: 0; font-size: 14px; font-weight: 700; }
.panel .sub { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.panel-head .right { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.src { font-size: 11px; color: var(--dim); margin-top: 12px; }
.src::before { content: "Source · "; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; padding: 16px 18px 14px; overflow: hidden; }
.kpi .lbl { padding-right: 64px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.kpi .lbl i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.kpi .val { margin-top: 12px; display: flex; align-items: baseline; gap: 6px; }
.kpi .val b { font-size: 28px; font-weight: 500; letter-spacing: -.01em; }
.kpi .val span { color: var(--muted); font-size: 12px; }
.kpi .dl { margin-top: 8px; font-size: 11.5px; color: var(--dim); display: flex; gap: 6px; flex-wrap: wrap; }
.kpi .dl em { font-style: normal; font-family: var(--mono); color: var(--text); }
.kpi .per { position: absolute; top: 16px; right: 16px; font-size: 10.5px; color: var(--dim); font-family: var(--mono); }
.kpi svg.spark { position: absolute; right: 16px; top: 44px; width: 66px; height: 30px; }
.kpi .ksrc { margin-top: 6px; font-size: 10.5px; color: var(--dim); }

/* ---------- layout ---------- */
.grid-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.stack { display: grid; gap: 14px; align-content: start; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 26px; padding: 0 11px; border-radius: 13px; border: 1px solid var(--seam); background: transparent; color: var(--dim); font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 7px; height: 7px; border-radius: 50%; }
.chip[aria-pressed="true"] { color: var(--text); border-color: #3a4840; background: #1a221e; }
.chip.gold[aria-pressed="true"] { color: var(--gold); border-color: #4a3a1a; background: #1f1a10; }

/* ---------- map ---------- */
.map-wrap { position: relative; }
#map { width: 100%; height: auto; display: block; touch-action: manipulation; }
#map .bubble { cursor: pointer; transition: opacity .15s; }
#map .bubble:hover circle.ring, #map .bubble.sel circle.ring { stroke-width: 2.2; }
#map text { font-family: var(--sans); }
td a { text-decoration: none; border-bottom: 1px dotted #46564c; }
td a:hover { color: var(--gold); border-color: var(--gold); }
.map-panel { display: flex; flex-direction: column; }
.map-panel .map-wrap { flex: 1; display: flex; align-items: center; }
.asset-card { position: absolute; left: 12px; top: 12px; width: 230px; background: rgba(13,18,16,.96); border: 1px solid var(--seam-2); border-radius: 9px; padding: 12px 14px; font-size: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.asset-card .k { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.asset-card h4 { margin: 6px 0 8px; font-size: 14px; }
.asset-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.asset-card dt { color: var(--muted); }
.asset-card dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 11.5px; }
.asset-card .note { margin-top: 8px; color: var(--muted); line-height: 1.45; }
.asset-card .x { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: var(--dim); font-size: 18px; cursor: pointer; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--seam); font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend .ring { width: 10px; height: 10px; border: 1.3px solid var(--muted); background: transparent; }
.legend .dashring { width: 10px; height: 10px; border: 1.3px dashed var(--muted); background: transparent; }
.legend .dash { width: 18px; height: 0; border-top: 2px dashed var(--gold); border-radius: 0; }

/* ---------- charts ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--dim); }
.chart .lbl { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
.chart .gridline { stroke: #1d2621; stroke-width: 1; }
.chart .axis { stroke: #2b352f; }
.series-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.series-legend span { display: inline-flex; align-items: center; gap: 6px; }
.series-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.series-legend i.sq { width: 9px; height: 9px; border-radius: 2px; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: #0e1311; border: 1px solid var(--seam-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 120px; box-shadow: 0 10px 28px rgba(0,0,0,.5); opacity: 0; transition: opacity .08s; }
.tip.on { opacity: 1; }
.tip .h { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.tip .r { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.tip .r span { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.tip .r i { width: 8px; height: 8px; border-radius: 2px; }
.tip .r b { font-family: var(--mono); font-weight: 400; color: var(--text); }

/* mix bar */
.mixbar { display: flex; gap: 2px; height: 18px; margin: 6px 0 10px; }
.mixbar div { border-radius: 2px; min-width: 2px; cursor: default; }
.mixleg { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--muted); }
.mixleg span { display: inline-flex; align-items: center; gap: 7px; }
.mixleg i { width: 8px; height: 8px; border-radius: 50%; }
.mixleg b { font-family: var(--mono); font-weight: 400; color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--seam); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--muted); font-size: 11.5px; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-family: var(--mono); }
.seg button[aria-pressed="true"] { background: #211c12; color: var(--gold); box-shadow: inset 0 0 0 1px #4a3a1a; }

/* ---------- feed ---------- */
.feed { display: grid; gap: 4px; }
.item { display: grid; grid-template-columns: 3px 1fr auto; gap: 12px; padding: 10px 2px; border-bottom: 1px solid #19211d; }
.item:last-child { border-bottom: 0; }
.item .bar { border-radius: 2px; }
.item .cat { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.item h4 { margin: 4px 0 3px; font-size: 13px; font-weight: 600; }
.item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.item .when { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; }
.item .ssrc { margin-top: 4px; font-size: 10.5px; color: var(--dim); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--seam-2); white-space: nowrap; }
th button { background: none; border: 0; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
td { padding: 10px; border-bottom: 1px solid #19211d; vertical-align: top; }
td.r, th.r { text-align: right; }
tr:hover td { background: #131a16; }
.tech { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tech i { width: 8px; height: 8px; border-radius: 50%; }
.stage { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--seam-2); color: var(--muted); white-space: nowrap; }
.stage.operating { color: #9fd0aa; border-color: #2b4a33; background: #132018; }
.stage.construction { color: #e0b864; border-color: #4a3a1a; background: #1d180e; }
.stage.tender, .stage.procurement { color: #c8b6ff; border-color: #3a3360; background: #17142a; }
.stage.development, .stage.planned { color: var(--muted); }

/* stage summary */
.stagebars { display: grid; gap: 12px; max-width: 760px; }
.stagebars .row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 12px; align-items: center; font-size: 12.5px; }
.stagebars .track { height: 6px; background: #1d2621; border-radius: 3px; overflow: hidden; }
.stagebars .fill { height: 100%; border-radius: 3px; }

/* stats */
.stat { padding: 16px 18px; }
.stat .lbl { color: var(--muted); font-size: 12px; }
.stat .v { margin-top: 10px; font-size: 26px; font-weight: 500; }
.stat .v span { font-size: 12px; color: var(--muted); margin-left: 4px; }
.stat .p { margin-top: 6px; font-size: 11px; color: var(--dim); }

.link-card h4 { margin: 0 0 4px; font-size: 14px; }
.link-card .spec { font-family: var(--mono); font-size: 11.5px; color: var(--gold); margin-top: 8px; }
.link-card p { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.progress { display: flex; gap: 3px; margin: 10px 0 6px; }
.progress div { flex: 1; height: 8px; border-radius: 2px; background: #1d2621; }
.progress div.on { background: var(--gold); }

/* ---------- footer ---------- */
footer { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--seam); display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; color: var(--dim); font-size: 11.5px; line-height: 1.55; }
footer p { margin: 0; max-width: 760px; }

/* ---------- dialogs ---------- */
dialog { background: #111714; color: var(--text); border: 1px solid var(--seam-2); border-radius: 12px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(4,6,5,.7); }
dialog form { padding: 22px; display: grid; gap: 12px; }
dialog h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; }
dialog p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
dialog label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
dialog input, dialog textarea { background: var(--bg); border: 1px solid var(--seam-2); border-radius: 8px; padding: 9px 10px; outline: none; }
dialog textarea { min-height: 96px; resize: vertical; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.hp { position: absolute; left: -9999px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: #18201c; border: 1px solid var(--seam-2); border-radius: 10px; padding: 11px 16px; font-size: 13px; opacity: 0; transition: .2s; z-index: 80; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--seam); overflow: visible; }
  .brand small, .tibeb, .nav-label, .side-foot { display: none; }
  .brand b { font-size: 14px; }
  .mark { width: 24px; height: 24px; }
  .navs { min-width: 0; flex: 1; display: flex; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .navs::-webkit-scrollbar { display: none; }
  .nav-group { margin: 0; display: contents; }
  .nav { display: contents; }
  .nav a { white-space: nowrap; padding: 6px 10px; }
  .nav a::before { display: none; }
  .nav a.active::after { display: none; }
  main { padding: 0 16px 28px; }
  .topbar { position: static; flex-wrap: wrap; }
  .top-actions { margin-left: 0; width: 100%; }
  .search { width: 100%; flex: 1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-4 { grid-template-columns: 1fr 1fr; }
  section { scroll-margin-top: 64px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi svg.spark { display: none; }
  .kpi .lbl { padding-right: 0; font-size: 11.5px; }
  .kpi .per { position: static; margin-top: 4px; }
  .kpi .val { margin-top: 8px; flex-wrap: wrap; }
  .kpi .val b { font-size: 24px; }
  .panel-head { flex-wrap: wrap; }
  .panel-head .right { margin-left: 0; justify-content: flex-start; width: 100%; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .title h1 { font-size: 26px; }
  .panel { padding: 16px; }
  .asset-card { position: static; width: auto; margin-top: 10px; }
  .stagebars .row { grid-template-columns: 92px 1fr 56px; }
  .sec-head { flex-wrap: wrap; }
  .sec-head .right { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 1560px) and (min-width: 561px) {
  .kpi svg.spark { top: auto; bottom: 14px; right: 14px; width: 56px; height: 24px; opacity: .9; }
  .kpi .lbl { padding-right: 52px; }
  .kpi .ksrc { padding-right: 64px; }
}
