/* eSunScope O&M portal. No build step, no third-party requests. */
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
  --bg: #ECF0F2; --surface: #FFFFFF; --surface-2: #F4F7F8; --line: #DAE2E6; --line-2: #BFCBD2;
  --ink: #12202D; --ink-2: #435564; --ink-3: #596977;
  --brand: #1F46C4; --brand-soft: #E5EBFB; --energy: #C98400;
  --ok: #0E7852; --ok-soft: #E0F2E9; --warn: #AE4B0C; --warn-soft: #FCEADB; --bad: #BF2A3C; --bad-soft: #FBE3E6; --bad-fill: #BF2A3C;
  --shadow: 0 24px 60px rgb(10 20 32 / .28);
  --r-s: 4px; --r-m: 7px; --r-l: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A121C; --surface: #101B29; --surface-2: #152336; --line: #213349; --line-2: #314860;
    --ink: #E7EEF4; --ink-2: #AEBCC9; --ink-3: #8D9EAD;
    --brand: #84A2FF; --brand-soft: #1A2A52; --energy: #F0B323;
    --ok: #3FCB95; --ok-soft: #0F2E26; --warn: #F59B5B; --warn-soft: #36210F; --bad: #FF7285; --bad-soft: #3A1620; --bad-fill: #D3374B;
    --shadow: 0 24px 60px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  --bg: #0A121C; --surface: #101B29; --surface-2: #152336; --line: #213349; --line-2: #314860;
  --ink: #E7EEF4; --ink-2: #AEBCC9; --ink-3: #8D9EAD;
  --brand: #84A2FF; --brand-soft: #1A2A52; --energy: #F0B323;
  --ok: #3FCB95; --ok-soft: #0F2E26; --warn: #F59B5B; --warn-soft: #36210F; --bad: #FF7285; --bad-soft: #3A1620; --bad-fill: #D3374B;
  --shadow: 0 24px 60px rgb(0 0 0 / .6);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--sans); font-feature-settings: "tnum" 1, "ss01" 0; -webkit-font-smoothing: antialiased; }
h1, h2, p, ul, dl, dd { margin: 0; } ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--brand); color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r-m); }
.skip:focus { top: 10px; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
.muted { color: var(--ink-3); } .strong { display: block; font-weight: 550; } .sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.nowrap { white-space: nowrap; }
.link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.i { flex: none; }
kbd { font: 500 11.5px/1 var(--sans); padding: 3px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--r-s); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.noscript { padding: 24px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.col { min-width: 0; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; min-height: 32px; }
.brand img { max-height: 32px; max-width: 100%; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.015em; }
/* Logo replaces the mark + wordmark; a logo that fails to fetch falls back to them. */
.brand-logo { display: none; }
.brand.has-logo .brand-logo { display: block; }
.brand.has-logo .brand-mark, .brand.has-logo .brand-name { display: none; }
.brand.has-logo .brand-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand.has-logo .brand-logo:not(.brand-logo-dark) { display: none; }
  :root:not([data-theme="light"]) .brand.has-logo .brand-logo-dark { display: block; }
}
:root[data-theme="dark"] .brand.has-logo .brand-logo:not(.brand-logo-dark) { display: none; }
:root[data-theme="dark"] .brand.has-logo .brand-logo-dark { display: block; }
.brand.has-logo.img-failed .brand-logo { display: none !important; }
.brand.has-logo.img-failed .brand-mark { display: revert; }
.brand.has-logo.img-failed .brand-name { display: revert; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); position: relative; flex: none;
  background-image: linear-gradient(90deg, transparent calc(50% - .5px), rgb(255 255 255 / .55) 0 calc(50% + .5px), transparent 0), linear-gradient(0deg, transparent calc(50% - .5px), rgb(255 255 255 / .55) 0 calc(50% + .5px), transparent 0); }
