:root {
  color-scheme: light;
  --ink: #13202b;
  --muted: #5e7182;
  --line: rgba(126, 148, 165, 0.28);
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --surface: #eff6f7;
  --accent: #007f8f;
  --accent-strong: #045b69;
  --shadow: 0 18px 55px rgba(12, 35, 48, 0.2);
}

/* Critical Leaflet layout rules. Keep these locally so the map still renders
   correctly if the CDN stylesheet is blocked or its integrity check fails. */
.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-container {
  overflow: hidden;
  font-family: inherit;
  background: #dce8ec;
}

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

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

.leaflet-map-pane {
  z-index: auto;
}

.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-tooltip {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.leaflet-tooltip.leaflet-interactive {
  cursor: pointer;
  pointer-events: auto;
}

.leaflet-tooltip-top::before,
.leaflet-tooltip-bottom::before,
.leaflet-tooltip-left::before,
.leaflet-tooltip-right::before {
  position: absolute;
  pointer-events: none;
  border: 6px solid transparent;
  background: transparent;
  content: "";
}

.leaflet-tooltip-top {
  margin-top: -6px;
}

.leaflet-tooltip-top::before {
  bottom: 0;
  left: 50%;
  margin-bottom: -12px;
  margin-left: -6px;
  border-top-color: rgba(20, 28, 35, 0.9);
}

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

.leaflet-tile {
  filter: inherit;
  visibility: hidden;
}

.leaflet-tile-loaded {
  visibility: inherit;
}

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

.leaflet-interactive {
  cursor: pointer;
}

.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
  pointer-events: none;
}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
  pointer-events: visiblePainted;
  pointer-events: auto;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control-zoom {
  margin: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(13, 38, 54, 0.18);
}

