:root {
  color-scheme: dark;
  --bg: #101614;
  --sidebar: #121a18;
  --surface: #18221f;
  --surface-2: #1e2a26;
  --surface-3: #26332f;
  --text: #edf4f1;
  --text-2: #b4c3be;
  --muted: #81918c;
  --line: #30413c;
  --green: #36b88d;
  --green-2: #78d7b8;
  --green-soft: #193d32;
  --cyan: #46a9c6;
  --blue: #5e8fdb;
  --amber: #e1a548;
  --red: #e56863;
  --violet: #a58adb;
  --shadow: 0 12px 30px rgba(0,0,0,.2);
  --sidebar-width: 270px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6f4;
  --sidebar: #174c3e;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --surface-3: #eaf0ed;
  --text: #18231f;
  --text-2: #43564f;
  --muted: #6c7c76;
  --line: #dce5e1;
  --green: #17785f;
  --green-2: #0e624c;
  --green-soft: #dcefe8;
  --cyan: #217c98;
  --blue: #376fb7;
  --amber: #a6610b;
  --red: #b5413e;
  --violet: #7155aa;
  --shadow: 0 14px 34px rgba(28,61,50,.075);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; max-width: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "DM Sans", system-ui, sans-serif; font-size: 14px; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
a { color: inherit; }
[hidden] { display: none !important; }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(360px, 520px);
  align-items: center;
  gap: clamp(40px, 8vw, 140px);
  padding: clamp(28px, 7vw, 110px);
  overflow: auto;
  background: #111917;
  color: #eef6f2;
}
.auth-screen::before { content: ""; position: absolute; inset: 0 48% 0 0; border-right: 1px solid #2d4039; background-image: repeating-linear-gradient(0deg, transparent 0 39px, rgba(113,146,135,.08) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(113,146,135,.08) 39px 40px); pointer-events: none; }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 17px; align-self: start; }
.auth-brand img { border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { font: 700 26px/1 "Outfit", sans-serif; }
.auth-brand span { margin-top: 6px; color: #91a8a0; font-size: 12px; }
.auth-panel { position: relative; z-index: 1; width: 100%; padding: 30px; border: 1px solid #30433c; border-radius: 8px; background: #18221f; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.auth-panel .kicker { margin: 0 0 7px; color: #55c39e; font: 600 11px/1.2 "DM Mono", monospace; text-transform: uppercase; }
.auth-panel h1 { margin: 0 0 8px; font: 700 30px/1.1 "Outfit", sans-serif; }
.auth-panel > p:not(.kicker):not(.form-error) { margin: 0 0 24px; color: #9db0aa; font-size: 13px; }
.auth-panel label { display: grid; gap: 7px; margin: 13px 0; color: #aebfb9; font-size: 11px; font-weight: 700; }
.auth-panel input { height: 44px; padding: 0 12px; border: 1px solid #385047; border-radius: 6px; background: #111917; color: #eef6f2; }
.form-error { min-height: 18px; margin: 4px 0 7px; color: #ef817d; font-size: 11px; }
.text-link { display: block; margin-top: 18px; color: #96aaa3; font-size: 12px; text-align: center; text-decoration: none; }
.auth-status { position: fixed; right: 20px; bottom: 18px; color: #7f958e; font-size: 11px; }

.denied-screen { position: fixed; inset: 0; z-index: 101; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.denied-panel { width: min(520px, 100%); padding: 32px; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 8px; background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.denied-code { color: var(--red); font: 700 12px/1 "DM Mono", monospace; }
.denied-panel h1 { margin: 9px 0; font: 700 26px/1.2 "Outfit", sans-serif; }
.denied-panel p { color: var(--text-2); font-size: 13px; line-height: 1.6; }
.denied-panel > div { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; width: var(--sidebar-width); height: 100vh; height: 100dvh; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--sidebar); }
html[data-theme="dark"] .sidebar { background: linear-gradient(180deg,#121c19 0%,#101714 58%,#121b18 100%); }
html[data-theme="light"] .sidebar { border-right-color: #2b6b59; background: linear-gradient(160deg,#16483b 0%,#1b654f 55%,#123d33 100%); color: #f3fbf7; }
html[data-theme="light"] .sidebar .brand-copy span, html[data-theme="light"] .sidebar .nav-divider, html[data-theme="light"] .sidebar .user-block div span { color: #b7d6ca; }
html[data-theme="light"] .sidebar .environment { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #d9eee6; }
html[data-theme="light"] .sidebar .nav-item { color: #d9eee6; }
html[data-theme="light"] .sidebar .nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
html[data-theme="light"] .sidebar .nav-item.is-active { background: #fff; color: #13503f; box-shadow: 0 8px 20px rgba(5,35,27,.2); }
html[data-theme="light"] .sidebar .nav-item b { background: rgba(255,255,255,.13); color: inherit; }
html[data-theme="light"] .sidebar .sidebar-foot, html[data-theme="light"] .sidebar .nav-divider::after { border-color: rgba(255,255,255,.15); background-color: transparent; }
html[data-theme="light"] .sidebar .icon-btn { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; }
.brand-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 3px 7px 14px; }
.brand-row img { border-radius: 7px; }
.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font: 700 18px/1.1 "Outfit", sans-serif; }
.brand-copy span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.sidebar-close { display: none !important; margin-left: auto; }
.environment { display: flex; align-items: center; gap: 9px; margin: 2px 4px 20px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-2); font: 500 11px/1.25 "DM Mono", monospace; }
.environment i, .scope-status i, .source-health i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent); }
.simulation-environment { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: color-mix(in srgb, var(--amber) 9%, var(--surface)); color: var(--text); }
.simulation-environment i, .simulation-scope i { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent); }
.demo-environment { border-color: color-mix(in srgb, var(--blue) 42%, var(--line)); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); color: var(--text); }
.demo-environment i, .demo-scope i { background: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent); }
.primary-nav { display: grid; gap: 5px; }
.nav-item { display: grid; grid-template-columns: 31px minmax(0,1fr) auto; align-items: center; min-height: 45px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; text-align: left; text-decoration: none; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.is-active { background: var(--green-soft); color: var(--green-2); font-weight: 700; }
.nav-symbol { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: 5px; font: 700 13px/1 "DM Mono", monospace; }
.nav-item b { min-width: 19px; padding: 3px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: 9px; text-align: center; }
.nav-item b.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.nav-item b.warn { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.nav-divider { display: flex; align-items: center; gap: 8px; margin: 17px 8px 8px; color: var(--muted); font: 600 9px/1 "DM Mono", monospace; text-transform: uppercase; }
.nav-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px 4px 2px; border-top: 1px solid var(--line); }
.user-block { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.avatar { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green-2); font-size: 10px; font-weight: 700; }
.user-block div { min-width: 0; }
.user-block strong, .user-block div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-block strong { font-size: 11px; }
.user-block div span { margin-top: 3px; color: var(--muted); font-size: 9px; }

.main-column { min-width: 0; max-width: 100%; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 15px; height: 72px; padding: 0 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); }
.menu-btn { display: none !important; }
.icon-btn { display: inline-grid; width: 38px; height: 38px; flex: none; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-2); }
.icon-btn:hover { border-color: var(--green); color: var(--green-2); }
.page-identity { min-width: 180px; }
.page-identity span, .page-identity strong { display: block; }
.page-identity span { margin-bottom: 4px; color: var(--muted); font: 500 10px/1 "DM Mono", monospace; text-transform: uppercase; }
.page-identity strong { font: 600 18px/1.1 "Outfit", sans-serif; }
.search-trigger { display: flex; align-items: center; gap: 9px; width: min(390px, 30vw); height: 40px; margin-left: auto; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 12px; }
.search-trigger span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger kbd { margin-left: auto; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--muted); font: 500 9px/1.4 "DM Mono", monospace; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.data-mode-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.data-mode-toggle button { min-width: 68px; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: 700 9px/1 "DM Mono", monospace; text-transform: uppercase; }
.data-mode-toggle button[aria-pressed="true"] { background: var(--green); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--green) 22%, transparent); }
.compact-select { display: grid; grid-template-columns: auto auto; align-items: center; gap: 6px; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.compact-select span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.compact-select select { max-width: 92px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.language-select select { max-width: 92px; }
.scopebar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 9px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.simulation-scope { display: flex; align-items: center; gap: 9px; }
.simulation-scope strong { margin-inline-start: 4px; padding: 3px 7px; border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: 4px; background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--amber); font: 700 8px/1.2 "DM Mono", monospace; letter-spacing: .08em; }
.demo-scope { display: flex; align-items: center; gap: 9px; }
.demo-scope strong { margin-inline-start: 4px; padding: 3px 7px; border: 1px solid color-mix(in srgb, var(--blue) 42%, transparent); border-radius: 4px; background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue); font: 700 8px/1.2 "DM Mono", monospace; letter-spacing: .08em; }
.simulation-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--line)); border-radius: 5px; background: color-mix(in srgb, var(--amber) 10%, var(--surface)); color: var(--amber); font: 700 9px/1.2 "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.simulation-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: simulation-pulse 1.8s ease-in-out infinite; }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line)); border-radius: 5px; background: color-mix(in srgb, var(--blue) 8%, var(--surface)); color: var(--blue); font: 700 9px/1.2 "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.demo-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
@keyframes simulation-pulse { 50% { opacity: .35; transform: scale(.78); } }
.scope-status, .scope-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.scope-meta span + span { padding-left: 9px; border-left: 1px solid var(--line); }

.view-root { width: min(1660px,100%); min-width: 0; margin: 0 auto; padding: 30px clamp(22px,2.2vw,38px) 48px; }
.view-root:focus { outline: 0; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.view-head .kicker { margin: 0 0 7px; color: var(--green); font: 600 10px/1 "DM Mono", monospace; text-transform: uppercase; }
.view-head h1 { margin: 0; font: 700 30px/1.15 "Outfit", sans-serif; }
.view-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.view-actions { display: flex; align-items: center; gap: 7px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 700; text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--green) 85%, #000); }
.btn-secondary { border-color: var(--line); background: var(--surface); color: var(--text-2); }
.btn-danger { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); background: color-mix(in srgb, var(--red) 10%, var(--surface)); color: var(--red); }
.btn-wide { width: 100%; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 11px; }
.btn:disabled { cursor: not-allowed; opacity: .55; }

.technical-index { color: var(--green); font: 600 9px/1 "DM Mono",monospace; text-transform: uppercase; }
.hierarchy-bar { display: grid; grid-template-columns: minmax(190px,1.2fr) repeat(5,minmax(118px,.75fr)) minmax(140px,.8fr); align-items: stretch; gap: 1px; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); box-shadow: var(--shadow); }
.hierarchy-title, .hierarchy-bar label, .hierarchy-live { min-width: 0; min-height: 72px; padding: 12px 14px; background: var(--surface); }
.hierarchy-title { display: flex; flex-direction: column; justify-content: center; }
.hierarchy-title strong { margin-top: 7px; font: 600 14px/1 "Outfit",sans-serif; }
.hierarchy-title small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.hierarchy-bar label { display: grid; align-content: center; gap: 5px; }
.hierarchy-bar label > span { color: var(--muted); font: 600 8px/1 "DM Mono",monospace; text-transform: uppercase; }
.hierarchy-bar select { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; font-weight: 600; }
.hierarchy-live { display: grid; grid-template-columns: 8px 1fr; align-content: center; column-gap: 8px; }
.hierarchy-live i { width: 7px; height: 7px; margin-top: 2px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.hierarchy-live span { color: var(--green-2); font-size: 9px; font-weight: 700; }
.hierarchy-live b { grid-column: 2; margin-top: 3px; color: var(--muted); font: 500 8px/1.35 "DM Mono",monospace; }

.source-ribbon { display: grid; grid-template-columns: minmax(210px,1.1fr) repeat(5,minmax(142px,1fr)); gap: 1px; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); box-shadow: var(--shadow); }
.source-ribbon-head, .source-position { min-height: 110px; padding: 16px; background: var(--surface); }
.source-ribbon-head { display: flex; flex-direction: column; justify-content: center; }
.source-ribbon-head div { margin-top: 8px; }
.source-ribbon-head strong, .source-ribbon-head small { display: block; }
.source-ribbon-head strong { font: 600 15px/1 "Outfit",sans-serif; }
.source-ribbon-head small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.source-position { position: relative; border-top: 3px solid var(--green); }
.source-position.solar { border-top-color: #e3b145; }
.source-position.battery { border-top-color: var(--cyan); }
.source-position.generator { border-top-color: var(--red); }
.source-position.fuel { border-top-color: var(--violet); }
.source-position-top { display: flex; align-items: center; gap: 6px; }
.source-position-top > strong { margin-right: auto; font-size: 12px; }
.source-position-top .status-badge { min-height: 18px; padding: 2px 5px; font-size: 6px; }
.source-glyph { width: 7px; height: 18px; border-radius: 2px; background: currentColor; color: var(--green); }
.source-position.solar .source-glyph { color: #e3b145; }
.source-position.battery .source-glyph { color: var(--cyan); }
.source-position.generator .source-glyph { color: var(--red); }
.source-position.fuel .source-glyph { color: var(--violet); }
.source-position > div:last-child { margin-top: 13px; }
.source-position > div:last-child b, .source-position > div:last-child span { display: block; }
.source-position > div:last-child b { font: 700 20px/1 "Outfit",sans-serif; }
.source-position > div:last-child span { margin-top: 7px; color: var(--muted); font-size: 10px; }

.kpi-row { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 13px; margin-bottom: 14px; }
.kpi-card { min-height: 126px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.kpi-card > span { color: var(--muted); font: 600 10px/1.25 "DM Mono", monospace; text-transform: uppercase; }
.kpi-value { display: flex; align-items: baseline; gap: 6px; margin: 17px 0 9px; }
.kpi-value strong { font: 700 28px/1 "Outfit", sans-serif; }
.kpi-value small { color: var(--muted); font-size: 10px; }
.kpi-value.currency strong { direction: ltr; font-size: 20px; letter-spacing: -.02em; unicode-bidi: isolate; }
.trend { font-size: 10px; font-weight: 700; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend.neutral { color: var(--cyan); }

.dashboard-grid { display: grid; grid-template-columns: 1.4fr .9fr .9fr; gap: 14px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.panel.span-2 { grid-column: span 2; }
.panel.span-3 { grid-column: 1/-1; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font: 600 17px/1.2 "Outfit", sans-serif; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 18px; }
.panel-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.panel-tabs button { min-height: 25px; padding: 4px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.panel-tabs button.is-active { background: var(--surface); color: var(--green-2); }

.chart-wrap { position: relative; min-width: 0; min-height: 260px; overflow: hidden; }
.chart-wrap svg { display: block; width: 100%; height: 260px; overflow: hidden; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font: 8px "DM Mono", monospace; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.alt { stroke: var(--cyan); }
.chart-area { fill: color-mix(in srgb, var(--green) 12%, transparent); }
.chart-dot { fill: var(--surface); stroke: var(--green); stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.chart-legend i { display: inline-block; width: 9px; height: 3px; margin-right: 5px; vertical-align: middle; background: var(--green); }
.chart-legend i.alt { background: var(--cyan); }

.map-panel { min-height: 510px; }
.fleet-map-shell { display: grid; grid-template-columns: minmax(0,1fr) 235px; min-height: 445px; }
.site-map { position: relative; z-index: 0; min-height: 445px; background: var(--surface-2); }
.map-rail { display: flex; flex-direction: column; gap: 18px; padding: 18px; border-left: 1px solid var(--line); background: var(--surface); }
.map-rail > div:first-child strong { display: block; margin-top: 8px; font: 600 14px/1 "Outfit",sans-serif; }
.map-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 6px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.map-legend span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.map-legend i.warn { background: var(--amber); }
.map-legend i.bad { background: var(--red); }
.map-legend i.offline { border: 1px solid var(--muted); background: transparent; }
.map-selection { margin-top: auto; }
.map-selection-label { color: var(--muted); font: 600 7px/1 "DM Mono",monospace; text-transform: uppercase; }
.map-selection > strong { display: block; margin-top: 8px; font: 700 22px/1 "Outfit",sans-serif; }
.map-selection > p { margin: 7px 0 15px; color: var(--text-2); font-size: 11px; line-height: 1.45; }
.map-selection dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 12px; background: var(--line); }
.map-selection dl div { min-width: 0; padding: 7px; background: var(--surface-2); }
.map-selection dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.map-selection dd { margin: 6px 0 0; font: 600 10px/1 "DM Mono",monospace; }
.map-selection .status-badge { min-height: 18px; padding: 2px 4px; font-size: 6px; }
.map-selection .btn { width: 100%; }
.map-unavailable { display: grid; min-height: 356px; place-items: center; color: var(--muted); font-size: 10px; }
.leaflet-container { background: #17231f; font-family: "DM Sans",sans-serif; }
html[data-theme="light"] .leaflet-container { background: #e7eeeb; }
.leaflet-control-zoom a { border-color: var(--line) !important; background: var(--surface) !important; color: var(--text) !important; }
.leaflet-control-attribution { background: color-mix(in srgb,var(--surface) 86%,transparent) !important; color: var(--muted) !important; font-size: 7px !important; }
.leaflet-control-attribution a { color: var(--green-2) !important; }
.leaflet-tooltip { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow); font-size: 9px; line-height: 1.5; }
.leaflet-tooltip-top::before { border-top-color: var(--surface); }
.rms-map-marker-wrap { background: transparent; border: 0; }
.rms-map-marker { position: relative; display: grid; width: 28px; height: 28px; place-items: center; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; background: var(--green); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb,var(--green) 22%,transparent),0 5px 14px rgba(0,0,0,.32); }
.rms-map-marker.warning { background: var(--amber); box-shadow: 0 0 0 6px color-mix(in srgb,var(--amber) 22%,transparent),0 5px 14px rgba(0,0,0,.32); }
.rms-map-marker.critical { background: var(--red); box-shadow: 0 0 0 6px color-mix(in srgb,var(--red) 22%,transparent),0 5px 14px rgba(0,0,0,.32); }
.rms-map-marker.offline { border-color: #d7dfdc; background: #5f6f69; box-shadow: 0 0 0 6px rgba(95,111,105,.2),0 5px 14px rgba(0,0,0,.32); }
.rms-map-marker b { font: 700 8px/1 "DM Mono",monospace; }
.rms-map-marker i { position: absolute; right: 0; bottom: 0; width: 7px; height: 7px; border: 1px solid #fff; border-radius: 50%; background: currentColor; }
.rms-map-marker-wrap em { position: absolute; top: 31px; left: 0; padding: 3px 5px; border: 1px solid rgba(255,255,255,.18); border-radius: 3px; background: rgba(11,19,16,.84); color: #f2f7f5; font: normal 700 8px/1 "DM Mono",monospace; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
html[data-theme="light"] .rms-map-marker-wrap em { border-color: rgba(24,61,49,.18); background: rgba(255,255,255,.94); color: #153e33; }

.status-list { display: grid; gap: 2px; }
.status-row { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 50px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.status-row:last-child { border-bottom: 0; }
.status-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-row i.warn { background: var(--amber); }
.status-row i.bad { background: var(--red); }
.status-row strong, .status-row span { display: block; }
.status-row strong { font-size: 12px; }
.status-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.status-row b { color: var(--text-2); font: 500 10px/1 "DM Mono", monospace; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { height: 42px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font: 600 9px/1.2 "DM Mono", monospace; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 52px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td strong { color: var(--text); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 3px 7px; border-radius: 4px; background: var(--green-soft); color: var(--green-2); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.status-badge.warn { background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--amber); }
.status-badge.bad { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.status-badge.muted { background: var(--surface-3); color: var(--muted); }

.filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.filterbar input, .filterbar select { height: 38px; min-width: 140px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--text); font-size: 12px; }
.filterbar input { min-width: 220px; flex: 1; }

.site-hero { display: grid; grid-template-columns: minmax(0,1.4fr) repeat(3,minmax(130px,.45fr)); gap: 13px; margin-bottom: 14px; }
.site-identity, .site-stat { min-height: 128px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.site-identity { display: flex; align-items: center; gap: 13px; }
.site-mark { display: grid; width: 56px; height: 56px; flex: none; place-items: center; border: 1px solid var(--green); border-radius: 7px; background: var(--green-soft); color: var(--green-2); font: 700 12px/1 "DM Mono", monospace; }
.site-identity h2 { margin: 0 0 5px; font: 700 23px/1.1 "Outfit", sans-serif; }
.site-identity p { margin: 0; color: var(--muted); font-size: 12px; }
.site-meta { display: flex; gap: 10px; margin-top: 10px; color: var(--text-2); font-size: 9px; }
.site-stat span, .site-stat strong, .site-stat small { display: block; }
.site-stat span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.site-stat strong { margin: 17px 0 7px; font: 700 24px/1 "Outfit",sans-serif; }
.site-stat small { color: var(--muted); font-size: 11px; }
.tabbar { display: flex; gap: 3px; overflow-x: auto; margin-bottom: 14px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.tabbar button { min-height: 38px; flex: none; padding: 8px 13px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.tabbar button.is-active { background: var(--green-soft); color: var(--green-2); }

.equipment-strip { display: grid; grid-template-columns: minmax(180px,1.2fr) repeat(5,minmax(120px,1fr)); gap: 1px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.equipment-strip-title, .equipment-unit { min-height: 76px; padding: 11px; background: var(--surface); }
.equipment-strip-title { display: flex; flex-direction: column; justify-content: center; }
.equipment-strip-title strong { margin-top: 7px; font: 600 12px/1 "Outfit",sans-serif; }
.equipment-strip-title small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.equipment-unit { position: relative; border-bottom: 3px solid var(--green); }
.equipment-unit.battery { border-bottom-color: var(--cyan); }
.equipment-unit.solar { border-bottom-color: #e3b145; }
.equipment-unit.generator { border-bottom-color: var(--red); }
.equipment-unit > span { color: var(--green-2); font: 600 8px/1 "DM Mono",monospace; }
.equipment-unit strong, .equipment-unit small { display: block; }
.equipment-unit strong { margin-top: 10px; font-size: 10px; }
.equipment-unit small { margin-top: 5px; color: var(--muted); font-size: 8px; }

.power-flow { display: grid; grid-template-columns: repeat(5,minmax(100px,1fr)); align-items: center; gap: 26px; min-height: 260px; padding: 20px; }
.flow-node { position: relative; display: grid; min-height: 88px; place-items: center; padding: 12px; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 7px; background: var(--surface-2); text-align: center; }
.flow-node:not(:last-child)::after { content: ""; position: absolute; top: 50%; left: 100%; width: 27px; height: 1px; background: var(--green); }
.flow-node:not(:last-child)::before { content: "›"; position: absolute; z-index: 1; top: calc(50% - 8px); left: calc(100% + 20px); color: var(--green); }
.flow-node b { font: 700 14px/1 "Outfit",sans-serif; }
.flow-node span { margin-top: 6px; color: var(--muted); font-size: 9px; }
.flow-node.warn { border-top-color: var(--amber); }
.flow-node.bad { border-top-color: var(--red); }

.gauge-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.gauge { display: grid; place-items: center; min-height: 170px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.gauge-ring { --value: 75; display: grid; width: 100px; height: 100px; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--value)*1%), var(--surface-3) 0); }
.gauge-ring::before { content: ""; grid-area: 1/1; width: 78px; height: 78px; border-radius: 50%; background: var(--surface); }
.gauge-ring strong { z-index: 1; grid-area: 1/1; font: 700 18px/1 "Outfit",sans-serif; }
.gauge > span { color: var(--muted); font-size: 9px; text-transform: uppercase; }

.asset-grid, .source-grid, .report-grid, .admin-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }

.vendor-connection-banner { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; padding:13px 16px; border:1px solid var(--line); border-left:3px solid var(--amber,#d49a32); border-radius:8px; background:var(--surface); }
.vendor-connection-banner.is-connected { border-left-color:var(--green); }
.vendor-connection-banner.is-error { border-left-color:var(--red,#c64f4f); }
.vendor-connection-banner > div { display:grid; gap:3px; min-width:0; }
.vendor-connection-banner strong { font-size:14px; }
.vendor-connection-banner small { color:var(--muted); overflow-wrap:anywhere; }
.vendor-connector { margin-bottom:14px; overflow:hidden; }
.vendor-connector-actions { display:flex; align-items:center; gap:8px; }
.vendor-connector-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.vendor-connector-summary > div { display:grid; gap:4px; padding:16px; border-right:1px solid var(--line); }
.vendor-connector-summary > div:last-child { border-right:0; }
.vendor-connector-summary span,.vendor-connector-summary small { color:var(--muted); font-size:11px; }
.vendor-connector-summary strong { font-size:18px; }
.vendor-connector-note { margin:0; padding:13px 16px; color:var(--muted); border-bottom:1px solid var(--line); }
.vendor-coverage { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--line); border-top:1px solid var(--line); }
.vendor-coverage > div { display:grid; gap:5px; padding:14px 16px; background:var(--surface); }
.vendor-coverage span { color:var(--muted); font-size:12px; line-height:1.5; }
.jz-live-badge { display:inline-flex; align-items:center; gap:7px; min-height:30px; padding:0 11px; border:1px solid color-mix(in srgb,var(--green) 45%,var(--line)); border-radius:999px; background:var(--green-soft); color:var(--green-2); font:700 9px/1 "DM Mono",monospace; letter-spacing:.08em; }
.jz-live-badge i { width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 0 4px color-mix(in srgb,var(--green) 18%,transparent); animation:jzPulse 1.8s ease-in-out infinite; }
@keyframes jzPulse { 50% { opacity:.45; box-shadow:0 0 0 7px transparent; } }
.jz-sync-strip { display:grid; grid-template-columns:minmax(240px,1fr) minmax(320px,1.4fr); align-items:center; gap:28px; margin-bottom:10px; padding:15px 17px; border:1px solid var(--line); border-left:3px solid var(--green); border-radius:8px; background:var(--surface); }
.jz-sync-strip > div { display:grid; gap:4px; }
.jz-sync-strip small { color:var(--muted); font-size:11px; }
.jz-sync-progress { grid-template-columns:1fr auto !important; align-items:center; }
.jz-sync-progress > div { height:7px; overflow:hidden; border-radius:10px; background:var(--surface-3); }
.jz-sync-progress i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--green),#3bc78a); transition:width .35s ease; }
.jz-sync-progress strong { font:600 9px/1 "DM Mono",monospace; }
.jz-sync-progress small { grid-column:1/-1; }
.jz-alert { display:flex; gap:12px; margin-bottom:10px; padding:12px 15px; border:1px solid var(--red); border-radius:7px; background:color-mix(in srgb,var(--red) 8%,var(--surface)); color:var(--red); }
.jz-alert span { color:var(--text-2); }
.jz-kpis { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:9px; margin-bottom:10px; }
.jz-map-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(290px,.8fr); gap:10px; margin-bottom:10px; }
.jz-map-panel { position:relative; min-height:540px; overflow:hidden; }
.jz-map-badges,.jz-map-legend { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.jz-estimated-badge { border-color:color-mix(in srgb,var(--amber) 52%,var(--line)); background:color-mix(in srgb,var(--amber) 13%,var(--surface)); color:var(--amber); }
.jz-map-legend { min-height:34px; padding:8px 15px; border-top:1px solid var(--line); color:var(--muted); font:600 8px/1 "DM Mono",monospace; }
.jz-map-legend span { display:inline-flex; align-items:center; gap:6px; }
.jz-map-legend i { width:8px; height:8px; border-radius:50%; background:var(--muted); }
.jz-map-legend i.verified { background:var(--green); }
.jz-map-legend i.estimated { border:1px dashed var(--amber); background:color-mix(in srgb,var(--amber) 24%,transparent); }
.jz-map-legend i.unresolved { background:var(--surface-3); }
.jz-map { min-height:460px; border-top:1px solid var(--line); background:var(--surface-2); }
.jz-map-empty { position:absolute; z-index:500; top:50%; left:50%; display:grid; width:min(430px,calc(100% - 40px)); gap:7px; padding:18px; transform:translate(-50%,-35%); border:1px solid var(--line); border-radius:8px; background:color-mix(in srgb,var(--surface) 92%,transparent); box-shadow:var(--shadow); text-align:center; pointer-events:none; }
.jz-map-empty span { color:var(--muted); font-size:12px; line-height:1.5; }
.jz-insight-panel { overflow:hidden; }
.jz-insight-section { display:grid; gap:10px; padding:15px; border-top:1px solid var(--line); }
.jz-insight-section > span { color:var(--muted); font:700 8px/1 "DM Mono",monospace; letter-spacing:.1em; }
.jz-dist-row { display:grid; grid-template-columns:minmax(80px,1fr) minmax(80px,1.2fr) 42px; align-items:center; gap:8px; }
.jz-dist-row > span { overflow:hidden; color:var(--text-2); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.jz-dist-row > div { height:6px; overflow:hidden; border-radius:10px; background:var(--surface-3); }
.jz-dist-row i { display:block; height:100%; border-radius:inherit; background:var(--green); }
.jz-dist-row strong { font:600 9px/1 "DM Mono",monospace; text-align:right; }
.jz-coverage-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:10px; }
.jz-coverage-grid article { display:grid; gap:6px; padding:16px; border:1px solid var(--line); border-top:3px solid var(--green); border-radius:7px; background:var(--surface); }
.jz-coverage-grid article.is-limited { border-top-color:var(--amber); }
.jz-coverage-grid span { color:var(--muted); font:700 8px/1 "DM Mono",monospace; letter-spacing:.08em; text-transform:uppercase; }
.jz-coverage-grid strong { font-size:14px; }
.jz-coverage-grid small { color:var(--muted); font-size:11px; line-height:1.45; }
.jz-filterbar { flex-wrap:wrap; }
.jz-filterbar input { min-width:320px; flex:1; }
.jz-register { overflow:hidden; }
.jz-pagination { display:flex; align-items:center; gap:10px; }
.jz-pagination strong { min-width:88px; font:600 9px/1 "DM Mono",monospace; text-align:center; }
.jz-table { min-width:1540px; }
.jz-table code { font-size:9px; white-space:nowrap; }
.jz-table td:nth-child(8),.jz-table td:nth-child(9) { max-width:230px; }
.asset-tabs { display: grid; grid-template-columns: repeat(8,minmax(92px,1fr)); gap: 1px; margin-bottom: 10px; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.asset-tabs button { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 7px; min-width: 116px; min-height: 53px; padding: 8px; border: 0; background: var(--surface); color: var(--text-2); text-align: left; }
.asset-tabs button:hover { background: var(--surface-2); }
.asset-tabs button.is-active { background: var(--green-soft); color: var(--green-2); }
.asset-tab-icon { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid currentColor; border-radius: 4px; font: 600 7px/1 "DM Mono",monospace; }
.asset-tabs strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.asset-tabs b { color: var(--muted); font: 600 8px/1 "DM Mono",monospace; }
.asset-intelligence { display: grid; grid-template-columns: 1.5fr .7fr; gap: 10px; margin-bottom: 10px; }
.health-matrix { display: grid; grid-template-columns: 78px repeat(6,minmax(42px,1fr)); gap: 2px; padding: 13px; }
.matrix-axis { display: grid; min-height: 22px; place-items: center; color: var(--muted); font: 600 7px/1 "DM Mono",monospace; }
.health-matrix > strong { display: flex; align-items: center; color: var(--text-2); font: 600 8px/1 "DM Mono",monospace; }
.matrix-cell { display: grid; min-height: 31px; place-items: center; border-radius: 3px; background: color-mix(in srgb,var(--green) 24%,var(--surface-2)); color: var(--green-2); font: 600 8px/1 "DM Mono",monospace; }
.matrix-cell.warn { background: color-mix(in srgb,var(--amber) 24%,var(--surface-2)); color: var(--amber); }
.matrix-cell.bad { background: color-mix(in srgb,var(--red) 24%,var(--surface-2)); color: var(--red); }
.asset-summary { display: grid; gap: 11px; }
.asset-summary > div { display: grid; grid-template-columns: 80px 1fr 34px; align-items: center; gap: 8px; }
.asset-summary span { color: var(--muted); font-size: 8px; }
.asset-summary progress { width: 100%; height: 6px; accent-color: var(--green); }
.asset-summary progress.warn { accent-color: var(--amber); }
.asset-summary progress.bad { accent-color: var(--red); }
.asset-summary > div b { font: 600 8px/1 "DM Mono",monospace; text-align: right; }
.asset-summary dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 4px 0 0; background: var(--line); }
.asset-summary dl div { padding: 9px 7px; background: var(--surface-2); }
.asset-summary dt { color: var(--muted); font-size: 7px; }
.asset-summary dd { margin: 5px 0 0; font: 600 10px/1 "DM Mono",monospace; }
.asset-card, .source-card, .report-card, .admin-card { min-height: 176px; padding: 19px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.asset-card:hover, .report-card:hover, .admin-card:hover { border-color: color-mix(in srgb,var(--green) 55%,var(--line)); }
.asset-type { color: var(--muted); font: 600 9px/1 "DM Mono",monospace; text-transform: uppercase; }
.asset-card h3, .source-card h3, .report-card h3, .admin-card h3 { margin: 14px 0 8px; font: 600 17px/1.25 "Outfit",sans-serif; }
.asset-card p, .source-card p, .report-card p, .admin-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.asset-health { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.asset-health progress { width: 100%; height: 5px; accent-color: var(--green); }
.asset-health b { color: var(--green-2); font: 600 9px/1 "DM Mono",monospace; }
.source-card { min-height: 180px; }
.source-top { display: flex; align-items: center; justify-content: space-between; }
.source-health { display: flex; align-items: center; gap: 6px; color: var(--green-2); font-size: 8px; font-weight: 700; }
.source-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.source-details div { padding: 8px; border-radius: 5px; background: var(--surface-2); }
.source-details span, .source-details strong { display: block; }
.source-details span { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.source-details strong { margin-top: 4px; font: 600 9px/1.2 "DM Mono",monospace; }
.report-card { display: flex; flex-direction: column; }
.report-card .btn { align-self: flex-start; margin-top: auto; }

.alarm-summary { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.alarm-chip { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 13px 16px; border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.alarm-chip.critical { border-left-color: var(--red); }
.alarm-chip.high { border-left-color: var(--amber); }
.alarm-chip.medium { border-left-color: var(--cyan); }
.alarm-chip strong { font: 700 23px/1 "Outfit",sans-serif; }
.alarm-chip span { color: var(--muted); font-size: 11px; }
.alarm-operations { display: grid; grid-template-columns: minmax(0,1.65fr) 370px; gap: 14px; align-items: start; }
.alarm-queue { min-width: 0; }
.alarm-queue .data-table { min-width: 1020px; }
.alarm-queue tr.is-selected { background: var(--green-soft); }
.alarm-queue tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.alarm-inspector { position: sticky; top: 130px; overflow: visible; }
.alarm-inspector-content { padding: 20px; }
.alarm-inspector-id { display: flex; align-items: center; gap: 9px; }
.alarm-inspector-id strong { margin-right: auto; font: 700 18px/1 "DM Mono",monospace; }
.alarm-inspector h3 { margin: 20px 0 8px; font: 700 20px/1.3 "Outfit",sans-serif; }
.alarm-context { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.alarm-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 18px; background: var(--line); }
.alarm-facts div { min-width: 0; padding: 11px; background: var(--surface-2); }
.alarm-facts dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.alarm-facts dd { margin: 7px 0 0; font: 600 11px/1.3 "DM Mono",monospace; }
.operator-guidance { display: grid; gap: 1px; margin-bottom: 18px; background: var(--line); }
.operator-guidance > div { padding: 12px; background: var(--surface); }
.operator-guidance span { color: var(--green); font: 600 9px/1 "DM Mono",monospace; text-transform: uppercase; }
.operator-guidance p { margin: 7px 0 0; color: var(--text-2); font-size: 11px; line-height: 1.55; }
.alarm-timeline { display: grid; grid-template-columns: repeat(4,1fr); margin: 20px 0; }
.alarm-timeline span { position: relative; min-width: 0; padding-top: 21px; color: var(--muted); }
.alarm-timeline span::before { content: ""; position: absolute; top: 6px; right: 0; left: 0; height: 1px; background: var(--line); }
.alarm-timeline i { position: absolute; z-index: 1; top: 2px; left: 0; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 1px var(--line); }
.alarm-timeline span.is-done i { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.alarm-timeline b, .alarm-timeline small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alarm-timeline b { font-size: 9px; }
.alarm-timeline small { margin-top: 4px; font-size: 8px; }
.alarm-inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.read-only-note { margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.kanban { display: grid; grid-template-columns: repeat(4,minmax(230px,1fr)); gap: 9px; overflow-x: auto; }
.kanban-col { min-width: 230px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: var(--text-2); font-size: 10px; font-weight: 700; }
.kanban-head b { color: var(--muted); font: 500 9px/1 "DM Mono",monospace; }
.work-card { margin-bottom: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.work-card:last-child { margin-bottom: 0; }
.work-card > span { color: var(--green); font: 600 8px/1 "DM Mono",monospace; }
.work-card h3 { margin: 8px 0; font-size: 11px; line-height: 1.4; }
.work-card p { margin: 0; color: var(--muted); font-size: 8px; }
.work-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.work-foot span { color: var(--muted); font-size: 8px; }

.control-lockout { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px; border: 1px solid color-mix(in srgb,var(--amber) 44%,var(--line)); border-left: 4px solid var(--amber); border-radius: 8px; background: linear-gradient(120deg,color-mix(in srgb,var(--amber) 9%,var(--surface)),var(--surface)); box-shadow: var(--shadow); }
.control-lockout h2 { margin: 10px 0 8px; font: 700 24px/1.2 "Outfit",sans-serif; }
.control-lockout p { max-width: 800px; margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.control-safety-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); box-shadow: var(--shadow); }
.control-safety-strip > div { min-width: 0; padding: 16px 18px; background: var(--surface); }
.control-safety-strip span, .control-safety-strip strong { display: block; }
.control-safety-strip span { margin-bottom: 8px; color: var(--muted); font: 600 9px/1 "DM Mono",monospace; text-transform: uppercase; }
.control-safety-strip strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.danger-text { color: var(--red); }
.control-layout { display: grid; grid-template-columns: minmax(280px,.85fr) minmax(320px,1.15fr); gap: 14px; margin-bottom: 14px; }
.control-compose { grid-row: span 2; }
.control-feedback { grid-column: 2; }
.control-form { display: grid; gap: 18px; padding: 22px; }
.control-form label { display: grid; gap: 8px; color: var(--text-2); font-size: 11px; font-weight: 700; }
.control-form label > span { font: 600 9px/1 "DM Mono",monospace; text-transform: uppercase; }
.control-form select, .control-form input, .control-form textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: var(--surface-2); color: var(--text); font: 500 12px/1.4 "DM Sans",sans-serif; }
.control-form select, .control-form input { height: 44px; padding: 0 12px; }
.control-form textarea { padding: 12px; resize: vertical; }
.control-form select:focus, .control-form input:focus, .control-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb,var(--green) 12%,transparent); }
.control-form small { color: var(--muted); font-size: 9px; font-weight: 400; }
.control-value-input { display: grid; grid-template-columns: 1fr 54px; }
.control-value-input input { border-radius: 5px 0 0 5px; }
.control-value-input b { display: grid; place-items: center; border: 1px solid var(--line); border-left: 0; border-radius: 0 5px 5px 0; background: var(--surface-3); color: var(--muted); font: 600 10px/1 "DM Mono",monospace; }
.control-command-summary { display: grid; gap: 7px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.control-command-summary span { color: var(--green-2); font: 600 9px/1 "DM Mono",monospace; }
.control-command-summary strong { font-size: 15px; }
.control-command-summary b { font: 700 23px/1.1 "Outfit",sans-serif; }
.control-command-summary p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.interlock-list { display: grid; gap: 1px; padding: 1px 20px; background: var(--line); }
.interlock-row { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; min-height: 52px; padding: 8px 0; background: var(--surface); }
.interlock-row > i { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--muted); font: 700 12px/1 "DM Mono",monospace; font-style: normal; }
.interlock-row.pass > i { background: var(--green-soft); color: var(--green-2); }
.interlock-row.fail > i { background: color-mix(in srgb,var(--red) 12%,var(--surface)); color: var(--red); }
.interlock-row strong, .interlock-row span { display: block; }
.interlock-row strong { font-size: 11px; }
.interlock-row span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.control-actions { display: flex; justify-content: flex-end; min-height: 68px; padding: 12px 20px; }
.control-setpoints { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.control-setpoints > div { min-width: 0; padding: 16px 18px; background: var(--surface); }
.control-setpoints span, .control-setpoints strong, .control-setpoints small { display: block; }
.control-setpoints span { color: var(--muted); font-size: 9px; }
.control-setpoints strong { margin: 10px 0 6px; color: var(--green-2); font: 700 17px/1 "DM Mono",monospace; }
.control-setpoints small { color: var(--muted); font-size: 8px; }
.verification-result { display: grid; gap: 5px; margin: 16px 18px; padding: 13px; border-left: 3px solid var(--green); border-radius: 4px; background: var(--green-soft); }
.verification-result strong { font-size: 11px; }
.verification-result span { color: var(--text-2); font-size: 9px; line-height: 1.5; }
.control-audit { margin-bottom: 14px; }
.control-audit code { color: var(--green-2); font: 600 10px/1 "DM Mono",monospace; }

.truth-banner { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(260px,.6fr); align-items: center; gap: 28px; margin-bottom: 14px; padding: 24px; border: 1px solid color-mix(in srgb,var(--amber) 42%,var(--line)); border-left: 4px solid var(--amber); border-radius: 8px; background: linear-gradient(120deg,color-mix(in srgb,var(--amber) 9%,var(--surface)),var(--surface)); box-shadow: var(--shadow); }
.truth-banner h2 { margin: 10px 0 7px; font: 700 24px/1.15 "Outfit",sans-serif; }
.truth-banner p { max-width: 800px; margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.truth-banner > strong { padding: 16px; border-radius: 6px; background: color-mix(in srgb,var(--red) 10%,var(--surface-2)); color: var(--red); font: 600 13px/1.5 "DM Mono",monospace; }
.readiness-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.readiness-facts article { min-height: 116px; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.readiness-facts span, .readiness-facts strong, .readiness-facts small { display: block; }
.readiness-facts span { color: var(--muted); font: 600 9px/1 "DM Mono",monospace; text-transform: uppercase; }
.readiness-facts strong { margin: 16px 0 7px; font: 700 24px/1 "Outfit",sans-serif; }
.readiness-facts small { color: var(--muted); font-size: 9px; }
.readiness-sequence { display: grid; grid-template-columns: minmax(230px,.7fr) minmax(0,1.8fr); gap: 22px; margin-bottom: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.readiness-sequence header h2 { margin: 10px 0 7px; font: 700 21px/1.2 "Outfit",sans-serif; }
.readiness-sequence header p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.readiness-sequence ol { display: grid; grid-template-columns: repeat(5,minmax(145px,1fr)); gap: 1px; margin: 0; padding: 0; overflow-x: auto; background: var(--line); list-style: none; }
.readiness-sequence li { min-width: 145px; min-height: 150px; padding: 14px; background: var(--surface-2); }
.readiness-sequence li.is-current { box-shadow: inset 0 3px var(--green); background: var(--green-soft); }
.readiness-sequence li > b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 5px; background: var(--surface-3); color: var(--green-2); font: 700 11px/1 "DM Mono",monospace; }
.readiness-sequence li strong, .readiness-sequence li span { display: block; }
.readiness-sequence li strong { margin: 14px 0 7px; font-size: 11px; }
.readiness-sequence li span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.readiness-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 30px 0 12px; }
.readiness-section-head h2 { margin: 9px 0 0; font: 700 22px/1.2 "Outfit",sans-serif; }
.readiness-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.readiness-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.readiness-card.critical { border-top-color: var(--red); }
.readiness-card.medium { border-top-color: var(--cyan); }
.readiness-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; min-height: 94px; padding: 18px; border-bottom: 1px solid var(--line); }
.readiness-card h2 { margin: 9px 0 0; font: 700 19px/1.2 "Outfit",sans-serif; }
.readiness-card-status { display: grid; justify-items: end; gap: 9px; flex: none; }
.readiness-card-status > span:first-child { color: var(--muted); font: 600 8px/1 "DM Mono",monospace; text-transform: uppercase; }
.readiness-summary { margin: 0; padding: 15px 18px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 11px; line-height: 1.6; }
.readiness-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.readiness-card-body > div { padding: 17px 18px; background: var(--surface); }
.readiness-card-body h3 { margin: 0 0 10px; color: var(--green-2); font: 700 9px/1 "DM Mono",monospace; text-transform: uppercase; }
.readiness-card-body h3:not(:first-child) { margin-top: 18px; }
.readiness-card-body p, .readiness-card-body li { color: var(--muted); font-size: 10px; line-height: 1.55; }
.readiness-card-body p { margin: 0; }
.readiness-card-body ul { display: grid; gap: 7px; margin: 0; padding-left: 17px; }
.control-boundary { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 18px; margin-top: 14px; padding: 18px; border: 1px solid color-mix(in srgb,var(--red) 38%,var(--line)); border-radius: 8px; background: color-mix(in srgb,var(--red) 7%,var(--surface)); }
.control-boundary span { color: var(--red); font: 700 9px/1.4 "DM Mono",monospace; letter-spacing: .08em; }
.control-boundary p { margin: 0; color: var(--text-2); font-size: 11px; line-height: 1.6; }

.search-dialog { width: min(680px,calc(100vw - 24px)); max-height: min(620px,80vh); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.search-dialog::backdrop { background: rgba(5,10,9,.72); backdrop-filter: blur(3px); }
.search-box { margin: 0; }
.search-head { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 13px; border-bottom: 1px solid var(--line); }
.search-head input { width: 100%; height: 36px; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-head button { padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--muted); font: 500 9px/1 "DM Mono",monospace; }
.search-results { max-height: 480px; overflow: auto; padding: 8px; }
.search-result { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 9px; width: 100%; min-height: 53px; padding: 8px; border: 0; border-radius: 5px; background: transparent; color: var(--text); text-align: left; }
.search-result:hover { background: var(--surface-2); }
.search-result > span:first-child { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--green-2); }
.search-result strong, .search-result small { display: block; }
.search-result strong { font-size: 11px; }
.search-result small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.search-result > small { font: 500 8px/1 "DM Mono",monospace; text-transform: uppercase; }

.language-registry { margin-top: 10px; }
.language-dialog { width: min(680px,calc(100vw - 24px)); max-height: min(720px,90vh); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.language-dialog::backdrop { background: rgba(5,10,9,.72); backdrop-filter: blur(3px); }
.language-form { margin: 0; }
.language-form > header, .language-form > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.language-form > header .kicker { margin: 0 0 5px; color: var(--green); font: 600 8px/1 "DM Mono",monospace; text-transform: uppercase; }
.language-form h2 { margin: 0; font: 600 18px/1 "Outfit",sans-serif; }
.language-form > footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.language-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 16px; }
.language-fields label { display: grid; gap: 6px; color: var(--text-2); font-size: 9px; font-weight: 700; }
.language-fields .span-2 { grid-column: 1/-1; }
.language-fields input, .language-fields select, .language-fields textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: var(--surface-2); color: var(--text); font-size: 10px; }
.language-fields textarea { resize: vertical; font-family: "DM Mono",monospace; line-height: 1.5; }
.language-form .form-error { margin: 0; padding: 0 16px; }

.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 7px; width: min(360px,calc(100vw - 32px)); }
.toast { padding: 11px 13px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 6px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow); font-size: 10px; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-scrim { display: none; }
.empty-state { padding: 35px 15px; color: var(--muted); font-size: 12px; text-align: center; }

/* Reference-parity scale: readable at control-room distance without becoming sparse. */
.sidebar { overflow-y: auto; }
.topbar { height: 78px; padding-inline: 28px; }
.page-identity { min-width: 210px; }
.page-identity span { font-size: 11px; }
.page-identity strong { font-size: 20px; }
.search-trigger { height: 44px; font-size: 13px; }
.compact-select { height: 42px; padding-inline: 11px; }
.compact-select span { font-size: 10px; }
.compact-select select { font-size: 12px; }
.scopebar { min-height: 50px; padding-inline: 28px; }
.scope-status, .scope-meta { font-size: 12px; }
.view-root { padding-top: 36px; padding-bottom: 62px; }
.view-head { margin-bottom: 28px; }
.view-head .kicker, .technical-index { font-size: 11px; }
.view-head h1 { font-size: 34px; }
.view-head p { max-width: 760px; font-size: 15px; line-height: 1.6; }
.view-actions { gap: 10px; }
.btn { min-height: 44px; padding: 10px 17px; font-size: 13px; }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.hierarchy-bar, .source-ribbon, .kpi-row, .dashboard-grid { margin-bottom: 20px; }
.hierarchy-title, .hierarchy-bar label, .hierarchy-live { min-height: 82px; padding: 15px 16px; }
.hierarchy-title strong { font-size: 16px; }
.hierarchy-title small { font-size: 12px; }
.hierarchy-bar label > span { font-size: 10px; }
.hierarchy-bar select { font-size: 13px; }
.hierarchy-live span { font-size: 11px; }
.hierarchy-live b { font-size: 10px; }
.source-ribbon-head, .source-position { min-height: 126px; padding: 19px; }
.source-ribbon-head strong { font-size: 17px; }
.source-ribbon-head small, .source-position > div:last-child span { font-size: 12px; }
.source-position-top > strong { font-size: 14px; }
.source-position-top .status-badge { min-height: 22px; padding: 3px 7px; font-size: 8px; }
.source-position > div:last-child b { font-size: 24px; }
.kpi-row { gap: 16px; }
.kpi-card { min-height: 144px; padding: 22px; }
.kpi-card > span { font-size: 11px; }
.kpi-value { margin-block: 19px 11px; }
.kpi-value strong { font-size: 32px; }
.kpi-value small, .trend { font-size: 12px; }
.dashboard-grid { gap: 18px; }
.panel-head { min-height: 72px; padding: 17px 22px; }
.panel-head h2 { font-size: 19px; }
.panel-head p { font-size: 13px; line-height: 1.45; }
.panel-body { padding: 22px; }
.panel-tabs button { min-height: 30px; padding-inline: 11px; font-size: 11px; }
.chart-axis { font-size: 10px; }
.chart-legend { font-size: 12px; }
.map-rail { padding: 22px; }
.map-rail > div:first-child strong { font-size: 16px; }
.map-legend span { font-size: 12px; }
.map-selection-label { font-size: 9px; }
.map-selection > p { font-size: 13px; }
.map-selection dt { font-size: 10px; }
.map-selection dd { font-size: 12px; }
.status-row { min-height: 58px; gap: 13px; padding: 11px 5px; }
.status-row strong { font-size: 14px; }
.status-row span, .status-row b { font-size: 12px; }
.data-table { font-size: 13px; }
.data-table th { height: 48px; padding: 11px 15px; font-size: 10px; }
.data-table td { height: 60px; padding: 11px 15px; }
.data-table td small { color: var(--muted); font-size: 11px; }
.status-badge { min-height: 26px; padding: 4px 8px; font-size: 9px; }
.filterbar { gap: 12px; margin-bottom: 20px; padding: 16px; }
.filterbar input, .filterbar select { height: 43px; padding-inline: 13px; font-size: 13px; }
.site-hero { gap: 16px; margin-bottom: 20px; }
.site-identity, .site-stat { min-height: 144px; padding: 22px; }
.site-identity p, .site-stat small { font-size: 13px; }
.site-meta, .site-stat span { font-size: 11px; }
.site-stat strong { font-size: 28px; }
.tabbar { gap: 5px; margin-bottom: 20px; padding: 8px; }
.tabbar button { min-height: 43px; padding-inline: 16px; font-size: 13px; }
.equipment-strip { margin-bottom: 16px; }
.equipment-strip-title, .equipment-unit { min-height: 92px; padding: 14px; }
.equipment-strip-title strong { font-size: 14px; }
.equipment-strip-title small, .equipment-unit small { font-size: 10px; }
.equipment-unit > span { font-size: 9px; }
.equipment-unit strong { font-size: 12px; }
.flow-node { min-height: 104px; padding: 15px; }
.flow-node b { font-size: 16px; }
.flow-node span { font-size: 11px; }
.gauge { min-height: 192px; }
.gauge-ring { width: 116px; height: 116px; }
.gauge-ring::before { width: 90px; height: 90px; }
.gauge-ring strong { font-size: 20px; }
.gauge > span { font-size: 11px; }
.asset-grid, .source-grid, .report-grid, .admin-grid { gap: 14px; }
.asset-card, .source-card, .report-card, .admin-card { min-height: 198px; padding: 22px; }
.asset-type { font-size: 10px; }
.asset-card p, .source-card p, .report-card p, .admin-card p { font-size: 13px; }
.asset-health b, .source-health, .source-details strong { font-size: 11px; }
.source-details span { font-size: 9px; }
.alarm-inspector-content { padding: 24px; }
.alarm-context, .operator-guidance p { font-size: 13px; }
.alarm-facts dt, .operator-guidance span { font-size: 10px; }
.alarm-facts dd { font-size: 12px; }
.alarm-timeline b { font-size: 10px; }
.alarm-timeline small, .read-only-note { font-size: 9px; }
.kanban { gap: 14px; }
.kanban-col { padding: 14px; }
.kanban-head { font-size: 12px; }
.work-card { padding: 15px; }
.work-card h3 { font-size: 14px; }
.work-card p, .work-foot span { font-size: 11px; }

.battery-kpis { margin-bottom: 20px; }
.battery-ops-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(430px,.85fr); gap: 18px; align-items: stretch; margin-bottom: 20px; }
.battery-map-panel, .battery-detail { min-height: 690px; }
.battery-map-panel { display: flex; flex-direction: column; }
.battery-map { z-index: 0; min-height: 610px; flex: 1; background: var(--surface-2); }
.map-legend.compact { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 14px; padding: 0; border: 0; }
.battery-detail { overflow: auto; }
.battery-detail-content { padding: 25px; }
.battery-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.battery-detail-head h2 { margin: 9px 0 5px; font: 700 24px/1.2 "Outfit",sans-serif; }
.battery-detail-head p { margin: 0; color: var(--muted); font: 500 11px/1.4 "DM Mono",monospace; }
.battery-health-overview { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.battery-health-ring { display: grid; width: 148px; height: 148px; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--health)*1%),var(--surface-3) 0); }
.battery-health-ring::before { content: ""; grid-area: 1/1; width: 116px; height: 116px; border-radius: 50%; background: var(--surface); }
.battery-health-ring > div { z-index: 1; grid-area: 1/1; text-align: center; }
.battery-health-ring strong, .battery-health-ring span { display: block; }
.battery-health-ring strong { font: 700 30px/1 "Outfit",sans-serif; }
.battery-health-ring span { margin-top: 7px; color: var(--muted); font-size: 11px; }
.battery-health-metrics { display: grid; gap: 15px; }
.battery-health-metrics > div { display: grid; grid-template-columns: minmax(88px,1fr) auto; gap: 6px 12px; }
.battery-health-metrics span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.battery-health-metrics strong { font: 700 18px/1 "Outfit",sans-serif; }
.battery-health-metrics progress, .battery-health-metrics small { grid-column: 1/-1; }
.battery-health-metrics progress { width: 100%; height: 7px; accent-color: var(--green); }
.battery-health-metrics small { color: var(--muted); font-size: 11px; }
.battery-detail-section { padding: 21px 0; border-bottom: 1px solid var(--line); }
.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-label span { font: 600 16px/1.2 "Outfit",sans-serif; }
.section-label small { color: var(--muted); font-size: 10px; }
.battery-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 16px; margin: 0; }
.battery-facts dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.battery-facts dd { margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.text-action { margin-top: 14px; padding: 0; border: 0; background: transparent; color: var(--green-2); font-size: 12px; font-weight: 700; }
.service-line { display: grid; grid-template-columns: repeat(4,1fr); }
.service-line span { position: relative; min-width: 0; padding: 23px 8px 0 0; }
.service-line span::before { content: ""; position: absolute; top: 7px; right: 0; left: 0; height: 1px; background: var(--line); }
.service-line i { position: absolute; z-index: 1; top: 2px; left: 0; width: 11px; height: 11px; border: 2px solid var(--surface); border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 1px var(--line); }
.service-line .is-complete i { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.service-line .warn i { background: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.service-line .bad i { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.service-line b, .service-line small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-line b { font-size: 11px; }
.service-line small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.cell-chart { display: grid; grid-template-columns: repeat(12,1fr); align-items: end; gap: 4px; min-height: 125px; padding-top: 10px; }
.cell-chart span { display: grid; grid-template-rows: 80px auto auto; align-items: end; gap: 4px; min-width: 0; text-align: center; }
.cell-chart i { display: block; width: 100%; height: var(--cell); min-height: 3px; border-radius: 3px 3px 0 0; background: var(--green); }
.cell-chart span.warn i { background: var(--amber); }
.cell-chart b { color: var(--muted); font: 500 8px/1 "DM Mono",monospace; }
.cell-chart small { color: var(--text-2); font: 500 8px/1 "DM Mono",monospace; }
.battery-detail-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; }
.battery-inventory .data-table tbody tr.is-selected { background: var(--green-soft); }
.battery-inventory .data-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.battery-map-marker-wrap { background: transparent; border: 0; }
.battery-map-marker { position: relative; display: grid; width: 34px; height: 34px; place-items: center; border: 2px solid rgba(255,255,255,.94); border-radius: 7px; background: var(--green); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb,var(--green) 20%,transparent),0 6px 16px rgba(0,0,0,.28); }
.battery-map-marker.warning { background: var(--amber); box-shadow: 0 0 0 6px color-mix(in srgb,var(--amber) 20%,transparent),0 6px 16px rgba(0,0,0,.28); }
.battery-map-marker.critical { background: var(--red); box-shadow: 0 0 0 6px color-mix(in srgb,var(--red) 20%,transparent),0 6px 16px rgba(0,0,0,.28); }
.battery-map-marker.offline { background: #60716b; box-shadow: 0 0 0 6px rgba(96,113,107,.2),0 6px 16px rgba(0,0,0,.28); }
.battery-map-marker::before { content: ""; width: 17px; height: 8px; border: 2px solid currentColor; border-radius: 2px; }
.battery-map-marker::after { content: ""; position: absolute; top: 12px; right: 5px; width: 2px; height: 6px; background: currentColor; }
.battery-map-marker b { position: absolute; top: -10px; right: -10px; display: grid; min-width: 21px; height: 21px; place-items: center; padding: 0 3px; border: 2px solid var(--surface); border-radius: 11px; background: var(--text); color: var(--surface); font: 700 8px/1 "DM Mono",monospace; }
.battery-map-marker-wrap em { position: absolute; top: 38px; left: 0; padding: 4px 6px; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; background: rgba(11,19,16,.88); color: #f2f7f5; font: normal 700 8px/1 "DM Mono",monospace; white-space: nowrap; }
html[data-theme="light"] .battery-map-marker-wrap em { border-color: rgba(24,61,49,.18); background: rgba(255,255,255,.96); color: #153e33; }

html[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--line); }
html[dir="rtl"] .nav-item, html[dir="rtl"] .data-table th { text-align: right; }
html[dir="rtl"] .search-trigger { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .compact-select { direction: rtl; }
html[dir="rtl"] .map-rail { border-right: 1px solid var(--line); border-left: 0; }
html[dir="rtl"] .asset-tabs button { text-align: right; }

/* Arabic uses one deliberate typeface throughout instead of mixed browser fallbacks. */
html[lang^="ar"] body,
html[lang^="ar"] body *:not(code):not(kbd):not(textarea) {
  font-family: "Noto Sans Arabic", "DM Sans", system-ui, sans-serif;
}
html[lang^="ar"] body { line-height: 1.55; }
html[lang^="ar"] :is(.auth-brand strong, .auth-panel h1, .denied-panel h1, .brand-copy strong, .page-identity strong, .view-head h1, .hierarchy-title strong, .panel-head h2, .site-identity h2, .asset-card h3, .source-card h3, .report-card h3, .admin-card h3, .alarm-inspector h3, .language-form h2, .battery-detail-head h2, .section-label span) {
  line-height: 1.45;
}
html[lang^="ar"] :is(.kicker, .nav-divider, .page-identity span, .data-table th, .asset-type) {
  text-transform: none;
}

@media (max-width: 1500px) {
  .search-trigger { width: 40px; padding: 0; justify-content: center; }
  .search-trigger span:nth-child(2), .search-trigger kbd { display: none; }
  .timezone-select { display: none; }
}

@media (max-width: 1240px) {
  .kpi-row { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1.2fr .8fr; }
  .panel.span-3 { grid-column: 1/-1; }
  .asset-grid, .source-grid, .report-grid, .admin-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .timezone-select { display: none; }
  .site-hero { grid-template-columns: 1.3fr repeat(3,.55fr); }
  .source-ribbon { grid-template-columns: repeat(5,minmax(125px,1fr)); overflow-x: auto; }
  .source-ribbon-head { grid-column: 1/-1; min-height: 58px; }
  .equipment-strip { grid-template-columns: repeat(5,minmax(125px,1fr)); overflow-x: auto; }
  .equipment-strip-title { grid-column: 1/-1; min-height: 58px; }
  .alarm-operations { grid-template-columns: 1fr; }
  .alarm-inspector { position: static; }
  .battery-ops-grid { grid-template-columns: 1fr; }
  .battery-map-panel, .battery-detail { min-height: auto; }
  .battery-map { min-height: 500px; }
  .readiness-grid { grid-template-columns: 1fr; }
  .readiness-sequence { grid-template-columns: 1fr; }
  .jz-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .jz-map-grid { grid-template-columns:1fr; }
  .jz-insight-panel { display:grid; grid-template-columns:1fr 1fr; }
  .jz-insight-panel .panel-head { grid-column:1/-1; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 18px 0 40px rgba(0,0,0,.28); }
  .sidebar.is-open { transform: translateX(0); }
  html[dir="rtl"] .sidebar { right: 0; left: auto; transform: translateX(102%); }
  html[dir="rtl"] .sidebar.is-open { transform: translateX(0); }
  .sidebar-close, .menu-btn { display: inline-grid !important; }
  .mobile-scrim { position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.54); }
  .mobile-scrim.is-open { display: block; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .panel.span-2 { grid-column: 1/-1; }
  .search-trigger { width: 36px; margin-left: auto; padding: 0; justify-content: center; }
  .search-trigger span:nth-child(2), .search-trigger kbd { display: none; }
  .site-hero { grid-template-columns: repeat(3,1fr); }
  .site-identity { grid-column: 1/-1; }
  .power-flow { grid-template-columns: 1fr; gap: 22px; }
  .flow-node:not(:last-child)::after { top: 100%; left: 50%; width: 1px; height: 23px; }
  .flow-node:not(:last-child)::before { top: calc(100% + 13px); left: calc(50% - 4px); transform: rotate(90deg); }
  .hierarchy-bar { grid-template-columns: repeat(3,minmax(145px,1fr)); overflow-x: auto; }
  .hierarchy-title { grid-column: span 2; }
  .asset-intelligence { grid-template-columns: 1fr; }
  .control-layout { grid-template-columns: 1fr; }
  .control-compose, .control-feedback { grid-column: auto; grid-row: auto; }
}

@media (max-width: 720px) {
  .auth-screen { grid-template-columns: 1fr; gap: 38px; padding: 24px 18px; }
  .auth-screen::before { inset: 0; border-right: 0; }
  .auth-brand { align-self: auto; }
  .auth-panel { padding: 22px; }
  .topbar { height: 58px; padding: 0 11px; }
  .page-identity { min-width: 0; flex: 1; }
  .page-identity span { display: none; }
  .page-identity strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .compact-select { display: none; }
  .data-mode-toggle { height: 36px; }
  .data-mode-toggle button { min-width: 54px; padding-inline: 6px; font-size: 8px; }
  .language-select { display: grid; grid-template-columns: 1fr; width: 62px; padding: 0 5px; }
  .language-select span { display: none; }
  .language-select select { width: 100%; max-width: none; }
  .top-actions { gap: 5px; }
  .scopebar { padding: 7px 12px; }
  .scope-meta span:not(:first-child) { display: none; }
  .view-root { padding: 20px 15px 34px; }
  .view-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .view-head h1 { font-size: 25px; }
  .view-head p { max-width: 290px; font-size: 12px; }
  .view-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .vendor-connection-banner { align-items:flex-start; flex-direction:column; }
  .vendor-connector .panel-head { align-items:flex-start; flex-direction:column; }
  .vendor-connector-actions { width:100%; flex-wrap:wrap; }
  .vendor-connector-summary { grid-template-columns:1fr 1fr; }
  .vendor-connector-summary > div:nth-child(2) { border-right:0; }
  .vendor-connector-summary > div:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .vendor-coverage { grid-template-columns:1fr; }
  .jz-sync-strip { grid-template-columns:1fr; gap:14px; }
  .jz-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .jz-insight-panel,.jz-coverage-grid { grid-template-columns:1fr; }
  .jz-map-panel { min-height:430px; }
  .jz-map { min-height:350px; }
  .jz-register .panel-head { align-items:flex-start; flex-direction:column; }
  .jz-pagination { width:100%; justify-content:space-between; }
  .kpi-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel.span-2, .panel.span-3 { grid-column: auto; }
  .asset-grid, .source-grid, .report-grid, .admin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .alarm-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filterbar input, .filterbar select { min-width: 0; width: 100%; flex: auto; }
  .site-hero { grid-template-columns: 1fr 1fr; }
  .site-stat:last-child { grid-column: 1/-1; }
  .gauge-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gauge { min-height: 150px; }
  .data-table { min-width: 720px; }
  .hierarchy-bar { display: flex; overflow-x: auto; }
  .hierarchy-title, .hierarchy-bar label, .hierarchy-live { min-width: 145px; }
  .fleet-map-shell { grid-template-columns: 1fr; }
  .site-map { min-height: 330px; }
  .map-rail { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 0; }
  html[dir="rtl"] .map-rail { border-right: 0; border-top: 1px solid var(--line); }
  .map-selection { grid-column: 1/-1; }
  .equipment-strip, .source-ribbon { display: flex; overflow-x: auto; }
  .equipment-strip-title, .equipment-unit, .source-ribbon-head, .source-position { min-width: 160px; }
  .asset-tabs { display: flex; }
  .language-fields { grid-template-columns: 1fr; }
  .language-fields .span-2 { grid-column: auto; }
  .alarm-inspector h3 { font-size: 18px; }
  .battery-map { min-height: 360px; }
  .battery-detail-content { padding: 20px; }
  .battery-health-overview { grid-template-columns: 128px 1fr; gap: 17px; }
  .battery-health-ring { width: 122px; height: 122px; }
  .battery-health-ring::before { width: 94px; height: 94px; }
  .battery-facts { grid-template-columns: 1fr 1fr; }
  .cell-chart { grid-template-columns: repeat(8,1fr); }
  .truth-banner { grid-template-columns: 1fr; gap: 16px; }
  .readiness-facts { grid-template-columns: 1fr 1fr; }
  .readiness-card > header, .readiness-section-head { align-items: flex-start; flex-direction: column; }
  .readiness-card-status { justify-items: start; }
  .readiness-card-body { grid-template-columns: 1fr; }
  .control-boundary { grid-template-columns: 1fr; }
  .control-lockout { align-items: flex-start; flex-direction: column; padding: 20px; }
  .control-safety-strip { grid-template-columns: 1fr 1fr; }
  .control-form { padding: 17px; }
}

@media (max-width: 430px) {
  .auth-brand strong { font-size: 22px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 100px; }
  .asset-grid, .source-grid, .report-grid, .admin-grid { grid-template-columns: 1fr; }
  .site-hero { grid-template-columns: 1fr; }
  .site-stat:last-child { grid-column: auto; }
  .gauge-row { grid-template-columns: 1fr 1fr; }
  .battery-health-overview { grid-template-columns: 1fr; justify-items: center; }
  .battery-health-metrics { width: 100%; }
  .service-line { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .cell-chart { grid-template-columns: repeat(6,1fr); }
  .control-layout .panel-head { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
