:root {
  --bg: #071117;
  --bg-grid: rgba(111, 166, 187, 0.035);
  --panel: #0c1921;
  --panel-secondary: #10202a;
  --panel-raised: #132934;
  --border: rgba(105, 164, 187, 0.20);
  --border-strong: rgba(112, 188, 212, 0.36);
  --text: #e7f0f6;
  --text-secondary: #adc0ce;
  --text-muted: #7f95a5;
  --accent: #42d4c8;
  --accent-dim: #1b6d69;
  --blue: #5aa9ff;
  --violet: #b68cff;
  --success: #57db8a;
  --warning: #f0b34e;
  --danger: #ff7182;
  --waiting: #8096a5;
  --unavailable: #687a84;
  --header-height: 62px;
  --sidebar-width: 176px;
  --radius: 5px;
  --gap: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.20);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    radial-gradient(circle at 48% -20%, rgba(42, 87, 96, 0.14), transparent 42%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
  font: clamp(13px, 0.48vw, 15px)/1.55 "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
}
button { font: inherit; }

.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 16px;
  border-bottom: 1px solid var(--border-strong);
  background: rgba(7, 16, 20, 0.96);
  backdrop-filter: blur(12px);
}
.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent 18%, transparent 82%, rgba(66, 212, 200, 0.25));
  opacity: 0.4;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 310px; }
