:root {
  --paper: #f4f5ef;
  --panel: rgba(255, 255, 255, 0.9);
  --surface: rgba(251, 252, 248, 0.84);
  --chart-bg: #f8fbf8;
  --ink: #17211c;
  --muted: #68726b;
  --line: #d9ded5;
  --sea: #2f7d8a;
  --sea-deep: #185765;
  --mint: #d8ebe5;
  --amber: #c9792b;
  --rose: #b94e4d;
  --rose-soft: #f4ddda;
  --amber-soft: #f6ead5;
  --shadow: 0 18px 50px rgba(37, 48, 43, 0.12);
  --ambient-bg: url("/assets/backgrounds/harbour-clear.svg");
  --ambient-overlay: linear-gradient(180deg, rgba(244, 245, 239, 0.38), rgba(244, 245, 239, 0.18)),
    radial-gradient(circle at 50% 42%, rgba(244, 245, 239, 0.08), rgba(23, 33, 28, 0.24));
  --ambient-filter: saturate(1.04) brightness(0.98);
}

body.dim-mode {
  --paper: #111a1b;
  --panel: rgba(23, 35, 36, 0.9);
  --surface: rgba(27, 42, 43, 0.84);
  --chart-bg: #152122;
  --ink: #dce6df;
  --muted: #9aa8a2;
  --line: #314041;
  --sea: #72b7bd;
  --sea-deep: #a6d8dc;
  --mint: #1f3938;
  --amber: #e0b168;
  --rose: #ef918b;
  --rose-soft: #3d2526;
  --amber-soft: #3b321f;
  --shadow: 0 12px 38px rgba(0, 0, 0, 0.28);
  --ambient-overlay: linear-gradient(180deg, rgba(7, 13, 15, 0.08), rgba(7, 13, 15, 0.34)),
    radial-gradient(circle at 50% 44%, rgba(220, 230, 223, 0.06), rgba(0, 0, 0, 0.34));
  --ambient-filter: saturate(0.92) brightness(0.86);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
  letter-spacing: 0;
  position: relative;
}

body.ambient-clear {
  --ambient-bg: url("/assets/backgrounds/harbour-clear.svg");
}

body.ambient-cloud {
  --ambient-bg: url("/assets/backgrounds/harbour-cloud.svg");
}

body.ambient-rain {
  --ambient-bg: url("/assets/backgrounds/harbour-rain.svg");
  --ambient-overlay: linear-gradient(180deg, rgba(17, 26, 27, 0.12), rgba(17, 26, 27, 0.28)),
    radial-gradient(circle at 50% 44%, rgba(244, 245, 239, 0.06), rgba(13, 21, 21, 0.28));
}

body.ambient-fog {
  --ambient-bg: url("/assets/backgrounds/harbour-fog.svg");
  --ambient-overlay: linear-gradient(180deg, rgba(244, 245, 239, 0.3), rgba(244, 245, 239, 0.22)),
    radial-gradient(circle at 50% 44%, rgba(244, 245, 239, 0.12), rgba(23, 33, 28, 0.16));
  --ambient-filter: saturate(0.82) brightness(1.02);
}

body.ambient-storm {
  --ambient-bg: url("/assets/backgrounds/harbour-storm.svg");
  --ambient-overlay: linear-gradient(180deg, rgba(10, 16, 18, 0.12), rgba(10, 16, 18, 0.38)),
    radial-gradient(circle at 50% 44%, rgba(244, 245, 239, 0.06), rgba(0, 0, 0, 0.32));
  --ambient-filter: saturate(0.9) brightness(0.88);
}

body.ambient-dusk {
  --ambient-bg: url("/assets/backgrounds/harbour-dusk.svg");
  --ambient-overlay: linear-gradient(180deg, rgba(244, 245, 239, 0.18), rgba(17, 26, 27, 0.18)),
    radial-gradient(circle at 50% 44%, rgba(244, 245, 239, 0.06), rgba(17, 26, 27, 0.24));
}

body.ambient-night {
  --ambient-bg: url("/assets/backgrounds/harbour-night.svg");
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background-image: var(--ambient-bg);
  background-position: center;
  background-size: cover;
  filter: var(--ambient-filter);
  transform: scale(1.025);
  transition: background-image 450ms ease, filter 450ms ease;
}

body::after {
  z-index: -1;
  background: var(--ambient-overlay);
  backdrop-filter: blur(1px);
  transition: background 450ms ease;
}

.dashboard-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100svh;
  min-height: 680px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 12px;
  padding: 16px 18px 12px;
}

.dashboard-shell > * {
  min-width: 0;
}

.topbar,
.tide-panel,
.decision-panel,
.weather-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px) saturate(1.08);
  box-shadow: var(--shadow);
}

.topbar {
  min-height: 104px;
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(620px, 2fr);
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 8px;
}

.title-block {
  min-width: 0;
  display: grid;
  align-content: center;
}

