:root {
  --bg: #1c4066;
  /* Light surfaces so the all-black writing stays readable on panels,
     inputs and buttons (these were dark blue with light text). */
  --panel: #e8f4ff;
  --panel-raised: #d2e9ff;
  --border: #4a80ab;
  /* All writing is solid black - no dimmed/grey variant anywhere. */
  --text: #000;
  --text-dim: #000;
  --accent: #f0883a;
  --accent-dim: #f7b98a;
  --rec: #d14343;
  --ok: #4caf7d;
  --radius: 3px;
  /* Stencil for all writing outside the video itself - see .tile-label
     and .tile-play-btn for the on-video exceptions. */
  --font: 'Allerta Stencil', 'Stencil Std', 'Arial Black', sans-serif;
  --video-font: -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  /* Allerta Stencil only ships a regular weight - a browser-faked bold
     smears over the stencil gaps, so bold text renders as regular. */
  font-synthesis: none;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
  /* The "backing page" - ONE continuous gradient spanning the full width
     (sidebar + main together, no seam between them), exactly matching the
     source reference crop: orange at both outer edges, light blue through
     the middle. The sidebar/main are transparent below so this shows
     through both instead of each re-running its own copy. */
  background: linear-gradient(90deg,
    #ffa831 0%,
    #c4e6ff 15%,
    #acdcff 36%,
    #9ed4ff 50%,
    #acdcff 64%,
    #c4e6ff 85%,
    #ffa831 100%
  );
}

.shell::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  z-index: 0;
}

/* ---------- Sidebar ---------- */

.sidebar {
  /* Transparent - shows the .shell "backing page" gradient through it
     (see above), matching the reference exactly instead of re-running its
     own separately-scaled copy. */
  position: relative;
  z-index: 1;
  overflow-y: auto;
  background: transparent;
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Hamburger toggle and backdrop - only shown/usable below the drawer
   breakpoint (see the @media block at the end of this section). Kept in
   normal flow above 768px so they never affect the desktop two-column
   layout. */
.sidebar-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: #000;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

/* "Pop in" button inside the open drawer - the drawer covers the hamburger
   that opened it, so it needs its own way to close. Drawer mode only. */
.sidebar-close-btn {
  display: none;
  position: relative;
  margin-left: auto;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid #000;
  border-radius: 6px;
  /* The X is drawn with two thick bars rather than a text character - the
     stencil font's x is thin and hard to see at a glance. */
  font-size: 0;
  cursor: pointer;
}
.sidebar-close-btn::before,
.sidebar-close-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 4px;
  background: #000;
  border-radius: 2px;
}
.sidebar-close-btn::before { transform: translate(-50%, -50%) rotate(45deg); }
.sidebar-close-btn::after { transform: translate(-50%, -50%) rotate(-45deg); }
.sidebar-close-btn:hover { background: var(--accent); }

.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 1;
  }

  .sidebar-close-btn {
    display: inline-block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    max-width: 82vw;
    z-index: 210;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.45);
    /* As a drawer it floats over the camera grid - kept see-through like
       the desktop sidebar, with just a light tint so the writing reads. */
    background: rgba(232, 244, 255, 0.35);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.current-user {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  text-transform: capitalize;
}

