:root {
  color-scheme: light;
  --bg: #f4f7f4;
  --panel: #ffffff;
  --ink: #17201d;
  --muted: #62706a;
  --line: #d9e2dc;
  --line-strong: #bdcbc3;
  --teal: #087d72;
  --teal-dark: #065f58;
  --blue: #2f74c0;
  --coral: #c85c45;
  --amber: #b97322;
  --violet: #7357b8;
  --good: #16875f;
  --warn: #bd7b18;
  --bad: #b4423b;
  --shadow: 0 18px 48px rgba(23, 32, 29, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 247, 244, 0.92), rgba(244, 247, 244, 1)),
    repeating-linear-gradient(135deg, rgba(8, 125, 114, 0.08) 0 1px, transparent 1px 18px);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: rgba(8, 125, 114, 0.14);
  stroke: var(--teal-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p,
footer {
  color: var(--muted);
}

.status-pill {
  min-width: 112px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 9px 14px;
  text-align: center;
  white-space: nowrap;
}

.status-pill.is-loading {
  color: var(--amber);
}

.status-pill.is-error {
  color: var(--bad);
}

.status-pill.is-ready {
  color: var(--good);
}

main {
  display: grid;
  gap: 18px;
}

.controls-band,
.map-panel,
.favorites-panel,
.activity-panel,
.chart-panel,
.daily-panel,
.compass-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.controls-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  padding: 16px;
}

.spot-form {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(130px, 0.55fr) minmax(130px, 0.55fr) 44px auto;
  align-items: end;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.depth-control label,
.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 0 12px;
}

.field input:focus,
.field select:focus,
.depth-control input:focus,
button:focus-visible {
  outline: 3px solid rgba(8, 125, 114, 0.22);
  outline-offset: 2px;
}

