/* =====================================================================
   SuryaVayu · Renewable Asset Intelligence — Design system v2
   Enterprise light UI · sidebar shell · realistic 3D environments
   ===================================================================== */

:root {
  --page: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-3: #f1f3f7;
  --border: #e5e8ee;
  --border-strong: #d4d9e2;
  --hairline: #eef0f4;

  --ink: #0d1626;
  --ink-2: #364154;
  --ink-3: #657085;
  --ink-4: #98a1b2;

  --brand: #0b2545;
  --brand-2: #163a66;
  --accent: #2a78d6;
  --accent-2: #1f63b8;
  --accent-soft: #ebf3fd;
  --accent-line: #c7dcf6;

  --wind: #0f7c8c;
  --wind-2: #0b6573;
  --wind-soft: #e7f5f7;
  --solar: #d9822b;
  --solar-2: #b86a1c;
  --solar-soft: #fdf4e9;

  --st-run: #0ca30c;      --st-run-soft: #e8f6e8;
  --st-warn: #fab219;     --st-warn-soft: #fff6e0;
  --st-serious: #ec835a;
  --st-fault: #d03b3b;    --st-fault-soft: #fcecec;
  --st-maint: #2a78d6;    --st-maint-soft: #ebf3fd;
  --st-idle: #8a94a6;     --st-idle-soft: #f1f3f6;
  --st-comms: #6250d6;    --st-comms-soft: #efedfb;

  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow: 0 2px 6px -1px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, .22), 0 6px 12px -6px rgba(16, 24, 40, .08);
  --ring: 0 0 0 3px rgba(42, 120, 214, .18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --mod: var(--accent);
  --mod-2: var(--accent-2);
  --mod-soft: var(--accent-soft);
  --sb-w: 260px;
  --top-h: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--page);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01", "ss03";
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; letter-spacing: -0.012em; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: #cfe1f8; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.hidden { display: none !important; }

body.mod-wind { --mod: var(--wind); --mod-2: var(--wind-2); --mod-soft: var(--wind-soft); }
body.mod-solar { --mod: var(--solar); --mod-2: var(--solar-2); --mod-soft: var(--solar-soft); }

/* =====================================================================
   APP SHELL
   ===================================================================== */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .25s var(--ease); }
body.sb-collapsed { --sb-w: 76px; }

