/* The console design system, copied into every tool like nav.js.
   <html data-brand="energy"> selects IDAN Energy; anything else is IDAN Motor / Platform. */

@font-face { font-family: 'Kumbh Sans'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(fonts/kumbh-sans.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 300 600; font-display: swap; src: url(fonts/public-sans.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(fonts/space-grotesk.woff2) format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/hanken-grotesk.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(fonts/jetbrains-mono.woff2) format('woff2'); }

:root {
  color-scheme: light dark;

  --f-head: 'Kumbh Sans', 'Public Sans', system-ui, sans-serif;
  --f-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-data: 'Kumbh Sans', 'Public Sans', system-ui, sans-serif;
  --f-label: 'Kumbh Sans', 'Public Sans', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --data-features: 'tnum';
  --h1: 700 28px/36px var(--f-head);
  --h2: 600 16px/24px var(--f-head);
  --btn-font: 600 14px/20px var(--f-head);
  --label: 700 12px/16px var(--f-label);
  --label-track: .08em;
  --badge: 700 12px/16px var(--f-label);
  --th-rule: 2px solid var(--accent);

  --bg: #FFFFFF;
  --side: #F7F5F2;
  --panel: #FFFFFF;
  --tile: #F7F5F2;
  --ink: #111921;
  --ink-2: #111921;
  --muted: #6C7278;
  --line: #CCCCCC;
  --line-2: #CCCCCC;
  --field: #848A91;
  --accent: #743DBC;
  --onaccent: #FFFFFF;
  --link: #743DBC;
  --tint: #EDE5F8;
  --track: #EEEAF3;
  --hover: #F7F5F2;
  --scrim: rgba(17, 25, 33, .5);
  --shadow: 0 4px 12px rgba(15, 23, 42, .08);

  --ok: #26A65B;   --ok-fg: #1B7A43;   --ok-bg: #E8F6EE;
  --warn: #F5A524; --warn-fg: #8A5A00; --warn-bg: #FFF4E0;
  --bad: #E5484D;  --bad-fg: #B42328;  --bad-bg: #FDECEC;
  --idle: #6C7278; --idle-fg: #111921; --idle-bg: #F7F5F2;
  --info: #743DBC; --info-fg: #743DBC; --info-bg: #EDE5F8;

  /* What the tools' own stylesheets called these before the design system. */
  --deep: var(--link);
  --cyan: var(--accent);
  --brand: var(--accent);
}

:root[data-brand="energy"] {
  --f-head: 'Space Grotesk', system-ui, sans-serif;
  --f-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-data: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --f-label: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --data-features: normal;
  --h1: 600 24px/32px var(--f-head);
  --label: 600 11px/14px var(--f-label);
  --badge: 600 11px/14px var(--f-label);
  --th-rule: 1px solid var(--line);

  --bg: #FFFFFF;
  --side: #F8FAFC;
  --panel: #F8FAFC;
  --tile: #F8FAFC;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --field: #8492A6;
  --accent: #0CBFF3;
  --onaccent: #0F172A;
  --link: #006684;
  --tint: #E7F9FE;
  --track: #F1F5F9;
  --hover: #F1F5F9;
  --scrim: rgba(15, 23, 42, .45);

  --ok: #10B981;   --ok-fg: #047857;   --ok-bg: #ECFDF5;
  --warn: #F59E0B; --warn-fg: #B45309; --warn-bg: #FFFBEB;
  --bad: #EF4444;  --bad-fg: #B91C1C;  --bad-bg: #FEF2F2;
  --idle: #334155; --idle-fg: #334155; --idle-bg: #F1F5F9;
  --info: #0CBFF3; --info-fg: #006684; --info-bg: #E7F9FE;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121117;
    --side: #18161E;
    --panel: #1B1922;
    --tile: #211E29;
    --ink: #EEEBF2;
    --ink-2: #D9D5DF;
    --muted: #A29DAA;
    --line: #34303D;
    --line-2: #423D4C;
    --field: #6E6878;
    --accent: #8F5BD6;
    --onaccent: #FFFFFF;
    --link: #B996EC;
    --tint: #2D2340;
    --track: #2A2633;
    --hover: #221F2A;
    --scrim: rgba(0, 0, 0, .6);
    --shadow: 0 4px 16px rgba(0, 0, 0, .4);

    --ok: #3DBE73;   --ok-fg: #6FD69A;   --ok-bg: #16301F;
    --warn: #F5A524; --warn-fg: #F7C46A; --warn-bg: #362A12;
    --bad: #F0646A;  --bad-fg: #F59A9E;  --bad-bg: #3A1B1E;
    --idle: #A29DAA; --idle-fg: #D9D5DF; --idle-bg: #262230;
    --info: #B996EC; --info-fg: #CDB3F2; --info-bg: #2D2340;
  }
  :root[data-brand="energy"] {
    --bg: #0B1220;
    --side: #0F172A;
    --panel: #111A2B;
    --tile: #131D30;
    --ink: #E2E8F0;
    --ink-2: #CBD5E1;
    --muted: #94A3B8;
    --line: #1E293B;
    --line-2: #334155;
    --field: #64748B;
    --accent: #0CBFF3;
    --onaccent: #0F172A;
    --link: #5CD3F6;
    --tint: #0B2C3B;
    --track: #1E293B;
    --hover: #16213A;

    --ok: #10B981;   --ok-fg: #6EE7B7;   --ok-bg: #0D2B22;
    --warn: #F59E0B; --warn-fg: #FCD34D; --warn-bg: #2E2410;
    --bad: #EF4444;  --bad-fg: #FCA5A5;  --bad-bg: #351719;
    --idle: #94A3B8; --idle-fg: #CBD5E1; --idle-bg: #1E293B;
    --info: #0CBFF3; --info-fg: #5CD3F6; --info-bg: #0B2C3B;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/20px var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
h1 { font: var(--h1); letter-spacing: -.01em; }
h2 { font: var(--h2); }
h3 { font: 600 14px/20px var(--f-head); }
p { margin: 0; }
small, .small { font-size: 13px; line-height: 18px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.hide, [hidden] { display: none !important; }
code, kbd, samp { font: 500 12px/16px var(--f-mono); }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--tint); }

.ic {
  width: 20px; height: 20px; flex: none; display: inline-block;
  fill: currentColor; vertical-align: middle;
}
.ic.s16 { width: 16px; height: 16px; }
.ic.s18 { width: 18px; height: 18px; }
.ic.s24 { width: 24px; height: 24px; }

.data, .num, .mono {
  font-family: var(--f-data); font-feature-settings: var(--data-features);
  font-weight: 500;
}
.mono { font-family: var(--f-mono); }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.eyebrow {
  font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase;
  color: var(--ink-2);
}

button, input, select, textarea { font: inherit; color: inherit; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 4px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--field);
  font: var(--btn-font); text-decoration: none; white-space: nowrap; cursor: pointer;
  flex-shrink: 0;
}
button:hover, .btn:hover { background: var(--hover); color: var(--ink); }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; background: var(--bg); }
button.primary, .btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--onaccent);
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.06); background: var(--accent); color: var(--onaccent); }
button.danger, .btn.danger { color: var(--bad-fg); border-color: var(--bad); }
button.danger:hover, .btn.danger:hover { background: var(--bad-bg); color: var(--bad-fg); }
button.danger.primary, .btn.danger.primary { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
button.ghost, .btn.ghost, button.link {
  background: transparent; border-color: transparent; color: var(--link); padding: 0 12px;
}
button.ghost:hover, .btn.ghost:hover, button.link:hover { background: var(--hover); color: var(--link); }
button.link { min-height: 0; padding: 0; font: inherit; font-weight: 600; }
button.link:hover { background: transparent; text-decoration: underline; }
button.sm, .btn.sm { min-height: 32px; padding: 0 12px; }
button.block, .btn.block { width: 100%; }
button.square, .btn.square { width: 40px; padding: 0; }
button.square.sm, .btn.square.sm { width: 32px; }

.iconbtn {
  position: relative; width: 40px; height: 40px; min-height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 4px; background: transparent; color: var(--ink-2);
}
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn .dot {
  position: absolute; top: 9px; right: 9px; width: 8px; height: 8px;
  border-radius: 9999px; background: var(--bad); border: 2px solid var(--bg);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
select, textarea {
  width: 100%; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--field); border-radius: 4px;
  background: var(--bg); color: var(--ink); font: 400 14px/20px var(--f-body);
}
textarea { padding: 10px 12px; min-height: 88px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--link); }
input[type="file"] { font: 400 14px/20px var(--f-body); }
input[type="file"]::file-selector-button {
  margin-right: 12px; min-height: 32px; padding: 0 12px; border-radius: 4px;
  border: 1px solid var(--field); background: var(--bg); color: var(--ink);
  font: var(--btn-font); cursor: pointer;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font: 500 14px/20px var(--f-body); color: var(--ink); }
