/* ---- Vision Management Platform - style.css, part 5 of 5 ---- */
/* Phase 12 of frontend modularization: style.css was split into 5 files
   at safe boundaries (verified comment/string/brace-aware, each file ends
   right after a fully-closed rule) and loaded via 5 <link> tags in the
   same order as the original file. This preserves the exact CSS cascade
   order byte-for-byte -- selectors are NOT grouped by feature/component
   because the original file interleaves the same component's rules across
   thousands of lines (e.g. .mpx-* grid rules appear from line ~4320 to
   ~18367), so a semantic regrouping would require re-deriving cascade
   order by hand and risk silently changing which rule wins. See
   frontend_modularization_plan.md Phase 12 for the deferred full reorg. */


.drawer-row-tag.tag-onwall {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.drawer-row-grip {
  color: #CBD5E1;
  cursor: grab;
  font-size: 12px;
  padding: 0 2px;
}

.drawer-row-grip:hover {
  color: #64748B;
}

/* Drawer Header Action Square Buttons [ + ] [ < ] */
.drawer-action-square-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-action-square-btn:hover {
  background: #F8FAFC;
  color: #0F172A;
  border-color: #CBD5E1;
}

/* Footer of Drawer */
.drawer-footer {
  height: 52px;
  padding: 0 16px;
  border-top: 1px solid #F1F5F9;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.send-wall-btn {
  height: 32px;
  border-radius: 16px;
  border: none;
  background: #0F172A;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: all 0.15s ease;
}

.send-wall-btn:hover {
  background: #1E293B;
}

/* Top bar Hierarchy Toggle Button */
.topbar-hierarchy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #0F172A;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-hierarchy-toggle .topbar-cam-badge {
  background: #0F172A;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 2px;
  transition: all 0.15s ease;
}

/* When Hierarchy Drawer is OPEN (active) */
.topbar-hierarchy-toggle.active,
.topbar-hierarchy-toggle.open {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.topbar-hierarchy-toggle.active .topbar-cam-badge,
.topbar-hierarchy-toggle.open .topbar-cam-badge {
  background: #334155;
  color: #FFFFFF;
}

/* Top bar Mode Switcher Toggle Pill [ Drill-down | Tree drawer ] */
.topbar-mode-switcher {
  background: #F1F5F9;
  border-radius: 8px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.topbar-mode-btn {
  border: none;
  background: transparent;
  color: #64748B;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-mode-btn:hover {
  color: #0F172A;
}

.topbar-mode-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Rail Badge Dot for Alarms */
.rail-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #EF4444;
  position: absolute;
  top: -1px;
  right: -2px;
  border: 1.5px solid #0F172A;
}

/* Video Wall Container & Padded Grid Card (Matching Reference Screenshot) */
#tab-grid {
  padding: 8px !important;
  margin: 0 !important;
  flex: 1;
  height: calc(100vh - 52px);
  min-height: 0;
  overflow: hidden;
  background: #EEF1F6 !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#tab-grid > div {
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  width: 100% !important;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#camera-grid.multiplexer-canvas {
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  gap: 1px !important;
  background: #CBD5E1 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

.mpx-tile, .mpx-tile-empty {
  border-radius: 0 !important;
}

.mpx-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: #0B1120;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.mpx-tile-empty {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: #FFFFFF !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mpx-tile-empty:hover {
  background: #F8FAFC !important;
}

.mpx-empty-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F1F5F9;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.mpx-empty-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #94A3B8;
}

/* On-Tile Volume Popover Slider */
.mpx-vol-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mpx-vol-popover {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  margin-right: 6px;
  z-index: 100;
  white-space: nowrap;
}

.mpx-vol-wrap:hover .mpx-vol-popover {
  display: flex;
}

.mpx-vol-slider {
  width: 70px;
  height: 4px;
  accent-color: #3B5BFD;
  cursor: pointer;
}

.mpx-vol-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #F8FAFC;
  min-width: 28px;
}

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬
   DRAG & DROP TILE REORDERING STYLES
   ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */

.mpx-tile[draggable="true"] {
  cursor: grab;
}

.mpx-tile[draggable="true"]:active {
  cursor: grabbing;
}

.mpx-tile.dragging-tile {
  opacity: 0.45;
  transform: scale(0.98);
  border: 2px dashed #3B5BFD !important;
}

.mpx-tile.drag-over-tile,
.mpx-tile-empty.drag-over-tile {
  border: 2px solid #3B5BFD !important;
  box-shadow: 0 0 16px rgba(59, 91, 253, 0.45) !important;
  background: rgba(59, 91, 253, 0.08) !important;
}

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬
   MOBILE RESPONSIVENESS (Screens <= 768px and <= 480px)
   ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */

.mobile-menu-toggle-btn {
  display: none;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  color: #0F172A;
  cursor: pointer;
  margin-right: 10px;
  transition: all 0.15s ease;
}

.mobile-menu-toggle-btn:hover {
  background: #E2E8F0;
}

