:root {
  color-scheme: dark;
  --ink: #f6fdff;
  --muted: #c5e6ea;
  --panel: rgba(4, 48, 58, 0.58);
  --line: rgba(226, 252, 255, 0.28);
  --cyan: #82edf2;
  --mint: #7ff0cc;
  --amber: #ffd28a;
  --coral: #ff7a69;
  --sea: #13a7b4;
  --sand: #f0dca8;
  --foam: #f4feff;
  --deep: #032329;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: #032329;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(3, 35, 41, 0.26), rgba(4, 45, 55, 0.52) 42%, rgba(3, 23, 28, 0.88) 100%),
    linear-gradient(115deg, rgba(244, 254, 255, 0.12), transparent 28%, rgba(19, 167, 180, 0.16) 62%, transparent 100%),
    url("./assets/ocean-wave-blur.jpg") center top / cover fixed no-repeat,
    #032329;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.04), transparent 28%),
    repeating-linear-gradient(168deg, rgba(244, 254, 255, 0.052) 0 1px, transparent 1px 92px);
  opacity: 0.66;
}

body::after {
  content: "";
  position: fixed;
  left: -12vw;
  right: -12vw;
  bottom: -20vh;
  height: 42vh;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(168deg, transparent 0 34%, rgba(244, 254, 255, 0.22) 34% 36%, transparent 36% 100%),
    linear-gradient(172deg, transparent 0 48%, rgba(130, 237, 242, 0.16) 48% 50%, transparent 50% 100%),
    repeating-linear-gradient(170deg, rgba(244, 254, 255, 0.18) 0 2px, transparent 2px 34px),
    linear-gradient(180deg, rgba(19, 167, 180, 0), rgba(19, 167, 180, 0.28));
  filter: blur(10px);
  opacity: 0.56;
  transform: translate3d(0, 0, 0) rotate(-2deg);
  animation: oceanDrift 18s ease-in-out infinite alternate;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 44, 52, 0.56);
  backdrop-filter: blur(22px) saturate(1.22);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(238, 251, 255, 0.78);
  border-radius: 50%;
  background:
    radial-gradient(circle at 64% 28%, rgba(241, 214, 160, 0.9) 0 3px, transparent 4px),
    linear-gradient(180deg, rgba(118, 215, 232, 0.28), rgba(22, 141, 160, 0.34));
  box-shadow: inset 0 -8px 0 rgba(112, 223, 189, 0.42), 0 0 18px rgba(118, 215, 232, 0.28);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.status-pill {
  justify-self: end;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d8edf2;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.typhoon-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 210, 138, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 210, 138, 0.14), rgba(130, 237, 242, 0.08)),
    rgba(4, 48, 58, 0.56);
  box-shadow: 0 18px 46px rgba(0, 36, 42, 0.22);
}

.typhoon-entry h2 {
  margin: 4px 0 6px;
}

.typhoon-entry p {
  margin: 0;
  color: #d5eef3;
  line-height: 1.55;
}

.typhoon-entry-link,
.typhoon-back-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 254, 255, 0.34);
  border-radius: 8px;
  padding: 0 16px;
  color: #062b31;
  font-weight: 800;
  background: linear-gradient(135deg, var(--amber), var(--mint));
}

.typhoon-shell {
  width: min(1320px, calc(100% - 32px));
}

.typhoon-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(2, 27, 34, 0.94), rgba(5, 79, 89, 0.56)),
    url("./assets/south-china-map-blur.png") center / cover no-repeat;
  box-shadow: 0 20px 56px rgba(0, 24, 32, 0.28);
}

.typhoon-hero h1 {
  margin: 6px 0 12px;
  font-size: clamp(30px, 3.6vw, 48px);
}

.typhoon-hero p {
  max-width: 780px;
  margin-bottom: 0;
  color: #d7eef3;
  line-height: 1.7;
}

.typhoon-hero .typhoon-safety-officer {
  display: inline-block;
  max-width: min(100%, 980px);
  border: 1px solid rgba(255, 210, 138, 0.34);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff2cc;
  white-space: normal;
  background: rgba(255, 210, 138, 0.1);
}

.typhoon-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.typhoon-selector,
.typhoon-panel,
.typhoon-map-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.1), rgba(4, 48, 58, 0.5)),
    var(--panel);
  box-shadow: 0 20px 54px rgba(0, 36, 42, 0.22);
  backdrop-filter: blur(18px) saturate(1.18);
}

.typhoon-selector {
  position: sticky;
  top: 80px;
  align-self: start;
  padding: 16px;
}

.typhoon-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.typhoon-summary-grid,
.typhoon-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.typhoon-summary-card,
.typhoon-decision-card {
  min-height: 190px;
}

.typhoon-bullets {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: #d9f0f4;
  line-height: 1.55;
}

.typhoon-bullets li {
  padding-left: 16px;
  border-left: 3px solid rgba(255, 210, 138, 0.72);
}

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

.decision-grid div {
  min-height: 76px;
  border: 1px solid rgba(226, 252, 255, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(244, 254, 255, 0.055);
}

.decision-grid span,
.typhoon-source-box span,
.region-impact-card span,
.gate-card span,
.daily-date span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.decision-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--amber);
  font-size: 18px;
}

.typhoon-safety-text {
  margin: 14px 0 0;
  color: #d9f0f4;
  line-height: 1.6;
}

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

.typhoon-list-item {
  width: 100%;
  min-height: 94px;
  border: 1px solid rgba(226, 252, 255, 0.18);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: rgba(244, 254, 255, 0.05);
  cursor: pointer;
}

.typhoon-list-item.active {
  border-color: rgba(255, 210, 138, 0.7);
  background: rgba(255, 210, 138, 0.12);
}

.typhoon-list-item span,
.typhoon-list-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.typhoon-list-item strong {
  display: block;
  margin: 7px 0;
  font-size: 17px;
}

.typhoon-source-box {
  margin-top: 16px;
  border-top: 1px solid rgba(226, 252, 255, 0.18);
  padding-top: 14px;
}

.typhoon-source-box strong {
  display: block;
  margin-bottom: 8px;
}

.typhoon-source-box p {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0 0 8px;
  color: #d9f0f4;
  font-size: 12px;
}

.typhoon-source-box p strong {
  margin: 0;
  color: var(--amber);
  font-size: 12px;
}

.typhoon-map-panel,
.typhoon-panel {
  padding: 18px;
}

.typhoon-map-wrap {
  position: relative;
  aspect-ratio: 100 / 64;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 252, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(9, 69, 82, 0.5), rgba(2, 24, 31, 0.68)),
    rgba(244, 254, 255, 0.04);
}

.typhoon-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.typhoon-map-sea {
  fill: rgba(45, 119, 155, 0.34);
}

.typhoon-map-land {
  fill: rgba(178, 225, 156, 0.24);
  stroke: rgba(218, 248, 226, 0.26);
  stroke-width: 0.18;
}

.typhoon-map-land.mainland {
  fill: rgba(182, 232, 156, 0.28);
}

.typhoon-map-land.island {
  fill: rgba(230, 246, 214, 0.82);
}

