:root {
  --ink: #16262c;
  --ink-soft: #4a5d63;
  --sea: #143642;
  --sea-2: #1f4d5a;
  --kelp: #5b8a8f;
  --fog: #eef1ef;
  --fog-2: #dfe5e3;
  --paper: #fbfaf7;
  --sun: #f2a65a;
  --sun-deep: #d9772b;
  --good: #3f8f5e;
  --warn: #c98a1b;
  --bad: #b5523b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 54, 66, .06), 0 6px 24px rgba(20, 54, 66, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--sea-2); }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.small { font-size: 13px; color: var(--ink-soft); }

/* Masthead: layered fog over the sea */
.masthead {
  color: #fff; padding: 44px 0 64px;
  background:
    radial-gradient(120% 70% at 85% 0%, rgba(242, 166, 90, .45), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.0) 55%, rgba(238,241,239,.35) 80%, var(--paper) 100%),
    linear-gradient(160deg, #0f2b35 0%, #1f4d5a 55%, #5b8a8f 100%);
}
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; opacity: .8; margin: 0 0 6px; }
.masthead h1 { font-size: clamp(32px, 5vw, 52px); }
.lede { max-width: 640px; font-size: 17px; opacity: .92; margin: 10px 0 0; }

/* Planner */
.plan { display: grid; grid-template-columns: 1fr 340px; gap: 20px; margin-top: -36px; }
@media (max-width: 860px) { .plan { grid-template-columns: 1fr; } }
.map-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; }
#map { height: 460px; border-radius: 10px; }
@media (max-width: 860px) { #map { height: 340px; } }
.hint { margin: 8px 6px 2px; font-size: 13px; color: var(--ink-soft); }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, button { font: inherit; }
input[type=date], select {
  border: 1px solid var(--fog-2); border-radius: 10px; padding: 9px 10px; background: var(--fog); color: var(--ink);
}
.picked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.picked li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--fog); border-radius: 10px; padding: 7px 10px; color: var(--ink); font-weight: 500; font-size: 14px;
}
.picked li.empty { background: none; color: var(--ink-soft); font-weight: 400; padding: 0; }
.picked button { border: 0; background: none; cursor: pointer; color: var(--ink-soft); font-size: 18px; line-height: 1; }
.presets summary { cursor: pointer; color: var(--sea-2); font-size: 14px; }
.preset-list { display: grid; gap: 4px; margin-top: 8px; max-height: 240px; overflow: auto; }
.preset-list label { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink); font-size: 14px; cursor: pointer; }
.go {
  border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--sun-deep), var(--sun)); box-shadow: 0 4px 14px rgba(217, 119, 43, .3);
}
.go:hover { filter: brightness(1.05); }