.primary-button,
.icon-button,
.segment,
.day-tab {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.primary-button {
  height: 44px;
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  padding: 0 18px;
  font-weight: 800;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--teal-dark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.depth-control {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.depth-control > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.depth-control strong {
  font-size: 1.35rem;
}

.depth-control input {
  width: 100%;
  accent-color: var(--teal);
}

.spot-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
}

.map-panel,
.favorites-panel {
  padding: 16px;
}

.map-panel .section-head,
.favorites-panel .section-head {
  margin-bottom: 12px;
}

.favorite-toggle svg {
  fill: none;
  stroke: var(--amber);
}

.favorite-toggle.is-active {
  background: rgba(185, 115, 34, 0.13);
  border-color: rgba(185, 115, 34, 0.55);
}

.favorite-toggle.is-active svg {
  fill: rgba(185, 115, 34, 0.28);
}

.spot-map {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  aspect-ratio: 2.45 / 1;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 116, 192, 0.28), rgba(8, 125, 114, 0.16)),
    #dce9e5;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}

.spot-map.is-leaflet {
  background: #a9d5df;
}

.spot-map.is-leaflet .map-tiles,
.spot-map.is-leaflet .map-markers {
  display: none;
}

.spot-map.is-dragging {
  cursor: grabbing;
}

.map-tiles,
.map-markers {
  position: absolute;
  inset: 0;
}

.map-tiles {
  pointer-events: none;
}

.map-tile {
  position: absolute;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms ease;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.map-tile.is-loaded {
  opacity: 1;
}

.map-tile.is-stale {
  opacity: 0.42;
}

.map-marker {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transform: translate(-50%, -50%);
}

.map-marker::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 3px 10px rgba(23, 32, 29, 0.32);
}

.map-marker.is-active {
  z-index: 5;
}

.map-marker.is-active::before {
  width: 14px;
  height: 14px;
  background: var(--coral);
}

.map-marker.is-favorite::after {
  content: "★";
  position: absolute;
  right: -6px;
  top: -8px;
  color: var(--amber);
  font-size: 15px;
  line-height: 1;
  text-shadow: 0 1px 0 #fff, 0 0 5px rgba(255, 255, 255, 0.95);
}

.map-marker-label {
  position: absolute;
  left: 50%;
  bottom: 20px;
  display: none;
  max-width: 170px;
  transform: translateX(-50%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(23, 32, 29, 0.16);
}

.map-marker.is-active .map-marker-label,
.map-marker:focus-visible .map-marker-label {
  display: block;
}

.custom-marker {
  position: absolute;
  z-index: 4;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 999px 999px 999px 2px;
  background: var(--ink);
  box-shadow: 0 5px 14px rgba(23, 32, 29, 0.34);
  transform: translate(-50%, -86%) rotate(-45deg);
}

.custom-marker::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: #fff;
}

.map-attribution {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 900;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  padding: 3px 6px;
  font-size: 0.72rem;
  pointer-events: none;
}

.map-controls {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 900;
  display: grid;
  gap: 6px;
}

.map-control {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(23, 32, 29, 0.14);
}

.map-control:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.map-control.is-active {
  border-color: rgba(8, 125, 114, 0.56);
  background: rgba(8, 125, 114, 0.12);
  color: var(--teal);
}

.map-control svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.map-scale {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 900;
  display: grid;
  gap: 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 6px 8px;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(23, 32, 29, 0.14);
}

.map-scale span {
  display: block;
  width: 70px;
  height: 6px;
  border-bottom: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

.map-scale strong {
  font-size: 0.72rem;
  line-height: 1;
}

.fish-filter-control {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 900;
  display: grid;
  justify-items: end;
  max-width: min(68%, 360px);
}

.fish-filter-control.is-hidden {
  display: none;
}

.fish-filter-trigger {
  display: grid;
  grid-template-columns: auto auto 16px;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(23, 32, 29, 0.12);
}

.fish-filter-trigger span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.fish-filter-trigger strong {
  color: var(--teal);
}

.fish-filter-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  transition: transform 160ms ease;
}

.fish-filter-trigger.is-open svg {
  transform: rotate(180deg);
}

.fish-filter-panel {
  display: none;
  width: min(252px, calc(100vw - 112px));
  max-height: 275px;
  margin-top: 7px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 6px;
  box-shadow: 0 18px 45px rgba(23, 32, 29, 0.24);
}

.fish-filter-panel.is-open {
  display: grid;
  gap: 5px;
}

.fish-filter-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 5px 7px;
  text-align: left;
}

.fish-filter-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fish-filter-option > span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.72rem;
}

.fish-filter-option.is-active {
  border-color: rgba(8, 125, 114, 0.56);
  background: rgba(8, 125, 114, 0.14);
  color: var(--teal);
}

.fish-filter-icon,
.favorite-star-marker {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}

.fish-filter-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(8, 125, 114, 0.11);
}

.fish-filter-icon svg {
  width: 23px;
  height: 23px;
  fill: var(--teal);
  stroke: #fff;
  stroke-width: 1.8;
  paint-order: stroke fill;
}

.favorite-star-marker svg {
  width: 28px;
  height: 28px;
  fill: var(--amber);
  stroke: #fff;
  stroke-width: 2.2;
  paint-order: stroke fill;
  filter: drop-shadow(0 3px 8px rgba(23, 32, 29, 0.32));
}

.known-fishing-marker {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(23, 32, 29, 0.28);
}

.known-fishing-marker svg {
  width: 25px;
  height: 25px;
  fill: var(--teal);
  stroke: #fff;
  stroke-width: 1.8;
  paint-order: stroke fill;
}

.known-fishing-marker.fish-thon svg,
.fish-filter-option.fish-thon .fish-filter-icon svg {
  fill: #2f74c0;
}

.known-fishing-marker.fish-dorade svg,
.fish-filter-option.fish-dorade .fish-filter-icon svg {
  fill: var(--amber);
}

.known-fishing-marker.fish-loup svg,
.fish-filter-option.fish-loup .fish-filter-icon svg {
  fill: #3f7f9f;
}

.known-fishing-marker.fish-sar svg,
.fish-filter-option.fish-sar .fish-filter-icon svg {
  fill: #59656f;
}