.leaflet-control-zoom a {
  display: block;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.leaflet-control-attribution {
  margin: 0 10px 8px 0;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

.shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.control-rail,
.detail-card {
  position: fixed;
  z-index: 2;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.control-rail {
  left: 24px;
  top: 24px;
  width: min(440px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 12px;
  overflow: auto;
}

.brand-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
}

.brand-row img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

p {
  margin: 0;
}

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

.brand-row p {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 252, 253, 0.78);
}

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

.mode-button {
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(91, 115, 132, 0.32);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.1;
}

.mode-button:hover {
  border-color: var(--accent);
}

.mode-button:disabled,
select:disabled,
input[type="range"]:disabled {
  cursor: wait;
  opacity: 0.62;
}

.mode-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.mode-description {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 750;
}

.time-field {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 252, 253, 0.78);
}

.time-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.time-header > span {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.time-buttons {
  display: inline-grid;
  grid-template-columns: 32px minmax(58px, auto) 32px;
  gap: 6px;
  align-items: center;
}

.time-button {
  min-width: 0;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid rgba(91, 115, 132, 0.32);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.time-button:hover:not(:disabled) {
  border-color: var(--accent);
}

.time-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.time-button-play {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(91, 115, 132, 0.32);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

input[type="range"] {
  accent-color: var(--accent);
}

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

.summary-row {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
}

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

.summary-row strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.is-loading-placeholder strong,
.legend-row.is-loading-placeholder .legend-label,
.legend-row.is-loading-placeholder .legend-detail,
.legend-row.is-loading-placeholder .swatch {
  border-radius: 6px;
  color: transparent;
  background: linear-gradient(90deg, rgba(203, 221, 226, 0.75), rgba(238, 247, 249, 0.95), rgba(203, 221, 226, 0.75));
  background-size: 220% 100%;
  animation: loadingPulse 1.4s ease-in-out infinite;
}

.is-loading-placeholder strong {
  width: min(100%, 92px);
  min-height: 21px;
}

.legend-row.is-loading-placeholder .legend-label {
  min-height: 14px;
}

.legend-row.is-loading-placeholder .legend-detail {
  width: 52px;
  min-height: 12px;
}

.legend-row.is-loading-placeholder .swatch {
  border-color: transparent;
}

@keyframes loadingPulse {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.destination-recommendations {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(0, 127, 143, 0.22);
  border-radius: 8px;
  background: rgba(232, 248, 250, 0.78);
}

.destination-recommendations-title {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.destination-pick-list {
  display: grid;
  gap: 6px;
}

.destination-pick,
.destination-empty {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.destination-pick {
  display: grid;
  gap: 2px;
}

.destination-pick strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.destination-pick-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  align-items: baseline;
  color: var(--ink);
}

.destination-separator {
  color: var(--muted);
  font-weight: 800;
}

.legend {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.legend-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend-scale {
  display: grid;
  gap: 6px;
}

.legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 24px;
  font-size: 12px;
}

.legend-label {
  min-width: 0;
  font-weight: 750;
}

.legend-detail {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.swatch {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.22);
}

.forecast-status {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.forecast-status strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.forecast-status span {
  overflow-wrap: anywhere;
}

.info-button {
  min-height: 38px;
  justify-self: start;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-button:hover {
  background: #ffffff;
}

.data-attribution {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-attribution strong {
  color: var(--ink);
}

.data-attribution a {
  color: var(--accent-strong);
  font-weight: 800;
}

.detail-card {
  right: 24px;
  top: 24px;
  bottom: 24px;
  width: min(430px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 16px;
  border-radius: 12px;
  overflow: hidden;
}

.detail-card.is-empty {
  top: 24px;
  bottom: auto;
  width: min(360px, calc(100vw - 48px));
  max-height: none;
  display: block;
  padding: 14px 16px;
  overflow: visible;
}

.map-hint {
  display: grid;
  gap: 4px;
}

.map-hint-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.map-hint-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 127, 143, 0.12);
  vertical-align: 1px;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: start;
}

.detail-close {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}

.detail-close:hover {
  background: #ffffff;
}

.detail-profile-link {
  display: inline-block;
  margin-top: 7px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
}

.detail-profile-link:hover {
  text-decoration: underline;
}

.detail-meta {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.sunlight-panel {
  margin: 0;
}

.sunlight-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sunlight-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(0, 127, 143, 0.12);
  background: #dff5f7;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.sunlight-pill span {
  white-space: nowrap;
}

.sunlight-pill-wide {
  max-width: 100%;
}

.sunlight-pill-wide span {
  white-space: normal;
  overflow-wrap: anywhere;
}

.beach-report-scroll {
  min-height: 0;
  max-height: none;
  padding-top: 12px;
  padding-right: 4px;
  border-top: 1px solid var(--line);
  overflow: auto;
  scrollbar-gutter: stable;
}

.forecast-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(0, 127, 143, 0.12);
}

.forecast-context-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.1;
}

.forecast-context-time {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #dff5f7;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

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

.beach-metric {
  min-height: 86px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 252, 253, 0.9);
}

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

.beach-metric strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
}

.beach-metric small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.beach-metric-accent {
  background: #e8f8fa;
  border-color: rgba(0, 127, 143, 0.22);
}

.beach-metric-excellent {
  border-color: rgba(80, 240, 230, 0.8);
}

.beach-metric-good {
  border-color: rgba(80, 204, 170, 0.8);
}

.beach-metric-fair {
  border-color: rgba(240, 230, 65, 0.9);
}

.beach-metric-poor {
  border-color: rgba(255, 80, 80, 0.7);
}

.beach-metric-very-poor {
  border-color: rgba(150, 0, 50, 0.55);
}

.detail-accordion {
  display: grid;
  gap: 8px;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.detail-section summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 9px 11px;
  background: rgba(248, 252, 253, 0.92);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.detail-section[open] summary {
  border-bottom: 1px solid var(--line);
  background: #eef8fa;
}

.detail-section-body {
  padding: 11px;
}

.beach-section-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.beach-section-block {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 252, 253, 0.86);
}

.beach-section-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.fact-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.fact-list li {
  margin-bottom: 6px;
}

.fact-list li:last-child {
  margin-bottom: 0;
}

.section-copy {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 28px;
}

.info-modal.is-open {
  display: grid;
  place-items: center;
}

.info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 28, 37, 0.42);
  backdrop-filter: blur(3px);
}

.info-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 48px));
  max-height: min(82vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.info-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.info-dialog-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.info-dialog-body {
  padding: 18px;
  overflow: auto;
}

.info-dialog-body h3 {
  margin: 18px 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-dialog-body h3:first-child {
  margin-top: 0;
}

.info-dialog-body p,
.info-dialog-body li {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.info-dialog-body p {
  margin: 0 0 10px;
}

.info-dialog-body ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.detail-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.15;
}

.detail-card h3 {
  margin: 18px 0 9px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
}

a {
  color: var(--accent-strong);
  font-weight: 800;
}

.leaflet-tooltip {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  background: rgba(20, 28, 35, 0.88);
  box-shadow: 0 10px 24px rgba(15, 34, 45, 0.18);
  color: #ffffff;
  font-weight: 600;
}

.leaflet-tooltip.aithra-map-tooltip {
  max-width: min(340px, calc(100vw - 32px));
  white-space: normal;
}

.tooltip-card {
  display: grid;
  gap: 4px;
  min-width: 230px;
  max-width: 340px;
  line-height: 1.25;
}

.tooltip-title {
  display: block;
  margin-bottom: 1px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.tooltip-location {
  display: block;
  margin-bottom: 3px;
  color: rgba(244, 251, 252, 0.82);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.tooltip-row {
  display: grid;
  grid-template-columns: minmax(84px, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
  font-weight: 550;
}

.tooltip-text {
  display: block;
  font-size: 12px;
  font-weight: 550;
  overflow-wrap: anywhere;
  text-align: right;
}

.tooltip-icon {
  display: block;
  min-width: 84px;
  color: rgba(244, 251, 252, 0.82);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  text-align: left;
  transform: translateY(1px);
}

.tooltip-note {
  display: block;
  color: rgba(244, 251, 252, 0.9);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.tooltip-note strong {
  color: #f4fbfc;
  font-weight: 850;
}

.tooltip-divider {
  display: block;
  height: 1px;
  margin: 4px 0;
  background: rgba(244, 251, 252, 0.18);
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  #map {
    position: relative;
    height: 56vh;
    min-height: 420px;
  }

  .control-rail,
  .detail-card {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: auto;
    max-height: none;
    display: grid;
    gap: 14px;
    margin: 14px;
    overflow: visible;
  }

  .beach-report-scroll {
    max-height: none;
    overflow: visible;
  }

  .info-modal {
    padding: 14px;
  }

  .shell {
    display: flex;
    flex-direction: column;
  }

  .control-rail {
    order: -1;
  }

  .detail-card.is-empty {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    background: #e8f1f3;
  }

  #map {
    height: 46vh;
    min-height: 340px;
  }

  .control-rail,
  .detail-card {
    margin: 8px;
    border-radius: 10px;
  }

  .control-rail {
    gap: 12px;
    padding: 14px;
  }

  .control-grid,
  .beach-section-split {
    grid-template-columns: 1fr;
  }

  .brand-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .brand-row img {
    width: 40px;
    height: 40px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 9px;
    line-height: 1.25;
  }

  h1 {
    font-size: 24px;
  }

  .brand-row p {
    font-size: 12px;
    line-height: 1.28;
  }

  .field {
    gap: 6px;
    font-size: 12px;
  }

  select {
    min-height: 38px;
    padding: 7px 9px;
  }

  .mode-panel,
  .time-field,
  .legend,
  .forecast-status,
  .data-attribution {
    border-radius: 8px;
  }

  .mode-panel {
    gap: 7px;
    padding: 9px;
  }

  .mode-bar {
    gap: 6px;
  }

  .mode-button {
    min-height: 34px;
    padding: 6px 5px;
    font-size: 11px;
  }

  .mode-description {
    font-size: 11px;
  }

  .time-field {
    gap: 9px;
    padding: 11px;
  }

  .time-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .time-header > span {
    font-size: 12px;
  }

  .time-buttons {
    width: 100%;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 7px;
  }

  .time-button {
    height: 34px;
  }

  .summary {
    grid-template-columns: repeat(3, minmax(96px, 1fr));
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .summary-row {
    min-height: 58px;
    padding: 9px;
    border-radius: 8px;
  }

  .summary-row span {
    font-size: 9px;
    line-height: 1.15;
  }

  .summary-row strong {
    font-size: 18px;
  }

  .legend {
    gap: 7px;
    padding: 10px;
  }

  .legend-title {
    font-size: 10px;
  }

  .legend-scale {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 4px;
  }

  .legend-row {
    grid-template-columns: 13px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 21px;
    font-size: 11px;
  }

  .legend-detail {
    font-size: 10px;
  }

  .swatch {
    width: 13px;
    height: 13px;
  }

  .info-button {
    width: 100%;
    justify-self: stretch;
    min-height: 36px;
  }

  .data-attribution {
    display: none;
  }

  .detail-card {
    gap: 12px;
    padding: 12px;
  }

  .detail-card h2 {
    font-size: 19px;
  }

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

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

  .beach-metric span {
    font-size: 10px;
  }

  .beach-metric strong {
    font-size: 16px;
  }

  .info-modal {
    padding: 8px;
  }

  .info-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 10px;
  }

  .info-dialog-header,
  .info-dialog-body {
    padding: 14px;
  }

  .info-dialog-header h2 {
    font-size: 19px;
  }

  .leaflet-control-zoom {
    margin: 10px;
  }

  .leaflet-control-attribution {
    max-width: calc(100vw - 20px);
    margin: 0 6px 6px 0;
    font-size: 9px;
  }
}

@media (hover: none), (pointer: coarse) {
  .leaflet-tooltip.aithra-map-tooltip {
    display: none;
  }
}

@media (max-width: 380px) {
  .control-rail {
    padding: 12px;
  }

  .mode-bar {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: 22px;
  }
}
