:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --panel: #ffffff;
  --ink: #18201b;
  --muted: #667064;
  --line: #d9ded4;
  --accent: #bb3d2b;
  --ok: #28785d;
  --warn: #b97317;
  --snpp: #2364aa;
  --noaa20: #20805f;
  --noaa21: #b4471f;
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.leaflet-container {
  overflow: hidden;
  outline-offset: 1px;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-zoom-animated {
  transform-origin: 0 0;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
  transition: transform 250ms cubic-bezier(0, 0, 0.25, 1);
}

.leaflet-container .leaflet-overlay-pane svg {
  max-width: none;
  max-height: none;
}

.leaflet-container img.leaflet-tile,
.leaflet-container .leaflet-marker-icon,
.leaflet-container .leaflet-marker-shadow {
  max-width: none;
}

.leaflet-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
}

.leaflet-tooltip {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
  padding: 4px 8px;
  pointer-events: none;
  white-space: nowrap;
}

.camprafaud-pin {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
  transform: rotate(-45deg);
}

.camprafaud-pin::after {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.leaflet-tooltip.camprafaud-label {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 7px;
  font-weight: 700;
  padding: 0;
  text-shadow: 0 1px 2px #fff, 0 -1px 2px #fff, 1px 0 2px #fff, -1px 0 2px #fff;
}

.leaflet-tooltip.camprafaud-label::before {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
}

.map-panel,
#map {
  min-height: 100%;
}

.status-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
}

.brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

h2 {
  margin-bottom: 10px;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.health-badge {
  border-radius: 999px;
  background: #ecefeb;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.health-badge.ok {
  background: #dff1e9;
  color: var(--ok);
}

.health-badge.warn {
  background: #fff0d9;
  color: var(--warn);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.toolbar {
  display: flex;
  gap: 10px;
}

button,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button {
  flex: 1;
  background: var(--ink);
  color: white;
  font-weight: 700;
}

select {
  flex: 1;
  padding: 0 10px;
}

.summary {
  color: var(--ink);
  font-size: 15px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 50%;
}

.snpp {
  background: var(--snpp);
}

.noaa20 {
  background: var(--noaa20);
}

.noaa21 {
  background: var(--noaa21);
}

.passes-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.passes-list li {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.pass-button {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  flex: initial;
  padding: 8px 0;
  text-align: left;
}

.pass-button:hover,
.passes-list li.selected .pass-button {
  background: #f1f5f1;
}

.pass-time {
  color: var(--muted);
}

.pass-observed {
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.pass-pending {
  color: var(--muted);
  font-size: 12px;
}

.pass-future {
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}

.leaflet-popup-content {
  margin: 10px 12px;
  min-width: 180px;
}

@media (max-width: 760px) {
  .app-shell {
    display: flex;
    flex-direction: column;
  }

  .map-panel {
    min-height: 58vh;
  }

  .status-panel {
    min-height: 42vh;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px;
  }

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

  .metric {
    min-height: 78px;
    padding: 10px;
  }

  .metric strong {
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