.known-fishing-marker.fish-roche svg,
.fish-filter-option.fish-roche .fish-filter-icon svg {
  fill: var(--coral);
}

.known-fishing-marker.fish-maquereau svg,
.fish-filter-option.fish-maquereau .fish-filter-icon svg {
  fill: #2b9aa5;
}

.known-fishing-marker.fish-maigre svg,
.fish-filter-option.fish-maigre .fish-filter-icon svg {
  fill: #ad6b36;
}

.known-fishing-marker.fish-cephalopodes svg,
.fish-filter-option.fish-cephalopodes .fish-filter-icon svg {
  fill: #7357b8;
}

.leaflet-popup-content {
  display: grid;
  gap: 4px;
  min-width: 180px;
  margin: 10px 12px;
  color: var(--ink);
}

.leaflet-popup-content strong,
.leaflet-popup-content span,
.leaflet-popup-content small,
.leaflet-popup-content em {
  display: block;
}

.leaflet-popup-content span {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
}

.leaflet-popup-content small,
.leaflet-popup-content em {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.leaflet-popup-content em {
  color: var(--bad);
  font-style: normal;
  font-weight: 800;
}

.pending-spot-marker {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.map-markers > .pending-spot-marker {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -92%);
}

.pending-spot-marker svg {
  width: 34px;
  height: 42px;
  fill: #2f74c0;
  stroke: #fff;
  stroke-width: 2.2;
  paint-order: stroke fill;
  filter: drop-shadow(0 5px 12px rgba(23, 32, 29, 0.34));
}

.pending-spot-marker circle {
  fill: #fff;
  stroke: none;
}

.spot-map.has-name-sheet .map-scale {
  opacity: 0;
}

.spot-name-sheet {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 950;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(23, 32, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  max-height: calc(100% - 20px);
  overflow: auto;
  padding: 12px;
  box-shadow: 0 18px 45px rgba(23, 32, 29, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 14px));
  transition: opacity 180ms ease, transform 180ms ease;
}

.spot-name-sheet.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.spot-name-head,
.spot-name-actions {
  display: grid;
  align-items: center;
  gap: 8px;
}

.spot-name-head {
  grid-template-columns: minmax(0, 1fr) 36px;
}

.spot-name-head strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}

.sheet-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--muted);
}

.sheet-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.spot-name-coords {
  color: var(--muted);
  font-size: 0.82rem;
}

.spot-name-field {
  display: grid;
  gap: 5px;
}

.spot-name-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.spot-name-field input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-weight: 800;
}

.spot-name-field input:focus {
  outline: 3px solid rgba(8, 125, 114, 0.22);
  outline-offset: 1px;
}

.spot-name-actions {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.ghost-button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.map-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
}

.map-meta strong {
  color: var(--ink);
}

.favorites-panel {
  align-content: start;
}

.favorites-list {
  display: grid;
  gap: 10px;
}

.favorite-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  gap: 8px;
}

.favorite-select,
.favorite-action {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
}

.favorite-select {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 9px 10px;
  text-align: left;
}

.favorite-select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-select span,
.favorites-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.favorite-select.is-active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.favorite-action {
  display: grid;
  width: 38px;
  min-height: 58px;
  place-items: center;
}

.favorite-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.favorite-rename {
  color: var(--amber);
}

.favorite-remove {
  color: var(--bad);
}

.favorite-save {
  color: var(--teal);
}

.favorite-cancel {
  color: var(--muted);
}

.favorite-edit-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  gap: 8px;
}

.favorite-name-input {
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(8, 125, 114, 0.25);
}

.favorite-name-input:focus {
  outline: 2px solid rgba(8, 125, 114, 0.24);
  outline-offset: 2px;
}

.favorites-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 14px;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}

.day-tab {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 12px;
  text-align: left;
}

.day-tab.is-active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.day-tab strong {
  font-size: 1rem;
}

.day-tab span {
  color: var(--muted);
  font-size: 0.82rem;
}

