:root {
  color-scheme: light;
  --ink: #1b2422;
  --ink-soft: #51605a;
  --paper: #f3eee4;
  --paper-2: #fffdf8;
  --line: #ddd4c3;
  --harbor: #14343c;
  --harbor-2: #1d4c59;
  --water: #1f6a72;
  --foam: #e5f1ef;
  --king: #8d311c;
  --king-bg: #f8e7e0;
  --maybe: #7a5410;
  --maybe-bg: #f8f1dc;
  --today-line: #1f6a72;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --shadow: 0 12px 32px rgba(20, 52, 60, 0.05);
}

* { box-sizing: border-box; }

html { overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.45;
}

a {
  color: var(--harbor-2);
  text-underline-offset: 0.15em;
}

a:hover { color: var(--king); }

:focus-visible {
  outline: 2px solid var(--water);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: white;
  padding: 0.4rem 0.7rem;
  z-index: 5;
}

.skip:focus { top: 0.75rem; }

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  background: var(--harbor);
  color: #f6f1e7;
  padding: 1.6rem 0 1.5rem;
}

.site-header a { color: #d7efec; }

.header-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
}

.eyebrow {
  margin: 0 0 0.2rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #b7d5d2;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
}

.lede {
  margin: 0.7rem 0 0;
  max-width: 38rem;
  color: #e4ddd0;
}

.station {
  margin: 0;
  text-align: right;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #d9e4e1;
}

main { padding: 1.25rem 0 3rem; }

.status, .warning, .error, .band-note, .quiet, .chart-hint, .chart-tip {
  color: var(--ink-soft);
}

.status { margin-top: 0.4rem; }

.error, .warning {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 1rem;
}

.error { border-color: #e2b2a6; background: #fdf6f3; color: var(--king); }

.warning { border-color: #e4d3a4; background: #fbf8ef; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 1rem;
  margin-top: 0.4rem;
}

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.25rem;
  min-width: 0;
  max-width: 100%;
}

.kicker {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-date {
  margin: 0.25rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 560;
}

.when {
  margin: 0.15rem 0 0.6rem;
  color: var(--ink-soft);
}

.range {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.05rem, 9vw, 4.5rem);
  letter-spacing: -0.035em;
  line-height: 0.92;
  color: var(--harbor);
  font-variant-numeric: tabular-nums;
}

.today-panel.is-yes .range { color: var(--king); }
.today-panel.is-possible .range { color: var(--maybe); }

.range .unit {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.range-label {
  margin: 0.35rem 0 0.9rem;
  color: var(--ink-soft);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--line);
}

.facts div { margin: 0; }

.facts dt {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.facts dd {
  margin: 0.1rem 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.badge {
  display: inline-block;
  margin: 0.9rem 0 0;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
}

.badge.yes { background: var(--king-bg); color: var(--king); }
.badge.possible { background: var(--maybe-bg); color: var(--maybe); }
.badge.clear { background: var(--foam); color: var(--harbor-2); }

.timing, .badge-note {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
}

.tide-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
}

.tide-list li {
  background: var(--paper);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.tide-list .is-peak {
  background: var(--harbor);
  color: #f6f1e7;
}

.runs-panel h2 {
  margin: 0.15rem 0 0.8rem;
  font-size: 1.7rem;
}

.run-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.run-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.8rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.run-list li:first-child { border-top: 0; padding-top: 0; }

.run-dates { font-weight: 700; }

.run-flag { justify-self: end; font-size: 0.92rem; }
.run-flag.yes { color: var(--king); }
.run-flag.possible { color: var(--maybe); }

.run-detail {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.band-note {
  margin: 1rem 0;
  padding: 0.15rem 0.1rem;
  max-width: 70rem;
}

.chart-panel, .table-section { margin-top: 1rem; }

.section-head h2 {
  margin: 0;
  font-size: 1.8rem;
}

.chart-hint { margin: 0.2rem 0 0; font-size: 0.9rem; }

.chart-scroll {
  overflow-x: auto;
  margin-top: 0.6rem;
  max-width: 100%;
}

.chart-scroll svg { display: block; height: 320px; }

.chart-tip {
  min-height: 1.4em;
  margin: 0.55rem 0 0;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}

.quiet { margin: 0.25rem 0 0; }

.tools {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.filters { display: flex; gap: 0.35rem; }

button {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}

button[aria-pressed="true"] {
  background: var(--harbor);
  border-color: var(--harbor);
  color: #f6f1e7;
}

.text-button { border-color: transparent; }

.table-wrap {
  overflow-x: auto;
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
}

caption {
  caption-side: bottom;
  text-align: left;
  color: var(--ink-soft);
  padding: 0.7rem 0.8rem 0.85rem;
  font-size: 0.88rem;
}

th, td {
  padding: 0.48rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--paper-2);
}

th {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
  position: sticky;
  top: 0;
  z-index: 2;
}

td.num, th.num { text-align: right; }

td.date, th.date {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 8px 0 8px -8px rgba(20, 52, 60, 0.35);
}

tr.is-today td.date {
  box-shadow: inset 3px 0 0 var(--today-line), 8px 0 8px -8px rgba(20, 52, 60, 0.35);
}

th.date { z-index: 3; }

tr.month th {
  background: #efe8db;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 560;
  text-align: left;
}

tr.is-yes td { background: var(--king-bg); }
tr.is-possible td { background: var(--maybe-bg); }

.flag-yes { color: var(--king); font-weight: 700; }
.flag-possible { color: var(--maybe); font-weight: 700; }

#check-panel { margin-top: 1rem; overflow-x: auto; }
#check-panel h2 { margin: 0 0 0.35rem; font-size: 1.6rem; }
#check-panel .quiet { margin-bottom: 0.8rem; }

.check-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.check-table th, .check-table td {
  text-align: left;
  padding: 0.4rem 1rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.check-table th:last-child, .check-table td:last-child {
  padding-left: 0.4rem;
  text-align: left;
}
.check-table th {
  position: static;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.check-table td.num, .check-table th.num { text-align: right; }
.prelim { color: var(--ink-soft); }

.notes, .method {
  margin-top: 1.4rem;
}

.notes h2, .method summary {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 560;
}

.notes ul {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
  max-width: 46rem;
}

.notes li + li { margin-top: 0.45rem; }

.method {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.4rem 1.15rem 0.2rem;
}

.method summary {
  cursor: pointer;
  padding: 0.7rem 0;
}

.method-body {
  max-width: 46rem;
  padding-bottom: 0.8rem;
}

.method-body p { margin: 0.7rem 0; }

code {
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-size: 0.92em;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 0 1.4rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.site-footer p { margin: 0; }

@media (max-width: 800px) {
  .header-inner, .hero-grid { display: block; }
  .station { text-align: left; margin-top: 1rem; }
  .runs-panel { margin-top: 1rem; }
  .facts { grid-template-columns: 1fr; }
  .chart-hint { display: block; }
}

@media (min-width: 801px) {
  .chart-hint { display: none; }
}

@media print {
  .site-header { background: white; color: black; padding-top: 0; }
  .site-header a, .lede, .station { color: black; }
  .skip, .tools, .chart-panel, .chart-hint, .site-footer { display: none; }
  .panel, .method, .table-wrap { box-shadow: none; }
  body { background: white; }
  .wrap { width: auto; }
  details.method { display: block; }
  details.method summary { display: none; }
  a { text-decoration: none; }
  th { position: static; }
  td.date, th.date { position: static; }
}