.field > .hint, .hint { font: 400 13px/18px var(--f-body); color: var(--ink-2); }
.field > .err, .err { font: 400 13px/18px var(--f-body); color: var(--bad-fg); }
.field .req { color: var(--bad-fg); margin-left: 2px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.fields .span2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 10px; font: 400 14px/20px var(--f-body); cursor: pointer; }

.search { position: relative; flex: 1 1 380px; max-width: 380px; min-width: 200px; }
.search > .ic { position: absolute; left: 12px; top: 10px; color: var(--muted); pointer-events: none; }
.search > input { padding-left: 40px !important; }

.filter, select.filter {
  width: auto; min-height: 40px; padding: 0 12px; gap: 6px;
  border: 1px solid var(--field); border-radius: 4px; background: var(--bg);
  color: var(--ink); font: 500 14px/20px var(--f-body);
}
.filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.filterbar .grow { flex: 1; }
.filterbar .count-note { font: 400 13px/18px var(--f-body); color: var(--ink-2); white-space: nowrap; }

.seg { display: inline-flex; border: 1px solid var(--field); border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.seg > button, .seg > a {
  min-height: 38px; border: 0; border-radius: 0; border-left: 1px solid var(--field);
  padding: 0 14px; background: var(--bg); color: var(--ink); font: var(--btn-font);
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.seg > :first-child { border-left: 0; }
.seg > [aria-pressed="true"], .seg > [aria-current="page"] { background: var(--accent); color: var(--onaccent); }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .knob {
  width: 36px; height: 20px; border-radius: 9999px; background: var(--line-2);
  position: relative; transition: background .15s; flex: none;
}
.toggle .knob::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 9999px; background: #FFFFFF; transition: transform .15s;
}
.toggle input:checked + .knob { background: var(--accent); }
.toggle input:checked + .knob::after { transform: translateX(16px); }
.toggle input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }

.shell {
  display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh;
  background: var(--bg); color: var(--ink);
}
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side); border-right: 1px solid var(--line); min-width: 0; z-index: 20;
}
.sidebody { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.shell > .main { min-width: 0; display: flex; flex-direction: column; }

.shell.locked { grid-template-columns: minmax(0, 1fr); }
.shell.locked .side, .shell.locked .topbar { display: none; }

.ws { position: relative; padding: 16px 12px 8px; }
.wsbtn {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; min-height: 0;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); text-align: left; font: inherit;
}
.wsbtn:hover { background: var(--bg); border-color: var(--field); }
.wsmark {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line);
  background: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wsmark img, .wsmark svg { width: 22px; height: auto; display: block; }
.wsname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wsname b { font: 600 15px/20px var(--f-head); }
.wsname span { font: 400 12px/16px var(--f-body); color: var(--ink-2); }
.wsbtn > .ic { color: var(--ink-2); }

.wspop {
  position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); z-index: 30;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); padding: 12px 8px 8px; display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100vh - 96px); overflow: auto;
}
.wspop .eyebrow { padding: 4px 12px 8px; color: var(--ink); }
.wsopt {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 4px;
  text-decoration: none; color: var(--ink);
}
.wsopt:hover { background: var(--hover); color: var(--ink); }
.wsopt[aria-current="true"] { background: var(--tint); }
.wsopt .wsmark { width: 36px; height: 36px; }
.wsopt .wsname span { color: var(--ink-2); }
.wsopt > .ic { color: var(--link); }
.wsplanned { border-top: 1px solid var(--line); margin-top: 8px; padding: 10px 4px 0; }
.wsplanned > summary { cursor: pointer; padding: 4px 8px; font: 600 14px/20px var(--f-body); list-style: revert; }
.wsplanned details { margin: 4px 0 0 8px; }
.wsplanned details > summary { cursor: pointer; padding: 4px 8px; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-2); }
.wsplanned ul { list-style: none; margin: 0; padding: 0 0 4px 16px; }
.wsplanned li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; font: 400 13px/18px var(--f-body); color: var(--muted); }
.wsplanned li span { font: 500 11px/18px var(--f-mono); }