.activity-panel {
  padding: 18px;
}

.activity-fish-field {
  display: grid;
  grid-template-columns: auto minmax(150px, 220px);
  align-items: center;
  gap: 9px;
}

.activity-fish-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-fish-field select {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 800;
}

.activity-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.activity-summary {
  display: grid;
  align-content: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 16px;
}

.activity-ring {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #fbfdfb 0 55%, transparent 56%),
    conic-gradient(var(--teal) calc(var(--activity-score, 0) * 1%), rgba(8, 125, 114, 0.14) 0);
  box-shadow: inset 0 0 0 1px rgba(8, 125, 114, 0.14);
}

.activity-ring strong {
  color: var(--ink);
  font-size: 2.4rem;
  line-height: 1;
}

.activity-summary > div:nth-child(2) {
  display: grid;
  gap: 5px;
}

.activity-summary > div:nth-child(2) strong {
  font-size: 1.25rem;
}

.activity-summary > div:nth-child(2) span {
  color: var(--muted);
  line-height: 1.35;
}

.activity-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.activity-reason {
  border-radius: 999px;
  background: rgba(8, 125, 114, 0.1);
  color: var(--teal-dark);
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.activity-reason.warn {
  background: rgba(189, 123, 24, 0.12);
  color: var(--warn);
}

.activity-reason.bad {
  background: rgba(180, 66, 59, 0.12);
  color: var(--bad);
}

.activity-chart-wrap {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
}

.activity-chart-wrap canvas {
  display: block;
  width: 100%;
  min-height: 240px;
  aspect-ratio: 2.7 / 1;
}

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

.activity-windows div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
}

.activity-windows span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-windows strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 420px);
  gap: 18px;
}

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

.metric-card {
  display: grid;
  min-height: 172px;
  align-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(8, 125, 114, 0.12);
  color: var(--teal-dark);
}

.metric-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-label,
.metric-detail {
  color: var(--muted);
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.metric-detail {
  min-height: 1.35em;
}

.compass-panel {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: 12px;
  padding: 16px;
}

.compass-panel canvas,
.chart-panel canvas {
  width: 100%;
  display: block;
}

.compass-panel canvas {
  aspect-ratio: 1;
}

.best-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.best-window span {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.chart-panel,
.daily-panel {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.segment {
  min-width: 78px;
  height: 34px;
  padding: 0 12px;
  font-weight: 800;
}

.segment.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.chart-panel canvas {
  min-height: 260px;
  aspect-ratio: 2.8 / 1;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: var(--teal);
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.daily-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
}

.daily-card.is-active {
  border-color: var(--teal);
}

.daily-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  border-radius: 999px;
  background: rgba(22, 135, 95, 0.12);
  color: var(--good);
  font-weight: 900;
}

.score.warn {
  background: rgba(189, 123, 24, 0.12);
  color: var(--warn);
}

.score.bad {
  background: rgba(180, 66, 59, 0.12);
  color: var(--bad);
}

.daily-list {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
}

.daily-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

footer {
  margin-top: 22px;
  font-size: 0.84rem;
  line-height: 1.45;
}

@media (max-width: 1020px) {
  .controls-band,
  .spot-workspace,
  .activity-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .spot-form {
    grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(120px, 0.5fr)) 44px auto;
  }

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

  .spot-map {
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill {
    width: fit-content;
  }

  .spot-form {
    grid-template-columns: 1fr 1fr;
  }

  .field-wide,
  .primary-button {
    grid-column: 1 / -1;
  }

  .icon-button {
    width: 100%;
  }

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

  .activity-fish-field,
  .activity-windows {
    grid-template-columns: 1fr;
  }

  .activity-ring {
    width: 112px;
    height: 112px;
  }

  .spot-map {
    min-height: 280px;
    aspect-ratio: 1.25 / 1;
  }

  .map-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .spot-form {
    grid-template-columns: 1fr;
  }

  .icon-button {
    grid-column: auto;
  }
}
