:root {
  color-scheme: dark;
  --bg: #07100e;
  --bg-elevated: #0a1512;
  --panel: #0d1a17;
  --panel-strong: #11211d;
  --line: #21332e;
  --line-soft: rgba(146, 175, 164, 0.13);
  --text: #eff9f5;
  --muted: #91a49d;
  --muted-2: #657971;
  --signal: #b9f227;
  --signal-strong: #d4ff5e;
  --cyan: #49d8d0;
  --violet: #a995ff;
  --amber: #ffbf47;
  --red: #ff756b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  font-family: "Bahnschrift", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% -10%, rgba(78, 145, 120, 0.12), transparent 35rem),
    var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(185, 242, 39, 0.48);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--signal);
  color: #0b140c;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(6, 15, 13, 0.88);
  backdrop-filter: blur(24px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  letter-spacing: 0.18em;
  font-size: 1.08rem;
  font-weight: 850;
}
.brand-mark { width: 36px; fill: none; stroke: var(--signal); stroke-width: 1.8; }
.brand-mark path:last-child { stroke: var(--cyan); }
.nav-list { display: grid; gap: 6px; margin-top: 55px; }
.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 13px;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.nav-item svg { width: 20px; fill: currentColor; }
.nav-item:hover { background: rgba(255, 255, 255, 0.025); color: var(--text); }
.nav-item.is-active {
  border-color: rgba(185, 242, 39, 0.2);
  background: rgba(185, 242, 39, 0.09);
  color: var(--signal-strong);
}
.nav-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 191, 71, 0.15);
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}
.sidebar-foot { margin-top: auto; padding: 18px 12px 6px; border-top: 1px solid var(--line-soft); }
.eyebrow { color: var(--muted-2); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; }
.gateway-state { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.9rem; }
.gateway-state i, .live-badge i, .dot.online { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px rgba(185, 242, 39, 0.55); }
.gateway-id { display: block; margin: 7px 0 0 16px; color: var(--muted-2); font-size: 0.75rem; }
.workspace { min-height: 100vh; margin-left: 248px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(22px, 3.2vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 14, 0.82);
  backdrop-filter: blur(22px);
}
.site-picker { display: flex; align-items: center; gap: 7px; margin-top: 3px; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 1rem; }
.site-picker svg { width: 17px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.connection-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(185, 242, 39, 0.2);
  border-radius: 99px;
  background: rgba(185, 242, 39, 0.06);
  color: #ccebb4;
  font-size: 0.8rem;
}
.pulse-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.pulse-dot::after { position: absolute; inset: -5px; border: 1px solid var(--signal); border-radius: inherit; content: ""; animation: pulse 2.2s infinite; }
@keyframes pulse { 0%, 45% { opacity: 0; transform: scale(.5); } 70% { opacity: .55; } 100% { opacity: 0; transform: scale(1.5); } }
.connection-pill.offline { border-color: rgba(255, 117, 107, .2); background: rgba(255, 117, 107, .06); color: #ffc0bb; }
.connection-pill.offline .pulse-dot { background: var(--red); }
.connection-pill.offline .pulse-dot::after { display: none; }
.icon-button, .profile-button { border: 0; background: transparent; cursor: pointer; }
.icon-button { position: relative; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.icon-button svg { width: 19px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.notification-dot { position: absolute; top: 6px; right: 5px; width: 7px; height: 7px; border: 2px solid var(--bg); border-radius: 50%; background: var(--amber); }
.profile-button { display: flex; align-items: center; gap: 9px; padding: 0 0 0 6px; }
.profile-button > span:first-child { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #28423a, #172a25); color: var(--signal-strong); font-size: 0.78rem; font-weight: 800; }
.profile-copy { display: grid; text-align: left; }
.profile-copy strong { font-size: 0.82rem; }
.profile-copy small { color: var(--muted); font-size: 0.72rem; }
main { max-width: 1640px; margin: 0 auto; padding: 38px clamp(22px, 3.2vw, 54px) 70px; }
.intro-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
h1, h2, p { margin: 0; }
h1 { margin-top: 7px; font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.1; letter-spacing: -0.035em; }
h2 { margin-top: 5px; font-size: 1.18rem; letter-spacing: -0.015em; }
.freshness { display: grid; justify-items: end; color: var(--muted-2); font-size: 0.78rem; }
.freshness strong { margin-top: 4px; color: var(--muted); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card, .panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(17, 33, 29, 0.95), rgba(10, 22, 18, 0.95));
  box-shadow: var(--shadow);
}
.metric-card { position: relative; min-height: 190px; overflow: hidden; padding: 18px 19px; border-radius: var(--radius-md); }
.metric-card::before { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(120deg, rgba(255,255,255,.025), transparent 38%); content: ""; }
.metric-primary { border-color: rgba(185, 242, 39, 0.28); background: linear-gradient(150deg, rgba(31, 53, 39, .95), rgba(11, 25, 20, .96)); }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(185, 242, 39, 0.1); color: var(--signal); }
.metric-icon.cyan { background: rgba(73, 216, 208, .1); color: var(--cyan); }
.metric-icon.violet { background: rgba(169, 149, 255, .1); color: var(--violet); }
.metric-icon.amber { background: rgba(255, 191, 71, .1); color: var(--amber); }
.metric-icon svg { width: 19px; fill: none; stroke: currentColor; stroke-linejoin: round; stroke-width: 1.7; }
.trend, .state-label { font-size: .67rem; font-weight: 850; letter-spacing: .08em; }
.trend.positive, .state-label.good { color: var(--signal); }
.state-label.attention { color: var(--amber); }
.metric-card > p { margin-top: 22px; color: var(--muted); font-size: .85rem; }
.metric-value { display: flex; align-items: baseline; gap: 7px; margin-top: 5px; }
.metric-value strong { font-size: clamp(1.8rem, 2.4vw, 2.45rem); line-height: 1; letter-spacing: -.05em; }
.metric-value span { color: var(--muted); font-size: .75rem; }
.sparkline { position: absolute; right: 0; bottom: 0; left: 0; width: 100%; height: 48px; }
.spark-area { fill: rgba(185, 242, 39, .08); }
.spark-line { fill: none; stroke: var(--signal); stroke-width: 2; vector-effect: non-scaling-stroke; }
.metric-foot, .range-labels { display: flex; justify-content: space-between; margin-top: 17px; color: var(--muted-2); font-size: .68rem; }
.quality-track { height: 3px; margin-top: 14px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.07); }
.quality-track i { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--signal)); transition: width .5s; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .78rem; font-weight: 650; }
.text-button:hover { color: var(--text); }
.alert-card .text-button { position: absolute; bottom: 18px; color: var(--amber); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .75fr); gap: 14px; margin-top: 14px; align-items: start; }
.panel { border-radius: var(--radius-lg); }
.equipment-panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--line-soft); }
.panel-head.compact { padding-bottom: 18px; border: 0; }
.summary-chips { display: flex; gap: 17px; color: var(--muted); font-size: .72rem; }
.summary-chips span { display: flex; align-items: center; gap: 6px; }
.summary-chips b { color: var(--text); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dot.warning { background: var(--amber); }
.equipment-table { width: 100%; }
.equipment-row { display: grid; grid-template-columns: minmax(190px, 1.2fr) .85fr 1fr .72fr 22px; align-items: center; gap: 12px; min-height: 72px; padding: 10px 24px; border-bottom: 1px solid var(--line-soft); }
.equipment-row:last-child { border-bottom: 0; }
.equipment-row:not(.equipment-header) { cursor: pointer; transition: background .18s; }
.equipment-row:not(.equipment-header):hover, .equipment-row.is-selected { background: rgba(185, 242, 39, .035); }
.equipment-header { min-height: 38px; padding-top: 6px; padding-bottom: 6px; color: var(--muted-2); font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.device-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.device-glyph { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); color: var(--cyan); font-weight: 800; }
.device-copy { display: grid; min-width: 0; }
.device-copy strong { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.device-copy small, .cell-muted { color: var(--muted-2); font-size: .7rem; }
.status { display: inline-flex; width: max-content; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 99px; background: rgba(185,242,39,.07); color: #c7e9ac; font-size: .7rem; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); content: ""; }
.status.warning { background: rgba(255,191,71,.08); color: #ffd995; }
.status.warning::before { background: var(--amber); }
.parameter { font-size: .8rem; font-weight: 700; }
.row-arrow { color: var(--muted-2); font-size: 1.1rem; }
.control-panel { position: relative; overflow: hidden; }
.control-accent { height: 3px; background: linear-gradient(90deg, var(--signal), var(--cyan), transparent 85%); }
.live-badge { display: flex; align-items: center; gap: 6px; color: var(--signal); font-size: .62rem; font-weight: 850; letter-spacing: .08em; }
.system-visual { position: relative; height: 126px; margin: 2px 24px 0; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 14px; background: repeating-linear-gradient(0deg, transparent 0 19px, rgba(255,255,255,.018) 20px), repeating-linear-gradient(90deg, transparent 0 19px, rgba(255,255,255,.018) 20px); }
.duct-line { position: absolute; top: 62px; right: 25px; left: 24px; height: 2px; background: linear-gradient(90deg, var(--cyan), rgba(73,216,208,.15)); }
.duct-line::after { position: absolute; top: -4px; right: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid var(--cyan); content: ""; }
.fan-symbol { position: absolute; top: 38px; left: 45px; width: 50px; height: 50px; border: 2px solid rgba(73,216,208,.65); border-radius: 50%; animation: fan-glow 3s ease-in-out infinite; }
.fan-symbol i { position: absolute; top: 22px; left: 22px; width: 18px; height: 7px; border-radius: 70% 20% 70% 20%; background: var(--cyan); transform-origin: 3px 3px; }
.fan-symbol i:nth-child(1) { transform: rotate(0deg); }
.fan-symbol i:nth-child(2) { transform: rotate(120deg); }
.fan-symbol i:nth-child(3) { transform: rotate(240deg); }
.fan-symbol b { position: absolute; top: 20px; left: 20px; width: 7px; height: 7px; border-radius: 50%; background: var(--text); }
@keyframes fan-glow { 50% { box-shadow: 0 0 22px rgba(73,216,208,.13); } }
.flow-label { position: absolute; top: 35px; right: 26px; display: grid; justify-items: end; }
.flow-label span { color: var(--muted-2); font-size: .62rem; letter-spacing: .12em; }
.flow-label strong { margin-top: 4px; font-size: 1rem; }
.control-values { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 24px 0; border: 1px solid var(--line-soft); border-radius: 13px; }
.control-values div { display: grid; gap: 7px; padding: 13px; border-right: 1px solid var(--line-soft); }
.control-values div:last-child { border: 0; }
.control-values span { color: var(--muted-2); font-size: .64rem; line-height: 1.25; }
.control-values strong { font-size: .83rem; }
.setpoint-block { margin: 20px 24px 0; }
.setpoint-copy { display: flex; align-items: center; justify-content: space-between; }
.setpoint-copy label { color: var(--muted); font-size: .8rem; }
.setpoint-copy output { font-size: .9rem; font-weight: 800; }
input[type="range"] { width: 100%; height: 22px; margin: 12px 0 0; accent-color: var(--signal); cursor: pointer; }
.range-labels { margin-top: 0; }
.command-row { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8px; margin: 19px 24px 0; }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: .78rem; font-weight: 800; }
.button svg { width: 14px; fill: currentColor; }
.button.primary { background: var(--signal); color: #0c160d; }
.button.primary:hover { background: var(--signal-strong); }
.button.secondary { border-color: var(--line); background: rgba(255,255,255,.025); color: var(--muted); }
.button.secondary:hover { color: var(--text); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.command-note { margin: 12px 24px 22px; color: var(--muted-2); font-size: .65rem; text-align: center; }
.events-panel { margin-top: 14px; overflow: hidden; }
.camera-panel { margin-top: 14px; overflow: hidden; }
.camera-head { align-items: center; }
.camera-actions { display: flex; align-items: center; gap: 18px; }
.camera-state { display: inline-flex; align-items: center; gap: 8px; color: #c7e9ac; font-size: .72rem; }
.camera-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px rgba(185, 242, 39, .45); }
.camera-state.connecting { color: var(--amber); }
.camera-state.connecting i { background: var(--amber); box-shadow: none; animation: pulse 1.3s infinite; }
.camera-body { padding: 18px 24px 22px; }
.camera-stage { position: relative; overflow: hidden; aspect-ratio: 16 / 9; max-height: 72vh; border: 1px solid var(--line); border-radius: 16px; background: #020706; }
.camera-stage::before { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-2); content: "Ожидание видеопотока"; font-size: .8rem; }
.camera-stage iframe { position: relative; z-index: 1; width: 100%; height: 100%; border: 0; background: #020706; }
.camera-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 12px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--line-soft); }
.camera-meta span { display: grid; gap: 4px; padding: 12px 14px; background: var(--panel); }
.camera-meta b { font-size: .76rem; }
.camera-meta small { color: var(--muted-2); font-size: .68rem; }
.event-list { display: grid; }
.event-item { display: grid; grid-template-columns: 10px minmax(180px, 1fr) minmax(190px, 2fr) 100px; gap: 16px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line-soft); }
.event-item:last-child { border: 0; }
.event-severity { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.event-severity.info { background: var(--cyan); }
.event-source strong, .event-message { font-size: .8rem; }
.event-source { display: grid; }
.event-source small, .event-time { color: var(--muted-2); font-size: .68rem; }
.event-time { text-align: right; }
.points-panel { margin-top: 14px; overflow: hidden; }
.points-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.point-card { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; min-height: 82px; padding: 15px 18px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.point-card:nth-child(3n) { border-right: 0; }
.point-card strong { align-self: center; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.point-card output { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 1.08rem; font-weight: 800; }
.point-card small { color: var(--muted-2); font-size: .66rem; }
.point-card.has-error output { color: var(--red); font-size: .74rem; }
.mobile-nav { display: none; }
.login-dialog { width: min(420px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: #0d1a17; color: var(--text); box-shadow: 0 35px 100px rgba(0,0,0,.6); }
.login-dialog::backdrop { background: rgba(1,6,5,.88); backdrop-filter: blur(9px); }
.login-dialog form { display: grid; gap: 14px; padding: 30px; }
.login-brand { margin-bottom: 18px; padding: 0; }
.login-dialog h2 { margin-top: -6px; font-size: 1.7rem; }
.login-dialog p { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.login-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: .76rem; }
.login-dialog input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #091310; color: var(--text); }
.login-dialog .login-error { min-height: 1.2em; margin-top: -5px; color: var(--red); }
.confirm-dialog { width: min(440px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: #0d1a17; color: var(--text); box-shadow: 0 35px 100px rgba(0,0,0,.55); }
.confirm-dialog::backdrop { background: rgba(1,6,5,.74); backdrop-filter: blur(5px); }
.confirm-dialog form { padding: 28px; }
.dialog-icon { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 20px; border-radius: 14px; background: rgba(255,191,71,.1); color: var(--amber); }
.dialog-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.confirm-dialog h2 { margin-top: 9px; font-size: 1.45rem; }
.confirm-dialog p { margin-top: 10px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 25px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; min-width: 310px; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid rgba(185,242,39,.25); border-radius: 13px; background: #13231e; box-shadow: 0 18px 55px rgba(0,0,0,.42); opacity: 0; transform: translateY(18px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; background: rgba(185,242,39,.12); color: var(--signal); font-weight: 900; }
.toast > span:last-child { display: grid; }
.toast strong { font-size: .78rem; }
.toast small { margin-top: 2px; color: var(--muted); font-size: .7rem; }

@media (max-width: 1180px) {
  .sidebar { width: 86px; align-items: center; padding-inline: 12px; }
  .brand span, .nav-item span:not(.nav-count), .sidebar-foot { display: none; }
  .brand { padding: 0; }
  .nav-item { display: grid; width: 52px; grid-template-columns: 1fr; place-items: center; padding: 0; }
  .nav-count { position: absolute; margin: -29px 0 0 31px; }
  .workspace { margin-left: 86px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .control-panel { order: -1; }
  .points-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .point-card:nth-child(3n) { border-right: 1px solid var(--line-soft); }
  .point-card:nth-child(2n) { border-right: 0; }
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 66px; padding: 10px 16px; }
  .topbar .eyebrow, .profile-copy, .connection-pill { display: none; }
  .site-picker { margin: 0; }
  .top-actions { gap: 4px; }
  .profile-button { padding: 0; }
  main { padding: 26px 14px 105px; }
  .intro-row { align-items: start; }
  .freshness { display: none; }
  .metrics { display: flex; margin-right: -14px; padding-right: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .metric-card { min-width: 78vw; scroll-snap-align: start; }
  .content-grid { gap: 10px; margin-top: 10px; }
  .panel { border-radius: 18px; }
  .panel-head { align-items: start; padding: 19px 17px; }
  .summary-chips { display: grid; gap: 5px; }
  .equipment-header { display: none; }
  .equipment-row { grid-template-columns: 1fr auto; gap: 7px; min-height: 76px; padding: 12px 17px; }
  .equipment-row > :nth-child(3), .equipment-row > :nth-child(4) { display: none; }
  .row-arrow { grid-column: 2; grid-row: 1; }
  .system-visual { margin-inline: 17px; }
  .control-values { margin-inline: 17px; }
  .control-values div { padding: 10px; }
  .setpoint-block, .command-row { margin-inline: 17px; }
  .command-row { grid-template-columns: 1fr; }
  .command-note { margin-inline: 17px; }
  .event-item { grid-template-columns: 9px 1fr auto; gap: 10px; padding-inline: 17px; }
  .event-message { grid-column: 2 / -1; }
  .events-panel { margin-top: 10px; }
  .points-panel { margin-top: 10px; }
  .points-grid { grid-template-columns: 1fr; }
  .point-card, .point-card:nth-child(2n), .point-card:nth-child(3n) { border-right: 0; }
  .mobile-nav { position: fixed; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; z-index: 40; display: grid; grid-template-columns: repeat(auto-fit,minmax(60px,1fr)); padding: 6px; border: 1px solid var(--line); border-radius: 17px; background: rgba(10,21,18,.92); box-shadow: 0 15px 50px rgba(0,0,0,.45); backdrop-filter: blur(22px); }
  .mobile-nav button { display: grid; justify-items: center; gap: 2px; min-height: 48px; border: 0; border-radius: 12px; background: transparent; color: var(--muted-2); font-size: .65rem; }
  .mobile-nav button span { font-size: 1rem; }
  .mobile-nav button.is-active { background: rgba(185,242,39,.08); color: var(--signal); }
  .toast { right: 14px; bottom: 88px; left: 14px; min-width: 0; }
  .camera-head { display: grid; }
  .camera-actions { width: 100%; justify-content: space-between; }
  .camera-body { padding: 12px 12px 16px; }
  .camera-stage { border-radius: 12px; }
  .camera-meta { grid-template-columns: 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; }
}

/* TAKT visual layer 1.0. Control logic and DOM identifiers are unchanged. */
:root{--bg:#171d23;--bg-elevated:#1b252d;--panel:#222b33;--panel-strong:#29343e;--paper:#222b33;--ink:#f0f3f5;--text:#f0f3f5;--muted:#b1bdc8;--muted-2:#94a4b1;--line:#3a4651;--line-soft:rgba(173,192,207,.17);--deep:#11181e;--deep2:#28343e;--signal:#ff783e;--signal-strong:#ff9b6b;--accent:#ff783e;--cyan:#91bedc;--violet:#b4becb;--amber:#f6c764;--warning:#f6c764;--red:#ff807d;--danger:#ff807d;--radius-lg:6px;--radius-md:5px;--radius-sm:4px;font-family:Arial,"Segoe UI",sans-serif}
body{background:#171d23;font-family:Arial,"Segoe UI",sans-serif}
.sidebar{background:#11181e;border-color:#3a4651;backdrop-filter:none}
.brand,.login-mark{font-size:2.1rem;letter-spacing:-.06em;font-weight:900;gap:0;color:#f0f3f5}
.brand-mark{display:none}.brand span,.login-mark span{line-height:1.1}
.nav-item,.nav-link{border-radius:4px;font-size:.9rem;color:#b1bdc8}
.nav-item.is-active,.nav-link.active{background:#ff783e;border-color:#ff783e;color:#171b20}
.nav-item:hover,.nav-link:hover{color:#fff;background:#303c46}.nav-item.is-active:hover,.nav-link.active:hover{background:#ff9b6b;color:#171b20}
.topbar{background:#1b242b;border-color:#3a4651;backdrop-filter:none}
.panel,.metric-card,.vent-unit-card,.ticket-card,.scene,.resource-card{background:#222b33;border-color:#3a4651;border-radius:6px;box-shadow:none}
.metric-primary,.metric-card:first-child,.metric-card.featured{background:#26333d;color:#f0f3f5}
.metric-primary .metric-value,.metric-primary p,.metric-primary .metric-foot{color:#f0f3f5}
.metric-icon,.metric-icon.cyan,.metric-icon.violet{color:#c2d0db;background:#33434f}
.metric-icon.amber{color:#f6c764;background:#403b2e}
.metric-top .trend.positive{color:#c7d3dc;background:#35424b}
.eyebrow,.side-caption,.nav-group,.login-eyebrow{color:#a7b4c0;font-size:.75rem}
.panel-head,.panel-heading{border-color:#3a4651}
.panel-head h2,.panel-heading h2{letter-spacing:-.025em}
.button,.icon-button,.text-button,input,select,textarea{border-radius:4px}
.button.primary,.button-primary,.scene.active{background:#ff783e;color:#171b20;border-color:#ff783e}
.button.primary:hover,.button-primary:hover{background:#ff9b6b;color:#171b20}
.button.secondary,.button-secondary{background:#29343e;color:#f0f3f5;border-color:#778896}
.button:disabled{opacity:.45;cursor:not-allowed}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid #ffab83;outline-offset:3px}
input,select,textarea,.login-dialog input{background:#18222a;border-color:#566674;color:#f0f3f5}
input[type=range]{accent-color:#ff783e}
.control-panel{background:#222b33;border-color:#465762}.control-accent{background:#ff783e}
.system-visual{background:#1c2730;border-color:#475b6a;border-radius:4px}
.fan-symbol,.duct-line{border-color:#829eb2}.fan-symbol i{background:#a5bac9}.fan-symbol b{background:#d9e4eb}
.control-values,.control-values>div{background:#25313a;border-color:#47545f}
.equipment-row.is-selected{background:#2c3943;border-left-color:#ff783e}.device-glyph{background:#334651;color:#cce0ed;border-radius:4px}
.status,.state-label.good,.positive,.live-badge{color:#78dfa0;background:rgba(87,191,132,.09)}
.status.warning,.state-label.attention{color:#f6c764;background:rgba(246,199,100,.08)}
.pulse,.live-dot,.live-badge i,.gateway-state i,.dot.online{background:#72df9d;box-shadow:none}
.connection-pill{background:#28383a;color:#b6e5cc;border-color:#456257}
.spark-line{stroke:#ff914f}.spark-area{fill:rgba(255,145,79,.09)}
.login-dialog,.confirm-dialog{background:#222b33;color:#f0f3f5;border-color:#546572;border-radius:6px}
.login-dialog::backdrop,.confirm-dialog::backdrop{background:rgba(9,15,22,.85)}
.login-dialog p,.confirm-dialog p,.command-note{color:#b1bdc8}
.toast{background:#293741;border-color:#738a9a;border-radius:4px}
.toast-icon{background:#3b5246;color:#9be2b5}
.mobile-nav{background:#141c23;border-color:#43505b;border-radius:5px}
.mobile-nav button{border-radius:3px;font-size:.75rem;color:#c1cbd3}
.mobile-nav button.is-active{background:#3b2e27;color:#ffab83}
.demo-badge{background:#28343e;color:#c9d4dc;border-color:#596773}
.brand-mark path{stroke:currentColor}
.metric-card:first-child{border-color:#465762}
.metric-card small,.clock,.side-bottom small{color:#a7b4c0}
.avatar{background:#34414b;color:#f0f3f5}
.system-card{background:#222b33;border-color:#3a4651;border-radius:6px}
.system-card:hover{border-color:#ffab83}.system-symbol{background:#39414a;color:#ffab83;border-radius:4px}
.segmented{background:#18222a}.segmented button.selected,.ticket-filter.selected{background:#433328;color:#ffab83;border-color:#ffab83}
.scene.selected,.camera-option.selected,.vent-unit-card.selected{background:#2d3841;border-color:#ffab83;box-shadow:none}
.unit-indicator.running,.ticket-status.resolved{background:#283c32;color:#9be2b5}
.toast{border-left-color:#ff783e}
@media(min-width:721px) and (max-width:1180px){.app-shell .brand span{display:block;font-size:1rem;letter-spacing:-.07em}.app-shell .brand{padding:0}}
@media(max-width:720px){.panel,.metric-card,.control-panel{border-radius:5px}.login-dialog .brand span{display:block}.command-row .button{min-height:48px}.control-values strong{font-size:1.05rem}.metric-card{min-width:78vw}}

#hcPanel{margin-bottom:24px;scroll-margin-top:90px}.hc-summary{display:flex;flex-wrap:wrap;gap:24px;padding:20px}.hc-summary strong{display:block;font-size:24px}.hc-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:0 20px 20px}.hc-card{padding:18px;background:#1b252d;border:1px solid #465762;border-radius:5px;min-width:0}.hc-card h3{font-size:24px}.hc-state{color:#c3d1dc;margin:10px 0 18px}.hc-card dl{margin:0}.hc-card dl>div{border-top:1px solid #3a4651;padding:10px 0}.hc-card dt{font-size:12px;color:#b1bdc8}.hc-card dd{margin:4px 0 0;font-size:18px}.hc-note{padding:0 20px 20px;color:#b1bdc8;font-size:12px}.hc-stale .hc-state{color:#f6c764}a.nav-item{text-decoration:none}@media(max-width:1400px){.hc-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:720px){.hc-grid{grid-template-columns:1fr;padding:0 14px 14px}.hc-summary{padding:14px;gap:16px}#hcPanel .panel-head{flex-wrap:wrap}#hcPanel .panel-head>span{font-size:12px}}

/* Production workspace: the same palette, type and spacing as the TAKT demo. */
.air-diagram{padding:10px 0 15px}.air-diagram svg{width:100%;height:auto;display:block;max-height:160px}.air-diagram text{fill:#d7e1e8;font-family:Arial,sans-serif;font-size:13px}.air-diagram .air-arrow{stroke:#8fbbd9;stroke-width:2;fill:none;stroke-dasharray:7 6}.air-diagram .coil{stroke:#ff6a2e;stroke-width:3;fill:none}#overviewDashboard{margin-top:20px;margin-bottom:24px}
:root{--bg:#171d23;--bg-elevated:#1b242b;--panel:#222b33;--line:#3a4651;--text:#f0f3f5;--muted:#b1bdc8;--muted-2:#a7b4c0;--signal:#ff6a2e;--signal-strong:#ff9b6a;font-family:Arial,'Segoe UI',sans-serif}
body{background:var(--bg);line-height:1.5}.sidebar{width:222px;padding:28px 17px;background:#11181e;backdrop-filter:none}.workspace{margin-left:222px}.brand{padding:0 13px;letter-spacing:-.055em;font-size:38px;line-height:1}.brand span{display:block!important;font-size:38px!important}.brand small{display:block;font-size:9px;letter-spacing:.13em;color:#8f9ba7;font-weight:500;margin-top:12px}.nav-list{margin-top:40px}.nav-item{min-height:48px;border-radius:4px;font-size:14px;grid-template-columns:22px 1fr auto}.nav-item.is-active{background:#ff6a2e;color:#15191d;border-color:transparent}.nav-symbol{font-size:22px}.sidebar-foot{font-size:12px}.gateway-id{color:#a7b4c0}.data-stale .gateway-state i{background:#f6c764}.topbar{position:relative;background:#1b242b;padding:22px 30px;backdrop-filter:none;gap:20px}.profile-button,.site-picker{cursor:default}.profile-button>span:first-child{background:#33414b;color:#f0f3f5;border-radius:4px}.connection-pill{border-radius:4px}.pulse-dot{background:#72df9d}.pulse-dot:after{display:none}main{padding:30px;max-width:1680px}h1{font-size:28px;font-weight:650}.panel,.metric-card{border-radius:5px;box-shadow:none}.intro-row{margin-bottom:25px}.eyebrow{font-size:11px;font-weight:500;letter-spacing:.13em}.metrics{gap:18px;margin-bottom:23px}.metric-card{padding:20px;min-height:160px}.metric-value strong{font-size:35px}.metric-value{flex-wrap:wrap}.metric-value>span{font-size:12px}.metric-icon{width:30px;height:30px}.metric-foot{font-size:11px}.dashboard-grid{display:grid;grid-template-columns:1.3fr 1fr;gap:20px}.workspace-notice{color:#b8c8d2;font-size:13px;margin-bottom:20px}.workspace-notice.is-stale{padding:12px 16px;border:1px solid #775e2b;background:#3a3426;color:#efdaad;border-radius:4px}.panel-head{padding:19px 21px}.panel-head h2{font-size:19px}.system-code{font-size:28px;color:#9faeba;font-weight:600}.system-code.cold{color:#91cfff}.system-entry-body{padding:22px}.muted{color:var(--muted);font-size:13px}.air-schematic{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#1b252e;border:1px solid #50606c;padding:18px 14px;margin:0 0 20px;min-height:106px}.air-schematic>span{font-size:12px}.air-schematic .air-fan{font-size:40px;color:#b6c4ce;line-height:1;text-align:center}.air-fan small{display:block;font-size:11px;margin-top:7px}.air-schematic>b{color:#91cfff}.cold-machines{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-bottom:20px;min-height:106px;align-items:center}.cold-machines span{border:1px solid #506b7c;background:#1b252e;padding:19px 5px;text-align:center;color:#b8deef;border-radius:4px}.system-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:25px;flex-wrap:wrap}.system-footer strong{font-size:13px;font-weight:500}.system-footer .button{font-size:13px}.overview-events{margin-top:20px}.overview-event{display:flex;gap:20px;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}.overview-event span{color:#f6c764}.content-grid{margin-top:0;grid-template-columns:minmax(0,1.3fr) minmax(320px,1fr);gap:20px}.control-panel{border-color:var(--line)}.control-accent{display:none}.fan-symbol{animation:none!important}.fan-symbol i{animation:none!important}.equipment-row{grid-template-columns:minmax(130px,1.3fr) minmax(95px,1fr) minmax(75px,.8fr) 24px}.equipment-row>[role=cell]:nth-child(4),.equipment-header>[role=columnheader]:nth-child(4){display:none}.equipment-row{padding:16px 20px}.device-glyph{display:none}.system-visual{height:130px}.live-badge{color:#b1bdc8;background:transparent;font-size:11px}.hc-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;padding:24px}.hc-summary p{color:#b1bdc8;font-size:13px}.hc-summary strong{font-size:32px;color:#d9edf7;font-weight:600;margin-top:8px}.hc-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.hc-card{padding:22px}.hc-card h3{font-size:25px;margin:0}.hc-card dl{display:grid;grid-template-columns:1fr 1fr;column-gap:20px}.hc-card dd{font-size:20px}.hc-state{font-size:14px}.hc-note{font-size:13px}#hcPanel>.panel-head>span{font-size:12px;color:#b1bdc8}.hc-stale>.panel-head>span{color:#f6c764}.points-panel{margin-top:20px}.button.primary{background:#ff6a2e}.data-stale .status{color:#f6c764;background:#3a3426}.data-stale .system-visual{opacity:.6}.login-dialog .brand{margin-bottom:28px}.login-dialog{max-width:460px}.top-actions{min-width:0}
@media(max-width:1180px) and (min-width:721px){.sidebar{width:200px;padding:25px 12px}.workspace{margin-left:200px}.sidebar .brand{padding:0 10px}.sidebar .brand span{font-size:35px!important}.sidebar .nav-item span{display:block}.sidebar .nav-item{grid-template-columns:20px 1fr auto}.sidebar-foot{display:block}.dashboard-grid,.content-grid{grid-template-columns:1fr}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar{padding:20px}.top-actions .profile-button{display:none}main{padding:24px 20px}.hc-summary strong{font-size:25px}}
@media(max-width:720px){.sidebar{display:none}.workspace{margin-left:0}.topbar{padding:18px 16px;display:block}.top-actions{margin-top:12px}.top-actions .profile-button,.top-actions .icon-button{display:none}.connection-pill{display:flex;font-size:12px;padding:6px 9px;width:max-content;max-width:100%}main{padding:23px 16px 100px}.intro-row{gap:12px;align-items:start}h1{font-size:25px}.freshness{font-size:10px;min-width:80px}.metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;gap:10px}.metric-card{min-width:0;min-height:145px;padding:14px}.metric-value strong{font-size:28px}.metric-value{gap:5px}.metric-card p{font-size:12px}.metric-top .trend{display:none}.metric-foot{flex-wrap:wrap;gap:5px}.dashboard-grid,.content-grid{display:grid;grid-template-columns:1fr;gap:17px}.system-entry-body{padding:17px}.system-footer{margin-top:20px}.panel-head{padding:17px}.panel-head h2{font-size:18px}.system-code{font-size:23px}.overview-event{flex-direction:column;gap:4px}.mobile-nav{position:fixed;inset:auto 0 0;display:flex;border-radius:0;background:#141c23;padding:8px 4px calc(8px + env(safe-area-inset-bottom));gap:0}.mobile-nav button{flex:1;min-width:0;font-size:10px;padding:6px 2px}.mobile-nav button span{font-size:19px}.hc-summary{grid-template-columns:1fr 1fr;gap:18px;padding:17px}.hc-summary strong{font-size:25px}.hc-grid{grid-template-columns:1fr;padding:0 14px 14px}.hc-card{padding:17px}.hc-card dd{font-size:18px}.hc-note{padding:0 17px 17px}.equipment-row{grid-template-columns:minmax(100px,1fr) minmax(75px,.8fr) 24px;padding:14px}.equipment-row .parameter,.equipment-header>[role=columnheader]:nth-child(3){display:none}.points-grid{grid-template-columns:1fr 1fr}.point-card{min-width:0;overflow-wrap:anywhere}.panel-head{flex-wrap:wrap}.system-visual{height:120px}.control-panel{order:0}.freshness strong{font-size:10px}.brand span{font-size:35px!important}}