/* Season */
.season { margin-top: 32px; }
.webcam { margin-top: 32px; }
.webcam h2 { font-size: 26px; }
.cam-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 16px; margin: 14px 0 8px; align-items: start; }
@media (max-width: 760px) { .cam-row { grid-template-columns: minmax(0, 1fr); } }
.boon { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.boon h3 { font-size: 18px; margin-bottom: 8px; }
.boon dl { display: grid; grid-template-columns: auto auto; gap: 6px 12px; margin: 0; }
.boon dt { font-size: 13px; color: var(--ink-soft); }
.boon dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; }
.boon .upd { margin-top: 10px; }
.cam-frame { position: relative; aspect-ratio: 16 / 9; margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--sea); box-shadow: var(--shadow); max-width: 960px; }
.cam-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.season-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.season h2 { font-size: 26px; }
.season-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; }
@media (max-width: 900px) { .season-grid { grid-template-columns: 1fr; } }
.season-col { background: var(--fog); border-radius: var(--radius); padding: 16px; }
.season-col h3 { font-size: 18px; margin-bottom: 8px; }
.season-item { padding: 8px 0; border-top: 1px solid var(--fog-2); }
.season-item:first-of-type { border-top: 0; }
.season-item strong { display: block; }
.season-item .where { font-size: 13px; color: var(--ink-soft); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; margin-left: 6px; vertical-align: 2px; }
.tag.peak { background: var(--sun); color: #3b1d05; }
.tag.on { background: #cfe1dc; color: var(--sea); }
.ethics { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.cal { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }
.cal th, .cal td { padding: 4px 3px; text-align: center; }
.cal th:first-child, .cal td:first-child { text-align: left; white-space: nowrap; padding-right: 10px; }
.cal td.m { width: 6.5%; }
.cal td.m span { display: block; height: 12px; border-radius: 3px; background: var(--fog-2); }
.cal td.m.on span { background: var(--kelp); }
.cal td.m.pk span { background: var(--sun-deep); }
.cal th.now { color: var(--sun-deep); }
.cal-wrap { overflow-x: auto; }
details.calendar summary { cursor: pointer; color: var(--sea-2); margin-top: 12px; font-size: 14px; }

/* Results */
.results { margin: 36px 0 20px; display: flex; flex-direction: column; gap: 28px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-head { padding: 18px 20px 14px; background: linear-gradient(135deg, var(--sea), var(--sea-2)); color: #fff; }
.card-head h2 { font-size: 26px; }
.card-head .meta { font-size: 13px; opacity: .85; margin-top: 4px; }
.card-head .meta a { color: #fff; }
.card-head .notes { margin: 8px 0 0; font-size: 14px; opacity: .92; max-width: 820px; }
.card-body { padding: 18px 20px 22px; display: grid; gap: 22px; }
.block h3 { font-size: 18px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.block h3 .src { font-family: Inter, sans-serif; font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.src-list { margin-top: 10px; background: var(--fog); border-radius: 10px; padding: 8px 12px; }
.src-list summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.src-list p { margin: 10px 0 4px; }
.src-list ul { margin: 0; padding-left: 18px; }
.src-list li { margin: 2px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--fog); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--ink-soft); }
.stat .v { font-size: 18px; font-weight: 600; }
.stat .s { font-size: 12px; color: var(--ink-soft); }
.stat.gold { background: #fdf0e2; }
.outlook { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; background: var(--fog); }
.pill.good { background: #dcefe3; color: #1f5c38; }
.pill.warn { background: #fbefd6; color: #7a5208; }
.pill.bad { background: #f5ddd6; color: #7d2f1d; }
.nws { font-size: 14px; color: var(--ink); background: var(--fog); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.nws p { margin: 4px 0; }
.hourly-wrap { overflow-x: auto; border: 1px solid var(--fog-2); border-radius: 10px; }
.hourly { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.hourly th, .hourly td { padding: 6px 7px; text-align: center; white-space: nowrap; border-left: 1px solid var(--fog); }
.hourly th:first-child, .hourly td:first-child { position: sticky; left: 0; background: #fff; text-align: left; font-weight: 600; color: var(--ink-soft); border-left: 0; z-index: 1; }
.hourly thead th { background: var(--fog); font-weight: 600; }
.hourly thead th.golden { background: #fde3c6; }
.hourly thead th.blue { background: #d7e3f2; }
.fog-0 { background: #e7f3ea; }
.fog-1 { background: #fbf1d9; }
.fog-2 { background: #efd9d2; }
.arrow { display: inline-block; font-size: 13px; }
.tide-svg { width: 100%; height: auto; display: block; background: var(--fog); border-radius: 10px; }
.tide-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tide-list .pill b { font-weight: 700; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .cols { grid-template-columns: 1fr; } }
.sp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.sp-list li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.sp-list img, .sp-list .noimg { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--fog-2); }
.sp-list .sci { font-size: 12px; color: var(--ink-soft); font-style: italic; }
.sp-list .cnt { font-size: 12px; color: var(--ink-soft); text-align: right; }
.notable { background: #fdf0e2; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.notable ul { margin: 4px 0 0; padding-left: 18px; }
.loading { color: var(--ink-soft); font-size: 14px; }
.loading::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--kelp); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
.err { color: var(--bad); font-size: 14px; }
.foot { padding: 28px 20px 40px; font-size: 13px; color: var(--ink-soft); border-top: 1px solid var(--fog-2); margin-top: 20px; }
.leaflet-container { font: inherit; }
.card-body { grid-template-columns: minmax(0, 1fr); }
.card-body > *, .cols > * { min-width: 0; }
.tide-svg { max-height: 240px; }