@media (max-width: 768px) {
  /* Mobile Toggle Button */
  .mobile-menu-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Main Layout Stacking */
  .main-layout {
    flex-direction: column;
    overflow-x: hidden;
  }

  /* 220px Left Sidebar turns into off-screen mobile drawer */
  .nav-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.35);
  }

  .nav-rail.mobile-open {
    transform: translateX(0);
  }

  /* Hierarchy Drawer Mobile Positioning */
  .hierarchy-drawer {
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .hierarchy-scrim {
    left: 0 !important;
  }

  /* Video Wall tab padding and layout */
  #tab-grid {
    padding: 6px !important;
    height: auto !important;
    min-height: calc(100vh - 52px);
  }

  /* Top bar responsiveness */
  .top-nav {
    padding: 0 10px !important;
    gap: 8px;
    flex-wrap: wrap;
    height: auto !important;
    min-height: 52px;
  }

  #vw-topbar-controls {
    flex-wrap: wrap;
    gap: 6px !important;
  }

  /* AI Workflow Filter Bar & Lanes */
  .pp2-filter-card {
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .pp2-lanes {
    flex-direction: column !important;
    gap: 16px !important;
  }

  .pp2-filter-field {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Table Horizontal Scrolling */
  .pp2-table-wrapper, .table-responsive, .data-table-container, .upv-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  /* Modals */
  .modal-content, .confirm-modal-content {
    width: 92vw !important;
    max-width: 92vw !important;
    padding: 16px !important;
    margin: 16px auto !important;
  }
}

@media (max-width: 480px) {
  .pp2-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .pp2-header-right {
    width: 100%;
    justify-content: flex-start;
  }

  .mpx-tile-empty {
    aspect-ratio: 4 / 3;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   VIDEO WALL — TABLET LAYOUT (581px – 900px)
   Collapsed icon-only sidebar (52px) + 2-col camera grid
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 581px) and (max-width: 900px) {
  /* Collapse sidebar to icon-only strip */
  .nav-rail {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    /* Override the 768px mobile-drawer position rules */
    position: relative !important;
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
  }

  /* Hide all text labels in sidebar */
  .rail-brand-text,
  .rail-group-header,
  .rail-item-label,
  .rail-user-info,
  .rail-logout-btn {
    display: none !important;
  }

  /* Center logo mark */
  .rail-logo-header {
    padding: 14px !important;
    justify-content: center !important;
  }

  /* Center nav items */
  .rail-item-btn {
    padding: 10px !important;
    justify-content: center !important;
  }

  /* Center footer */
  .rail-footer {
    padding: 10px !important;
    justify-content: center !important;
  }

  /* Hide hamburger on tablet — nav is always visible as icon strip */
  .mobile-menu-toggle-btn {
    display: none !important;
  }

  /* Keep main layout as row (sidebar + content side by side) */
  .main-layout {
    flex-direction: row !important;
  }

  /* 2-column camera grid on tablet */
  #camera-grid.multiplexer-canvas.grid-3,
  #camera-grid.multiplexer-canvas.grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   VIDEO WALL — MOBILE LAYOUT (≤ 580px)
   No sidebar · bottom tab bar · 2-col camera grid
   ══════════════════════════════════════════════════════════════════════ */

/* ── Bottom Tab Bar Base (hidden on tablet/desktop) ── */
.mobile-bottom-nav {
  display: none;
}

/* ── Mobile Brand Block (hidden on tablet/desktop) ── */
.mobile-topbar-brand {
  display: none;
}

@media (max-width: 580px) {
  /* ── 1. Hide sidebar entirely ── */
  .nav-rail {
    display: none !important;
  }

  /* ── 2. Also hide the hamburger menu button on mobile (no drawer needed) ── */
  .mobile-menu-toggle-btn {
    display: none !important;
  }

  /* ── 3. Top header ── */
  .top-nav {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 14px !important;
    flex-wrap: nowrap !important;
  }

  /* Hide right-side action controls */
  #vw-topbar-controls {
    display: none !important;
  }

  /* Hide desktop breadcrumbs */
  #app-breadcrumbs {
    display: none !important;
  }

  /* Show mobile brand block */
  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-brand-icon {
    width: 28px;
    height: 28px;
    background: #4f46e5;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mobile-brand-text {
    display: flex;
    flex-direction: column;
  }

  .mobile-brand-section {
    font-size: 9px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    font-family: -apple-system, system-ui, sans-serif;
  }

  .mobile-brand-page {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    font-family: -apple-system, system-ui, sans-serif;
  }

  /* ── 4. Camera grid area ── */
  #tab-grid {
    padding: 10px !important;
    padding-bottom: 68px !important; /* clear bottom tab bar */
    height: auto !important;
    min-height: calc(100vh - 48px) !important;
    overflow-y: auto !important;
    background: #f5f6f8 !important;
  }

  #tab-grid > div {
    height: auto !important;
    flex: none !important;
  }

  /* Force 2-col grid at all times on mobile */
  #camera-grid.multiplexer-canvas,
  #camera-grid.multiplexer-canvas.grid-2,
  #camera-grid.multiplexer-canvas.grid-3,
  #camera-grid.multiplexer-canvas.grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    background: #f5f6f8 !important;
    border: none !important;
    height: auto !important;
    overflow: visible !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* ── 5. Camera tiles ── */
  .mpx-tile {
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
    width: 100% !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    border: 1px solid #e5e7eb !important;
    position: relative !important;
  }

  /* Top overlay — gradient + live dot + timestamp */
  .mpx-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
    z-index: 2;
    pointer-events: none;
  }

  /* Bottom overlay — gradient + name */
  .mpx-tile::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 2;
    pointer-events: none;
  }

  /* Live dot */
  .mpx-live-dot {
    width: 6px !important;
    height: 6px !important;
    background: #ef4444 !important;
    border-radius: 50% !important;
    box-shadow: 0 0 4px #ef4444 !important;
    position: absolute !important;
    top: 5px !important;
    left: 5px !important;
    z-index: 5 !important;
  }

  /* Timestamp */
  .mpx-timestamp {
    font-size: 7px !important;
    color: rgba(255,255,255,0.7) !important;
    font-weight: 500 !important;
    position: absolute !important;
    top: 4px !important;
    right: 5px !important;
    z-index: 5 !important;
  }

  /* Camera name label */
  .mpx-cam-name {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #fff !important;
    position: absolute !important;
    bottom: 4px !important;
    left: 6px !important;
    right: 6px !important;
    z-index: 5 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Sub-label */
  .mpx-cam-sub {
    font-size: 8px !important;
    color: rgba(255,255,255,0.65) !important;
    position: absolute !important;
    bottom: 14px !important;
    left: 6px !important;
    right: 6px !important;
    z-index: 5 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Hide signal badge on mobile */
  .mpx-signal-badge,
  .signal-badge {
    display: none !important;
  }

  /* ── 6. Empty tile ── */
  .mpx-tile-empty {
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
    width: 100% !important;
    border: 1.5px dashed #d1d5db !important;
    border-radius: 8px !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    cursor: pointer !important;
  }

  .mpx-empty-circle {
    width: 22px !important;
    height: 22px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #9ca3af !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
  }

  .mpx-empty-label {
    font-size: 8px !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    color: #9ca3af !important;
  }

  /* ── 7. Bottom Tab Bar ── */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 8px 0 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 50;
  }

  .mobile-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-family: -apple-system, system-ui, sans-serif;
    transition: color 0.15s ease;
  }

  .mobile-tab-btn svg {
    stroke: currentColor;
  }

  .mobile-tab-btn .mobile-tab-label {
    font-size: 9px;
    font-weight: 500;
    color: inherit;
  }

  /* Active tab */
  .mobile-tab-btn.mobile-tab-active {
    color: #4f46e5;
    font-weight: 700;
  }

  .mobile-tab-btn.mobile-tab-active .mobile-tab-label {
    font-weight: 700;
    color: #4f46e5;
  }

  /* Raise toast above tab bar */
  #toast-container {
    bottom: 80px !important;
  }

  /* Hierarchy drawer: hide completely when closed on mobile (no translate sliver) */
  .hierarchy-drawer {
    display: none !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    transition: none !important;
  }

  /* Only show it when explicitly opened */
  .hierarchy-drawer.open {
    display: flex !important;
  }

  /* Also hide the scrim completely unless active */
  .hierarchy-scrim {
    left: 0 !important;
  }
}


