@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-400.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-500.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-600.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-700.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/inter-800.ttf") format("truetype"); }

:root {
  color-scheme: dark;
  --app-bg: #090e17;
  --app-sidebar: #0d1420;
  --app-surface: #121c2b;
  --app-elevated: #192536;
  --app-hover: #202f42;
  --app-border: #263447;
  --app-border-subtle: #1d2938;
  --app-text: #f1f5f9;
  --app-muted: #a0aec0;
  --app-dim: #718096;
  --app-blue: #3b82f6;
  --app-blue-hover: #2563eb;
  --app-green: #22c55e;
  --app-amber: #f59e0b;
  --app-red: #ef4444;
  --app-recording: #f43f5e;
  --app-radius: 8px;
  font-family: "Inter", "Open Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: inherit;
  letter-spacing: -.008em;
}
body:not(.authPage) {
  height: 100%;
  overflow: hidden;
}
button, input, select { font: inherit; }
a { color: inherit; }

.app-shell {
  display: flex;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.sidebar {
  width: 236px;
  flex: 0 0 236px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 20px 12px 14px;
  background: var(--app-sidebar);
  border-right: 1px solid var(--app-border-subtle);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 8px;
  text-decoration: none;
}
.brandMark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
}
.brandLogo { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.brandText { display: grid; gap: 2px; }
.brandText strong { font-size: 18px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.brandText small { color: var(--app-dim); font-size: 11px; line-height: 1.2; }
.sidebarLabel {
  padding: 0 8px;
  color: var(--app-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sideNav {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 4px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #29465a transparent;
}
.sideNav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.sideNav a:hover { background: var(--app-hover); color: var(--app-text); }
.sideNav a.active { background: #172a42; border-color: #2b4d70; color: var(--app-text); }
.navIcon { width: 17px; height: 17px; display: grid; place-items: center; color: currentColor; }
.navIcon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.serviceDot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--app-green); box-shadow: 0 0 0 3px #22c55e1c; }
.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.shell { width: 100%; max-width: none; margin: 0; padding: 24px 28px 44px; }
.top { margin: 0 0 18px; padding: 0 0 18px; border-bottom: 1px solid var(--app-border-subtle); }
.top h1 { margin: 6px 0 5px; color: var(--app-text); font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.top p { max-width: 760px; margin: 0; color: var(--app-muted); font-size: 12px; line-height: 1.5; }
.eyebrow { color: #60a5fa; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.top .links { display: none; }
.legacyNav { display: none !important; }

.toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 600;
}
.toolbar label { margin-left: 3px; }
.select, .field {
  min-height: 36px;
  margin-top: 0;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: #0e1725;
  color: var(--app-text);
  font-size: 12px;
}
.toolbar .select { min-width: 132px; }
.select:focus, .field:focus, .range:focus { outline: 2px solid #3b82f655; outline-offset: 1px; border-color: var(--app-blue); }
.button, .link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-elevated);
  color: var(--app-text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}
.button:hover, .link:hover { border-color: #3d5d7e; background: var(--app-hover); }
.button:disabled { cursor: wait; opacity: .55; }
.button.primary { border-color: var(--app-blue); background: var(--app-blue); color: #fff; }
.button.primary:hover { border-color: var(--app-blue-hover); background: var(--app-blue-hover); }
.button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.hint { margin-left: auto; color: var(--app-dim); font-size: 11px; }
.status { min-height: 20px; margin: 0 0 12px; color: var(--app-amber); font-size: 12px; }

.grid { gap: 10px; }
.grid[data-layout="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); box-shadow: 0 10px 30px #00000022; }
.cardHead { padding: 9px 11px; background: #152235; border-bottom: 1px solid var(--app-border-subtle); }
.cardHead b { font-size: 12px; }
.playing { color: var(--app-green); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.screen { background: #05080e; }
.screen iframe { display: block; }
.meta { padding: 8px 10px; color: var(--app-dim); font-size: 10px; }
.placeholder, .empty { color: var(--app-dim); }

.layout { gap: 14px; margin-top: 14px; }
.layout > .card { align-self: start; }
.availabilityCard { margin-top: 0; padding: 18px; }
.availabilityHeader { align-items: flex-end; }
.availabilityHeader h2 { margin: 5px 0 4px; color: var(--app-text); font-size: 16px; }
.availabilityHeader p { color: var(--app-muted); font-size: 12px; }
.availabilityActions label { color: var(--app-dim); font-size: 10px; }
.availabilityActions .select, .availabilityActions .field { min-width: 138px; border-color: var(--app-border); background: #0e1725; }
.availabilityMeta { margin-top: 15px; color: var(--app-text); }
.availabilityMeta span { color: var(--app-muted); }
.weekdayRow { color: var(--app-dim); }
.availabilityDay { border-color: var(--app-border); background: #0e1725 !important; color: var(--app-dim) !important; }
.availabilityDay.available { border-color: #266b54; background: #123328 !important; color: var(--app-text) !important; }
.availabilityDay.available:hover { transform: translateY(-1px); border-color: var(--app-green); box-shadow: 0 6px 16px #22c55e22; }
.availabilityDay.active { outline: 2px solid var(--app-blue); }
.availabilityDay .dayMeta { color: var(--app-dim); }
.availabilityDay.available .dayMeta { color: #86efac; }
.availabilityLegend { color: var(--app-dim); }
.legendDot.available { background: var(--app-green); }
.player { padding: 16px; }
.playerTitle { margin-bottom: 12px; }
.playerTitle b { color: var(--app-text); font-size: 14px; }
.player iframe { height: auto; aspect-ratio: 16 / 9; max-height: 68vh; }
.timeline { padding-top: 14px; }
.timeline label { color: var(--app-muted); }
.range { accent-color: var(--app-blue); }
.segments { margin-top: 14px; }
.segment { border-color: var(--app-border); background: var(--app-surface); }
.segmentText { color: var(--app-text); }
.segmentText small { color: var(--app-dim); }

@media (max-width: 1100px) {
  .sidebar { width: 208px; flex-basis: 208px; }
  .shell { padding: 22px 20px 36px; }
  .layout { grid-template-columns: 300px 1fr; }
}
@media (max-width: 860px) {
  body:not(.authPage) { height: auto; overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100dvh; overflow: visible; }
  .app-main { height: auto; min-height: 0; overflow: visible; }
  .sidebar { width: 100%; height: auto; min-height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 11px 14px; border-right: 0; border-bottom: 1px solid var(--app-border-subtle); overflow: visible; }
  .sidebarLabel { display: none; }
  .sideNav { display: flex; flex: 1 1 auto; gap: 3px; justify-content: flex-end; overflow: visible; }
  .sideNav a { min-height: 34px; padding: 7px 8px; }
  .sideNav a span:last-child { display: none; }
  .shell { padding: 18px 14px 30px; }
  .layout { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid[data-layout="32"], .grid[data-layout="48"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .sidebar { align-items: flex-start; }
  .brandMark { width: 40px; height: 40px; flex-basis: 40px; }
  .brandText { display: none; }
  .sideNav { flex-wrap: wrap; }
  .toolbar { align-items: stretch; }
  .toolbar .hint { width: 100%; margin-left: 0; }
  .grid, .grid[data-layout="32"], .grid[data-layout="48"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .availabilityHeader { display: block; }
  .availabilityActions { margin-top: 14px; }
  .availabilityActions label, .availabilityActions .select, .availabilityActions .field { width: 100%; }
  .availabilityActions .button { width: 100%; }
}
@media (max-width: 420px) {
  .grid, .grid[data-layout="32"], .grid[data-layout="48"] { grid-template-columns: 1fr; }
  .grid[data-layout="4"] { grid-template-columns: 1fr; }
}

/* Live wall fullscreen mode keeps the selected camera group mounted while
   giving the mosaic every available pixel. JavaScript chooses the most
   footage-efficient columns and rows for the current camera count and viewport. */
body.wallFullscreen {
  background: #000;
  overflow: hidden;
}
body.wallFullscreen .app-shell {
  min-height: 100vh;
  height: 100vh;
}
body.wallFullscreen .sidebar,
body.wallFullscreen .top,
body.wallFullscreen .toolbar,
body.wallFullscreen #status {
  display: none;
}
body.wallFullscreen .app-main,
body.wallFullscreen .shell {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  height: 100vh;
  margin: 0;
  padding: 0;
}
body.wallFullscreen .app-main { overflow: hidden; }
body.wallFullscreen #grid {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  grid-template-columns: repeat(var(--wall-columns, 4), minmax(0, 1fr)) !important;
  grid-template-rows: repeat(var(--wall-rows, 1), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  gap: 1px;
  background: #000;
}
body.wallFullscreen .card {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #05080e;
}
body.wallFullscreen .cardHead,
body.wallFullscreen .meta {
  display: none;
}
body.wallFullscreen .screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}
body.wallFullscreen .screen iframe {
  width: 100%;
  height: 100%;
}

/* NVR health monitor */
.diagnosticsHeader { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.diagnosticsHeader > div:first-child { min-width: 0; }
.diagnosticsMeta { display: flex; align-items: center; flex: 0 0 auto; gap: 14px; padding-top: 4px; color: var(--app-dim); }
.diagnosticsMetaItem { display: inline-flex; align-items: center; gap: 6px; color: var(--app-dim); font-size: 10px; font-weight: 600; white-space: nowrap; }
.diagnosticsMetaItem svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.diagnosticsMetaItem strong { color: var(--app-muted); font-weight: 700; }
.healthToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}
.healthToolbarCopy { display: flex; align-items: center; gap: 10px; }
.healthToolbarCopy strong { display: block; color: var(--app-text); font-size: 13px; }
.healthToolbarCopy small { display: block; margin-top: 3px; color: var(--app-dim); font-size: 11px; }
.healthLiveDot { width: 9px; height: 9px; border-radius: 50%; background: var(--app-green); box-shadow: 0 0 0 4px #22c55e1a; }
.healthSummary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.summaryCard { display: grid; gap: 4px; min-height: 92px; padding: 15px; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.summaryLabel { color: var(--app-muted); font-size: 11px; font-weight: 650; }
.summaryValue { color: var(--app-text); font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.summaryCard small { color: var(--app-dim); font-size: 10px; }
.summaryGood { border-color: #246044; background: #10291f; }
.summaryGood .summaryValue { color: #86efac; }
.summaryBad { border-color: #66353d; background: #2b171d; }
.summaryBad .summaryValue { color: #fda4af; }
.healthSection { padding: 17px; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: #0d1827; }
.sectionHead { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--app-border-subtle); }
.sectionHead h2 { margin: 5px 0 5px; color: var(--app-text); font-size: 17px; letter-spacing: -.02em; }
.sectionHead p { max-width: 680px; margin: 0; color: var(--app-muted); font-size: 11px; line-height: 1.5; }
.healthBadge { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--app-border); border-radius: 999px; color: var(--app-muted); background: #111e2f; font-size: 10px; font-weight: 700; }
.healthGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.healthCard { min-width: 0; padding: 16px; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.healthCard.online { border-color: #24583f; }
.healthCard.offline { border-color: #64363d; }
.healthCardHead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.healthDeviceType { color: var(--app-dim); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.healthCard h3 { margin: 5px 0 0; color: var(--app-text); font-size: 15px; letter-spacing: -.02em; }
.healthState { display: inline-flex; align-items: center; gap: 6px; color: var(--app-dim); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.healthState i { width: 7px; height: 7px; border-radius: 50%; background: var(--app-dim); }
.healthState.online { color: #86efac; }
.healthState.online i { background: var(--app-green); box-shadow: 0 0 0 3px #22c55e1a; }
.healthState.offline { color: #fda4af; }
.healthState.offline i { background: var(--app-red); box-shadow: 0 0 0 3px #ef44441a; }
.healthDetails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--app-border-subtle); }
.healthDetails div { display: flex; justify-content: space-between; gap: 10px; min-width: 0; font-size: 11px; }
.healthDetails span { color: var(--app-dim); }
.healthDetails b { overflow: hidden; color: var(--app-text); font-weight: 650; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.healthMessage { min-height: 31px; margin: 15px 0 0; color: var(--app-muted); font-size: 11px; line-height: 1.45; }
.healthEmpty { padding: 30px; color: var(--app-dim); text-align: center; font-size: 12px; }
.healthInfo { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--app-border-subtle); border-radius: var(--app-radius); background: #0e1928; }
.healthInfoIcon { display: grid; flex: 0 0 auto; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: var(--app-blue); background: #172a42; }
.healthInfoIcon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.healthInfo strong { color: var(--app-text); font-size: 12px; }
.healthInfo p { margin: 3px 0 0; color: var(--app-dim); font-size: 11px; line-height: 1.45; }
.healthInfo .button { margin-left: auto; flex: 0 0 auto; }
@media (max-width: 760px) {
  .diagnosticsHeader { display: block; }
  .diagnosticsMeta { flex-wrap: wrap; margin-top: 10px; padding-top: 0; gap: 10px 14px; }
  .healthGrid, .healthSummary { grid-template-columns: 1fr; }
  .healthDetails { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sectionHead { display: block; }
  .healthBadge { display: inline-flex; margin-top: 12px; }
  .healthInfo { align-items: flex-start; flex-wrap: wrap; }
  .healthInfo .button { margin-left: 42px; }
}
@media (max-width: 480px) {
  .healthDetails { grid-template-columns: 1fr; }
}

/* Device credentials: compact application-shell layout */
.credentialsPage { overflow-x: hidden; }
.credentialsMain { padding-top: 18px; padding-bottom: 18px; }
.credentialsMain .top { margin-bottom: 12px; padding-bottom: 12px; }
.credentialsMain .top h1 { margin: 4px 0 3px; font-size: 22px; }
.credentialsMain .top p { margin: 0; font-size: 11px; }
.credentialsNotice { margin: 0 0 10px; padding: 9px 11px; border-left: 3px solid var(--app-blue); background: #10263a; color: var(--app-muted); font-size: 11px; line-height: 1.35; }
.credentialsCard { min-width: 0; margin: 0 0 10px; padding: 13px 14px; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.credentialsCard h2 { margin: 0 0 3px; color: var(--app-text); font-size: 15px; letter-spacing: -.02em; }
.credentialsCard > p { margin: 0 0 9px; color: var(--app-muted); font-size: 11px; line-height: 1.35; }
.credentialsFields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.credentialsFields label { display: block; margin: 0 0 4px; color: var(--app-muted); font-size: 10px; font-weight: 650; }
.credentialsFields input { width: 100%; height: 34px; margin: 0 0 7px; padding: 7px 9px; border: 1px solid var(--app-border); border-radius: 6px; background: #0e1725; color: var(--app-text); font-size: 11px; }
.credentialsFields input + input { margin-top: 0; }
.credentialsState { min-height: 15px; margin: 1px 0 0 !important; color: var(--app-dim) !important; font-size: 10px !important; }
.credentialsSave { display: flex; align-items: center; gap: 14px; margin-top: 0; padding: 11px 13px; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: #0d1827; }
.credentialsSaveCopy { min-width: 0; flex: 1; }
.credentialsSave h2 { margin: 0 0 2px; color: var(--app-text); font-size: 14px; }
.credentialsSave p { margin: 0; color: var(--app-muted); font-size: 10px; line-height: 1.35; }
.credentialsSave .notice.warning { margin: 5px 0 0; padding: 5px 7px; border-left: 2px solid var(--app-amber); background: #2a2515; font-size: 9px; line-height: 1.25; }
.credentialsActions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.credentialsActions .button { min-height: 34px; margin: 0; padding: 8px 11px; white-space: nowrap; }
.credentialsStatus { min-width: 150px; margin: 0; font-size: 10px; }
@media (max-width: 900px) {
  .credentialsMain { overflow: visible; }
  .credentialsFields { grid-template-columns: 1fr; }
  .credentialsSave { display: block; }
  .credentialsActions { margin-top: 10px; }
  .credentialsStatus { min-height: 16px; margin-top: 8px; }
}

/* Playback investigation modal */
body.modalOpen { overflow: hidden; }
.playbackModal { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: clamp(12px, 3vw, 42px); background: rgba(3, 8, 15, .78); }
.playbackModal.open { display: grid; animation: playbackOverlayIn 180ms ease-out both; }
.playbackModalBackdrop { position: absolute; inset: 0; background: rgba(2, 6, 12, .55); }
.playbackDialog { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(90vw, 1400px); max-height: 90vh; overflow: hidden; border: 1px solid #30445e; border-radius: 12px; background: #0d1726; box-shadow: 0 24px 80px rgba(0,0,0,.55); animation: playbackDialogIn 180ms ease-out both; }
.playbackDialog:fullscreen { width: 100vw; height: 100vh; max-height: none; border: 0; border-radius: 0; }
.playbackModalHeader { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 16px 18px 13px; border-bottom: 1px solid var(--app-border-subtle); background: #111d2e; }
.playbackModalHeading { min-width: 0; }
.playbackModalHeading h2 { margin: 4px 0 3px; color: var(--app-text); font-size: 18px; line-height: 1.2; letter-spacing: -.025em; }
.playbackModalHeading p { margin: 0; color: var(--app-muted); font-size: 11px; }
.playbackModalRange { display: block; margin-top: 7px; color: var(--app-dim); font-size: 10px; }
.playbackModalActions { display: flex; flex: 0 0 auto; gap: 7px; }
.playbackModalActions .iconButton { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--app-border); border-radius: 6px; background: #172536; color: var(--app-muted); cursor: pointer; }
.playbackModalActions .iconButton:hover { border-color: #456486; background: var(--app-hover); color: var(--app-text); }
.playbackModalActions .iconButton svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.playbackModalBody { min-height: 0; overflow: auto; padding: 14px 18px 16px; }
.playbackDialog:fullscreen .playbackModalBody { flex: 1; display: flex; flex-direction: column; }
.playbackVideoFrame { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 58vh; overflow: hidden; border: 1px solid var(--app-border-subtle); border-radius: 7px; background: #03070c; }
.playbackModal #video { display: block; width: 100%; height: 100%; border: 0; background: #03070c; }
.playbackControls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.playbackControls .button { min-height: 36px; margin: 0; }
.playbackDialog:fullscreen .playbackVideoFrame { flex: 1; max-height: none; min-height: 0; }
.playbackModal .timeline { display: none; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--app-border-subtle); }
.playbackModal .timeline.open { display: block; }
.playbackModal .timeline label { color: var(--app-muted); font-size: 11px; }
.timelineTimeZone, .timelineMode { margin-left: 6px; color: var(--app-dim); font-size: 9px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.timelineMode { color: #8ec6ff; }
.playbackModal .timeline .note { margin-top: 8px; color: var(--app-dim); font-size: 10px; }
.timelineActions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.playbackModal .timelineActions .button { margin-top: 0; }
.timelineControl, .syncTimelineControl { position: relative; margin-top: 10px; min-height: 30px; padding: 10px 0 8px; overflow: visible; }
.timelineTrack, .syncTimelineTrack { position: absolute; z-index: 0; top: 50%; left: 0; right: 0; height: 5px; box-sizing: border-box; transform: translateY(-50%); overflow: hidden; border: 1px solid rgba(73, 105, 133, .72); border-radius: 999px; background: #172536; pointer-events: none; }
.timelineSegment, .syncAvailabilityLane i { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 999px; background: linear-gradient(90deg, #3478dc, #56c9b0); }
.timelineControl .range, .syncTimelineControl .range { position: relative; z-index: 1; display: block; width: 100%; height: 18px; margin: 0; appearance: none; border: 0; background: transparent; cursor: pointer; }
.timelineControl .range::-webkit-slider-runnable-track, .syncTimelineControl .range::-webkit-slider-runnable-track { height: 5px; border: 0; background: transparent; }
.timelineControl .range::-moz-range-track, .syncTimelineControl .range::-moz-range-track { height: 5px; border: 0; background: transparent; }
.timelineControl .range::-moz-range-progress, .syncTimelineControl .range::-moz-range-progress { background: transparent; }
.timelineControl .range::-webkit-slider-thumb, .syncTimelineControl .range::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -4px; appearance: none; border: 2px solid #0b1525; border-radius: 50%; background: #3b82f6; box-shadow: 0 0 0 1px rgba(100, 169, 255, .55), 0 2px 6px rgba(0, 0, 0, .35); }
.timelineControl .range::-moz-range-thumb, .syncTimelineControl .range::-moz-range-thumb { width: 13px; height: 13px; box-sizing: border-box; border: 2px solid #0b1525; border-radius: 50%; background: #3b82f6; box-shadow: 0 0 0 1px rgba(100, 169, 255, .55), 0 2px 6px rgba(0, 0, 0, .35); }
.timelineControl .range:focus, .syncTimelineControl .range:focus { outline: none; }
.timelineControl .range:focus-visible, .syncTimelineControl .range:focus-visible { outline: 2px solid rgba(59, 130, 246, .42); outline-offset: 3px; border-radius: 999px; }
.timelineTooltip, .syncTimelineTooltip { position: absolute; z-index: 3; top: -4px; transform: translateX(-50%); max-width: min(260px, 80vw); padding: 4px 7px; border: 1px solid #385372; border-radius: 5px; background: #101c2d; color: var(--app-text); font-size: 10px; line-height: 1.2; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 120ms ease; }
.timelineTooltip.isVisible, .syncTimelineTooltip[aria-hidden=false] { opacity: 1; }
.timelineTooltip.isGap { border-color: #76552a; color: #f6d47b; background: #2a2417; }
.playbackInfo { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--app-border-subtle); }
.playbackInfo div { min-width: 0; }
.playbackInfo span { display: block; margin-bottom: 3px; color: var(--app-dim); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.playbackInfo b { display: block; overflow: hidden; color: var(--app-text); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.playbackModalStatus { min-height: 17px; margin: 10px 0 0; color: var(--app-amber); font-size: 11px; }
@keyframes playbackOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes playbackDialogIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .playbackModal.open, .playbackDialog { animation: none; } }
@media (max-width: 760px) {
  .playbackModal { padding: 10px; }
  .playbackDialog { width: 100%; max-height: 94vh; }
  .playbackModalHeader { padding: 13px 14px 11px; }
  .playbackModalBody { padding: 11px 14px 14px; }
  .playbackInfo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .playbackModalHeading h2 { font-size: 16px; }
  .playbackModalRange { max-width: 230px; line-height: 1.35; }
  .playbackVideoFrame { max-height: 42vh; }
  .playbackInfo { grid-template-columns: 1fr 1fr; }
}

/* Recording search workspace and compact results table */
.playbackPage .recordingWorkspace { grid-template-columns: minmax(280px, 28%) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.playbackPage .recordingWorkspace > .searchCard { margin: 0; padding: 14px; }
.playbackPage .recordingWorkspace > .resultsColumn { min-width: 0; }
/* Keep equivalent controls in both playback tabs on the same compact rhythm. */
.playbackPage .searchCard .label,
.syncSearchGrid .label { display: block; margin-top: 12px; color: var(--app-muted); font-size: 10px; font-weight: 700; line-height: normal; }
.playbackPage .searchCard .select,
.playbackPage .searchCard .field,
.syncSearchGrid > div:not(.syncCameraPicker):not(.syncQuickActions) > .select,
.syncSearchGrid > div:not(.syncCameraPicker):not(.syncQuickActions) > .field { min-height: 34px; margin-top: 5px; padding: 8px 9px; font-size: 11px; }
.playbackPage .searchCard .row { gap: 9px; }
.playbackPage .searchCard .button { margin-top: 14px; min-height: 34px; padding: 8px 11px; }
.playbackPage .searchCard .message { min-height: 17px; margin: 9px 0 0; font-size: 10px; }
.playbackPage .searchCard .note { margin-top: 12px; color: var(--app-dim); font-size: 10px; line-height: 1.4; }
.playbackPage .resultsList { display: block; min-width: 0; margin: 0; }
.resultsCard { min-width: 0; overflow: hidden; border: 1px solid var(--app-border); border-radius: 11px; background: #0d1726; }
.resultsHeader { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 14px 12px; border-bottom: 1px solid var(--app-border-subtle); }
.resultsHeader h2 { margin: 4px 0 3px; color: var(--app-text); font-size: 15px; letter-spacing: -.02em; }
.resultsHeader p { margin: 0; color: var(--app-muted); font-size: 10px; }
.resultsCount { flex: 0 0 auto; padding: 4px 8px; border: 1px solid #1a6a4b; border-radius: 999px; color: #86efac; background: #0d3a29; font-size: 10px; font-weight: 700; white-space: nowrap; }
.resultsTableWrap { max-height: min(58vh, 620px); overflow: auto; }
.resultsTable { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--app-text); font-size: 11px; }
.resultsTable th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; border-bottom: 1px solid var(--app-border); color: var(--app-muted); background: #101c2c; font-size: 9px; font-weight: 600; text-align: left; white-space: nowrap; }
.resultsTable th:first-child, .resultsTable td:first-child { width: 42px; padding-left: 10px; color: var(--app-dim); }
.resultsTable th:last-child, .resultsTable td:last-child { width: 82px; padding-right: 10px; text-align: right; }
.resultsTable td { height: 42px; padding: 7px 10px; border-bottom: 1px solid var(--app-border-subtle); color: var(--app-text); white-space: nowrap; }
.resultsTable tbody tr { background: #101c2c; transition: background 150ms ease, box-shadow 150ms ease; }
.resultsTable tbody tr:hover { background: #17283d; }
.resultsTable tbody tr.selected { background: #172d47; box-shadow: inset 0 0 0 1px var(--app-blue); }
.resultsTable tbody tr:last-child td { border-bottom: 0; }
.resultsPlay { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 29px; margin: 0; padding: 5px 8px; border-color: #40536b; border-radius: 999px; background: transparent; color: var(--app-text); font-size: 10px; }
.resultsPlay:hover { border-color: #6b83a2; background: #21344b; }
.resultsPlay svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.resultsFooter { padding: 8px 10px; border-top: 1px solid var(--app-border-subtle); color: var(--app-dim); background: #0d1726; font-size: 10px; }
.resultsCardEmpty { padding: 18px 14px; }
.resultsCardEmpty h2 { margin: 4px 0 4px; color: var(--app-text); font-size: 15px; }
.resultsCardEmpty p { margin: 0; color: var(--app-muted); font-size: 11px; }
.resultsLoading { padding: 18px 14px; color: var(--app-amber); font-size: 11px; }
.resultsError { padding: 18px 14px; color: #fda4af; font-size: 11px; }
@media (max-width: 900px) {
  .playbackPage .recordingWorkspace { grid-template-columns: 1fr; }
  .playbackPage .recordingWorkspace > .searchCard { position: static; }
  .resultsTableWrap { max-height: 52vh; }
}
@media (max-width: 540px) {
  .resultsHeader { display: block; }
  .resultsCount { display: inline-flex; margin-top: 9px; }
  .resultsTable { font-size: 10px; }
  .resultsTable th, .resultsTable td { padding-left: 7px; padding-right: 7px; }
  .resultsTable th:nth-child(2), .resultsTable td:nth-child(2),
  .resultsTable th:nth-child(3), .resultsTable td:nth-child(3) { min-width: 135px; }
  .resultsTableWrap { overflow-x: auto; }
}

/* Single-camera focus view opened by double-clicking a live tile. */
body.cameraFocusOpen { overflow: hidden; }
.cameraFocus { display: none; position: fixed; inset: 0; z-index: 220; place-items: center; padding: clamp(10px, 2vw, 28px); }
.cameraFocus.open { display: grid; animation: cameraFocusIn 160ms ease-out both; }
.cameraFocusBackdrop { position: absolute; inset: 0; background: rgba(2, 7, 14, .86); backdrop-filter: blur(3px); }
.cameraFocusDialog { position: relative; z-index: 1; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(96vw, 1800px); height: min(94vh, 1100px); overflow: hidden; border: 1px solid var(--app-border); border-radius: 12px; background: #070d16; box-shadow: 0 28px 80px rgba(0, 0, 0, .55); }
.cameraFocusHeader { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; border-bottom: 1px solid var(--app-border-subtle); background: #101b2a; }
.cameraFocusHeader h2 { margin: 4px 0 0; color: var(--app-text); font-size: 15px; letter-spacing: -.02em; }
.cameraFocusViewport { min-height: 0; display: grid; place-items: center; background: #020509; }
.cameraFocusViewport iframe { display: block; width: 100%; height: 100%; border: 0; background: #020509; }
.cameraFocusTrigger { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.cameraFocusTrigger:focus-visible { outline: 2px solid var(--app-blue); outline-offset: -3px; }
.cameraFocusPlaceholder { width: 100%; height: 100%; background: #020509; }
@keyframes cameraFocusIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .cameraFocus.open { animation: none; } }
@media (max-width: 640px) { .cameraFocus { padding: 0; } .cameraFocusDialog { width: 100vw; height: 100vh; border-radius: 0; border-left: 0; border-right: 0; } }

.screen { position: relative; }

.cameraFocusHeader .iconButton { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--app-border); border-radius: 6px; background: #172536; color: var(--app-muted); cursor: pointer; }
.cameraFocusHeader .iconButton:hover { border-color: #456486; background: var(--app-hover); color: var(--app-text); }
.cameraFocusHeader .iconButton svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

/* Recording calendar spacing refinement: preserve the existing grid and controls
   while giving each information band a clearer vertical rhythm. */
.playbackPage .availabilityCard { padding: 20px; }
.playbackPage .availabilityHeader { gap: 24px; }
.playbackPage .availabilityHeader > div:first-child { min-width: 0; }
.playbackPage .availabilityActions { gap: 12px; row-gap: 10px; }
.playbackPage .availabilityMeta { margin-top: 20px; min-height: 20px; line-height: 1.4; }
.playbackPage .availabilityMeta span { line-height: 1.4; }
.playbackPage .weekdayRow { margin-top: 20px; }
.playbackPage .weekdayRow span { padding: 0 3px 4px; }
.playbackPage .availabilityGrid { margin-top: 12px; }
.playbackPage .availabilityLegend { margin-top: 16px; }
@media (max-width: 900px) {
  .playbackPage .availabilityActions { margin-top: 18px; gap: 10px; }
  .playbackPage .availabilityMeta { margin-top: 20px; }
  .playbackPage .weekdayRow { margin-top: 18px; }
  .playbackPage .availabilityGrid { margin-top: 12px; }
}

/* Recording calendar states occupy the complete seven-column calendar area. */
.playbackPage .availabilityEmpty {
  grid-column: 1 / -1;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  border: 1px dashed #29465f;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(16, 38, 58, .58), rgba(8, 20, 34, .42));
  text-align: center;
}
.playbackPage .availabilityEmptyIcon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 13px;
  border: 1px solid #244e78;
  border-radius: 12px;
  background: #173451;
  color: #72b5ff;
}
.playbackPage .availabilityEmptyIcon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.playbackPage .availabilityEmpty h3 { margin: 0; color: var(--app-text, #e7f1f5); font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.playbackPage .availabilityEmpty p { max-width: 520px; margin: 8px 0 0; color: var(--app-muted, #91aaba); font-size: 12px; line-height: 1.5; }
.playbackPage .availabilityEmpty-loading { min-height: 154px; }
.playbackPage .availabilityEmpty-loading .availabilityEmptyIcon { border-color: #285b80; background: #102d47; }
.playbackPage .availabilityEmpty-error { border-color: #684052; background: rgba(70, 29, 45, .24); }
.playbackPage .availabilityEmpty-error .availabilityEmptyIcon { border-color: #7b4053; background: #3a2030; color: #f5a2b3; }
.playbackPage .availabilitySpinner { width: 22px; height: 22px; border: 2px solid #38668e; border-top-color: #8fc6ff; border-radius: 50%; animation: availabilitySpin .8s linear infinite; }
.playbackPage .availabilityLegend.is-hidden { display: none; }
@keyframes availabilitySpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .playbackPage .availabilitySpinner { animation: none; } }
@media (max-width: 540px) {
  .playbackPage .availabilityEmpty { min-height: 174px; padding: 24px 16px; }
  .playbackPage .availabilityEmpty p { font-size: 11px; }
}

/* Device credentials: premium, compact management workspace. */
.credentialsMain { width: 100%; max-width: none; margin: 0; padding: 26px 30px 34px; }
.credentialsMain .top { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; padding-bottom: 18px; }
.credentialsMain .top > div:first-child { min-width: 0; }
.credentialsMain .top h1 { margin: 5px 0 4px; font-size: 25px; }
.credentialsMain .top p { font-size: 12px; }
.credentialsStorageBadge { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 7px 10px; border: 1px solid #1f5b46; border-radius: 999px; color: #86efac; background: #0d2d24; font-size: 10px; font-weight: 700; white-space: nowrap; }
.credentialsStorageBadge[hidden] { display: none; }
.credentialsStorageBadge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.credentialsNotice { display: flex; align-items: flex-start; gap: 11px; margin: 0 0 16px; padding: 13px 15px; border: 1px solid #214567; border-left: 3px solid var(--app-blue); border-radius: 8px; background: #10263a; color: var(--app-muted); font-size: 11px; line-height: 1.45; }
.credentialsNoticeIcon { flex: 0 0 auto; width: 18px; height: 18px; color: #7db5ff; }
.credentialsNoticeIcon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.credentialsNotice strong { display: block; margin-bottom: 3px; color: var(--app-text); font-size: 12px; }
.credentialsNotice p { margin: 0; }
.credentialsCard { margin: 0 0 14px; padding: 17px 18px 14px; border: 1px solid var(--app-border); border-radius: 10px; background: linear-gradient(145deg, #121e2e, #101a29); }
.credentialsSectionHeader { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.credentialsKicker { color: #60a5fa; font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.credentialsSectionHeader h2 { margin: 4px 0 4px; color: var(--app-text); font-size: 16px; letter-spacing: -.025em; }
.credentialsSectionHeader p { max-width: 680px; margin: 0; color: var(--app-muted); font-size: 11px; line-height: 1.45; }
.credentialsSectionBadge { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #2a4460; border-radius: 999px; color: #bcd3e5; background: #16263a; font-size: 10px; font-weight: 700; white-space: nowrap; }
.credentialsFields { gap: 14px; }
.credentialDevice { min-width: 0; padding: 13px 14px 10px; border: 1px solid var(--app-border); border-radius: 8px; background: #0e1827; }
.credentialDeviceHeader { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.credentialDeviceName { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--app-text); font-size: 12px; font-weight: 700; }
.credentialDeviceName svg { flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: #7db5ff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.credentialDeviceMeta { margin: -5px 0 9px 25px; color: var(--app-dim); font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
.credentialStatusBadge { padding: 4px 7px; border: 1px solid #43536a; border-radius: 999px; color: var(--app-muted); background: #172334; font-size: 9px; font-weight: 700; white-space: nowrap; }
.credentialStatusBadge.isConfigured { border-color: #1f694d; color: #86efac; background: #0d3327; }
.credentialsFields label { display: block; margin: 0 0 5px; color: #c6d2df; font-size: 10px; font-weight: 700; }
.credentialDevice label:not(:first-of-type) { margin-top: 9px; }
.credentialsFields input { height: 38px; margin: 0; padding: 8px 10px; border: 1px solid #30445c; border-radius: 7px; background: #0b1523; color: var(--app-text); font-size: 11px; transition: border-color 150ms ease, box-shadow 150ms ease; }
.credentialsFields input::placeholder { color: #6f8196; }
.credentialsFields input:focus { border-color: var(--app-blue); box-shadow: 0 0 0 3px #3b82f61c; outline: none; }
.credentialsState { min-height: 16px; margin: 12px 0 0 !important; padding-top: 10px; border-top: 1px solid var(--app-border-subtle); color: var(--app-dim) !important; font-size: 10px !important; }
.credentialsCameraCard .credentialsFields { width: 100%; max-width: none; }
.credentialsCameraCard .credentialsState { margin-top: 12px !important; }
.credentialsSave { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 16px 18px; border: 1px solid #2d4662; border-radius: 10px; background: linear-gradient(145deg, #101e31, #0d1827); }
.credentialsSaveIcon { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; color: #60a5fa; }
.credentialsSaveIcon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.credentialsSaveCopy { min-width: 0; flex: 1; }
.credentialsSave h2 { margin: 4px 0 4px; color: var(--app-text); font-size: 15px; }
.credentialsSave p { max-width: 760px; margin: 0; color: var(--app-muted); font-size: 10px; line-height: 1.45; }
.credentialsSave .notice.warning { margin: 9px 0 0; padding: 7px 9px; border: 1px solid #5e4d1d; border-left: 2px solid var(--app-amber); border-radius: 5px; background: #2a2515; color: #f6d47b; font-size: 10px; line-height: 1.35; }
.credentialsActions { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 6px; flex: 0 0 auto; align-self: flex-end; }
.credentialsActions .button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; margin: 0; padding: 9px 13px; border-radius: 7px; white-space: nowrap; }
.credentialsActions .button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.credentialsStatus { order: 1; min-width: 0; margin: 0; color: var(--app-muted); font-size: 10px; line-height: 1.35; text-align: right; }
.credentialsActions .button { order: 2; }
/* Keep the full credential workflow visible on common desktop heights while
   retaining comfortable field targets and the same hierarchy. */
@media (min-width: 781px) {
  .credentialsMain { padding-top: 18px; padding-bottom: 20px; }
  .credentialsMain .top { margin-bottom: 12px; padding-bottom: 12px; }
  .credentialsNotice { margin-bottom: 10px; padding: 10px 12px; }
  .credentialsCard { margin-bottom: 10px; padding: 12px 14px 10px; }
  .credentialsSectionHeader { margin-bottom: 10px; }
  .credentialsFields { gap: 10px; }
  .credentialDevice { padding: 10px 12px 8px; }
  .credentialDeviceHeader { margin-bottom: 8px; }
  .credentialsFields label { margin-bottom: 3px; }
  .credentialDevice label:not(:first-of-type) { margin-top: 7px; }
  .credentialsFields input { height: 34px; padding: 6px 9px; }
  .credentialsState { margin-top: 8px !important; padding-top: 7px; }
  .credentialsCameraCard .credentialsState { margin-top: 8px !important; }
  .credentialsSave { padding: 12px 14px; }
  .credentialsSave .notice.warning { margin-top: 6px; padding: 5px 7px; }
}
@media (max-width: 780px) {
  .credentialsMain { padding: 22px 18px 28px; }
  .credentialsMain .top { display: block; }
  .credentialsMain .credentialsStorageBadge { margin-top: 12px; }
  .credentialsFields { grid-template-columns: 1fr; }
  .credentialsSave { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .credentialsActions { grid-column: 1 / -1; align-self: start; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .credentialsMain { padding: 18px 12px 24px; }
  .credentialsSectionHeader { display: block; }
  .credentialsSectionBadge { display: inline-flex; margin-top: 10px; }
  .credentialsSave { display: block; }
  .credentialsSaveIcon { display: none; }
  .credentialsActions { display: block; margin-top: 14px; }
  .credentialsActions .button { width: 100%; justify-content: center; }
  .credentialsStatus { display: block; min-height: 16px; margin-top: 9px; }
}

.syncEmpty[hidden],.syncGrid[hidden],.syncTimelineSection[hidden]{display:none!important}
.playbackTabs{display:flex;gap:6px;margin-top:18px;margin-bottom:18px;padding-bottom:0}
.playbackTabButton{display:inline-flex;align-items:center;gap:8px;border:1px solid transparent;border-radius:8px;background:transparent;color:#94adba;padding:9px 13px;font:inherit;font-size:12px;font-weight:700;cursor:pointer;transition:background .16s ease,border-color .16s ease,color .16s ease}
.playbackTabButton svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.playbackTabButton:hover{border-color:#365d70;color:#e4f4f7;background:#102a3a}
.playbackTabButton.is-active{border-color:#3d86bb;background:#153552;color:#eaf6fb;box-shadow:0 5px 16px rgba(18,85,132,.2)}
.playbackTabPanel[hidden]{display:none!important}
.syncPlaybackPanel{display:grid;gap:16px;margin-top:0}
.syncSearchCard,.syncWallCard{padding:16px}
.syncSectionHeading,.syncWallHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.syncSectionHeading h2,.syncWallHeader h2{margin:5px 0 4px;font-size:16px}
.syncSectionHeading p,.syncWallHeader p{margin:0;color:var(--muted,#91aaba);font-size:12px;line-height:1.45}
.syncStatus{color:#7be2c5;font-size:11px;font-weight:700;padding-top:5px;text-align:right}
.syncSearchGrid{display:grid;grid-template-columns:minmax(160px,.85fr) minmax(250px,1.35fr) minmax(180px,1fr) minmax(180px,1fr);gap:12px;margin-top:15px;align-items:start}
.syncSearchGrid>div{min-width:0}
.syncCameraPicker{position:relative;align-self:start}
.syncPickerHeader{display:flex;align-items:center;justify-content:space-between;gap:8px}
.syncPickerHeader .label{margin-top:12px;color:var(--app-muted);font-size:10px;font-weight:700;line-height:normal}
.syncSelectedCount{margin-top:12px;color:#6fe0c1;font-size:10px;font-weight:700;white-space:nowrap}
.syncCameraToggle{width:100%;min-height:34px;display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:5px;padding:8px 9px;border:1px solid var(--app-border);border-radius:6px;background:#0e1725;color:var(--app-text);font:inherit;font-size:11px;font-weight:400;cursor:pointer;text-align:left}
.syncCameraToggle:hover,.syncCameraToggle[aria-expanded=true]{border-color:var(--app-blue);background:#13253a}
.syncCameraToggle::after{content:'⌄';color:var(--app-muted);font-size:15px;line-height:1}
.syncCameraMenu{position:absolute;z-index:10;top:calc(100% - 1px);left:0;right:0;display:none;padding:8px;border:1px solid #31566a;border-radius:7px;background:#0b1c2b;box-shadow:0 16px 32px #0008}
.syncCameraMenu.is-open{display:block}
.syncCameraFilter{width:100%;min-height:32px;margin-bottom:7px;padding:7px 9px;border:1px solid #294b5e;border-radius:5px;background:#07131e;color:var(--app-text);font-size:11px}
.syncCameraList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;max-height:200px;overflow:auto;padding:2px;border:0;background:transparent}
.syncCameraOption{display:flex;align-items:center;gap:7px;min-width:0;border-radius:5px;padding:5px 6px;cursor:pointer}
.syncCameraOption:hover{background:#123044}
.syncCameraOption input{accent-color:#55d7b6;flex:0 0 auto}
.syncCameraOption span{display:grid;min-width:0}
.syncCameraOption b{overflow:hidden;color:#dcecef;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.syncCameraOption small{color:#7793a3;font-size:9px}
.syncPickerEmpty{grid-column:1/-1;color:#7995a5;font-size:11px;padding:8px}
.syncPickerActions{display:flex;gap:6px;margin-top:7px}
.syncPickerActions .button{margin:0;padding:7px 9px;font-size:10px}
.syncQuickActions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;grid-column:2/-1;align-self:end}
.syncQuickActions .button{min-height:34px;margin:0;padding:8px 11px;font-size:12px}
.syncQuickActions svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;vertical-align:-3px}
.syncQuickLabel,.syncLayoutLabel{color:#7893a4;font-size:10px;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
.syncLayoutBar{display:flex;align-items:center;gap:8px;border-top:1px solid #244557;margin-top:16px;padding-top:13px}
.syncLayoutButtons{display:flex;gap:5px}
.syncLayoutButton{border:1px solid #31566a;border-radius:6px;background:#0c2130;color:#a8c2cc;padding:7px 10px;font:inherit;font-size:11px;font-weight:700;cursor:pointer}
.syncLayoutButton span{font-size:10px;font-weight:500;color:#7e9aa8}
.syncLayoutButton:hover{border-color:#5c9fc1}
.syncLayoutButton.is-active{border-color:#61dcbc;background:#16423f;color:#e8fff7}
.syncLayoutButton.is-active span{color:#a3f1dd}
.syncPageLabel{margin-left:auto;color:#809cab;font-size:11px}
.syncPageButton{margin:0;padding:6px 9px;font-size:10px}
.syncPageButton:disabled{opacity:.4;cursor:default}
.syncWallCard{position:relative;display:flex;min-height:0;flex-direction:column}
.syncWallHeader>div:first-child{min-width:0;padding-right:330px}
.syncWallActions{position:absolute;top:16px;right:16px;display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
.syncWallActions .button{min-height:36px;margin:0;padding:8px 12px;font-size:12px}
.syncWallActions .button{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.syncControlIcon{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.syncWallActions .button.primary .syncControlIcon{fill:currentColor;stroke:none}
.syncEmpty{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;min-height:300px;margin-top:14px;border:1px dashed #2c5368;border-radius:8px;background:rgba(8,25,39,.5);text-align:center}
.syncEmptyIcon{display:grid;place-items:center;width:46px;height:46px;border:1px solid #2e6d96;border-radius:12px;background:#103552;color:#65b8f3}
.syncEmptyIcon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.syncEmpty h3{margin:12px 0 4px;font-size:15px}
.syncEmpty p{max-width:430px;margin:0;color:#8ba5b3;font-size:11px;line-height:1.5}
.syncGrid{display:grid;gap:8px;margin-top:14px;min-height:0;align-content:start;align-items:start}
.syncGrid.layout-1{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;width:100%}
.syncGrid.layout-4{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,auto)}
.syncGrid.layout-8{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,auto)}
.syncGrid.layout-16{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,auto)}
.syncGrid.count-1{grid-template-columns:minmax(0,1fr);grid-template-rows:auto}
.syncGrid.count-2{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto}
.syncGrid.count-3{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,auto)}
.syncCameraTile{display:block;align-self:start;min-width:0;min-height:0;overflow:hidden;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-surface)}
.syncTileHeader{display:flex;align-items:center;justify-content:space-between;gap:9px;min-height:0;padding:9px 11px;background:#152235;border-bottom:1px solid var(--app-border-subtle);color:#dbecef;font-size:12px}
.syncTileHeader strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.syncTileStatus{color:#70e2c4;font-size:9px;font-weight:800;text-transform:uppercase}
.syncCameraTile[data-state=loading] .syncTileStatus,.syncCameraTile[data-state=buffering] .syncTileStatus{color:#f1cf83}
.syncCameraTile[data-state=unavailable] .syncTileStatus,.syncCameraTile[data-state=error] .syncTileStatus{color:#df9a9a}
.syncTileViewport{position:relative;display:grid;width:100%;min-height:0;aspect-ratio:16/9;place-items:center;background:#02080d}
.syncTileViewport iframe{display:block;width:100%;height:100%;min-height:0;border:0;background:#02080d}
.syncTileBody{display:grid;place-items:center;width:100%;height:100%;min-height:0;padding:20px;text-align:center}
.syncTileMessage{color:#8da7b5;font-size:11px;line-height:1.45}
.syncCameraTile[data-state=loading] .syncTileMessage,.syncCameraTile[data-state=buffering] .syncTileMessage{color:#e6cf93}
.syncCameraTile[data-state=unavailable] .syncTileMessage{color:#7f98a6}
.syncCameraTile[data-state=error] .syncTileMessage{color:#edaaaa}
.syncTimelineSection{flex:0 0 auto;margin-top:14px;border:1px solid #294e61;border-radius:8px;background:#0b1d2a;padding:10px 12px}
.syncTimelineHeader{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#d7eaee;font-size:11px;font-weight:700}
.syncTimelineHeader small{margin-left:6px;color:#718c9d;font-size:9px;font-weight:600;text-transform:uppercase}
.syncTimelineControl{position:relative}
.syncTimelineTrack{position:absolute}
.syncAvailabilityRow{display:contents}
.syncAvailabilityRow>span{display:none}
.syncAvailabilityLane{position:absolute;inset:0;width:100%;height:100%;overflow:hidden;border-radius:inherit;background:transparent}
.syncAvailabilityLane i{min-width:2px}
.syncTimelineTooltip[hidden],.syncTimelineTooltip[aria-hidden=true]{display:none}
.syncTimelineLabels{display:flex;justify-content:space-between;gap:10px;color:#72909f;font-size:9px}
.syncTimelineLabels span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.syncFullscreenMeta{display:none}
.syncWallCard:fullscreen,.syncWallCard.syncFullscreen{position:relative;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:10px;width:100vw;height:100dvh;min-height:100dvh;max-height:none;overflow:hidden;border:0;border-radius:0;background:#06111b;padding:8px 14px 14px}
.syncWallCard:fullscreen .syncWallHeader,.syncWallCard.syncFullscreen .syncWallHeader{display:none}
.syncWallCard:fullscreen .syncWallHeader>div:first-child,.syncWallCard.syncFullscreen .syncWallHeader>div:first-child{min-width:0;align-self:center}
.syncWallCard:fullscreen .syncFullscreenMeta,.syncWallCard.syncFullscreen .syncFullscreenMeta{display:flex;align-items:center;gap:8px;margin-top:6px;color:#89a8b8;font-size:10px;line-height:1.2}
.syncWallCard:fullscreen .syncWallHeader .eyebrow,.syncWallCard.syncFullscreen .syncWallHeader .eyebrow{font-size:11px}
.syncWallCard:fullscreen .syncWallHeader h2,.syncWallCard.syncFullscreen .syncWallHeader h2{margin:4px 0 5px;font-size:20px}
.syncWallCard:fullscreen .syncWallHeader p,.syncWallCard.syncFullscreen .syncWallHeader p{font-size:13px}
.syncWallCard:fullscreen .syncFullscreenMeta,.syncWallCard.syncFullscreen .syncFullscreenMeta{font-size:11px}
.syncWallCard:fullscreen .syncFullscreenMeta span,.syncWallCard.syncFullscreen .syncFullscreenMeta span{padding-right:8px;border-right:1px solid #29485a}
.syncWallCard:fullscreen .syncFullscreenMeta span:last-child,.syncWallCard.syncFullscreen .syncFullscreenMeta span:last-child{padding-right:0;border-right:0;color:#b9d4df}
.syncWallCard:fullscreen .syncWallActions,.syncWallCard.syncFullscreen .syncWallActions{position:absolute;top:auto;left:26px;right:auto;bottom:22px;justify-content:flex-start;margin:0}
.syncWallCard:fullscreen .syncWallActions .button,.syncWallCard.syncFullscreen .syncWallActions .button{min-height:34px;padding:7px 10px}
.syncWallCard:fullscreen .syncWallActions #syncFullscreen,.syncWallCard.syncFullscreen .syncWallActions #syncFullscreen{display:none}
.syncWallCard:fullscreen .syncGrid,.syncWallCard.syncFullscreen .syncGrid,.syncWallCard:fullscreen .syncEmpty,.syncWallCard.syncFullscreen .syncEmpty{grid-row:1;min-height:0;align-self:stretch;margin-top:0}
.syncWallCard:fullscreen .syncGrid,.syncWallCard.syncFullscreen .syncGrid{overflow:auto;align-content:stretch;align-items:stretch;gap:8px;padding:1px;overscroll-behavior:contain}
.syncWallCard:fullscreen .syncGrid.layout-1,.syncWallCard.syncFullscreen .syncGrid.layout-1{grid-template-rows:minmax(0,1fr)}
.syncWallCard:fullscreen .syncGrid.layout-4,.syncWallCard.syncFullscreen .syncGrid.layout-4{grid-template-rows:repeat(2,minmax(0,1fr))}
.syncWallCard:fullscreen .syncGrid.layout-8,.syncWallCard.syncFullscreen .syncGrid.layout-8{grid-template-rows:repeat(2,minmax(0,1fr))}
.syncWallCard:fullscreen .syncGrid.layout-16,.syncWallCard.syncFullscreen .syncGrid.layout-16{grid-template-rows:repeat(4,minmax(180px,1fr));align-content:stretch}
.syncWallCard:fullscreen .syncCameraTile,.syncWallCard.syncFullscreen .syncCameraTile{display:grid;grid-template-rows:auto minmax(0,1fr);height:100%;min-height:0;aspect-ratio:auto;align-self:stretch}
.syncWallCard:fullscreen .syncTileHeader,.syncWallCard.syncFullscreen .syncTileHeader{min-height:38px;padding:8px 13px;font-size:13px}
.syncWallCard:fullscreen .syncTileStatus,.syncWallCard.syncFullscreen .syncTileStatus{font-size:10px}
.syncWallCard:fullscreen .syncTileViewport,.syncWallCard.syncFullscreen .syncTileViewport{height:100%;min-height:0;aspect-ratio:auto}
.syncWallCard:fullscreen .syncTileViewport iframe,.syncWallCard.syncFullscreen .syncTileViewport iframe{min-height:0}
.syncWallCard:fullscreen .syncTimelineSection,.syncWallCard.syncFullscreen .syncTimelineSection{grid-row:2;margin-top:0;padding-bottom:54px}
.syncWallCard:fullscreen .syncTimelineHeader,.syncWallCard.syncFullscreen .syncTimelineHeader{font-size:12px}
.syncWallCard:fullscreen .syncTimelineHeader small,.syncWallCard.syncFullscreen .syncTimelineHeader small{font-size:10px}
.syncWallCard:fullscreen .syncTimelineSection .note,.syncWallCard.syncFullscreen .syncTimelineSection .note{display:none}
.syncFullscreenPager{display:none}
.syncFullscreenPager[hidden]{display:none!important}
.syncWallCard:fullscreen .syncFullscreenPager:not([hidden]),.syncWallCard.syncFullscreen .syncFullscreenPager:not([hidden]){display:flex;position:absolute;right:26px;bottom:22px;align-items:center;gap:8px}
.syncFullscreenPager span{color:#8da9b8;font-size:11px}
.syncFullscreenPager .button{min-height:34px;margin:0;padding:7px 10px;font-size:11px}
.syncWallCard.syncFullscreen{position:fixed;z-index:9999;inset:0}
@media(max-width:1100px){.syncSearchGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.syncQuickActions{grid-column:1/-1}.syncGrid.layout-8,.syncGrid.layout-16{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:800px){.syncSectionHeading,.syncWallHeader{display:block}.syncWallHeader>div:first-child{padding-right:0}.syncStatus{text-align:left;margin-top:10px}.syncWallActions{position:static;justify-content:flex-start;margin-top:12px}.syncGrid.layout-4,.syncGrid.layout-8,.syncGrid.layout-16{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.syncWallCard:fullscreen .syncWallHeader>div:first-child,.syncWallCard.syncFullscreen .syncWallHeader>div:first-child{padding-right:0}.syncWallCard:fullscreen .syncWallActions,.syncWallCard.syncFullscreen .syncWallActions{position:absolute;top:auto;left:14px;right:auto;bottom:16px;margin:0;justify-content:flex-start}.syncWallCard:fullscreen .syncFullscreenPager:not([hidden]),.syncWallCard.syncFullscreen .syncFullscreenPager:not([hidden]){right:14px;bottom:16px}}
@media(max-width:560px){.playbackTabs{overflow:auto}.playbackTabButton{white-space:nowrap}.syncSearchGrid{grid-template-columns:1fr}.syncCameraPicker{grid-row:auto}.syncQuickActions{grid-column:auto}.syncLayoutBar{align-items:flex-start;flex-wrap:wrap}.syncPageLabel{margin-left:0}.syncGrid.layout-4,.syncGrid.layout-8,.syncGrid.layout-16{grid-template-columns:1fr}}

/* Authentication and account management */
.authPage{min-height:100vh;display:grid;place-items:center;padding:28px;background:radial-gradient(circle at 15% 10%,#173b4c 0,#091723 42%,#050d15 100%);color:#e7f1f5}.authShell{width:min(1180px,100%);min-height:700px;display:grid;grid-template-columns:1.08fr .92fr;overflow:hidden;border:1px solid #294b5d;border-radius:22px;background:#0b1825;box-shadow:0 25px 90px rgba(0,0,0,.32)}.authBrandPanel{position:relative;display:flex;flex-direction:column;padding:46px 54px;background:linear-gradient(160deg,#123548 0%,#0b2637 44%,#08151f 100%)}.authBrandPanel:after{content:"";position:absolute;inset:auto -12% -22% 15%;height:60%;background:radial-gradient(ellipse,rgba(55,174,171,.18),transparent 68%);pointer-events:none}.authBrand{position:relative;z-index:1;display:flex;align-items:center;gap:13px;color:#eef8fb;text-decoration:none}.authBrand .brandMark{width:48px;height:48px}.authBrand img{width:100%;height:100%;object-fit:contain;border-radius:11px}.authBrand strong{display:block;font-size:19px;letter-spacing:-.02em}.authBrand small{display:block;margin-top:4px;color:#9dc5d2;font-size:11px}.authBrandCopy{position:relative;z-index:1;margin-top:auto;margin-bottom:38px;max-width:500px}.authBrandCopy h1{margin:9px 0 14px;font-size:38px;line-height:1.08;letter-spacing:-.045em}.authBrandCopy p{margin:0;color:#a9c8d2;font-size:14px;line-height:1.65}.authFeatures{position:relative;z-index:1;display:grid;gap:10px}.authFeatures article{display:flex;align-items:center;gap:13px;padding:14px 15px;border:1px solid rgba(107,181,193,.2);border-radius:10px;background:rgba(11,37,52,.46)}.authFeatureIcon{display:grid;place-items:center;width:28px;height:28px;border:1px solid #56d3ca;border-radius:8px;color:#67e0c2;font-weight:800}.authFeatures strong{display:block;font-size:12px}.authFeatures small{display:block;margin-top:3px;color:#91b3bf;font-size:11px}.authBrandFooter{position:relative;z-index:1;margin-top:auto;padding-top:36px;color:#9ab7c0;font-size:11px}.authBrandFooter .serviceDot{display:inline-block;margin-right:7px}.authFormPanel{display:grid;place-items:center;padding:40px;background:#f3f7f8}.authCard{width:min(430px,100%);padding:38px;border:1px solid #d6e1e3;border-radius:17px;background:#fff;color:#153044;box-shadow:0 20px 50px rgba(17,44,60,.12)}.authCard .eyebrow{color:#2a9c9f}.authCard h2{margin:10px 0 7px;font-size:30px;color:#113047}.authCard>p{margin:0 0 30px;color:#66818c;font-size:13px}.authLabel{display:block;margin-top:18px;color:#173349;font-size:12px;font-weight:800}.authLabel input{display:block;width:100%;height:46px;margin-top:8px;border:1px solid #c8d7db;border-radius:8px;background:#fff;color:#153044;padding:0 13px;font:inherit;font-size:13px;outline:none;transition:border-color .2s,box-shadow .2s}.authLabel input:focus{border-color:#279ba3;box-shadow:0 0 0 3px rgba(39,155,163,.15)}.passwordField{position:relative}.passwordField input{padding-right:60px}.passwordToggle{position:absolute;right:8px;top:8px;height:30px;border:0;background:transparent;color:#287d88;font-size:11px;font-weight:800;cursor:pointer}.authSubmit{width:100%;height:46px;margin-top:22px;border:0!important;background:#167f93!important;color:#fff!important}.authSubmit:disabled{opacity:.65;cursor:wait}.authMessage{min-height:19px;margin-top:14px;color:#b24343;font-size:12px;line-height:1.4}.setupNotice{margin-top:18px;padding:11px 12px;border:1px solid #d7e4e7;border-radius:8px;background:#f3f8f9;color:#57727d;font-size:11px;line-height:1.45}.setupNotice code{color:#1d6873}.accessDenied{width:min(520px,100%)}.accessDenied .authCard{text-align:center}.accessDenied h1{margin:12px 0 8px}.accessDenied p{margin:0 0 24px;color:#66818c;line-height:1.55}.authDeniedIcon{display:grid;place-items:center;width:52px;height:52px;margin:0 auto;border-radius:50%;background:#fff0e8;color:#c56d37;font-size:25px;font-weight:800}.profileMenu{position:relative;flex:0 0 auto;margin-top:auto;padding-top:15px;border-top:1px solid rgba(74,111,127,.45)}.profileButton{display:flex;align-items:center;width:100%;gap:10px;border:1px solid transparent;border-radius:9px;background:transparent;color:#dcebf0;padding:9px 8px;text-align:left;cursor:pointer}.profileButton:hover{border-color:#31556a;background:#102b3d}.profileAvatar{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:#1f7e8e;color:#fff;font-size:12px;font-weight:800}.profileSummary{min-width:0;flex:1}.profileSummary strong,.profileSummary small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profileSummary strong{font-size:12px}.profileSummary small{margin-top:2px;color:#88a6b3;font-size:10px;text-transform:capitalize}.profileChevron{color:#83a4b1}.profilePopover{position:absolute;right:0;bottom:calc(100% + 8px);z-index:20;width:220px;max-height:min(360px,calc(100dvh - 24px));overflow:auto;padding:7px;border:1px solid #36566a;border-radius:10px;background:#0e2535;box-shadow:0 15px 35px rgba(0,0,0,.28)}.profilePopoverHead{padding:9px 10px 11px;border-bottom:1px solid #29485a}.profilePopoverHead strong,.profilePopoverHead small{display:block}.profilePopoverHead strong{font-size:12px}.profilePopoverHead small{margin-top:4px;color:#8eacb8;font-size:10px;overflow:hidden;text-overflow:ellipsis}.profilePopover button{display:block;width:100%;margin-top:4px;border:0;border-radius:7px;background:transparent;color:#dbeaf0;padding:9px 10px;text-align:left;font:inherit;font-size:11px;font-weight:700;cursor:pointer}.profilePopover button:hover{background:#16384b;color:#67e0c2}.authDialog{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:20px}.authDialogBackdrop{position:absolute;inset:0;background:rgba(1,8,13,.7)}.authDialogCard{position:relative;width:min(410px,100%);padding:28px;border:1px solid #31566b;border-radius:14px;background:#102535;color:#e7f1f5;box-shadow:0 22px 70px rgba(0,0,0,.45)}.authDialogCard h2{margin:8px 0;color:#fff;font-size:22px}.authDialogCard p{margin:0 0 16px;color:#9db6c0;font-size:12px}.authDialogCard .authLabel{color:#bcd0d7}.authDialogCard .authLabel input{background:#0b1b29;border-color:#365a6b;color:#eef6f8}.authDialogCard .button{width:100%;margin-top:18px}.authDialogClose{position:absolute;right:13px;top:9px;border:0;background:none;color:#96b2bd;font-size:25px;cursor:pointer}
.adminHeader{display:flex;align-items:flex-end;justify-content:space-between;gap:18px}.adminHeader h1{margin:6px 0;font-size:28px}.adminHeader p{margin:0;color:#91aaba;font-size:13px}.adminToolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:18px 0}.adminToolbar .field,.adminToolbar .select{width:auto;min-width:170px;margin:0}.adminSummary{display:flex;gap:10px;margin:18px 0}.adminStat{min-width:130px;padding:13px 15px;border:1px solid #2b4e61;border-radius:9px;background:#0f2535}.adminStat span,.adminStat strong{display:block}.adminStat span{color:#8caab6;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.adminStat strong{margin-top:5px;color:#fff;font-size:20px}.adminTableWrap{overflow:auto;border:1px solid #2b4e61;border-radius:11px;background:#0d202f}.adminTable{width:100%;border-collapse:collapse;min-width:760px}.adminTable th,.adminTable td{padding:12px 14px;border-bottom:1px solid #213f50;text-align:left;font-size:12px}.adminTable th{color:#8faebb;font-size:10px;letter-spacing:.08em;text-transform:uppercase}.adminTable td{color:#dbeaf0}.adminTable tr:last-child td{border-bottom:0}.adminStatus,.adminRole{display:inline-flex;padding:4px 8px;border-radius:99px;font-size:10px;font-weight:800;text-transform:capitalize}.adminStatus.active{background:rgba(41,197,148,.14);color:#63e0ba}.adminStatus.inactive{background:rgba(210,150,73,.14);color:#f1ca86}.adminRole{background:#143b52;color:#9ed9e7}.adminActions{display:flex;gap:5px;flex-wrap:wrap}.adminActions button{margin:0!important;padding:6px 8px!important;font-size:10px!important}.adminEmpty,.adminLoading{padding:28px;text-align:center;color:#8faab6;font-size:12px}.adminModal{position:fixed;inset:0;z-index:90;display:grid;place-items:center;padding:20px;background:rgba(1,8,13,.72)}.adminModalCard{width:min(500px,100%);max-height:90vh;overflow:auto;padding:24px;border:1px solid #31566b;border-radius:13px;background:#102535}.adminModalCard h2{margin:7px 0;color:#fff;font-size:21px}.adminModalCard p{margin:0 0 16px;color:#9db6c0;font-size:12px}.adminFormGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.adminFormGrid .authLabel:first-child,.adminFormGrid .authLabel:nth-child(2){grid-column:span 1}.adminFormGrid .authLabel input,.adminFormGrid .authLabel select{display:block;width:100%;height:40px;margin-top:6px;border:1px solid #365a6b;border-radius:7px;background:#0b1b29;color:#e7f1f5;padding:0 10px;font:inherit;font-size:12px}.adminModalActions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.adminModalActions .button{margin:0}.adminError{min-height:18px;color:#f0a69c;font-size:11px}
@media(max-width:820px){.authShell{grid-template-columns:1fr}.authBrandPanel{min-height:470px;padding:32px}.authBrandCopy{margin-top:70px}.authFormPanel{padding:28px 18px}.adminFormGrid{grid-template-columns:1fr}.adminToolbar .field,.adminToolbar .select{flex:1;min-width:140px}}
@media(max-width:520px){.authPage{padding:0}.authShell{min-height:100vh;border:0;border-radius:0}.authBrandCopy h1{font-size:31px}.authCard{padding:27px 22px}.adminSummary{overflow:auto}.adminStat{min-width:115px}}
.profileMenu{z-index:40;margin-top:auto}
@media(max-width:860px){.profileMenu{margin-top:0;padding-top:0;border-top:0;flex:0 0 auto}.profilePopover{right:0;bottom:calc(100% + 8px)}}
.profileDetail{display:flex;justify-content:space-between;gap:20px;padding:10px 0;border-bottom:1px solid #29485a;font-size:12px}.profileDetail:last-child{border-bottom:0}.profileDetail span{color:#8faebb}.profileDetail strong{color:#eef6f8;text-align:right;overflow-wrap:anywhere}
.authFormPanel{background:#08131f}.authCard{border-color:#2b4e61;background:#102535;color:#e7f1f5;box-shadow:0 20px 50px rgba(0,0,0,.24)}.authCard .eyebrow{color:#67e0c2}.authCard h2{color:#fff}.authCard>p{color:#9db6c0}.authLabel{color:#c1d3d9}.authLabel input{border-color:#365a6b;background:#0b1b29;color:#eef6f8}.setupNotice{border-color:#2e5264;background:#0b1b29;color:#9db6c0}
/* Global branch workspace selector. It reuses the sidebar surface, borders, and type scale. */
.branchSwitcher{position:relative;margin:0 0 10px;padding:0 0 1px;z-index:35}
.branchSwitcherLabel{display:block;margin:0 0 7px;padding:0 8px;color:#7893a4;font-size:9px;letter-spacing:.12em;text-transform:uppercase}
.branchSwitcherButton{display:flex;align-items:center;gap:9px;width:100%;min-height:54px;padding:8px 10px;border:1px solid #294762;border-radius:7px;background:#14283d;color:#e7f1f5;font:inherit;text-align:left;cursor:pointer;transition:border-color 150ms ease,background 150ms ease,box-shadow 150ms ease}
.branchSwitcherButton:hover,.branchSwitcherButton:focus-visible{border-color:#4f8bb2;background:#19324a;box-shadow:0 0 0 3px rgba(74,145,189,.11);outline:none}
.branchSwitcherIcon,.branchOptionIcon{display:grid;place-items:center;flex:0 0 auto;color:#75b9e9}
.branchSwitcherIcon{width:20px;height:20px}
.branchSwitcherIcon svg,.branchOptionIcon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.7}
.branchSwitcherCopy{min-width:0;flex:1}
.branchSwitcherCopy strong,.branchSwitcherCopy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.branchSwitcherCopy strong{font-size:13px;line-height:1.2}
.branchSwitcherCopy small{margin-top:3px;color:#9bb3c1;font-size:10px}
.branchSwitcherChevron{color:#9cb7c4;font-size:15px;line-height:1}
.branchSwitcherPopover{position:absolute;top:calc(100% + 3px);left:0;right:0;padding:8px;border:1px solid #36566a;border-radius:9px;background:#0d2131;box-shadow:0 18px 38px rgba(0,0,0,.38);animation:branchPopoverIn 130ms ease-out}
.branchSwitcherPopover[hidden]{display:none}
.branchSwitcherSearch{display:block;margin:0 0 7px}
.branchSwitcherSearch input{width:100%;height:32px;padding:7px 9px;border:1px solid #294b5e;border-radius:6px;background:#07131e;color:var(--app-text,#e7f1f5);font:inherit;font-size:11px;outline:none}
.branchSwitcherSearch input:focus{border-color:var(--app-blue,#3b82f6);box-shadow:0 0 0 3px rgba(59,130,246,.16)}
.branchSwitcherList{display:grid;gap:3px;max-height:240px;overflow:auto}
.branchOption{display:flex;align-items:center;gap:8px;width:100%;padding:8px 7px;border:0;border-radius:6px;background:transparent;color:#dcecf1;font:inherit;text-align:left;cursor:pointer}
.branchOption:hover,.branchOption:focus-visible{background:#16384b;outline:none}
.branchOption.is-selected{background:#193b50}
.branchOptionCopy{min-width:0;flex:1}
.branchOptionCopy strong,.branchOptionCopy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.branchOptionCopy strong{font-size:11px}
.branchOptionCopy small{margin-top:2px;color:#89a6b4;font-size:9px}
.branchOptionCheck{visibility:hidden;color:#67e0c2;font-size:13px;font-weight:800}
.branchOption.is-selected .branchOptionCheck{visibility:visible}
.branchSwitcherEmpty{padding:12px 8px;color:#89a6b4;font-size:10px;text-align:center}
@keyframes branchPopoverIn{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}
.branchWorkspaceEmpty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:300px;margin:20px 0;padding:32px;border:1px dashed #2d5368;border-radius:10px;background:rgba(8,25,39,.5);text-align:center}
.branchWorkspaceEmpty[hidden]{display:none}
.branchWorkspaceEmptyIcon{display:grid;place-items:center;width:46px;height:46px;border:1px solid #2e6d96;border-radius:12px;background:#103552;color:#65b8f3}
.branchWorkspaceEmptyIcon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.7}
.branchWorkspaceEmpty h2{margin:12px 0 5px;color:var(--app-text,#e7f1f5);font-size:17px}
.branchWorkspaceEmpty p{max-width:430px;margin:0;color:#8ba5b3;font-size:12px;line-height:1.5}
.branchWorkspaceEmpty .button{margin-top:18px}
.branchHiddenWhenEmpty{display:none!important}
.branchSwitching #grid,.branchSwitching .playbackTabPanel,.branchSwitching .healthSection,.branchSwitching .healthSummary,.branchSwitching .healthInfo{visibility:hidden}
@media(max-width:760px){.branchSwitcherPopover{right:auto;width:min(290px,calc(100vw - 36px))}
}
.adminModalCard{overflow:visible}
.branchAccessField{min-width:0}
.branchMultiSelect{position:relative;margin-top:6px;width:100%}
.branchMultiSelectTrigger{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;height:40px;padding:0 10px;border:1px solid #365a6b;border-radius:7px;background:#0b1b29;color:#e7f1f5;font:inherit;font-size:12px;text-align:left;cursor:pointer;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}
.branchMultiSelectTrigger:hover,.branchMultiSelectTrigger:focus-visible{border-color:#4f8bb2;background:#10283a;box-shadow:0 0 0 3px rgba(74,145,189,.12);outline:none}
.branchMultiSelectTrigger span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.branchMultiSelectChevron{color:#9db8c3;font-size:15px;line-height:1;transform:translateY(-1px)}
.branchMultiSelectPanel{position:absolute;top:calc(100% + 5px);left:0;right:0;z-index:120;padding:7px;border:1px solid #365a6b;border-radius:8px;background:#0d2232;box-shadow:0 16px 34px rgba(0,0,0,.42);animation:branchPickerIn .12s ease-out}
.branchMultiSelectPanel[hidden]{display:none}
.branchPickerActions{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 2px 7px;border-bottom:1px solid #29485a}
.branchPickerActions button{border:0;background:transparent;color:#6fc8ec;padding:4px 5px;font:inherit;font-size:10px;font-weight:800;cursor:pointer}
.branchPickerActions button:hover,.branchPickerActions button:focus-visible{color:#8de3dc;text-decoration:underline;outline:none}
.branchPickerOptions{display:grid;gap:2px;max-height:210px;overflow:auto;padding-top:5px}
.branchPickerOption{display:flex;align-items:center;gap:8px;min-height:38px;padding:6px 7px;border:1px solid transparent;border-radius:6px;color:#dcecf1;cursor:pointer;transition:background .14s ease,border-color .14s ease}
.branchPickerOption:hover,.branchPickerOption:focus-within{border-color:#28546b;background:#14364a}
.branchPickerOption input{position:absolute;opacity:0;pointer-events:none}
.branchPickerOptionText{min-width:0;flex:1}
.branchPickerOptionText strong,.branchPickerOptionText small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.branchPickerOptionText strong{font-size:11px}.branchPickerOptionText small{margin-top:2px;color:#89a6b4;font-size:9px}
.branchPickerCheck{visibility:hidden;display:grid;place-items:center;width:18px;height:18px;border:1px solid #365a6b;border-radius:5px;color:#06131d;font-size:11px;font-weight:900}
.branchPickerOption:has(input:checked){border-color:#2f6f8e;background:#153e54}.branchPickerOption:has(input:checked) .branchPickerCheck{visibility:visible;border-color:#42c7c0;background:#42c7c0}
.branchPickerEmpty{padding:12px 8px;color:#89a6b4;font-size:10px;text-align:center}
@keyframes branchPickerIn{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}
.deviceAccessField{grid-column:1/-1;min-width:0}.deviceAccessField>span:first-child{display:block}.deviceAccessField .fieldHint{display:block;margin-top:4px;color:#89a6b4;font-size:10px;font-weight:500;line-height:1.4}.deviceMultiSelect{position:relative;margin-top:7px;width:100%}.deviceMultiSelectPanel{max-height:min(330px,42vh);overflow:hidden}.devicePickerOptions{max-height:260px;overflow:auto;padding-top:5px}.devicePickerGroup+.devicePickerGroup{margin-top:7px;padding-top:6px;border-top:1px solid #29485a}.devicePickerGroupTitle{padding:2px 7px 4px;color:#b9d8e2;font-size:10px;font-weight:800;letter-spacing:.04em}.devicePickerGroupTitle span{color:#7898a7;font-weight:500}.devicePickerOption{min-height:36px}.devicePickerOption .branchPickerOptionText strong{font-size:11px}.adminTable{min-width:930px}
@media(max-width:820px){.deviceAccessField{grid-column:1}.deviceMultiSelectPanel{max-height:38vh}}

/* Audit log controls stay on the existing admin surface while keeping the
   table and pagination compact on smaller screens. */
.auditToolbar{align-items:flex-end;margin:18px 0 12px;padding:12px 14px;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-surface)}
.auditFilter{display:flex;flex:0 1 148px;flex-direction:column;gap:6px;min-width:125px;color:#8faebb;font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.auditFilter.auditSearch{flex:1 1 300px;min-width:230px}
.auditFilter.auditRows{flex-basis:120px}
.auditFilter .field,.auditFilter .select{width:100%;min-width:0;height:36px;margin:0;padding:8px 10px;font-size:12px;font-weight:600;letter-spacing:0;text-transform:none}
.auditFilter .select:disabled{cursor:not-allowed;opacity:.55}
.auditTableWrap{margin-top:0}
.auditTable{min-width:760px}
.auditPagination{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:58px;padding:10px 14px;border-top:1px solid var(--app-border);color:#8faebb;font-size:11px}
.auditPageControls{display:flex;align-items:center;gap:5px}
.auditPageControls>.button{min-height:32px;padding:7px 10px;font-size:11px}
.auditPages{display:flex;align-items:center;gap:4px}
.auditPageButton{min-width:32px!important;padding:6px 8px!important}
.auditPageButton.is-active{border-color:var(--app-blue);background:var(--app-blue);color:#fff}
.auditPageButton.is-active:disabled{cursor:default;opacity:1}
.auditPageEllipsis{display:inline-flex;align-items:center;justify-content:center;min-width:20px;color:var(--app-dim);font-size:12px}
@media(max-width:900px){.auditToolbar{align-items:stretch}.auditFilter,.auditFilter.auditSearch,.auditFilter.auditRows{flex:1 1 calc(33.333% - 10px)}}
@media(max-width:620px){.auditToolbar{display:grid;grid-template-columns:1fr 1fr}.auditFilter,.auditFilter.auditSearch,.auditFilter.auditRows{min-width:0}.auditFilter.auditSearch{grid-column:1/-1}.auditPagination{align-items:stretch;flex-direction:column;gap:9px}.auditPageControls{justify-content:space-between}.auditPages{overflow:auto}}