.jump { padding: 4px 12px 16px; }
.jumpbtn {
  width: 100%; min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--field); border-radius: 4px; background: var(--bg);
  color: var(--ink-2); font: 400 14px/20px var(--f-body); justify-content: flex-start;
}
.jumpbtn > span { flex: 1; text-align: left; }
kbd {
  font: 500 11px/14px var(--f-label); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px;
}

.navscroll { flex: 1; min-height: 0; overflow: auto; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 20px; }
.navsec { display: flex; flex-direction: column; gap: 2px; }
.navlabel {
  padding: 0 12px 6px; font: var(--label); letter-spacing: var(--label-track);
  text-transform: uppercase; color: var(--muted);
}
:root:not([data-brand="energy"]) .navlabel { color: var(--ink); }
.navitem {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px;
  border-radius: 4px; text-decoration: none; background: transparent; color: var(--ink-2);
  font: 500 14px/20px var(--f-body); border: 0; width: 100%; text-align: left;
}
.navitem:hover { background: var(--hover); color: var(--ink); }
.navitem > span:not(.count) { flex: 1; min-width: 0; }
.navitem > .ic { color: var(--ink-2); }
.navitem[aria-current="page"] { background: var(--tint); color: var(--ink); font-weight: 600; }
.navitem[aria-current="page"] > .ic { color: var(--link); }
:root:not([data-brand="energy"]) .navitem[aria-current="page"] { color: var(--link); }

.count {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px;
  background: var(--idle-bg); color: var(--idle-fg);
  font: 600 11px/14px var(--f-label); font-feature-settings: 'tnum'; white-space: nowrap;
}
.count.bad { background: var(--bad-bg); color: var(--bad-fg); }
.count.warn { background: var(--warn-bg); color: var(--warn-fg); }
.count.brand { background: var(--tint); color: var(--link); }