/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬
   ROAD ANALYSIS MODAL & PP2 SAMPLE ITEM STYLES
   ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */

/* Processed List Phase Tile Icons & Sample Item Accent */
.pp2-thumb.phase-pre {
  background: #EEF4FF !important;
  color: #2563EB !important;
}

.pp2-thumb.phase-during {
  background: #FFF7ED !important;
  color: #C2410C !important;
}

.pp2-thumb.phase-post {
  background: #ECFDF5 !important;
  color: #047857 !important;
}

.pp2-item.sample-item {
  background: #F8FAFF !important;
  border-left: 3px solid #2563EB !important;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.pp2-item.sample-item:hover {
  background: #EFF6FF !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.pp2-sample-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #EEF4FF;
  color: #2563EB;
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 8px;
  flex-shrink: 0;
  display: inline-block;
}

/* Road Analysis Shell Modal */
.ram-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  transition: padding 0.3s cubic-bezier(0.4,0,0.2,1);
}
.ram-overlay--fullscreen {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.ram-container {
  background: #FFFFFF;
  width: 100%;
  max-width: 1320px;
  max-height: 840px;
  height: 92vh;
  border-radius: 18px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: max-width 0.3s cubic-bezier(0.4,0,0.2,1),
              max-height 0.3s cubic-bezier(0.4,0,0.2,1),
              border-radius 0.3s cubic-bezier(0.4,0,0.2,1),
              height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.ram-container--fullscreen {
  max-width: none;
  max-height: none;
  height: 100dvh;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.ram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid #F1F5F9;
  background: #FFFFFF;
  flex-shrink: 0;
}

.ram-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ram-phase-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #EEF4FF;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ram-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ram-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.ram-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ram-badge-alerts {
  background: #FEE2E2;
  color: #DC2626;
}

.ram-badge-geosnap {
  background: #ECFDF5;
  color: #047857;
}

.ram-subline {
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  color: #64748B;
}

.ram-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ram-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: background 0.12s ease;
}

.ram-btn-secondary:hover {
  background: #F1F5F9;
}

.ram-btn-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #F1F5F9;
  border: none;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.12s ease, color 0.12s ease;
}

.ram-btn-close:hover {
  background: #FEE2E2;
  color: #DC2626;
}

.ram-body {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #EEF1F6;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ram-left-col {
  display: grid;
  grid-template-rows: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.ram-right-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ram-panel {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.ram-panel-a {
  background: #000000;
  color: #F8FAFC;
  border-color: #1E293B;
}

.ram-panel-a-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ram-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3B5BFD;
  box-shadow: 0 0 8px #3B5BFD;
}

.ram-panel-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #F8FAFC;
}

.ram-panel-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #94A3B8;
  margin-left: 6px;
}

.ram-view-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px;
  border-radius: 7px;
  gap: 2px;
}

.ram-tab-btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: #94A3B8;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.ram-tab-btn.active {
  background: #3B5BFD;
  color: #FFFFFF;
}

.ram-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

#ram-3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ram-video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
  pointer-events: none;
}

/* Forcefully hide native video controls at CSS level */
.ram-video-element::-webkit-media-controls,
.ram-video-element::-webkit-media-controls-enclosure,
.ram-video-element::-webkit-media-controls-panel {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.ram-stub-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94A3B8;
  font-size: 13px;
  font-weight: 600;
  z-index: 5;
}

.ram-stub-overlay i {
  font-size: 28px;
  color: #3B5BFD;
}

/* Controls are now .ram-controls-overlay inside .ram-viewport */
.ram-panel-a-controls { display: none; }

.ram-width-readout {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}

.ram-width-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 800;
  color: #EF4444;
}

.ram-width-lbl {
  color: #94A3B8;
  font-size: 11.5px;
}

.ram-width-sep {
  color: #64748B;
}

.ram-width-req {
  font-family: 'JetBrains Mono', monospace;
  color: #94A3B8;
  font-size: 11.5px;
}

.ram-legend-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  font-size: 11px;
  color: #CBD5E1;
}

.ram-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ram-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.ram-swatch.green { background: #10B981; }
.ram-swatch.amber { background: #F59E0B; }
.ram-swatch.red   { background: #EF4444; }

.ram-scrub-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ram-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3B5BFD;
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.12s ease, background 0.12s ease;
}

.ram-play-btn:hover {
  transform: scale(1.06);
  background: #2563EB;
}

.ram-slider-wrap {
  position: relative;
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
}

.ram-track-gradient {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #10B981 0%, #10B981 40%, #F59E0B 40%, #F59E0B 65%, #EF4444 65%, #EF4444 85%, #10B981 85%, #10B981 100%);
  pointer-events: none;
}

.ram-slider {
  width: 100%;
  height: 6px;
  background: transparent;
  cursor: pointer;
  accent-color: #3B5BFD;
  z-index: 2;
}

.ram-chainage-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #F8FAFC;
  min-width: 80px;
  text-align: right;
}

/* Panel C: Road Width Alerts Table */
.ram-panel-c-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #F1F5F9;
  background: #FFFFFF;
}