.typhoon-map-coast {
  fill: none;
  stroke: rgba(225, 255, 226, 0.64);
  stroke-width: 0.34;
}

.warning-line {
  fill: none;
  stroke-width: 0.24;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.42;
}

.warning-24 {
  stroke: rgba(244, 238, 88, 0.58);
}

.warning-48 {
  stroke: rgba(64, 109, 255, 0.52);
  stroke-dasharray: 1 1.6;
}

.warning-label {
  font-size: 1.75px;
  font-weight: 800;
  writing-mode: vertical-rl;
  paint-order: stroke;
  stroke: rgba(2, 24, 31, 0.42);
  stroke-width: 0.38;
  opacity: 0.48;
}

.warning-label-24 {
  fill: rgba(255, 218, 61, 0.72);
}

.warning-label-48 {
  fill: rgba(109, 160, 255, 0.68);
}

.map-city-pin circle {
  fill: rgba(248, 251, 255, 0.72);
  stroke: rgba(127, 240, 204, 0.58);
  stroke-width: 0.22;
}

.map-surf-spot circle {
  fill: #f8fbff;
  stroke: rgba(127, 240, 204, 0.92);
  stroke-width: 0.42;
  filter: drop-shadow(0 0 2px rgba(127, 240, 204, 0.58));
}

.map-gate-area path {
  opacity: 0.26;
  stroke-width: 0.18;
}

.map-gate-area.high path {
  fill: rgba(127, 240, 204, 0.18);
  stroke: rgba(127, 240, 204, 0.4);
}

.map-gate-area.mid path {
  fill: rgba(255, 210, 138, 0.15);
  stroke: rgba(255, 210, 138, 0.36);
}

.map-gate-area.low path {
  fill: rgba(255, 122, 105, 0.12);
  stroke: rgba(255, 122, 105, 0.3);
}

.map-gate-area text {
  fill: rgba(247, 253, 255, 0.56);
  font-size: 2px;
  font-weight: 800;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(2, 24, 31, 0.42);
  stroke-width: 0.48;
  opacity: 0.58;
}

.map-flow-set {
  animation: typhoonFlowPulse 2.8s ease-in-out infinite;
  animation-delay: var(--flow-delay, 0s);
}

.map-flow-arrow {
  fill: none;
  stroke-linecap: round;
  stroke-width: 0.62;
  stroke-dasharray: 1.3 1.1;
}

.map-flow-arrow.swell {
  stroke: rgba(143, 238, 243, 0.82);
  marker-end: url("#swellArrowHead");
}

.map-flow-arrow.wind {
  stroke: rgba(255, 210, 138, 0.74);
  marker-end: url("#windArrowHead");
}

.swell-arrow-head {
  fill: rgba(143, 238, 243, 0.9);
}

.wind-arrow-head {
  fill: rgba(255, 210, 138, 0.86);
}

.typhoon-track-line {
  fill: none;
  stroke: url("#trackGradient");
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.typhoon-track-line.history {
  opacity: 0.45;
  stroke-width: 0.58;
}

.typhoon-forecast-line {
  fill: none;
  stroke: rgba(255, 210, 138, 0.92);
  stroke-width: 0.76;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1.5 1.2;
  opacity: 0.95;
}

.typhoon-forecast-point {
  fill: rgba(255, 210, 138, 0.92);
  stroke: rgba(5, 29, 35, 0.72);
  stroke-width: 0.22;
}

.typhoon-track-point {
  fill: var(--cyan);
  stroke: rgba(2, 24, 31, 0.85);
  stroke-width: 0.4;
}

.typhoon-track-point.current {
  fill: var(--amber);
}

.typhoon-track-hit {
  cursor: pointer;
  outline: none;
}

.typhoon-track-touch {
  fill: transparent;
  stroke: transparent;
}

.typhoon-track-hit.active .typhoon-track-point,
.typhoon-track-hit:focus-visible .typhoon-track-point {
  fill: #f8fbff;
  stroke: var(--amber);
  stroke-width: 0.72;
}

.map-gate circle {
  stroke: rgba(2, 24, 31, 0.72);
  stroke-width: 0.24;
  opacity: 0.78;
}

.map-gate.high circle,
.gate-legend i.high {
  fill: var(--mint);
  background: var(--mint);
}

.map-gate.mid circle,
.gate-legend i.mid {
  fill: var(--amber);
  background: var(--amber);
}

.map-gate.low circle,
.gate-legend i.low {
  fill: var(--coral);
  background: var(--coral);
}

.typhoon-map-empty {
  fill: rgba(244, 254, 255, 0.72);
  font-size: 3.4px;
  font-weight: 800;
}

.gate-legend {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gate-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid rgba(226, 252, 255, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  color: #e6f7fa;
  font-size: 12px;
  background: rgba(2, 24, 31, 0.48);
}

.gate-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.track-point-detail {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  min-width: 178px;
  max-width: min(240px, calc(100% - 28px));
  transform: translate(-50%, -112%);
  border: 1px solid rgba(226, 252, 255, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  color: #effdff;
  background:
    linear-gradient(180deg, rgba(9, 75, 88, 0.92), rgba(2, 24, 31, 0.94)),
    rgba(2, 24, 31, 0.92);
  box-shadow: 0 16px 34px rgba(0, 24, 31, 0.34);
  backdrop-filter: blur(16px);
}

.track-point-detail span,
.track-point-detail small {
  display: block;
  color: rgba(214, 239, 244, 0.76);
  font-size: 11px;
}

.track-point-detail strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.track-point-detail p {
  margin: 6px 0 4px;
  color: #cce8f3;
  font-size: 12px;
  line-height: 1.45;
}

@keyframes typhoonFlowPulse {
  0% {
    opacity: 0.36;
    stroke-dashoffset: 0;
  }

  50% {
    opacity: 0.9;
    stroke-dashoffset: -2.4;
  }

  100% {
    opacity: 0.36;
    stroke-dashoffset: -4.8;
  }
}

.typhoon-mini-meta {
  color: var(--muted);
  font-size: 12px;
}

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

.region-impact-card,
.gate-card,
.daily-analysis-card {
  border: 1px solid rgba(226, 252, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(244, 254, 255, 0.045);
}

.region-impact-card.high {
  border-color: rgba(127, 240, 204, 0.48);
}

.region-impact-card.mid {
  border-color: rgba(255, 210, 138, 0.48);
}

.region-impact-card.low {
  border-color: rgba(255, 122, 105, 0.42);
}

.region-impact-card strong,
.gate-card strong {
  display: block;
  margin: 5px 0 8px;
  font-size: 20px;
}

.region-impact-card p,
.gate-card p,
.daily-analysis-card p {
  margin: 0 0 12px;
  color: #d9f0f4;
  line-height: 1.58;
}

.region-impact-card small,
.gate-card small,
.daily-analysis-card small {
  color: var(--muted);
  line-height: 1.45;
}

.gate-card-list,
.daily-analysis-list {
  display: grid;
  gap: 12px;
}

.gate-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.gate-card div span {
  color: var(--amber);
  text-align: right;
}

.daily-date {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.daily-date strong {
  font-size: 18px;
}

.daily-date span {
  color: var(--amber);
  font-weight: 800;
}

.swell-outlook {
  overflow-x: auto;
}

.swell-table {
  min-width: 720px;
  display: grid;
  gap: 8px;
}

.swell-row {
  display: grid;
  grid-template-columns: 80px repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.swell-row > span {
  min-height: 58px;
  border: 1px solid rgba(226, 252, 255, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: #f7fdff;
  background: rgba(244, 254, 255, 0.045);
}

.swell-row.head > span {
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: rgba(244, 254, 255, 0.08);
}

.swell-row span.high {
  border-color: rgba(127, 240, 204, 0.48);
}

.swell-row span.mid {
  border-color: rgba(255, 210, 138, 0.48);
}

.swell-row span.low {
  border-color: rgba(255, 122, 105, 0.42);
}

.swell-row small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.typhoon-empty {
  border: 1px dashed rgba(226, 252, 255, 0.22);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.hero {
  position: relative;
  min-height: 360px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #082430;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 16, 21, 0.88), rgba(4, 16, 21, 0.42), rgba(4, 16, 21, 0.1));
}

.hero-overlay {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding: 58px 42px;
}

.eyebrow,
.section-title p,
.card-heading span {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.hero-copy {
  max-width: 560px;
  color: #cce8f3;
  font-size: 18px;
  line-height: 1.65;
}

.timeline-panel,
.spot-map-panel,
.summary-card,
.spot-card,
.tide-band,
.detail-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.1), rgba(4, 48, 58, 0.52)),
    var(--panel);
  box-shadow: 0 20px 54px rgba(0, 36, 42, 0.24);
  backdrop-filter: blur(18px) saturate(1.18);
}

.timeline-panel {
  margin-top: 18px;
  padding: 14px 16px;
}

.timeline-panel .section-title {
  flex-direction: row;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.timeline-panel .section-title h2 {
  font-size: 18px;
}

.spot-map-panel {
  margin-top: 16px;
  padding: 18px;
}

.spot-map-title h2 {
  font-size: 16px;
}

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

.region-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 16px;
}

.region-tab {
  --tier-color: var(--cyan);
  min-height: 58px;
  border: 1px solid rgba(178, 230, 238, 0.26);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.08), rgba(4, 54, 64, 0.46)),
    rgba(244, 254, 255, 0.035);
  text-align: left;
  cursor: pointer;
}

.region-tab.score-high {
  --tier-color: var(--mint);
}

.region-tab.score-mid {
  --tier-color: var(--amber);
}

.region-tab.score-low {
  --tier-color: var(--coral);
}

.region-tab.active {
  border-color: var(--tier-color);
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.18), rgba(4, 60, 70, 0.54)),
    rgba(127, 240, 204, 0.08);
  box-shadow: inset 0 0 0 1px var(--tier-color), 0 14px 32px rgba(0, 44, 50, 0.2);
}

.region-tab span,
.region-tab strong,
.region-tab small {
  display: block;
}

.region-tab .region-name {
  font-weight: 900;
}

.region-tab .region-head-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.region-tab strong {
  margin-top: 4px;
  color: var(--tier-color);
  font-size: 13px;
}

.region-tab small {
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}

.day-button {
  min-height: 82px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.09), rgba(4, 52, 62, 0.44)),
    rgba(244, 254, 255, 0.04);
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
}

