:root {
  --bg: #06111f;
  --bg-deep: #030a13;
  --panel: rgba(9, 27, 44, .82);
  --panel-strong: rgba(10, 31, 50, .96);
  --panel-soft: rgba(14, 39, 59, .66);
  --line: rgba(116, 174, 208, .16);
  --line-strong: rgba(105, 209, 204, .28);
  --text: #edfaff;
  --text-soft: #a3bac9;
  --text-dim: #668092;
  --mint: #57e4ce;
  --blue: #58a8ff;
  --violet: #a98cff;
  --amber: #f6c85f;
  --orange: #ff9c5b;
  --red: #ff5f71;
  --radius: 16px;
  --shadow: 0 22px 60px rgba(0, 0, 0, .3);
  --font-display: "Bahnschrift", "DIN Alternate", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-body: "Segoe UI Variable", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(32, 126, 155, .25), transparent 31%),
    radial-gradient(circle at 88% 0%, rgba(34, 84, 161, .18), transparent 32%),
    linear-gradient(155deg, #071726 0%, #06111f 48%, #030a13 100%);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(116, 174, 208, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116, 174, 208, .025) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  pointer-events: none;
}

button, a { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
a { color: inherit; }
svg { display: block; }
h1, h2, h3, p, dl, dd { margin: 0; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 50;
  padding: 10px 14px;
  color: #06111f;
  background: var(--mint);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 14, 24, .82);
  box-shadow: 0 10px 36px rgba(0, 0, 0, .16);
  backdrop-filter: blur(18px);
}

.brand { display: flex; gap: 12px; align-items: center; min-width: 230px; }
.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--mint);
  border: 1px solid rgba(87, 228, 206, .42);
  border-radius: 11px;
  background: radial-gradient(circle at 40% 35%, rgba(87, 228, 206, .16), rgba(5, 19, 32, .9));
  box-shadow: inset 0 0 22px rgba(87, 228, 206, .08), 0 0 22px rgba(87, 228, 206, .06);
}
.brand__mark svg { width: 30px; height: 30px; }
.brand__copy { display: grid; gap: 1px; }
.brand__copy > span, .eyebrow {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.brand h1 { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; letter-spacing: .02em; }

.facility-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 11px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 27, 44, .68);
  font-size: .75rem;
  white-space: nowrap;
}
.facility-chip strong { color: var(--text); font-family: var(--font-display); }
.signal-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(87, 228, 206, .1), 0 0 12px rgba(87, 228, 206, .8);
  animation: signal 2.2s ease-in-out infinite;
}

.topbar__telemetry {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}
.topbar__telemetry div {
  display: grid;
  gap: 1px;
  min-width: 112px;
  padding: 0 17px;
  border-left: 1px solid var(--line);
}
.topbar__telemetry dt { color: var(--text-dim); font-family: var(--font-mono); font-size: .61rem; letter-spacing: .08em; }
.topbar__telemetry dd { color: var(--text); font-family: var(--font-mono); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.text-mint { color: var(--mint) !important; }

.topbar__actions { display: flex; gap: 7px; align-items: center; }
.back-link, .icon-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-soft);
  background: rgba(9, 27, 44, .7);
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.back-link:hover, .icon-button:hover { color: var(--mint); border-color: var(--line-strong); background: rgba(20, 51, 69, .75); }
.icon-button { width: 36px; padding: 0; }
.icon-button svg, .back-link svg { width: 18px; height: 18px; }
.back-link span { font-size: .72rem; }
.live-toggle { width: auto; padding: 0 10px; color: var(--mint); border-color: rgba(87, 228, 206, .28); }
.live-toggle[aria-pressed="false"] { color: var(--amber); border-color: rgba(246, 200, 95, .3); }
.live-toggle[aria-pressed="false"] .signal-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(246, 200, 95, .08); animation: none; }
.live-toggle__label { font-family: var(--font-mono); font-size: .65rem; font-weight: 700; letter-spacing: .08em; }

.dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 13px;
  width: min(100%, 1920px);
  margin: 0 auto;
  padding: 14px 20px 12px;
}

.metric-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.metric-card {
  position: relative;
  min-width: 0;
  min-height: 108px;
  padding: 13px 15px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(20, 51, 69, .7), rgba(7, 24, 39, .9)),
    var(--panel);
  box-shadow: 0 13px 30px rgba(0, 0, 0, .17), inset 0 1px 0 rgba(255, 255, 255, .02);
}
.metric-card::after {
  position: absolute;
  right: -24px;
  bottom: -38px;
  width: 112px;
  height: 112px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 44px color-mix(in srgb, var(--accent) 10%, transparent);
  content: "";
}
.metric-card__top { display: flex; align-items: center; justify-content: space-between; color: var(--text-soft); font-size: .75rem; }
.metric-icon { display: grid; width: 28px; height: 28px; place-items: center; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.metric-icon svg { width: 17px; height: 17px; stroke: currentColor; }
.metric-card__value { display: flex; gap: 7px; align-items: baseline; margin-top: 5px; }
.metric-card__value strong { color: var(--text); font-family: var(--font-display); font-size: clamp(1.7rem, 2.25vw, 2.25rem); font-weight: 650; letter-spacing: -.035em; line-height: 1; }
.metric-card__value small { color: var(--text-dim); font-family: var(--font-mono); font-size: .65rem; }
.metric-card__foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 9px; color: var(--text-dim); font-size: .66rem; }
.metric-card__foot span:first-child { display: flex; gap: 6px; align-items: center; color: color-mix(in srgb, var(--accent) 70%, var(--text-soft)); }
.metric-card__foot i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(11, 32, 51, .85), rgba(5, 19, 32, .91)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .02);
}
.panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(87, 228, 206, .22), transparent);
  content: "";
  pointer-events: none;
}
.panel__head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(116, 174, 208, .1);
}
.panel__head > div:first-child { display: grid; gap: 2px; min-width: 0; }
.panel__head h2 { font-family: var(--font-display); font-size: 1rem; font-weight: 650; letter-spacing: .015em; }
.panel__meta, .panel__state { display: flex; gap: 7px; align-items: center; color: var(--text-dim); font-family: var(--font-mono); font-size: .65rem; white-space: nowrap; }
.panel__meta strong { color: var(--text-soft); }
.panel__state { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; }