.ram-panel-c-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: #0F172A;
}

.ram-count-chip {
  background: #FEE2E2;
  color: #DC2626;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.ram-filter-chips {
  display: flex;
  gap: 4px;
}

.ram-chip {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #64748B;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.ram-chip.active {
  background: #3B5BFD;
  border-color: #3B5BFD;
  color: #FFFFFF;
}

/* ── Panel C Flex Body (Table + Right Alert Image Panel) ── */
.ram-panel-c-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.ram-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  min-width: 0;
  transition: flex 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Right Alert Image Panel */
.ram-alert-img-panel {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid #E2E8F0;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.04);
  z-index: 5;
  transition: all 0.25s ease;
}

.ram-alert-img-panel.hidden {
  display: none !important;
}

.ram-img-panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
}

.ram-img-panel-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.01em;
}

.ram-img-panel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ram-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.12s ease;
}

.ram-nav-btn:hover:not(:disabled) {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

.ram-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ram-img-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  padding: 0 4px;
  min-width: 48px;
  text-align: center;
}

.ram-img-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: #F1F5F9;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  margin-left: 4px;
  transition: all 0.12s ease;
}

.ram-img-close-btn:hover {
  background: #FEE2E2;
  color: #DC2626;
}

.ram-img-panel-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ram-img-card {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  background: #0F172A;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ram-img-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ram-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ram-img-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94A3B8;
  font-size: 12px;
  padding: 24px;
}

.ram-img-tag-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
}

.ram-img-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(220, 38, 38, 0.92);
  color: #FFFFFF;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

.ram-img-panel-footer {
  padding: 10px 12px;
  border-top: 1px solid #F1F5F9;
  background: #FFFFFF;
}

.ram-btn-fullres {
  width: 100%;
  padding: 8.5px 14px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.12s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.ram-btn-fullres:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #3B5BFD;
}

.ram-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ram-table th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  color: #64748B;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #E2E8F0;
  z-index: 2;
}

.ram-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #F1F5F9;
  color: #0F172A;
  vertical-align: middle;
}

.ram-table tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.ram-table tr:hover {
  background: #F8FAFC;
}

.ram-table tr.active-row {
  background: #EFF6FF !important;
  box-shadow: inset 3px 0 0 #3B5BFD;
}

.ram-sev-bar { border-left: none; }

.ram-snap-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.12s ease;
}
.ram-snap-btn:hover {
  background: #3B5BFD;
  border-color: #3B5BFD;
  color: #FFFFFF;
}

.ram-ch-col {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.ram-finding-title {
  font-weight: 700;
  color: #0F172A;
}

.ram-finding-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #94A3B8;
  margin-top: 2px;
}

.ram-meas-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.ram-meas-val.critical { color: #EF4444; }
.ram-meas-val.high     { color: #F97316; }
.ram-meas-val.medium   { color: #F59E0B; }

.ram-req-val {
  font-family: 'JetBrains Mono', monospace;
  color: #94A3B8;
}

.ram-sev-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.ram-sev-pill.critical { background: #FEE2E2; color: #DC2626; border: 1px solid #FCA5A5; }
.ram-sev-pill.high     { background: #FFEDD5; color: #C2410C; border: 1px solid #FDBA74; }
.ram-sev-pill.medium   { background: #FEF3C7; color: #B45309; border: 1px solid #FCD34D; }

/* Panel B: Route Map */
.ram-panel-b {
  height: 100%;
}

.ram-panel-b-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #F1F5F9;
  background: #FFFFFF;
}

.ram-map-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: #0F172A;
}

.ram-map-coords {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #94A3B8;
  margin-top: 2px;
}

.ram-map-toggles {
  display: flex;
  background: #F1F5F9;
  padding: 2px;
  border-radius: 7px;
  gap: 2px;
}

.ram-map-btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: #64748B;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.ram-map-btn.active {
  background: #2563EB;
  color: #FFFFFF;
}

.ram-map-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #E2E8F0;
}

.ram-map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  z-index: 1000;
  font-size: 11px;
}

.ram-map-legend-title {
  font-size: 10px;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ram-map-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  margin-bottom: 3px;
  font-weight: 600;
}

.ram-legend-km {
  font-family: 'JetBrains Mono', monospace;
  color: #64748B;
  margin-left: 6px;
}

.ram-map-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 10px 14px;
  background: #FFFFFF;
  border-top: 1px solid #F1F5F9;
}

.ram-metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ram-metric-lbl {
  font-size: 10px;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.05em;
}

.ram-metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
}

.ram-metric-val.red {
  color: #EF4444;
}

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬
   PROCESSED UX REWORK STYLES (FIVE-SLOT MODEL STRIP & LEGEND)
   ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */

/* Header Model Legend Bar */
.pp2-legend-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 8px 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pp2-legend-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94A3B8;
  text-transform: uppercase;
}

