/* Surfbird Money. One typeface (Schibsted Grotesk), a harbor-blue ink, a tide-teal accent and an amber
   reserved for dates and deadlines. The one bold element is the tide chart on the home page; everything
   else stays quiet so the numbers carry the page. */
:root {
  --bg: #fbfcfc;
  --paper: #eef4f5;      /* sea mist: panels, table heads */
  --ink: #102633;        /* harbor blue */
  --muted: #52656f;
  --line: #d3dfe2;
  --accent: #0a6c78;     /* tide */
  --accent-soft: #dcecee;
  --date: #9a5b00;       /* amber: dates, deadlines, days left */
  --sun: #f2b544;        /* amber fill in charts */
  --good: #1d6b3a; --good-bg: #e3f2e7;
  --warn: #7a5200; --warn-bg: #fbf0d4;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1a22; --paper: #132631; --ink: #e4eef1; --muted: #9db0b8; --line: #23394444;
    --accent: #5ec4cf; --accent-soft: #15333b; --date: #f2b544; --sun: #f2b544;
    --good: #7dd39a; --good-bg: #17301f; --warn: #ebc066; --warn-bg: #352a11;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font-body); font-feature-settings: "tnum" 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 2px; }

/* Header */
.top { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; justify-content: space-between; padding: 14px max(18px, calc((100vw - var(--wrap)) / 2)); border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 800 20px/1 var(--font-display); letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand svg { width: 30px; height: 18px; flex: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; font-weight: 500; }
.top nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.top nav a:hover { color: var(--ink); }

main { max-width: var(--wrap); margin: 0 auto; padding: 28px 18px 56px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; font-weight: 800; margin: 6px 0 14px; }
h2 { font-size: 23px; line-height: 1.2; font-weight: 700; margin: 40px 0 12px; }
h3 { font-size: 18px; line-height: 1.3; font-weight: 700; }
p, li { max-width: 70ch; }
.lede { font-size: 19px; line-height: 1.55; color: var(--ink); max-width: 62ch; }
.kicker { color: var(--date); font: 600 14px/1.4 var(--font-body); margin: 0; }
.hero { padding: 4px 0 0; }

/* Numbers */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; margin: 22px 0 8px; border-top: 2px solid var(--ink); }
.stats div { padding: 14px 18px 14px 0; border-bottom: 1px solid var(--line); }
.stats strong { display: block; font: 800 30px/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stats span { color: var(--muted); font-size: 15px; }

/* Tables */
.tw { overflow-x: auto; border-top: 2px solid var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 13.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; padding-right: 20px; }
tr > .num:last-child { padding-right: 0; }
td.soon { color: var(--date); font-weight: 700; }
.sub { display: block; color: var(--muted); font-size: 13.5px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font: 600 13px/1.6 var(--font-body); white-space: nowrap; }
.pill.open { background: var(--accent-soft); color: var(--accent); }
.pill.mid { background: var(--warn-bg); color: var(--warn); }
.pill.done { background: var(--good-bg); color: var(--good); }

/* Event pages */
.event { max-width: 780px; }
.facts { display: grid; grid-template-columns: 1fr; margin: 22px 0; border-top: 2px solid var(--ink); }
.facts div { display: grid; grid-template-columns: minmax(150px, 38%) 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.checks { padding-left: 20px; }
.checks li { margin: 8px 0; }
.eq { border-top: 2px solid var(--ink); }
.eq th { width: 36%; color: var(--muted); font-weight: 500; }
.calc, .signup { background: var(--paper); border-radius: 12px; padding: 20px 22px 16px; margin: 32px 0; }
.calc h2, .signup h2 { margin-top: 0; font-size: 21px; }
.signup { border-left: 4px solid var(--accent); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select { width: 100%; min-width: 0; font: 16px var(--font-body); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.calc-out { font: 700 19px/1.5 var(--font-body); margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.signup-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.signup-form input[type=email] { flex: 1 1 240px; width: auto; }
.signup-form select { flex: 0 1 220px; width: auto; }
button { font: 700 15.5px var(--font-body); background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer; }
button:hover { filter: brightness(1.08); }
:root[data-theme="dark"] button { color: #0c1a22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button { color: #0c1a22; } }
.form-msg { flex-basis: 100%; margin: 4px 0 0; font-size: 14px; }
.fine { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.hp { position: absolute; left: -5000px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.source p { color: var(--muted); font-size: 15px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; }
.prose { max-width: 72ch; }
.how p { max-width: 68ch; }
.crumbs { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.crumbs a { color: var(--muted); }
.cols { columns: 3 170px; padding-left: 18px; }
.cols li { break-inside: avoid; margin: 2px 0; }
.note { background: var(--warn-bg); color: var(--ink); border-radius: 10px; padding: 12px 16px; font-size: 15px; }
.finder input { max-width: 440px; }
.finder-out { list-style: none; padding: 0; margin: 10px 0 0; }
.finder-out li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.wire-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.wire-item h3 { margin: 0 0 4px; font-size: 18px; }
.wire-item ul { margin: 6px 0 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; font-weight: 500; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.subnav a { color: var(--muted); }

/* Bar charts (data page) */
.bars { margin: 16px 0 6px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr minmax(90px, auto); gap: 12px; align-items: center; padding: 6px 0; }
.bar-k { font-size: 15px; }
.bar-track { height: 16px; }
.bar { display: block; height: 16px; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-v { font: 600 14px/1 var(--font-body); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.bar-row:hover .bar { background: var(--ink); }
details.tbl { margin: 6px 0 0; font-size: 14px; }
details.tbl summary { cursor: pointer; color: var(--muted); }

/* Home: the tide chart */
.tide { margin: 8px 0 6px; }
.tide svg { display: block; width: 100%; height: auto; overflow: visible; }
.tide .water { fill: var(--accent-soft); }
.tide .waterline { stroke: var(--accent); stroke-width: 2; }
.tide .tick { stroke: var(--line); }
.tide .tick-label { fill: var(--muted); font: 500 12px var(--font-body); }
.tide .lock { fill: var(--accent); }
.tide .lock:hover, .tide a:focus .lock { fill: var(--ink); }
.tide .deal { fill: var(--bg); stroke: var(--ink); stroke-width: 2; }
.tide .tax { fill: var(--sun); stroke: var(--date); stroke-width: 1.5; }
.tide .label { fill: var(--ink); font: 700 13px var(--font-body); }
.tide .label-sub { fill: var(--muted); font: 500 12px var(--font-body); }
.tide .leader { stroke: var(--muted); stroke-width: 1; opacity: .55; }
.tide .today { stroke: var(--date); stroke-dasharray: 3 3; }
.tide .break { stroke: var(--bg); stroke-width: 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--muted); margin: 6px 0 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 12px; height: 12px; }
.legend .k-lock { background: var(--accent); }
.legend .k-deal { border: 2px solid var(--ink); border-radius: 50%; }
.legend .k-tax { background: var(--sun); transform: rotate(45deg); width: 10px; height: 10px; }

.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 40px; margin-top: 8px; }
.home-grid h2 { margin-top: 32px; font-size: 20px; }
.feed { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.feed li { padding: 11px 0; border-bottom: 1px solid var(--line); max-width: none; }
.feed a { font-weight: 700; color: var(--ink); text-decoration: none; }
.feed a:hover { color: var(--accent); text-decoration: underline; }
.feed .when { color: var(--date); font-weight: 700; font-variant-numeric: tabular-nums; }
.feed .what { display: block; color: var(--muted); font-size: 14.5px; }
.more { font-weight: 600; }
.updated { color: var(--muted); font-size: 14px; margin: 0 0 4px; }

/* Slide-in signup */
.slidein { position: fixed; right: 18px; bottom: 18px; z-index: 20; max-width: 360px; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 16px 18px 12px; box-shadow: 0 10px 30px rgba(16, 38, 51, .16); transform: translateY(130%); transition: transform .35s ease; }
.slidein.show { transform: translateY(0); }
.slidein h2 { font-size: 18px; margin: 0 26px 6px 0; }
.slidein p { font-size: 14.5px; margin: 0 0 10px; color: var(--muted); }
.slidein .x { position: absolute; top: 8px; right: 8px; background: transparent; color: var(--muted); padding: 4px 8px; font-size: 20px; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .slidein { transition: none; } }
@media (max-width: 560px) { .slidein { left: 10px; right: 10px; max-width: none; } }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 26px max(18px, calc((100vw - var(--wrap)) / 2)); color: var(--muted); font-size: 14px; background: var(--paper); }
.foot p { max-width: 90ch; margin: 0 0 8px; }
@media (max-width: 560px) {
  html, body { font-size: 16px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .top nav { gap: 2px 14px; font-size: 14.5px; }
  .tide { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-right: -18px; }
  .tide svg { min-width: 780px; }
  .tide figcaption { padding-right: 18px; }
  .top { padding-bottom: 8px; }
  .top nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 0 18px; scrollbar-width: none; padding-bottom: 4px; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { white-space: nowrap; }
}