.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  font-size: 13px;
  letter-spacing: -0.08em;
  overflow: hidden;
}
.brand-mark i { position: absolute; inset: 3px; border: 1px solid rgba(66, 212, 200, 0.18); }
.brand-mark::before,
.brand-mark::after { content: ""; position: absolute; background: var(--accent); }
.brand-mark::before { width: 8px; height: 1px; top: -1px; left: 4px; }
.brand-mark::after { width: 1px; height: 8px; right: -1px; bottom: 4px; }
.brand-copy strong { display: block; font-size: 15px; line-height: 1.2; letter-spacing: 0.025em; }
.brand-copy small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12px; letter-spacing: 0.06em; }
.header-telemetry { display: flex; align-items: center; gap: clamp(14px, 1vw, 24px); color: var(--text-muted); }
.header-signal { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.header-signal b { color: var(--text-secondary); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.header-signal em { max-width: 120px; overflow: hidden; color: var(--text-muted); font-size: 12px; font-style: normal; text-overflow: ellipsis; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.status-dot.AVAILABLE { color: var(--success); box-shadow: 0 0 7px rgba(87, 219, 138, 0.5); }
.status-dot.ERROR { color: var(--danger); }
.status-dot.STALE { color: var(--warning); }
.status-dot.WAITING_UPSTREAM,
.status-dot.NO_DATA { color: var(--waiting); }
.status-dot.UNAVAILABLE,
.status-dot.IDLE { color: var(--unavailable); }
.status-dot.live-pulse { animation: live-pulse 2.4s ease-out infinite; }
@keyframes live-pulse { 0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(87, 219, 138, 0); } 12% { box-shadow: 0 0 0 4px rgba(87, 219, 138, 0.12); } }
#clock { padding-left: 18px; border-left: 1px solid var(--border); color: var(--text-secondary); font: 13px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.view-toggle { display: flex; padding: 2px; border: 1px solid var(--border); background: #081217; }
.view-toggle button { min-width: 48px; padding: 6px 10px; border: 0; color: var(--text-muted); background: transparent; cursor: pointer; font-size: 13px; }
.view-toggle button.active { color: var(--accent); background: var(--panel-raised); }

.sidebar {
  position: fixed;
  z-index: 15;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 10px 14px;
  border-right: 1px solid var(--border);
  background: rgba(8, 18, 22, 0.96);
}
.sidebar nav { display: grid; gap: 6px; }
.nav {
  position: relative;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border: 1px solid transparent;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}
.nav::before { content: ""; position: absolute; top: 7px; bottom: 7px; left: -9px; width: 2px; background: transparent; }
.nav svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.25; }
.nav:first-child svg { fill: currentColor; stroke: none; }
.nav span { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.nav small { color: #607784; font: 11px ui-monospace, monospace; }
.nav:hover { color: var(--text-secondary); background: rgba(24, 45, 53, 0.35); }
.nav.active { color: var(--text); border-color: var(--border); background: linear-gradient(90deg, rgba(66, 212, 200, 0.09), rgba(18, 35, 42, 0.45)); }
.nav.active::before { background: var(--accent); box-shadow: 0 0 8px rgba(66, 212, 200, 0.35); }
.nav.active svg,
.nav.active small { color: var(--accent); }
.safety-block { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px; border: 1px solid var(--border); background: rgba(14, 30, 38, 0.76); color: var(--text-muted); font-size: 11px; letter-spacing: 0.02em; }
.safety-block div { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.safety-block i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.safety-block strong { color: var(--accent); font-size: 13px; }
.safety-block span:last-child { grid-column: 1 / -1; }

main { width: calc(100% - var(--sidebar-width)); min-height: calc(100vh - var(--header-height)); margin: var(--header-height) 0 0 var(--sidebar-width); padding: 22px clamp(18px, 1.25vw, 42px) 36px; }
.page { display: none; width: 100%; animation: page-in 0.16s ease-out; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0.6; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
.page-head { min-height: 72px; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: clamp(25px, 1.05vw, 34px); font-weight: 650; line-height: 1.2; letter-spacing: -0.02em; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font: clamp(12px, 0.38vw, 13px)/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 0.08em; }
.page-description { margin: 7px 0 0; color: var(--text-secondary); font-size: clamp(13px, 0.43vw, 15px); }
.page-tools { display: flex; align-items: center; gap: 12px; }
.last-updated { color: var(--text-muted); font: 12px ui-monospace, monospace; }
.window-picker { display: flex; align-items: center; border: 1px solid var(--border); background: rgba(8, 18, 23, 0.8); }
.window-picker button { width: 44px; height: 32px; border: 0; border-right: 1px solid var(--border); color: var(--text-muted); background: transparent; cursor: pointer; font: 12px ui-monospace, monospace; }
.window-picker button.active { color: var(--accent); background: var(--panel-raised); }
.window-picker span { padding: 0 10px; color: var(--text-muted); font-size: 12px; }
.readonly-stamp { padding: 8px 12px; border: 1px solid var(--accent-dim); color: var(--accent); background: rgba(66, 212, 200, 0.045); font-size: 12px; letter-spacing: 0.04em; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.overview-primary { margin-top: var(--gap); }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(150deg, rgba(16, 34, 44, 0.98), rgba(10, 23, 30, 0.98)); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: rgba(19, 42, 53, 0.50); }
.panel-head p { margin: 0 0 3px; color: var(--text-muted); font-size: 12px; letter-spacing: 0.04em; }
.panel-head h2 { margin: 0; font-size: clamp(15px, 0.5vw, 18px); font-weight: 620; }
.panel-head strong { color: var(--text); font: clamp(17px, 0.55vw, 20px) ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; }
.panel-tag { color: var(--text-muted); font-size: 11px; letter-spacing: 0.03em; white-space: nowrap; }

.status-grid,
.kpi-grid { display: grid; gap: 10px; }
.status-grid.six,
.kpi-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.status-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.status-card { position: relative; min-width: 0; height: 104px; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, var(--panel-secondary), #0b1921); overflow: hidden; }
.status-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--status-color, var(--waiting)); }
.status-card.AVAILABLE { --status-color: var(--success); }
.status-card.ERROR { --status-color: var(--danger); }
.status-card.STALE { --status-color: var(--warning); }
.status-card.WAITING_UPSTREAM,
.status-card.NO_DATA { --status-color: var(--waiting); }
.status-card.UNAVAILABLE,
.status-card.IDLE { --status-color: var(--unavailable); }
.status-label { display: flex; justify-content: space-between; align-items: center; color: var(--text-secondary); font-size: clamp(13px, 0.42vw, 15px); font-weight: 560; }
.status-label .status-dot { flex: 0 0 auto; }
.status-value { margin-top: 9px; overflow: hidden; color: var(--text); font-size: clamp(17px, 0.56vw, 20px); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.status-meta { margin-top: 5px; overflow: hidden; color: var(--text-muted); font-size: clamp(12px, 0.36vw, 13px); text-overflow: ellipsis; white-space: nowrap; }

.kpi-card { position: relative; min-width: 0; height: 132px; margin-top: 10px; padding: 13px 15px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18, 38, 48, 0.98), rgba(10, 23, 30, 0.98)); overflow: hidden; }
.kpi-card:hover { border-color: var(--border-strong); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.kpi-label { overflow: hidden; color: var(--text-secondary); font-size: clamp(13px, 0.43vw, 15px); font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.kpi-reading { display: flex; align-items: baseline; gap: 6px; margin-top: 7px; }
.kpi-value { overflow: hidden; color: var(--text); font: clamp(24px, 0.85vw, 31px)/1.15 ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.kpi-unit { color: var(--text-secondary); font: clamp(12px, 0.38vw, 14px) ui-monospace, monospace; }
.kpi-meta { position: absolute; right: 14px; bottom: 8px; left: 14px; display: flex; justify-content: space-between; gap: 10px; color: #718795; font-size: 11px; }
.kpi-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-spark { position: absolute; right: 12px; bottom: 26px; left: 12px; width: calc(100% - 24px); height: 36px; opacity: 0.92; }
.mini-badge,
.badge { display: inline-flex; align-items: center; gap: 6px; color: var(--waiting); font-size: 12px; font-weight: 560; white-space: nowrap; }
.mini-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--waiting); font-size: 11px; font-weight: 560; white-space: nowrap; }
.badge::before,
.mini-badge::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.badge { padding: 3px 7px; border: 1px solid currentColor; }
.mini-badge.AVAILABLE,
.badge.AVAILABLE { color: var(--success); }
.mini-badge.ERROR,
.badge.ERROR { color: var(--danger); }
.mini-badge.STALE,
.badge.STALE { color: var(--warning); }
.mini-badge.WAITING_UPSTREAM,
.mini-badge.NO_DATA,
.badge.WAITING_UPSTREAM,
.badge.NO_DATA { color: var(--waiting); }
.mini-badge.UNAVAILABLE,
.mini-badge.IDLE,
.badge.UNAVAILABLE,
.badge.IDLE { color: var(--unavailable); }

.chart-stack { padding: 8px 16px 10px; }
.chart-row { min-height: 94px; display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--border); }
.chart-row:last-child { border-bottom: 0; }
.chart-row > div { display: grid; gap: 6px; }
.chart-row b { color: var(--text-secondary); font-size: clamp(13px, 0.42vw, 15px); font-weight: 600; }
.chart-row span { color: var(--text); font: clamp(16px, 0.5vw, 19px) ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; }
.chart-row canvas { width: 100%; height: 82px; }
.chart-panel > canvas { display: block; width: 100%; height: 248px; }
.comparison-chart canvas { display: block; width: 100%; height: 190px; }
.chart-empty { color: var(--text-muted); font-size: 13px; }

.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.health-item { min-width: 0; min-height: 44px; display: grid; grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); }
.health-item label { color: var(--text-muted); font-size: 13px; }
.health-item span { overflow: hidden; color: var(--text-secondary); font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.event-list { min-height: 132px; max-height: 220px; overflow-y: auto; padding: 5px 14px; }
.event-row { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--border); }
.event-row:last-child { border-bottom: 0; }
.event-row time { color: var(--text-muted); font: 12px ui-monospace, monospace; }
.event-row span { color: var(--text-secondary); font-size: 13px; }
.empty-state { display: grid; min-height: 120px; place-items: center; color: var(--text-muted); font-size: 13px; text-align: center; }

.thermal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.thermal-item { min-width: 0; padding: 13px 15px; background: var(--panel); }
.thermal-item-head { display: flex; justify-content: space-between; gap: 8px; }
.thermal-item strong { overflow: hidden; color: var(--text-secondary); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.thermal-item output { color: var(--text); font: 16px ui-monospace, monospace; }
.thermal-track { height: 5px; margin-top: 11px; background: #162c37; overflow: hidden; }
.thermal-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--accent)); }
.thermal-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--text-muted); font-size: 11px; }
.network-list { display: grid; gap: 1px; background: var(--border); }
.network-card { min-width: 0; padding: 13px 15px; background: var(--panel); }
.network-card-head { display: flex; align-items: center; justify-content: space-between; }
.network-card h3 { margin: 0; color: var(--text); font: 15px ui-monospace, monospace; }
.network-addresses { display: grid; gap: 4px; margin-top: 10px; color: var(--text-muted); font: 12px ui-monospace, monospace; word-break: break-all; }
.network-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.network-stat label { display: block; color: var(--text-muted); font-size: 11px; }
.network-stat span { color: var(--text-secondary); font: 13px ui-monospace, monospace; }