.day-button.active {
  border-color: rgba(244, 254, 255, 0.9);
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.18), rgba(127, 240, 204, 0.1)),
    rgba(6, 68, 78, 0.54);
  box-shadow: inset 0 0 0 1px rgba(130, 237, 242, 0.28), 0 14px 30px rgba(0, 36, 42, 0.18);
}

.day-button.past {
  opacity: 0.72;
}

.day-label {
  display: inline;
  margin-bottom: 0;
  font-weight: 800;
}

.day-head-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 5px;
}

.day-date,
.day-wave {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.day-score {
  display: inline-block;
  margin-top: 0;
  font-size: 12px;
  font-weight: 900;
}

.day-score.score-high,
.metric.score-high strong {
  color: var(--mint);
}

.day-score.score-mid,
.metric.score-mid strong {
  color: var(--amber);
}

.day-score.score-low,
.metric.score-low strong {
  color: var(--coral);
}

.map-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
}

.map-stage {
  --map-backdrop-zoom: 1.1;
  --map-tint: rgba(19, 160, 170, 0.24);
  --map-accent: rgba(236, 253, 255, 0.2);
  --wave-flow-angle: 0deg;
  --wind-flow-angle: 0deg;
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(178, 230, 238, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 86, 98, 0.18), rgba(5, 43, 52, 0.34)),
    #084555;
  isolation: isolate;
}

.map-backdrop,
.map-tone,
.map-scan,
.coastline {
  position: absolute;
  inset: 0;
}

.map-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0.7;
  filter: blur(7px) saturate(1.14) contrast(0.98);
  transform: scale(var(--map-backdrop-zoom));
  transform-origin: 50% 50%;
  transition: transform 420ms ease, object-position 420ms ease, filter 420ms ease, opacity 420ms ease;
}

.map-tone {
  background:
    radial-gradient(130% 80% at 20% 10%, var(--map-accent), transparent 66%),
    linear-gradient(170deg, var(--map-tint), rgba(3, 35, 43, 0.22) 50%, rgba(2, 26, 34, 0.56));
  mix-blend-mode: screen;
  opacity: 0.8;
  transition: background 420ms ease, opacity 420ms ease;
}

.map-pins-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.map-flow-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.flow-track {
  position: absolute;
  inset: -10%;
  opacity: 0.48;
  mix-blend-mode: screen;
  will-change: transform;
  overflow: hidden;
}

.flow-track-wave {
  transform: rotate(var(--wave-flow-angle));
  background: radial-gradient(circle at 50% 50%, rgba(182, 242, 255, 0.12), transparent 62%);
}

.flow-track-wind {
  transform: rotate(var(--wind-flow-angle));
  background: radial-gradient(circle at 50% 50%, rgba(140, 235, 248, 0.1), transparent 62%);
}

.flow-particle {
  position: absolute;
  display: block;
  left: -18%;
  top: 50%;
  width: 34px;
  height: 2px;
  border-radius: 999px;
  opacity: 0;
  animation: flowParticleTraverse 10s linear infinite;
}

.flow-track-wave .flow-particle {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  color: rgba(224, 251, 255, 0.92);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  transform: rotate(90deg);
  transform-origin: center;
  text-shadow: 0 0 9px rgba(193, 246, 255, 0.34);
}

.flow-track-wind .flow-particle {
  height: 1.7px;
  background: linear-gradient(90deg, rgba(145, 231, 247, 0), rgba(145, 231, 247, 0.32) 42%, rgba(210, 247, 255, 0.94));
  box-shadow: 0 0 9px rgba(153, 236, 249, 0.3);
}

.flow-track-wave.speed-slow .flow-particle {
  animation-duration: 12.5s;
}

