.sv-view {
  --sv-link: #006b91;
  padding: 0 24px 28px;
}
[data-theme="dark"] .sv-view {
  --sv-link: #65ccf1;
}
@media (prefers-color-scheme: dark) {
  .sv-view { --sv-link: #65ccf1; }
}
[data-theme="light"] .sv-view { --sv-link: #006b91; }
.sv-shell {
  max-width: 1600px;
  margin: auto;
}
.sv-heading {
  padding: 10px 0 14px;
}
.sv-heading h1 {
  font-size: clamp(25px, 3vw, 40px);
  letter-spacing: -1.2px;
  margin: 3px 0 8px;
  line-height: 1.15;
}
.sv-heading p {
  max-width: 720px;
  color: var(--ink-2);
}
.sv-eyebrow {
  font-size: 10px !important;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 0 0 8px;
}
.sv-free {
  font-size: 10px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 0 6px;
  margin-left: auto;
}
.sv-nav-mark {
  font-size: 20px;
  width: 20px;
}
.sv-searchbar {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 10px 0 12px;
}
.sv-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.sv-searchbar input,
.sv-compare-inputs input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
}
.sv-searchbar button,
.sv-view button,
.sv-view select {
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 8px 11px;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
}
.sv-view button:hover,
.sv-view button:focus-visible {
  border-color: #1593bc;
  background: var(--bg-2);
}
.sv-view :focus-visible {
  outline: 2px solid #168ab3;
  outline-offset: 3px;
}
.sv-note,
.sv-caveat {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.55;
}
.sv-caveat {
  padding: 10px 12px;
  border-left: 3px solid #198bb0;
  background: var(--bg-2);
}
.sv-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 12px 24px #0003;
  max-height: 330px;
  overflow: auto;
}
.sv-search-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
}
.sv-search-results [aria-selected="true"] {
  background: var(--bg-3);
}
.sv-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
  margin-top: 16px;
}
.sv-tabs a {
  padding: 10px 13px;
  white-space: nowrap;
  font-size: 12px;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
}
.sv-tabs a[aria-current="page"] {
  border-color: #28afd4;
  color: var(--ink);
  font-weight: 600;
}
.sv-status {
  font-size: 12px;
  color: var(--ink-2);
  min-height: 20px;
  margin: 12px 0;
}
.sv-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  min-width: 0;
}
.sv-map-layout.sv-map-wide { grid-template-columns: minmax(0, 1fr); }
.sv-map-wide .sv-map { height: clamp(460px, calc(73vh - 80px), 770px); }
.sv-map-notes { margin: 14px 0; font-size: 12px; }
.sv-map-notes > summary { cursor: pointer; color: var(--ink-2); }
.sv-view [hidden] { display: none !important; }
.sv-view pre { max-width: 100%; overflow: auto; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sv-map-panel {
  position: relative;
  container-type: inline-size;
  min-width: 0;
  background: #071626;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.sv-map {
  position: relative;
  height: clamp(430px, 62vh, 780px);
  width: 100%;
  background: radial-gradient(ellipse at 50% 50%, #1465a0, #08294f);
}
.sv-national-modes {
  display: flex;
  gap: 4px;
  padding: 0 10px 8px;
  background: var(--bg-2);
}
.sv-national-modes button {
  font-size: 12px;
  min-height: 44px;
}
.sv-national-modes button[aria-pressed="true"] {
  background: #143b54;
  border-color: #69d3e7;
  color: #e1faff;
  box-shadow: inset 0 -2px #69d3e7;
}
.sv-national-legend {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(180px, 1fr);
  column-gap: 24px;
  padding: 12px 16px;
  border-top: 1px solid #335168;
  color: #e4f3fb;
  background: #081c30;
  font: 11px/1.4 system-ui, sans-serif;
}
.sv-national-legend strong { font-size: 12px; grid-column: 1; grid-row: 1; }
.sv-density-scale {
  grid-column: 2;
  grid-row: 1;
  height: 9px;
  margin-top: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, #096fc3, #00a9ed, #1adddb, #a5edc2, #fff2ae);
}
.sv-national-legend[data-mode="residents"] .sv-density-scale {
  background: linear-gradient(90deg, #145c9c, #087fb8 16.667%, #00a5b2 33.333%, #78dfbd 66.667%, #fff2ae);
}
.sv-density-ticks { grid-column: 2; grid-row: 2; display: flex; justify-content: space-between; margin-top: 3px; }
.sv-national-legend p { grid-column: 1; grid-row: 2; margin: 3px 0 0; color: #c3d8e6; }
.sv-national-legend .sv-density-total { grid-column: 3; grid-row: 1 / 3; align-self: center; }
@container (max-width: 600px) {
  .sv-national-legend { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; padding: 10px; }
  .sv-national-legend .sv-density-total { grid-column: 1 / 3; grid-row: 3; border-top: 1px solid #335168; padding-top: 6px; margin-top: 7px; }
}
.sv-map .maplibregl-popup-content {
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  border: 1px solid var(--line-2);
  padding: 18px;
  box-shadow: 0 6px 24px #0005;
}
.sv-map .maplibregl-popup { z-index: 4; }
.sv-state-popup { padding-top: 14px; font: 13px/1.5 system-ui, sans-serif; }
.sv-state-popup h3 { margin: 0 0 8px; font-size: 18px; }
.sv-state-popup p { margin: 8px 0; }
.sv-map .maplibregl-popup-close-button { width: 44px; height: 44px; border: 0; font-size: 23px; }
.sv-state-popup > button { width: 100%; min-height: 44px; }
.sv-atmosphere {
  position: absolute;
  inset: 3% 2%;
  pointer-events: none;
  background-image: radial-gradient(circle, #90d9ff55 0.6px, transparent 1px), radial-gradient(circle, #68baff33 0.5px, transparent 1px);
  background-size: 97px 79px, 149px 127px;
}
.sv-atmosphere i {
  position: absolute;
  inset: 9% 8%;
  border: 1px solid #47bcff30;
  border-radius: 50%;
  transform: rotate(-24deg);
  box-shadow: 0 0 16px #246ed522;
}
.sv-atmosphere i:nth-child(2) { inset: 1% 25%; transform: rotate(32deg); }
.sv-atmosphere i:nth-child(3) { inset: 26% -3%; transform: rotate(12deg); }
.sv-camera-imagery {
  padding: 14px;
  margin: 14px 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg-2);
}
.sv-camera-imagery h3 { font-size: 15px; margin: 6px 0 12px; }
.sv-camera-imagery > a { display: block; margin: 10px 0; overflow-wrap: anywhere; }
.sv-camera-actions { display: grid; gap: 8px; }
.sv-camera-actions a {
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--sv-link);
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.sv-camera-actions a:hover { border-color: var(--sv-link); }
.sv-orbits {
  position: absolute;
  inset: 12% 12%;
  pointer-events: none;
  opacity: 0;
  animation: sv-orbit-fade 2.4s ease-out;
}
.sv-orbits:before {
  content: "";
  position: absolute;
  inset: -25%;
  background-image:
    radial-gradient(circle, #e0faff88 0.6px, transparent 1.1px),
    radial-gradient(circle, #96dfff66 0.7px, transparent 1.3px);
  background-size:
    93px 71px,
    147px 113px;
  background-position:
    12px 20px,
    50px 5px;
}
.sv-orbits i {
  position: absolute;
  inset: 12% -4%;
  border: 1px solid #6cdfff88;
  border-radius: 50%;
  transform: rotate(-24deg);
  box-shadow: 0 0 14px #27a9d744;
}
.sv-orbits i:nth-child(2) {
  inset: -3% 23%;
  transform: rotate(32deg);
}
.sv-orbits i:nth-child(3) {
  inset: 21% -13%;
  transform: rotate(13deg);
}
@keyframes sv-orbit-fade {
  0%,
  40% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}
.sv-insets svg {
  display: block;
  width: 64px;
  height: 42px;
  fill: #12618a;
  stroke: #51d8ff;
  stroke-width: 0.8;
  filter: drop-shadow(0 0 3px #25b5df);
}
.sv-map-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--card);
  min-height: 44px;
}
.sv-breadcrumb {
  font-size: 11px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.sv-breadcrumb button {
  border: 0;
  padding: 3px;
  font-size: 11px;
}
.sv-layers {
  font-size: 12px;
}
.sv-layers summary {
  white-space: nowrap;
  cursor: pointer;
  padding: 6px;
}
.sv-layers[open] .sv-filter-grid {
  position: absolute;
  z-index: 8;
  right: 8px;
  top: 48px;
  width: min(310px, calc(100% - 16px));
  background: var(--card);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 9px;
  box-shadow: 0 12px 24px #0004;
}
.sv-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.sv-filter-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.sv-filter-grid select {
  grid-column: 1/-1;
  min-width: 0;
}
.sv-insets {
  position: absolute;
  bottom: 38px;
  left: 10px;
  display: flex;
  gap: 7px;
  max-width: calc(100% - 60px);
  flex-wrap: wrap;
}
.sv-insets button {
  font-size: 10px;
  min-height: 38px;
  border-radius: 50%;
  color: #c8f2ff;
  background: #081a2be8;
  border: 1px solid #4db7df88;
  box-shadow: 0 0 12px #26a9d522;
}
.sv-route-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px;
  background: var(--card);
}
.sv-route-tools button,
.sv-route-tools select {
  font-size: 11px;
}
.sv-route-tools button[aria-pressed="true"] {
  background: #0c6388;
  color: white;
}
.sv-report {
  scroll-margin-top: 72px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  max-height: calc(62vh + 118px);
  overflow: auto;
  min-width: 0;
}
.sv-report h2 {
  font-size: 24px;
  line-height: 1.2;
  margin: 4px 0 14px;
}
.sv-report h3 {
  font-size: 13px;
  margin: 20px 0 9px;
}
.sv-report > button {
  margin: 5px;
  font-size: 12px;
}
.sv-report > p {
  font-size: 12px;
}
.sv-report a {
  display: block;
  font-size: 12px;
  color: var(--sv-link);
  margin: 6px 0;
}
.sv-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.sv-stats strong {
  display: block;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.7px;
}
.sv-stats span {
  display: block;
  font-size: 10px;
  color: var(--ink-2);
  margin-top: 5px;
}
.sv-breakdown {
  margin: 18px 0;
}
.sv-breakdown h3 {
  font-size: 13px;
  margin-bottom: 12px;
}
.sv-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  font-size: 11px;
  gap: 4px;
  margin: 9px 0;
}
.sv-bar {
  grid-column: 1/-1;
  height: 3px;
  min-width: 1px;
  background: #258eae;
  border-radius: 3px;
}
.sv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sv-actions button {
  font-size: 11px;
}
.sv-report svg {
  width: 100%;
  height: 64px;
  color: #209aba;
}
.sv-worries details,
.sv-report details {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  font-size: 12px;
}
.sv-worries summary {
  font-weight: 600;
  cursor: pointer;
}
.sv-other {
  max-width: 1080px;
  margin: auto;
  padding: 12px 0;
}
.sv-other h2 {
  font-size: 23px;
}
.sv-other .sv-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.sv-other details {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  margin: 10px 0;
  background: var(--card);
}
.sv-other > svg {
  height: 90px;
  width: 100%;
  color: #168eaf;
}
.sv-table-scroll {
  overflow: auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.sv-view table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.sv-view th,
.sv-view td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  min-width: 90px;
}
.sv-view th {
  background: var(--bg-2);
  font-size: 11px;
}
.sv-view td a {
  color: var(--sv-link);
}
.sv-view td button {
  font-size: 12px;
  padding: 4px 6px;
}
.sv-table {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.sv-table summary {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}
.sv-compare-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.sv-report-back { display: none; }
.sv-draw-hint {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  right: 64px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  pointer-events: none;
}
.sv-toast {
  position: fixed;
  z-index: 90;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(460px, calc(100vw - 32px));
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: 0 6px 24px #0004;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  pointer-events: none;
}
.sv-view button:disabled { opacity: .5; cursor: default; }
body[data-view="surveillance"] .composer-dock {
  display: none;
}
.sv-map .maplibregl-ctrl-attrib {
  font-size: 10px;
}
.sv-map .maplibregl-ctrl-group button {
  background-color: #fff;
  color: #172b3d;
}
.sv-map .maplibregl-ctrl-group button:not(:disabled):hover,
.sv-map .maplibregl-ctrl-group button:focus-visible {
  background-color: #d8e9f3;
}
.sv-map canvas:focus-visible {
  outline-offset: -3px;
}
@media (max-width: 1100px) {
  .sv-map-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
  .sv-view {
    padding: 0 16px 24px;
  }
  .sv-report {
    padding: 16px;
  }
}
@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  .sv-view {
    padding: 0 12px 18px !important;
  }
  .sv-heading {
    padding-top: 6px;
  }
  .sv-heading h1 {
    font-size: 28px;
  }
  .sv-heading > p:last-child {
    font-size: 13px;
  }
  .sv-searchbar {
    flex-wrap: wrap;
  }
  .sv-search-wrap {
    flex-basis: 100%;
  }
  .sv-searchbar > button {
    flex: 1;
    min-height: 40px;
  }
  .sv-map-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .sv-map, .sv-map-wide .sv-map {
    height: clamp(380px, calc(100svh - 440px), 510px);
    min-height: 380px;
    scroll-margin-top: 64px;
  }
  .sv-report {
    max-height: none;
    border-radius: 18px 18px 10px 10px;
    padding: 20px 17px;
  }
  .sv-report:before {
    display: none;
  }
  .sv-report-back { display: block; margin: 0 0 16px !important; }
  .sv-tabs { flex-wrap: wrap; }
  .sv-tabs a {
    padding: 10px 9px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
  }
  .sv-view button, .sv-view select, .sv-view summary {
    min-height: 44px;
  }
  .sv-view button { min-width: 44px; }
  .sv-view select, .sv-view input:not([type="checkbox"]) { font-size: 16px; }
  .sv-view summary { align-content: center; }
  .sv-report a, .sv-other a, .sv-view td a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .sv-report > p, .sv-report details, .sv-note, .sv-caveat { font-size: 13px; }
  .sv-map .maplibregl-ctrl-group button { width: 44px; height: 44px; }
  .sv-map .maplibregl-ctrl-top-right .maplibregl-ctrl-group { display: flex; }
  .sv-map .maplibregl-ctrl-top-right button + button { border-top: 0; border-left: 1px solid #ddd; }
  .sv-map .maplibregl-popup {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    max-width: calc(100% - 24px) !important;
  }
  .sv-map .maplibregl-popup-tip { display: none; }
  .sv-map .maplibregl-popup-content { max-height: calc(65svh - 20px); overflow-y: auto; }
  .sv-national-modes button { flex: 1; padding: 7px 5px; font-size: 12px; }
  .sv-national-legend { grid-template-columns: 1fr 1fr; column-gap: 12px; padding: 10px; font-size: 10px; }
  .sv-national-legend strong { font-size: 11px; }
  .sv-national-legend .sv-density-total { grid-column: 1 / 3; grid-row: 3; border-top: 1px solid #335168; padding-top: 6px; margin-top: 7px; }
  .sv-map-tools { position: relative; z-index: 3; }
  .sv-layers[open] .sv-filter-grid {
    top: calc(100% + 4px);
    max-height: min(440px, calc(100dvh - 260px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sv-filter-grid label { min-height: 44px; font-size: 12px; }
  .sv-filter-grid input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; }
  .sv-search-results { max-height: min(330px, 45dvh); }
  .sv-search-results button { min-height: 48px; font-size: 14px; }
  .sv-route-tools {
    gap: 6px;
  }
  .sv-route-tools button,
  .sv-route-tools select {
    flex: 1 1 43%;
    min-height: 44px;
  }
  .sv-insets {
    bottom: 56px;
    max-width: calc(100% - 20px);
    gap: 4px;
  }
  .sv-insets svg {
    width: 42px;
    height: 28px;
  }
  .sv-insets button {
    padding: 5px;
    font-size: 11px;
  }
  .sv-other .sv-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sv-compare-inputs {
    grid-template-columns: 1fr;
  }
  .sv-status {
    font-size: 11px;
  }
  .sv-breadcrumb span {
    max-width: 155px;
  }
  .sv-map-tools {
    align-items: flex-start;
  }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .sv-searchbar { flex-wrap: nowrap; }
  .sv-search-wrap { flex-basis: 0; }
  .sv-searchbar > button { flex: 0 0 auto; }
  .sv-map, .sv-map-wide .sv-map { height: 65svh; min-height: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  .sv-view * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