.process-panel { grid-column: span 8; min-height: 330px; }
.process-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  padding: 16px 15px 11px;
}
.process-flow::before {
  position: absolute;
  top: 43px;
  right: 8%;
  left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(87, 228, 206, .22) 8%, rgba(87, 228, 206, .22) 92%, transparent);
  content: "";
}
.process-node {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 128px;
  padding: 9px 9px 8px;
  overflow: hidden;
  border: 1px solid rgba(116, 174, 208, .14);
  border-radius: 11px;
  color: var(--text-soft);
  background: linear-gradient(180deg, rgba(17, 46, 64, .72), rgba(7, 24, 39, .82));
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.process-node:hover { z-index: 2; border-color: rgba(87, 228, 206, .35); transform: translateY(-2px); }
.process-node.is-selected { border-color: rgba(87, 228, 206, .64); background: linear-gradient(180deg, rgba(20, 61, 72, .82), rgba(7, 28, 42, .92)); box-shadow: 0 0 0 1px rgba(87, 228, 206, .09), 0 0 26px rgba(87, 228, 206, .09); }
.process-node--warning.is-selected { border-color: rgba(246, 200, 95, .7); box-shadow: 0 0 0 1px rgba(246, 200, 95, .1), 0 0 28px rgba(246, 200, 95, .1); }
.process-node--delay.is-selected { border-color: rgba(255, 156, 91, .72); box-shadow: 0 0 0 1px rgba(255, 156, 91, .1), 0 0 28px rgba(255, 156, 91, .1); }
.process-node__index { color: rgba(87, 228, 206, .9); font-family: var(--font-mono); font-size: .64rem; }
.process-node__status { display: inline-flex; gap: 5px; align-items: center; width: max-content; color: var(--text-dim); font-size: .62rem; white-space: nowrap; }
.process-node__status i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 7px var(--mint); }
.status-warning { color: var(--amber); }
.status-warning i { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.status-delay { color: var(--orange); }
.status-delay i { background: var(--orange); box-shadow: 0 0 7px var(--orange); }
.process-node strong { overflow: hidden; color: var(--text); font-family: var(--font-display); font-size: .78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.process-node__value { color: var(--text-soft); font-family: var(--font-mono); font-size: .76rem; white-space: nowrap; }
.process-node__value small { color: var(--text-dim); font-size: .56rem; }
.process-node--warning .process-node__value { color: var(--amber); }
.process-node--delay .process-node__value { color: var(--orange); }
.micro-bars { display: flex; gap: 2px; align-items: end; height: 17px; margin-top: 2px; opacity: .7; }
.micro-bars i { flex: 1; min-width: 1px; border-radius: 1px 1px 0 0; background: currentColor; color: rgba(87, 228, 206, .45); }
.micro-bars i:nth-child(1) { height: 35%; }
.micro-bars i:nth-child(2) { height: 58%; }
.micro-bars i:nth-child(3) { height: 43%; }
.micro-bars i:nth-child(4) { height: 74%; }
.micro-bars i:nth-child(5) { height: 60%; }
.micro-bars i:nth-child(6) { height: 88%; }
.micro-bars i:nth-child(7) { height: 68%; }
.micro-bars i:nth-child(8) { height: 94%; }
.process-node--warning .micro-bars { color: rgba(246, 200, 95, .56); }
.process-node--delay .micro-bars { color: rgba(255, 156, 91, .56); }

.node-inspector {
  display: grid;
  grid-template-columns: minmax(175px, .75fr) minmax(0, 1.7fr);
  gap: 18px;
  margin: 0 15px 13px;
  padding: 12px 14px;
  border: 1px solid rgba(116, 174, 208, .12);
  border-radius: 11px;
  background: rgba(4, 16, 28, .5);
}
.node-inspector__title { display: grid; align-content: center; gap: 3px; }
.node-inspector__title h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 650; }
.status-pill { display: inline-flex; width: max-content; margin-top: 3px; padding: 3px 7px; border-radius: 999px; font-family: var(--font-mono); font-size: .58rem; }
.status-pill--normal { color: var(--mint); background: rgba(87, 228, 206, .09); }
.status-pill--warning { color: var(--amber); background: rgba(246, 200, 95, .1); }
.status-pill--delay { color: var(--orange); background: rgba(255, 156, 91, .1); }
.node-inspector__readings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; align-content: center; }
.node-inspector__readings div { display: flex; gap: 10px; justify-content: space-between; min-width: 0; padding-bottom: 4px; border-bottom: 1px solid rgba(116, 174, 208, .09); }
.node-inspector__readings dt { color: var(--text-dim); font-size: .64rem; white-space: nowrap; }
.node-inspector__readings dd { overflow: hidden; color: var(--text-soft); font-family: var(--font-mono); font-size: .64rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.alarm-panel { grid-column: span 4; display: flex; flex-direction: column; min-height: 330px; }
.count-badge { display: grid; width: 28px; height: 24px; place-items: center; color: var(--amber); border: 1px solid rgba(246, 200, 95, .28); border-radius: 6px; background: rgba(246, 200, 95, .07); font-family: var(--font-mono); font-size: .68rem; }
.alarm-list { display: grid; gap: 5px; padding: 9px 10px 4px; }
.alarm-item {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 8px 10px 8px 13px;
  border: 1px solid rgba(116, 174, 208, .12);
  border-radius: 9px;
  background: rgba(8, 25, 40, .58);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.alarm-item::before { position: absolute; top: 9px; bottom: 9px; left: 0; width: 2px; border-radius: 2px; background: var(--text-dim); content: ""; }
.alarm-item--warning::before { background: var(--amber); box-shadow: 0 0 10px rgba(246, 200, 95, .6); }
.alarm-item--notice::before { background: var(--orange); }
.alarm-item--info::before { background: var(--blue); }
.alarm-item:hover, .alarm-item.is-selected { border-color: rgba(87, 228, 206, .28); background: rgba(17, 47, 65, .65); }
.alarm-item__top { display: flex; justify-content: space-between; color: var(--text-dim); font-family: var(--font-mono); font-size: .54rem; letter-spacing: .06em; }
.alarm-item--warning .alarm-item__top span { color: var(--amber); }
.alarm-item--notice .alarm-item__top span { color: var(--orange); }
.alarm-item--info .alarm-item__top span { color: var(--blue); }
.alarm-item strong { overflow: hidden; color: var(--text-soft); font-size: .7rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.alarm-item__reading { color: var(--text-soft); font-family: var(--font-mono); font-size: .63rem; }
.alarm-item__reading i { margin-left: 5px; color: var(--text-dim); font-style: normal; font-size: .56rem; }
.alarm-item__state { position: absolute; right: 9px; bottom: 8px; color: var(--text-dim); font-size: .55rem; }
.alarm-detail { display: grid; gap: 5px; margin: 5px 10px 0; padding: 9px 11px; border: 1px solid rgba(246, 200, 95, .2); border-radius: 9px; background: linear-gradient(120deg, rgba(246, 200, 95, .08), rgba(8, 25, 40, .6)); }
.alarm-detail__head { display: flex; align-items: center; justify-content: space-between; color: var(--text-dim); font-family: var(--font-mono); font-size: .55rem; }
.severity { padding: 2px 6px; border-radius: 4px; font-weight: 700; letter-spacing: .06em; }
.severity--warning { color: var(--amber); background: rgba(246, 200, 95, .1); }
.severity--notice { color: var(--orange); background: rgba(255, 156, 91, .1); }
.severity--info { color: var(--blue); background: rgba(88, 168, 255, .1); }
.alarm-detail h3 { overflow: hidden; color: var(--text); font-family: var(--font-display); font-size: .78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.alarm-detail p { color: var(--text-soft); font-size: .64rem; line-height: 1.45; }
.ack-button { justify-self: start; margin-top: 1px; padding: 4px 9px; border: 1px solid rgba(87, 228, 206, .25); border-radius: 6px; color: var(--mint); background: rgba(87, 228, 206, .06); font-size: .6rem; cursor: pointer; }
.ack-button:hover { background: rgba(87, 228, 206, .12); }
.ack-button:disabled { color: var(--text-dim); border-color: var(--line); background: transparent; cursor: default; }
.alarm-panel__foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: auto; padding: 7px 12px; border-top: 1px solid rgba(116, 174, 208, .1); color: var(--text-dim); font-family: var(--font-mono); font-size: .54rem; }
.alarm-panel__foot > span:first-child { display: flex; gap: 6px; align-items: center; }
.alarm-panel__foot .signal-dot { width: 5px; height: 5px; }
.alarm-panel__foot strong { color: var(--text-soft); }

.trend-panel { grid-column: span 8; min-height: 310px; }
.range-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(3, 12, 22, .35); }
.range-switch button { min-width: 42px; padding: 4px 7px; border: 0; border-radius: 5px; color: var(--text-dim); background: transparent; font-family: var(--font-mono); font-size: .59rem; cursor: pointer; }
.range-switch button:hover { color: var(--text); }
.range-switch button.is-active { color: var(--mint); background: rgba(87, 228, 206, .1); box-shadow: inset 0 0 0 1px rgba(87, 228, 206, .13); }
.trend-summary { display: flex; gap: 24px; align-items: center; padding: 8px 16px 2px; }
.trend-summary > div:not(.trend-legend) { display: grid; gap: 1px; }
.trend-summary span { color: var(--text-dim); font-size: .62rem; }
.trend-summary strong { color: var(--text); font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; }
.trend-summary strong small { color: var(--text-dim); font-family: var(--font-mono); font-size: .56rem; }
.trend-legend { display: flex; gap: 14px; margin-left: auto; color: var(--text-dim); font-size: .59rem; }
.legend-line { display: inline-flex; gap: 5px; align-items: center; }
.legend-line::before { width: 15px; height: 2px; border-radius: 2px; background: currentColor; content: ""; }
.legend-line--mint { color: var(--mint); }
.legend-line--blue { color: var(--blue); }
.chart-wrap { padding: 0 11px 4px 7px; }
#trend-chart { width: 100%; height: 214px; overflow: visible; }
.chart-grid line { stroke: rgba(116, 174, 208, .11); stroke-dasharray: 3 5; }
.chart-labels text { fill: var(--text-dim); font-family: var(--font-mono); font-size: 10px; }
.trend-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trend-line--mint { stroke: var(--mint); }
.trend-line--blue { stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: .75; }
.threshold-line { stroke: rgba(246, 200, 95, .5); stroke-width: 1; stroke-dasharray: 5 5; }
.threshold-label { fill: var(--amber); font-family: var(--font-mono); font-size: 10px; }
.trend-focus line { stroke: rgba(237, 250, 255, .26); stroke-width: 1; stroke-dasharray: 3 4; }
.trend-focus circle:first-of-type { fill: var(--mint); filter: drop-shadow(0 0 7px var(--mint)); }
.trend-focus circle:last-of-type { fill: none; stroke: rgba(87, 228, 206, .25); stroke-width: 1; }

.resource-panel { grid-column: span 4; min-height: 310px; }
.resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 13px 8px; }
.resource-gauge { display: grid; justify-items: center; gap: 3px; min-width: 0; padding: 8px 5px; border: 1px solid rgba(116, 174, 208, .1); border-radius: 10px; background: rgba(8, 25, 40, .45); }
.gauge-ring {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--gauge) calc(var(--value) * 1%), rgba(69, 105, 126, .16) 0);
  box-shadow: 0 0 20px color-mix(in srgb, var(--gauge) 8%, transparent);
}
.gauge-ring::before { grid-area: 1 / 1; width: 50px; height: 50px; border-radius: 50%; background: #0a1d2e; content: ""; }
.gauge-ring span { z-index: 1; grid-area: 1 / 1; color: var(--text); font-family: var(--font-display); font-size: .98rem; font-weight: 600; }
.gauge-ring small { color: var(--text-dim); font-family: var(--font-mono); font-size: .51rem; }
.resource-gauge > strong { color: var(--text-soft); font-size: .66rem; font-weight: 600; }
.resource-gauge > small { color: var(--text-dim); font-family: var(--font-mono); font-size: .54rem; }
.environment-strip { display: flex; gap: 7px; justify-content: space-between; margin: 4px 13px 11px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(4, 16, 28, .42); }
.environment-strip span { display: flex; gap: 5px; align-items: center; color: var(--text-soft); font-family: var(--font-mono); font-size: .54rem; white-space: nowrap; }
.env-dot { width: 5px; height: 5px; border-radius: 50%; }
.env-dot--mint { background: var(--mint); box-shadow: 0 0 7px var(--mint); }
.env-dot--blue { background: var(--blue); box-shadow: 0 0 7px var(--blue); }
.env-dot--amber { background: var(--amber); box-shadow: 0 0 7px var(--amber); }

.batch-panel { grid-column: span 7; min-height: 310px; }
.batch-table { padding: 8px 14px 12px; }
.batch-row { display: grid; grid-template-columns: minmax(150px, 1.35fr) minmax(85px, .8fr) minmax(145px, 1.2fr) minmax(64px, .55fr) minmax(66px, .6fr); gap: 12px; align-items: center; min-height: 60px; border-bottom: 1px solid rgba(116, 174, 208, .1); color: var(--text-soft); font-size: .67rem; }
.batch-row:last-child { border-bottom: 0; }
.batch-row--head { min-height: 35px; color: var(--text-dim); font-family: var(--font-mono); font-size: .56rem; letter-spacing: .04em; }
.batch-row strong { color: var(--text); font-family: var(--font-mono); font-size: .69rem; font-weight: 600; }
.batch-row > span:nth-child(3) { display: flex; gap: 8px; align-items: center; }
.progress { flex: 1; height: 4px; overflow: hidden; border-radius: 2px; background: rgba(69, 105, 126, .22); }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--mint)); box-shadow: 0 0 8px rgba(87, 228, 206, .38); }
.batch-row b { min-width: 27px; color: var(--text-soft); font-family: var(--font-mono); font-size: .6rem; font-weight: 500; text-align: right; }
.batch-flag { display: inline-flex; width: max-content; padding: 3px 6px; border-radius: 4px; font-size: .54rem; font-style: normal; }
.batch-flag--normal { color: var(--mint); background: rgba(87, 228, 206, .08); }
.batch-flag--warning { color: var(--amber); background: rgba(246, 200, 95, .09); }