.flow-track-wave.speed-mid .flow-particle {
  animation-duration: 9.5s;
}

.flow-track-wave.speed-fast .flow-particle {
  animation-duration: 7s;
}

.flow-track-wind.speed-slow .flow-particle {
  animation-duration: 13s;
}

.flow-track-wind.speed-mid .flow-particle {
  animation-duration: 10s;
}

.flow-track-wind.speed-fast .flow-particle {
  animation-duration: 7.2s;
}

.flow-track-wave.gap-tight .flow-particle.p1 { animation-delay: -0.4s; }
.flow-track-wave.gap-tight .flow-particle.p2 { animation-delay: -0.8s; }
.flow-track-wave.gap-tight .flow-particle.p3 { animation-delay: -1.2s; }
.flow-track-wave.gap-tight .flow-particle.p4 { animation-delay: -1.6s; }
.flow-track-wave.gap-tight .flow-particle.p5 { animation-delay: -2.0s; }
.flow-track-wave.gap-tight .flow-particle.p6 { animation-delay: -2.4s; }
.flow-track-wave.gap-tight .flow-particle.p7 { animation-delay: -2.8s; }
.flow-track-wave.gap-tight .flow-particle.p8 { animation-delay: -3.2s; }
.flow-track-wave.gap-tight .flow-particle.p9 { animation-delay: -3.6s; }
.flow-track-wave.gap-tight .flow-particle.p10 { animation-delay: -4.0s; }

.flow-track-wave.gap-mid .flow-particle.p1 { animation-delay: -0.7s; }
.flow-track-wave.gap-mid .flow-particle.p2 { animation-delay: -1.4s; }
.flow-track-wave.gap-mid .flow-particle.p3 { animation-delay: -2.1s; }
.flow-track-wave.gap-mid .flow-particle.p4 { animation-delay: -2.8s; }
.flow-track-wave.gap-mid .flow-particle.p5 { animation-delay: -3.5s; }
.flow-track-wave.gap-mid .flow-particle.p6 { animation-delay: -4.2s; }
.flow-track-wave.gap-mid .flow-particle.p7 { animation-delay: -4.9s; }
.flow-track-wave.gap-mid .flow-particle.p8 { animation-delay: -5.6s; }
.flow-track-wave.gap-mid .flow-particle.p9 { animation-delay: -6.3s; }
.flow-track-wave.gap-mid .flow-particle.p10 { animation-delay: -7.0s; }

.flow-track-wave.gap-wide .flow-particle.p1 { animation-delay: -1.1s; }
.flow-track-wave.gap-wide .flow-particle.p2 { animation-delay: -2.2s; }
.flow-track-wave.gap-wide .flow-particle.p3 { animation-delay: -3.3s; }
.flow-track-wave.gap-wide .flow-particle.p4 { animation-delay: -4.4s; }
.flow-track-wave.gap-wide .flow-particle.p5 { animation-delay: -5.5s; }
.flow-track-wave.gap-wide .flow-particle.p6 { animation-delay: -6.6s; }
.flow-track-wave.gap-wide .flow-particle.p7 { animation-delay: -7.7s; }
.flow-track-wave.gap-wide .flow-particle.p8 { animation-delay: -8.8s; }
.flow-track-wave.gap-wide .flow-particle.p9 { animation-delay: -9.9s; }
.flow-track-wave.gap-wide .flow-particle.p10 { animation-delay: -11.0s; }

.flow-track-wind .flow-particle.p1 { animation-delay: -1.2s; }
.flow-track-wind .flow-particle.p2 { animation-delay: -3.4s; }
.flow-track-wind .flow-particle.p3 { animation-delay: -0.9s; }
.flow-track-wind .flow-particle.p4 { animation-delay: -5.1s; }
.flow-track-wind .flow-particle.p5 { animation-delay: -2.7s; }
.flow-track-wind .flow-particle.p6 { animation-delay: -4.3s; }
.flow-track-wind .flow-particle.p7 { animation-delay: -6.3s; }
.flow-track-wind .flow-particle.p8 { animation-delay: -7.1s; }
.flow-track-wind .flow-particle.p9 { animation-delay: -4.9s; }
.flow-track-wind .flow-particle.p10 { animation-delay: -8.2s; }

.flow-particle.p3 {
  top: 34%;
  width: 30px;
}

.flow-particle.p1 {
  top: 12%;
  width: 26px;
}

.flow-particle.p2 {
  top: 22%;
  width: 32px;
}

.flow-particle.p4 {
  top: 44%;
  width: 35px;
}

.flow-particle.p5 {
  top: 56%;
  width: 33px;
}

.flow-particle.p6 {
  top: 66%;
  width: 29px;
}

.flow-particle.p7 {
  top: 74%;
  width: 38px;
}

.flow-particle.p8 {
  top: 82%;
  width: 31px;
}

.flow-particle.p9 {
  top: 27%;
  width: 28px;
}

.flow-particle.p10 {
  top: 61%;
  width: 36px;
}

.map-stage.wave-flow-unknown .flow-track-wave,
.map-stage.wind-flow-unknown .flow-track-wind {
  opacity: 0.2;
}

.flow-hud {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.flow-chip {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto auto 18px;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid rgba(223, 250, 255, 0.42);
  background: rgba(3, 39, 47, 0.66);
  backdrop-filter: blur(10px);
}

.flow-chip span {
  font-size: 11px;
  color: #c4edf5;
}

.flow-chip strong {
  font-size: 13px;
  color: #f1feff;
  letter-spacing: 0;
}

.flow-chip small {
  font-size: 11px;
  color: #bce3eb;
}

.flow-chip.wave {
  border-color: rgba(235, 252, 255, 0.48);
}

.flow-chip.wind {
  border-color: rgba(158, 234, 246, 0.48);
}

.flow-arrow {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  transform-origin: 50% 50%;
  transition: transform 280ms ease;
  color: rgba(236, 253, 255, 0.92);
}

.flow-arrow.wave-icon::before {
  content: "≈";
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.flow-arrow.wind-icon::before {
  content: "→";
  font-size: 15px;
  font-weight: 500;
}

.map-scan {
  background:
    linear-gradient(rgba(244, 254, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 237, 242, 0.018) 1px, transparent 1px);
  background-size: 94px 94px;
  mask-image: linear-gradient(180deg, transparent, black 18%, black 82%, transparent);
  opacity: 0.2;
}

.coastline {
  background:
    linear-gradient(108deg, transparent 0 38%, rgba(241, 214, 160, 0.16) 38% 41%, transparent 41%),
    linear-gradient(156deg, transparent 0 48%, rgba(118, 215, 232, 0.12) 48% 51%, transparent 51%);
  opacity: 0.78;
}

.map-pin {
  --pin-color: var(--cyan);
  --pin-glow: rgba(118, 215, 232, 0.72);
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 66px;
  min-height: 32px;
  border: 1px solid rgba(178, 230, 238, 0.36);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--ink);
  background: rgba(5, 47, 57, 0.66);
  box-shadow: 0 16px 28px rgba(0, 35, 42, 0.18);
  cursor: pointer;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
}


.map-pin[hidden] {
  display: none;
}

.map-pin.score-high {
  --pin-color: var(--mint);
  --pin-glow: rgba(68, 240, 178, 0.86);
}

.map-pin.score-mid {
  --pin-color: var(--amber);
  --pin-glow: rgba(244, 199, 107, 0.82);
}

.map-pin.score-low {
  --pin-color: var(--coral);
  --pin-glow: rgba(255, 105, 97, 0.78);
}

.map-pin.active {
  border-color: var(--pin-color);
  background: rgba(244, 254, 255, 0.16);
  box-shadow: inset 0 0 0 1px var(--pin-glow), 0 18px 34px rgba(0, 42, 50, 0.22);
}

.pin-dot {
  position: relative;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pin-color);
  box-shadow: 0 0 18px var(--pin-glow);
}