.pp2-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.pp2-legend-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.pp2-legend-icon.roller     { background: #ECFEFF; color: #0891B2; }
.pp2-legend-icon.grader     { background: #F5F3FF; color: #7C3AED; }
.pp2-legend-icon.spreader   { background: #FFFBEB; color: #B45309; }
.pp2-legend-icon.utilities  { background: #F0FDFA; color: #0F766E; }
.pp2-legend-icon.roadwidth  { background: #EEF4FF; color: #2563EB; }
.pp2-legend-icon.empty      { background: #FFFFFF; border: 1px dashed #DBE2EC; color: #CBD5E1; }

.pp2-legend-item.not-run {
  background: transparent;
  border: 1px dashed #DBE2EC;
  color: #64748B;
}

/* Stacked Full-Width Section Layout (Segmentation on top, GeoSnap at bottom) */
.pp2-lanes {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  width: 100% !important;
}

.pp2-item-list {
  max-height: 470px !important;
  overflow-y: auto !important;
}

/* Row Anatomy & Multi-Column Items */
.pp2-item {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 12px 18px !important;
  border-bottom: 1px solid #F1F5F9 !important;
  background: #FFFFFF !important;
  border-left: none !important;
  box-shadow: none !important;
  transition: background 0.12s ease;
}

.pp2-item:hover {
  background: #F8FAFC !important;
}

.pp2-col-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 180px;
}

.pp2-identity-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp2-identity-sub {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.pp2-col-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pp2-col-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #94A3B8;
  text-transform: uppercase;
}

.pp2-col-val {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp2-col-val.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #64748B;
}

/* 40x40 Phase Tile (Radius 11) */
.pp2-thumb {
  width: 40px !important;
  height: 40px !important;
  border-radius: 11px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  flex-shrink: 0 !important;
}

.pp2-thumb.phase-pre {
  background: #EEF4FF !important;
  color: #2563EB !important;
}

.pp2-thumb.phase-during {
  background: #FFF7ED !important;
  color: #C2410C !important;
}

.pp2-thumb.phase-post {
  background: #ECFDF5 !important;
  color: #047857 !important;
}

.pp2-thumb.phase-unknown {
  background: #F1F5F9 !important;
  color: #64748B !important;
}

/* Phase Chip in Meta Line */
.pp2-phase-chip {
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 6px;
  display: inline-block;
}

.pp2-phase-chip.phase-pre { background: #EEF4FF; color: #2563EB; }
.pp2-phase-chip.phase-during { background: #FFF7ED; color: #C2410C; }
.pp2-phase-chip.phase-post { background: #ECFDF5; color: #047857; }

/* Fixed Five-Slot Model Strip */
.pp2-model-strip-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.pp2-model-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: #F8FAFC;
  border: 1px solid #EEF1F6;
  border-radius: 20px;
}

.pp2-model-slot {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* Available Slot Colors */
.pp2-legend-icon.reclaimer  { background: #F5F3FF; color: #7C3AED; }
.pp2-legend-icon.defects    { background: #FFE4E6; color: #E11D48; }

.pp2-model-slot.slot-roller.avail   { background: #ECFEFF; color: #0891B2; cursor: pointer; }
.pp2-model-slot.slot-reclaimer.avail{ background: #F5F3FF; color: #7C3AED; cursor: pointer; }
.pp2-model-slot.slot-spreader.avail { background: #FFFBEB; color: #B45309; cursor: pointer; }
.pp2-model-slot.slot-roadwidth.avail{ background: #EEF4FF; color: #2563EB; cursor: pointer; }
.pp2-model-slot.slot-utilities.avail{ background: #F0FDFA; color: #0F766E; cursor: pointer; }
.pp2-model-slot.slot-defects.avail  { background: #FFE4E6; color: #E11D48; cursor: pointer; }

.pp2-model-slot.avail:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Not Run Slot */
.pp2-model-slot.not-run {
  background: #FFFFFF;
  border: 1px dashed #DBE2EC;
  color: #CBD5E1;
  opacity: 0.65;
  cursor: default;
}

/* 7px Red Alert Dot */
.pp2-alert-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 7px;
  height: 7px;
  background: #EF4444;
  border: 1.5px solid #FFFFFF;
  border-radius: 50%;
}

/* n / 5 Counter */
.pp2-model-cnt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  min-width: 32px;
}

.pp2-model-cnt.muted {
  color: #94A3B8;
}

/* Pagination Footer */
.pp2-lane-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #FFFFFF;
  border-top: 1px solid #F1F5F9;
}

.pp2-range-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
}

.pp2-pager-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pp2-rows-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 0.05em;
}

.pp2-rows-select {
  padding: 3px 8px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  background: #FFFFFF;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.pp2-page-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pp2-page-num {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pp2-page-num.active {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

.pp2-page-num:disabled {
  color: #CBD5E1;
  border-color: #F1F5F9;
  cursor: not-allowed;
}

/* How to read a row card */
.pp2-read-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 16px;
}

.pp2-read-title {
  margin: 0 0 6px 0;
  font-size: 13.5px;
  font-weight: 800;
  color: #0F172A;
}

.pp2-read-desc {
  margin: 0;
  font-size: 12px;
  color: #64748B;
  line-height: 1.5;
}

/* Video Stream Processing Placeholder */
.ram-video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  padding: 24px;
}

.ram-placeholder-content {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 580px;
}

.ram-placeholder-graphic {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ram-placeholder-icon {
  font-size: 28px;
  color: #38BDF8;
}

.ram-placeholder-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ram-placeholder-badge {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #38BDF8;
  text-transform: uppercase;
}

.ram-placeholder-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #F8FAFC;
}

.ram-placeholder-desc {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.45;
}

.ram-placeholder-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ram-ph-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
}

.ram-ph-lbl {
  font-weight: 700;
  color: #64748B;
}

.ram-ph-val {
  color: #E2E8F0;
  font-weight: 600;
}

.ram-ph-status {
  color: #38BDF8;
  font-weight: 700;
}

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ Loading state: shown while video stream is buffering ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
@keyframes ram-spin {
  to { transform: rotate(360deg); }
}

@keyframes ram-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50%       { opacity: 1;   transform: scale(1.05); }
}

.ram-placeholder-pulse {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  animation: ram-pulse 2s ease-in-out infinite;
  background: radial-gradient(circle at center, rgba(56,189,248,0.12), transparent 70%);
}

/* Spinning ring shown only in ram-loading mode */
.ram-loading-ring {
  display: none;
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  border: 2.5px solid transparent;
  border-top-color: #3B82F6;
  border-right-color: rgba(59,130,246,0.3);
  animation: ram-spin 0.9s linear infinite;
  pointer-events: none;
}

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ ram-loading state overrides ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
.ram-video-placeholder.ram-loading .ram-loading-ring {
  display: block;
}
.ram-video-placeholder.ram-loading .ram-placeholder-graphic {
  border-color: rgba(59,130,246,0.4);
  background: rgba(15,23,42,0.9);
}
.ram-video-placeholder.ram-loading .ram-placeholder-pulse {
  background: radial-gradient(circle at center, rgba(59,130,246,0.18), transparent 70%);
}
.ram-video-placeholder.ram-loading .ram-placeholder-icon {
  color: #60A5FA;
  font-size: 22px;
}
.ram-video-placeholder.ram-loading .ram-placeholder-badge {
  color: #60A5FA;
}
.ram-video-placeholder.ram-loading .ram-placeholder-title {
  color: #BAE6FD;
}
.ram-video-placeholder.ram-loading .ram-ph-status {
  color: #60A5FA;
}

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ No GPS Track overlay ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
.ram-no-gps-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(6px);
  z-index: 500;
  pointer-events: none;
}
.ram-no-gps-icon { font-size: 38px; color: #475569; }
.ram-no-gps-title { font-size: 14px; font-weight: 800; color: #CBD5E1; letter-spacing: 0.01em; }
.ram-no-gps-desc { font-size: 11.5px; color: #64748B; text-align: center; max-width: 220px; line-height: 1.55; }

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ Map GPS loading spinner overlay ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
.ram-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 600;
  color: #94A3B8;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}
.ram-map-loading i { font-size: 18px; color: #10B981; }

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ GPS availability badge in AI Workflow table rows ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
.pp2-gps-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.pp2-gps-badge.has-gps { background: #F0FDF4; border: 1px solid #DCFCE7; color: #16A34A; }
.pp2-gps-badge.no-gps  { background: #F8FAFC; border: 1px solid #E2E8F0; color: #94A3B8; }

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ Defect frame image overlay (shown over map on row click) ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
.ram-defect-img-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #0F172A;
  z-index: 800;
  animation: ram-fade-in 0.2s ease;
}
@keyframes ram-fade-in { from { opacity:0; transform:scale(0.97); } to { opacity:1; transform:scale(1); } }
.ram-defect-img-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ram-defect-img-label {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.ram-defect-img-close {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 6px;
  color: #94A3B8;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}
.ram-defect-img-close:hover { background: rgba(255,255,255,0.16); color: #F1F5F9; }
.ram-defect-img-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ram-defect-img-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 10.5px;
  color: #64748B;
  flex-shrink: 0;
}

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ Leaflet defect marker tooltip ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
.ram-defect-tooltip {
  background: rgba(15, 23, 42, 0.9) !important;
  border: none !important;
  border-radius: 6px !important;
  color: #F1F5F9 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 8px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}
.ram-defect-tooltip::before { display: none !important; }

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ Active finding row highlight ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
#ram-alerts-tbody tr.active-row { background: #EFF6FF !important; }
#ram-alerts-tbody tr:hover { background: #F8FAFC; }

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ True browser fullscreen via Fullscreen API ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
/* When the overlay IS the fullscreen element, fill it completely */
#road-analysis-modal:fullscreen,
#road-analysis-modal:-webkit-full-screen,
#road-analysis-modal:-moz-full-screen {
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  background: #0F172A !important;
}
#road-analysis-modal:fullscreen .ram-container,
#road-analysis-modal:-webkit-full-screen .ram-container,
#road-analysis-modal:-moz-full-screen .ram-container {
  max-width: none !important;
  max-height: none !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  flex: 1 !important;
}

/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ Fullscreen: force overlay + container to fill the fullscreen root 100% ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
.ram-overlay--fullscreen {
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  height: 100% !important;
  width: 100% !important;
}


/* Ã¢â€â‚¬Ã¢â€â‚¬ Minimal hover-reveal video controls overlay Ã¢â€â‚¬Ã¢â€â‚¬ */
.ram-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 10;
}

/* Show on hover over the viewport */
.ram-viewport:hover .ram-controls-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Also show when playing (so user can pause) */
.ram-viewport.ram-is-playing .ram-controls-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Fade out 2 s after play starts Ã¢â‚¬â€ handle via JS class toggle */
.ram-viewport.ram-autoplay-hide .ram-controls-overlay {
  opacity: 0;
  pointer-events: none;
}





.ram-map-legend { display: none !important; }



/* ── Driver Location GPS Beacon (Glowing Blue & White with Pulsing Rays) ── */
.ram-driver-beacon-marker {
  z-index: 10000 !important;
  pointer-events: none;
}

.ram-driver-beacon-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulsing outer radiating rays ring 1 */
.ram-driver-beacon-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 220, 255, 0.65) 0%, rgba(0, 82, 255, 0.35) 50%, rgba(0, 82, 255, 0) 75%);
  animation: ramBeaconPulse 1.8s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
  pointer-events: none;
}

/* Pulsing outer radiating rays ring 2 (staggered delay) */
.ram-driver-beacon-pulse-secondary {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 162, 255, 0.5) 0%, rgba(0, 82, 255, 0.2) 60%, rgba(0, 82, 255, 0) 80%);
  animation: ramBeaconPulse 1.8s infinite cubic-bezier(0.215, 0.61, 0.355, 1) 0.6s;
  pointer-events: none;
}

/* Inner deep blue core with crisp white border and intense glow */
.ram-driver-beacon-core {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00A6FF 0%, #0044FF 100%);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 0 12px #00F0FF, 0 0 24px rgba(0, 82, 255, 0.9), inset 0 0 4px #FFFFFF;
  z-index: 2;
}

@keyframes ramBeaconPulse {
  0% {
    transform: scale(0.4);
    opacity: 1;
  }
  70% {
    transform: scale(1.7);
    opacity: 0.35;
  }
  100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

/* ── Bottom-Left Minimap Overview Box (Picture-in-Picture) ── */
.ram-minimap-box {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 145px;
  height: 115px;
  z-index: 1000;
  border-radius: 10px;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  background: #0F172A;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ram-minimap-box:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.ram-minimap-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1002;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.85);
  color: #F8FAFC;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════════════════════════════════
   PHASE 2 — MOBILE CAMERA DETAIL SCREEN  (light theme)
   ══════════════════════════════════════════════════════════════════════ */

/* ── Keyframe Animations ── */
@keyframes mcd-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes mcd-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes mcd-swipe-hint {
  0%   { transform: translateX(0);     opacity: 0.7; }
  50%  { transform: translateX(-10px); opacity: 1;   }
  100% { transform: translateX(0);     opacity: 0.7; }
}

/* ── Live dot pulse ── */
.mcd-topbar-dot {
  animation: mcd-pulse 1.5s ease-in-out infinite;
}

/* ── Camera Detail Full-Screen Overlay ── */
/* Hidden by default — JS sets display:flex + opacity:1 on open */
.mobile-cam-detail {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  flex-direction: column;
  background: #ffffff;   /* light — matches app chrome */
  overflow: hidden;
  opacity: 0;
}

/* ─── Zone 1: Top Bar ─────────────────────────────────────── */
.mcd-topbar {
  height: 48px;
  min-height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
  z-index: 5;
}

.mcd-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f3f4f6;
  border: none;
  border-radius: 20px;
  padding: 5px 10px 5px 8px;
  cursor: pointer;
  color: #374151;
  font-size: 11px;
  font-weight: 600;
  font-family: -apple-system, system-ui, sans-serif;
  line-height: 1;
  transition: background 0.15s ease;
}

.mcd-back-btn svg {
  stroke: #374151 !important;
}

.mcd-back-btn:active {
  background: #e5e7eb;
}

.mcd-title-block {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mcd-topbar-dot {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
  flex-shrink: 0;
}

.mcd-cam-name-label {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  font-family: -apple-system, system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.mcd-more-btn {
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.mcd-more-btn svg {
  stroke: #374151 !important;
}

.mcd-more-btn svg circle {
  fill: #374151 !important;
}

.mcd-more-btn:active {
  background: #e5e7eb;
}

/* ─── Zone 2: Live Feed (stays dark — it's video) ─────────── */
.mcd-feed-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #1a1a2e;  /* dark but slightly warmer than pure black */
}

.mcd-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Offline overlay — light inside the feed */
.mcd-offline-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f5f6f8;  /* matches grid tile background */
}

.mcd-offline-overlay.hidden {
  display: none;
}

.mcd-offline-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ef4444;
  font-family: -apple-system, system-ui, sans-serif;
}

.mcd-offline-sub {
  font-size: 10px;
  color: #9ca3af;
  font-family: 'JetBrains Mono', monospace;
}

/* Top-left camera info overlay — keep semi-dark pill over video */
.mcd-feed-info-tl {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.mcd-feed-sub {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  font-family: -apple-system, system-ui, sans-serif;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(0,0,0,0.35);
  padding: 1px 5px;
  border-radius: 3px;
}

.mcd-feed-res {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-family: -apple-system, system-ui, sans-serif;
  background: rgba(0,0,0,0.25);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Top-right timestamp pill — stays dark over video */
.mcd-feed-ts-pill {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}

/* Left / Right Navigation Arrows */
.mcd-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
}

.mcd-nav-left {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.4), transparent);
}

.mcd-nav-right {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,0.4), transparent);
  animation: mcd-swipe-hint 2s ease-in-out infinite;
}

.mcd-nav-right.hinted {
  animation: none;
}

/* Dot Pagination */
.mcd-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  align-items: center;
  z-index: 4;
  pointer-events: none;
}

.mcd-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: all 200ms ease;
}

.mcd-dot-active {
  width: 16px;
  height: 4px;
  border-radius: 2px;
  background: #ffffff;
}

/* Swipe hint */
.mcd-swipe-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 4px 10px;
  pointer-events: none;
}

.mcd-swipe-hint span {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  font-family: -apple-system, system-ui, sans-serif;
  white-space: nowrap;
}

/* ─── Zone 3: Action Bar ──────────────────────────────────── */
.mcd-action-bar {
  height: 72px;
  min-height: 72px;
  flex-shrink: 0;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 10px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.mcd-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mcd-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background 0.15s ease;
}

.mcd-action-btn:active .mcd-action-icon {
  transform: scale(0.92);
}

.mcd-action-label {
  font-size: 9px;
  color: #6b7280;
  font-family: -apple-system, system-ui, sans-serif;
  font-weight: 500;
}

/* Record pulse when active */
.mcd-record-icon.recording {
  animation: mcd-pulse 1s ease-in-out infinite;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

/* ─── Zone 4: Filmstrip ───────────────────────────────────── */
.mcd-filmstrip {
  height: 88px;
  min-height: 88px;
  flex-shrink: 0;
  background: #f9fafb;  /* light grey — matches grid background */
  border-top: 1px solid #e5e7eb;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.mcd-filmstrip-label {
  font-size: 9px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: -apple-system, system-ui, sans-serif;
  flex-shrink: 0;
}

.mcd-filmstrip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  align-items: center;
  scrollbar-width: none;
}

.mcd-filmstrip-row::-webkit-scrollbar {
  display: none;
}

.mcd-thumb {
  width: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1.5px solid #e5e7eb;
  transition: border-color 0.15s ease;
}

.mcd-thumb-active {
  border: 2px solid #4f46e5;
}

.mcd-thumb-img {
  aspect-ratio: 16 / 10;
  background: #e5e7eb;  /* light placeholder */
  width: 100%;
}

.mcd-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 3px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 7px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: -apple-system, system-ui, sans-serif;
}

/* ── Tile grid: expand icon overlay (mobile only) ── */
.mpx-mobile-expand-icon {
  display: none; /* hidden on desktop */
}

/* ── Selected tile highlight ── */
.mpx-tile-selected {
  /* Applied by JS */
}

/* ── Mobile-only styles (≤ 580px) ── */
@media (max-width: 580px) {
  /* Show expand icon on each tile */
  .mpx-mobile-expand-icon {
    display: flex;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  /* Selected tile */
  .mpx-tile-selected {
    border: 2px solid #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
  }

  /* Hide desktop hover controls on mobile */
  .mpx-ctrls {
    display: none !important;
  }

  /* Detail screen bottom nav clears the mobile bottom tab bar */
  .mobile-cam-detail {
    bottom: 0;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   PHASE 3 — CAMERA SELECTION PANEL
   ══════════════════════════════════════════════════════════════════════ */

/* ── Mobile "Add Camera" slot ── */
@media (max-width: 580px) {
  .mpx-add-cam-tile {
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    border: 1.5px dashed #4f46e5;
    background: #f5f3ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .mpx-add-cam-tile:active {
    background: #ede9fe;
  }

  .mpx-add-cam-ring {
    width: 22px;
    height: 22px;
    border: 1.5px solid #4f46e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mpx-add-cam-label {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #4f46e5;
    font-family: -apple-system, system-ui, sans-serif;
  }
}

/* ── Backdrop scrim ── */
.cam-panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 205;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.cam-panel-backdrop.csp-active {
  display: block;
  pointer-events: auto;
}

/* ── Panel container (iOS height fix: top:0 + bottom:0, NOT height:100%) ── */
.cam-select-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 88%;
  max-width: 360px;
  z-index: 210;
  background: #ffffff;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
}

.cam-select-panel.csp-visible {
  display: flex;
}

.cam-select-panel.csp-open {
  transform: translateX(0);
}

/* ── Header ── */
.csp-header {
  flex-shrink: 0;
  padding-top: 54px;
  padding: 54px 14px 0;
  background: #fff;
}

/* Title row */
.csp-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.csp-title {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  font-family: -apple-system, system-ui, sans-serif;
}

.csp-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* View toggle pill */
.csp-view-toggle {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.csp-toggle-btn {
  padding: 5px 8px;
  background: #f3f4f6;
  border: none;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.csp-toggle-btn.csp-toggle-active {
  background: #111827;
  color: #ffffff;
}

/* Icon buttons (+, <) */
.csp-icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.csp-icon-btn:active {
  background: #f3f4f6;
}

/* Search bar */
.csp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}

.csp-search.csp-search-focused {
  border-color: #4f46e5;
}

.csp-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #111827;
  font-family: -apple-system, system-ui, sans-serif;
  outline: none;
}

.csp-search-input::placeholder {
  color: #9ca3af;
}

/* Section label */
.csp-section-label {
  font-size: 12px;
  font-weight: 600;
  color: #4f46e5;
  padding-bottom: 6px;
  border-bottom: 1px solid #f3f4f6;
  font-family: -apple-system, system-ui, sans-serif;
}

/* ── Scrollable list ── */
.csp-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.csp-list::-webkit-scrollbar {
  display: none;
}

/* ── Flat view rows ── */
.csp-flat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.1s ease;
}

.csp-flat-row:active {
  background: #f9fafb;
}

.csp-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}

.csp-flat-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.csp-flat-info {
  flex: 1;
  min-width: 0;
}

.csp-flat-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  font-family: -apple-system, system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csp-flat-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
  font-family: -apple-system, system-ui, sans-serif;
}

