/* ==========================================================================
   VLXF OS — visual system
   ========================================================================== */
:root {
  --bg: #070a0c;
  --bg-elev: #0a0f11;
  --panel: #0f1518;
  --panel-2: #131b1e;
  --panel-3: #182125;
  --line: rgba(226, 244, 235, 0.085);
  --line-strong: rgba(226, 244, 235, 0.16);
  --text: #eef4ef;
  --text-2: #c8d2cd;
  --muted: #89958f;
  --dim: #5d6a65;
  --mint: #7df0c6;
  --mint-2: #3bd1a3;
  --mint-soft: rgba(125, 240, 198, 0.11);
  --cyan: #73d9e8;
  --blue: #7ea9ff;
  --amber: #f2bd67;
  --orange: #ff955f;
  --red: #ff6f68;
  --violet: #b9a4ff;
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 238px;
  --topbar-h: 66px;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", "Menlo", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-width: 1180px;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% -8%, rgba(72, 166, 137, 0.08), transparent 33%),
    radial-gradient(circle at 86% 4%, rgba(64, 111, 132, 0.09), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(190, 232, 215, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 232, 215, 0.024) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 72%);
}
::selection { background: rgba(125, 240, 198, 0.25); color: #fff; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(177, 200, 190, 0.17); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(177, 200, 190, 0.3); }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.icon-wrap { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon { display: block; }
.hidden { display: none !important; }

/* ambient */
.ambient { position: fixed; width: 500px; height: 500px; border-radius: 50%; pointer-events: none; filter: blur(100px); opacity: 0.16; z-index: 0; }
.ambient-a { top: -210px; left: 20%; background: #2e8f76; }
.ambient-b { top: 35%; right: -260px; background: #2e6070; opacity: 0.12; }

/* ==========================================================================
   Shell
   ========================================================================== */
.app-shell { position: relative; z-index: 1; display: flex; height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 21px 14px 14px;
  background: linear-gradient(180deg, rgba(10, 15, 17, 0.96), rgba(7, 11, 12, 0.96));
  border-right: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.brand-row { display: flex; align-items: center; gap: 8px; padding: 0 8px 22px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0; flex: 1; min-width: 0; }
.brand-mark {
  width: 37px; height: 37px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(125, 240, 198, 0.15), rgba(125, 240, 198, 0.03));
  border: 1px solid rgba(125, 240, 198, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 25px rgba(40, 175, 130, 0.08);
}
.brand-mark svg { width: 27px; height: 27px; fill: none; stroke: var(--mint); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.brand-mark svg circle { fill: var(--mint); stroke: none; }
.brand-type { display: flex; flex-direction: column; line-height: 1.2; }
.brand-type b { font-size: 14px; letter-spacing: 0.1em; font-weight: 650; }
.brand-type em { font-style: normal; color: var(--mint); font-weight: 500; letter-spacing: 0.03em; }
.brand-type small { margin-top: 4px; font-size: 8.5px; color: var(--dim); letter-spacing: 0.12em; }
.soda-brand {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  height: 28px; padding-left: 9px; border-left: 1px solid var(--line);
  opacity: 0.84; transition: 180ms var(--ease);
}
.soda-brand img { display: block; width: auto; height: 20px; }
.soda-brand:hover { opacity: 1; transform: translateY(-1px); }

.site-switcher {
  display: flex; align-items: center; gap: 9px;
  margin: 0 4px 20px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer; transition: 180ms var(--ease);
}
.site-switcher:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.032); }
.site-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(125, 240, 198, 0.09); color: var(--mint); font: 600 11px var(--mono); border: 1px solid rgba(125, 240, 198, 0.16); }
.site-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.site-copy small { color: var(--dim); font-size: 8px; letter-spacing: 0.08em; margin-bottom: 2px; }
.site-copy b { font-size: 11px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-chevron { color: var(--dim); transform: scale(0.8); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 0 10px 9px; font: 500 8.5px var(--mono); letter-spacing: 0.14em; color: #4e5b56; text-transform: uppercase; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 42px; padding: 0 11px; border-radius: 9px;
  color: #8e9b95; transition: 160ms var(--ease);
}
.nav-item:hover { color: var(--text-2); background: rgba(255, 255, 255, 0.028); }
.nav-item.active { color: var(--text); background: linear-gradient(90deg, rgba(125, 240, 198, 0.105), rgba(125, 240, 198, 0.015)); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--mint); box-shadow: 0 0 10px rgba(125, 240, 198, 0.5); }
.nav-item.active .nav-icon { color: var(--mint); }
.nav-icon { color: #65736d; transition: 160ms; }
.nav-copy { display: flex; flex-direction: column; gap: 1px; }
.nav-copy b { font-size: 12px; font-weight: 500; letter-spacing: 0.02em; }
.nav-copy small { font: 400 7.5px var(--mono); color: #4d5a55; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-item.active .nav-copy small { color: rgba(125, 240, 198, 0.5); }
.nav-badge { margin-left: auto; min-width: 18px; height: 17px; padding: 0 5px; border-radius: 5px; background: rgba(255, 111, 104, 0.14); color: #ff938b; font: 600 9px var(--mono); display: grid; place-items: center; }
.nav-chevron { margin-left: auto; opacity: 0.25; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.engine-card {
  position: relative; overflow: hidden;
  margin: 0 2px 4px; padding: 12px;
  border-radius: 11px;
  border: 1px solid rgba(125, 240, 198, 0.13);
  background:
    radial-gradient(circle at 100% 0, rgba(125, 240, 198, 0.09), transparent 48%),
    linear-gradient(150deg, rgba(125, 240, 198, 0.04), rgba(255, 255, 255, 0.012));
}
.engine-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 30%, rgba(125, 240, 198, 0.03) 50%, transparent 70%); }
.engine-top { display: flex; align-items: center; gap: 7px; }
.engine-orb { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(125, 240, 198, 0.22); background: rgba(125, 240, 198, 0.06); }
.engine-orb i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 9px var(--mint); animation: breathe 2.4s infinite; }
.engine-top > div { display: flex; flex-direction: column; line-height: 1.25; }
.engine-top b { font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; }
.engine-top small { font: 400 7.5px var(--mono); letter-spacing: 0.06em; color: var(--dim); }
.engine-live { margin-left: auto; font: 600 7px var(--mono); letter-spacing: 0.1em; color: var(--mint); padding: 3px 5px; border: 1px solid rgba(125, 240, 198, 0.22); border-radius: 4px; background: rgba(125, 240, 198, 0.05); }
.engine-stat { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 9px; }
.engine-stat b { color: var(--text); font: 500 11px var(--mono); }
.engine-meter { height: 3px; border-radius: 3px; margin-top: 9px; overflow: hidden; background: rgba(255, 255, 255, 0.07); }
.engine-meter i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--mint-2), var(--mint)); box-shadow: 0 0 8px rgba(125, 240, 198, 0.4); }
.engine-meta { display: flex; justify-content: space-between; margin-top: 6px; font: 400 7.5px var(--mono); color: #53615b; }
.side-link { display: flex; align-items: center; gap: 9px; padding: 8px 10px; color: #6f7c76; border-radius: 8px; font-size: 10.5px; }
.side-link:hover { color: var(--text-2); background: rgba(255, 255, 255, 0.025); }
.side-link span[data-icon] { transform: scale(0.88); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 10px 8px 1px; border-top: 1px solid var(--line); }
.side-user > div { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.side-user b { font-size: 11px; font-weight: 500; }
.side-user small { font-size: 8.5px; color: var(--dim); }
.avatar { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; color: #c4f5e3; font-size: 11px; font-weight: 600; background: linear-gradient(145deg, rgba(125, 240, 198, 0.2), rgba(125, 240, 198, 0.05)); border: 1px solid rgba(125, 240, 198, 0.18); }
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }

.workspace { flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 14, 0.72);
  backdrop-filter: blur(18px);
  position: relative; z-index: 15;
}
.topbar-left { display: flex; align-items: center; gap: 10px; width: 245px; }
.crumbs { display: flex; align-items: center; gap: 9px; font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.crumbs b { font-weight: 500; color: var(--text-2); }
.crumbs i { color: #3c4a45; font-style: normal; }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.global-status { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.018); color: var(--muted); font-size: 9.5px; }
.global-status i { width: 1px; height: 11px; background: var(--line-strong); margin: 0 2px; }
.global-status .mono { color: var(--text-2); font-size: 9.5px; letter-spacing: 0.04em; }
.pulse-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(125, 240, 198, 0.09), 0 0 9px rgba(125, 240, 198, 0.5); animation: breathe 2.4s infinite; }
.topbar-right { display: flex; align-items: center; gap: 9px; justify-content: flex-end; width: 420px; }
.search-trigger {
  height: 32px; min-width: 252px; display: flex; align-items: center; gap: 8px;
  padding: 0 9px 0 11px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255, 255, 255, 0.018); color: #65726d; font-size: 9.5px; transition: 160ms;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--muted); background: rgba(255, 255, 255, 0.03); }
.search-trigger span:nth-child(2) { flex: 1; text-align: left; }
.search-trigger kbd { font: 500 8px var(--mono); color: #54615c; border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; background: rgba(255, 255, 255, 0.02); }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #84918b; border: 1px solid transparent; transition: 160ms; position: relative; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.icon-btn.subtle { width: 24px; height: 24px; }
.notify-dot { position: absolute; right: 7px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); border: 1.5px solid #0a0e10; }
.top-divider { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.top-user { display: flex; align-items: center; gap: 8px; padding: 2px 2px 2px 4px; border-radius: 7px; }
.top-user:hover { background: rgba(255, 255, 255, 0.03); }
.top-user-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.2; }
.top-user-copy b { font-size: 10px; font-weight: 500; }
.top-user-copy small { font-size: 8px; color: var(--dim); }
.top-user .tiny { color: #53605b; transform: scale(0.75); }
.mobile-menu { display: none; }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 25px 28px 40px; scroll-behavior: smooth; }
.view > * { animation: pageIn 480ms var(--ease) both; }
@keyframes pageIn { from { opacity: 1; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ==========================================================================
   Shared atoms
   ========================================================================== */
.page { max-width: 1640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 2px 2px 5px; }
.page-head .eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--dim); font: 500 8.5px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; }
.page-head .eyebrow::before { content: ""; width: 16px; height: 1px; background: var(--mint); opacity: 0.7; }
.page-head h1 { font-size: 27px; line-height: 1.15; font-weight: 560; letter-spacing: -0.035em; }
.page-head h1 em { font-style: normal; color: var(--mint); }
.page-head p { margin-top: 7px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.page-head p b { color: var(--text-2); font-weight: 500; }
.page-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-bottom: 2px; }
.head-meta { display: flex; align-items: center; gap: 8px; color: var(--dim); font: 400 9px var(--mono); }

.btn {
  height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.025); color: var(--text-2); font-size: 10.5px; font-weight: 500;
  white-space: nowrap; transition: 160ms var(--ease);
}
.btn:hover { border-color: rgba(226, 244, 235, 0.28); background: rgba(255, 255, 255, 0.05); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(180deg, #8af4cd, #5edcb4); border-color: rgba(125, 240, 198, 0.7); color: #08211a; box-shadow: 0 4px 16px rgba(60, 210, 163, 0.14); font-weight: 600; }
.btn-primary:hover { background: linear-gradient(180deg, #9ffbd7, #6be7c0); color: #061b15; border-color: var(--mint); box-shadow: 0 6px 20px rgba(60, 210, 163, 0.22); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.035); border-color: var(--line); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 9.5px; border-radius: 7px; }
.btn-danger { color: #ff9c96; border-color: rgba(255, 111, 104, 0.23); background: rgba(255, 111, 104, 0.06); }
.btn .icon { opacity: 0.8; }

.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.01)), var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.panel-head.tight { padding: 12px 14px 0; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 560; color: var(--text); letter-spacing: 0.01em; }
.panel-title .icon { color: var(--mint); opacity: 0.9; }
.panel-title small { font: 400 8px var(--mono); color: var(--dim); letter-spacing: 0.04em; }
.panel-sub { margin-top: 5px; color: var(--dim); font-size: 9px; }
.panel-body { padding: 14px 16px; }
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head-row .panel-head { padding: 0; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9.5px; }
.link-btn:hover { color: var(--mint); }
.link-btn .icon { opacity: 0.7; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: 5px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); color: var(--muted); font: 500 8.5px var(--mono); letter-spacing: 0.02em; white-space: nowrap; }
.pill.mint { color: var(--mint); border-color: rgba(125, 240, 198, 0.17); background: rgba(125, 240, 198, 0.065); }
.pill.amber { color: var(--amber); border-color: rgba(242, 189, 103, 0.17); background: rgba(242, 189, 103, 0.06); }
.pill.red { color: #ff958e; border-color: rgba(255, 111, 104, 0.18); background: rgba(255, 111, 104, 0.065); }
.pill.blue { color: var(--blue); border-color: rgba(126, 169, 255, 0.17); background: rgba(126, 169, 255, 0.06); }
.pill.violet { color: var(--violet); border-color: rgba(185, 164, 255, 0.17); background: rgba(185, 164, 255, 0.06); }
.pill.gray { color: #93a099; }
.pill .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.tag { display: inline-flex; align-items: center; color: #92a19a; font-size: 9px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255, 255, 255, 0.02); white-space: nowrap; }
.severity { display: inline-flex; align-items: center; gap: 5px; font-size: 8.5px; font-weight: 500; white-space: nowrap; }
.severity::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.severity.critical { color: var(--red); }
.severity.high { color: var(--orange); }
.severity.medium { color: var(--amber); }
.severity.low { color: var(--blue); }

.status-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; margin-right: 5px; background: var(--mint); box-shadow: 0 0 6px rgba(125, 240, 198, 0.6); }
.status-dot.offline { background: #5b6661; box-shadow: none; }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 6px rgba(242, 189, 103, 0.5); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 7px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.14); }
.seg { height: 24px; padding: 0 9px; display: flex; align-items: center; gap: 5px; border-radius: 5px; color: var(--dim); font-size: 9px; white-space: nowrap; transition: 140ms; }
.seg:hover { color: var(--muted); }
.seg.active { color: var(--text); background: rgba(255, 255, 255, 0.06); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.seg .icon { opacity: 0.7; }
.seg.active .icon { color: var(--mint); opacity: 1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { color: #95a29c; font-size: 9.5px; font-weight: 500; }
.field > label em { color: var(--mint); font-style: normal; margin-left: 3px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px;
  background: rgba(0, 0, 0, 0.18); color: var(--text); padding: 9px 10px;
  font-size: 10px; outline: none; transition: 150ms;
}
.input { height: 34px; }
.select { height: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8882' stroke-width='1.6'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(125, 240, 198, 0.45); box-shadow: 0 0 0 3px rgba(125, 240, 198, 0.06); }
.input::placeholder, .textarea::placeholder { color: #586660; }
.textarea { resize: vertical; min-height: 80px; line-height: 1.7; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { color: #5e6b65; font-size: 8.5px; line-height: 1.6; }
.switch { width: 32px; height: 18px; padding: 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); position: relative; transition: 180ms; flex: 0 0 auto; }
.switch i { display: block; width: 12px; height: 12px; border-radius: 50%; background: #89958f; transition: 180ms var(--ease); }
.switch.on { background: rgba(125, 240, 198, 0.18); border-color: rgba(125, 240, 198, 0.3); }
.switch.on i { transform: translateX(14px); background: var(--mint); box-shadow: 0 0 7px rgba(125, 240, 198, 0.5); }

/* ==========================================================================
   Overview
   ========================================================================== */
.overview-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.overview-intro .headline-row { display: flex; align-items: center; gap: 10px; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 20px; border: 1px solid rgba(125, 240, 198, 0.16); background: rgba(125, 240, 198, 0.055); color: var(--mint); font-size: 8.5px; margin-bottom: 9px; }
.live-tag::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 6px var(--mint); animation: breathe 1.8s infinite; }
.overview-intro h1 { font-size: 30px; font-weight: 520; letter-spacing: -0.04em; }
.overview-intro h1 span { color: #75837d; font-weight: 300; }
.overview-intro p { color: var(--muted); font-size: 10.5px; margin-top: 8px; }
.overview-intro p b { color: var(--text-2); font-weight: 500; }
.overview-actions { display: flex; gap: 8px; align-items: center; }
.date-block { text-align: right; margin-right: 10px; color: var(--dim); }
.date-block b { display: block; color: var(--text-2); font: 400 10px var(--mono); letter-spacing: 0.04em; }
.date-block small { font: 400 8px var(--mono); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi-card { min-height: 114px; padding: 14px 15px 11px; position: relative; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; right: -22px; bottom: -34px; width: 110px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(125, 240, 198, 0.045), transparent 65%); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { color: #84918b; font-size: 9.5px; letter-spacing: 0.02em; }
.kpi-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--mint); background: rgba(125, 240, 198, 0.07); border: 1px solid rgba(125, 240, 198, 0.11); }
.kpi-icon.amber { color: var(--amber); background: rgba(242, 189, 103, 0.06); border-color: rgba(242, 189, 103, 0.13); }
.kpi-icon.blue { color: var(--blue); background: rgba(126, 169, 255, 0.06); border-color: rgba(126, 169, 255, 0.12); }
.kpi-icon.red { color: var(--red); background: rgba(255, 111, 104, 0.06); border-color: rgba(255, 111, 104, 0.13); }
.kpi-value-row { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.kpi-value { font: 430 28px var(--mono); letter-spacing: -0.06em; line-height: 1; }
.kpi-unit { color: var(--dim); font-size: 9px; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 10px; }
.kpi-note { color: var(--dim); font-size: 8.5px; line-height: 1.45; }
.kpi-note b { color: var(--mint); font-weight: 500; }
.kpi-note.amber b { color: var(--amber); }
.kpi-note.red b { color: #ff958e; }
.kpi-spark { width: 74px; height: 24px; opacity: 0.8; }

.pipeline { display: flex; align-items: stretch; min-height: 91px; }
.pipeline-label { flex: 0 0 170px; padding: 15px 16px; border-right: 1px solid var(--line); position: relative; overflow: hidden; }
.pipeline-label::after { content: ""; position: absolute; inset: 0; background: linear-gradient(140deg, rgba(125, 240, 198, 0.04), transparent 70%); pointer-events: none; }
.pipeline-label .micro { color: var(--dim); font: 400 7.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.pipeline-label b { display: block; margin-top: 7px; font-size: 11.5px; font-weight: 550; }
.pipeline-label p { margin-top: 4px; color: var(--dim); font-size: 8.5px; line-height: 1.5; }
.pipe-flow { flex: 1; display: grid; grid-template-columns: 1fr 26px 1fr 26px 1fr 26px 1fr 26px 1fr; align-items: center; padding: 10px 14px; }
.pipe-node { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pipe-node-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #8fa198; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); flex: 0 0 auto; }
.pipe-node.hot .pipe-node-icon { color: var(--mint); border-color: rgba(125, 240, 198, 0.18); background: rgba(125, 240, 198, 0.07); box-shadow: 0 0 24px rgba(78, 209, 165, 0.06); }
.pipe-copy { min-width: 0; }
.pipe-copy b { display: block; font: 500 13px var(--mono); letter-spacing: -0.03em; white-space: nowrap; }
.pipe-copy b small { font: 400 8px var(--sans); color: var(--dim); margin-left: 3px; letter-spacing: 0; }
.pipe-copy span { display: block; margin-top: 2px; color: var(--dim); font-size: 8px; white-space: nowrap; }
.pipe-link { height: 1px; position: relative; margin: 0 6px; background: linear-gradient(90deg, var(--line-strong), rgba(125, 240, 198, 0.2), var(--line-strong)); }
.pipe-link::after { content: ""; position: absolute; top: -2px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); opacity: 0; animation: flowDot 3.8s infinite; }
.pipe-link:nth-of-type(2)::after { animation-delay: 0.8s; }
.pipe-link:nth-of-type(3)::after { animation-delay: 1.6s; }
.pipe-link:nth-of-type(4)::after { animation-delay: 2.4s; }
@keyframes flowDot { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 5px); opacity: 0; } }

.overview-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr); gap: 12px; }
.featured-panel { min-height: 338px; display: flex; flex-direction: column; }
.featured-stage { position: relative; flex: 1; margin: 12px 14px 0; border-radius: 10px; overflow: hidden; background: #050808; min-height: 248px; }
.featured-stage canvas { width: 100%; height: 100%; position: absolute; inset: 0; filter: brightness(1.13) contrast(1.02); }
.stage-body canvas, .video-tile canvas { filter: brightness(1.14) contrast(1.03) saturate(1.04); }
.feature-topline { position: absolute; top: 0; left: 0; right: 0; padding: 11px 12px; display: flex; align-items: flex-start; justify-content: space-between; z-index: 4; background: linear-gradient(180deg, rgba(2, 6, 6, 0.72), transparent); }
.feature-id { display: flex; align-items: center; gap: 7px; }
.cam-badge { display: inline-flex; align-items: center; gap: 5px; color: #eaf4ee; font: 500 8.5px var(--mono); background: rgba(5, 9, 9, 0.56); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 5px; padding: 4px 6px; backdrop-filter: blur(8px); }
.cam-badge .rec { width: 4px; height: 4px; border-radius: 50%; background: #ff6f68; box-shadow: 0 0 6px #ff6f68; animation: breathe 1.4s infinite; }
.feature-name { color: rgba(238, 247, 241, 0.8); font-size: 9px; text-shadow: 0 1px 4px #000; }
.feature-vlm { display: flex; align-items: center; gap: 6px; color: var(--mint); font: 500 8px var(--mono); background: rgba(7, 17, 14, 0.62); border: 1px solid rgba(125, 240, 198, 0.2); padding: 4px 7px; border-radius: 5px; backdrop-filter: blur(8px); }
.feature-vlm .spark-wave { display: flex; gap: 2px; align-items: center; height: 8px; }
.feature-vlm .spark-wave i { width: 1.5px; background: var(--mint); border-radius: 2px; animation: wave 1.2s infinite ease-in-out; }
.feature-vlm .spark-wave i:nth-child(1) { height: 3px; animation-delay: 0s; }
.feature-vlm .spark-wave i:nth-child(2) { height: 7px; animation-delay: .15s; }
.feature-vlm .spark-wave i:nth-child(3) { height: 5px; animation-delay: .3s; }
.feature-vlm .spark-wave i:nth-child(4) { height: 8px; animation-delay: .45s; }
@keyframes wave { 0%,100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
.feature-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; z-index: 4; background: linear-gradient(0deg, rgba(2, 6, 6, 0.82), transparent); }
.semantic-caption { display: flex; align-items: flex-start; gap: 7px; color: rgba(235, 244, 238, 0.85); font-size: 9.5px; line-height: 1.55; text-shadow: 0 1px 3px #000; }
.semantic-caption .icon { color: var(--mint); margin-top: 1px; }
.feature-meta-line { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.feature-meta-line .left { display: flex; gap: 6px; align-items: center; }
.feed-time { color: rgba(233, 241, 234, 0.55); font: 400 8px var(--mono); letter-spacing: 0.04em; }
.det-box { position: absolute; z-index: 3; border: 1px solid rgba(125, 240, 198, 0.78); background: rgba(125, 240, 198, 0.045); box-shadow: 0 0 0 1px rgba(2, 8, 6, 0.3), 0 0 14px rgba(125, 240, 198, 0.06); pointer-events: none; }
.det-box.warn { border-color: rgba(242, 189, 103, 0.9); background: rgba(242, 189, 103, 0.055); }
.det-box.danger { border-color: rgba(255, 111, 104, 0.92); background: rgba(255, 111, 104, 0.055); }
.det-box .lbl { position: absolute; top: -17px; left: -1px; display: flex; gap: 4px; align-items: center; height: 16px; padding: 0 5px; background: rgba(7, 19, 15, 0.9); border: 1px solid rgba(125, 240, 198, 0.55); border-bottom: 0; color: var(--mint); font: 500 7.5px var(--mono); white-space: nowrap; }
.det-box.warn .lbl { color: var(--amber); border-color: rgba(242, 189, 103, 0.55); background: rgba(24, 18, 8, 0.9); }
.det-box.danger .lbl { color: #ff9992; border-color: rgba(255, 111, 104, 0.55); background: rgba(25, 10, 9, 0.9); }
.det-box .lbl b { font-weight: 600; }
.det-box .lbl span { opacity: 0.65; font-weight: 400; }

.recent-events { min-height: 338px; display: flex; flex-direction: column; }
.event-count { font: 500 8.5px var(--mono); color: var(--red); }
.event-list { flex: 1; padding: 3px 11px 8px; }
.event-item { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.045); cursor: pointer; transition: 140ms; position: relative; }
.event-item:last-child { border-bottom: 0; }
.event-item:hover { background: rgba(255, 255, 255, 0.018); }
.event-sev { width: 2px; border-radius: 2px; flex: 0 0 2px; align-self: stretch; background: var(--amber); opacity: 0.75; }
.event-sev.critical { background: var(--red); }
.event-sev.high { background: var(--orange); }
.event-sev.medium { background: var(--amber); }
.event-sev.low { background: var(--blue); }
.event-content { flex: 1; min-width: 0; }
.event-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.event-row1 b { font-size: 10px; font-weight: 500; color: var(--text-2); }
.event-row1 time { color: var(--dim); font: 400 8px var(--mono); }
.event-row2 { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--dim); font-size: 8.5px; }
.event-row2 .event-cam { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-row2 i { width: 2px; height: 2px; border-radius: 50%; background: #4b5953; }
.event-conf { color: #81918a; font: 400 8px var(--mono); }
.event-status { margin-left: auto; font-size: 8px; padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.035); color: var(--muted); }
.event-status.pending { color: #ff988f; background: rgba(255, 111, 104, 0.07); }

.overview-bottom { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, 1fr); gap: 12px; }
.trend-panel { min-height: 238px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.chart-legend { display: flex; align-items: center; gap: 13px; margin-top: 3px; }
.legend-item { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 8.5px; }
.legend-item i { width: 10px; height: 2px; border-radius: 2px; background: var(--mint); }
.legend-item.blue i { background: rgba(126, 169, 255, 0.65); }
.chart-summary { display: flex; align-items: center; gap: 16px; padding: 0 16px; margin-top: 4px; }
.chart-big { font: 400 25px var(--mono); letter-spacing: -0.05em; }
.chart-big small { font: 400 8px var(--sans); color: var(--dim); margin-left: 4px; }
.chart-delta { color: var(--mint); font: 500 8.5px var(--mono); }
.chart-area { padding: 2px 8px 6px; }
.chart-svg { display: block; width: 100%; height: 132px; overflow: visible; }
.chart-axis text { fill: #56635d; font: 7px var(--mono); }
.region-panel { min-height: 238px; }
.region-list { display: flex; flex-direction: column; gap: 11px; padding: 14px 16px 16px; }
.region-row { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: 9px; }
.region-name { color: #a4b0aa; font-size: 9px; }
.region-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.055); overflow: hidden; }
.region-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, rgba(125, 240, 198, 0.4), var(--mint)); }
.region-bar i.amber { background: linear-gradient(90deg, rgba(242, 189, 103, 0.35), var(--amber)); }
.region-bar i.red { background: linear-gradient(90deg, rgba(255, 111, 104, 0.35), var(--red)); }
.region-value { text-align: right; color: #7e8d85; font: 400 8.5px var(--mono); }
.region-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; padding-top: 11px; border-top: 1px solid var(--line); }
.region-foot span { color: var(--dim); font-size: 8.5px; }
.region-foot b { color: var(--text-2); font: 500 9px var(--mono); }

/* ==========================================================================
   Streams / ingestion
   ========================================================================== */
.stream-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card { padding: 12px 14px; display: flex; align-items: center; gap: 11px; }
.stat-icon { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; color: var(--mint); background: rgba(125, 240, 198, 0.06); border: 1px solid rgba(125, 240, 198, 0.1); }
.stat-icon.amber { color: var(--amber); background: rgba(242, 189, 103, 0.055); border-color: rgba(242, 189, 103, 0.11); }
.stat-icon.blue { color: var(--blue); background: rgba(126, 169, 255, 0.055); border-color: rgba(126, 169, 255, 0.11); }
.stat-icon.red { color: var(--red); background: rgba(255, 111, 104, 0.055); border-color: rgba(255, 111, 104, 0.11); }
.stat-copy { display: flex; flex-direction: column; gap: 1px; }
.stat-copy b { font: 430 19px var(--mono); letter-spacing: -0.04em; line-height: 1.1; }
.stat-copy span { color: var(--dim); font-size: 8.5px; }
.stat-trend { margin-left: auto; align-self: flex-start; font: 500 8px var(--mono); color: var(--mint); padding: 2px 4px; background: rgba(125, 240, 198, 0.05); border-radius: 4px; }
.stream-panel { overflow: visible; }
.stream-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.stream-toolbar .spacer { flex: 1; }
.filter-search { position: relative; width: 200px; }
.filter-search .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.filter-search input { width: 100%; height: 29px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0, 0, 0, 0.18); padding: 0 10px 0 29px; outline: none; font-size: 9.5px; color: var(--text); }
.filter-search input:focus { border-color: rgba(125, 240, 198, 0.3); }
.filter-select { height: 29px; font-size: 9px; border-radius: 7px; padding: 0 7px; }
.stream-table-wrap { overflow-x: auto; }
.stream-table { width: 100%; border-collapse: collapse; min-width: 870px; }
.stream-table th { text-align: left; padding: 9px 12px; color: #65726d; font: 500 8px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stream-table td { padding: 9px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); vertical-align: middle; }
.stream-table tr:last-child td { border-bottom: 0; }
.stream-table tbody tr { transition: 120ms; cursor: default; }
.stream-table tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
.cam-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.cam-thumb { width: 42px; height: 27px; border-radius: 4px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08); position: relative; background: #0b1112; flex: 0 0 auto; }
.cam-thumb canvas { width: 100%; height: 100%; display: block; }
.cam-thumb::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 2px); pointer-events: none; }
.cam-cell-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cam-cell-copy b { font-size: 10px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 205px; }
.cam-cell-copy span { color: var(--dim); font: 400 8px var(--mono); letter-spacing: 0.03em; }
.proto { display: inline-flex; align-items: center; gap: 4px; color: #8d9a94; font: 400 8.5px var(--mono); }
.proto i { width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); opacity: .65; }
.source-cell { color: #7d8a84; font: 400 8px var(--mono); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quality-cell { display: flex; flex-direction: column; gap: 2px; }
.quality-cell b { color: #98a59f; font: 400 8.5px var(--mono); font-weight: 400; }
.quality-cell span { color: #53615b; font-size: 8px; }
.latency { display: inline-flex; align-items: center; gap: 5px; font: 400 8.5px var(--mono); color: #83918a; }
.latency::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--mint); }
.latency.warn::before { background: var(--amber); }
.ai-cell { display: flex; align-items: center; gap: 6px; }
.ai-spark { width: 23px; height: 12px; opacity: .7; }
.table-actions { display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.row-menu { width: 24px; height: 24px; border-radius: 5px; color: #65736d; display: grid; place-items: center; }
.row-menu:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); }
.table-count { color: var(--dim); font-size: 8.5px; }
.table-count b { color: #a4b0aa; font-weight: 500; }
.pagination { display: flex; align-items: center; gap: 3px; }
.page-btn { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 5px; display: grid; place-items: center; color: #6e7b75; font: 400 8.5px var(--mono); border: 1px solid transparent; }
.page-btn:hover { color: var(--text-2); background: rgba(255,255,255,.04); }
.page-btn.active { color: var(--mint); background: rgba(125, 240, 198, 0.08); border-color: rgba(125, 240, 198, 0.16); }
.side-stack { display: flex; flex-direction: column; gap: 12px; }
.streams-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 12px; align-items: start; }
.gateway-list { padding: 4px 14px 12px; }
.gateway-item { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.045); }
.gateway-item:last-child { border-bottom: 0; }
.gateway-glyph { width: 24px; height: 24px; border-radius: 6px; background: rgba(255,255,255,.03); border: 1px solid var(--line); display: grid; place-items: center; color: #84958c; }
.gateway-copy { flex: 1; min-width: 0; }
.gateway-copy b { display: block; color: #b9c4be; font-size: 9px; font-weight: 500; }
.gateway-copy span { display: block; color: #56635d; font: 400 7.5px var(--mono); margin-top: 2px; }
.gateway-load { width: 34px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.07); overflow: hidden; }
.gateway-load i { display: block; height: 100%; background: var(--mint); }
.gateway-load i.warn { background: var(--amber); }
.protocol-bars { padding: 8px 16px 14px; display: flex; flex-direction: column; gap: 9px; }
.protocol-bar { display: grid; grid-template-columns: 50px 1fr 30px; align-items: center; gap: 8px; }
.protocol-bar span { color: #84938b; font: 400 8px var(--mono); }
.protocol-bar .bar { height: 4px; background: rgba(255,255,255,.055); border-radius: 3px; overflow: hidden; }
.protocol-bar .bar i { display: block; height: 100%; background: rgba(115, 217, 232, 0.6); border-radius: 3px; }
.protocol-bar b { text-align: right; color: #9aa8a1; font: 400 8px var(--mono); }
.ingest-note { margin: 0 14px 14px; padding: 10px; border: 1px dashed rgba(125, 240, 198, 0.16); border-radius: 8px; background: rgba(125, 240, 198, 0.025); }
.ingest-note b { display: block; color: #b7c9bf; font-size: 9px; font-weight: 500; margin-bottom: 3px; }
.ingest-note p { color: #63716a; font-size: 8px; line-height: 1.55; }

/* ==========================================================================
   Live wall
   ========================================================================== */
.wall-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.wall-toolbar .spacer { flex: 1; }
.wall-toolbar .toolbar-label { color: #5f6d67; font: 400 8px var(--mono); letter-spacing: .04em; margin-right: 2px; }
.wall-toolbar .vertical-line { width: 1px; height: 18px; background: var(--line); margin: 0 1px; }
.wall-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wall-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wall-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.video-tile { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #05090a; cursor: pointer; aspect-ratio: 16 / 9; transition: 180ms var(--ease); }
.video-tile:hover { border-color: rgba(125, 240, 198, 0.32); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.video-tile.selected { border-color: rgba(125, 240, 198, 0.55); box-shadow: 0 0 0 1px rgba(125, 240, 198, 0.15), 0 0 30px rgba(70, 209, 164, 0.05); }
.video-tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.video-tile::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px); mix-blend-mode: soft-light; opacity: .55; }
.video-tile .tile-top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: flex-start; justify-content: space-between; padding: 8px 9px; background: linear-gradient(180deg, rgba(2,6,7,.74), transparent); }
.tile-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tile-index { color: var(--mint); font: 500 7.5px var(--mono); background: rgba(7, 17, 15, .7); border: 1px solid rgba(125, 240, 198, .2); border-radius: 3px; padding: 2px 4px; }
.tile-name { color: rgba(239, 247, 241, .9); font-size: 8.5px; text-shadow: 0 1px 4px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.tile-zone { color: rgba(210, 226, 217, .5); font-size: 7.5px; }
.tile-status { display: inline-flex; align-items: center; gap: 4px; color: rgba(233, 245, 236, .72); font: 500 7px var(--mono); background: rgba(4,8,8,.55); border: 1px solid rgba(255,255,255,.1); padding: 3px 5px; border-radius: 4px; backdrop-filter: blur(4px); }
.tile-status i { width: 4px; height: 4px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 5px var(--mint); }
.tile-status.ai { color: var(--mint); border-color: rgba(125,240,198,.19); }
.tile-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 20px 9px 8px; background: linear-gradient(0deg, rgba(2,5,6,.82), transparent); }
.tile-time { color: rgba(226, 239, 230, .72); font: 400 7.5px var(--mono); letter-spacing: .03em; }
.tile-labels { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tile-label { font: 500 7px var(--mono); color: rgba(235,246,238,.8); border: 1px solid rgba(255,255,255,.14); background: rgba(3,8,8,.5); border-radius: 3px; padding: 2px 4px; }
.tile-label.alert { color: #ffa099; border-color: rgba(255,111,104,.32); background: rgba(30,9,8,.56); }
.tile-label.semantic { color: var(--mint); border-color: rgba(125,240,198,.25); background: rgba(4,16,12,.58); }
.tile-detect { position: absolute; z-index: 3; border-color: rgba(125,240,198,.7); }
.tile-detect.warn { border-color: rgba(242,189,103,.95); }
.tile-detect.danger { border-color: rgba(255,111,104,.95); }
.tile-detect .lbl { font-size: 6.5px; height: 14px; top: -15px; padding: 0 4px; }
.tile-region { position: absolute; z-index: 2; pointer-events: none; opacity: .7; }
.wall-footer { display: flex; align-items: center; gap: 18px; padding: 9px 13px; }
.wall-footer .spacer { flex: 1; }
.wall-foot-item { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 8px; }
.wall-foot-item b { color: #a9b4ae; font: 400 8px var(--mono); }
.wall-foot-item .icon { color: #61706a; }
.wall-footer .live-note { color: #63716b; font: 400 8px var(--mono); }
.wall-footer .live-note b { color: var(--mint); }

/* ==========================================================================
   Semantic
   ========================================================================== */
.semantic-layout { display: grid; grid-template-columns: 186px minmax(0, 1fr) 352px; gap: 11px; align-items: start; }
.camera-rail { padding: 11px 8px; max-height: 820px; overflow-y: auto; }
.rail-label { display: flex; align-items: center; justify-content: space-between; padding: 1px 6px 9px; color: #596760; font: 500 7.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.rail-label span { color: #45524d; }
.rail-item { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 7px; cursor: pointer; border: 1px solid transparent; transition: 130ms; margin-bottom: 2px; }
.rail-item:hover { background: rgba(255,255,255,.025); }
.rail-item.active { background: rgba(125,240,198,.07); border-color: rgba(125,240,198,.15); }
.rail-thumb { width: 55px; height: 33px; border-radius: 4px; overflow: hidden; position: relative; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.07); background: #05090a; }
.rail-thumb canvas { width: 100%; height: 100%; display: block; }
.rail-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.32), transparent 60%); }
.rail-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-copy b { font-size: 8.5px; font-weight: 500; color: #a7b3ad; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92px; }
.rail-copy small { font: 400 7px var(--mono); color: #52605a; }
.rail-item.active .rail-copy b { color: var(--text); }
.rail-item.active .rail-copy small { color: rgba(125,240,198,.55); }
.rail-sep { height: 1px; background: var(--line); margin: 8px 5px; }
.rail-add { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: 7px; margin-top: 5px; border: 1px dashed var(--line); border-radius: 6px; color: #62706a; font-size: 8px; }
.rail-add:hover { color: var(--mint); border-color: rgba(125,240,198,.25); }

.semantic-center { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.semantic-stage { padding: 0; }
.stage-toolbar { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.stage-toolbar .spacer { flex: 1; }
.layer-chip { height: 24px; display: flex; align-items: center; gap: 5px; padding: 0 7px; border-radius: 5px; color: #6c7b74; border: 1px solid transparent; font-size: 8.5px; transition: 130ms; }
.layer-chip:hover { color: var(--muted); background: rgba(255,255,255,.03); }
.layer-chip.on { color: var(--mint); background: rgba(125,240,198,.065); border-color: rgba(125,240,198,.14); }
.layer-chip .icon { opacity: .7; }
.layer-chip.on .icon { opacity: 1; }
.stage-body { position: relative; aspect-ratio: 16 / 8.8; background: #050809; overflow: hidden; }
.stage-body canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-body::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.024) 0 1px, transparent 1px 3px); mix-blend-mode: soft-light; z-index: 8; }
.stage-top { position: absolute; top: 0; left: 0; right: 0; padding: 11px 12px; display: flex; justify-content: space-between; z-index: 9; background: linear-gradient(180deg, rgba(2,6,7,.65), transparent); }
.stage-cam-title { display: flex; align-items: center; gap: 8px; color: rgba(239,246,240,.88); font-size: 9px; }
.stage-cam-title .icon { color: var(--mint); }
.stage-top-right { display: flex; gap: 5px; align-items: center; }
.stage-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; z-index: 9; background: linear-gradient(0deg, rgba(2,6,7,.85), transparent); }
.stream-caption { display: flex; align-items: flex-start; gap: 7px; max-width: 72%; }
.caption-icon { width: 18px; height: 18px; border-radius: 5px; background: rgba(125,240,198,.1); border: 1px solid rgba(125,240,198,.18); color: var(--mint); display: grid; place-items: center; flex: 0 0 auto; }
.stream-caption p { color: rgba(235,245,238,.87); font-size: 9px; line-height: 1.55; text-shadow: 0 1px 4px #000; }
.stage-timecode { text-align: right; color: rgba(230,240,232,.64); font: 400 8px var(--mono); line-height: 1.6; letter-spacing: .04em; }
.stage-timecode b { display: block; color: var(--mint); font-weight: 500; }
.box-label { position: absolute; z-index: 10; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font: 500 7.5px var(--mono); }
.region-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.region-poly { fill: rgba(125,240,198,.06); stroke: rgba(125,240,198,.55); stroke-width: .5; stroke-dasharray: 2.6 2; }
.region-poly.red { fill: rgba(255,111,104,.06); stroke: rgba(255,111,104,.62); }
.region-poly.amber { fill: rgba(242,189,103,.055); stroke: rgba(242,189,103,.62); }
.region-text { fill: rgba(229,247,238,.7); font: 6.5px var(--mono); letter-spacing: .03em; }
.trail-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.trail-path { fill: none; stroke: rgba(125,240,198,.8); stroke-width: 1.2; stroke-dasharray: 3 3; filter: drop-shadow(0 0 3px rgba(125,240,198,.5)); }
.trail-dot { fill: var(--mint); filter: drop-shadow(0 0 4px var(--mint)); }
.timeline-panel { padding: 10px 12px 9px; }
.timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.timeline-title { display: flex; align-items: center; gap: 7px; color: #95a29b; font-size: 8.5px; }
.timeline-title b { color: #d9e4dd; font-weight: 500; }
.timeline-controls { display: flex; align-items: center; gap: 7px; }
.timeline-date { color: #59665f; font: 400 7.5px var(--mono); }
.timeline-track { position: relative; height: 30px; border-radius: 5px; overflow: hidden; background: linear-gradient(90deg, rgba(125,240,198,.09), rgba(125,240,198,.035) 55%, rgba(255,255,255,.025)); border: 1px solid rgba(255,255,255,.05); }
.timeline-track::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 11.8%, rgba(255,255,255,.05) 11.8% 11.9%); }
.timeline-track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 72%; background: linear-gradient(90deg, rgba(125,240,198,.1), rgba(125,240,198,.025)); border-right: 1px solid var(--mint); box-shadow: 4px 0 12px rgba(125,240,198,.1); }
.timeline-event { position: absolute; top: 7px; width: 2px; height: 16px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 7px rgba(242,189,103,.5); cursor: pointer; }
.timeline-event.critical { background: var(--red); box-shadow: 0 0 7px rgba(255,111,104,.5); }
.timeline-labels { display: flex; justify-content: space-between; margin-top: 5px; color: #4f5c56; font: 400 7px var(--mono); }
.timeline-marker { position: absolute; top: 4px; width: 1px; height: 22px; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.timeline-marker::before { content: ""; position: absolute; top: -2px; left: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }

.qa-panel { padding: 13px 14px; }
.qa-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.qa-head-left { display: flex; align-items: center; gap: 7px; color: #b0bdb6; font-size: 9.5px; }
.qa-head-left .icon { color: var(--mint); }
.qa-suggestions { display: flex; gap: 5px; margin-bottom: 9px; flex-wrap: wrap; }
.qa-suggestion { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: #718078; font-size: 8px; transition: 130ms; }
.qa-suggestion:hover { color: var(--mint); border-color: rgba(125,240,198,.2); }
.qa-input-row { display: flex; gap: 7px; align-items: center; }
.qa-input-wrap { flex: 1; position: relative; }
.qa-input-wrap .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #5b6862; }
.qa-input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0,0,0,.18); padding: 0 10px 0 31px; outline: none; font-size: 9.5px; color: var(--text); }
.qa-input:focus { border-color: rgba(125,240,198,.35); }
.qa-send { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: rgba(125,240,198,.12); border: 1px solid rgba(125,240,198,.26); color: var(--mint); }
.qa-send:hover { background: rgba(125,240,198,.2); }
.qa-answer { margin-top: 9px; padding: 9px 10px; border-left: 2px solid rgba(125,240,198,.4); background: rgba(125,240,198,.025); border-radius: 0 6px 6px 0; color: #9eaca5; font-size: 9px; line-height: 1.65; }
.qa-answer b { color: var(--mint); font-weight: 500; }
.qa-answer .qa-meta { margin-top: 5px; color: #56635d; font: 400 7.5px var(--mono); }

.analysis-panel { padding: 0; }
.analysis-tabs { display: flex; padding: 0 10px; border-bottom: 1px solid var(--line); gap: 2px; }
.analysis-tab { height: 38px; padding: 0 8px; display: flex; align-items: center; gap: 5px; color: #6f7d76; font-size: 9px; position: relative; }
.analysis-tab.active { color: var(--text); }
.analysis-tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 1px; background: var(--mint); box-shadow: 0 0 8px rgba(125,240,198,.5); }
.analysis-content { padding: 12px 13px; display: flex; flex-direction: column; gap: 12px; }
.analysis-block { }
.analysis-block-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.analysis-block-title b { font-size: 8px; font-weight: 500; color: #8e9c95; letter-spacing: .07em; text-transform: uppercase; font-family: var(--mono); }
.analysis-block-title span { font: 400 7.5px var(--mono); color: #4f5c56; }
.summary-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgba(255,255,255,.018); }
.summary-box p { color: #acb9b2; font-size: 9px; line-height: 1.7; }
.summary-box .summary-tagline { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); color: #6c7a73; font-size: 8px; }
.summary-box .summary-tagline .status-dot { margin: 0; }
.obj-list { display: flex; flex-direction: column; gap: 4px; }
.obj-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; background: rgba(255,255,255,.018); border: 1px solid rgba(255,255,255,.035); }
.obj-icon { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; background: rgba(125,240,198,.06); color: var(--mint); }
.obj-copy { flex: 1; min-width: 0; }
.obj-copy b { display: block; color: #b4c0b9; font-size: 8.5px; font-weight: 500; }
.obj-copy small { display: block; color: #53615b; font: 400 7px var(--mono); margin-top: 1px; }
.conf-bar { width: 45px; height: 3px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.conf-bar i { display: block; height: 100%; background: var(--mint); border-radius: 2px; }
.conf-value { color: #8c9a93; font: 400 7.5px var(--mono); width: 26px; text-align: right; }
.capture-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.capture-thumb { aspect-ratio: 16/10; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: #0b1112; position: relative; }
.capture-thumb canvas { width: 100%; height: 100%; display: block; }
.capture-thumb .cap-time { position: absolute; bottom: 3px; right: 4px; color: rgba(233,242,235,.6); font: 400 6.5px var(--mono); text-shadow: 0 1px 3px #000; }
.capture-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.32), transparent 60%); }
.hit-card { border: 1px solid rgba(242,189,103,.16); border-radius: 8px; padding: 9px 10px; background: linear-gradient(140deg, rgba(242,189,103,.05), transparent); }
.hit-card-top { display: flex; align-items: center; justify-content: space-between; }
.hit-card-top b { color: #d9b775; font-size: 9px; font-weight: 500; }
.hit-card p { color: #8f9b94; font-size: 8.5px; line-height: 1.6; margin-top: 5px; }
.hit-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: #69766f; font: 400 7.5px var(--mono); }
.hit-card-foot .link-btn { font-size: 8px; }
.memory-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgba(0,0,0,.12); }
.memory-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.memory-head b { color: #9caaa2; font-size: 8.5px; font-weight: 500; }
.memory-head span { color: var(--mint); font: 500 7.5px var(--mono); }
.memory-row { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.memory-label { width: 55px; color: #626f68; font: 400 7.5px var(--mono); }
.memory-bar { flex: 1; height: 4px; border-radius: 3px; background: rgba(255,255,255,.055); overflow: hidden; }
.memory-bar i { display: block; height: 100%; background: var(--mint); border-radius: 3px; opacity: .75; }
.memory-bar i.blue { background: var(--blue); opacity: .6; }
.memory-value { width: 34px; text-align: right; color: #84918a; font: 400 7.5px var(--mono); }
.memory-foot { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #53605a; font: 400 7px var(--mono); }
.memory-foot b { color: #8d9b94; font-weight: 400; }
.pipeline-mini { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.pipe-step { display: flex; align-items: center; gap: 7px; color: #74827b; font-size: 8px; }
.pipe-step .num { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(125,240,198,.2); color: var(--mint); font: 500 6.5px var(--mono); background: rgba(125,240,198,.04); }
.pipe-step.active { color: #b0beb7; }
.pipe-step .step-line { flex: 1; height: 1px; background: var(--line); margin-left: 3px; }
.pipe-step .ms { color: #5b6862; font: 400 7px var(--mono); }

/* ==========================================================================
   Rules
   ========================================================================== */
.rule-hero { position: relative; padding: 18px 20px; overflow: hidden; }
.rule-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 83% -10%, rgba(125,240,198,.09), transparent 38%), radial-gradient(circle at 0 120%, rgba(126,169,255,.05), transparent 35%); pointer-events: none; }
.rule-hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr); gap: 24px; align-items: stretch; position: relative; z-index: 1; }
.composer-label { display: flex; align-items: center; gap: 7px; color: var(--mint); font: 500 8px var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 9px; }
.composer-label .icon { width: 14px; }
.composer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.composer-head h2 { font-size: 18px; font-weight: 540; letter-spacing: -.02em; line-height: 1.4; }
.composer-head p { margin-top: 5px; color: #7e8b85; font-size: 9.5px; line-height: 1.6; }
.nl-compose { margin-top: 13px; position: relative; }
.nl-textarea { width: 100%; min-height: 78px; resize: none; border: 1px solid rgba(125,240,198,.19); border-radius: 9px; background: rgba(4,10,9,.46); padding: 12px 13px 32px; color: #dce7e0; font-size: 11px; line-height: 1.8; outline: none; transition: 160ms; }
.nl-textarea:focus { border-color: rgba(125,240,198,.45); box-shadow: 0 0 0 3px rgba(125,240,198,.04), inset 0 1px 0 rgba(255,255,255,.03); }
.nl-textarea::placeholder { color: #57645e; }
.nl-toolbar { position: absolute; right: 8px; bottom: 7px; left: 8px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.nl-toolbar > * { pointer-events: auto; }
.nl-hint { display: flex; align-items: center; gap: 5px; color: #53615b; font-size: 7.5px; }
.nl-hint kbd { font: 500 7px var(--mono); border: 1px solid var(--line); border-radius: 3px; padding: 1px 3px; }
.example-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.example-chips > span { color: #596660; font-size: 8px; margin-right: 2px; }
.example-chip { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 20px; color: #7b8a82; font-size: 8px; background: rgba(255,255,255,.015); transition: 140ms; }
.example-chip:hover { color: var(--mint); border-color: rgba(125,240,198,.22); background: rgba(125,240,198,.035); }
.parse-status { display: flex; align-items: center; gap: 6px; color: #6f7d76; font-size: 8.5px; margin-top: 12px; }
.parse-status .pulse-dot { width: 4px; height: 4px; }
.rule-preview { border: 1px solid var(--line); border-radius: 10px; background: rgba(3,8,8,.28); padding: 12px; display: flex; flex-direction: column; }
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.preview-head b { display: flex; align-items: center; gap: 6px; font-size: 8.5px; font-weight: 500; color: #92a098; }
.preview-head .icon { color: var(--mint); }
.preview-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 154px; color: #5a6761; }
.preview-empty .empty-orb { width: 35px; height: 35px; border-radius: 9px; display: grid; place-items: center; border: 1px dashed rgba(125,240,198,.22); color: var(--mint); background: rgba(125,240,198,.03); margin-bottom: 8px; }
.preview-empty b { color: #8c9a93; font-size: 9px; font-weight: 500; }
.preview-empty p { margin-top: 4px; font-size: 8px; line-height: 1.6; max-width: 210px; }
.preview-empty .mini-flow { display: flex; align-items: center; gap: 4px; margin-top: 9px; font: 400 7px var(--mono); color: #5a6861; }
.preview-empty .mini-flow i { width: 12px; height: 1px; background: #3d4a44; }
.preview-draft { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.draft-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.045); }
.draft-row:last-child { border-bottom: 0; padding-bottom: 0; }
.draft-row span { color: #5d6a64; font-size: 7.5px; }
.draft-row b { color: #a9b6af; font-size: 8.5px; font-weight: 500; text-align: right; }
.rule-health { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: #5b6862; font: 400 7px var(--mono); }
.rule-health b { color: var(--mint); font-weight: 400; }
.rules-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 12px; align-items: start; }
.rules-panel { overflow: visible; }
.rules-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rules-toolbar .spacer { flex: 1; }
.rule-items { padding: 2px 10px 7px; }
.rule-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) 80px 64px; gap: 10px; align-items: center; padding: 11px 7px; border-bottom: 1px solid rgba(255,255,255,.045); position: relative; }
.rule-item:last-child { border-bottom: 0; }
.rule-item:hover { background: rgba(255,255,255,.014); }
.rule-item.disabled { opacity: .55; }
.rule-state { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: rgba(125,240,198,.06); border: 1px solid rgba(125,240,198,.14); color: var(--mint); }
.rule-state.critical { background: rgba(255,111,104,.06); border-color: rgba(255,111,104,.15); color: var(--red); }
.rule-state.high { background: rgba(255,149,95,.06); border-color: rgba(255,149,95,.15); color: var(--orange); }
.rule-state.medium { background: rgba(242,189,103,.055); border-color: rgba(242,189,103,.14); color: var(--amber); }
.rule-main { min-width: 0; cursor: pointer; }
.rule-main-row { display: flex; align-items: center; gap: 7px; }
.rule-main-row b { font-size: 10px; font-weight: 500; color: #d6e0da; }
.rule-main p { margin-top: 3px; color: #65736c; font-size: 8.2px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px; }
.rule-tags { display: flex; align-items: center; gap: 4px; margin-top: 5px; }
.rule-tags .tag { font-size: 7px; padding: 2px 5px; color: #617069; }
.rule-metric { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rule-metric b { color: #9ca9a2; font: 400 10px var(--mono); }
.rule-metric span { color: #53605a; font-size: 7px; }
.rule-metric b small { font-size: 6.5px; color: #55625c; margin-left: 2px; }
.rule-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.rule-enable { font: 500 7.5px var(--mono); color: #5f6c66; }
.rule-enable.on { color: var(--mint); }
.rule-side-card { padding: 14px; }
.rule-side-card + .rule-side-card { margin-top: 0; }
.mini-ranking { display: flex; flex-direction: column; gap: 9px; margin-top: 11px; }
.rank-row { display: grid; grid-template-columns: 18px 1fr 30px; gap: 7px; align-items: center; }
.rank-num { color: #46534d; font: 500 7.5px var(--mono); }
.rank-copy { min-width: 0; }
.rank-copy div { display: flex; justify-content: space-between; gap: 5px; margin-bottom: 4px; }
.rank-copy b { color: #8b9992; font-size: 8px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-copy span { color: #5d6b64; font: 400 7px var(--mono); }
.rank-bar { height: 3px; border-radius: 3px; background: rgba(255,255,255,.055); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: rgba(242,189,103,.55); border-radius: 3px; }
.rank-value { text-align: right; color: #84928b; font: 400 8px var(--mono); }
.rule-health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.health-cell { padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.016); }
.health-cell b { display: block; font: 400 15px var(--mono); color: #becbc3; }
.health-cell span { display: block; margin-top: 2px; color: #58655f; font-size: 7.5px; }
.rule-log { padding: 0 14px 10px; }
.rule-log-row { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.rule-log-row:last-child { border-bottom: 0; }
.rule-log-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--amber); }
.rule-log-row b { flex: 1; color: #87958e; font-size: 8px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-log-row time { color: #4f5c56; font: 400 7px var(--mono); }

/* ==========================================================================
   Drawer / modal / toast
   ========================================================================== */
.backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(2, 6, 7, 0.64); backdrop-filter: blur(5px); animation: fadeIn 180ms ease both; }
.backdrop.closing { animation: fadeOut 150ms ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: 570px; max-width: 94vw;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0d1316, #090e10);
  border-left: 1px solid rgba(226,244,235,.12);
  box-shadow: -30px 0 80px rgba(0,0,0,.45);
  animation: slideIn 320ms var(--ease) both;
}
.drawer.closing { animation: slideOut 220ms var(--ease) both; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOut { to { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.drawer-eyebrow { display: flex; align-items: center; gap: 7px; color: var(--mint); font: 500 7.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.drawer-head h2 { font-size: 19px; font-weight: 550; letter-spacing: -.025em; }
.drawer-head p { margin-top: 5px; color: var(--dim); font-size: 9px; line-height: 1.6; }
.drawer-body { flex: 1; overflow-y: auto; padding: 17px 22px 24px; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 22px; border-top: 1px solid var(--line); background: rgba(0,0,0,.15); }
.drawer-foot .foot-left { color: #5e6b65; font-size: 8px; display: flex; align-items: center; gap: 6px; }
.drawer-foot .foot-actions { display: flex; gap: 7px; }
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.step { display: flex; align-items: center; gap: 6px; color: #596660; font-size: 8px; }
.step-num { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); color: #64716b; font: 500 7px var(--mono); }
.step.active { color: var(--text-2); }
.step.active .step-num { border-color: rgba(125,240,198,.42); color: var(--mint); background: rgba(125,240,198,.07); box-shadow: 0 0 12px rgba(125,240,198,.08); }
.step.done .step-num { border-color: rgba(125,240,198,.3); color: var(--mint); background: rgba(125,240,198,.07); }
.step-line { flex: 1; height: 1px; background: var(--line); }
.drawer-section { margin-bottom: 17px; }
.drawer-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.drawer-section-title b { color: #9aa79f; font-size: 8.5px; font-weight: 500; letter-spacing: .05em; font-family: var(--mono); text-transform: uppercase; }
.drawer-section-title span { color: #53615b; font-size: 7.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-grid .span2 { grid-column: span 2; }
.protocol-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.protocol-card { padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.016); cursor: pointer; transition: 140ms; }
.protocol-card:hover { border-color: var(--line-strong); }
.protocol-card.active { border-color: rgba(125,240,198,.38); background: rgba(125,240,198,.05); }
.protocol-card b { display: block; color: #b9c5be; font: 500 9px var(--mono); }
.protocol-card span { display: block; margin-top: 3px; color: #596660; font-size: 7.5px; line-height: 1.45; }
.protocol-card.active b { color: var(--mint); }
.probe-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgba(0,0,0,.18); }
.probe-idle { display: flex; align-items: center; gap: 8px; color: #5f6c66; font-size: 8.5px; }
.probe-ok { display: flex; align-items: center; gap: 8px; color: #8fa29a; font-size: 8.5px; }
.probe-ok .icon { color: var(--mint); }
.probe-ok b { color: var(--text-2); font-weight: 500; }
.probe-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.probe-cell { background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.04); border-radius: 4px; padding: 5px 6px; }
.probe-cell span { display: block; color: #52605a; font-size: 6.5px; }
.probe-cell b { display: block; color: #8d9b94; font: 400 7.5px var(--mono); margin-top: 2px; }
.ai-bind-row { display: flex; gap: 8px; align-items: center; }
.ai-bind-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: rgba(125,240,198,.07); border: 1px solid rgba(125,240,198,.15); color: var(--mint); }
.ai-bind-copy { flex: 1; }
.ai-bind-copy b { display: block; color: #b2beb7; font-size: 9px; font-weight: 500; }
.ai-bind-copy span { display: block; color: #58655f; font-size: 7.5px; margin-top: 2px; }
.range-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--mint); height: 3px; }
.range-row .range-value { width: 47px; text-align: right; color: #9aa79f; font: 400 8px var(--mono); }

.command-dialog { position: fixed; z-index: 96; top: 14vh; left: 50%; transform: translateX(-50%); width: min(620px, 90vw); border: 1px solid rgba(226,244,235,.14); border-radius: 13px; background: #0d1416; box-shadow: 0 30px 100px rgba(0,0,0,.55); overflow: hidden; animation: cmdIn 220ms var(--ease) both; }
@keyframes cmdIn { from { opacity: 0; transform: translate(-50%, -8px) scale(.985); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.command-search { display: flex; align-items: center; gap: 10px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.command-search .icon { color: var(--mint); }
.command-search input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); font-size: 12px; }
.command-search input::placeholder { color: #596660; }
.command-search kbd { color: #5d6a64; font: 500 8px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.command-results { max-height: 390px; overflow-y: auto; padding: 7px; }
.command-group-label { padding: 8px 9px 5px; color: #4f5c56; font: 500 7px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.command-item { display: flex; align-items: center; gap: 9px; padding: 9px 9px; border-radius: 7px; cursor: pointer; }
.command-item:hover { background: rgba(125,240,198,.055); }
.command-item-icon { width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; background: rgba(255,255,255,.03); color: #83928a; }
.command-item-copy { flex: 1; min-width: 0; }
.command-item-copy b { display: block; color: #b7c4bc; font-size: 9.5px; font-weight: 500; }
.command-item-copy span { display: block; color: #56635d; font-size: 8px; margin-top: 2px; }
.command-item .arrow { color: #4e5b55; }
.command-none { padding: 30px; text-align: center; color: #5a6761; font-size: 9px; }
.notify-drawer { width: 390px; }
.notify-list { padding: 7px 12px; }
.notify-item { display: flex; gap: 9px; padding: 11px 8px; border-bottom: 1px solid rgba(255,255,255,.045); }
.notify-item:last-child { border-bottom: 0; }
.notify-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(255,111,104,.06); color: var(--red); border: 1px solid rgba(255,111,104,.12); flex: 0 0 auto; }
.notify-copy { flex: 1; }
.notify-copy b { font-size: 9.5px; color: #b9c5be; font-weight: 500; }
.notify-copy p { color: #66736d; font-size: 8.5px; line-height: 1.55; margin-top: 2px; }
.notify-copy time { color: #4d5a54; font: 400 7px var(--mono); display: block; margin-top: 3px; }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 240px; max-width: 360px; padding: 10px 13px; border: 1px solid rgba(125,240,198,.2); border-radius: 8px; background: rgba(10,19,16,.95); color: #b9c8c0; font-size: 9.5px; box-shadow: 0 12px 35px rgba(0,0,0,.35); backdrop-filter: blur(12px); animation: toastIn 260ms var(--ease) both; }
.toast.out { animation: toastOut 200ms ease both; }
.toast .icon { color: var(--mint); }
.toast.warn { border-color: rgba(242,189,103,.22); }
.toast.warn .icon { color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 55px 20px; color: #5c6963; text-align: center; }
.empty-state .icon { color: #4b5852; margin-bottom: 9px; }
.empty-state b { color: #899790; font-size: 10px; font-weight: 500; }
.empty-state p { margin-top: 4px; font-size: 8.5px; }

/* utility */
.row { display: flex; align-items: center; }
.gap6 { gap: 6px; }
.gap8 { gap: 8px; }
.spacer { flex: 1; }
.text-mint { color: var(--mint); }
.text-muted { color: var(--muted); }
.text-dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); }

/* responsive */
@media (max-width: 1380px) {
  :root { --sidebar-w: 218px; }
  .topbar-left { width: 210px; }
  .topbar-right { width: 380px; }
  .search-trigger { min-width: 215px; }
  .semantic-layout { grid-template-columns: 172px minmax(0, 1fr) 328px; }
  .view { padding-left: 22px; padding-right: 22px; }
  .pipe-node-icon { width: 27px; height: 27px; }
  .pipe-copy b { font-size: 12px; }
}
@media (max-width: 1220px) {
  body { min-width: 1024px; }
  :root { --sidebar-w: 204px; }
  .overview-main { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); }
  .topbar-center { display: none; }
  .topbar-left { width: auto; flex: 1; }
  .streams-layout { grid-template-columns: minmax(0, 1fr) 260px; }
  .semantic-layout { grid-template-columns: 160px minmax(0, 1fr) 300px; }
  .rule-hero-grid { grid-template-columns: minmax(0, 1.4fr) minmax(270px, .8fr); }
  .wall-grid { gap: 8px; }
}
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-main, .overview-bottom { grid-template-columns: 1fr; }
  .streams-layout, .rules-layout { grid-template-columns: 1fr; }
  .semantic-layout { grid-template-columns: 150px minmax(0, 1fr); }
  .analysis-panel { grid-column: span 2; }
  .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-flow { gap: 2px; }
  .pipeline-label { flex-basis: 145px; }
  .search-trigger { min-width: 160px; }
}

/* wall selected channel */
.wall-selection {
  display: flex; align-items: center; gap: 13px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 11px;
  background: linear-gradient(120deg, rgba(125,240,198,.045), rgba(255,255,255,.012) 45%), var(--panel);
}
.selection-thumb { width: 80px; height: 45px; border-radius: 6px; overflow: hidden; position: relative; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.09); background: #060a0a; }
.selection-thumb canvas { width: 100%; height: 100%; display: block; }
.selection-thumb::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px); }
.selection-main { flex: 1; min-width: 0; }
.selection-row { display: flex; align-items: center; gap: 8px; }
.selection-row b { color: #d6e2da; font-size: 10.5px; font-weight: 500; }
.selection-main p { color: #68766f; font-size: 8.5px; line-height: 1.55; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 640px; }
.selection-stat { min-width: 68px; padding-left: 14px; border-left: 1px solid var(--line); }
.selection-stat span { display: block; color: #56635d; font-size: 7.5px; margin-bottom: 3px; }
.selection-stat b { color: #aebbb4; font: 500 10px var(--mono); }

/* camera detail drawer */
.detail-preview { position: relative; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #050809; margin-bottom: 10px; }
.detail-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.detail-preview::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px); }
.detail-preview-hud { position: absolute; z-index: 2; top: 9px; left: 9px; right: 9px; display: flex; justify-content: space-between; }
.detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.detail-stats div { padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.016); }
.detail-stats span { display: block; color: #56635d; font-size: 7px; }
.detail-stats b { display: block; color: #9ca9a2; font: 400 8px var(--mono); margin-top: 3px; }
.source-box { min-height: 34px; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0,0,0,.18); color: #9aa79f; font-size: 8.5px; line-height: 1.5; }
.source-box .mono { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* analysis panel containment */
.analysis-panel { position: sticky; top: 0; }
.analysis-content { max-height: 735px; overflow-y: auto; }

/* small icon sizing consistency */
.btn .icon-wrap { margin: 0 -1px; }
.rule-preview .btn { pointer-events: auto; }

@media (max-width: 1080px) {
  .wall-selection { flex-wrap: wrap; }
  .selection-main p { max-width: 420px; }
  .analysis-panel { position: static; }
}
/* region chips rendered above stretched SVG */
.region-label {
  position: absolute; z-index: 4; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 5px; border-radius: 3px;
  border: 1px solid rgba(125,240,198,.28);
  background: rgba(3, 11, 8, .72);
  color: var(--mint); font: 500 7px var(--mono); letter-spacing: .02em;
  pointer-events: none; white-space: nowrap;
}
.region-label::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.region-label.red { color: #ff958e; border-color: rgba(255,111,104,.28); background: rgba(17,5,4,.74); }
.region-label.amber { color: var(--amber); border-color: rgba(242,189,103,.28); background: rgba(17,12,4,.74); }
.video-tile .region-label { font-size: 6px; padding: 1px 4px; }

/* page header refinements */
.page-head .eyebrow { font-size: 9px; }
.page-head p { font-size: 11px; }
.kpi-label { font-size: 10px; }
.event-row2 { font-size: 9px; }
.nav-item .nav-copy b { font-size: 12.5px; }
/* ==========================================================================
   Real RTSP · SODA Office
   ========================================================================== */
.real-mini {
  display: inline-flex; align-items: center; height: 13px; padding: 0 3px;
  border-radius: 3px; font: 600 6px var(--mono); letter-spacing: .06em;
  color: #ff958e; border: 1px solid rgba(255,111,104,.28);
  background: rgba(255,111,104,.08); vertical-align: 1px;
}
.cam-thumb.real { border-color: rgba(255,111,104,.28); background: #050707; }
.cam-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-thumb.real::before {
  content: "LIVE"; position: absolute; z-index: 2; right: 2px; bottom: 2px;
  padding: 1px 2px; border-radius: 2px; color: #ffb1ab;
  background: rgba(18,5,4,.72); font: 600 5px var(--mono);
}
.real-feed { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: 1; background: #050809; }
.video-tile .real-feed { filter: brightness(1.03) contrast(1.02); }
.real-frame { position: absolute; inset: 0; background: #030606; overflow: hidden; }
.real-frame > .real-feed { height: 100%; width: 100%; object-fit: contain; }
.real-frame.real-wide > .real-feed { object-fit: cover; }
.real-overlay { position: absolute; z-index: 3; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); width: 75%; pointer-events: none; }
.real-frame.real-wide .real-overlay { width: 100%; }
.real-stage { aspect-ratio: 4 / 3; background: #030606; }
.real-stage.wide-stage { aspect-ratio: 2.22; }
.real-stage > .real-feed { object-fit: cover; }
.real-stage .stage-top, .real-stage .stage-bottom { z-index: 9; }
.rail-real-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-thumb::before { content: ""; }
.rail-thumb:has(.rail-real-img)::before {
  content: "R"; position: absolute; z-index: 3; top: 2px; right: 2px;
  width: 9px; height: 9px; display: grid; place-items: center;
  border-radius: 2px; color: #ffaca5; background: rgba(15,4,3,.75);
  font: 600 5px var(--mono);
}
.selection-real-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-label.live { color: #ffb0a8; border-color: rgba(255,111,104,.35); background: rgba(31,8,7,.62); }
.video-tile.real-tile { border-color: rgba(255,111,104,.16); }
.video-tile.real-tile.selected { border-color: rgba(255,111,104,.55); box-shadow: 0 0 0 1px rgba(255,111,104,.16), 0 0 30px rgba(226,80,69,.07); }
.live-evidence { position: relative; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; background: #050808; }
.live-evidence-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-evidence-hud { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 16px 8px 6px; background: linear-gradient(0deg, rgba(2,6,7,.82), transparent); color: #a6b4ac; font: 400 7px var(--mono); }

/* page */
.office-page { gap: 12px; }
.office-page .live-tag { margin-bottom: 0; }
.office-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.office-grid { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 12px; align-items: start; }
.office-feeds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.office-camera { overflow: hidden; }
.office-camera-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 13px 10px; }
.office-camera-name { display: flex; align-items: center; gap: 6px; color: #e5efe8; font-size: 11px; font-weight: 540; }
.office-camera-name .icon { color: var(--mint); }
.office-camera-meta { margin-top: 4px; color: #56635d; font: 400 7px var(--mono); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.office-stage { position: relative; aspect-ratio: 4/3; background: #030606; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.office-stage::after { content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px); mix-blend-mode: soft-light; }
.office-stage .real-feed { object-fit: cover; }
.office-stage-top { position: absolute; z-index: 8; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 9px 10px; background: linear-gradient(180deg, rgba(2,6,7,.66), transparent); }
.office-stage-mode { color: rgba(224,241,232,.6); font: 400 7px var(--mono); }
.office-stage-bottom { position: absolute; z-index: 8; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 25px 10px 8px; background: linear-gradient(0deg, rgba(2,6,7,.84), transparent); }
.office-stage-caption { color: rgba(235,245,238,.84); font-size: 8px; line-height: 1.5; text-shadow: 0 1px 4px #000; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.office-camera-foot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); color: #67756e; font: 400 7.5px var(--mono); }
.office-camera-foot .icon { color: #6e7d75; }
.office-camera-foot .link-btn { font-size: 8px; }
.office-side { display: flex; flex-direction: column; gap: 10px; }
.office-pipeline { overflow: hidden; }
.office-pipe-body { padding: 7px 13px 13px; }
.office-pipe-step { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 8px; position: relative; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.office-pipe-step:last-child { border-bottom: 0; }
.office-pipe-num { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--mint); border: 1px solid rgba(125,240,198,.22); background: rgba(125,240,198,.04); font: 500 6px var(--mono); }
.office-pipe-step b { display: block; color: #aab8b0; font-size: 8px; font-weight: 500; }
.office-pipe-step span { display: block; margin-top: 2px; color: #56635d; font-size: 7px; }
.office-pipe-step em { color: #5f6d66; font: normal 400 6.5px var(--mono); text-align: right; max-width: 90px; }
.office-engine-body { padding: 10px 13px 13px; }
.office-engine-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.office-engine-row span { color: #58655f; font-size: 7.5px; }
.office-engine-row b { color: #9daaa3; font: 500 7.5px var(--mono); }
.office-engine-row a { color: var(--mint); font: 400 7.5px var(--mono); }
.office-adapter-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 9px; padding: 8px; border: 1px dashed rgba(242,189,103,.18); border-radius: 6px; background: rgba(242,189,103,.03); }
.office-adapter-note .icon { color: var(--amber); margin-top: 1px; flex: 0 0 auto; }
.office-adapter-note p { color: #7c8171; font-size: 7.5px; line-height: 1.55; }
.office-engine-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; color: #52605a; font: 400 7px var(--mono); }
.office-engine-foot b { color: #90a098; font-weight: 400; }
.office-ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.office-result { padding: 13px 14px; }
.office-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.office-result-scene { margin-top: 10px; color: #a7b4ac; font-size: 9.5px; line-height: 1.7; min-height: 32px; }
.office-findings { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.office-finding { display: flex; align-items: flex-start; gap: 7px; padding: 7px 8px; border: 1px solid rgba(242,189,103,.12); border-radius: 6px; background: rgba(242,189,103,.035); }
.office-finding-dot { width: 4px; height: 4px; border-radius: 50%; margin-top: 4px; background: var(--amber); box-shadow: 0 0 6px var(--amber); flex: 0 0 auto; }
.office-finding div { flex: 1; }
.office-finding b { display: block; color: #c4b083; font-size: 8px; font-weight: 500; }
.office-finding p { margin-top: 2px; color: #7f887a; font-size: 7.5px; line-height: 1.5; }
.office-finding > .mono { color: #8e9a92; font-size: 7px; margin-top: 2px; }
.office-no-hit { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px; border: 1px solid rgba(125,240,198,.11); border-radius: 6px; background: rgba(125,240,198,.025); color: #778a80; font-size: 8px; }
.office-no-hit .icon { color: var(--mint); }
.office-observations { display: flex; flex-direction: column; gap: 3px; margin-top: 9px; }
.office-observations span { padding-left: 11px; position: relative; color: #6d7a73; font-size: 8px; line-height: 1.55; }
.office-observations span::before { content: ""; position: absolute; left: 2px; top: 5px; width: 3px; height: 3px; border-radius: 50%; background: #53615b; }
.office-result-foot { display: flex; align-items: center; gap: 13px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); color: #56635d; font-size: 7.5px; }
.office-result-foot b { color: #88958e; font: 400 7.5px var(--mono); }
.office-result-foot .mono { margin-left: auto; color: #53605a; }
.office-privacy { display: flex; align-items: center; gap: 7px; padding: 0 3px; color: #4f5d56; font-size: 8px; }
.office-privacy .icon { color: #6b7971; }

/* responsive */
@media (max-width: 1380px) {
  .office-grid { grid-template-columns: minmax(0, 1fr) 276px; }
  .office-camera-meta { max-width: 240px; }
}
@media (max-width: 1220px) {
  .office-feeds { grid-template-columns: 1fr; }
  .office-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .office-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .office-grid, .office-ai-grid { grid-template-columns: 1fr; }
  .office-feeds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* hide burned-in camera timestamps behind our HUD */
.real-tile .tile-top {
  background: linear-gradient(180deg, rgba(3,6,7,.97) 0%, rgba(3,6,7,.82) 72%, transparent 100%);
}
.stage-body.real-stage .stage-top {
  min-height: 46px; padding: 0 12px; align-items: center;
  background: linear-gradient(180deg, rgba(3,6,7,.97) 0%, rgba(3,6,7,.9) 78%, transparent 100%);
}
.office-stage .office-stage-top {
  min-height: 38px; padding: 0 10px; align-items: center;
  background: linear-gradient(180deg, rgba(3,6,7,.97) 0%, rgba(3,6,7,.86) 78%, transparent 100%);
}
.detail-preview .real-feed { object-fit: cover; }
/* Solid HUD bars fully mask camera-burned timestamps */
.real-tile .tile-top,
.stage-body.real-stage .stage-top,
.office-stage .office-stage-top {
  background: #030707;
}
.real-tile .tile-top::after,
.stage-body.real-stage .stage-top::after,
.office-stage .office-stage-top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: rgba(255,255,255,.055);
}
/* taller real HUD to fully cover the camera's baked-in OSD */
.stage-body.real-stage .stage-top { min-height: 64px; }
.office-stage .office-stage-top { min-height: 52px; }
/* live-frame Q&A */
.qa-send:disabled { opacity: .45; cursor: wait; }
.qa-input:disabled { opacity: .55; cursor: wait; }
.qa-thinking {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  color: #8fa39a; font-size: 9px;
}
.thinking-dots { display: inline-flex; gap: 3px; align-items: center; }
.thinking-dots i {
  width: 4px; height: 4px; border-radius: 50%; background: var(--mint);
  animation: thinking 1.1s infinite ease-in-out;
}
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes thinking { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }
/* ==========================================================================
   Real stream rules and closed-loop alarms
   ========================================================================== */
.real-rules-panel {
  position: relative;
  background:
    radial-gradient(circle at 95% 0, rgba(255,111,104,.055), transparent 34%),
    linear-gradient(150deg, rgba(125,240,198,.035), rgba(255,255,255,.012) 48%),
    var(--panel);
}
.real-rules-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 15px 18px 11px; }
.real-rules-kicker { color: var(--mint); font: 500 7.5px var(--mono); letter-spacing: .14em; margin-bottom: 5px; }
.real-rules-head .panel-title { font-size: 13px; }
.real-rules-head p { color: #738079; font-size: 8.5px; line-height: 1.55; margin-top: 5px; }
.real-loop { display: flex; align-items: center; gap: 5px; padding: 0 18px 13px; }
.real-loop-step { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.055); background: rgba(255,255,255,.016); }
.real-loop-num { color: var(--mint); font: 500 6.5px var(--mono); opacity: .7; }
.real-loop-step b { color: #a7b5ad; font-size: 8px; font-weight: 500; }
.real-loop-step small { color: #56635d; font-size: 7px; }
.real-loop-arrow { color: #46534d; display: flex; align-items: center; }
.real-rules-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); border-top: 1px solid var(--line); }
.real-rules-list { padding: 11px 14px 13px; display: flex; flex-direction: column; gap: 7px; border-right: 1px solid var(--line); min-height: 160px; }
.real-rule-card { padding: 10px 11px; border: 1px solid rgba(125,240,198,.11); border-radius: 8px; background: linear-gradient(130deg, rgba(125,240,198,.035), rgba(255,255,255,.012)); transition: 160ms; }
.real-rule-card:hover { border-color: rgba(125,240,198,.22); }
.real-rule-card.off { opacity: .55; }
.real-rule-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.real-rule-name { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.real-rule-icon { width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; color: var(--mint); background: rgba(125,240,198,.07); border: 1px solid rgba(125,240,198,.15); }
.real-rule-name b { display: block; color: #d8e4dc; font-size: 9.5px; font-weight: 500; }
.real-rule-name small { display: block; color: #5d6a64; font: 400 7px var(--mono); margin-top: 3px; }
.real-rule-card > p { margin: 8px 0 7px 33px; color: #78857e; font-size: 8px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.real-rule-stats { display: flex; align-items: center; gap: 12px; margin-left: 33px; color: #56635d; font-size: 7.5px; }
.real-rule-stats b { color: #a5b2aa; font: 500 8px var(--mono); font-weight: 400; }
.real-rule-status { margin-left: auto; color: var(--mint); font: 500 7px var(--mono); }
.real-rule-card.off .real-rule-status { color: #7f8a84; }
.real-rule-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.045); }
.real-rule-actions .btn { height: 25px; }
.real-rule-threshold { color: #53615a; font: 400 7px var(--mono); }
.real-events-panel { padding: 12px 13px; background: rgba(255,111,104,.012); }
.real-events-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.real-events-head b { display: block; color: #aebbb3; font-size: 9px; font-weight: 500; }
.real-events-head small { display: block; color: #55625c; font: 400 6.5px var(--mono); letter-spacing: .06em; margin-top: 3px; }
.real-events-head > .mono { color: #747f79; font-size: 8px; }
.real-event-row { display: flex; gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.real-event-row:last-child { border-bottom: 0; }
.real-event-thumb { width: 47px; height: 35px; border-radius: 4px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); background: #060a0a; flex: 0 0 auto; }
.real-event-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.real-event-copy { flex: 1; min-width: 0; }
.real-event-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.real-event-title b { color: #c4d0c8; font-size: 8.5px; font-weight: 500; }
.real-event-copy p { margin-top: 3px; color: #7b8780; font-size: 7.5px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.real-event-copy > small { display: block; color: #52605a; font: 400 6.5px var(--mono); margin-top: 3px; }
.real-event-actions { margin-top: 5px; }
.real-event-actions .ack { color: var(--mint); font-size: 7.5px; }
.real-rules-empty, .real-events-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px 18px; color: #58655f; }
.real-rules-empty .icon, .real-events-empty .icon { color: #65756c; margin-bottom: 7px; }
.real-rules-empty b, .real-events-empty b { color: #909f97; font-size: 9px; font-weight: 500; }
.real-rules-empty p, .real-events-empty p { max-width: 230px; margin: 4px 0 9px; color: #5d6a63; font-size: 8px; line-height: 1.55; }
.real-rule-threshold + .spacer { flex: 1; }

/* office alarm banner */
.office-alarm-banner {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid rgba(255,111,104,.27); border-radius: 9px;
  background: linear-gradient(90deg, rgba(255,111,104,.11), rgba(255,111,104,.025));
  box-shadow: 0 0 22px rgba(255,80,65,.04);
}
.office-alarm-icon { width: 27px; height: 27px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; color: #ff958e; border: 1px solid rgba(255,111,104,.23); background: rgba(255,111,104,.08); }
.office-alarm-copy { flex: 1; min-width: 0; }
.office-alarm-copy b { display: block; color: #ffc2bd; font-size: 9px; font-weight: 500; }
.office-alarm-copy p { margin-top: 3px; color: #a07873; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.office-alarm-time { color: #a47570; font: 400 7px var(--mono); }
.office-alarm-banner .btn { height: 25px; font-size: 8px; }
/* real RTSP / RTMP onboarding */
.protocol-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.real-offline {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-align: center;
  background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.035), transparent 52%), #050808;
  color: #5f6d66;
}
.real-offline .icon-wrap { color: #718079; opacity: .7; }
.real-offline b { color: #98a59d; font-size: 9px; font-weight: 500; }
.real-offline small { color: #55625c; font-size: 7px; }
.video-tile .real-offline b { font-size: 8px; }
.video-tile .real-offline small { font-size: 6px; }
