:root {
  color-scheme: dark;
  --bg: #101715;
  --panel: #18221e;
  --line: #2d3c34;
  --text: #edf4ea;
  --muted: #aabbb0;
  --accent: #b9f580;
  --snapshot: #e5bd78;
  --offline: #84958c;
  font-family: system-ui,-apple-system,sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  min-width: 300px;
  background: radial-gradient(ellipse at 78% 10%,#1b2a20 0,transparent 55%),var(--bg);
}

button,input,select {
  font: inherit;
}

button,a,input,select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.topbar {
  border-bottom: 1px solid #2a372e;
  background: #101714e8;
}

.topbar-content,main {
  width: min(1520px,100%);
  margin: auto;
  padding-inline: clamp(16px,4vw,60px);
}

.topbar-content {
  height: 63px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.065em;
  white-space: nowrap;
}

.brand-accent {
  color: var(--accent);
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 10px;
  border-radius: 9px;
  background: var(--accent);
  color: #1a2b1c;
}

.brand-icon i {
  display: block;
  width: 15px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 3px;
  position: relative;
}

.brand-icon i::before {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  top: 1.5px;
  left: 3.5px;
}

.brand-icon i::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 2px;
  background: currentColor;
  left: 2px;
  top: -4px;
  border-radius: 1px;
}

.source-link {
  font-size: 13px;
  color: var(--muted);
}

.source-link span {
  margin-left: 5px;
  color: var(--accent);
}

.source-link:hover,.subtle:hover {
  color: var(--accent);
}

main {
  padding-bottom: 36px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 34px 0 27px;
}

h1 {
  font-size: clamp(36px,5.3vw,71px);
  font-weight: 760;
  line-height: .98;
  letter-spacing: -.075em;
  margin: 0;
}

h1 em {
  color: var(--accent);
  font-style: normal;
}

.intro p {
  color: var(--muted);
  font-size: clamp(14px,1.7vw,17px);
  margin: 15px 0 0;
}

.summary {
  display: flex;
  gap: clamp(14px,3vw,36px);
  padding-bottom: 3px;
}

.summary div {
  min-width: 107px;
  border-left: 1px solid #3c4e3e;
  padding-left: 15px;
}

.summary strong,.summary span {
  display: block;
  white-space: nowrap;
}

.summary strong {
  font-size: clamp(25px,4vw,42px);
  font-variant-numeric: tabular-nums;
  line-height: 1.02;
  letter-spacing: -.055em;
}

.summary span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(310px,28%);
  gap: 16px;
  align-items: start;
}

.map-card,.feed-card,.camera-card {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.card-heading {
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 15px;
}

.card-heading h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -.014em;
}

.subtle {
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px 12px;
}

.search-field,.region-field,.live-field {
  min-height: 39px;
  display: flex;
  align-items: center;
  background: #111b16;
  border: 1px solid #314239;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-field {
  gap: 9px;
  flex: 1;
  min-width: 100px;
  padding: 0 11px;
}

.search-field:focus-within {
  border-color: var(--accent);
}

.search-field input {
  border: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
  min-width: 0;
  outline: none;
  line-height: 36px;
  padding: 0;
}

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

.search-icon {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  flex: none;
  margin-right: 2px;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 5px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
}

.region-field select {
  background: transparent;
  max-width: 100%;
  min-height: 37px;
  color: inherit;
  border: 0;
  padding: 0 5px 0 9px;
}

.live-field {
  cursor: pointer;
  white-space: nowrap;
  gap: 6px;
  padding: 0 9px;
}

.live-field input {
  accent-color: var(--accent);
  margin: 0;
}

.map-viewport {
  height: clamp(470px,62vh,720px);
  position: relative;
  isolation: isolate;
  background: #162a2d;
  border-block: 1px solid var(--line);
}

#apple-map,#overview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#overview {
  cursor: crosshair;
}

.map-message {
  position: absolute;
  top: 12px;
  left: 12px;
  margin: 0;
  background: #121e19ed;
  color: var(--text);
  border: 1px solid #3a4b41;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  pointer-events: none;
}

.overview-attribution {
  position: absolute;
  bottom: 7px;
  right: 8px;
  background: #15231fee;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
}

.map-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 8px 13px;
  color: var(--muted);
  font-size: 11px;
}

.legend {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
}

.legend span {
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: 1px;
  background: var(--offline);
}

.dot.live {
  background: var(--accent);
}

.dot.snapshot {
  background: var(--snapshot);
}

.rail {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.pill {
  border-radius: 20px;
  background: #26362d;
  color: #c6d6c9;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.pill.live {
  background: #263e26;
  color: var(--accent);
}

.pill.snapshot {
  background: #443820;
  color: #f4cf8f;
}

.screen {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16/9;
  margin: 0 10px;
  background: #0d1612;
  border: 1px solid #2c3d33;
  border-radius: 9px;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
}

.screen img,.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.screen p {
  padding: 0 10px;
  font-size: 13px;
}

.feed-details {
  padding: 12px 13px 8px;
}

.route-badge {
  justify-self: start;
  display: inline-block;
  padding: 3px 6px;
  background: #293c2e;
  color: var(--accent);
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.feed-details h3 {
  font-size: 20px;
  letter-spacing: -.04em;
  line-height: 1.14;
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
}

.feed-details p {
  min-height: 1em;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.feed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  margin-top: 5px;
}

.camera-card .card-heading {
  border-bottom: 1px solid var(--line);
}

#result-count {
  color: var(--muted);
  font-size: 12px;
}

#camera-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow: auto;
  scrollbar-color: #506355 transparent;
}

#camera-list .empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.camera-row {
  width: 100%;
  display: grid;
  grid-template-columns: 57px minmax(0,1fr) 9px;
  gap: 9px;
  align-items: center;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid #2b3a31;
  padding: 9px 12px;
  min-height: 50px;
}

.camera-row .dot {
  margin: 0;
}

.camera-row:hover,.camera-row[aria-pressed="true"] {
  background: #26392c;
}

.camera-row:focus-visible {
  outline-offset: -3px;
}

.row-text {
  min-width: 0;
}

.row-name,.row-place {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.row-place {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.more-row {
  padding: 4px 13px;
  text-align: center;
}

@media (max-width:850px){
  .workspace {
    grid-template-columns: minmax(0,1fr) minmax(245px,36%);
  }
  .map-toolbar {
    flex-wrap: wrap;
  }
  .search-field {
    flex-basis: 100%;
  }
}
@media (max-width:650px){
  .topbar-content {
    height: 54px;
  }
  .intro {
    display: block;
    padding-top: 27px;
    padding-bottom: 20px;
  }
  h1 {
    font-size: clamp(39px,9vw,58px);
  }
  .summary {
    margin-top: 19px;
  }
  .workspace {
    grid-template-columns: minmax(0,1fr);
    gap: 12px;
  }
  .rail {
    gap: 12px;
  }
  .map-viewport {
    height: clamp(325px,45svh,460px);
  }
  .map-toolbar {
    gap: 6px;
  }
  .search-field {
    flex-basis: 100%;
  }
}