.health-panel { grid-column: span 5; min-height: 310px; }
.health-score { color: var(--mint); font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1; }
.health-score small { margin-left: 2px; color: var(--text-dim); font-family: var(--font-mono); font-size: .55rem; }
.health-list { display: grid; gap: 13px; padding: 14px 16px; }
.health-item { display: grid; gap: 5px; }
.health-item > div:first-child { display: flex; align-items: baseline; justify-content: space-between; }
.health-item span, .health-item small { color: var(--text-dim); font-size: .61rem; }
.health-item strong { color: var(--text-soft); font-family: var(--font-mono); font-size: .64rem; font-weight: 500; }
.health-bar { height: 4px; overflow: hidden; border-radius: 2px; background: rgba(69, 105, 126, .18); }
.health-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(87, 228, 206, .35), var(--mint)); box-shadow: 0 0 8px rgba(87, 228, 206, .22); }
.health-bar--amber i { background: linear-gradient(90deg, rgba(246, 200, 95, .3), var(--amber)); }
.health-bar--blue i { background: linear-gradient(90deg, rgba(88, 168, 255, .3), var(--blue)); }

.dashboard-footer {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 3px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: .55rem;
  letter-spacing: .02em;
}
.dashboard-footer > div { display: flex; gap: 17px; align-items: center; flex-wrap: wrap; }
.dashboard-footer > div:first-child span { display: flex; gap: 6px; align-items: center; }
.dashboard-footer strong { color: var(--text-soft); font-weight: 500; }
.dashboard-footer .signal-dot { width: 5px; height: 5px; }
.simulation-tag { padding: 3px 7px; border: 1px solid rgba(246, 200, 95, .25); border-radius: 4px; color: var(--amber); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  padding: 10px 13px;
  border: 1px solid rgba(87, 228, 206, .3);
  border-radius: 9px;
  color: var(--text);
  background: rgba(7, 27, 42, .96);
  box-shadow: 0 15px 45px rgba(0, 0, 0, .35);
  font-size: .72rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

@keyframes signal { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.8); } }
@keyframes dash { to { stroke-dashoffset: -48; } }