/* ── Tree view rows ── */
.csp-tree-row {
  display: flex;
  align-items: flex-start;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid #f9fafb;
  cursor: pointer;
  transition: background 0.1s ease;
  position: relative;
}

.csp-tree-row:active {
  background: #f9fafb;
}

/* Depth indentation via padding-left (set inline by JS) */
.csp-tree-chevron {
  width: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.csp-tree-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 6px;
  margin-top: 3px;
}

.csp-tree-icon {
  flex-shrink: 0;
  margin-right: 8px;
  margin-top: 1px;
}

.csp-tree-info {
  flex: 1;
  min-width: 0;
}

.csp-tree-label {
  font-size: 13px;
  color: #111827;
  font-family: -apple-system, system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csp-tree-label-org {
  font-weight: 700;
}

.csp-tree-label-other {
  font-weight: 500;
}

.csp-tree-meta {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 1px;
  font-family: -apple-system, system-ui, sans-serif;
}

.csp-tree-ch {
  font-size: 11px;
  color: #9ca3af;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1px;
}

/* Add button (cameras only) */
.csp-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #4f46e5;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  transition: background 0.15s ease;
}

.csp-add-btn:active {
  background: #f5f3ff;
}

/* ── Footer ── */
.csp-footer {
  flex-shrink: 0;
  padding: 10px 16px 20px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.csp-footer-count {
  font-size: 12px;
  color: #9ca3af;
  font-family: -apple-system, system-ui, sans-serif;
}

.csp-send-btn {
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  font-family: -apple-system, system-ui, sans-serif;
  transition: background 0.15s ease;
}

.csp-send-btn:active {
  background: #374151;
}

/* Hide send button in tree view */
.csp-send-btn.csp-hidden {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════════
   PHASE 3.1 — REMOVE FROM WALL
   ══════════════════════════════════════════════════════════════════════ */

/* ── Mobile × remove badge on camera tiles ── */
.mpx-mobile-remove-btn {
  display: none; /* hidden on desktop */
}

@media (max-width: 580px) {
  .mpx-mobile-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease;
  }

  .mpx-mobile-remove-btn:active {
    background: rgba(239, 68, 68, 0.85);
  }
}

/* ── Camera Detail action sheet (More menu) ── */
.mcd-action-sheet {
  display: none;
  position: fixed;          /* fixed so it escapes any overflow:hidden ancestors */
  top: 56px;                /* will be overridden by JS to sit below the ⋯ button */
  right: 12px;
  z-index: 9999;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  min-width: 210px;
  flex-direction: column;
  border: 1px solid #f3f4f6;
  animation: cspSheetIn 0.15s ease;
}

@keyframes cspSheetIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.mcd-action-sheet.mcd-sheet-open {
  display: flex;
}

.mcd-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  font-family: -apple-system, system-ui, sans-serif;
  text-align: left;
  width: 100%;
  transition: background 0.12s ease;
}

.mcd-action-item:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

.mcd-action-item:active {
  background: #f9fafb;
}

.mcd-action-danger {
  color: #ef4444;
}

/* Topbar needs relative positioning for the sheet to anchor */
.mcd-topbar {
  position: relative;
}

/* ── Sheet backdrop (dims the detail screen behind the menu) ── */
.mcd-sheet-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  background: transparent;
}

.mcd-sheet-backdrop.mcd-sheet-open {
  display: block;
}

/* ── Mobile Camera Panel Tree Helpers ── */
.csp-chevron {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.csp-chevron-spacer {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex-shrink: 0;
}

.csp-no-results {
  padding: 24px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