.brand-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--energy); box-shadow: 0 0 0 2px var(--surface); }
.brand-sm { display: none; padding: 0; }
.nav-list { display: grid; gap: 2px; }
.nav-i { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-m); color: var(--ink-2); font-weight: 500; }
.nav-i:hover { background: var(--surface-2); color: var(--ink); }
.nav-i[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.nav-n { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav-n.hot { background: var(--bad-fill); color: #fff; font-weight: 600; padding: 1px 7px; border-radius: 10px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.cmd { min-width: 0; display: flex; align-items: center; gap: 10px; flex: 0 1 420px; height: 34px; padding: 0 8px 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); color: var(--ink-3); text-align: left; }
.cmd:hover { border-color: var(--ink-3); } .cmd-t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.fresh { font-size: 12.5px; color: var(--ink-3); margin-right: 6px; font-variant-numeric: tabular-nums; } .fresh.is-bad { color: var(--bad); font-weight: 550; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--r-m); background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
#banner:empty { display: none; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 28px; font-size: 13.5px; }
.banner-warn { background: var(--warn-soft); color: var(--warn); } .banner-bad { background: var(--bad-soft); color: var(--bad); }
.banner .link { margin-left: auto; color: inherit; font-weight: 550; }
main { width: 100%; max-width: 1520px; margin: 0 auto; padding: 26px 28px 72px; outline: none; }

/* ---------- page furniture ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
h1 { font-size: 27px; line-height: 1.15; font-weight: 620; letter-spacing: -.022em; }
h2 { font-size: 15px; font-weight: 620; letter-spacing: -.005em; }
.lede { margin-top: 6px; max-width: 68ch; color: var(--ink-2); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; } .meta > span + span { position: relative; }
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--ink-2); font-weight: 500; } .crumb:hover { color: var(--brand); }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 36px; margin-bottom: 36px; align-items: start; }
.split-rev { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 12px 8px 8px; }
.skeleton { padding: 56px 0; color: var(--ink-3); }
.empty-state { padding: 64px 0; display: grid; gap: 10px; justify-items: start; max-width: 52ch; }
.empty, .empty-row { color: var(--ink-3); padding: 24px; } .empty-row { text-align: center; }
.calm { display: flex; align-items: center; gap: 12px; padding: 18px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-l); color: var(--ink-2); } .calm .i { color: var(--ok); } .calm.big { padding: 40px 24px; justify-content: center; }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0 0 34px; border-block: 1px solid var(--line); }
.kpi { padding: 16px 20px; } .kpi:first-child { padding-left: 0; } .kpi + .kpi { border-left: 1px solid var(--line); }
.kpi dt { font-size: 13px; color: var(--ink-2); }
.kpi dd { margin-top: 4px; display: flex; align-items: baseline; gap: 5px; }
.kpi-v { font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi-u { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.kpi-n { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- status mix ---------- */
.mixwrap { min-width: 280px; max-width: 420px; flex: 1 1 280px; }
.mixbar { display: block; width: 100%; height: 10px; } .mixbar rect { shape-rendering: crispEdges; }
.mix-online { fill: var(--ok); } .mix-warning { fill: var(--warn); } .mix-offline { fill: var(--line-2); }
.mixkey { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--ink-2); } .mixkey li { display: inline-flex; align-items: center; gap: 6px; }
.mixkey svg { width: 11px; height: 11px; } .k-online svg { color: var(--ok); } .k-warning svg { color: var(--warn); } .k-offline svg { color: var(--ink-3); }
.mixcell { width: 150px; } .mixcell .mixbar { height: 8px; }

/* ---------- plant array ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-3); } .legend li { display: inline-flex; align-items: center; gap: 6px; }
.array { display: grid; gap: 20px; }
.array-label { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; font-weight: 550; } .array-label .muted { font-weight: 400; font-size: 12.5px; }
.cells { display: flex; flex-wrap: wrap; gap: 5px; }
.cell, .sw { position: relative; display: block; border-radius: 4px; }
.cell { width: 24px; height: 24px; transition: transform 120ms; }
.cell:hover, .cell:focus-visible { transform: scale(1.18); z-index: 2; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.cell-online { background: var(--ok); }
.cell-online.lv1 { background: color-mix(in srgb, var(--ok) 30%, var(--surface)); }
.cell-online.lv2 { background: color-mix(in srgb, var(--ok) 52%, var(--surface)); }
.cell-online.lv3 { background: color-mix(in srgb, var(--ok) 76%, var(--surface)); }
.cell-online.lv0 { background: transparent; border: 1.5px dashed var(--ok); }
.cell-warning { background: var(--warn); }
.cell-offline { background: repeating-linear-gradient(135deg, var(--line-2) 0 1.5px, transparent 1.5px 5px); border: 1px solid var(--line-2); }
.cell:not(.lv0):not(.cell-offline)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, transparent calc(50% - .5px), rgb(255 255 255 / .38) 0 calc(50% + .5px), transparent 0), linear-gradient(0deg, transparent calc(50% - .5px), rgb(255 255 255 / .38) 0 calc(50% + .5px), transparent 0); }
.cell.has-alert::before { content: ""; position: absolute; right: -3px; top: -3px; z-index: 1; width: 9px; height: 9px; border-radius: 50%; background: var(--bad-fill); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- attention queue ---------- */
.queue { border-top: 1px solid var(--line); }
.q-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 6px; border-bottom: 1px solid var(--line); }
a.q-row:hover { background: var(--surface-2); }
.q-static { grid-template-columns: minmax(0, 1fr) auto; }
.q-ic { padding-top: 2px; } .q-ic svg { width: 15px; height: 15px; }
.q-critical .q-ic { color: var(--bad); } .q-warning .q-ic, .q-silent .q-ic { color: var(--warn); } .q-info .q-ic, .q-low .q-ic { color: var(--ink-3); }
.q-main { display: grid; gap: 2px; min-width: 0; } .q-name { font-weight: 550; overflow-wrap: anywhere; } .q-text { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.q-when { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.more { margin-top: 10px; font-size: 13px; }

/* ---------- chart ---------- */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; } .ch-axis { fill: var(--ink-3); font: 400 11px var(--sans); }
.ch-bar { fill: var(--energy); } .ch-hit { fill: transparent; }
.ch-col { outline: none; } .ch-col:hover .ch-bar, .ch-col:focus-visible .ch-bar { fill: var(--brand); }
.spark { color: var(--brand); }

/* ---------- tables ---------- */
.tablewrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.tablewrap.tall { max-height: calc(100dvh - 250px); min-height: 220px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl.rows { min-width: 900px; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl.compact th, .tbl.compact td { padding: 8px 14px; }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-size: 12.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; padding-block: 0; height: 38px; }
.tbl tbody th { font-weight: 400; } .tbl .wrap { max-width: 46ch; overflow-wrap: anywhere; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .sticky { position: sticky; left: 0; z-index: 2; background: var(--surface); } .tbl thead .sticky { z-index: 4; background: var(--surface-2); }
.th-b { display: inline-flex; align-items: center; gap: 4px; height: 38px; color: inherit; } .th-b:hover { color: var(--ink); } .th-i { width: 13px; height: 13px; }
.rows tbody tr { cursor: pointer; } .rows tbody tr:hover > * { background: var(--surface-2); }
.rows tbody tr:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 0; }
.name { font-weight: 550; } .name:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.is-low, .is-stale { color: var(--warn); } .row-flag > * { background: var(--warn-soft); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad-fill); color: #fff; font-size: 12px; font-weight: 600; }
.flag { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); font-weight: 550; } .flag svg { width: 12px; height: 12px; }
.arrow { margin: 0 6px; color: var(--ink-3); }

/* ---------- status marks ---------- */
.st { display: inline-flex; margin-right: 10px; vertical-align: -1px; } .st svg { width: 12px; height: 12px; }
.st-online { color: var(--ok); } .st-warning { color: var(--warn); } .st-offline { color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.pill-i { width: 11px; height: 11px; }
.pill-online { color: var(--ok); background: var(--ok-soft); } .pill-warning { color: var(--warn); background: var(--warn-soft); }
.pill-offline { color: var(--bad); background: var(--bad-soft); } .pill-info { color: var(--brand); background: var(--brand-soft); }

/* ---------- controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; display: block; } .search .i { position: absolute; left: 11px; top: 8px; color: var(--ink-3); pointer-events: none; }
input, select { height: 34px; padding: 0 11px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); }
.search input { width: 100%; padding-left: 34px; }
input:hover, select:hover { border-color: var(--ink-3); } input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input::placeholder { color: var(--ink-3); }
select { padding-right: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-m + 1px); overflow: hidden; background: var(--surface); }
.seg-b { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0; background: transparent; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg-b + .seg-b { border-left: 1px solid var(--line-2); } .seg-b:hover { background: var(--surface-2); color: var(--ink); }
.seg-b[aria-current="true"] { background: var(--ink); color: var(--bg); } .seg-b:focus-visible { outline-offset: -2px; }
.seg-n { font-size: 12px; opacity: .72; font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); font-weight: 550; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--ink-3); background: var(--surface-2); } .btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: transparent; }
:root[data-theme="dark"] .btn-primary { color: #08101d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #08101d; } }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

/* ---------- plant detail + settings ---------- */
.plant-head h1 { overflow-wrap: anywhere; }
.cfg { margin-bottom: 36px; } .cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; padding-top: 4px; }
.field label, .field .lbl { display: block; margin-bottom: 6px; font-weight: 550; font-size: 13px; }
.field-row { display: flex; align-items: center; gap: 8px; } .field-row input { width: 160px; } .unit { color: var(--ink-3); }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); } .val { padding-top: 6px; }
.set { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; padding: 26px 0; border-top: 1px solid var(--line); } .set:first-of-type { border-top: 0; padding-top: 4px; }
.set-l p { margin-top: 4px; font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; margin-bottom: 16px; }
.facts dt { font-size: 12.5px; color: var(--ink-3); } .facts dd { font-weight: 550; font-size: 15px; }
.actions { display: flex; gap: 10px; }
.result { margin-top: 12px; font-weight: 500; } .result.ok, .ok-t { color: var(--ok); } .result.bad, .bad-t { color: var(--bad); }
.topics { margin-top: 14px; display: grid; gap: 6px; max-width: 360px; } .topics li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.topics .ok-t, .topics .bad-t { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; } .topic { font-weight: 550; }
.set-r .hint kbd { margin: 0 2px; }

