:root {
      --bg-primary: #0c1018;
      --bg-sidebar: #0e121c;
      --bg-card: #151b28;
      --bg-card-elevated: #1a2232;
      --bg-toolbar: #121824;
      --bg-surface: #161d2c;
      --accent: #12c9a0;
      --accent-hover: #2ee8be;
      --accent-dim: rgba(18, 201, 160, 0.14);
      --accent-glow: rgba(18, 201, 160, 0.38);
      --status-online: #34d17a;
      --status-online-dim: rgba(52, 209, 122, 0.16);
      --status-online-border: rgba(52, 209, 122, 0.55);
      --status-offline: #f05252;
      --status-offline-dim: rgba(240, 82, 82, 0.16);
      --status-offline-border: rgba(240, 82, 82, 0.5);
      --text: #e8e8ee;
      --text-dim: #8a8a9c;
      --text-muted: #5a5a6e;
      --border: rgba(255, 255, 255, 0.09);
      --border-strong: rgba(255, 255, 255, 0.13);
      --border-subtle: rgba(255, 255, 255, 0.05);
      --danger: #d45a4a;
      --danger-dim: rgba(212, 90, 74, 0.12);
      --timeline-tick-major: rgba(180, 182, 198, 0.62);
      --timeline-tick-minor: rgba(130, 132, 150, 0.28);
      --pb-pill-grad-0: #1a9a82;
      --pb-pill-grad-1: #127a68;
      --radius-sm: 4px;
      --radius-md: 6px;
      --radius-lg: 8px;
      --radius-xl: 10px;
      --shadow-chrome: 0 1px 0 rgba(255, 255, 255, 0.03), 0 2px 8px rgba(0, 0, 0, 0.32);
      --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.48);
      --shadow-modal: 0 20px 56px rgba(0, 0, 0, 0.58);
      --tile-border: rgba(255, 255, 255, 0.07);
      --tile-border-active: rgba(255, 255, 255, 0.18);
      --badge-bg: var(--bg-card);
      --font-caption: 10px;
      --font-label: 11px;
      --font-body: 12px;
      --font-title: 13px;
      --font-value: 12px;
      --recording-green: #36c96a;
      --recording-green-dim: #1e9e4a;
      --playhead-teal: #5eb8b0;
      --progress-amber: #d4a04a;
      --transition-fast: 0.15s ease;
      --transition-ui: 0.15s ease;
      --focus-ring: 0 0 0 2px var(--bg-primary), 0 0 0 4px rgba(120, 140, 180, 0.45);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
      background: var(--bg-primary);
      color: var(--text);
      height: 100vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      font-size: var(--font-body);
      line-height: 1.45;
      letter-spacing: 0.01em;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      z-index: -2;
      background:
        radial-gradient(ellipse 90% 55% at 50% -8%, rgba(36, 72, 120, 0.28) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(18, 201, 160, 0.08) 0%, transparent 50%),
        linear-gradient(175deg, #101828 0%, #0c1018 45%, #080c14 100%);
      pointer-events: none;
    }

    body::after {
      content: '';
      position: fixed;
      inset: 0;
      z-index: -1;
      opacity: 0.35;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
      background-repeat: repeat;
      background-size: 128px 128px;
      pointer-events: none;
      mix-blend-mode: overlay;
    }

    /* Subtle scrollbars for chrome panels */
    #cam-list,
    .layout-menu,
    .help-modal-body {
      scrollbar-width: thin;
      scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
    }

    #cam-list::-webkit-scrollbar,
    .layout-menu::-webkit-scrollbar,
    .help-modal-body::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }

    #cam-list::-webkit-scrollbar-thumb,
    .layout-menu::-webkit-scrollbar-thumb,
    .help-modal-body::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.12);
      border-radius: var(--radius-sm);
    }

    #cam-list::-webkit-scrollbar-thumb:hover,
    .layout-menu::-webkit-scrollbar-thumb:hover,
    .help-modal-body::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    button:focus-visible,
    input:focus-visible {
      outline: none;
      box-shadow: var(--focus-ring);
    }

    /* ---- Initial load overlay ---- */
    .app-boot-overlay {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: rgba(8, 8, 14, 0.62);
      -webkit-backdrop-filter: blur(12px);
      backdrop-filter: blur(12px);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.28s ease, visibility 0.28s ease;
    }

    .app-boot-overlay.visible {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .app-boot-card {
      width: min(340px, 92vw);
      padding: 22px 24px;
      border-radius: var(--radius-xl);
      background: var(--bg-card-elevated);
      border: 1px solid var(--border);
      box-shadow: var(--shadow-modal);
    }

    .app-boot-label {
      font-size: var(--font-body);
      font-weight: 500;
      color: var(--text-dim);
      margin-bottom: 14px;
      text-align: center;
      letter-spacing: 0.02em;
    }

    .app-boot-bar-track {
      height: 3px;
      border-radius: var(--radius-sm);
      background: rgba(255, 255, 255, 0.05);
      overflow: hidden;
    }

    .app-boot-bar-fill {
      width: 38%;
      height: 100%;
      border-radius: var(--radius-sm);
      background: linear-gradient(90deg,
          transparent,
          rgba(140, 150, 170, 0.5),
          rgba(180, 190, 210, 0.7),
          transparent);
      animation: appBootBarSlide 1.1s ease-in-out infinite;
    }

    @keyframes appBootBarSlide {
      0% {
        transform: translateX(-130%);
      }

      100% {
        transform: translateX(300%);
      }
    }
