:root {
  --bg: #030914;
  --bg-2: #071321;
  --panel: rgba(9, 23, 39, .82);
  --panel-solid: #0a1828;
  --line: rgba(130, 178, 218, .17);
  --line-strong: rgba(69, 166, 255, .38);
  --text: #eef7ff;
  --muted: #8196a9;
  --blue: #1688ff;
  --cyan: #49d8ff;
  --green: #3bdf9b;
  --red: #ff4d6d;
  --amber: #ffbe4c;
  --shadow: 0 26px 80px rgba(0, 0, 0, .46);
  --radius: 20px;
  --font: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(22, 136, 255, .12), transparent 33%),
    radial-gradient(circle at 86% 72%, rgba(14, 204, 210, .06), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.good { color: var(--green) !important; }
.muted { color: var(--muted); }
.grid-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image:
    linear-gradient(rgba(79, 150, 205, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 150, 205, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
  z-index: -1;
}

/* Login */
.login-page { overflow-x: hidden; }
.login-page::before,
.login-page::after {
  content: "";
  position: fixed;
  width: 44vw;
  height: 44vw;
  border: 1px solid rgba(48, 141, 226, .16);
  transform: rotate(35deg);
  pointer-events: none;
}
.login-page::before { left: -28vw; top: -18vw; }
.login-page::after { right: -31vw; bottom: -25vw; }
.login-shell {
  width: min(1240px, calc(100% - 48px));
  min-height: calc(100vh - 74px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
  padding: 48px 0;
}
.login-brand { min-width: 0; }
.brand-kicker,
.eyebrow {
  margin: 0 0 13px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}
.brand-kicker { display: flex; align-items: center; gap: 9px; }
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(59, 223, 155, .1), 0 0 20px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .5; transform: scale(.78); } }
.cinematic-logo {
  display: block;
  width: min(700px, 100%);
  aspect-ratio: 16/9;
  object-fit: contain;
  filter: drop-shadow(0 24px 50px rgba(0, 69, 174, .35));
  margin: -30px 0 -20px;
}
.login-brand h1 {
  margin: 0;
  font-size: clamp(30px, 4.1vw, 60px);
  font-weight: 300;
  letter-spacing: .09em;
  line-height: .95;
}
.login-brand h1 strong { color: var(--blue); font-weight: 900; }
.login-brand > p {
  max-width: 690px;
  margin: 28px 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.protocol-row { display: flex; flex-wrap: wrap; gap: 8px; }
.protocol-row span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  color: #8cadca;
  background: rgba(4, 19, 34, .65);
  border-radius: 6px;
  font-size: 9px;
  letter-spacing: .14em;
  font-weight: 800;
}
.login-card {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 4vw, 48px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(14, 34, 54, .94), rgba(5, 14, 26, .96));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(24px);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0, rgba(22,136,255,.16), transparent 38%);
  pointer-events: none;
}
.login-card-topline { position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, var(--blue), transparent); }
.security-mark { display: flex; align-items: end; gap: 4px; height: 28px; margin-bottom: 24px; }
.security-mark span { width: 7px; border: 1px solid var(--blue); background: rgba(22, 136, 255, .14); transform: skew(-18deg); }
.security-mark span:nth-child(1) { height: 15px; }
.security-mark span:nth-child(2) { height: 23px; }
.security-mark span:nth-child(3) { height: 28px; background: var(--blue); box-shadow: 0 0 18px rgba(22,136,255,.7); }
.login-card h2 { margin: 0 0 8px; font-size: 29px; letter-spacing: -.03em; }
.login-card .muted { margin: 0 0 33px; font-size: 13px; }
.field-label,
.settings-card label > span {
  display: block;
  margin: 0 0 8px;
  color: #9cb2c5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.input-wrap { position: relative; margin-bottom: 20px; }
.input-wrap input,
.settings-card input,
.settings-card select {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: rgba(2, 10, 19, .72);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.input-wrap input { padding: 0 76px 0 52px; }
.settings-card input,
.settings-card select { padding: 0 14px; }
.input-wrap input:focus,
.settings-card input:focus,
.settings-card select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22,136,255,.12);
}
.input-icon {
  position: absolute;
  z-index: 1;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.reveal-button {
  position: absolute;
  z-index: 2;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #7793aa;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  cursor: pointer;
}
.primary-button,
.secondary-button,
.control-button,
.icon-button,
.nav-button,
.mobile-nav button,
.warning-banner button {
  border: 0;
  cursor: pointer;
  transition: transform .15s, border-color .2s, background .2s, opacity .2s;
}
.primary-button {
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(120deg, #0675ed, #169bff);
  border-radius: 10px;
  color: white;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .12em;
  box-shadow: 0 10px 30px rgba(7, 118, 237, .25);
}
.login-button { justify-content: space-between; }
.button-arrow { font-size: 20px; font-weight: 400; }
.primary-button:hover,
.secondary-button:hover,
.control-button:hover { transform: translateY(-1px); }
.form-message { min-height: 22px; margin: 2px 0 10px; color: var(--red); font-size: 12px; line-height: 1.4; }
.form-message.success { color: var(--green); }
.login-foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #60778b;
  font-size: 9px;
  letter-spacing: .08em;
}
.status-pill { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.status-pill.online { color: var(--green); }
.status-pill.online i { background: var(--green); box-shadow: 0 0 9px var(--green); }
.status-pill.offline { color: var(--red); }
.status-pill.offline i { background: var(--red); }
.login-footer {
  height: 54px;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: #4f6678;
  font-size: 9px;
  letter-spacing: .12em;
}

/* App shell */
.app-page { padding-bottom: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 74px;
  padding: 0 clamp(18px, 3vw, 48px);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 10, 19, .88);
  backdrop-filter: blur(24px);
}
.topbar-brand { display: flex; align-items: center; gap: 15px; min-width: 0; }
.topbar-brand img { width: 120px; height: 38px; object-fit: contain; }
.topbar-brand div { padding-left: 14px; border-left: 1px solid var(--line-strong); }
.topbar-brand strong { display: block; font-size: 11px; letter-spacing: .13em; }
.topbar-brand span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; letter-spacing: .14em; }
.desktop-nav { align-self: stretch; display: flex; align-items: stretch; gap: 5px; }
.nav-button {
  position: relative;
  padding: 0 18px;
  background: transparent;
  color: #7791a7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
}
.nav-button::after { content: ""; position: absolute; left: 17px; right: 17px; bottom: 0; height: 2px; background: transparent; }
.nav-button.active { color: #fff; }
.nav-button.active::after { background: var(--blue); box-shadow: 0 0 14px var(--blue); }
.topbar-tools { display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.system-time { text-align: right; }
.system-time strong { display: block; font-size: 17px; letter-spacing: .08em; }
.system-time span { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.icon-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.025);
  color: #88a0b4;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
}
.app-shell { width: min(1580px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 64px; }
.view-panel { display: none; animation: viewIn .32s ease both; }
.view-panel.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}
.section-heading h1 { margin: 0; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.04em; }
.section-heading .eyebrow { margin-bottom: 8px; }
.camera-state {
  min-width: 205px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(255,77,109,.25);
  border-radius: 8px;
  background: rgba(255,77,109,.07);
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
}
.camera-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.camera-state.online { border-color: rgba(59,223,155,.3); background: rgba(59,223,155,.07); color: var(--green); }
.camera-state.online i { box-shadow: 0 0 10px var(--green); }
.warning-banner {
  margin: 0 0 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255,77,109,.3);
  border-radius: 10px;
  background: rgba(255,77,109,.07);
  color: #ffc2ce;
  font-size: 12px;
}
.warning-banner strong { color: #fff; }
.warning-banner span { flex: 1; }
.warning-banner button { padding: 8px 11px; border-radius: 6px; background: var(--red); color: #fff; font-size: 9px; font-weight: 900; }
.warning-banner.amber { border-color: rgba(255,190,76,.3); background: rgba(255,190,76,.06); color: #ffd993; }
.warning-banner.amber button { background: #b57911; }
.monitor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.glass-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(12, 28, 47, .82), rgba(5, 14, 26, .88));
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 18px 45px rgba(0,0,0,.18);
  backdrop-filter: blur(16px);
}
.video-card { overflow: hidden; }
.video-topline {
  height: 48px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  color: #7b93a7;
  font-size: 9px;
  letter-spacing: .09em;
}
.video-topline div { display: flex; align-items: center; gap: 11px; }
.video-topline strong { color: var(--red); }
.record-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 9px var(--red); animation: pulse 1.2s infinite; }
.video-stage {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #010407;
}
.video-stage > img { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.stream-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(circle, rgba(16,78,127,.16), transparent 46%), #030913;
  color: #7391aa;
  text-align: center;
}
.stream-placeholder strong { color: #adc2d3; font-size: 12px; letter-spacing: .11em; }
.stream-placeholder p { margin: 0; max-width: 80%; font-size: 11px; }
.radar {
  width: 88px;
  height: 88px;
  position: relative;
  margin-bottom: 7px;
  border: 1px solid rgba(73,216,255,.3);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 15px, rgba(73,216,255,.1) 16px 17px);
}
.radar::before,
.radar::after { content: ""; position: absolute; background: rgba(73,216,255,.18); }
.radar::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.radar::after { top: 50%; left: 0; right: 0; height: 1px; }
.radar span { position: absolute; inset: 5px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(73,216,255,.5), transparent 22%, transparent); animation: radar 2s linear infinite; }
@keyframes radar { to { transform: rotate(360deg); } }
.radar.small { width: 65px; height: 65px; }
.scanline { position: absolute; left: 0; right: 0; height: 2px; top: -2px; background: linear-gradient(90deg, transparent, rgba(73,216,255,.5), transparent); opacity: .36; animation: scan 7s linear infinite; pointer-events: none; }
@keyframes scan { to { transform: translateY(80vh); } }
.camera-osd { position: absolute; z-index: 2; color: rgba(255,255,255,.78); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-shadow: 0 1px 3px #000; }
.camera-osd.top-left { top: 15px; left: 16px; }
.camera-osd span { color: #b6cad9; font-weight: 400; }
.motion-overlay {
  position: absolute;
  z-index: 3;
  top: 15px;
  right: 16px;
  padding: 7px 10px;
  border: 1px solid var(--red);
  background: rgba(174, 13, 45, .75);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  opacity: 0;
  transform: translateY(-5px);
  transition: .2s;
}
.motion-overlay.active { opacity: 1; transform: none; }
.video-controls { min-height: 58px; padding: 9px 12px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.control-button,
.secondary-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.025);
  color: #9db1c2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}
.control-button:hover,
.secondary-button:hover { border-color: var(--line-strong); background: rgba(22,136,255,.08); color: #fff; }
.primary-small { margin-left: auto; border-color: rgba(22,136,255,.5); background: rgba(22,136,255,.16); color: #d8edff; }
.monitor-sidebar { display: grid; gap: 18px; align-content: start; }
.metric-card { padding: 20px; }
.metric-title { display: flex; align-items: center; justify-content: space-between; color: #8fa8bb; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.metric-title i { width: 7px; height: 7px; border-radius: 50%; background: #52697d; }
.metric-title i.active,
.online-static { background: var(--green) !important; box-shadow: 0 0 9px rgba(59,223,155,.7); }
.motion-score { margin: 20px 0 9px; display: flex; align-items: baseline; }
.motion-score strong { font-size: 54px; line-height: 1; letter-spacing: -.06em; }
.motion-score span { margin-left: 5px; color: var(--muted); font-size: 12px; }
.meter { height: 5px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.06); }
.meter span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--green), var(--amber), var(--red)); transition: width .3s; }
.metric-meta { margin-top: 12px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.metric-meta strong { color: #dcecff; }
.status-list { margin: 16px 0 0; padding: 0; list-style: none; }
.status-list li { padding: 9px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid rgba(255,255,255,.045); color: var(--muted); font-size: 10px; }
.status-list li:last-child { border-bottom: 0; }
.status-list strong { color: #c8d9e7; font-size: 9px; letter-spacing: .05em; }
.network-card code { display: block; margin: 18px 0 7px; color: var(--cyan); font: 700 13px Consolas, monospace; word-break: break-all; }
.network-card p { margin: 0 0 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.network-card .secondary-button { width: 100%; }

/* Events */
.events-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.events-summary > div { padding: 16px 18px; border: 1px solid var(--line); border-radius: 11px; background: rgba(7,19,33,.65); }
.events-summary span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.events-summary strong { font-size: 15px; }
.events-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.event-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.event-card img { width: 100%; aspect-ratio: 16/9; display: block; object-fit: cover; background: #000; }
.event-card-body { padding: 13px; }
.event-card-head { display: flex; justify-content: space-between; gap: 12px; }
.event-card-head strong { font-size: 11px; letter-spacing: .06em; }
.event-card-head span { color: var(--cyan); font-size: 10px; }
.event-card time { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.empty-state { min-height: 390px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-state strong { color: #a9bdcd; font-size: 12px; letter-spacing: .12em; }
.empty-state p { margin: 0; font-size: 11px; }

/* Settings */
.settings-badge { padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 18px; align-items: start; }
.settings-column { display: grid; gap: 18px; }
.settings-card { padding: clamp(20px, 2.4vw, 30px); }
.settings-card.compact { padding: 22px; }
.settings-card-title { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.settings-card-title > div { display: flex; align-items: center; gap: 12px; }
.settings-card-title div > span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--cyan); font-size: 10px; font-weight: 900; }
.settings-card-title h2 { margin: 0; font-size: 18px; }
.settings-card-title small { color: #648096; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.settings-card label { display: block; margin-bottom: 17px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-card select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6f899f 50%), linear-gradient(135deg, #6f899f 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.range-block { margin: 6px 0 19px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.16); }
.range-block > div:first-child { display: flex; justify-content: space-between; color: #9db2c3; font-size: 11px; }
.range-block strong { color: var(--cyan); }
.range-block input { height: 25px; padding: 0; border: 0; background: transparent; accent-color: var(--blue); }
.range-labels { display: flex; justify-content: space-between; color: #587087; font-size: 7px; font-weight: 800; letter-spacing: .11em; }
.switch-row { min-height: 56px; padding: 0 2px; display: flex !important; align-items: center; justify-content: space-between; gap: 18px; }
.switch-row > span { margin: 0 !important; }
.switch-row strong { display: block; color: #d7e7f3; font-size: 11px; letter-spacing: 0; text-transform: none; }
.switch-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; flex: 0 0 42px; height: 23px; border-radius: 20px; background: #24384a; transition: .2s; }
.switch-row i::after { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: #73889a; transition: .2s; }
.switch-row input:checked + i { background: rgba(22,136,255,.45); }
.switch-row input:checked + i::after { transform: translateX(19px); background: #fff; box-shadow: 0 0 10px var(--blue); }
.secondary-button.full { width: 100%; }
.qr-card > p { margin: -4px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.qr-box { min-height: 220px; display: grid; place-items: center; margin: 0 0 13px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #fff; color: #59636a; font-size: 9px; font-weight: 900; letter-spacing: .09em; }
.qr-box img { width: 200px; height: 200px; }
.pair-countdown { min-height: 18px; margin-bottom: 8px; color: var(--amber); font-size: 9px; text-align: center; }
.access-card dl { margin: 0; }
.access-card dl > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.access-card dl > div:last-child { border-bottom: 0; }
.access-card dt { margin-bottom: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.access-card dd { margin: 0; color: #d5e6f2; font: 600 11px/1.45 var(--font); word-break: break-word; }
.mobile-nav { display: none; }
.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: 390px;
  padding: 14px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #0c2034;
  box-shadow: var(--shadow);
  color: #dcecff;
  font-size: 11px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .25s;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: rgba(255,77,109,.45); color: #ffc3ce; }

@media (max-width: 1080px) {
  .topbar { grid-template-columns: 1fr auto; }
  .desktop-nav { display: none; }
  .monitor-grid { grid-template-columns: 1fr; }
  .monitor-sidebar { grid-template-columns: repeat(3, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-column { grid-template-columns: repeat(2, 1fr); }
  .access-card { grid-column: 1 / -1; }
  .events-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .mobile-nav {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: rgba(5, 17, 30, .94);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
  }
  .mobile-nav button { min-width: 104px; padding: 9px 14px; border-radius: 9px; background: transparent; color: #7790a5; font-size: 9px; font-weight: 900; letter-spacing: .06em; }
  .mobile-nav button span { display: block; margin-bottom: 3px; font-size: 15px; }
  .mobile-nav button.active { background: rgba(22,136,255,.17); color: #fff; }
  .app-shell { padding-bottom: 110px; }
}

@media (max-width: 760px) {
  .login-shell { width: min(100% - 28px, 520px); grid-template-columns: 1fr; gap: 22px; padding: 28px 0 34px; }
  .login-brand { text-align: center; }
  .brand-kicker { justify-content: center; }
  .cinematic-logo { margin: -40px auto -34px; }
  .login-brand h1 { font-size: 29px; }
  .login-brand > p { margin: 18px auto; font-size: 13px; }
  .protocol-row { justify-content: center; }
  .login-card { padding: 29px 23px; }
  .login-footer { width: calc(100% - 28px); font-size: 7px; }
  .topbar { height: 64px; padding: 0 14px; gap: 10px; }
  .topbar-brand img { width: 94px; }
  .topbar-brand div { display: none; }
  .topbar-tools { gap: 8px; }
  .system-time span { display: none; }
  .system-time strong { font-size: 14px; }
  .app-shell { width: calc(100% - 24px); padding-top: 24px; }
  .section-heading { align-items: start; margin-bottom: 18px; }
  .section-heading h1 { font-size: 25px; }
  .camera-state { min-width: 0; padding: 10px; }
  .camera-state span { display: none; }
  .warning-banner { align-items: start; flex-wrap: wrap; }
  .warning-banner button { width: 100%; }
  .video-topline > div:last-child { display: none; }
  .video-stage { aspect-ratio: 4/3; }
  .video-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .control-button { min-height: 42px; padding: 0 7px; font-size: 8px; }
  .primary-small { margin-left: 0; }
  .monitor-sidebar { grid-template-columns: 1fr; }
  .events-summary { grid-template-columns: 1fr; }
  .events-grid { grid-template-columns: 1fr 1fr; }
  .settings-column { grid-template-columns: 1fr; }
  .access-card { grid-column: auto; }
  .form-grid.two { grid-template-columns: 1fr; gap: 0; }
  .settings-badge { display: none; }
  .mobile-nav { width: calc(100% - 24px); bottom: 9px; justify-content: stretch; }
  .mobile-nav button { min-width: 0; flex: 1; }
  .toast { left: 12px; right: 12px; bottom: 90px; max-width: none; }
}

@media (max-width: 430px) {
  .events-grid { grid-template-columns: 1fr; }
  .login-foot { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
.camera-switcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.camera-switch-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 82px;
  padding: 8px;
  color: #9fb1c3;
  text-align: left;
  background: rgba(4, 16, 28, .78);
  border: 1px solid rgba(79, 132, 173, .22);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.camera-switch-card:hover,
.camera-switch-card.active {
  color: #eef7ff;
  background: rgba(8, 30, 50, .95);
  border-color: rgba(36, 160, 255, .75);
  transform: translateY(-1px);
}

.camera-switch-preview {
  position: relative;
  display: block;
  width: 112px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #01070d;
  border-radius: 8px;
}

.camera-switch-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-switch-preview i {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 8px;
  height: 8px;
  background: #ff385d;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff385d;
}

.camera-switch-card.online .camera-switch-preview i {
  background: #36e5a2;
  box-shadow: 0 0 10px #36e5a2;
}

.camera-switch-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.camera-switch-copy strong,
.camera-switch-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-switch-copy strong { font-size: 13px; letter-spacing: .08em; }
.camera-switch-copy small { color: #7890a6; font-size: 11px; }

.camera-form-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.camera-form-toolbar label { margin: 0; }
.camera-form-toolbar .secondary-button { min-height: 46px; white-space: nowrap; }

@media (max-width: 620px) {
  .camera-switcher { grid-template-columns: 1fr; }
  .camera-form-toolbar { grid-template-columns: 1fr; }
  .camera-form-toolbar .secondary-button { width: 100%; }
}
