:root {
  color-scheme: light;
  font: 16px/1.55 Inter, "Segoe UI", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: #183343;
  background: #eef3f5;
  --ink: #102d3f;
  --muted: #4e6875;
  --line: #d8e3e8;
  --teal: #006c65;
  --compare: #a04c2f;
  --shadow: 0 8px 24px #2348580b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1,h2,h3,p { margin: 0; }
a { color: var(--teal); text-underline-offset: 4px; }
button,input,select { font: inherit; }
button,select,summary { cursor: pointer; }
button:disabled,select:disabled,input:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 2px solid #006e80; outline-offset: 3px; }
.wrap { width: min(1240px,calc(100% - 72px)); margin-inline: auto; min-width: 0; }
.site-header,.site-footer { background: #fff; }
.site-header { border-bottom: 1px solid var(--line); }
.navigation,.footer { display: flex; align-items: center; gap: 30px; min-height: 70px; }
.navigation nav { display: flex; gap: 24px; }
.navigation nav a,.brand,.footer a { text-decoration: none; }
.navigation nav a { color: #365361; font-weight: 650; font-size: .91rem; display: grid; align-items: center; min-height: 44px; }
.navigation nav a:hover,.footer a:hover { text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; color: var(--ink); font-size: 1.28rem; font-weight: 850; letter-spacing: -.04em; white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-right: 3px; border-radius: 10px; color: #fff; background: #0b5a64; font-size: 30px; line-height: 1; }
.brand-region { color: #216776; font-size: .74em; letter-spacing: .02em; }
.header-actions,.footer-links { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.support,.language,.button { min-height: 44px; min-width: 44px; padding: 8px 14px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .86rem; text-decoration: none; }
.support,.language,.secondary { background: #fff; border: 1px solid #bed1d8; color: #294b58; }
.support:hover,.language:hover,.secondary:hover { background: #eaf5f5; border-color: #89abaa; }
.primary { background: #07655f; color: #fff; border: 1px solid #07655f; }
.primary:hover { background: #084e51; }
.plain { border: 0; background: transparent; color: #365361; }
.plain:hover { background: #ecf3f5; }
.skip { position: absolute; top: 8px; left: 8px; background: white; padding: 10px; z-index: 5; transform: translateY(-160%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hero {
  background: radial-gradient(ellipse at 80% 90%, #267787, transparent 60%), linear-gradient(115deg,#102d3f,#204c60);
  background-image: linear-gradient(90deg,#0a2436fa 8%,#0a263be0 41%,#102e4350 85%), url('/harbour.webp'), linear-gradient(115deg,#102d3f,#204c60);
  background-position: center, center 56%, center;
  background-size: cover;
  border-radius: 19px;
  color: #fff;
  display: flex;
  align-items: center;
  min-height: 270px;
  margin: 28px 0 32px;
  overflow: hidden;
  box-shadow: 0 12px 28px #102f4224;
}
.hero-copy { padding: 32px 44px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #bcece9; font-size: .76rem; font-weight: 750; letter-spacing: .05em; }
.eyebrow span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #63dacc; }
.hero h1 { font-size: clamp(2rem,4.1vw,3.9rem); line-height: 1.12; letter-spacing: -.045em; margin: 10px 0; text-wrap: balance; }
.hero h1 + p { color: #e3f0f5; max-width: 540px; }
.hero-facts { list-style: none; padding: 0; margin: 22px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-facts li { border: 1px solid #b5dfe251; background: #112f42a1; color: #f3fafb; border-radius: 5px; padding: 3px 9px; font-size: .77rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
h2 { font-size: 1.28rem; color: var(--ink); line-height: 1.28; }
.section-head h2 { font-size: 1.55rem; }
.section-head p,.card-head p,.source-card p,#chart-note { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.card { border: 1px solid var(--line); background: #fff; border-radius: 13px; box-shadow: var(--shadow); min-width: 0; }
.filters { padding: 15px 16px; display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; gap: 12px; }
.filters label { min-width: 0; }
.filters label span { font-size: .77rem; font-weight: 750; display: block; margin: 0 0 4px; color: #405c69; }
.filters select,.filters input { color: var(--ink); padding: 6px 10px; display: block; background: #f9fbfc; border: 1px solid #bccfd8; border-radius: 7px; width: 100%; min-width: 0; min-height: 44px; }
.status { margin: 16px 0; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 14px 0; }
.metric { padding: 16px 17px; border-top: 3px solid #b8dddd; }
.metric:nth-child(2) { border-top-color: #bfd6ea; }
.metric:nth-child(3) { border-top-color: #d6e2ba; }
.metric h3 { font-size: .8rem; font-weight: 750; color: var(--muted); }
.metric strong { display: block; font-size: clamp(1.36rem,3vw,2rem); line-height: 1.4; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric p { color: var(--muted); font-size: .8rem; }
.results { display: grid; grid-template-columns: minmax(0,1.9fr) minmax(0,1fr); align-items: start; gap: 14px; }
.chart-card,.tides-card { padding: 18px; }
.card-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: end; gap: 6px 11px; max-width: 60%; }
.legend li,.station-title { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 720; }
.legend li::before,.station-title::before { content: ''; display: inline-block; flex: 0 0 12px; border-top: 3px solid var(--teal); }
.legend li:nth-child(2)::before,.station-group + .station-group .station-title::before { border-top: 3px dashed var(--compare); }
canvas { display: block; width: 100%; height: 256px; margin: 12px 0 0; }
#chart-note { font-size: .75rem; }
details { margin-top: 14px; border-top: 1px solid var(--line); }
summary { color: var(--teal); padding-block: 12px; min-height: 44px; font-size: .85rem; font-weight: 700; }
table { border-collapse: collapse; width: 100%; font-size: .83rem; font-variant-numeric: tabular-nums; }
th,td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #e5edf0; }
thead th { background: #f0f6f8; color: #3a5966; }
.station-group { margin-top: 13px; }
.station-title { margin: 0 0 8px; color: #244a58; }
.tides-card tbody td:last-child { text-align: right; white-space: nowrap; font-weight: 700; }
.tides-card thead th:last-child { text-align: right; }
.time { white-space: nowrap; }
.tide-tag { font-size: .77rem; font-weight: 700; border-radius: 4px; display: inline-block; color: #365361; }
.tide-tag.high { color: #02685f; }
.tide-tag.low { color: #804425; }
.source-card { padding: 20px; margin: 20px 0 30px; display: flex; justify-content: space-between; gap: 22px; }
.source-card p { max-width: 650px; }
.source-links { display: flex; flex-wrap: wrap; align-items: start; gap: 6px 14px; font-size: .83rem; font-weight: 650; }
.source-links a { min-height: 32px; display: inline-flex; align-items: center; }
.site-footer { border-top: 1px solid var(--line); }
.footer { min-height: 78px; }
.labs { color: #284553; font-weight: 750; }
dialog { width: min(470px,calc(100vw - 32px)); max-height: 92dvh; overflow: auto; padding: 24px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; }
dialog::backdrop { background: #102d3f9e; }
dialog p { margin: 12px 0; color: var(--muted); }
.privacy-option { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.toast { position: fixed; bottom: 15px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 20px); background: #17394c; color: #fff; border-radius: 8px; padding: 10px 16px; box-shadow: var(--shadow); z-index: 3; }
@media (max-width: 880px) {
  .wrap { width: calc(100% - 40px); }
  .hero-copy { padding: 30px; }
  .results { grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 28px); }
  .navigation { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; padding-block: 8px; }
  .navigation nav { grid-row: 2; grid-column: 1/-1; gap: 16px; }
  .navigation nav a { min-height: 36px; }
  .header-actions { display: contents; }
  .language { grid-row: 1; grid-column: 2; }
  .header-actions .support { grid-column: 1/-1; grid-row: 3; }
  .hero { margin: 16px 0 24px; min-height: 236px; }
  .hero-copy { padding: 22px; }
  .section-head,.source-card { align-items: stretch; flex-direction: column; }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 10px; }
  .metrics { gap: 6px; }
  .metric { padding: 10px 7px; }
  .metric h3,.metric p { font-size: .71rem; }
  .results { grid-template-columns: minmax(0,1fr); }
  .chart-card,.tides-card { padding: 13px; }
  canvas { height: 228px; }
  .footer { flex-wrap: wrap; gap: 6px 12px; padding-block: 8px; }
}
