:root {
  color-scheme: light;
  --ground: #F2F4F7;
  --surface: #FFFFFF;
  --surface-2: #E9EDF4;
  --ink: #111827;
  --muted: #475467;
  --border: #667085;
  --border-soft: #D0D5DD;
  --accent: #1D4ED8;
  --accent-ink: #FFFFFF;
  --accent-tint: #E8EFFE;
  --success: #14532D;
  --success-tint: #E7F4EB;
  --danger: #7F1D1D;
  --danger-tint: #FDECEC;
  --player: #080C14;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --step-1: 12px;
  --step-2: 14px;
  --step-3: 16px;
  --step-4: 20px;
  --step-5: 30px;
  --step-6: 40px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0F141D;
  --surface: #171F2C;
  --surface-2: #1D2736;
  --ink: #F3F6FA;
  --muted: #A3B1C6;
  --border: #6B7B94;
  --border-soft: #334155;
  --accent: #60A5FA;
  --accent-ink: #0B1220;
  --accent-tint: #172B44;
  --success: #86EFAC;
  --success-tint: #132B1E;
  --danger: #FCA5A5;
  --danger-tint: #32171A;
  --player: #05070B;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--step-3);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
[role="button"] {
  cursor: pointer;
}

button:disabled,
a[aria-disabled="true"] {
  cursor: not-allowed;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

img,
video {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.mono,
kbd,
.tab-badge,
.modal-code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.topbar.scrolled {
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-weight: 800;
  font-size: var(--step-3);
  letter-spacing: -0.01em;
}

.brand-sub {
  color: var(--muted);
  font-size: var(--step-1);
  font-weight: 500;
}

.view-switcher {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  background: var(--surface);
}

.view-tab {
  position: relative;
  z-index: 1;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: var(--step-2);
  border-radius: var(--radius-sm);
}

.view-tab.active {
  color: var(--accent);
}

.view-tab:hover {
  background: var(--surface-2);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.view-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  z-index: 0;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  transition: width 150ms ease, transform 150ms ease;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telemetry-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: max-content;
  font-size: var(--step-1);
}

.weather-icon {
  display: none;
}

.telemetry-label {
  color: var(--muted);
  font-weight: 600;
}

.telemetry-value {
  color: var(--ink);
  font-weight: 700;
  font-size: var(--step-2);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn:active {
  transform: translateY(1px);
}

.close-btn {
  color: var(--danger);
}

.masthead {
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}

.masthead-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  padding: 40px 0 36px;
  align-items: end;
}

.source-line {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--step-1);
  font-weight: 600;
}

.masthead h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.masthead-desc {
  max-width: 62ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: var(--step-3);
}

.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: var(--step-2);
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent);
  filter: brightness(0.94);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-tint);
}

.status-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: 16px;
}

.status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
}

.status-key {
  color: var(--muted);
  font-size: var(--step-2);
  font-weight: 600;
}

.status-value {
  color: var(--ink);
  font-size: var(--step-4);
}

.status-note {
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.45;
}

.status-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--border-soft);
}

.control-dock {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.control-dock > .container {
  padding: 20px 0 16px;
}

.control-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: var(--step-1);
  font-weight: 700;
}

.search-field {
  flex: 1 1 520px;
  min-width: 0;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.search-input-wrap:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: 0 0 20px;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--step-3);
}

.search-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search-clear {
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 700;
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn.spinning {
  opacity: 0.7;
}

.filter-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-2);
  font-weight: 700;
}

.filter-btn:hover {
  background: var(--surface-2);
}

.filter-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.filter-count {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-align: center;
}

.area-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.area-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 600;
}

.area-pill:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.area-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}


.workspace-section {
  padding: 32px 0 48px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-size: var(--step-4);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--step-2);
}

.sort-wrap {
  min-width: 200px;
}

.sort-select,
.mv-select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-2);
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.loading-state {
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.cam-card {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 126px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.cam-card:hover {
  border-color: var(--border);
}

.cam-card.in-view {
  animation: card-in 180ms ease both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.cam-thumb-wrap {
  position: relative;
  min-height: 126px;
  background: var(--surface-2);
  overflow: hidden;
}

.cam-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-thumb-grad {
  position: absolute;
  inset: 0 0 auto 0;
  height: 42px;
  background: rgba(8, 12, 20, 0.62);
}

.cam-corner {
  display: none;
}

.cam-top-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 20, 0.8);
  color: #F3F6FA;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FCD34D;
}

.status-badge.online .dot {
  background: #4ADE80;
}

.status-badge.offline .dot {
  background: #FCA5A5;
}

.cam-code {
  color: #F3F6FA;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.cam-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(8, 12, 20, 0.28);
  transition: opacity 150ms ease;
}

.cam-thumb-wrap:hover .cam-play-overlay,
.cam-thumb-wrap:focus-visible .cam-play-overlay {
  opacity: 1;
}

.play-circle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #FFFFFF;
  color: #111827;
}

.play-circle svg {
  width: 18px;
  height: 18px;
}

.cam-body {
  padding: 14px;
  min-width: 0;
}

.cam-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cam-area-tag {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cam-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  min-width: 36px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mini-btn:hover {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--ink);
}

.mini-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}

.mini-btn.fav-active {
  color: #B45309;
}

.mini-btn svg {
  width: 16px;
  height: 16px;
  margin: auto;
}

.cam-title {
  margin: 8px 0 4px;
  font-size: var(--step-3);
  line-height: 1.3;
  cursor: pointer;
}

.cam-title:hover {
  color: var(--accent);
}

.cam-landmark {
  margin: 0;
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.45;
}

.empty-state {
  padding: 40px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: var(--step-4);
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
}

