:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #60717a;
  --line: #d8e1df;
  --paper: #f6f8f3;
  --panel: #ffffff;
  --blue: #186d8d;
  --green: #2f7a53;
  --orange: #b35c25;
  --red: #9d3434;
  --shadow: 0 10px 28px rgba(20, 36, 42, 0.08);
}

* {
  box-sizing: border-box;
}

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

.topbar {
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px clamp(16px, 4vw, 48px);
  background:
    linear-gradient(rgba(18, 38, 43, 0.72), rgba(18, 38, 43, 0.42)),
    url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1800&q=80") center 58% / cover;
  color: white;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 56px);
  line-height: 0.98;
  font-weight: 800;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

.top-actions,
.controls,
.map-tools,
.legend,
.links,
.scores {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button,
.button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 13px;
  background: var(--blue);
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ghost {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.44);
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px clamp(12px, 3vw, 32px) 40px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary div,
.controls,
.map-panel,
.results,
.source-notes,
.bait-guide,
.hotspot-guide,
.trip-guide {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary div {
  padding: 16px;
}

.summary span {
  display: block;
  font-size: 30px;
  font-weight: 800;
}

.summary p,
.panel-head p,
.notice,
.source-notes p,
.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.controls {
  padding: 14px;
  margin-bottom: 16px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toggle-layer {
  min-height: 40px;
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.toggle-layer input {
  min-height: auto;
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: white;
  font: inherit;
}

input[type="search"] {
  width: min(360px, 80vw);
}

input[type="range"] {
  min-width: 180px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.45fr);
  gap: 16px;
  align-items: start;
}

.map-panel,
.results,
.source-notes,
.bait-guide,
.hotspot-guide,
.trip-guide {
  padding: 16px;
}

.map-panel {
  position: sticky;
  top: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 12px;
}

.satellite-map {
  width: 100%;
  height: min(68vh, 720px);
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #dcebf0;
}

.map-tools {
  margin: 0 0 10px;
}

.map-tools button {
  padding: 8px 10px;
  background: #234b59;
}

.nav-status {
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #f7faf8;
  color: #35454b;
  font-size: 13px;
  line-height: 1.4;
}

.leaflet-container {
  font: inherit;
}

.waypoint-marker {
  width: 18px;
  height: 18px;
  border: 2px solid white;
  border-radius: 999px;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.55);
}

.waypoint-marker.prime {
  background: #e33b2f;
}

.waypoint-marker.fishery {
  background: #f2b705;
}

.waypoint-marker.wreck {
  background: #00a6d6;
}

.waypoint-marker.solid {
  background: #00a676;
}

.waypoint-marker.underwater {
  background: #2364d2;
}

.waypoint-marker.noaa,
.waypoint-marker.hotspot,
.waypoint-marker.osm,
.waypoint-marker.manual {
  background: var(--blue);
}

.waypoint-marker.trip {
  background: #8a3ffc;
}

.user-location-marker {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #1769ff;
  box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.22), 0 2px 10px rgba(0, 0, 0, 0.35);
}

.waypoint-marker.selected {
  width: 24px;
  height: 24px;
  border: 3px solid #111;
}

.leaflet-popup-content {
  min-width: 220px;
}

.popup-title {
  margin-bottom: 4px;
  font-weight: 800;
}

.popup-meta {
  margin: 4px 0;
  color: #46565c;
  font-size: 12px;
  line-height: 1.35;
}

.popup-links {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.popup-links a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.legend {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

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

.prime {
  background: #e33b2f;
}

.fishery {
  background: #f2b705;
}

.wreck {
  background: #00a6d6;
}

.solid {
  background: #00a676;
}

.underwater {
  background: #2364d2;
}

.noaa,
.hotspot,
.osm,
.manual {
  background: var(--blue);
}

.trip {
  background: #8a3ffc;
}

.cards {
  display: grid;
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24, 109, 141, 0.15);
}

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

.kind {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.category {
  width: fit-content;
  margin-top: 5px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.coords {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #3f4c51;
  font-size: 13px;
}

.score {
  min-width: 56px;
  padding: 6px 8px;
  border-radius: 6px;
  text-align: center;
  background: #edf5f7;
  color: var(--blue);
  font-weight: 800;
}

.score small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.scores {
  margin: 10px 0;
}

.pill {
  border-radius: 999px;
  background: #eef3ee;
  color: #384a40;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.hazard {
  background: #f7ece7;
  color: var(--red);
}

.notes {
  margin: 8px 0;
  line-height: 1.45;
}

.links {
  margin-top: 12px;
}

.links a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.source-notes {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.bait-guide {
  margin-top: 16px;
}

.hotspot-guide {
  margin-top: 16px;
}

.trip-guide {
  margin-top: 16px;
}

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

.bait-card,
.hotspot-card,
.trip-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.bait-card h3,
.hotspot-card h3,
.trip-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.bait-card .consensus {
  margin-bottom: 10px;
  line-height: 1.45;
}

.bait-list,
.season-list {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
}

.bait-list li,
.season-list li {
  line-height: 1.4;
  color: #35454b;
  font-size: 13px;
}

.bait-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin: 0 8px 1px 0;
  border-radius: 999px;
  background: var(--green);
}

.season-list strong {
  color: var(--ink);
}

@media (max-width: 920px) {
  .topbar,
  .panel-head,
  .card-head {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .bait-grid,
  .hotspot-grid,
  .trip-grid {
    grid-template-columns: 1fr;
  }

  .map-panel {
    position: static;
  }
}

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