.navfoot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 10px; }
.navwho { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.navwho:hover { color: var(--ink); }
.navwho > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.navwho b { font: 600 14px/20px var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navwho small { font: 400 12px/16px var(--f-body); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navwho[aria-current="page"] b { color: var(--link); }

.avatar {
  width: 32px; height: 32px; border-radius: 4px; background: var(--tint); color: var(--link);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font: 600 13px/1 var(--f-head);
}
.avatar.lg { width: 48px; height: 48px; font-size: 18px; border-radius: 8px; }

.topbar {
  height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 32px;
  border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.menubtn { display: none; margin-left: -8px; }
.topbar .crumbs {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  font: 400 14px/20px var(--f-body); color: var(--ink-2); overflow: hidden;
}
.topbar .crumbs a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.topbar .crumbs a:hover { color: var(--ink); text-decoration: underline; }
.topbar .crumbs > .ic { color: var(--muted); width: 18px; height: 18px; }
.topbar .crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tstatus { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/16px var(--f-body); color: var(--ink-2); white-space: nowrap; }
.tstatus .ic { width: 18px; height: 18px; }
.tstatus.ok { color: var(--ok-fg); }
.tstatus.bad { color: var(--bad-fg); }
.topbar .actions { display: flex; align-items: center; gap: 4px; }

.pg {
  padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 24px;
  width: 100%; max-width: 1320px; min-width: 0;
}
.pg.full { max-width: none; }

.scrim { display: none; }

.palette {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--ink); box-shadow: var(--shadow);
  margin: 12vh auto auto;
}
.palette::backdrop { background: var(--scrim); }
.palette .search { max-width: none; margin: 12px; }
.palette ul { list-style: none; margin: 0; padding: 0 8px 8px; max-height: 50vh; overflow: auto; }
.palette li a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 4px;
  text-decoration: none; color: var(--ink);
}
.palette li a > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette li a small { color: var(--ink-2); }
.palette li a:hover, .palette li a[aria-selected="true"] { background: var(--tint); }
.palette .none { padding: 12px 20px 20px; color: var(--ink-2); }

.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.phead > div:first-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ptitle { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lede { font: 400 14px/20px var(--f-body); color: var(--ink-2); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/20px var(--f-head); text-decoration: none; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: start; }
.tile {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; justify-content: flex-start;
  min-height: 0; padding: 12px 16px; border-radius: 8px; text-align: left; min-width: 0;
  background: var(--tile); border: 1px solid var(--line); color: var(--ink); font: inherit;
}
button.tile:hover { background: var(--hover); border-color: var(--field); }
.tile[aria-pressed="true"] { background: var(--tint); border: 1.5px solid var(--accent); }
.tile > .tlabel { display: flex; align-items: center; gap: 8px; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-2); }
.tile > .tvalue { font: 600 22px/28px var(--f-data); font-feature-settings: var(--data-features); color: var(--ink); }
.tile > .tvalue small { font: 400 13px/18px var(--f-body); color: var(--muted); margin-left: 2px; }
.tile > .tnote { font: 400 12px/16px var(--f-body); color: var(--ink-2); }

.dot { width: 6px; height: 6px; border-radius: 9999px; background: currentColor; display: inline-block; flex-shrink: 0; }
.tlabel .dot { width: 8px; height: 8px; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.dot.idle { background: var(--idle); } .dot.info { background: var(--info); }
.dot.hollow { background: transparent; border: 1.5px solid var(--idle); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px;
  background: var(--idle-bg); border: 1px solid var(--idle-bg); color: var(--idle-fg);
  font: var(--badge); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; vertical-align: middle;
}
.badge > .dot { background: var(--idle); }
.badge.ok { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-fg); }
.badge.ok > .dot { background: var(--ok); }
.badge.bad { background: var(--bad-bg); border-color: var(--bad-bg); color: var(--bad-fg); }
.badge.bad > .dot { background: var(--bad); }
.badge.warn { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn-fg); }
.badge.warn > .dot { background: var(--warn); }
.badge.info { background: var(--info-bg); border-color: var(--info-bg); color: var(--info-fg); }
.badge.info > .dot { background: var(--info); }
.badge.hollow { background: transparent; border-color: var(--idle); color: var(--idle-fg); }
.badge.hollow > .dot { background: transparent; border: 1.5px solid var(--idle); }

.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs > a, .tabs > button {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none;
  text-decoration: none; color: var(--ink-2);
  font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; white-space: nowrap;
}
.tabs > a:hover, .tabs > button:hover { color: var(--ink); background: none; }
.tabs > [aria-current="page"], .tabs > [aria-selected="true"] { color: var(--link); border-bottom-color: var(--accent); }
.tabs .count { height: auto; padding: 1px 6px; font-weight: 500; }

.card, .panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  display: flex; flex-direction: column; min-width: 0;
}
.cardhead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.cardhead > div:first-child { min-width: 0; }
.cardhead p, .cardhead .sub { margin: 2px 0 0; font: 400 13px/18px var(--f-body); color: var(--ink-2); }
.cardbody { padding: 16px 20px; min-width: 0; }
.cardfoot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cardfoot .grow { flex: 1; }
.card.flat { background: var(--bg); }
.cardbody > .tablewrap:only-child { border: 0; border-radius: 0 0 8px 8px; margin: -16px -20px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.kv.one { grid-template-columns: minmax(0, 1fr); }
.kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt, .kv .k { font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-2); }
.kv dd, .kv .v { margin: 0; font: 400 14px/20px var(--f-body); color: var(--ink); overflow-wrap: anywhere; }
dl.kv { margin: 0; }

.rows { display: flex; flex-direction: column; }
.rows > div, .rows > li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.rows > :last-child { border-bottom: 0; }
.rows .k { color: var(--ink-2); }
.rows .v { font-weight: 500; text-align: right; }
ul.rows { list-style: none; margin: 0; padding: 0; }