/* ---------- overlays ---------- */
.dlg { padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); width: min(640px, calc(100vw - 24px)); max-height: 78dvh; overflow: hidden; }
.dlg::backdrop { background: rgb(8 16 26 / .5); backdrop-filter: blur(2px); }
.dlg-body { padding: 20px 22px 24px; } .dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; } .keys > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); } .keys dt { color: var(--ink-2); } .keys dd { display: flex; gap: 4px; }
.palette { margin: 11vh auto auto; }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.pal-head input { flex: 1; height: 54px; border: 0; background: transparent; font-size: 16px; padding: 0; color: var(--ink); } .pal-head input:focus-visible { outline: none; }
.pal-list { max-height: 52dvh; overflow: auto; padding: 6px; }
.pal-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-m); cursor: pointer; } .pal-item .i { color: var(--ink-3); }
.pal-item[aria-selected="true"] { background: var(--brand-soft); color: var(--ink); } .pal-item[aria-selected="true"] .i { color: var(--brand); }
.pal-t { font-weight: 550; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pal-s { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.pal-empty { padding: 24px; text-align: center; color: var(--ink-3); }
.pal-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); background: var(--surface-2); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 11px 16px; border-radius: var(--r-l); background: var(--ink); color: var(--bg); font-weight: 500; box-shadow: var(--shadow); cursor: pointer; } .toast-err { background: var(--bad-fill); color: #fff; }
.tip { position: fixed; z-index: 90; pointer-events: none; max-width: 300px; padding: 6px 10px; border-radius: var(--r-m); background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.4; box-shadow: var(--shadow); } .tip[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .split, .split-rev { grid-template-columns: minmax(0, 1fr); gap: 32px; } .set { grid-template-columns: 1fr; gap: 14px; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .rail { position: fixed; inset: auto 0 0 0; z-index: 30; height: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .rail .brand { display: none; } .nav-list { display: flex; width: 100%; } .nav-list li { flex: 1; }
  .nav-i { flex-direction: column; justify-content: center; gap: 2px; height: 52px; padding: 0; font-size: 11.5px; position: relative; }
  .nav-n { display: none; } .nav-n.hot { display: block; position: absolute; top: 3px; left: 54%; margin: 0; font-size: 10.5px; padding: 0 5px; }
  .topbar { padding: 0 14px; gap: 10px; } .brand-sm { display: flex; } .brand-sm .brand-name { display: none; } .cmd { flex: 1 1 0; min-width: 0; } .topbar-r { flex: none; margin-left: 0; } .cmd kbd, .fresh { display: none; }
  main { padding: 18px 14px 40px; } .banner { padding: 10px 14px; } h1 { font-size: 24px; }
  .kpis { grid-template-columns: 1fr 1fr; } .kpi, .kpi:first-child { padding: 14px 12px 14px 0; } .kpi + .kpi { border-left: 0; } .kpi:nth-child(even) { border-left: 1px solid var(--line); padding-left: 14px; }
  .kpi-v { font-size: 25px; } .tablewrap.tall { max-height: none; } .keys { grid-template-columns: 1fr; }
  .toasts { bottom: calc(72px + env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }
  .cell { width: 26px; height: 26px; } .cells { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (prefers-contrast: more) { :root { --line: #8d9ba6; --ink-3: var(--ink-2); } }