.map-pin.active .pin-dot {
  background: var(--pin-color);
  box-shadow: 0 0 20px var(--pin-glow);
}

.map-pin.active .pin-dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--pin-color);
  border-radius: 50%;
  animation: pinPulse 1.4s ease-out infinite;
}

.pin-label {
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.map-info {
  --spot-detail-image: url("./assets/ocean-wave-blur.jpg");
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 360px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(214, 246, 251, 0.24);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(160deg, rgba(240, 255, 255, 0.18), rgba(4, 49, 59, 0.58)),
    linear-gradient(180deg, rgba(2, 28, 34, 0.2), rgba(2, 24, 30, 0.86)),
    var(--spot-detail-image) center / cover no-repeat,
    url("./assets/ocean-wave-blur.jpg") center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 16px 36px rgba(0, 32, 40, 0.22);
}

.map-info > * {
  position: relative;
  z-index: 1;
}

.map-info h2 {
  margin-top: 8px;
  font-size: 34px;
}

.map-name-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.map-name-row h2 {
  margin: 0;
}


.map-info p:not(.eyebrow) {
  color: #cce8f3;
  line-height: 1.65;
}

.map-type-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spot-fav-btn {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(222, 250, 255, 0.36);
  border-radius: 8px;
  color: #d2eef5;
  background: rgba(7, 74, 86, 0.45);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.spot-fav-btn.active {
  border-color: rgba(127, 240, 204, 0.78);
  background: rgba(64, 177, 145, 0.24);
  color: #7ff0cc;
}

.default-spot-state {
  min-width: 0;
  color: #b7dde6;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.summary-grid,
.spots-grid,
.notes-band {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.summary-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
}

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

.notes-band {
  grid-template-columns: 1fr;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: rgba(214, 239, 244, 0.72);
}

.thanks-button {
  appearance: none;
  border: 1px solid rgba(214, 239, 244, 0.35);
  border-radius: 999px;
  padding: 4px 12px;
  color: rgba(239, 253, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
}

.thanks-button:hover,
.thanks-button:focus-visible {
  color: var(--foam);
  border-color: rgba(239, 253, 255, 0.58);
  background: rgba(255, 255, 255, 0.13);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--foam);
  text-decoration: underline;
}

.thanks-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.thanks-modal[hidden] {
  display: none;
}

.thanks-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(132, 235, 227, 0.2), transparent 38%),
    rgba(2, 22, 28, 0.68);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.thanks-modal-card {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid rgba(219, 250, 252, 0.36);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(243, 255, 255, 0.16), rgba(9, 88, 99, 0.62) 44%, rgba(3, 35, 43, 0.9)),
    rgba(5, 48, 58, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.thanks-modal-card::before {
  content: "";
  position: absolute;
  inset: auto -12% -34% -12%;
  height: 52%;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(246, 255, 255, 0.22), transparent 48%),
    repeating-radial-gradient(ellipse at 50% 100%, rgba(178, 246, 237, 0.2) 0 1px, transparent 1px 12px);
  opacity: 0.9;
  pointer-events: none;
}

.thanks-modal-shell {
  position: relative;
  padding: 30px 30px 26px;
}

.thanks-modal-kicker {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(223, 250, 251, 0.28);
  border-radius: 999px;
  padding: 4px 10px;
  color: rgba(203, 244, 246, 0.86);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.thanks-modal h2 {
  margin: 14px 0 12px;
  color: var(--foam);
  font-size: 26px;
  letter-spacing: 0;
}

.thanks-modal p {
  margin: 0;
  color: rgba(239, 253, 255, 0.9);
  font-size: 15px;
  line-height: 1.78;
  white-space: pre-line;
}

.thanks-modal-close {
  margin-top: 24px;
  width: 100%;
  border: 1px solid rgba(222, 251, 252, 0.42);
  border-radius: 999px;
  padding: 11px 18px;
  color: #07333a;
  background: linear-gradient(135deg, #e9ffff, #86efe4);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(83, 225, 216, 0.18);
}

.thanks-modal-close:hover,
.thanks-modal-close:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(83, 225, 216, 0.24);
}

.summary-card,
.spot-card,
.detail-band {
  padding: 20px;
}

.summary-card.ai-card,
.summary-card.safety-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(226, 252, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.12), rgba(6, 70, 82, 0.52) 44%),
    var(--panel);
}

.summary-card.ai-card::before,
.summary-card.safety-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(168deg, transparent 0 38%, rgba(244, 254, 255, 0.12) 38% 40%, transparent 40% 100%),
    linear-gradient(180deg, rgba(130, 237, 242, 0.08), transparent 44%);
  pointer-events: none;
  opacity: 0.9;
}

.summary-card.ai-card > *,
.summary-card.safety-card > * {
  position: relative;
  z-index: 1;
}

.summary-card.safety-card {
  border-color: rgba(244, 199, 107, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 232, 168, 0.13), rgba(69, 48, 10, 0.24) 48%, rgba(5, 50, 58, 0.5)),
    var(--panel);
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.card-heading strong {
  font-size: 13px;
  color: var(--muted);
}

.summary-card p {
  color: #d7edf5;
  line-height: 1.65;
}

#aiSummary {
  min-height: 112px;
  border: 1px solid rgba(226, 252, 255, 0.24);
  border-radius: 8px;
  padding: 14px;
  color: var(--foam);
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.075), rgba(4, 35, 43, 0.28)),
    rgba(4, 35, 43, 0.36);
  box-shadow: inset 0 0 26px rgba(130, 237, 242, 0.06);
  white-space: pre-line;
}


#aiSummary.typing::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: -0.18em;
  background: var(--mint);
  animation: cursorBlink 0.8s steps(1) infinite;
}

.alert-list {
  display: grid;
  gap: 8px;
  min-height: 112px;
}

.alert-item {
  padding: 10px 12px;
  border: 1px solid rgba(244, 199, 107, 0.35);
  border-radius: 8px;
  color: #ffe1a1;
  background: rgba(244, 199, 107, 0.09);
}

textarea {
  width: 100%;
  min-height: 132px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: rgba(4, 45, 54, 0.42);
  line-height: 1.55;
}