.tablewrap { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; background: var(--bg); min-width: 0; }
.tablewrap > .scroll { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font: 400 14px/20px var(--f-body); color: var(--ink); }
.table th {
  text-align: left; padding: 10px 16px; white-space: nowrap; vertical-align: bottom;
  font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-2);
  border-bottom: var(--th-rule);
}
:root:not([data-brand="energy"]) .table th { color: var(--ink); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.table.dense td { padding: 10px 16px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; }
.table tr.link { cursor: pointer; }
.table tr.link:hover td, .table tr[aria-selected="true"] td { background: var(--hover); }
.table tr[aria-selected="true"] td { background: var(--tint); }
.table td.chev { width: 40px; padding-right: 12px; color: var(--ink-2); text-align: right; }
.table .main { font-weight: 600; color: var(--ink); }
.table .sub { display: block; font: 400 13px/18px var(--f-body); color: var(--ink-2); }
.table td a.rowlink { color: inherit; text-decoration: none; }
.table td a.rowlink:hover { text-decoration: underline; }
.tfoot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--line); font: 400 13px/18px var(--f-body); color: var(--ink-2);
}
.pager { display: flex; gap: 8px; align-items: center; }

.meter { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.bar { width: 56px; height: 6px; background: var(--track); border-radius: 2px; overflow: hidden; flex-shrink: 0; display: inline-block; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.bar.ok > span { background: var(--ok); } .bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }
.bar.wide { width: 100%; height: 8px; }

.notice {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--tile); color: var(--ink);
  font: 400 14px/20px var(--f-body);
}
.notice > .ic { margin-top: 0; flex: none; }
.notice > div { flex: 1; min-width: 0; }
.notice b, .notice strong { font-weight: 600; }
.notice.info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.notice.info > .ic { color: var(--info-fg); }
.notice.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.notice.ok > .ic { color: var(--ok-fg); }
.notice.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.notice.warn > .ic { color: var(--warn-fg); }
.notice.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.notice.bad > .ic { color: var(--bad-fg); }
.notice.brand { background: var(--tint); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.notice.brand > .ic { color: var(--link); }

.empty { padding: 32px 16px; text-align: center; color: var(--ink-2); font: 400 14px/20px var(--f-body); }
.empty > .ic { width: 32px; height: 32px; color: var(--muted); display: block; margin: 0 auto 8px; }
.empty b { display: block; color: var(--ink); font: 600 15px/22px var(--f-head); margin-bottom: 4px; }

.drop {
  display: flex; align-items: center; gap: 16px; padding: 20px 20px; border: 1px dashed var(--field);
  border-radius: 8px; background: var(--bg);
}
.drop > .ic { width: 24px; height: 24px; color: var(--link); }
.drop > div { flex: 1; min-width: 0; }
.drop b { display: block; font: 600 15px/22px var(--f-head); }
.drop.over { border-color: var(--accent); background: var(--tint); }

.steps { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0; padding: 0; }
.steps > li { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font: 500 14px/20px var(--f-body); color: var(--ink-2); }
.steps > li:last-child { flex: none; }
.steps > li::after { content: ''; flex: 1; height: 1px; background: var(--line-2); min-width: 16px; }
.steps > li:last-child::after { display: none; }
.steps .n {
  width: 28px; height: 28px; border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line-2); background: var(--bg); color: var(--ink-2);
  font: 600 13px/1 var(--f-head); flex-shrink: 0;
}
.steps > li[aria-current="step"] { color: var(--ink); font-weight: 600; }
.steps > li[aria-current="step"] .n { border-color: var(--accent); background: var(--accent); color: var(--onaccent); }
.steps > li.done .n { border-color: var(--ok); background: var(--ok); color: #FFFFFF; }
.steps > li.done .n .ic { width: 16px; height: 16px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.sidepanel { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; }
.sidepanel .cardhead { align-items: flex-start; }

dialog.dlg {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow);
}
dialog.dlg.wide { width: min(720px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: var(--scrim); }
.dlghead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.dlghead p { margin-top: 4px; color: var(--ink-2); }
.dlgbody { padding: 8px 24px 16px; display: flex; flex-direction: column; gap: 16px; }
.dlgfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlgfoot .grow { flex: 1; }

.menu { position: relative; display: inline-flex; }
.menupop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 260px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  padding: 6px; display: flex; flex-direction: column;
}
.menupop > a, .menupop > button {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 0; padding: 10px 12px;
  border: 0; border-radius: 4px; background: transparent; color: var(--ink); text-align: left;
  text-decoration: none; font: 500 14px/20px var(--f-body); white-space: normal;
}
.menupop > a:hover, .menupop > button:hover { background: var(--hover); }
.menupop > a > span, .menupop > button > span { display: flex; flex-direction: column; }
.menupop small { color: var(--ink-2); font-weight: 400; }
.menupop .danger { color: var(--bad-fg); }

button.info {
  width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0 0 0 6px; border-radius: 9999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font: italic 600 11px/1 Georgia, serif; vertical-align: middle; flex-shrink: 0;
}
button.info:hover, button.info[aria-expanded="true"] { border-color: var(--link); color: var(--link); background: transparent; }
.info-pop {
  position: fixed; margin: 0; z-index: 50; max-width: min(340px, calc(100vw - 16px));
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow);
  font: 400 13px/18px var(--f-body); white-space: pre-line; text-align: left;
}