@media (max-width: 1320px) {
  .topbar { grid-template-columns: auto auto 1fr auto; gap: 12px; padding-inline: 16px; }
  .topbar__telemetry div { min-width: 95px; padding-inline: 11px; }
  .brand { min-width: 200px; }
  .brand__copy > span { font-size: .58rem; }
  .dashboard { padding-inline: 15px; gap: 11px; }
  .process-node { padding-inline: 7px; }
  .process-node strong { font-size: .72rem; }
  .process-node__value { font-size: .69rem; }
}

@media (max-width: 1100px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar__telemetry { display: none; }
  .facility-chip { justify-self: start; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-card:nth-child(4), .metric-card:nth-child(5) { min-height: 96px; }
  .process-panel, .alarm-panel, .trend-panel, .resource-panel { grid-column: span 12; }
  .batch-panel, .health-panel { grid-column: span 6; }
  .process-flow { overflow-x: auto; grid-template-columns: repeat(7, minmax(112px, 1fr)); padding-bottom: 14px; }
  .node-inspector { grid-template-columns: minmax(180px, .7fr) minmax(0, 1.8fr); }
  #trend-chart { height: 235px; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { position: relative; display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 13px; }
  .brand { flex: 1 1 210px; min-width: 0; }
  .brand__mark { width: 38px; height: 38px; }
  .brand h1 { font-size: 1.05rem; }
  .brand__copy > span { font-size: .52rem; letter-spacing: .08em; }
  .facility-chip { order: 2; padding: 6px 9px; font-size: .67rem; }
  .topbar__actions { order: 3; margin-left: auto; }
  .back-link span { display: none; }
  .back-link { width: 36px; padding: 0; }
  .dashboard { display: block; padding: 11px 11px 14px; }
  .metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }
  .metric-card { min-height: 106px; padding: 12px; }
  .metric-card:last-child { grid-column: 1 / -1; min-height: 94px; }
  .metric-card__value strong { font-size: 1.9rem; }
  .panel { margin-top: 10px; border-radius: 14px; }
  .panel__head { padding-inline: 13px; }
  .process-flow { gap: 7px; padding-inline: 11px; }
  .node-inspector { grid-template-columns: 1fr; gap: 10px; margin-inline: 11px; }
  .node-inspector__readings { grid-template-columns: 1fr; }
  .alarm-list { max-height: none; }
  .trend-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-inline: 13px; }
  .trend-legend { grid-column: 1 / -1; margin-left: 0; }
  #trend-chart { height: auto; min-height: 215px; }
  .resource-grid { padding-inline: 11px; }
  .batch-table { padding-inline: 11px; }
  .batch-row { grid-template-columns: minmax(130px, 1.3fr) minmax(90px, .8fr) minmax(100px, 1fr); gap: 8px; min-height: 56px; }
  .batch-row > span:nth-child(4), .batch-row > span:nth-child(5) { display: none; }
  .batch-row--head > span:nth-child(4), .batch-row--head > span:nth-child(5) { display: none; }
  .health-list { padding-inline: 13px; }
  .dashboard-footer { display: grid; justify-content: stretch; gap: 8px; padding: 5px 3px 0; line-height: 1.7; }
  .dashboard-footer > div { justify-content: space-between; gap: 7px 12px; }
  .dashboard-footer > div:first-child span:nth-child(n+3) { display: none; }
  .toast { right: 12px; bottom: 12px; left: 12px; text-align: center; }
}

@media (max-width: 430px) {
  .metric-grid { gap: 7px; }
  .metric-card { padding: 10px; }
  .metric-card__top { font-size: .68rem; }
  .metric-card__value strong { font-size: 1.7rem; }
  .metric-card__foot { display: block; font-size: .59rem; }
  .metric-card__foot span:last-child { display: none; }
  .panel__head h2 { font-size: .92rem; }
  .panel__head .eyebrow { font-size: .55rem; }
  .range-switch button { min-width: 36px; }
  .resource-gauge > strong { font-size: .61rem; }
  .environment-strip { display: grid; grid-template-columns: 1fr 1fr; }
}

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