.remote-address {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.remote-address .field-hint {
  margin: 0;
  font-size: 11px;
}

.remote-address-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.remote-address-row code {
  flex: 1;
  font-size: 11px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-small {
  padding: 4px 10px;
  font-size: 11px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 6px;
}

.brand-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.btn {
  border: 1px solid var(--border);
  background: var(--panel-raised);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn:hover { border-color: var(--accent-dim); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}
.btn-primary:hover { background: #f5a15f; }

.btn-ghost { background: transparent; }

.btn-block { width: 100%; }

.camera-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.camera-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}
.camera-list-item:hover { border-color: var(--border); background: var(--panel-raised); }

.camera-list-item .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 8px;
  flex-shrink: 0;
}
.camera-list-item.offline .status-dot { background: var(--text-dim); }

.camera-list-item .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-list-item .mode-tag {
  color: #000;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  width: 15px;
  height: 15px;
  line-height: 13px;
  text-align: center;
  flex-shrink: 0;
}

.camera-list-item .remove,
.camera-list-item .recordings-btn,
.camera-list-item .edit-btn,
.camera-list-item .zones-btn {
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
}
.camera-list-item .recordings-btn { font-size: 10px; }
.camera-list-item .remove:hover,
.camera-list-item .recordings-btn:hover,
.camera-list-item .edit-btn:hover,
.camera-list-item .zones-btn:hover { background: var(--accent); border-radius: var(--radius); }

/* ---------- Users modal ---------- */

.users-list {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 4px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.user-item .user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-item select { font-size: 12px; padding: 3px 6px; }
.user-item .remove {
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
}
.user-item .remove:hover { background: var(--accent); border-radius: var(--radius); }
.user-item .reset-devices {
  font-size: 11px;
  padding: 3px 7px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.user-item .reset-devices:hover:not(:disabled) { background: var(--accent); }
.user-item .reset-devices:disabled { opacity: 0.4; cursor: default; }

/* ---------- Devices & security ---------- */

.devices-list { max-height: 240px; overflow-y: auto; }
.device-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.device-item .device-info { flex: 1; min-width: 0; }
.device-item .device-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-item .device-current { text-decoration: underline; }
.device-item .field-hint { margin: 2px 0 0; font-size: 11px; }

/* ---------- Main ---------- */

.main {
  /* Transparent - shows the .shell "backing page" gradient through it
     (see .shell above), continuing seamlessly from the sidebar with no
     seam between them, matching the reference exactly. */
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  overflow: hidden;
  /* The header's own colour scheme - kept separate from the backing page/
     sidebar gradient (see .shell). Same confirmed stops as before
     (orange-outer / blue-centre), just running top-to-bottom instead of
     left-to-right. */
  background: linear-gradient(180deg,
    #ffa831 0%,
    #c4e6ff 15%,
    #acdcff 36%,
    #9ed4ff 50%,
    #acdcff 64%,
    #c4e6ff 85%,
    #ffa831 100%
  );
  border-bottom: 2px solid #0d1b2a;
}

/* Grainy/noise texture over the gradients, matching the source design's
   per-stop "Noise" slider - an SVG feTurbulence filter tiled as a
   background-image, blended over whichever gradient sits underneath it
   (the header's own, or the shell's backing-page one). */
.topbar::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 100px 100px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.topbar-brand { display: flex; flex-direction: column; }
.topbar-wordmark {
  font-family: 'Allerta Stencil', 'Stencil Std', 'Arial Black', sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 1px;
  text-decoration: underline;
  color: #000;
}
.topbar-tagline {
  display: block;
  font-family: 'Allerta Stencil', 'Stencil Std', 'Arial Black', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.7px;
  color: #000;
  margin-top: 1px;
}

.topbar-meta-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.grid-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.grid-size-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.size-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-raised);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.size-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.topbar-meta {
  color: var(--text-dim);
  font-size: 12.5px;
}
.topbar-meta.clickable { cursor: pointer; }
.topbar-meta.clickable:hover { text-decoration: underline; }

.sessions-list { max-height: 320px; overflow-y: auto; }
.session-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.session-item:last-child { border-bottom: none; }
.session-item .session-user { color: var(--text); font-weight: 600; }
.session-item .session-user .role-tag {
  font-weight: 400;
  color: var(--text-dim);
  text-transform: capitalize;
}
.session-item .session-meta { color: var(--text-dim); }

.grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-content: start;
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--text-dim);
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.tile {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.tile video, .tile img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Sits on top of the video itself, over a dark fade - so it keeps the
   plain font and light text (black would vanish into the fade), unlike
   all the writing outside the video. */
.tile-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  font-family: var(--video-font);
  font-size: 12.5px;
  color: #fff;
}

.tile-label .ptz-tag {
  color: var(--accent);
  font-size: 11px;
  border: 1px solid var(--accent-dim);
  padding: 1px 6px;
  border-radius: var(--radius);
}

.tile-activity-stripe {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 8px;
  background: var(--accent);
  opacity: 0.85;
  cursor: pointer;
}

.tile-play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(13,27,42,0.75);
  border: 1px solid var(--border);
  color: #fff; /* on the video, over a dark circle */
  font-family: var(--video-font);
  font-size: 16px;
  cursor: pointer;
}

/* ---------- Modals ---------- */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 420px;
  max-width: 92vw;
  max-height: 86vh;
  overflow-y: auto;
}

