:root {
  --bg: #f5f7fb;
  --ink: #12151c;
  --muted: #5e6772;
  --line: #e4e7ee;
  --tide: #1d4ed8;
  --flood: #ea580c;
  --paper: #ffffff;
  color: var(--ink);
  background: var(--bg);
  font-family: Figtree, "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--tide); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: Sora, "Segoe UI", sans-serif; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 0.45rem; }
h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
h2 { font-size: 1.15rem; }
p { margin: 0 0 0.75rem; }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: 12px; top: -40px; background: var(--ink); color: white; padding: 8px 12px; z-index: 800; }
.skip:focus { top: 12px; }
.kicker { margin: 0 0 6px; font-family: Figtree, sans-serif; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; }
.lede { color: var(--muted); max-width: 62ch; }
.fine { color: var(--muted); font-size: 0.9rem; }
.kind { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 6px; }

.top { position: sticky; top: 0; z-index: 700; background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-family: Sora, sans-serif; font-weight: 600; }
.brand img { border-radius: 8px; }
.top-nav { display: flex; gap: 16px; }
.top-nav a { color: var(--ink); text-decoration: none; font-weight: 650; }
.country-bar { display: flex; flex-wrap: wrap; gap: 8px; width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 10px; }
.country-bar a { color: var(--ink); text-decoration: none; font-weight: 650; padding: 4px 12px; border-radius: 999px; background: #eef1f6; }
.country-bar a.here { background: var(--ink); color: #fff; }
.find { position: relative; flex: 1; }
.find input { width: 100%; border: none; background: #eef1f6; border-radius: 8px; padding: 10px 12px; font: inherit; color: inherit; }
.find input:focus { outline: 2px solid var(--tide); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; z-index: 800; }
.results a { display: block; padding: 10px 12px; color: var(--ink); text-decoration: none; }
.results a:hover { background: #eef3ff; }

.stage { position: relative; background: #d7dee8; }
.chart-map { height: 68vh; min-height: 420px; width: 100%; }
.stage-home .chart-map, .stage-index .chart-map { height: 56vh; }
.stage-copy { position: absolute; z-index: 500; left: 20px; bottom: 20px; width: min(460px, calc(100% - 40px)); max-height: calc(68vh - 40px); overflow: auto; background: rgba(255, 255, 255, 0.96); padding: 16px 18px 12px; border-radius: 8px; }
.stage-home .stage-copy, .stage-index .stage-copy { position: static; width: min(1120px, calc(100% - 32px)); max-height: none; overflow: visible; margin: 0 auto; background: transparent; padding: 22px 0 4px; border-radius: 0; }
.stage-copy .now-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 4px; }
.stage-copy .stat { background: transparent; border: 0; border-left: 3px solid var(--line); border-radius: 0; padding: 0 0 0 10px; }
.stage-copy .stat p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.stage-copy .stat strong { display: block; font-family: Sora, sans-serif; font-size: 1.7rem; font-weight: 600; }
.stage-copy .stat span { color: var(--muted); font-size: 0.88rem; }
.stage-copy .stat.high { border-left-color: var(--tide); }
.stage-copy .stat.high strong { color: var(--tide); }
.stage-copy .stat.low { border-left-color: var(--flood); }
.stage-copy .stat.low strong { color: var(--flood); }

.key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; font-size: 0.92rem; }
.key b { font-weight: 650; }
.swatch { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; }
.swatch.tide { background: var(--tide); border-radius: 50%; }
.swatch.flood { background: var(--flood); border-radius: 2px; }
.leaflet-marker-icon.pin { background: transparent; border: 0; }
.leaflet-marker-icon.pin span { display: block; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--flood); border: 2px solid #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(18, 21, 28, 0.28); }
.map-popup .leaflet-popup-content-wrapper { border-radius: 10px; }
.map-popup .leaflet-popup-content { margin: 14px 14px 12px; font-family: Figtree, sans-serif; }
.map-pop { display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.map-pop strong { font-family: Sora, sans-serif; font-size: 1.05rem; line-height: 1.25; }
.map-pop span { color: var(--muted); font-size: 0.92rem; }
.map-pop a { display: block; margin-top: 8px; padding: 10px 12px; background: var(--tide); color: #fff; text-align: center; text-decoration: none; border-radius: 8px; font-weight: 650; }

.states, .index { padding: 8px 0 28px; }
.state-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.state-card { color: var(--ink); text-decoration: none; }
.state-card strong { color: var(--tide); margin-left: 6px; }
.state-card:hover { color: var(--tide); }

.index-list { list-style: none; padding: 0; margin: 0 0 28px; columns: 2; }
.index-list li { break-inside: avoid; display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.index-list a { color: var(--ink); font-weight: 650; text-decoration: none; }
.index-list a:hover { color: var(--tide); }
.index-list em { color: var(--muted); font-style: normal; font-size: 0.88rem; }
.crumbs { color: var(--muted); font-size: 0.88rem; }
.crumbs a { color: inherit; }

.instruments { width: min(1120px, calc(100% - 32px)); margin: 22px auto; display: grid; grid-template-columns: 1.25fr 0.75fr; background: var(--paper); border: 1px solid var(--line); }
.instrument { padding: 22px 24px 8px; }
.instrument.tide { border-top: 4px solid var(--tide); }
.instrument.flood { border-top: 4px solid var(--flood); background: #fff7f2; }
.instrument.tide .kicker { color: var(--tide); }
.instrument.flood .kicker { color: #c2410c; }
.split-note { color: var(--ink); }
.instrument .panel { background: transparent; border: 0; padding: 8px 0; margin: 8px 0; }
.curve { margin: 8px 0 4px; }
.tide-chart { width: 100%; height: auto; display: block; }
.tide-line { fill: none; stroke: var(--tide); stroke-width: 2.4; }
.now-mark { stroke: #12151c; stroke-width: 1.25; stroke-dasharray: 2 3; }
.now-dot { fill: #12151c; stroke: #fff; stroke-width: 1.5; }
.now-tag { font-family: Figtree, sans-serif; font-size: 12px; font-weight: 650; fill: #12151c; }
.tide-now { font-weight: 650; margin: 8px 0 0; }
.tide-area { fill: var(--tide); opacity: 0.12; }
.dot-high { fill: var(--tide); }
.dot-low { fill: var(--flood); }
.zero { stroke: #d5dbe6; stroke-dasharray: 3 4; }

.tide-more { margin: 4px 0 16px; }
.tide-more summary { cursor: pointer; font-weight: 650; color: var(--tide); }
.tide-more[open] summary { margin-bottom: 8px; }
table.tides { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
table.tides th { text-align: left; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 6px; }
table.tides td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.tides tr.high td:nth-child(2) { color: var(--tide); font-weight: 650; }
table.tides tr.low td:nth-child(2) { color: var(--flood); font-weight: 650; }
table.tides td:last-child { font-variant-numeric: tabular-nums; font-weight: 650; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.facts div { padding: 0; }
.facts dt { color: var(--muted); font-size: 0.78rem; }
.facts dd { margin: 0; font-weight: 650; }
.forecast, .near, .crests { list-style: none; padding: 0; margin: 0 0 8px; }
.forecast li, .near li, .crests li { padding: 8px 0; border-top: 1px solid var(--line); }
.forecast span, .near span { color: var(--muted); }
.near li { display: flex; justify-content: space-between; gap: 12px; }
.crest-top { display: flex; justify-content: space-between; gap: 12px; }
.gauge-name { font-family: Sora, sans-serif; font-weight: 600; font-size: 1.05rem; }
.flood-note { display: block; color: var(--flood); font-weight: 650; }

.app-line { width: min(1120px, calc(100% - 32px)); margin: 0 auto 36px; display: flex; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.app-line img { border-radius: 8px; }
.app-line p { margin: 0; flex: 1; }
.app-line a { font-weight: 650; white-space: nowrap; }

.market { width: min(1120px, calc(100% - 32px)); margin: 28px auto 48px; }
.market-hero { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 28px; align-items: center; margin-bottom: 36px; }
.market-hero img, .showcase img { width: 100%; height: auto; border-radius: 16px; }
.store-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.store-row a { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; font-weight: 650; padding: 10px 14px; border-radius: 8px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; list-style: none; padding: 0; margin: 16px 0 40px; }
.feature-grid h3 { font-family: Sora, "Segoe UI", sans-serif; font-size: 1.05rem; margin: 0 0 6px; }
.feature-grid p { margin: 0; color: var(--muted); }
.showcase { display: grid; grid-template-columns: 1fr 0.72fr; gap: 32px; align-items: center; margin: 0 0 40px; }
.showcase.reverse { grid-template-columns: 0.72fr 1fr; }
.showcase.reverse .showcase-copy { order: 2; }
.phone-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 16px 0 40px; }
.phone-row img { width: min(240px, 28%); height: auto; border-radius: 22px; }
.market-close { text-align: center; padding-top: 8px; }
.market-close img { border-radius: 16px; margin: 0 auto 12px; }
.market-close .store-row { justify-content: center; }
.narrow { width: min(760px, calc(100% - 32px)); margin: 28px auto 48px; }
.prose h2 { margin-top: 1.4rem; }
.guide-list { list-style: none; padding: 0; margin: 0 0 28px; }
.guide-list a { display: block; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.guide-list a:hover strong { color: var(--tide); }
.guide-list strong { display: block; font-family: Sora, sans-serif; }
.guide-list span { display: block; color: var(--muted); }
.policy { width: min(760px, calc(100% - 32px)); margin: 28px auto 40px; }
.policy h2 { margin-top: 1.4rem; }
.policy ul { padding-left: 1.1rem; }

.foot { border-top: 1px solid var(--line); padding: 18px 0 28px; color: var(--muted); font-size: 0.92rem; }
.foot .wrap { width: min(1120px, calc(100% - 32px)); }
.foot a { color: inherit; }

@media (max-width: 860px) {
  .top-inner { flex-wrap: wrap; padding: 8px 0; }
  .find { order: 3; flex-basis: 100%; }
  .chart-map, .stage-home .chart-map, .stage-index .chart-map { height: 46vh; min-height: 280px; }
  .stage-copy { position: static; width: auto; max-height: none; overflow: visible; margin: 0; border-radius: 0; padding: 16px; }
  .instruments, .feature-grid, .market-hero, .showcase, .showcase.reverse, .stage-copy .now-grid { grid-template-columns: 1fr; }
  .showcase.reverse .showcase-copy { order: 0; }
  .phone-row img { width: min(220px, 70%); }
  .index-list { columns: 1; }
  .app-line { flex-wrap: wrap; }
}