.map-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.map-toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.map-counter {
  color: var(--muted);
  font-size: var(--step-1);
}

.map-quick-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jump-btn {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 600;
}

.jump-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}

.batam-map {
  width: 100%;
  height: min(68vh, 620px);
  min-height: 420px;
  background: var(--surface-2);
}

.cctv-marker-wrapper {
  background: transparent;
  border: 0;
}

.cctv-marker {
  position: relative;
  width: 24px;
  height: 24px;
}

.cctv-marker-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}

.cctv-marker-core {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.cctv-marker.offline .cctv-marker-ring {
  border-color: var(--danger);
}

.cctv-marker.offline .cctv-marker-core {
  background: var(--danger);
}

.leaflet-container {
  font-family: "Plus Jakarta Sans", sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 14px;
}

.map-popup img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.map-popup h4 {
  margin: 10px 0 4px;
  font-size: var(--step-3);
}

.map-popup p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--step-1);
}

.map-popup-actions {
  display: flex;
  gap: 6px;
}

.map-popup-btn {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--step-1);
  font-weight: 700;
}

.map-popup-btn.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

.multiview-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-btn {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 600;
}

.preset-btn.active {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.multiview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mv-tile {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.mv-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--player);
}

.mv-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mv-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 20, 0.82);
  color: #F3F6FA;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
}

.hud-badge.error {
  border-color: #FCA5A5;
  color: #FCA5A5;
}

.status-dot,
.pulse-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ADE80;
}

.hud-badge.error .status-dot,
.hud-badge.error .pulse-beacon {
  background: #FCA5A5;
}

.mv-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border-soft);
}

.mv-btn {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 700;
}

.mv-btn:hover {
  background: var(--surface-2);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 12, 20, 0.78);
}

.modal-shell {
  width: min(1080px, 100%);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-footer {
  align-items: flex-start;
  border-bottom: 0;
  border-top: 1px solid var(--border-soft);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.modal-code {
  min-width: 68px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: var(--step-1);
  font-weight: 600;
  text-align: center;
}

.modal-title {
  margin: 0;
  font-size: var(--step-3);
  line-height: 1.3;
}

.modal-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--step-1);
}

.modal-head-actions {
  display: flex;
  gap: 6px;
}

.player-stage {
  position: relative;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  background: var(--player);
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-hud-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.hud-telemetry {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 20, 0.82);
  color: #F3F6FA;
  font-size: 11px;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(8, 12, 20, 0.7);
  color: #F3F6FA;
  text-align: center;
}

.overlay-msg {
  margin: 0;
  font-size: var(--step-2);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(243, 246, 250, 0.35);
  border-top-color: #F3F6FA;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 700;
  text-decoration: none;
}

.tool-btn svg {
  width: 16px;
  height: 16px;
}

.tool-btn:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.tool-link {
  color: var(--accent);
}

.modal-coords {
  color: var(--muted);
  font-size: var(--step-1);
  white-space: nowrap;
}

.modal-nearby {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: var(--step-1);
}

.nearby-chip {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-1);
}

.nearby-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: var(--step-2);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(6px);
}

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

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

.footer-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.footer-left strong {
  font-size: var(--step-2);
}

.footer-left p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--step-1);
}

.footer-right {
  color: var(--muted);
  font-size: 11px;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
  text-align: center;
}

.spinning {
  pointer-events: none;
  opacity: 0.7;
}

.status-dot-sm {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.stat-card,
.hero,
.hero-media,
.hero-video,
.hero-overlay,
.hero-scanline,
.hero-radar,
.radar-ring,
.radar-sweep,
.hero-content,
.hero-badge,
.hero-title,
.gradient-text,
.hero-desc,
.hero-cta,
.hero-stats,
.stat-label,
.stat-value,
.stat-sub,
.bg-grid,
.bg-spotlight,
.empty-icon,
.reticle {
  display: none;
}

@media (max-width: 1024px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 12px 0;
    gap: 12px;
  }

  .view-switcher {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .view-tab {
    flex: 1;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .masthead-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0;
  }

  .status-panel {
    max-width: 520px;
  }

  .camera-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .brand-sub,
  .telemetry-block:first-child .telemetry-label {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .clock-block {
    display: none;
  }

  .masthead h1 {
    font-size: clamp(28px, 8vw, 34px);
  }

  .masthead-actions .btn {
    flex: 1 1 100%;
  }

  .control-top {
    align-items: stretch;
    flex-direction: column;
  }

  .control-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-actions .filter-btn:last-child {
    grid-column: 1 / -1;
  }

  .section-head,
  .map-toolbar,
  .multiview-header,
  .footer-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-wrap {
    min-width: 0;
  }

  .cam-card {
    grid-template-columns: 1fr;
  }

  .cam-thumb-wrap {
    min-height: 180px;
    aspect-ratio: 16 / 9;
  }

  .map-quick-jump {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batam-map {
    min-height: 420px;
  }

  .multiview-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal-shell {
    max-height: calc(100dvh - 16px);
  }

  .modal-header,
  .modal-footer,
  .modal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-head-actions {
    justify-content: flex-end;
  }

  .modal-toolbar .toolbar-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-nearby {
    justify-content: flex-start;
  }

  .player-stage {
    min-height: 220px;
  }
}

@media (max-width: 420px) {
  .brand-title {
    font-size: var(--step-2);
  }

  .view-tab {
    padding: 8px 6px;
    font-size: var(--step-1);
  }

  .telemetry-block:first-child {
    display: none;
  }

  .search-input::placeholder {
    font-size: var(--step-1);
  }

  .filter-btn {
    padding: 8px 10px;
  }

  .mv-bar {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
