:root {
  --ink: #111820;
  --ink-soft: #19232d;
  --panel: #202c36;
  --paper: #f5f2eb;
  --paper-deep: #e9e5dc;
  --white: #fff;
  --muted: #6f777e;
  --line: rgba(17, 24, 32, .12);
  --accent: #ff5a36;
  --accent-deep: #db3f20;
  --green: #31b977;
  --amber: #dca137;
  --radius: 20px;
  --shadow: 0 20px 60px rgba(18, 25, 32, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.is-hidden { display: none !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 30px 22px;
  display: flex; flex-direction: column; color: #e9eef2;
  background: var(--ink); border-right: 1px solid rgba(255,255,255,.07);
}
.brand, .auth-brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  color: #fff; background: var(--accent); font-size: 13px; font-weight: 900; letter-spacing: -.5px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.12);
}
.brand strong { display: block; font-size: 17px; letter-spacing: -.4px; }
.brand small { display: block; color: #98a5af; font-size: 12px; margin-top: 1px; }
.primary-nav { display: grid; gap: 7px; margin-top: 60px; }
.nav-item {
  width: 100%; display: flex; gap: 13px; align-items: center; padding: 12px 13px;
  border: 0; border-radius: 12px; color: #9eabb4; background: transparent; text-align: left;
  font-size: 14px; font-weight: 700; transition: .2s ease;
}
.nav-item span { width: 22px; text-align: center; font-size: 17px; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.075); }
.nav-item.active span { color: var(--accent); }
.sidebar-foot { margin-top: auto; }
.device-chip {
  display: flex; align-items: center; gap: 10px; padding: 13px;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.07); border-radius: 14px;
}
.device-chip strong, .device-chip small { display: block; }
.device-chip strong { font-size: 11px; letter-spacing: .1px; }
.device-chip small { color: #8997a1; font-size: 10px; margin-top: 3px; }
.pulse-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(49,185,119,.12); }
.sidebar .text-button { margin-top: 15px; color: #909ca5; }

.main { min-width: 0; padding: 32px clamp(24px, 4vw, 64px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 7px; color: var(--accent-deep); font-size: 10px; line-height: 1; font-weight: 900; letter-spacing: 1.7px; }
.topbar h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -1.3px; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.connection-badge { display: flex; gap: 9px; align-items: center; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); font-size: 11px; font-weight: 800; }
.connection-badge.dummy { color: #9c451f; border-color: rgba(255,90,54,.25); background: rgba(255,90,54,.09); }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 20px; transition: transform .2s; }
.icon-button:hover { transform: rotate(30deg); }

.page { display: none; animation: page-in .25s ease; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.hero-panel {
  min-height: 330px; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center;
  padding: clamp(34px, 5vw, 64px); overflow: hidden; border-radius: 27px;
  color: #fff; background: linear-gradient(128deg, #111820 0%, #1b2731 100%);
  box-shadow: var(--shadow); position: relative;
}
.hero-panel::after { content: ""; position: absolute; right: -12%; bottom: -45%; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(255,90,54,.14), transparent 64%); }
.hero-panel h2 { margin: 0; font-size: clamp(37px, 5vw, 63px); line-height: .98; letter-spacing: -3.3px; }
.hero-panel h2 em { color: var(--accent); font-family: Georgia, serif; font-weight: 400; }
.hero-panel p:not(.eyebrow) { max-width: 510px; margin: 23px 0 27px; color: #aeb9c1; line-height: 1.65; font-size: 14px; }
.primary-button, .small-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: 11px; font-weight: 800; text-decoration: none; transition: .2s ease;
}
.primary-button { min-height: 46px; padding: 0 18px; color: #fff; background: var(--accent); box-shadow: 0 8px 23px rgba(255,90,54,.25); }
.primary-button:hover { transform: translateY(-1px); background: var(--accent-deep); }
.small-button { min-height: 36px; padding: 0 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); font-size: 12px; }
.small-button:hover { border-color: rgba(17,24,32,.3); }
.small-button:disabled { cursor: wait; color: var(--muted); background: var(--paper-deep); border-color: var(--line); opacity: .82; }
.small-button[aria-busy="true"]::before { content: ""; width: 10px; height: 10px; border: 2px solid rgba(17,24,32,.2); border-top-color: var(--accent); border-radius: 50%; animation: command-spin .8s linear infinite; }
@keyframes command-spin { to { transform: rotate(360deg); } }
.text-button { padding: 7px 5px; color: var(--muted); border: 0; background: transparent; font-size: 12px; font-weight: 800; }
.sync-orbit { position: relative; min-height: 235px; display: grid; place-items: center; }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.orbit-one { width: 300px; height: 300px; }
.orbit-two { width: 205px; height: 205px; }
.camera-glyph, .drive-glyph {
  z-index: 2; position: absolute; display: grid; place-items: center; color: #fff; background: #26343f; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 16px 30px rgba(0,0,0,.27);
}
.camera-glyph { left: 16%; width: 112px; height: 82px; border-radius: 18px; }
.camera-glyph::before { content: ""; position: absolute; left: 15px; top: 14px; width: 34px; height: 25px; border: 3px solid #a9b5be; border-radius: 6px; }
.camera-glyph span { position: absolute; left: 25px; top: 22px; color: var(--accent); font-size: 8px; }
.camera-glyph b, .drive-glyph b { position: absolute; right: 12px; bottom: 11px; font-size: 9px; letter-spacing: 1px; }
.drive-glyph { right: 12%; width: 95px; height: 113px; border-radius: 18px; }
.drive-glyph span { width: 49px; height: 12px; border: 2px solid #94a2ad; border-radius: 5px; }
.drive-glyph span::after { content: ""; float: right; width: 5px; height: 5px; margin: 2px 4px; background: var(--green); border-radius: 50%; }
.transfer-line { display: flex; gap: 12px; align-items: center; }
.transfer-line::before, .transfer-line::after { content: ""; width: 38px; height: 1px; background: rgba(255,255,255,.16); }
.transfer-line i { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; animation: transfer 1.4s infinite; }
.transfer-line i:nth-child(2) { animation-delay: .18s; }.transfer-line i:nth-child(3) { animation-delay: .36s; }
@keyframes transfer { 0%, 70%, 100% { opacity: .2; transform: scale(.8); } 35% { opacity: 1; transform: scale(1.25); } }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin: 18px 0; }
.metric-card { min-height: 135px; padding: 23px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-label { display: block; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 13px; font-size: 36px; line-height: 1; letter-spacing: -1.7px; }
.metric-card strong i { margin: 0 4px; color: #b8b8b2; font-style: normal; font-size: 18px; }
.metric-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.storage-bar { height: 4px; margin-top: 14px; overflow: hidden; border-radius: 9px; background: var(--paper-deep); }
.storage-bar span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .5s; }
.split-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 18px; }
.panel { padding: 26px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head, .section-heading.inline { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.panel h3 { margin: 0; font-size: 18px; letter-spacing: -.5px; }
.event-list { display: grid; gap: 3px; margin-top: 16px; }
.event-row { display: grid; grid-template-columns: 9px 1fr auto; gap: 11px; align-items: center; min-height: 45px; border-bottom: 1px solid rgba(17,24,32,.07); }
.event-row:last-child { border-bottom: 0; }
.event-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.event-row.warning .event-dot { background: var(--amber); }.event-row.error .event-dot { background: var(--accent); }
.event-row span { font-size: 12px; font-weight: 700; }.event-row time { color: var(--muted); font-size: 10px; }
.empty-state { min-height: 90px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.camera-summary { display: grid; gap: 10px; margin-top: 18px; }
.camera-summary-row { display: flex; align-items: center; gap: 13px; padding: 11px; border-radius: 12px; background: var(--paper); }
.camera-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--ink); }
.camera-summary-row strong, .camera-summary-row small { display: block; }.camera-summary-row strong { font-size: 12px; }.camera-summary-row small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.status-pill { margin-left: auto; padding: 5px 8px; border-radius: 99px; color: #188253; background: rgba(49,185,119,.12); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.status-pill.offline, .status-pill.waiting { color: #6e7478; background: rgba(90,95,100,.1); }
.status-pill.error { color: #c64225; background: rgba(255,90,54,.12); }
.status-pill.syncing, .status-pill.connecting { color: #a46a08; background: rgba(220,161,55,.14); }

.section-heading { margin: 15px 0 28px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 5vw, 54px); letter-spacing: -2.3px; }
.section-heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.filter-bar, .inline-form { display: flex; gap: 12px; align-items: end; margin-bottom: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.62); }
label { display: grid; gap: 7px; color: #404951; font-size: 11px; font-weight: 800; }
label span { color: var(--muted); font-weight: 500; }
input, select {
  min-height: 43px; padding: 0 12px; color: var(--ink); background: #fff;
  border: 1px solid rgba(17,24,32,.17); border-radius: 10px; outline: 0;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,54,.1); }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.video-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 6px 22px rgba(18,25,32,.04); }
.video-thumb { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; position: relative; border: 0; color: #fff; background: linear-gradient(145deg, #1a242c, #30414d); }
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-thumb::after { content: ""; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); box-shadow: 0 8px 20px rgba(0,0,0,.22); }
.video-thumb::before { z-index: 1; content: ""; position: absolute; margin-left: 3px; border-left: 10px solid white; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.video-duration { position: absolute; z-index: 2; right: 10px; bottom: 10px; padding: 3px 6px; border-radius: 5px; color: #fff; background: rgba(8,12,16,.82); font-size: 11px; font-weight: 800; line-height: 1; }
.video-card.pending .video-duration { bottom: 24px; }
.video-card.pending .video-thumb::after { background: #64717b; }
.video-card.pending .video-thumb::before { display: none; }
.video-progress { position: absolute; left: 15px; right: 15px; bottom: 14px; height: 4px; background: rgba(255,255,255,.2); border-radius: 10px; overflow: hidden; }
.video-progress span { display: block; height: 100%; background: var(--accent); }
.video-body { padding: 16px; }
.video-body strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.video-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.video-actions { display: flex; gap: 8px; margin-top: 14px; }
.video-actions { flex-wrap: wrap; align-items: center; }
.video-actions .small-button { flex: 1; }
.processing-note { display: block; margin-top: 9px; color: var(--muted); }
.camera-options { display: grid; gap: 8px; margin: 16px 0; padding: 13px; border-radius: 12px; background: var(--paper-deep); }
.camera-options label { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; }
.camera-help { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.camera-actions { flex-wrap: wrap; }
.camera-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.camera-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.75); }
.camera-card-head { display: flex; gap: 13px; align-items: center; }
.camera-card-head h3 { margin: 0; font-size: 18px; }.camera-card-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.camera-connection { display: flex; align-items: center; gap: 10px; margin-top: 15px; padding: 11px 12px; border-radius: 12px; background: rgba(90,95,100,.07); }
.camera-connection .connection-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #858b90; box-shadow: 0 0 0 4px rgba(90,95,100,.09); }
.camera-connection strong, .camera-connection small { display: block; }.camera-connection strong { font-size: 11px; }.camera-connection small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.camera-connection.connected, .camera-connection.recent { background: rgba(49,185,119,.08); }
.camera-connection.connected .connection-dot, .camera-connection.recent .connection-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(49,185,119,.12); }
.camera-connection.connecting { background: rgba(220,161,55,.1); }
.camera-connection.connecting .connection-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(220,161,55,.13); animation: pulse 1.4s ease-in-out infinite; }
.camera-connection.error { background: rgba(255,90,54,.08); }
.camera-connection.error .connection-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(255,90,54,.1); }
.sync-readiness { display: grid; gap: 3px; margin: 12px 0 14px; padding: 11px 12px; border-left: 3px solid #92989c; border-radius: 0 10px 10px 0; background: rgba(90,95,100,.05); }
.sync-readiness strong { font-size: 11px; }.sync-readiness span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.sync-readiness.ready, .sync-readiness.syncing { border-left-color: var(--green); background: rgba(49,185,119,.06); }
.status-pill.connected, .status-pill.recent { color: #188253; background: rgba(49,185,119,.12); }
.camera-details { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 20px 0; }
.camera-details div { padding: 11px; border-radius: 11px; background: var(--paper); }
.camera-details span, .camera-details strong { display: block; }.camera-details span { color: var(--muted); font-size: 9px; text-transform: uppercase; }.camera-details strong { margin-top: 4px; font-size: 12px; }
.camera-error { padding: 10px; margin-bottom: 14px; color: #a23a23; background: rgba(255,90,54,.09); border-radius: 9px; font-size: 11px; }
.camera-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.remote-panel { margin-bottom: 18px; }
.remote-status { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 12px; background: var(--paper-deep); }
.remote-status.ready { background: #edf7ef; }
.remote-status.warning { background: #fff4df; }
.remote-status > div { display: grid; gap: 2px; }
.remote-status small, .remote-note { color: var(--muted); }
.remote-steps { margin: 14px 0; padding-left: 22px; color: var(--muted); line-height: 1.65; }
.command-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 12px; background: #121920; color: #fff; }
.command-box code { overflow-wrap: anywhere; }
.remote-url { display: block; width: fit-content; margin: 12px 0; font-weight: 800; }
.danger { color: #bd3b20 !important; }
.network-status { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.network-status div { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.7); }
.network-status span, .network-status strong { display: block; }.network-status span { color: var(--muted); font-size: 9px; text-transform: uppercase; font-weight: 900; }.network-status strong { margin-top: 7px; font-size: 13px; }
.network-list { display: grid; gap: 8px; margin-top: 15px; }
.readiness-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.readiness-panel > div { flex: 1; }
.readiness-card { padding: 14px 16px; margin: 14px 0; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.72); }
.readiness-card strong, .readiness-card small { display: block; }
.readiness-card strong { font-size: 13px; }
.readiness-card small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.readiness-card.ready { border-color: rgba(52,168,103,.32); background: rgba(52,168,103,.08); }
.readiness-card.warning { border-color: rgba(240,153,35,.35); background: rgba(240,153,35,.09); }
.readiness-card.blocked { border-color: rgba(214,71,48,.35); background: rgba(214,71,48,.08); }
.network-row { min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 10px 11px; border: 1px solid rgba(17,24,32,.08); border-radius: 12px; background: var(--paper); }
.network-row > span:first-child { font-size: 19px; }.network-row strong, .network-row small { display: block; }.network-row strong { font-size: 12px; }.network-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.network-row button { margin-left: auto; }
.compact .network-row { background: #fff; }

.auth-view, .setup-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: #fff; background: var(--ink); }
.auth-view::before, .setup-view::before { content: ""; position: fixed; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(255,90,54,.13), transparent 67%); right: -120px; bottom: -140px; }
.auth-brand { position: fixed; top: 28px; left: 32px; z-index: 2; }
.auth-card { z-index: 1; width: min(420px, 100%); padding: 40px; color: var(--ink); background: var(--paper); border-radius: 23px; box-shadow: 0 25px 80px rgba(0,0,0,.3); }
.auth-card h1, .setup-step h2 { margin: 0; font-size: 38px; letter-spacing: -1.7px; }
.auth-card > p:not(.eyebrow), .setup-step > p:not(.eyebrow, .form-error, .form-note) { color: var(--muted); line-height: 1.5; }
.auth-card label { margin: 15px 0; }.auth-card .primary-button { width: 100%; margin-top: 8px; }
.form-error { min-height: 16px; margin: 9px 0 0; color: #c43d23 !important; font-size: 11px; font-weight: 700; }
.setup-frame { z-index: 1; width: min(1050px, 100%); min-height: 650px; display: grid; grid-template-columns: 36% 64%; overflow: hidden; border-radius: 26px; box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.setup-aside { display: flex; flex-direction: column; justify-content: space-between; padding: 45px; background: linear-gradient(145deg, #1c2933, #121a21); }
.setup-aside .auth-brand { position: static; }
.setup-aside h1 { margin: 0; font-size: 48px; line-height: 1; letter-spacing: -2.7px; }
.setup-aside > div > p:not(.eyebrow) { color: #93a0aa; line-height: 1.65; font-size: 13px; }
#setup-progress { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; margin: 0; padding: 0; list-style: none; counter-reset: steps; }
#setup-progress li { overflow: hidden; color: transparent; font-size: 1px; }
#setup-progress li::before { content: ""; display: block; height: 3px; border-radius: 8px; background: rgba(255,255,255,.12); }
#setup-progress li.active::before, #setup-progress li.done::before { background: var(--accent); }
.setup-content { display: grid; padding: clamp(35px, 6vw, 80px); color: var(--ink); background: var(--paper); }
.setup-step { display: none; align-content: center; max-width: 500px; width: 100%; margin: auto; }
.setup-step.active { display: grid; animation: page-in .25s ease; }
.setup-step label:not(.choice-card) { margin: 13px 0; }
.setup-step .primary-button { margin-top: 15px; justify-self: start; }
.choice-card { display: flex; align-items: center; gap: 12px; margin: 11px 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.choice-card input { min-height: auto; accent-color: var(--accent); }.choice-card strong, .choice-card small { display: block; }.choice-card small { margin-top: 3px; }
.choice-card.muted { opacity: .55; pointer-events: none; }
.setup-actions { display: flex; gap: 15px; align-items: center; }
.form-note { margin: 3px 0; color: var(--muted); font-size: 11px; }
.ready-checks { display: grid; gap: 10px; margin: 22px 0; }
.ready-checks div { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ready-checks div > span { grid-row: 1 / 3; width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; }.ready-checks strong { font-size: 12px; }.ready-checks small { color: var(--muted); font-size: 10px; margin-top: 3px; }

dialog { width: min(430px, calc(100% - 28px)); padding: 31px; border: 0; border-radius: 20px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 90px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,15,20,.68); backdrop-filter: blur(4px); }
dialog h2 { margin: 0 0 20px; }
.dialog-close { position: absolute; top: 13px; right: 15px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(17,24,32,.07); font-size: 22px; }
dialog label { margin: 14px 0; }.video-dialog { width: min(900px, calc(100% - 28px)); padding: 12px; background: #111820; color: #fff; }
.video-dialog video { display: block; width: 100%; max-height: 72vh; border-radius: 13px; background: #000; }
.dummy-preview {
  aspect-ratio: 16 / 9; position: relative; display: grid; place-content: center;
  overflow: hidden; border-radius: 13px; text-align: center;
  background: linear-gradient(180deg, #93b7c7 0 52%, #223743 52% 100%);
}
.dummy-preview::before {
  content: ""; position: absolute; inset: 42% -10% auto; height: 26%;
  background: #304f4f; clip-path: polygon(0 72%, 22% 8%, 43% 78%, 64% 0, 82% 61%, 100% 22%, 100% 100%, 0 100%);
}
.dummy-preview::after {
  content: ""; position: absolute; inset: 60% -15% -10%; opacity: .65;
  background: repeating-linear-gradient(170deg, rgba(255,255,255,.2) 0 2px, transparent 2px 22px);
  animation: dummy-water 3s linear infinite;
}
.dummy-preview strong, .dummy-preview small { z-index: 2; text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.dummy-preview strong { font-size: clamp(19px, 3vw, 34px); }
.dummy-preview small { margin-top: 8px; color: rgba(255,255,255,.82); }
.dummy-rec { position: absolute; z-index: 3; top: 18px; left: 20px; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.dummy-rec::first-letter { color: var(--accent); }
@keyframes dummy-water { to { transform: translateX(40px); } }
.video-dialog > div { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 8px 3px; }
.video-dialog > .dummy-preview { display: grid; padding: 0; }
.video-dialog .dialog-close { z-index: 2; color: #fff; background: rgba(0,0,0,.5); }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 17px; color: #fff; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s; font-size: 12px; }
.toast.show { opacity: 1; transform: none; }.toast.error { background: #9e321e; }
.loader { padding: 25px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .video-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-panel { grid-template-columns: 1fr .75fr; }
}
@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { z-index: 10; position: fixed; top: auto; bottom: 0; width: 100%; height: 70px; padding: 8px 12px; border: 0; border-top: 1px solid rgba(255,255,255,.1); }
  .sidebar .brand, .sidebar-foot { display: none; }
  .primary-nav { grid-template-columns: repeat(5,1fr); gap: 3px; margin: 0; }
  .nav-item { display: grid; place-items: center; gap: 2px; padding: 7px 2px; font-size: 9px; text-align: center; }
  .nav-item span { font-size: 17px; }
  .main { padding: 24px 18px 95px; }
  .hero-panel { grid-template-columns: 1fr; min-height: 390px; }
  .sync-orbit { display: none; }
  .split-grid, .camera-grid { grid-template-columns: 1fr; }
  .network-status { grid-template-columns: repeat(2,1fr); }
  .setup-frame { grid-template-columns: 1fr; min-height: 650px; }
  .setup-aside { display: none; }
}
@media (max-width: 560px) {
  .topbar-actions .connection-badge { display: none; }
  .hero-panel { padding: 34px 25px; }
  .metrics-grid, .video-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 115px; }
  .filter-bar, .inline-form { align-items: stretch; flex-direction: column; }
  .section-heading.inline { align-items: stretch; flex-direction: column; }
  .camera-details { grid-template-columns: 1fr 1fr; }
  .auth-view { align-items: start; padding-top: 110px; }
  .auth-card { padding: 28px; }
  .network-grid { grid-template-columns: 1fr; }
}