.note-image-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.note-image-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.note-image-btn,
.note-useful-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(205, 242, 247, 0.32);
  border-radius: 999px;
  padding: 0 12px;
  color: #e7fbff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  cursor: pointer;
}

button.note-image-btn {
  font: inherit;
}

.note-location-state {
  margin-top: 8px;
  display: inline-flex;
  max-width: 100%;
  border-radius: 999px;
  padding: 7px 12px;
  color: #d7fbf4;
  background: rgba(127, 240, 204, 0.12);
  font-size: 13px;
  cursor: pointer;
}

.note-location-state[hidden] {
  display: none;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.note-actions button {
  min-height: 38px;
  border: 1px solid rgba(244, 254, 255, 0.62);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--deep);
  background: var(--foam);
  font-weight: 800;
  cursor: pointer;
}

.note-actions button:disabled {
  opacity: 0.66;
  cursor: wait;
}

.note-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.note-item {
  border: 1px solid rgba(226, 252, 255, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(244, 254, 255, 0.055);
}

.note-item.muted {
  color: var(--muted);
}

.note-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--foam);
  font-size: 12px;
}

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

.note-item p {
  margin: 8px 0 0;
  color: #e4fbff;
  line-height: 1.6;
  white-space: pre-line;
}

.note-location {
  margin-top: 8px;
  color: #acdce3;
  font-size: 12px;
  line-height: 1.5;
}

.note-image {
  display: block;
  margin-top: 10px;
  width: min(260px, 100%);
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(226, 252, 255, 0.18);
}

.note-useful-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.note-useful-btn {
  min-height: 28px;
  font-size: 12px;
}

.note-useful-btn:disabled {
  opacity: 0.68;
  cursor: wait;
}

.note-useless-btn {
  color: #ffe8dc;
  border-color: rgba(255, 186, 150, 0.32);
  background: rgba(255, 186, 150, 0.12);
}

#saveState {
  color: var(--muted);
  font-size: 13px;
}

.spot-card {
  --spot-detail-image: url("./assets/ocean-wave-blur.jpg");
  position: relative;
  overflow: hidden;
  border-color: rgba(226, 252, 255, 0.28);
}

.spot-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sea), var(--foam), var(--mint));
  z-index: 2;
}

.spot-card.score-high {
  border-color: rgba(127, 240, 204, 0.48);
}

.spot-card.score-mid {
  border-color: rgba(255, 210, 138, 0.48);
}

.spot-card.score-low {
  border-color: rgba(255, 122, 105, 0.48);
}

.spot-card > :not(.spot-card-photo) {
  position: relative;
  z-index: 1;
}

.spot-card-photo {
  min-height: 138px;
  margin: -20px -20px 16px;
  display: flex;
  align-items: end;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(226, 252, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(3, 31, 39, 0.08), rgba(3, 31, 39, 0.78)),
    linear-gradient(130deg, rgba(127, 240, 204, 0.18), rgba(8, 74, 86, 0.1) 42%, rgba(3, 31, 39, 0.5)),
    var(--spot-detail-image) center / cover no-repeat,
    url("./assets/ocean-wave-blur.jpg") center / cover no-repeat;
}

.spots-grid.single .spot-card-photo {
  min-height: clamp(170px, 28vw, 260px);
}

.spot-card-photo span {
  display: inline-flex;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(224, 251, 255, 0.24);
  border-radius: 8px;
  color: #effdff;
  background: rgba(3, 31, 39, 0.44);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.spot-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.spot-name {
  margin: 0;
  font-size: 24px;
}

.rating {
  min-width: 76px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #021014;
  font-weight: 900;
}

.rating.Good {
  background: var(--mint);
}

.rating.Fair {
  background: var(--amber);
}

.rating.Poor {
  background: var(--coral);
}

.rating.score-high {
  background: var(--mint);
}

.rating.score-mid {
  background: var(--amber);
}

.rating.score-low {
  background: var(--coral);
}

.score-ring {
  --tier-color: var(--cyan);
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  margin: 18px 0;
  border-radius: 50%;
  background: conic-gradient(var(--tier-color) calc(var(--score) * 1%), rgba(255, 255, 255, 0.08) 0);
}

.score-ring.score-high {
  --tier-color: var(--mint);
}

.score-ring.score-mid {
  --tier-color: var(--amber);
}

.score-ring.score-low {
  --tier-color: var(--coral);
}

.score-ring.focus {
  box-shadow: 0 0 34px rgba(68, 240, 178, 0.2);
}

.score-ring span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.08), transparent 46%),
    #073942;
  font-weight: 900;
  font-size: 24px;
}

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

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244, 254, 255, 0.06);
}

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

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.spot-note {
  margin: 14px 0 0;
  color: #c6dfe9;
  line-height: 1.55;
}

.spot-best-window {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-band {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}

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

.spots-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.spot-card[hidden] {
  display: none;
}

.tide-band {
  margin-top: 16px;
  padding: 18px;
  overflow: hidden;
}

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

.tide-band-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: #c9eef3;
  font-size: 12px;
}

.tide-band-meta span,
.tide-band-meta strong {
  min-height: 28px;
  border: 1px solid rgba(178, 230, 238, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(244, 254, 255, 0.06);
  color: #d9f8fb;
  font-weight: 800;
}

.tide-band-meta strong {
  color: var(--cyan);
}

.tide-band-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.trend-metric-tabs {
  display: flex;
  width: 100%;
  max-width: 320px;
  gap: 6px;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid rgba(178, 230, 238, 0.2);
  border-radius: 8px;
  background: rgba(2, 35, 43, 0.42);
}

.trend-metric-tabs button {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  box-sizing: border-box;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 6px 4px;
  background: transparent;
  color: #acd6dc;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.trend-metric-tabs button:hover {
  color: var(--foam);
  background: rgba(244, 254, 255, 0.07);
}

.trend-metric-tabs button.active {
  color: #032e36;
  background: var(--foam);
  box-shadow: 0 4px 14px rgba(143, 238, 243, 0.18);
}

.tide-chart-card {
  border: 1px solid rgba(207, 244, 250, 0.18);
  border-radius: 8px;
  padding: 14px 14px 10px;
  background:
    linear-gradient(180deg, rgba(143, 238, 243, 0.08), rgba(3, 36, 45, 0.32)),
    rgba(4, 47, 58, 0.38);
}

.web-tide-plot {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.web-tide-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.web-tide-grid {
  stroke: rgba(207, 244, 250, 0.16);
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}

.web-tide-line {
  fill: none;
  stroke: #7ff0cc;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgba(127, 240, 204, 0.28));
}

.tide-chart-card.metric-wave .web-tide-line {
  stroke: #67dce7;
}

.tide-chart-card.metric-score .web-tide-line {
  stroke: #f4c76b;
}

.tide-chart-card.metric-wind .web-tide-line {
  stroke: #ff9b84;
}

.web-tide-marker.sample {
  fill: #effdff;
}

.tide-chart-card.metric-wave .web-tide-marker.sample {
  fill: #67dce7;
}

.tide-chart-card.metric-score .web-tide-marker.sample {
  fill: #f4c76b;
}

.tide-chart-card.metric-wind .web-tide-marker.sample {
  fill: #ff9b84;
}

.web-tide-marker {
  stroke: rgba(4, 47, 58, 0.96);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.web-tide-marker.high {
  fill: var(--amber);
}

.web-tide-marker.low {
  fill: var(--mint);
}

.web-tide-label {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 92px;
  border: 1px solid rgba(226, 252, 255, 0.22);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(3, 35, 41, 0.78);
  color: #f6fdff;
  text-align: center;
  box-shadow: 0 12px 26px rgba(0, 28, 34, 0.22);
  backdrop-filter: blur(10px);
  max-width: min(130px, calc(100% - 16px));
}

.web-tide-label.above {
  transform: translate(-50%, calc(-100% - 12px));
}

.web-tide-label.below {
  transform: translate(-50%, 12px);
}

.web-tide-label::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  background: rgba(3, 35, 41, 0.78);
  transform: translateX(-50%) rotate(45deg);
}

.web-tide-label.above::after {
  bottom: -6px;
  border-right: 1px solid rgba(226, 252, 255, 0.22);
  border-bottom: 1px solid rgba(226, 252, 255, 0.22);
}

.web-tide-label.below::after {
  top: -6px;
  border-left: 1px solid rgba(226, 252, 255, 0.22);
  border-top: 1px solid rgba(226, 252, 255, 0.22);
}

.web-tide-label span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.web-tide-label strong {
  color: #f6fdff;
  font-size: 12px;
  white-space: nowrap;
}

.web-tide-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: #b8dde2;
  font-size: 12px;
}

.web-tide-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.web-tide-points span {
  border: 1px solid rgba(178, 230, 238, 0.22);
  border-radius: 999px;
  padding: 5px 9px;
  color: #d7f5f8;
  font-size: 12px;
  background: rgba(244, 254, 255, 0.045);
}

.tide-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  color: #b8dde2;
}

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 12px;
}

.chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 1px solid rgba(178, 230, 238, 0.42);
  border-radius: 999px;
  padding: 7px 14px 7px 7px;
  color: var(--ink);
  background: rgba(4, 50, 60, 0.72);
  box-shadow: 0 18px 44px rgba(0, 40, 48, 0.28), 0 0 26px rgba(244, 254, 255, 0.08);
  cursor: pointer;
  backdrop-filter: blur(16px) saturate(1.12);
}

.chat-launcher img,
.chat-title img {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(68, 240, 178, 0.6);
  border-radius: 50%;
  object-fit: cover;
}

.chat-launcher span {
  font-weight: 900;
}

.chat-panel {
  width: min(380px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(178, 230, 238, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 254, 255, 0.12), rgba(5, 43, 52, 0.92) 38%),
    #073942;
  box-shadow: 0 22px 70px rgba(0, 37, 44, 0.44), 0 0 32px rgba(244, 254, 255, 0.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-title strong,
.chat-title span {
  display: block;
}

.chat-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.chat-history-toggle,
.chat-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.chat-history-toggle {
  width: auto;
  min-width: 52px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.chat-history-toggle.active {
  color: var(--deep);
  background: var(--foam);
}

.chat-local-history {
  border-bottom: 1px solid var(--line);
  background: rgba(3, 28, 35, 0.74);
  padding: 10px 12px;
}

.chat-local-history[hidden] {
  display: none;
}

.chat-local-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--foam);
  font-size: 13px;
}

.chat-local-history-head button {
  min-height: 28px;
  border: 1px solid rgba(226, 252, 255, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.chat-local-history-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.chat-local-item {
  border: 1px solid rgba(226, 252, 255, 0.16);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.chat-local-item.user {
  border-color: rgba(127, 240, 204, 0.26);
}

.chat-local-meta,
.chat-local-empty {
  color: var(--muted);
  font-size: 11px;
}

.chat-local-item p {
  margin: 5px 0 0;
  color: #e6fbff;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
}

.chat-messages {
  display: grid;
  gap: 10px;
  max-height: 360px;
  min-height: 210px;
  overflow-y: auto;
  padding: 12px;
}

.chat-message {
  display: flex;
}

.chat-message.user {
  justify-content: end;
}

.chat-bubble {
  max-width: 86%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: #dff6ff;
  background: rgba(244, 254, 255, 0.06);
  line-height: 1.55;
  white-space: pre-line;
}

.chat-message.user .chat-bubble {
  border-color: rgba(244, 254, 255, 0.72);
  color: #041015;
  background: var(--foam);
  font-weight: 700;
}

.chat-message.pending .chat-bubble {
  color: var(--muted);
}

.chat-quick-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 12px 12px;
}

.chat-quick-actions button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid rgba(241, 214, 160, 0.36);
  border-radius: 999px;
  padding: 0 12px;
  color: #f8efe0;
  background: rgba(241, 214, 160, 0.1);
  cursor: pointer;
  font-weight: 800;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.chat-quick-actions button:hover {
  border-color: rgba(241, 214, 160, 0.68);
  background: rgba(241, 214, 160, 0.16);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  min-height: 46px;
  max-height: 120px;
  resize: none;
}

.chat-form button {
  min-width: 68px;
  min-height: 46px;
  border: 1px solid rgba(68, 240, 178, 0.55);
  border-radius: 8px;
  color: var(--deep);
  background: var(--mint);
  font-weight: 900;
  cursor: pointer;
}

.chat-form button:disabled,
.chat-form textarea:disabled {
  opacity: 0.62;
  cursor: wait;
}

@keyframes pinPulse {
  from {
    opacity: 0.9;
    transform: scale(0.75);
  }

  to {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes cursorBlink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

@keyframes oceanDrift {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0;
    transform: translate3d(-1.5vw, 0, 0) rotate(-2deg);
  }

  to {
    background-position: 80px 0, -120px 0, 160px 0, 0 0;
    transform: translate3d(1.5vw, -1.5vh, 0) rotate(-1deg);
  }
}

@keyframes flowParticleTraverse {
  0% {
    left: -18%;
    opacity: 0;
  }

  10% {
    opacity: 0.88;
  }

  86% {
    opacity: 0.88;
  }

  100% {
    left: 118%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  .map-pin.active .pin-dot::after,
  #aiSummary.typing::after,
  .flow-particle {
    animation: none;
  }
}

@media (max-width: 860px) {
  body {
    background-attachment: scroll;
    background-position: center top;
  }

  .app-shell {
    width: min(100% - 20px, 1240px);
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: 340px;
  }

  .hero-overlay {
    padding: 38px 22px;
  }

  .timeline {
    grid-auto-columns: 132px;
  }

  .region-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(124px, 34vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .region-tab {
    min-height: 66px;
    scroll-snap-align: start;
  }

  .map-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .flow-hud {
    right: 8px;
    top: 8px;
    gap: 6px;
  }

  .flow-chip {
    min-height: 27px;
    padding: 5px 8px;
    gap: 6px;
  }

  .map-info {
    position: relative;
    z-index: 3;
    min-height: auto;
    margin-top: -18px;
    border: 1px solid rgba(178, 230, 238, 0.26);
    border-radius: 8px;
    padding: 14px;
    background:
      linear-gradient(160deg, rgba(240, 255, 255, 0.16), rgba(4, 49, 59, 0.58)),
      linear-gradient(180deg, rgba(2, 28, 34, 0.2), rgba(2, 24, 30, 0.86)),
      var(--spot-detail-image) center / cover no-repeat,
      url("./assets/ocean-wave-blur.jpg") center / cover no-repeat;
    box-shadow: 0 16px 34px rgba(0, 39, 47, 0.24);
    backdrop-filter: blur(16px);
  }

  .summary-grid,
  .notes-band,
  .detail-band {
    grid-template-columns: 1fr;
  }

  .tide-band-head {
    align-items: start;
    flex-direction: column;
  }

  .tide-band-meta {
    justify-content: flex-start;
  }

  .tide-band-side {
    width: 100%;
    justify-items: stretch;
  }

  .trend-metric-tabs {
    max-width: none;
  }

  .trend-metric-tabs button {
    padding-inline: 6px;
  }

  .web-tide-plot {
    height: 210px;
  }

  .spots-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(270px, 76vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .spots-grid.single {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .spot-card {
    scroll-snap-align: start;
  }

  .spot-card-photo {
    min-height: 128px;
  }

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

@media (max-width: 520px) {
  .status-pill {
    display: none;
  }

  .app-shell {
    width: min(100% - 14px, 1240px);
    padding-top: 8px;
    padding-bottom: 108px;
  }

  .topbar {
    min-height: 54px;
  }

  .brand {
    font-size: 15px;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 21px;
  }

  .timeline-panel,
  .spot-map-panel,
  .summary-card,
  .spot-card,
  .tide-band,
  .detail-band {
    padding: 14px;
  }

  .spot-card-photo {
    margin: -14px -14px 14px;
    padding: 13px 14px;
  }

  .tide-chart-card {
    padding: 12px 10px 10px;
  }

  .web-tide-plot {
    height: 190px;
  }

  .web-tide-label {
    min-width: 82px;
    padding: 5px 6px;
  }

  .web-tide-label strong {
    font-size: 11px;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .timeline {
    grid-auto-columns: minmax(102px, 34vw);
  }

  .region-tabs {
    grid-auto-columns: minmax(90px, 29vw);
    gap: 8px;
    margin-bottom: 12px;
  }

  .region-tab {
    min-height: 54px;
    padding: 7px 9px;
  }

  .region-tab strong {
    font-size: 12px;
  }

  .day-button {
    min-height: 80px;
    padding: 9px 10px;
  }

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

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

  .flow-chip {
    grid-template-columns: auto auto auto 16px;
  }

  .flow-chip span,
  .flow-chip small {
    font-size: 10px;
  }

  .flow-chip strong {
    font-size: 12px;
  }

  .flow-arrow {
    width: 18px;
    height: 18px;
  }

  .flow-arrow.wave-icon::before {
    font-size: 12px;
  }

  .flow-arrow.wind-icon::before {
    font-size: 12px;
  }

  .flow-particle {
    width: 26px;
    height: 1.6px;
  }

  .map-pin {
    min-width: 46px;
    min-height: 27px;
    padding: 4px 6px;
    gap: 4px;
  }

  .pin-dot {
    width: 8px;
    height: 8px;
  }

  .pin-label {
    display: inline;
    font-size: 9px;
  }

  .map-pin:not(.active) {
    width: auto;
    min-width: 46px;
    justify-content: flex-start;
    padding: 4px 6px;
  }

  .map-pin:not(.active) .pin-label {
    display: inline;
  }

  .map-info h2 {
    font-size: 28px;
  }

  .map-name-row {
    gap: 6px;
  }

  .map-info p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.6;
  }

  .map-type-row {
    gap: 6px;
  }

  #aiSummary {
    min-height: 128px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.72;
  }

  .card-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .card-heading strong {
    max-width: 100%;
  }

  .chat-widget {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .chat-widget.open {
    left: 10px;
    right: 10px;
    justify-items: stretch;
  }

  .chat-panel {
    width: 100%;
    max-height: calc(100dvh - 24px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  .chat-panel[hidden] {
    display: none;
  }

  .chat-messages {
    min-height: 170px;
    max-height: min(42dvh, 360px);
  }

  .chat-launcher span {
    display: none;
  }

  .chat-launcher {
    padding: 7px;
  }

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

  .chat-quick-actions button {
    font-size: 10px;
  }

  .chat-form textarea,
  .chat-form button {
    font-size: 16px;
  }

  .chat-form button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .typhoon-entry,
  .typhoon-hero,
  .typhoon-layout,
  .typhoon-summary-grid,
  .typhoon-panel-grid {
    grid-template-columns: 1fr;
  }

  .typhoon-selector {
    position: static;
  }

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

  .region-impact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .typhoon-shell {
    width: min(100% - 20px, 1320px);
  }

  .typhoon-layout,
  .typhoon-layout > *,
  .typhoon-main,
  .typhoon-main > *,
  .typhoon-selector,
  .typhoon-summary-grid,
  .typhoon-panel-grid,
  .typhoon-map-panel,
  .typhoon-panel,
  .summary-card,
  .typhoon-map-wrap,
  .gate-legend {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .typhoon-entry,
  .typhoon-hero,
  .typhoon-selector,
  .typhoon-map-panel,
  .typhoon-panel {
    padding: 14px;
  }

  .typhoon-hero {
    gap: 14px;
    margin-top: 12px;
  }

  .typhoon-hero h1 {
    margin-bottom: 10px;
    font-size: 36px;
    line-height: 1.04;
  }

  .typhoon-hero .typhoon-safety-officer {
    padding: 9px 10px;
    font-size: 14px;
    line-height: 1.58;
  }

  .typhoon-layout,
  .typhoon-main {
    gap: 12px;
  }

  .typhoon-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 78vw);
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .typhoon-list::-webkit-scrollbar {
    display: none;
  }

  .typhoon-list-item {
    min-height: 112px;
    scroll-snap-align: start;
  }

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

  .decision-grid {
    gap: 8px;
    margin-top: 12px;
  }

  .decision-grid div {
    min-height: 66px;
    padding: 10px;
  }

  .decision-grid strong {
    font-size: 16px;
  }

  .typhoon-map-wrap {
    min-height: 0;
  }

  .typhoon-map {
    height: 100%;
  }

  .gate-legend {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    display: flex;
    padding: 0;
  }

  .gate-legend span {
    min-width: 0;
    justify-content: center;
    padding: 5px 7px;
    font-size: 10px;
    background: rgba(2, 24, 31, 0.62);
  }

  .track-point-detail {
    min-width: 160px;
    max-width: calc(100% - 18px);
    padding: 9px 10px;
    transform: translate(-50%, -108%);
  }

  .daily-date,
  .gate-card div {
    align-items: flex-start;
    flex-direction: column;
  }

  .gate-card div span {
    text-align: left;
  }
}