.source-summary { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--border); background: var(--panel); color: var(--text-muted); font: 12px ui-monospace, monospace; }
.source-summary strong { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.comparison-value { min-width: 0; padding: 15px 16px; background: var(--panel); }
.comparison-value header { display: flex; align-items: center; justify-content: space-between; }
.comparison-value label { color: var(--text-secondary); font-size: 13px; font-weight: 560; }
.comparison-value output { display: block; margin-top: 9px; color: var(--text); font: 26px ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.comparison-value small { margin-left: 5px; color: var(--text-muted); font-size: 13px; }
.comparison-track { position: relative; height: 5px; margin-top: 12px; background: #162c37; }
.comparison-track::after { content: ""; position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: #38505a; }
.comparison-track i { position: absolute; top: 0; height: 100%; background: var(--accent); }
.comparison-value.command .comparison-track i { background: var(--warning); }
.comparison-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; color: #718795; font-size: 11px; }
.comparison-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actuator-grid { display: grid; gap: 1px; background: var(--border); }
.actuator-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.actuator-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.actuator-card { min-width: 0; padding: 15px; background: var(--panel); }
.actuator-card > header { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.actuator-card h3 { margin: 0; color: var(--text); font-size: 15px; font-weight: 620; }
.actuator-readings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 13px; }
.actuator-reading label { display: block; color: var(--text-muted); font-size: 12px; }
.actuator-reading output { display: inline-block; margin-top: 5px; color: var(--text); font: 21px ui-monospace, monospace; }
.actuator-reading small { margin-left: 4px; color: var(--text-muted); font-size: 11px; }
.actuator-reading.command output { color: var(--warning); }
.actuator-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border); }
.actuator-meta div { min-width: 0; }
.actuator-meta label { display: block; color: var(--text-muted); font-size: 11px; }
.actuator-meta span { display: block; margin-top: 3px; overflow: hidden; color: var(--text-secondary); font: 12px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }

.page-health-grid { display: grid; gap: 1px; background: var(--border); }
.page-health-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.page-card { position: relative; min-width: 0; min-height: 142px; padding: 15px; background: var(--panel); }
.page-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--status-color, var(--waiting)); }
.page-card.AVAILABLE { --status-color: var(--success); }
.page-card.ERROR { --status-color: var(--danger); }
.page-card.STALE { --status-color: var(--warning); }
.page-card-head { display: flex; align-items: center; justify-content: space-between; }
.page-card code { color: var(--accent); font: 14px ui-monospace, monospace; }
.page-card h3 { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 14px; color: var(--text); font-size: 16px; font-weight: 620; }
.page-card h3 span { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.page-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.page-card-stat label { display: block; color: var(--text-muted); font-size: 11px; }
.page-card-stat span { color: var(--text-secondary); font: 13px ui-monospace, monospace; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.diagnostic-item { min-width: 0; min-height: 62px; padding: 10px 14px; background: var(--panel); }
.diagnostic-item label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 12px; }
.diagnostic-item label small { overflow: hidden; color: #647987; font: 10px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.diagnostic-item span { display: block; margin-top: 6px; overflow: hidden; color: var(--text-secondary); font: 13px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.diagnostic-item.wide { grid-column: 1 / -1; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { height: 40px; padding: 0 14px; color: var(--text-muted); background: #0a171e; font-size: 12px; font-weight: 560; text-align: left; white-space: nowrap; }
.data-table td { height: 44px; padding: 0 14px; border-top: 1px solid var(--border); color: var(--text-secondary); font: 13px ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table th:last-child,
.data-table td:last-child { text-align: right; }
.runtime-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); }
.runtime-item { min-height: 136px; display: grid; place-content: center; text-align: center; background: var(--panel); }
.runtime-item label { color: var(--text-muted); font-size: 13px; }
.runtime-item output { margin-top: 9px; color: var(--text); font: 26px ui-monospace, monospace; }
.runtime-item small { color: var(--text-muted); font-size: 12px; }
.boundary-copy { min-height: 190px; padding: 16px; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.boundary-copy p { margin: 0 0 13px; }
.boundary-copy code { display: block; margin: 6px 0; color: var(--accent); font: 11px ui-monospace, monospace; word-break: break-all; }
.boundary-copy .no-core-data { margin-top: 13px; padding: 9px 11px; border: 1px solid var(--border); color: var(--waiting); }

body[data-view="compact"] .detail-panel { display: none; }
body[data-view="compact"] .page-description,
body[data-view="compact"] .last-updated { display: none; }
body[data-view="compact"] .kpi-card { height: 110px; }
body[data-view="compact"] .kpi-spark { bottom: 12px; height: 30px; }
body[data-view="compact"] .kpi-meta { display: none; }

@media (min-width: 2300px) {
  :root { --sidebar-width: 196px; --gap: 14px; }
  main { padding-top: 28px; padding-right: 44px; padding-left: 44px; }
  .status-card { height: 112px; }
  .kpi-card { height: 142px; }
  .chart-panel > canvas { height: 270px; }
  .chart-row { min-height: 106px; grid-template-columns: 150px minmax(0, 1fr); }
  .chart-row canvas { height: 92px; }
  .comparison-chart canvas { height: 220px; }
  .thermal-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .network-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1360px) {
.status-grid.six,
.kpi-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.five { grid-template-columns: repeat(5, minmax(135px, 1fr)); overflow-x: auto; }
  .actuator-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-signal em { display: none; }
}
@media (max-width: 1050px) {
  :root { --sidebar-width: 138px; }
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 { grid-column: span 6; }
  .page-health-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thermal-list { grid-template-columns: 1fr; }
  .header-telemetry { gap: 9px; }
  #clock { display: none; }
}
@media (max-width: 760px) {
  :root { --sidebar-width: 0px; }
  .topbar { padding: 0 10px; }
  .brand { min-width: 0; }
  .brand-copy small,
  .header-signal:not(#header-live),
  .view-toggle { display: none; }
  .sidebar { top: auto; right: 0; width: 100%; height: 52px; padding: 3px 5px; border-top: 1px solid var(--border); border-right: 0; }
  .sidebar nav { display: flex; justify-content: space-around; gap: 2px; }
  .nav { width: auto; min-width: 44px; height: 44px; justify-content: center; padding: 0 7px; }
  .nav::before { inset: auto 8px -4px; width: auto; height: 2px; }
  .nav span,
  .safety-block { display: none; }
  main { width: 100%; margin-left: 0; padding: 13px 10px 66px; }
  .page-head { align-items: flex-start; }
  .page-tools,
  .page-head > .window-picker,
  .readonly-stamp { display: none; }
  .status-grid.four,
  .status-grid.six,
  .kpi-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 { grid-column: 1 / -1; }
  .actuator-grid.four,
  .actuator-grid.two,
  .page-health-grid.five,
  .health-grid,
  .runtime-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
  .status-grid.six,
  .kpi-grid.six,
  .kpi-grid.five,
  .actuator-grid.four,
  .actuator-grid.two,
  .page-health-grid.five,
  .health-grid,
  .runtime-grid,
  .comparison { grid-template-columns: 1fr; }
}
/* Device metadata stays readable on wide displays without streaming raw clouds. */
.sensor-panel { margin: 14px 0; }
.sensor-note { color: var(--muted, #9aaec0); padding: 8px 16px; font-size: 14px; }
.sensor-panel .data-table td:last-child { white-space: normal; min-width: 280px; line-height: 1.7; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.media-section-title { margin: 24px 0 14px; font-size: clamp(18px, 1vw, 24px); }
.media-card { min-width: 0; overflow: hidden; }
.media-card .panel-head h2 { font-size: 16px; }
.media-viewport { position: relative; height: clamp(240px, 18vw, 440px); background: #07141c; }
.media-viewport img, .media-viewport canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.media-viewport [hidden], .media-overlay[hidden] { display: none; }
.media-overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #a7bac8; font-size: 16px; }
.media-meta { padding: 12px 14px; color: #b0c4d1; line-height: 1.65; font-size: 13px; overflow-wrap: anywhere; }
.media-view { margin: 0 14px 14px; padding: 8px 12px; background: #183340; color: #d9edf5; border: 1px solid #3d626f; cursor: pointer; }
.media-record-controls { padding: 12px 14px 16px; border-top: 1px solid #29434f; }
.media-record-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.media-record-toggle, .media-record-download { padding: 9px 14px; border: 1px solid #477385; border-radius: 4px; background: #193642; color: #e5edf5; font: inherit; font-size: 14px; line-height: 1.4; cursor: pointer; text-decoration: none; }
.media-record-toggle:disabled { opacity: .55; cursor: not-allowed; }
.media-record-toggle.is-recording { border-color: #e48b86; background: #502b31; color: #ffe9e6; }
.media-record-toggle:focus-visible, .media-record-download:focus-visible { outline: 2px solid #66d6df; outline-offset: 3px; }
.media-record-download { background: #143e48; }
.media-record-download[hidden] { display: none; }
.media-record-status { display: block; margin-top: 10px; color: #b9cbd6; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 1200px) { .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .media-grid { grid-template-columns: minmax(0, 1fr); } }