.gate {
  width: min(440px, calc(100vw - 32px)); margin: 12vh auto 0; padding: 40px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  display: flex; flex-direction: column; gap: 16px;
}
.gate .brandline { display: flex; align-items: center; gap: 12px; font: 700 18px/24px var(--f-head); }
.gate .brandline svg, .gate .brandline img { width: 36px; height: auto; color: var(--accent); }
.gate h2 { font: 700 28px/36px var(--f-head); }
.gate p { color: var(--ink-2); }
.gate button.primary { width: 100%; }
body.locked { background: var(--side); }
body.locked .shell { background: var(--side); }
.shell.locked .pg { max-width: none; }
.gate .glyph {
  width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--warn-bg); color: var(--warn-fg);
}
.gate .glyph.bad { background: var(--bad-bg); color: var(--bad-fg); }
.gate .glyph .ic { width: 28px; height: 28px; }
.gate .lede { font: 400 16px/24px var(--f-body); color: var(--ink); }
.gate .actions { margin-top: 4px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font: 400 13px/18px var(--f-body); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.gatefoot { display: flex; justify-content: center; gap: 24px; margin: 16px auto 0; font: 400 13px/18px var(--f-body); }
.gatefoot a { color: var(--ink); text-decoration: none; }
.gatefoot a:hover { text-decoration: underline; }

.wscards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.wscard { display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.wscard > a.wshead { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.wscard > a.wshead:hover b { color: var(--link); }
.wscard ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wscard li a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; color: var(--ink-2); text-decoration: none; }
.wscard li a:hover { background: var(--hover); color: var(--ink); }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(312px, 86vw); height: 100%;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: none;
  }
  .shell.navopen .side { transform: none; box-shadow: var(--shadow); }
  .shell.navopen .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: var(--scrim); }
  .menubtn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .pg { padding: 16px 16px 40px; gap: 16px; }
  .cols, .cols.even, .cols.three, .split, .fields { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .sidepanel { position: static; max-height: none; }
  .hide-sm { display: none !important; }
  .topbar .actions > .small, .topbar .actions > .muted, .topbar .actions > .info { display: none; }
  .badge { white-space: normal; height: auto; min-height: 22px; padding-top: 2px; padding-bottom: 2px; max-width: 100%; }
  .search { max-width: none; flex-basis: 100%; }
  .tiles { display: flex; flex-wrap: wrap; gap: 8px; }
  .tile { flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 4px; }
  .tile > .tvalue { font: 500 14px/20px var(--f-body); }
  .tile > .tlabel { font: 500 14px/20px var(--f-body); letter-spacing: 0; text-transform: none; color: var(--ink); }
  .tile > .tlabel .dot, .tile > .tnote { display: none; }
  .gate { margin-top: 24px; padding: 24px; }
  .phead { align-items: flex-start; }
  .steps > li > span:not(.n) { display: none; }

  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.cards tr:last-child { border-bottom: 0; }
  .table.cards td { padding: 2px 0; border: 0; text-align: left; }
  .table.cards td.num { text-align: left; }
  .table.cards td[data-label]::before {
    content: attr(data-label); display: inline-block; min-width: 40%; margin-right: 8px;
    font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-2);
  }
  .table.cards td.chev { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}

@media print {
  .side, .topbar, .scrim { display: none !important; }
  .shell { display: block; }
  .pg { padding: 0; max-width: none; }
}