.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 70; overflow: hidden; }
.sb-brand { height: var(--top-h); display: flex; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid var(--hairline); flex-shrink: 0; cursor: pointer; }
.sb-brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.sb-brand b { display: block; font-size: 16px; font-weight: 750; letter-spacing: -0.02em; color: var(--brand); line-height: 1.15; }
.sb-brand span { display: block; font-size: 11px; color: var(--ink-3); letter-spacing: .01em; white-space: nowrap; }
.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 12px 16px; scrollbar-width: thin; }
.sb-portfolio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; }
.sb-portfolio .pf-ico { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--wind), var(--solar)); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.sb-portfolio .pf-ico svg { width: 16px; height: 16px; }
.sb-portfolio b { display: block; font-size: 12.5px; line-height: 1.25; }
.sb-portfolio span { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.sb-group + .sb-group { margin-top: 14px; }
.sb-title { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-4); padding: 6px 10px; white-space: nowrap; }
.sb-title .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sb-item { position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--ink-2); font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, color .15s; }
.sb-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-3); transition: color .15s; }
.sb-item:hover { background: var(--surface-3); color: var(--ink); }
.sb-item:hover svg { color: var(--ink-2); }
.sb-item.active { background: var(--sb-soft, var(--accent-soft)); color: var(--sb-c, var(--accent-2)); font-weight: 650; }
.sb-item.active svg { color: var(--sb-c, var(--accent-2)); }
.sb-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sb-c, var(--accent)); }
.sb-item[data-mod="wind"] { --sb-c: var(--wind-2); --sb-soft: var(--wind-soft); }
.sb-item[data-mod="solar"] { --sb-c: var(--solar-2); --sb-soft: var(--solar-soft); }
.sb-item .sb-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--st-fault); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sb-item .sb-badge[data-n="0"] { display: none; }
.sb-item .sb-live { margin-left: auto; font-size: 11px; font-weight: 650; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sb-foot { border-top: 1px solid var(--hairline); padding: 12px; flex-shrink: 0; }
.sb-status { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.sb-status > div { min-width: 0; }
.sb-status b { display: block; font-size: 12px; }
.sb-status span { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-collapse { margin-top: 10px; width: 100%; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 600; }
.sb-collapse:hover { background: var(--surface-3); color: var(--ink); }
.sb-collapse svg { width: 16px; height: 16px; transition: transform .25s; }
body.sb-collapsed .sb-collapse svg { transform: rotate(180deg); }
body.sb-collapsed .sb-brand div, body.sb-collapsed .sb-portfolio div, body.sb-collapsed .sb-item span, body.sb-collapsed .sb-item .sb-live,
body.sb-collapsed .sb-title span, body.sb-collapsed .sb-status > div, body.sb-collapsed .sb-collapse span { display: none; }
body.sb-collapsed .sb-item { justify-content: center; padding: 0; }
body.sb-collapsed .sb-item .sb-badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
body.sb-collapsed .sb-title { justify-content: center; padding: 6px 0; }
body.sb-collapsed .sb-portfolio { justify-content: center; padding: 8px; }
body.sb-collapsed .sb-status { justify-content: center; padding: 10px 0; }
body.sb-collapsed .sb-brand { justify-content: center; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 60; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 24px; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--border); }
.tb-menu { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); min-width: 0; flex-shrink: 0; max-width: 34%; white-space: nowrap; }
.crumbs a { color: var(--ink-3); font-weight: 550; cursor: pointer; }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs .sep { color: var(--ink-4); }
.crumbs b { color: var(--ink); font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.tb-spacer { flex: 1; }
.tb-search { display: flex; align-items: center; gap: 10px; height: 36px; flex: 0 1 250px; min-width: 150px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-4); font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.tb-search:hover { border-color: var(--border-strong); background: var(--surface); }
.tb-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.tb-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd, .tb-search kbd { margin-left: auto; font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--border); background: var(--surface); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
.tb-chip { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; border: 1px solid var(--border); border-radius: 10px; font-size: 12px; color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.tb-chip b { font-variant-numeric: tabular-nums; color: var(--ink); }
.tb-chip svg { width: 15px; height: 15px; color: var(--ink-3); }
.tb-chip .badge-scn { font-size: 10.5px; font-weight: 700; color: #8a5a00; background: #fff4d6; border-radius: 5px; padding: 1px 6px; }
.tb-icon { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.tb-icon:hover { background: var(--surface-3); }
.tb-icon svg { width: 18px; height: 18px; }
.tb-icon .dotc { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--st-fault); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.tb-icon .dotc[data-n="0"] { display: none; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #163a66, #2a78d6); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); flex-shrink: 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-idle); position: relative; flex-shrink: 0; display: inline-block; }
.live-dot.on { background: var(--st-run); }
.live-dot.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--st-run); opacity: .5; animation: pulse 2s infinite; }
.live-dot.sim { background: var(--st-warn); }
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }

.content { flex: 1; min-width: 0; }
.view { display: none; }
.view.active { display: block; animation: fadein .28s var(--ease); }
.subpage { display: none; }
.subpage.on { display: block; animation: fadein .25s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.container { max-width: 1540px; margin: 0 auto; padding: 24px 28px 40px; }

/* page header */
.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.page-head .ph-main { min-width: 0; flex: 1; }
.page-head h1 { font-size: 25px; font-weight: 750; letter-spacing: -0.025em; margin-top: 4px; line-height: 1.2; }
.page-head p { color: var(--ink-3); margin-top: 6px; max-width: 920px; font-size: 14px; line-height: 1.6; }
.page-head .ph-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ph-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.meta-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.meta-chip svg { width: 13px; height: 13px; color: var(--ink-3); }
.meta-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .085em; text-transform: uppercase; color: var(--mod); }
.eyebrow::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: currentColor; opacity: .7; }
.section-title { display: flex; align-items: flex-end; gap: 16px; margin: 32px 0 14px; }
.section-title h2 { font-size: 19px; font-weight: 720; letter-spacing: -0.02em; margin-top: 4px; }
.section-title p { color: var(--ink-3); margin-top: 4px; max-width: 860px; }
.section-title .tools { margin-left: auto; display: flex; gap: 8px; }

/* live insight */
.insight { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; margin-bottom: 16px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 0%, var(--surface) 55%, color-mix(in srgb, var(--mod-soft) 70%, #fff) 100%); border: 1px solid var(--border); box-shadow: var(--shadow-xs); position: relative; overflow: hidden; }
.insight::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--mod), color-mix(in srgb, var(--mod) 40%, #fff)); }
.insight:empty { display: none; }
.insight .in-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--mod-soft); color: var(--mod); display: grid; place-items: center; flex-shrink: 0; }
.insight .in-ico svg { width: 18px; height: 18px; }
.insight .in-body { flex: 1; min-width: 0; }
.insight .in-h { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.insight .in-h .t { font-weight: 550; letter-spacing: 0; text-transform: none; color: var(--ink-4); }
.insight p { margin-top: 3px; font-size: 14px; color: var(--ink-2); line-height: 1.62; }
.insight p b { color: var(--ink); font-weight: 650; }
.insight .in-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.insight .in-actions button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; height: 27px; padding: 0 11px; font-size: 12px; font-weight: 620; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: border-color .15s, color .15s; }
.insight .in-actions button:hover { border-color: var(--mod); color: var(--mod-2); }
.insight .in-actions svg { width: 13px; height: 13px; }

/* =====================================================================
   CONTROLS
   ===================================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 620; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, box-shadow .15s, transform .06s, filter .15s; text-decoration: none !important; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.mod { background: var(--mod); border-color: var(--mod); color: #fff; }
.btn.mod:hover { background: var(--mod-2); }
.btn.danger { background: var(--st-fault); border-color: var(--st-fault); color: #fff; }
.btn.danger:hover { filter: brightness(1.06); }
.btn.soft { background: var(--mod-soft); border-color: transparent; color: var(--mod-2); box-shadow: none; }
.btn.soft:hover { filter: brightness(.97); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; gap: 6px; }
.btn.xs svg { width: 14px; height: 14px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.icon { width: 36px; padding: 0; }
.btn.xs.icon { width: 26px; }
.btn.sm.icon { width: 30px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 620; color: var(--ink-3); white-space: nowrap; transition: color .15s, background .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px rgba(16, 24, 40, .04); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field .lbl { font-size: 12.5px; font-weight: 620; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.field label output, .field .lbl output { font-weight: 700; color: var(--mod-2); font-variant-numeric: tabular-nums; background: var(--mod-soft); padding: 1px 8px; border-radius: 6px; font-size: 12px; }
.field small { color: var(--ink-3); font-size: 11.5px; line-height: 1.45; }
input[type="number"], input[type="text"], select { height: 38px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 11px; font-family: inherit; font-size: 13px; color: var(--ink); background: var(--surface); width: 100%; transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-xs); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23657085' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[readonly] { background: var(--surface-2); color: var(--ink-3); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--mod) 0 var(--p), #e3e7ee var(--p) 100%); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--mod); margin-top: -6px; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .12s; }
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: #e3e7ee; }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--mod); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--mod); box-shadow: 0 1px 3px rgba(16, 24, 40, .25); }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.w100 { width: 100%; }
.planner-layout, .loss-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.sticky-col { position: sticky; top: calc(var(--top-h) + 16px); }

/* =====================================================================
   CARDS
   ===================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); min-height: 58px; }
.card-h > div:first-child, .card-h > h3 { min-width: 0; }
.card-h h3 { font-size: 14.5px; font-weight: 680; display: flex; align-items: center; gap: 8px; }
.card-h .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.card-h .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.card-h .ch-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--mod-soft); color: var(--mod); display: grid; place-items: center; flex-shrink: 0; }
.card-h .ch-ico svg { width: 16px; height: 16px; }
.card-b { padding: 16px 18px; }
.card-b.tight { padding: 10px 12px; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--hairline); font-size: 12px; color: var(--ink-3); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.how { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ink-3); padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 9px; margin-top: 12px; line-height: 1.55; }
.how svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.how b { color: var(--ink-2); }
.ti { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-4); cursor: help; padding: 0; flex-shrink: 0; transition: color .15s, background .15s; }
.ti:hover { color: var(--accent); background: var(--accent-soft); }
.ti svg { width: 14px; height: 14px; }

/* =====================================================================
   KPI TILES
   ===================================================================== */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 13px; position: relative; overflow: hidden; min-width: 0; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .2s; }
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.kpi .k-label { font-size: 12px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.kpi .k-label .ti { margin-left: auto; }
.kpi .k-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 6px; }
.kpi .k-value { font-size: 25px; font-weight: 720; letter-spacing: -0.025em; white-space: nowrap; line-height: 1.15; }
.kpi .k-value small { font-size: 13px; font-weight: 620; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi .k-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-sub b { color: var(--ink-2); font-weight: 620; }
.kpi.loss .k-value { color: var(--st-fault); }
.kpi.loss { background: linear-gradient(180deg, #fff, #fffafa); }
.kpi .bar { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--mod); border-radius: 4px; transition: width .6s var(--ease); }
.spark { width: 84px; height: 30px; flex-shrink: 0; overflow: visible; }
.spark path.l { fill: none; stroke: var(--mod); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark path.a { fill: var(--mod); opacity: .1; stroke: none; }
.spark circle { fill: var(--mod); stroke: #fff; stroke-width: 1.5; }
.kpi.loss .spark path.l { stroke: var(--st-fault); }
.kpi.loss .spark path.a, .kpi.loss .spark circle { fill: var(--st-fault); }
.delta-up { color: #0a7a0a; font-weight: 650; }
.delta-down { color: var(--st-fault); font-weight: 650; }

/* =====================================================================
   PILLS
   ===================================================================== */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; line-height: 1.6; }
.pill i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.pill.run { background: var(--st-run-soft); color: #0a6b0a; } .pill.run i { background: var(--st-run); }
.pill.derate { background: var(--st-warn-soft); color: #8a5a00; } .pill.derate i { background: var(--st-warn); }
.pill.fault { background: var(--st-fault-soft); color: #a32525; } .pill.fault i { background: var(--st-fault); }
.pill.maint { background: var(--st-maint-soft); color: #1d5aa6; } .pill.maint i { background: var(--st-maint); }
.pill.idle { background: var(--st-idle-soft); color: #4b5565; } .pill.idle i { background: var(--st-idle); }
.pill.comms { background: var(--st-comms-soft); color: #4535b0; } .pill.comms i { background: var(--st-comms); }
.pill.storm { background: #e8eefc; color: #2c3e7a; } .pill.storm i { background: #3b4f9c; }
.pill.grid { background: #f3e8fb; color: #6b2c91; } .pill.grid i { background: #8e44ad; }
.pill.neutral { background: var(--surface-3); color: var(--ink-2); border-color: var(--border); }
.pill.crit { background: var(--st-fault); color: #fff; } .pill.crit i { background: #fff; }
.pill.serious { background: #fdeee7; color: #a2431c; } .pill.serious i { background: var(--st-serious); }
.pill.warning { background: var(--st-warn-soft); color: #8a5a00; } .pill.warning i { background: var(--st-warn); }
.pill.info { background: var(--accent-soft); color: #1d5aa6; } .pill.info i { background: var(--accent); }

/* =====================================================================
   3D VIEWPORT
   ===================================================================== */
.viewport-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; }
.viewport { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); height: clamp(560px, calc(100vh - var(--top-h) - 56px), 920px); background: linear-gradient(#cfe3f3, #eef4f7); box-shadow: var(--shadow); }
.viewport:fullscreen { border-radius: 0; height: 100vh; border: 0; }
.viewport canvas { display: block; width: 100%; height: 100%; outline: none; }
.vp-overlay { position: absolute; pointer-events: none; z-index: 5; }
.vp-overlay > * { pointer-events: auto; }
.vp-tl { top: 14px; left: 14px; display: flex; flex-direction: column; gap: 8px; max-width: 300px; }
.vp-tr { top: 14px; right: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.vp-bl { bottom: 14px; left: 14px; right: 14px; display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.glass { background: rgba(255, 255, 255, .87); backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .75); border-radius: 12px; box-shadow: 0 6px 20px rgba(15, 23, 42, .14); }
.vp-card { padding: 10px 12px; }
.vp-card h5 { margin: 0 0 7px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.vp-card h5::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.6px solid var(--ink-4); border-bottom: 1.6px solid var(--ink-4); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.vp-card.collapsed h5 { margin-bottom: 0; }
.vp-card.collapsed h5::after { transform: rotate(-45deg); }
.vp-card.collapsed > :not(h5) { display: none; }
.legend-list { display: grid; grid-template-columns: auto auto; gap: 4px 14px; font-size: 12px; }
.legend-list div { display: flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer; padding: 1px 0; border-radius: 4px; }
.legend-list div:hover { color: var(--accent); }
.legend-list i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.legend-list b { margin-left: auto; font-variant-numeric: tabular-nums; padding-left: 6px; }
.vp-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.vp-kpis div span { display: block; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.vp-kpis div b { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.vp-kpis div b small { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.loss-ticker { color: var(--st-fault) !important; }
.compass { width: 92px; height: 92px; position: relative; }
.compass svg { width: 100%; height: 100%; }
.weather-mini { display: flex; gap: 14px; padding: 8px 12px; font-size: 12px; align-items: center; }
.weather-mini div span { display: block; font-size: 10px; text-transform: uppercase; color: var(--ink-3); letter-spacing: .05em; font-weight: 650; }
.weather-mini div b { font-size: 14px; font-variant-numeric: tabular-nums; }
.vp-toolbar { display: flex; gap: 6px; padding: 6px; align-items: center; flex-wrap: wrap; }
.vp-toolbar .tl-lbl { font-size: 10px; font-weight: 700; color: var(--ink-4); text-transform: uppercase; letter-spacing: .07em; padding: 0 2px 0 6px; }
.vp-toolbar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; }
.time-ctrl { display: flex; align-items: center; gap: 10px; padding: 7px 12px; min-width: 380px; }
.time-ctrl input { flex: 1; }
.time-ctrl b { font-variant-numeric: tabular-nums; min-width: 46px; font-size: 14px; }
.vp-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 6; padding: 7px 14px; font-size: 12px; color: var(--ink-2); display: flex; gap: 14px; align-items: center; pointer-events: none; transition: opacity .8s; white-space: nowrap; }
.vp-hint span { display: inline-flex; align-items: center; gap: 6px; }
.vp-hint.gone { opacity: 0; }
.labels3d { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.lbl3d { position: absolute; transform: translate(-50%, -100%); font-size: 11px; font-weight: 700; white-space: nowrap; background: rgba(255, 255, 255, .94); border: 1px solid rgba(13, 22, 38, .08); border-radius: 7px; padding: 2px 7px 2px 6px; display: flex; align-items: center; gap: 5px; box-shadow: 0 2px 8px rgba(13, 22, 38, .14); color: var(--ink); pointer-events: auto; cursor: pointer; }
.lbl3d i { width: 7px; height: 7px; border-radius: 50%; }
.lbl3d small { font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lbl3d.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.lbl3d.sel small { color: #c9d6ea; }
.lbl3d.alarm { animation: alarm 1.2s infinite; }
@keyframes alarm { 0%, 100% { box-shadow: 0 0 0 0 rgba(208, 59, 59, .6); } 50% { box-shadow: 0 0 0 6px rgba(208, 59, 59, 0); } }
.hover-tip { position: absolute; z-index: 8; pointer-events: none; transform: translate(12px, 12px); padding: 9px 11px; font-size: 12px; min-width: 170px; display: none; }
.hover-tip b { display: block; font-size: 12.5px; }
.vp-loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 9; background: linear-gradient(#dfeaf3, #f4f7f9); transition: opacity .6s; }
.vp-loading.done { opacity: 0; pointer-events: none; }
.vp-loading .spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #cbd5e1; border-top-color: var(--mod); animation: spin 1s linear infinite; margin: 0 auto 12px; }
.vp-loading .lt { font-size: 13px; font-weight: 650; color: var(--ink-2); text-align: center; }
.vp-loading .ls { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.asset-panel { display: flex; flex-direction: column; gap: 16px; height: clamp(560px, calc(100vh - var(--top-h) - 56px), 920px); min-height: 0; }
.asset-panel .card { display: flex; flex-direction: column; min-height: 0; }
.asset-panel .card.grow { flex: 1; }
.asset-scroll { overflow-y: auto; flex: 1; scrollbar-width: thin; }
.asset-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--hairline); }
.asset-head .row { align-items: flex-start; }
.asset-head h3 { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; margin-top: 2px; }
.asset-head .meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.param-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hairline); }
.param { padding: 9px 18px; border-bottom: 1px solid var(--hairline); min-width: 0; }
.param:nth-child(odd) { border-right: 1px solid var(--hairline); }
.param span { display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.param b { font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 680; }
.param b small { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.param.alarm { background: #fffafa; } .param.alarm b { color: var(--st-fault); }
.param.warn b { color: #a87200; }
.asset-section { padding: 12px 18px; }
.asset-section h6 { margin: 0 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.empty-state { padding: 28px 22px; text-align: center; color: var(--ink-3); }
.empty-state svg { width: 46px; height: 46px; color: var(--ink-4); margin-bottom: 8px; }
.empty-state b { display: block; color: var(--ink-2); margin-bottom: 4px; }
.fault-box { margin: 12px 18px 0; border-radius: 11px; padding: 11px 13px; background: var(--st-fault-soft); border: 1px solid #f1caca; }
.fault-box.warn { background: var(--st-warn-soft); border-color: #f3dda2; }
.fault-box.info { background: var(--st-maint-soft); border-color: #c6dbf5; }
.fault-box.idle { background: var(--st-idle-soft); border-color: var(--border); }
.fault-box > b { display: block; font-size: 13px; }
.fault-box p { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.fault-box .loss { font-size: 12px; margin-top: 7px; display: flex; gap: 12px; flex-wrap: wrap; }
.fault-box .loss b { display: inline; font-size: 12px; }
.feed { overflow-y: auto; flex: 1; scrollbar-width: thin; }
.feed-item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; cursor: pointer; transition: background .15s; }
.feed-item:hover { background: var(--surface-2); }
.feed-item .fi-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.feed-item .fi-ico svg { width: 14px; height: 14px; }
.feed-item b { display: block; font-size: 12.5px; font-weight: 620; }
.feed-item .t { color: var(--ink-4); font-size: 11px; margin-left: auto; white-space: nowrap; padding-left: 8px; font-variant-numeric: tabular-nums; }
.feed-item p { color: var(--ink-3); font-size: 12px; }
.ico-crit { background: var(--st-fault-soft); color: var(--st-fault); }
.ico-warn { background: var(--st-warn-soft); color: #b07800; }
.ico-info { background: var(--accent-soft); color: var(--accent); }
.ico-ok { background: var(--st-run-soft); color: #0a7a0a; }

/* =====================================================================
   TABLES · CHARTS · RESULTS
   ===================================================================== */
.tbl-wrap { overflow: auto; scrollbar-width: thin; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 650; color: var(--ink-3); font-size: 11.5px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; z-index: 1; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: #f8fbff; }
.tbl tr.sel td { background: var(--mod-soft); }
.tbl tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--mod); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr { cursor: pointer; }
.tbl .mini-bar { width: 70px; height: 6px; background: var(--surface-3); border-radius: 4px; display: inline-block; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.tbl .mini-bar i { display: block; height: 100%; background: var(--mod); border-radius: 4px; }
.hot { color: var(--st-fault); font-weight: 700; }
.warm { color: #a87200; font-weight: 700; }
.chart-box { position: relative; height: 280px; }
.chart-box.h180 { height: 180px; } .chart-box.h220 { height: 220px; } .chart-box.h260 { height: 260px; } .chart-box.h320 { height: 320px; } .chart-box.h360 { height: 360px; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-legend i.sq { width: 10px; height: 10px; border-radius: 3px; }
.chart-legend i.band { height: 10px; opacity: .55; border-radius: 3px; }
.result-hero { padding: 18px 20px; border-radius: var(--radius); background: linear-gradient(135deg, #0b2545, #1a4475); color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.result-hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.result-hero span { font-size: 11.5px; opacity: .8; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; }
.result-hero b { display: block; font-size: 38px; letter-spacing: -0.035em; line-height: 1.1; margin: 6px 0 4px; font-weight: 760; }
.result-hero p { opacity: .88; font-size: 13px; line-height: 1.5; }
.result-hero.loss { background: linear-gradient(135deg, #7a1d1d, #c03737); }
.result-hero.gain { background: linear-gradient(135deg, #0b5a2b, #13873f); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.stat-row > div { background: var(--surface); padding: 13px 16px; }
.stat-row span { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.stat-row b { font-size: 19px; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; font-weight: 720; }
.stat-row b small { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare > div { border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; }
.compare > div.bad { background: #fff9f9; border-color: #f2d3d3; }
.compare > div.good { background: #f6fcf6; border-color: #cfe8cf; }
.compare h5 { margin: 0 0 10px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.compare dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 12.5px; }
.compare dt { color: var(--ink-3); }
.compare dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

/* =====================================================================
   ALERTS · PIPELINE · KANBAN · WHATSAPP
   ===================================================================== */
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; position: relative; padding: 6px 0 2px; }
.pipe-step { text-align: center; position: relative; padding: 0 4px; }
.pipe-step::before { content: ""; position: absolute; top: 17px; left: -50%; right: 50%; height: 3px; background: var(--surface-3); z-index: 0; }
.pipe-step:first-child::before { display: none; }
.pipe-step.done::before, .pipe-step.now::before { background: var(--mod); }
.pipe-dot { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; margin: 0 auto 8px; position: relative; z-index: 1; color: var(--ink-4); transition: all .3s; }
.pipe-dot svg { width: 16px; height: 16px; }
.pipe-step.done .pipe-dot { background: var(--mod); border-color: var(--mod); color: #fff; }
.pipe-step.now .pipe-dot { border-color: var(--mod); color: var(--mod); box-shadow: 0 0 0 5px var(--mod-soft); animation: nowpulse 1.4s infinite; }
@keyframes nowpulse { 50% { box-shadow: 0 0 0 9px transparent; } }
.pipe-step b { display: block; font-size: 12px; }
.pipe-step span { display: block; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; min-height: 200px; display: flex; flex-direction: column; }
.kcol h6 { margin: 0; padding: 10px 12px; font-size: 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.kcol h6 span { margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; font-size: 11px; }
.kcol .klist { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 360px; }
.ticket { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px; font-size: 12px; box-shadow: var(--shadow-xs); animation: fadein .3s ease; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ticket:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.ticket .tk-h { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; }
.ticket .tk-id { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-left: auto; }
.ticket b { display: block; font-size: 12.5px; line-height: 1.35; }
.ticket .tk-f { display: flex; justify-content: space-between; margin-top: 7px; color: var(--ink-3); font-size: 11px; align-items: center; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--brand-2); flex-shrink: 0; }
.phones { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; justify-items: center; }
.phone { width: 300px; height: 590px; border-radius: 44px; background: #0b0f14; padding: 11px; position: relative; box-shadow: 0 30px 60px -22px rgba(0, 0, 0, .38), inset 0 0 0 2px #2b3038; }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 88px; height: 22px; border-radius: 14px; background: #000; z-index: 3; }
.phone-screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; display: flex; flex-direction: column; background: #efeae2; }
.wa-status { height: 40px; background: #075e54; color: #fff; font-size: 11px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 22px 4px; font-weight: 600; }
.wa-head { background: #075e54; color: #fff; display: flex; align-items: center; gap: 9px; padding: 6px 12px 10px; }
.wa-head .wa-av { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; }
.wa-head .wa-av svg { width: 34px; height: 34px; }
.wa-head b { display: block; font-size: 13.5px; }
.wa-head span { display: block; font-size: 11px; opacity: .8; }
.wa-body { flex: 1; overflow-y: auto; padding: 10px 10px 14px; display: flex; flex-direction: column; gap: 6px; background-color: #efeae2; background-image: radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px); background-size: 14px 14px; scroll-behavior: smooth; }
.wa-day { align-self: center; background: #e1f2fb; color: #54656f; font-size: 10.5px; padding: 3px 9px; border-radius: 7px; margin: 4px 0; }
.wa-msg { max-width: 88%; min-width: 86px; background: #fff; border-radius: 9px; border-top-left-radius: 2px; padding: 7px 9px 18px; font-size: 12px; line-height: 1.42; position: relative; box-shadow: 0 1px .5px rgba(0, 0, 0, .13); align-self: flex-start; animation: msgin .3s ease; white-space: pre-line; color: #111b21; }
.wa-msg.out { align-self: flex-end; background: #d9fdd3; border-top-left-radius: 9px; border-top-right-radius: 2px; }
.wa-msg .wa-t { position: absolute; right: 8px; bottom: 3px; font-size: 9.5px; color: #667781; }
.wa-msg .wa-t .ticks { color: #53bdeb; }
.wa-msg b { font-weight: 700; }
.wa-msg .wa-btns { display: flex; flex-direction: column; gap: 1px; margin: 8px -9px -14px; border-top: 1px solid #e9edef; }
.wa-msg .wa-btns span { text-align: center; color: #027eb5; font-weight: 600; padding: 7px 0; font-size: 12px; border-bottom: 1px solid #f0f2f5; }
.wa-msg .wa-btns span:last-child { border-bottom: 0; }
.wa-msg .wa-map { height: 70px; border-radius: 6px; margin: -2px -4px 6px; background: linear-gradient(135deg, #cfe8c9, #e9f1d8 40%, #d6e7f3); position: relative; overflow: hidden; }
.wa-msg .wa-map::after { content: "📍"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -60%); font-size: 20px; }
.wa-msg .wa-map::before { content: ""; position: absolute; left: 0; right: 0; top: 46%; height: 5px; background: #fff; transform: rotate(-12deg); opacity: .9; }
@keyframes msgin { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.wa-typing { align-self: flex-start; background: #fff; border-radius: 9px; padding: 9px 12px; display: flex; gap: 3px; box-shadow: 0 1px .5px rgba(0, 0, 0, .13); }
.wa-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa5ad; animation: typing 1s infinite; }
.wa-typing i:nth-child(2) { animation-delay: .15s; } .wa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.wa-input { height: 46px; background: #f0f2f5; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.wa-input div { flex: 1; height: 32px; border-radius: 16px; background: #fff; font-size: 12px; color: #8696a0; display: flex; align-items: center; padding: 0 12px; }
.wa-input span { width: 32px; height: 32px; border-radius: 50%; background: #00a884; display: grid; place-items: center; color: #fff; }
.phone-cap { text-align: center; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.phone-cap b { color: var(--ink); display: block; font-size: 13px; }

/* =====================================================================
   HOME · COMMAND CENTER
   ===================================================================== */
.welcome { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 28px; color: #fff; margin-bottom: 16px; background: radial-gradient(700px 300px at 100% 0%, rgba(94, 196, 212, .35), transparent 60%), radial-gradient(600px 300px at 0% 120%, rgba(242, 163, 58, .32), transparent 60%), linear-gradient(120deg, #0b2545 0%, #12345e 60%, #173f6e 100%); box-shadow: var(--shadow); }
.welcome .w-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: center; position: relative; z-index: 1; }
.welcome .eyebrow { color: #9fd6df; }
.welcome h1 { font-size: 30px; font-weight: 780; letter-spacing: -0.03em; margin-top: 8px; line-height: 1.15; }
.welcome h1 em { font-style: normal; background: linear-gradient(90deg, #7fd3df, #ffd08a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome p { color: #c9d6ea; margin-top: 10px; font-size: 14.5px; line-height: 1.65; max-width: 700px; }
.welcome .cta { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.welcome .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .25); }
.welcome .btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.welcome .w-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.welcome .w-stat { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 12px 14px; }
.welcome .w-stat span { display: block; font-size: 11px; color: #a9bbd6; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.welcome .w-stat b { display: block; font-size: 22px; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.welcome .w-stat small { color: #a9bbd6; font-size: 11.5px; }
.site-card { display: flex; flex-direction: column; overflow: hidden; cursor: pointer; transition: box-shadow .2s, transform .2s, border-color .2s; }
.site-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border-strong); }
.site-card .sc-art { height: 150px; position: relative; overflow: hidden; }
.site-card .sc-art svg { width: 100%; height: 100%; display: block; }
.site-card .sc-tag { position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #fff; background: rgba(11, 18, 32, .35); border: 1px solid rgba(255, 255, 255, .3); padding: 4px 10px; border-radius: 999px; }
.site-card .sc-tag svg { width: 13px; height: 13px; }
.site-card .sc-b { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.site-card .sc-title { display: flex; align-items: center; gap: 10px; }
.site-card .sc-title h3 { font-size: 16px; font-weight: 720; }
.site-card .sc-title span { font-size: 12px; color: var(--ink-3); }
.site-card .sc-title .go { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; transition: background .15s, transform .2s, color .15s; flex-shrink: 0; }
.site-card:hover .sc-title .go { background: var(--sc-c, var(--accent)); color: #fff; transform: translateX(3px); }
.site-card .sc-title .go svg { width: 16px; height: 16px; }
.site-card .sc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.site-card .sc-stats div span { display: block; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.site-card .sc-stats div b { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.statusbar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.statusbar i { display: block; height: 100%; }
.statusbar-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.statusbar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.statusbar-legend i { width: 7px; height: 7px; border-radius: 50%; }
.site-map { overflow: hidden; display: flex; flex-direction: column; }
.site-map svg { display: block; width: 100%; height: auto; }
.site-map .cap { padding: 10px 16px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: 12px; }
.inc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--hairline); cursor: pointer; transition: background .12s; }
.inc:hover { background: var(--surface-2); }
.inc:last-child { border-bottom: 0; }
.inc .i-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.inc .i-ico svg { width: 16px; height: 16px; }
.inc b { display: block; font-size: 13px; font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc .i-sub { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 1px; }
.inc .i-loss { text-align: right; }
.inc .i-loss b { color: var(--st-fault); font-variant-numeric: tabular-nums; }
.inc .i-loss span { font-size: 11px; color: var(--ink-3); }
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1221px) { .flow.f5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.flow-step { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; position: relative; box-shadow: var(--shadow-xs); }
.flow-step .n { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.flow-step b { display: block; margin-top: 10px; font-size: 14px; }
.flow-step p { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; right: -10px; top: 28px; width: 8px; height: 8px; border-top: 2px solid var(--border-strong); border-right: 2px solid var(--border-strong); transform: rotate(45deg); z-index: 1; }
.feature { display: flex; gap: 14px; padding: 18px; }
.feature .fi { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.feature .fi svg { width: 20px; height: 20px; }
.feature b { display: block; font-size: 14px; }
.feature p { font-size: 13px; color: var(--ink-3); margin-top: 3px; line-height: 1.55; }
.source-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.source { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 11px; padding: 11px 14px; font-size: 12.5px; box-shadow: var(--shadow-xs); }
.source b { display: block; font-size: 13px; }
.source span { color: var(--ink-3); font-size: 11.5px; }
.source .sd { width: 8px; height: 8px; border-radius: 50%; background: var(--st-run); flex-shrink: 0; }
.source .sd.ref { background: var(--accent); }

/* =====================================================================
   AMC · KNOWLEDGE · SOLAR STRINGS
   ===================================================================== */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; position: relative; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.plan:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.plan .ribbon { position: absolute; top: -12px; left: 22px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .04em; }
.plan h3 { font-size: 18px; font-weight: 740; }
.plan .tagline { color: var(--ink-3); font-size: 13px; margin-top: 4px; min-height: 40px; }
.plan .price { margin: 14px 0 4px; display: flex; gap: 18px; padding: 12px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.plan .price div b { font-size: 24px; letter-spacing: -0.02em; font-weight: 760; }
.plan .price div span { display: block; font-size: 11.5px; color: var(--ink-3); }
.plan ul { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.plan li { display: flex; gap: 9px; align-items: flex-start; }
.plan li svg { width: 16px; height: 16px; color: var(--st-run); flex-shrink: 0; margin-top: 2px; }
.plan li.no { color: var(--ink-4); }
.plan li.no svg { color: var(--ink-4); }
.sla-table td:first-child { font-weight: 620; }
.sla-table td { white-space: normal; }
.gloss-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gloss { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.gloss:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.gloss.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 50% { box-shadow: 0 0 0 3px var(--accent-line); border-color: var(--accent); } 100% { box-shadow: var(--shadow-xs); } }
.gloss .gh { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.gloss b { font-size: 14px; }
.gloss .cat { margin-left: auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-3); background: var(--surface-3); padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.gloss p { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.gloss .ex { margin-top: 7px; font-size: 12px; color: var(--ink-3); border-left: 3px solid var(--hairline); padding-left: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 620; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.method-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px 0; padding-bottom: 4px; }
.mf-step { flex: 1 1 130px; min-width: 130px; border: 1px solid var(--border); background: var(--surface); padding: 14px; border-radius: 11px; position: relative; margin-right: 18px; }
.mf-step:last-child { margin-right: 0; }
.mf-step:not(:last-child)::after { content: "→"; position: absolute; right: -15px; top: 50%; transform: translateY(-50%); color: var(--ink-4); font-weight: 700; }
.mf-step .mf-n { font-size: 11px; font-weight: 700; color: var(--mod); text-transform: uppercase; letter-spacing: .06em; }
.mf-step b { display: block; margin: 4px 0; font-size: 13.5px; }
.mf-step p { font-size: 12px; color: var(--ink-3); }
.heat-wrap { overflow-x: auto; }
.heat { display: grid; gap: 2px; }
.heat .hc { height: 18px; border-radius: 3px; cursor: pointer; position: relative; }
.heat .hc:hover { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 2; }
.heat .hl { font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; font-family: var(--mono); white-space: nowrap; padding-right: 6px; }
.heat-scale { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.heat-scale .grad { width: 160px; height: 8px; border-radius: 4px; }
.inv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.inv { border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; box-shadow: var(--shadow-xs); }
.inv:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.inv.sel { border-color: var(--mod); box-shadow: 0 0 0 3px var(--mod-soft); }
.inv .ih { display: flex; align-items: center; gap: 8px; }
.inv .ih b { font-size: 13.5px; }
.inv .ip { font-size: 22px; font-weight: 720; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.inv .ip small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.inv .im { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.inv .im b { display: block; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.inv .load { height: 5px; border-radius: 3px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.inv .load i { display: block; height: 100%; background: var(--mod); }

/* =====================================================================
   OVERLAYS — drawer · palette · popover · tooltip · tour · toast
   ===================================================================== */
.scrim { position: fixed; inset: 0; background: rgba(13, 22, 38, .36); z-index: 85; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 94vw); background: var(--surface); z-index: 90; box-shadow: -24px 0 48px -20px rgba(13, 22, 38, .3); transform: translateX(104%); transition: transform .32s var(--ease); display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.drawer.on { transform: none; }
.dr-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--hairline); display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.dr-head .dr-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--mod-soft); color: var(--mod); display: grid; place-items: center; flex-shrink: 0; }
.dr-head .dr-ico svg { width: 21px; height: 21px; }
.dr-head h2 { font-size: 19px; font-weight: 740; margin-top: 3px; }
.dr-head p { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }
.dr-tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--hairline); overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.dr-tabs button { border: 0; background: transparent; padding: 11px 10px; font-size: 12.5px; font-weight: 620; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.dr-tabs button:hover { color: var(--ink); }
.dr-tabs button.on { color: var(--mod-2); border-bottom-color: var(--mod); }
.dr-body { flex: 1; overflow-y: auto; padding: 6px 24px 28px; scrollbar-width: thin; }
.dr-sec { padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.dr-sec:last-child { border-bottom: 0; }
.dr-sec h4 { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.dr-sec h4 .n { width: 22px; height: 22px; border-radius: 7px; background: var(--mod-soft); color: var(--mod-2); display: grid; place-items: center; font-size: 11px; font-weight: 750; flex-shrink: 0; }
.dr-sec p, .dr-sec li { font-size: 13.5px; color: var(--ink-2); line-height: 1.68; }
.dr-sec p + p, .dr-sec p + ul, .dr-sec ul + p { margin-top: 8px; }
.dr-sec ul { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.dr-sec ul li { position: relative; padding-left: 18px; }
.dr-sec ul li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--mod); opacity: .75; }
.dr-sec ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 9px; }
.dr-sec ol li { counter-increment: s; position: relative; padding-left: 32px; }
.dr-sec ol li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--mod); color: var(--mod-2); display: grid; place-items: center; font-size: 11px; font-weight: 750; }
.dr-sec b { color: var(--ink); }
.formula, .dr-sec code { font-family: var(--mono); font-size: 12px; background: #f3f6fb; border: 1px solid #e0e7f1; color: #1b3a63; padding: 1px 6px; border-radius: 6px; }
.formula { display: block; padding: 10px 12px; margin: 8px 0; white-space: pre-wrap; line-height: 1.7; border-radius: 9px; }
.dr-live { margin-top: 10px; padding: 12px 14px; border-radius: 11px; background: linear-gradient(135deg, var(--mod-soft), #fff); border: 1px solid color-mix(in srgb, var(--mod) 22%, transparent); }
.dr-live .h { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mod-2); display: flex; align-items: center; gap: 6px; }
.dr-live p { margin-top: 4px; font-size: 13.5px; }
.dr-legend { display: grid; grid-template-columns: auto 1fr; gap: 9px 12px; font-size: 13px; align-items: start; }
.dr-legend i { width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; display: inline-block; }
.dr-legend div b { display: block; font-size: 13px; }
.dr-legend div span { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.dr-terms { display: grid; gap: 8px; }
.dr-term { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.dr-term b { font-size: 13px; }
.dr-term p { font-size: 12.5px; margin-top: 2px; color: var(--ink-2); line-height: 1.55; }
.dr-foot { padding: 14px 24px; border-top: 1px solid var(--hairline); display: flex; gap: 8px; align-items: center; background: var(--surface-2); }
.dr-foot span { font-size: 12px; color: var(--ink-3); margin-right: auto; }
.palette { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%) translateY(-8px) scale(.98); width: min(660px, 94vw); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(13, 22, 38, .06); z-index: 95; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s var(--ease); overflow: hidden; }
.palette.on { opacity: 1; pointer-events: auto; transform: translateX(-50%); }
.pl-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--hairline); }
.pl-input svg { width: 20px; height: 20px; color: var(--ink-3); flex-shrink: 0; }
.pl-input input { border: 0 !important; box-shadow: none !important; height: 58px; font-size: 16px; padding: 0; background: transparent; }
.pl-list { max-height: 440px; overflow-y: auto; padding: 8px; }
.pl-group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); padding: 10px 10px 4px; }
.pl-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pl-item .pi { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-2); flex-shrink: 0; }
.pl-item .pi svg { width: 16px; height: 16px; }
.pl-item b { font-size: 13.5px; font-weight: 620; display: block; }
.pl-item span { font-size: 12px; color: var(--ink-3); }
.pl-item .pk { margin-left: auto; font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.pl-item.on { background: var(--accent-soft); }
.pl-item.on .pi { background: #fff; color: var(--accent); }
.pl-empty { padding: 28px; text-align: center; color: var(--ink-3); font-size: 13px; }
.pl-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--hairline); font-size: 11.5px; color: var(--ink-3); background: var(--surface-2); }
.pl-foot span { display: inline-flex; gap: 5px; align-items: center; }
.popover { position: fixed; z-index: 88; width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .18s, transform .18s var(--ease); overflow: hidden; }
.popover.on { opacity: 1; pointer-events: auto; transform: none; }
.pop-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.pop-h b { font-size: 14px; }
.pop-h .tools { margin-left: auto; display: flex; gap: 6px; }
.pop-list { max-height: 420px; overflow-y: auto; }
.pop-list .dtag { font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 5px; text-transform: uppercase; letter-spacing: .05em; margin-left: 6px; }
.dtag.wind { background: var(--wind-soft); color: var(--wind-2); }
.dtag.solar { background: var(--solar-soft); color: var(--solar-2); }
.pop-f { padding: 10px 16px; border-top: 1px solid var(--hairline); display: flex; gap: 8px; background: var(--surface-2); }
.tipbox { position: fixed; z-index: 99; max-width: 330px; background: #0d1626; color: #e7ecf3; border-radius: 11px; padding: 11px 13px; font-size: 12.5px; line-height: 1.55; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .14s, transform .14s; }
.tipbox.on { opacity: 1; transform: none; }
.tipbox b { display: block; color: #fff; font-size: 13px; margin-bottom: 3px; }
.tipbox .tf { display: block; font-family: var(--mono); font-size: 11.5px; background: rgba(255, 255, 255, .08); border-radius: 6px; padding: 5px 8px; margin-top: 7px; color: #cfe1ff; white-space: pre-wrap; }
.tipbox .tn { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(255, 255, 255, .12); color: #9fd6df; }
.tour-spot { position: fixed; z-index: 91; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(13, 22, 38, .55); transition: all .45s var(--ease); pointer-events: none; outline: 2px solid #fff; }
.tour-card { position: fixed; z-index: 92; width: 390px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 18px 18px 14px; border: 1px solid var(--border); transition: all .35s ease; }
.tour-card .tstep { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tour-card h4 { font-size: 16.5px; margin: 6px 0; font-weight: 720; }
.tour-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.tour-card .row { margin-top: 14px; }
.tour-prog { height: 4px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 12px; }
.tour-prog i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 96; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--st-fault); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 11px 14px; width: 370px; font-size: 12.5px; animation: toastin .3s ease; display: flex; gap: 10px; align-items: center; }
.toast.ok { border-left-color: var(--st-run); }
.toast.info { border-left-color: var(--accent); }
.toast.warn { border-left-color: var(--st-warn); }
.toast b { display: block; font-size: 13px; }
.toast p { color: var(--ink-3); }
@keyframes toastin { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.skel { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* =====================================================================
   MISC
   ===================================================================== */
.note { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
.note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.divider { height: 1px; background: var(--hairline); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.callout { border-radius: 11px; padding: 12px 14px; background: var(--mod-soft); border: 1px solid color-mix(in srgb, var(--mod) 22%, transparent); font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.callout b { color: var(--ink); }
.tag-mini { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--ink-3); letter-spacing: .03em; }
.src-note { font-size: 11.5px; color: var(--ink-4); margin-top: 8px; line-height: 1.5; }
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 28px; }
.footer-inner { max-width: 1540px; margin: 0 auto; display: flex; gap: 24px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.footer-inner b { color: var(--ink-2); }
.spin-rotor { animation: rotor 3.2s linear infinite; transform-box: view-box; }
.spin-rotor.slow { animation-duration: 4.4s; } .spin-rotor.fast { animation-duration: 2.2s; }
@keyframes rotor { to { transform: rotate(360deg); } }
.wind-flow { animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -36; } }
@media (prefers-reduced-motion: reduce) { .spin-rotor, .wind-flow, .live-dot.on::after, .lbl3d.alarm, .pipe-step.now .pipe-dot { animation: none; } }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1360px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-search { min-width: 150px; }
  .tb-clock { display: none; }
}
@media (max-width: 1220px) {
  .viewport-wrap { grid-template-columns: 1fr; }
  .asset-panel { height: auto; }
  .asset-panel .card.grow { max-height: 640px; }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow-step:nth-child(3)::after { display: none; }
  .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-chip.wx { display: none; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  body.sb-open .sidebar { transform: none; }
  body.sb-collapsed { --sb-w: 260px; }
  .tb-menu { display: grid; }
  .sb-collapse { display: none; }
  .welcome .w-grid { grid-template-columns: 1fr; }
  .g3, .g4, .g5, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planner-layout, .loss-layout { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
  .plans { grid-template-columns: 1fr; }
  .gloss-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phones { grid-template-columns: 1fr; }
  .tb-clock { display: none; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .page-head .ph-actions { justify-content: flex-start; flex-shrink: 1; min-width: 0; max-width: 100%; }
}
@media (max-width: 720px) {
  .container { padding: 16px 16px 32px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .tb-search { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .tb-search span, .tb-search kbd, #btn-tour span, .tb-chip.live .lc-txt { display: none; }
  #btn-tour { width: 36px; padding: 0; }
  .crumbs a, .crumbs .sep { display: none; }
  .kpis, .g2, .g3, .g4, .g5, .g6, .flow, .gloss-grid, .compare, .kanban, .source-strip { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi .k-value { font-size: 20px; }
  .kpi .k-sub { white-space: normal; }
  .spark { display: none; }
  .span2, .span3 { grid-column: auto; }
  .page-head h1 { font-size: 21px; }
  .flow-step::after { display: none; }
  .card-h { flex-wrap: wrap; }
  .card-h .tools { max-width: 100%; overflow-x: auto; margin-left: 0; }
  .welcome { padding: 20px; }
  .welcome h1 { font-size: 23px; }
  .viewport { height: 62vh; min-height: 420px; }
  .vp-tl .vp-card:nth-child(2), .vp-tr .weather-mini, .vp-hint { display: none; }
  .vp-tl { max-width: 62%; }
  .vp-bl { flex-wrap: nowrap; overflow-x: auto; }
  .vp-bl > * { flex-shrink: 0; }
  .legend-list { grid-template-columns: auto; font-size: 11px; }
  .compass { width: 70px; height: 70px; }
  .time-ctrl { min-width: 0; }
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
  .stat-row { grid-template-columns: repeat(2, 1fr) !important; }
  .result-hero b { font-size: 30px; }
  .phone { width: 280px; height: 540px; }
  .site-card .sc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tour-card { width: calc(100vw - 32px); }
  .drawer { width: 100vw; }
  .popover { width: calc(100vw - 24px); left: 12px !important; }
}