.condition-summary {
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.wind-unit-toggle {
  width: max-content;
  display: inline-grid;
  grid-template-columns: repeat(2, 42px);
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.wind-unit-toggle button {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.wind-unit-toggle button.active {
  background: var(--sea-deep);
  color: #fff;
  box-shadow: 0 4px 10px rgba(23, 33, 28, 0.13);
}

.wind-unit-toggle button:focus-visible {
  outline: 3px solid rgba(47, 125, 138, 0.35);
  outline-offset: 2px;
}

.install-button,
.app-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--sea-deep);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.install-button {
  cursor: pointer;
}

.install-button:hover {
  border-color: rgba(47, 125, 138, 0.42);
  background: #f0f7f4;
}

.update-button {
  color: var(--rose);
}

.app-status {
  color: var(--amber);
}

body.dim-mode .wind-unit-toggle {
  background: rgba(23, 35, 36, 0.62);
}

body.dim-mode .wind-unit-toggle button.active {
  background: var(--sea);
  color: #061313;
}

body.dim-mode .install-button,
body.dim-mode .app-status {
  background: rgba(23, 35, 36, 0.62);
}

body.dim-mode .install-button:hover {
  background: #203233;
}

.eyebrow,
.panel-kicker,
.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 0.95;
  font-weight: 850;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.metric {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric strong {
  min-width: 0;
  color: var(--sea-deep);
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1;
  white-space: nowrap;
}

.metric span:last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.springs-metric {
  border-color: rgba(47, 125, 138, 0.35);
  background: var(--mint);
}

.springs-metric.hot-springs {
  border-color: rgba(185, 78, 77, 0.52);
  background: var(--rose-soft);
}

.springs-metric.hot-springs strong {
  color: var(--rose);
}

.sea-temp-metric {
  border-color: rgba(47, 125, 138, 0.28);
}

.tide-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 14px 16px 12px;
  border-radius: 8px;
}

.panel-head,
.weather-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.panel-head > div:first-child {
  min-width: 0;
}

.tide-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sport-lights {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sport-light {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.sport-light strong,
.sport-light em {
  font-size: 11px;
  font-style: normal;
  line-height: 1;
}

.sport-light strong {
  color: var(--ink);
}

.traffic-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.sport-light.green .traffic-dot {
  background: #2f9b73;
}

.sport-light.amber .traffic-dot {
  background: var(--amber);
}

.sport-light.red .traffic-dot {
  background: var(--rose);
}

.sport-light.green {
  border-color: rgba(47, 155, 115, 0.36);
  background: rgba(216, 235, 229, 0.88);
  color: #1d6d51;
}

.sport-light.amber {
  border-color: rgba(201, 121, 43, 0.38);
  background: var(--amber-soft);
  color: var(--amber);
}

.sport-light.red {
  border-color: rgba(185, 78, 77, 0.4);
  background: var(--rose-soft);
  color: var(--rose);
}

.sport-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.sport-reasons span {
  min-width: 0;
  max-width: 430px;
}

.sport-reasons strong {
  color: var(--sea-deep);
  font-weight: 850;
}

.panel-meta,
.weather-head span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.panel-meta {
  align-items: center;
  display: flex;
  gap: 12px;
}

button {
  appearance: none;
  font: inherit;
}

.text-button,
.icon-button,
.graph-prev,
.graph-next {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--sea-deep);
  cursor: pointer;
  font-weight: 800;
}

.text-button:disabled,
.icon-button:disabled,
.graph-prev:disabled,
.graph-next:disabled {
  opacity: 0.38;
  cursor: default;
}

.text-button {
  padding: 0 12px;
}

.icon-button {
  width: 34px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.text-button:focus-visible,
.icon-button:focus-visible,
.graph-prev:focus-visible,
.graph-next:focus-visible,
.weather-card:focus-visible {
  outline: 3px solid rgba(47, 125, 138, 0.35);
  outline-offset: 2px;
}

.chart-frame {
  min-height: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--chart-bg);
  overflow: hidden;
}

.graph-prev,
.graph-next {
  position: absolute;
  top: 50%;
  width: 38px;
  height: 54px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  font-size: 32px;
  line-height: 1;
}

.graph-prev {
  left: 10px;
}

.graph-next {
  right: 10px;
}

body.dim-mode .graph-prev,
body.dim-mode .graph-next {
  background: rgba(27, 42, 43, 0.9);
}

#tideCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.tide-events {
  min-height: 36px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.event-pill {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}

.event-pill strong {
  color: var(--sea-deep);
}

.event-pill span {
  color: var(--muted);
}

.decision-panel {
  height: 92px;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(150px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
  padding: 9px 14px;
  border-radius: 8px;
}

.decision-head {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 5px;
  align-content: stretch;
}

.decision-head h2 {
  margin-top: 2px;
  color: var(--sea-deep);
}

.decision-head .text-button {
  width: max-content;
  min-height: 28px;
  padding: 0 10px;
}

.decision-grid {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.08fr 1.44fr 0.94fr 0.98fr 0.82fr;
  gap: 0;
}

.decision-card {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  align-content: start;
  gap: 3px;
  overflow: hidden;
  padding: 2px 12px;
  border-left: 1px solid var(--line);
  background: transparent;
}

.decision-card:first-child {
  border-left: 0;
}

.decision-card > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.decision-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--sea-deep);
  font-size: 14px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-card p,
.decision-card small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.22;
}

.decision-card p,
.decision-card small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.decision-lines {
  display: grid;
  gap: 1px;
}

.decision-window-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.decision-window-line b {
  flex: 0 0 34px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.decision-window-line strong {
  min-width: 0;
  color: var(--sea-deep);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-window-line.green strong {
  color: #1d6d51;
}

.decision-window-line.amber strong {
  color: var(--amber);
}

.decision-window-line.red strong,
.decision-card-safety.has-nudge strong {
  color: var(--rose);
}

.decision-muted {
  color: var(--muted);
}

.weather-panel {
  min-height: 102px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  padding: 10px 16px;
  border-radius: 8px;
}

.weather-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.weather-actions span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-strip {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.weather-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.weather-card:hover,
.text-button:hover,
.icon-button:hover,
.graph-prev:hover,
.graph-next:hover {
  border-color: rgba(47, 125, 138, 0.42);
  background: #f0f7f4;
}

body.dim-mode .weather-card:hover,
body.dim-mode .text-button:hover,
body.dim-mode .icon-button:hover,
body.dim-mode .graph-prev:hover,
body.dim-mode .graph-next:hover {
  background: #203233;
}

.weather-card:disabled {
  cursor: default;
  opacity: 0.68;
}

.weather-card:disabled:hover {
  border-color: var(--line);
  background: var(--surface);
}

.weather-card-past {
  opacity: 0.74;
}

.weather-card-empty .weather-temp {
  color: var(--muted);
}

.weather-unavailable {
  min-height: 118px;
  grid-column: 1 / -1;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.weather-unavailable strong {
  color: var(--rose);
  font-size: 16px;
}

.weather-unavailable span {
  max-width: 720px;
  font-size: 13px;
  line-height: 1.35;
}

.wind-bearing {
  display: inline-block;
  width: 16px;
  height: 16px;
  color: var(--sea-deep);
  font-size: 16px;
  line-height: 16px;
  text-align: center;
  transform-origin: 50% 50%;
}

.weather-card time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.weather-temp {
  color: var(--sea-deep);
  font-size: clamp(20px, 1.9vw, 25px);
  line-height: 1;
  font-weight: 850;
}

.weather-code {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  color: var(--sea-deep);
}

.weather-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.weather-icon path,
.weather-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.weather-icon .icon-sun {
  color: var(--amber);
}

.weather-icon .icon-cloud {
  color: var(--muted);
  fill: rgba(104, 114, 107, 0.1);
}

.weather-icon .icon-rain {
  color: var(--sea);
}

.weather-icon .icon-muted {
  color: var(--muted);
}

.weather-icon .icon-lightning {
  color: var(--amber);
  fill: rgba(201, 121, 43, 0.24);
}

body.dim-mode .weather-icon .icon-cloud {
  fill: rgba(154, 168, 162, 0.14);
}

.wind-line,
.rain-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.wind-line strong,
.rain-line strong {
  color: var(--ink);
}

.dashboard-footer {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.sponsorship[hidden] {
  display: none;
}

.sponsorship {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.sponsorship-copy {
  flex: 1 1 240px;
  min-width: 0;
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}

.sponsorship-label {
  color: var(--muted);
  font-size: 11px;
}

.sponsorship-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.sponsorship-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.sponsorship-description:empty {
  display: none;
}

.sponsorship-logo {
  flex: 0 0 auto;
  width: 80px;
  height: 40px;
  object-fit: contain;
}

.sponsorship-link {
  max-width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--sea-deep);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.sponsorship-link:hover {
  text-decoration: underline;
}

.sponsorship-link:focus-visible {
  outline: 2px solid var(--sea-deep);
  outline-offset: 3px;
}

.footnote {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.error-state {
  color: var(--rose);
}

.stale-state {
  color: var(--amber);
}

.forecast-dialog,
.install-dialog,
.threshold-dialog,
.note-dialog,
.radar-dialog,
.wind-dialog,
.watersports-dialog,
.webcam-dialog {
  width: min(860px, calc(100vw - 52px));
  max-height: min(620px, calc(100svh - 52px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.note-dialog {
  width: min(560px, calc(100vw - 52px));
}

.install-dialog {
  width: min(620px, calc(100vw - 52px));
}

.threshold-dialog {
  width: min(760px, calc(100vw - 52px));
}

.radar-dialog {
  width: min(920px, calc(100vw - 52px));
  max-height: min(670px, calc(100svh - 44px));
}

.wind-dialog {
  width: min(980px, calc(100vw - 52px));
  max-height: min(680px, calc(100svh - 44px));
}

.watersports-dialog {
  width: min(1180px, calc(100vw - 38px));
  max-height: min(730px, calc(100svh - 34px));
}

.webcam-dialog {
  width: min(980px, calc(100vw - 52px));
  max-height: min(680px, calc(100svh - 44px));
}

.forecast-dialog::backdrop,
.install-dialog::backdrop,
.threshold-dialog::backdrop,
.note-dialog::backdrop,
.radar-dialog::backdrop,
.wind-dialog::backdrop,
.watersports-dialog::backdrop,
.webcam-dialog::backdrop {
  background: rgba(23, 33, 28, 0.42);
}

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

.close-button {
  flex: 0 0 auto;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

.summary-pill,
.forecast-hour {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-pill {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

.summary-pill span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-pill strong {
  overflow: hidden;
  color: var(--sea-deep);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.threshold-form {
  display: grid;
  gap: 14px;
}

.threshold-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.threshold-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.threshold-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.threshold-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.threshold-grid em {
  color: var(--sea-deep);
  font-style: normal;
}

.threshold-grid input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  padding: 0 9px;
}

.threshold-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-grid {
  max-height: 390px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.dialog-grid.week-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.forecast-hour {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.forecast-day.selected-day {
  border-color: rgba(47, 125, 138, 0.48);
  background: var(--mint);
}

.forecast-hour time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.note-copy {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.radar-map {
  position: relative;
  height: min(390px, calc(100svh - 245px));
  min-height: 310px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #d9e6e4;
}

.radar-layer {
  position: absolute;
  inset: 0;
}

.radar-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  -webkit-user-drag: none;
}

.radar-frame {
  width: 512px;
  height: 512px;
}

.base-tile {
  opacity: 0.94;
}

.precipitation-layer {
  opacity: 0.82;
}

body.dim-mode .base-tile {
  filter: saturate(0.75) brightness(0.62) contrast(1.12);
}

body.dim-mode .rain-tile {
  opacity: 0.92;
}

.radar-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--rose);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.86);
  transform: translate(-50%, -50%);
}

.radar-center::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose);
  content: "";
  transform: translate(-50%, -50%);
}

.radar-loading {
  position: absolute;
  right: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dim-mode .radar-loading {
  background: rgba(27, 42, 43, 0.92);
}

.radar-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.radar-play {
  min-width: 76px;
}

.radar-slider-label {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.radar-slider-label span {
  color: var(--sea-deep);
}

.radar-slider-label span.projection-frame {
  color: var(--rose);
}

.radar-slider-label input {
  width: 100%;
  accent-color: var(--sea);
}

.radar-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.radar-status span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wind-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
  gap: 12px;
}

.wind-map,
.wind-station-list {
  min-width: 0;
}

.wind-map {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #d5e0dc;
}

.wind-map-graphic {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

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

.wind-map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  -webkit-user-drag: none;
}

.wind-map-tile.base {
  filter: saturate(0.76) contrast(0.9) brightness(1.04);
}

.wind-map-tile.seamark {
  opacity: 0.9;
}

body.dim-mode .wind-map {
  background: #172d30;
}

body.dim-mode .wind-map-tile.base {
  filter: saturate(0.72) brightness(0.64) contrast(1.12);
}

body.dim-mode .wind-map-tile.seamark {
  opacity: 0.82;
  filter: brightness(0.92) contrast(1.08);
}

.wind-map-pin {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 3px;
  transform: translate(-50%, -50%);
}

.wind-map-arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: var(--sea-deep);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 33, 28, 0.2);
  transform: rotate(var(--wind-angle));
}

.wind-map-pin.wind-speed-light .wind-map-arrow {
  background: var(--sea);
}

.wind-map-pin.wind-speed-fresh .wind-map-arrow,
.wind-map-pin.wind-speed-strong .wind-map-arrow {
  background: var(--amber);
}

.wind-map-pin.wind-speed-strong .wind-map-arrow {
  background: var(--rose);
}

.wind-map-pin.stale .wind-map-arrow {
  background: var(--amber);
}

.wind-map-pin.offline .wind-map-arrow {
  background: var(--muted);
}

.wind-map-label {
  max-width: 118px;
  display: grid;
  justify-items: center;
  gap: 1px;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--sea-deep);
  line-height: 1;
}

body.dim-mode .wind-map-label {
  background: rgba(23, 35, 36, 0.9);
}

.wind-map-label strong,
.wind-map-label em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wind-map-label strong {
  color: var(--sea-deep);
  font-size: 11px;
  font-weight: 850;
}

.wind-map-label em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.wind-map-attribution {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 3;
  display: flex;
  gap: 4px;
  max-width: calc(100% - 14px);
  overflow: hidden;
  padding: 3px 6px;
  border: 1px solid rgba(217, 222, 213, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: rgba(23, 33, 28, 0.74);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wind-map-attribution a {
  color: inherit;
  text-decoration: none;
}

body.dim-mode .wind-map-attribution {
  border-color: rgba(49, 64, 65, 0.8);
  background: rgba(23, 35, 36, 0.84);
  color: rgba(220, 230, 223, 0.8);
}

.wind-station-list {
  max-height: min(390px, calc(100svh - 245px));
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.wind-station-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--sea);
  border-radius: 8px;
  background: var(--surface);
}

.wind-station-card.stale {
  border-left-color: var(--amber);
}

.wind-station-card.offline {
  border-left-color: var(--rose);
}

.wind-station-head,
.wind-reading,
.wind-card-foot,
.wind-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wind-station-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.wind-station-head strong {
  overflow: hidden;
  color: var(--sea-deep);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wind-station-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wind-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--sea-deep);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.wind-status.stale {
  background: var(--amber-soft);
  color: var(--amber);
}

.wind-status.offline {
  background: var(--rose-soft);
  color: var(--rose);
}

.wind-reading {
  align-items: flex-end;
  margin: 9px 0 8px;
}

.wind-reading strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.wind-reading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.wind-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.wind-mini-grid div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.wind-mini-grid span,
.wind-card-foot span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wind-mini-grid strong {
  overflow: hidden;
  color: var(--sea-deep);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wind-card-foot {
  margin-top: 8px;
}

.wind-card-foot a,
.wind-status-line a {
  color: var(--sea-deep);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.wind-status-line {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wind-water-read {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 8px;
  margin-top: 10px;
}

.wind-loading {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.watersports-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 12px;
}

.watersports-chart,
.watersports-side {
  min-width: 0;
}

.watersports-chart {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dbe9e6;
}

.watersports-map-graphic {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

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

.watersports-map-vignette {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(24, 87, 101, 0.02)),
    radial-gradient(circle at 52% 48%, rgba(255, 255, 255, 0), rgba(23, 33, 28, 0.16));
  pointer-events: none;
}

.watersports-map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  -webkit-user-drag: none;
}

.watersports-map-tile.base {
  opacity: 0.9;
  filter: saturate(0.62) contrast(0.88) brightness(1.04);
}

.watersports-map-tile.seamark {
  opacity: 0.98;
}

body.dim-mode .watersports-chart {
  background: #172d30;
}

body.dim-mode .watersports-map-tile.base {
  opacity: 0.58;
  filter: saturate(0.55) brightness(0.58) contrast(1.18);
}

body.dim-mode .watersports-map-tile.seamark {
  opacity: 0.86;
  filter: brightness(0.92) contrast(1.1);
}

.depth-sounding,
.watersports-zone,
.watersports-wind-pin {
  position: absolute;
  z-index: 4;
}

.depth-sounding {
  width: auto;
  min-height: 0;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(18, 63, 73, 0.72);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 850;
  line-height: 1;
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.86),
    0 0 4px rgba(255, 255, 255, 0.68);
  text-align: center;
  transform: translate(-50%, -50%);
}

.depth-sounding strong {
  font-size: 11px;
  line-height: 1;
}

.depth-sounding span {
  color: rgba(18, 63, 73, 0.62);
  font-size: 8px;
  font-weight: 850;
}

body.dim-mode .depth-sounding {
  color: rgba(222, 232, 227, 0.72);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.46),
    0 0 4px rgba(0, 0, 0, 0.32);
}

body.dim-mode .depth-sounding span {
  color: rgba(222, 232, 227, 0.58);
}

.depth-sounding em {
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  grid-column: 1 / -1;
  max-width: 104px;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(24, 87, 101, 0.94);
  color: rgba(255, 255, 255, 0.88);
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
  opacity: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 140ms ease;
  white-space: nowrap;
}

.depth-sounding:hover em {
  opacity: 1;
}

.watersports-zone {
  display: grid;
  gap: 1px;
  max-width: 140px;
  padding: 6px 8px;
  border: 1px solid rgba(217, 222, 213, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 10px 20px rgba(23, 33, 28, 0.14);
  transform: translate(-50%, -50%);
}

.watersports-zone strong {
  color: var(--sea-deep);
  font-size: 11px;
  line-height: 1.05;
  white-space: nowrap;
}

.watersports-zone span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watersports-zone.good {
  border-left: 4px solid var(--sea);
}

.watersports-zone.watch {
  border-left: 4px solid var(--amber);
}

.watersports-zone.alert {
  border-left: 4px solid var(--rose);
}

.watersports-wind-pin {
  z-index: 5;
}

.watersports-wind-pin .wind-map-arrow {
  width: 36px;
  height: 36px;
  font-size: 22px;
}

.watersports-wind-pin .wind-map-label {
  --label-x: 0;
  --label-y: 0;
  width: 108px;
  max-width: 108px;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 8px;
  text-align: center;
  transform: translate(var(--label-x), var(--label-y));
}

.watersports-wind-pin.edge-east .wind-map-label {
  --label-x: -62px;
}

.watersports-wind-pin.edge-west .wind-map-label {
  --label-x: 62px;
}

.watersports-wind-pin.edge-south .wind-map-label {
  --label-y: -72px;
}

.watersports-wind-pin .wind-map-label strong,
.watersports-wind-pin .wind-map-label em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watersports-wind-pin .wind-map-label strong {
  color: var(--sea-deep);
  font-size: 11px;
  line-height: 1.05;
}

.watersports-wind-pin .wind-map-label em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.watersports-map-attribution {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 6;
  display: flex;
  gap: 4px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(217, 222, 213, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: rgba(23, 33, 28, 0.74);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watersports-map-attribution a {
  color: inherit;
  text-decoration: none;
}

.watersports-side {
  max-height: min(470px, calc(100svh - 245px));
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.watersports-score,
.watersports-detail-card,
.watersports-reference-card,
.watersports-activity-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.watersports-score {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-left: 5px solid var(--sea);
}

.watersports-score.play {
  border-left-color: var(--sea);
}

.watersports-score.watch {
  border-left-color: var(--amber);
}

.watersports-score.alert {
  border-left-color: var(--rose);
}

.watersports-score.unknown {
  border-left-color: var(--muted);
}

.watersports-score span,
.watersports-activity-grid span,
.watersports-mini-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.watersports-score strong {
  color: var(--sea-deep);
  font-size: 24px;
  line-height: 1.05;
}

.watersports-score p,
.watersports-reference-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
}

.watersports-score p b {
  color: var(--sea-deep);
}

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

.watersports-activity-grid div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

.watersports-activity-grid strong,
.watersports-mini-list strong {
  overflow: hidden;
  color: var(--sea-deep);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watersports-detail-card,
.watersports-reference-card {
  padding: 11px 12px;
}

.watersports-detail-card h3,
.watersports-reference-card h3 {
  margin: 0 0 8px;
  color: var(--sea-deep);
  font-size: 14px;
}

.watersports-mini-list {
  display: grid;
  gap: 6px;
}

.watersports-mini-list p {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}

.watersports-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.watersports-source-links a {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--sea-deep);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.watersports-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.watersports-status-line a {
  color: var(--sea-deep);
  font-weight: 850;
  text-decoration: none;
}

body.dim-mode .watersports-zone,
body.dim-mode .watersports-map-attribution {
  border-color: rgba(49, 64, 65, 0.8);
  background: rgba(23, 35, 36, 0.88);
  color: rgba(220, 230, 223, 0.86);
}

.webcam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.65fr);
  gap: 12px;
}

.webcam-primary,
.webcam-side {
  min-width: 0;
}

.webcam-video {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1515;
  aspect-ratio: 16 / 9;
}

.webcam-video iframe,
.webcam-video-player {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.webcam-video-player {
  background: #0d1515;
  object-fit: contain;
}

.webcam-video iframe[hidden],
.webcam-video-player[hidden],
.webcam-fallback[hidden] {
  display: none;
}

.webcam-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  background: #0d1515;
  color: #f6fbf7;
  text-align: center;
}

.webcam-fallback strong {
  font-size: 18px;
}

.webcam-fallback span {
  max-width: 420px;
  color: rgba(246, 251, 247, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.webcam-fallback .text-button {
  display: inline-grid;
  align-items: center;
  justify-self: center;
  color: var(--sea-deep);
  text-decoration: none;
}

.webcam-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.webcam-caption div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.webcam-caption strong {
  color: var(--sea-deep);
  font-size: 13px;
  white-space: nowrap;
}

.webcam-caption span,
.webcam-caption a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webcam-caption a {
  flex: 0 1 auto;
  color: var(--sea-deep);
  font-weight: 800;
  text-align: right;
  text-decoration: none;
}

.webcam-side {
  display: grid;
  gap: 8px;
}

.webcam-link-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}

.webcam-link-card:hover {
  border-color: rgba(47, 125, 138, 0.42);
  background: #f0f7f4;
}

.webcam-link-card:focus-visible {
  outline: 3px solid rgba(47, 125, 138, 0.35);
  outline-offset: 2px;
}

body.dim-mode .webcam-link-card:hover {
  background: #203233;
}

.webcam-link-card strong {
  color: var(--sea-deep);
  font-size: 14px;
}

.webcam-link-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.webcam-link-card em {
  color: var(--sea);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.webcam-link-card.primary-link,
.webcam-link-card[aria-pressed="true"] {
  border-color: rgba(47, 125, 138, 0.35);
  background: var(--mint);
}

.webcam-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 1040px) {
  .dashboard-shell {
    padding: 12px;
    gap: 9px;
  }

  .topbar {
    min-height: 96px;
    grid-template-columns: 220px minmax(570px, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .metric {
    padding: 10px;
  }

  .weather-panel {
    min-height: 112px;
  }

  .decision-panel {
    grid-template-columns: minmax(140px, 0.32fr) minmax(0, 1fr);
    height: 92px;
  }

  .decision-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-padding-left: 1px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .decision-grid::-webkit-scrollbar {
    display: none;
  }

  .decision-card {
    flex: 0 0 184px;
    scroll-snap-align: start;
  }

  .wind-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .watersports-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .watersports-summary {
    grid-template-columns: repeat(5, minmax(104px, 1fr));
    overflow-x: auto;
  }

  .webcam-layout {
    grid-template-columns: minmax(0, 1fr) 230px;
  }
}

@media (max-width: 899px) {
  html,
  body {
    width: 100%;
    max-width: 100dvw;
    height: auto;
    min-height: 100%;
  }

  body {
    overflow-y: auto;
  }

  body::before {
    transform: scale(1.04);
  }

  .dashboard-shell {
    width: 100dvw;
    max-width: 100dvw;
    height: auto;
    min-height: 100svh;
    grid-template-rows: auto auto auto auto auto;
    gap: 10px;
    overflow-x: hidden;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .topbar,
  .tide-panel,
  .decision-panel,
  .weather-panel {
    max-width: 100%;
  }

  .topbar {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 13px;
  }

  h1 {
    font-size: clamp(30px, 8vw, 40px);
    line-height: 0.98;
  }

  h2 {
    font-size: 17px;
  }

  .condition-summary {
    max-width: 100%;
    white-space: normal;
    line-height: 1.32;
  }

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

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

  .metric strong {
    font-size: clamp(21px, 7vw, 30px);
  }

  .metric span:last-child {
    font-size: 12px;
  }

  .tide-panel {
    min-height: 0;
    grid-template-rows: auto auto auto;
    gap: 9px;
    padding: 12px;
  }

  .panel-head,
  .weather-head {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .tide-title-line {
    align-items: flex-start;
    gap: 8px;
  }

  .sport-lights,
  .panel-meta {
    flex-wrap: wrap;
  }

  .sport-light {
    height: 30px;
  }

  .sport-reasons {
    display: grid;
    gap: 4px;
  }

  .decision-panel {
    height: auto;
    min-height: 0;
    gap: 9px;
    padding: 12px;
  }

  .decision-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
  }

  .decision-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-padding-left: 1px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .decision-card {
    flex: 0 0 230px;
    min-height: 118px;
    scroll-snap-align: start;
  }

  .panel-meta {
    gap: 8px;
  }

  .panel-meta span {
    font-size: 12px;
  }

  .chart-frame {
    min-height: 260px;
    height: clamp(260px, 62vw, 360px);
  }

  .graph-prev,
  .graph-next {
    width: 34px;
    height: 48px;
    font-size: 28px;
  }

  .graph-prev {
    left: 7px;
  }

  .graph-next {
    right: 7px;
  }

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

  .event-pill {
    min-height: 42px;
    font-size: 12px;
  }

  .weather-panel {
    min-height: 0;
    grid-template-rows: auto auto;
    padding: 12px;
  }

  .weather-actions {
    justify-content: flex-start;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .weather-actions::-webkit-scrollbar,
  .weather-strip::-webkit-scrollbar,
  .decision-grid::-webkit-scrollbar,
  .tide-events::-webkit-scrollbar,
  .dialog-summary::-webkit-scrollbar {
    display: none;
  }

  .weather-actions .text-button,
  .weather-actions .icon-button,
  .weather-actions span {
    flex: 0 0 auto;
  }

  .weather-actions span {
    max-width: none;
    font-size: 12px;
  }

  .weather-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-padding-left: 1px;
    scroll-snap-type: x proximity;
  }

  .weather-card {
    flex: 0 0 142px;
    min-height: 142px;
    scroll-snap-align: start;
  }

  .weather-main {
    align-items: flex-start;
  }

  .wind-line,
  .rain-line {
    font-size: 11px;
  }

  .footnote {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 0 2px 4px;
    line-height: 1.35;
  }

  .forecast-dialog,
  .install-dialog,
  .threshold-dialog,
  .note-dialog,
  .radar-dialog,
  .wind-dialog,
  .watersports-dialog,
  .webcam-dialog {
    width: calc(100dvw - 20px);
    max-width: none;
    max-height: calc(100svh - 20px);
    background: rgba(255, 255, 255, 0.96);
    padding: 13px;
  }

  body.dim-mode .forecast-dialog,
  body.dim-mode .install-dialog,
  body.dim-mode .threshold-dialog,
  body.dim-mode .note-dialog,
  body.dim-mode .radar-dialog,
  body.dim-mode .wind-dialog,
  body.dim-mode .watersports-dialog,
  body.dim-mode .webcam-dialog {
    background: rgba(23, 35, 36, 0.96);
  }

  .dialog-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .dialog-actions {
    gap: 6px;
  }

  .dialog-summary,
  .watersports-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow-x: visible;
  }

  .install-steps {
    grid-template-columns: 1fr;
  }

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

  .summary-pill {
    padding: 8px 9px;
  }

  .summary-pill strong {
    font-size: 16px;
  }

  .dialog-grid {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .radar-map {
    height: min(58svh, 390px);
    min-height: 280px;
  }

  .wind-layout,
  .watersports-layout,
  .webcam-layout {
    grid-template-columns: 1fr;
  }

  .wind-water-read {
    grid-template-columns: 1fr;
  }

  .wind-map {
    min-height: 330px;
  }

  .wind-station-list,
  .watersports-side {
    max-height: none;
    overflow: visible;
  }

  .watersports-chart {
    min-height: 370px;
  }

  .watersports-score strong {
    font-size: 22px;
  }

  .webcam-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .webcam-caption a {
    text-align: left;
  }

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

  .webcam-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .dashboard-shell {
    gap: 9px;
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .topbar,
  .tide-panel,
  .decision-panel,
  .weather-panel {
    border-radius: 8px;
  }

  .eyebrow,
  .panel-kicker,
  .metric-label {
    font-size: 10px;
  }

  h1 {
    font-size: clamp(28px, 9.6vw, 36px);
  }

  .status-grid {
    gap: 7px;
  }

  .metric {
    min-height: 72px;
    padding: 9px;
  }

  .metric strong {
    font-size: clamp(20px, 7.3vw, 27px);
  }

  .metric span:last-child {
    font-size: 11px;
  }

  .tide-title-line {
    display: grid;
  }

  .sport-lights {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sport-light {
    justify-content: center;
    padding: 0 6px;
  }

  .decision-head {
    align-items: stretch;
    flex-direction: column;
  }

  .decision-card {
    flex-basis: 218px;
  }

  .panel-meta .text-button,
  .weather-actions .text-button {
    padding: 0 10px;
  }

  .weather-actions {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .weather-actions .text-button,
  .weather-actions .icon-button {
    flex: 0 1 auto;
  }

  .weather-actions span {
    flex: 1 1 100%;
  }

  .chart-frame {
    height: 282px;
    min-height: 282px;
  }

  .tide-events {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .event-pill {
    flex: 0 0 156px;
    scroll-snap-align: start;
  }

  .weather-card {
    flex-basis: 136px;
    padding: 9px;
  }

  .weather-icon {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .forecast-dialog,
  .install-dialog,
  .threshold-dialog,
  .note-dialog,
  .radar-dialog,
  .wind-dialog,
  .watersports-dialog,
  .webcam-dialog {
    width: 100dvw;
    height: 100svh;
    max-height: 100svh;
    margin: 0;
    border-radius: 0;
    padding:
      max(12px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

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

  .install-steps {
    grid-template-columns: 1fr;
  }

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

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

  .dialog-grid.week-grid {
    grid-template-columns: 1fr;
  }

  .forecast-hour {
    min-height: 118px;
  }

  .radar-map {
    height: min(55svh, 360px);
    min-height: 260px;
  }

  .wind-map {
    min-height: 300px;
  }

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

  .watersports-chart {
    min-height: 320px;
  }

  .watersports-zone {
    width: 13px;
    height: 13px;
    max-width: none;
    gap: 0;
    overflow: hidden;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(23, 33, 28, 0.28);
  }

  .watersports-zone.good {
    background: var(--sea);
  }

  .watersports-zone.watch {
    background: var(--amber);
  }

  .watersports-zone.alert {
    background: var(--rose);
  }

  .watersports-zone strong,
  .watersports-zone span {
    display: none;
  }

  .watersports-wind-pin .wind-map-label {
    width: 92px;
    max-width: 92px;
    padding: 3px 6px;
  }

  .watersports-wind-pin.edge-east .wind-map-label {
    --label-x: -52px;
  }

  .watersports-wind-pin.edge-west .wind-map-label {
    --label-x: 52px;
  }

  .watersports-map-attribution {
    left: 6px;
    right: 6px;
    justify-content: center;
    font-size: 9px;
  }

  .webcam-layout {
    gap: 10px;
  }

  .webcam-side {
    grid-template-columns: 1fr;
  }

  .webcam-checks {
    gap: 7px;
  }
}

@media (max-width: 380px) {
  .status-grid,
  .dialog-summary,
  .watersports-summary,
  .webcam-checks {
    grid-template-columns: 1fr;
  }

  .chart-frame {
    height: 265px;
    min-height: 265px;
  }

  .weather-card {
    flex-basis: 132px;
  }
}

/* Launch polish: prominent observations and touch-friendly controls. */
.current-wind {
  display: grid;
  gap: 3px;
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  text-align: left;
  color: var(--sea-deep);
  background: var(--mint);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.current-wind-label { font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.current-wind strong { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; }
.current-wind span:last-child { font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.current-wind.wind-is-stale { background: var(--surface); color: var(--muted); }
.load-status { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.load-status.error-state { color: var(--rose); }
.no-script { padding: 16px; background: var(--panel); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--sea-deep); outline-offset: 3px; }
button:disabled { cursor: default; }
@media (min-width: 900px) {
  .dashboard-shell { min-height: 780px; }
  .topbar { grid-template-columns: minmax(230px, .85fr) minmax(0, 2fr); }
  .status-grid { min-width: 0; }
}
@media (max-width: 899px) {
  .current-wind { grid-template-columns: 1fr auto; align-items: center; padding: 12px; }
  .current-wind strong { grid-column: 2; grid-row: 1 / 3; font-size: clamp(23px, 6vw, 32px); }
  .current-wind span:last-child { grid-column: 1; }
  .title-actions .install-button, .wind-unit-toggle button, .text-button, .icon-button { min-height: 44px; }
  .icon-button { min-width: 44px; }
  .weather-actions { flex-wrap: wrap; overflow: visible; }
  .weather-actions span { flex-basis: 100%; white-space: normal; }
  .condition-summary { font-weight: 500; }
}
@media (max-width: 380px) {
  .current-wind { grid-template-columns: 1fr; }
  .current-wind strong, .current-wind span:last-child { grid-column: auto; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