.modal-wide { width: 820px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 15px; margin: 0; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body { padding: 18px; }

.field-row {
  display: flex;
  gap: 12px;
}
.field-row label { flex: 1; }

label {
  display: block;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 12.5px;
}

input, select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.field-hint {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.discover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.discover-item:last-child { border-bottom: none; }
.discover-item .meta { color: var(--text-dim); font-size: 12px; }
.discover-item > div { flex: 1; }
.discover-item-check { flex: 0 0 auto; width: 16px; height: 16px; }

/* ---------- PTZ modal ---------- */

.ptz-body {
  display: block;
}

.ptz-video {
  position: relative;
  overflow: hidden;
}

.ptz-video video {
  width: 100%;
  background: #000;
  aspect-ratio: 16/9;
  transition: transform 0.08s ease-out;
}

.tile video { transition: transform 0.08s ease-out; }

.ptz-summon-row {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 5;
}

.floating-panel {
  position: absolute;
  width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  z-index: 10;
}

.floating-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-raised);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: move;
  user-select: none;
}

.floating-panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}

.floating-panel-body { padding: 12px; }

.motion-events-list { max-height: 240px; overflow-y: auto; }

.motion-event-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.motion-event-row:hover { background: var(--panel-raised); }
.motion-event-row .event-time { color: var(--text-dim); font-size: 10.5px; margin-top: 2px; }

.ptz-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 4px;
  justify-content: center;
}

.dpad-btn {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.dpad-btn:active { background: var(--accent); }

.dpad-center {
  background: transparent;
  border-radius: var(--radius);
}

.zoom-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.preset-btn {
  font-size: 12px;
  padding: 5px 9px;
}

/* ---------- Recordings modal ---------- */

.recordings-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 18px;
}

.recordings-player video {
  width: 100%;
  background: #000;
  aspect-ratio: 16/9;
}

.recordings-player-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}
.recordings-player-nav .field-hint { flex: 1; text-align: center; margin: 0; }
.recordings-player-nav .btn { font-size: 12px; padding: 6px 10px; }
.recordings-player-nav .btn:disabled { opacity: 0.4; cursor: default; }

.recordings-scrub {
  margin-top: 12px;
}

.recordings-scrub-header {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.recordings-scrub-track {
  position: relative;
  height: 28px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
}

.scrub-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent-dim);
  min-width: 2px;
}
.scrub-segment:hover { background: var(--accent); }
.scrub-segment.active { background: var(--accent); }

.scrub-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text);
  pointer-events: none;
  display: none;
}
.scrub-playhead.visible { display: block; }

.recordings-scrub-hours {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 10px;
  margin-top: 3px;
}

.recordings-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* Filter bar for the "smart timeline" events feed below - instant,
   client-side filtering of the already-fetched event list (see
   applyEventsFilters in app.js), no re-fetch per keystroke/toggle. */
.events-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.events-filter-bar input[type="search"] {
  flex: 1;
  min-width: 100px;
  padding: 5px 8px;
  font-size: 12px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.events-filter-bar input[type="date"] {
  padding: 4px 6px;
  font-size: 12px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.events-category-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.events-category-filters label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  font-size: 12px;
  white-space: nowrap;
}
.events-category-filters input { margin: 0; }

.recordings-events {
  max-height: 320px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.recordings-events:empty { display: none; }

.event-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  font-size: 12px;
}
.event-item .event-category-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-dim);
}
.event-item .event-category-dot.people { background: var(--accent); }
.event-item .event-category-dot.vehicles { background: var(--ok); }
.event-item .event-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.event-item .event-type {
  color: #000;
  text-transform: capitalize;
}
.event-item .event-time { color: var(--text-dim); white-space: nowrap; }
.event-item.clickable .event-main { cursor: pointer; border-radius: var(--radius); }
.event-item.clickable .event-main:hover { background: var(--panel-raised); }
.event-item .event-download {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 2px 4px;
  flex-shrink: 0;
}
.event-item .event-download:hover { background: var(--accent); border-radius: var(--radius); }

.recordings-list {
  max-height: 280px;
  overflow-y: auto;
}

/* ---------- Motion zone editor ---------- */

.zones-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
.zones-canvas-wrap img,
.zones-canvas-wrap canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}
.zones-canvas-wrap img { object-fit: contain; }
.zones-canvas-wrap canvas { cursor: crosshair; }

.recordings-day-header {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 4px 4px;
}
.recordings-day-header:first-child { padding-top: 0; }
.recordings-day-header.clickable { cursor: pointer; }
.recordings-day-header.clickable:hover { text-decoration: underline; }
.recordings-day-header.active { background: var(--accent); border-radius: var(--radius); }

.recordings-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}
.recordings-item:hover { background: var(--panel-raised); }
.recordings-item.active { background: var(--accent); color: var(--text); }
.recordings-item .meta { color: var(--text-dim); font-size: 11.5px; }
