:root {
  color-scheme: light;
  --page: #e4eaec;          /* overcast */
  --sheet: #fcfcfb;         /* chart surface */
  --ink: #14232b;
  --ink-2: #47575f;
  --muted: #7d898e;
  --rule: #d5dcde;
  --grid: #e3e7e8;
  --axis: #b9c3c6;
  --rail: #16262e;          /* storm slate */
  --rail-ink: #dfe7ea;
  --accent: #0b5f6b;        /* cold Pacific */
  --accent-ink: #ffffff;
  --good: #006300; --bad: #b3261e;
  --seq: #2a78d6;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
  --sans: "IBM Plex Sans Condensed", "Avenir Next Condensed", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0e1518; --sheet: #1a1a19; --ink: #f0efec; --ink-2: #c3c8c9; --muted: #8b9498;
    --rule: #2e3537; --grid: #2a2e2f; --axis: #3d4547; --rail: #0a1114; --rail-ink: #cfd8db;
    --accent: #5fc1cd; --accent-ink: #06181c; --good: #0ca30c; --bad: #e66767; --seq: #3987e5;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.desk { display: grid; grid-template-columns: 208px minmax(0, 1fr) 340px; min-height: 100vh; }

/* rail */
.rail { background: var(--rail); color: var(--rail-ink); padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: var(--serif); font-size: 1.45rem; margin: 0 6px 26px; letter-spacing: -0.01em; }
.rail h2 { font-size: 0.87rem; font-weight: 500; color: #8fa1a8; margin: 18px 6px 6px; }
.rail .spot { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid transparent; color: inherit; padding: 7px 8px; cursor: pointer; font-size: 1.02rem; }
.rail .spot:hover { background: rgba(255, 255, 255, 0.06); }
.rail .spot[aria-current="true"] { border-left-color: #7fd0da; background: rgba(255, 255, 255, 0.09); font-weight: 600; }
.rail .ghost { margin: 22px 6px 0; color: var(--rail-ink); border-color: rgba(255, 255, 255, 0.28); }

/* main sheet */
main { background: var(--sheet); padding: 30px 36px 80px; min-width: 0; }
.spot-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px; margin-bottom: 6px; }
.spot-head h1 { font-family: var(--serif); font-weight: 500; font-size: 3rem; line-height: 1; letter-spacing: -0.02em; margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 4px; }
.facts div { display: flex; gap: 6px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.checked { color: var(--muted); font-size: 0.93rem; }

section { border-top: 1px solid var(--rule); margin-top: 28px; padding-top: 18px; }
section > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 12px; }
section h2 { font-size: 1.2rem; font-weight: 600; margin: 0; }
section .sub { color: var(--ink-2); margin: 0; }
.state { color: var(--ink-2); padding: 14px 0; }
.state.error { color: var(--bad); }

/* run board: doubles as the model legend */
.runs { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0; border: 1px solid var(--rule); }
.run { padding: 10px 12px; border-right: 1px solid var(--rule); min-width: 0; }
.run:last-child { border-right: 0; }
.run .name { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 1.07rem; }
.swatch { width: 14px; height: 4px; border-radius: 2px; flex: none; }
.run .when { font-variant-numeric: tabular-nums; }
.run .age, .run .about { color: var(--muted); font-size: 0.9rem; }
.run .change { font-size: 0.9rem; margin-top: 3px; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 6px; overflow: hidden; margin-left: auto; }
.seg button { border: 0; background: none; padding: 4px 11px; cursor: pointer; border-right: 1px solid var(--axis); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }

/* tables */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 9px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
thead th { font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--axis); vertical-align: bottom; }
thead th small { display: block; color: var(--muted); font-weight: 400; font-size: 0.87rem; }
th:first-child, td:first-child { text-align: left; }
tbody th { font-weight: 600; }
tbody th .swatch { display: inline-block; vertical-align: middle; margin-right: 7px; }
td.total, th.total { border-left: 1px solid var(--axis); font-weight: 600; }
td.na { color: var(--muted); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart text.end { fill: var(--ink-2); font-size: 12.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 6px; padding: 0; list-style: none; color: var(--ink-2); font-size: 0.93rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.pair h3, h3.mini { font-size: 1rem; font-weight: 600; margin: 14px 0 6px; }
.chances { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.chances b { font-weight: 600; }

.tip { position: fixed; z-index: 2000; pointer-events: none; background: var(--sheet); color: var(--ink); border: 1px solid var(--axis); border-radius: 6px; padding: 8px 10px; font-size: 0.93rem; box-shadow: 0 6px 18px rgba(10, 25, 32, 0.16); min-width: 150px; }
.tip .t { font-weight: 600; margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.tip .r span:last-child { margin-left: auto; padding-left: 14px; font-weight: 600; }

/* tides */
.tides { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 24px; }
.tides h3 { font-size: 1rem; margin: 0 0 4px; font-weight: 600; }
.tides ul { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.tides li { display: flex; gap: 8px; }
.tides li span:first-child { width: 2.6em; color: var(--muted); }
.tides li span:last-child { margin-left: auto; }

/* discussion: long-form reading */
.prose { font-family: var(--serif); font-size: 1.13rem; line-height: 1.58; max-width: 68ch; }
.prose p { margin: 0 0 0.85em; }
.prose ul { margin: 0 0 0.85em; padding-left: 1.1em; }
.prose li { margin-bottom: 0.4em; }
details { border-bottom: 1px solid var(--grid); }
details summary { cursor: pointer; padding: 9px 0; font-weight: 600; font-size: 1.02rem; }
details[open] summary { margin-bottom: 4px; }

/* buttons and forms */
button.primary, button.ghost { border-radius: 6px; padding: 6px 13px; cursor: pointer; border: 1px solid var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.ghost { background: none; color: var(--accent); }
button.quiet { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 4px; text-decoration: underline; font-size: 0.9rem; }
button.quiet:hover { color: var(--bad); }
button:disabled { opacity: 0.55; cursor: default; }
input, select, textarea { background: var(--sheet); border: 1px solid var(--axis); border-radius: 5px; padding: 6px 8px; width: 100%; }
textarea { resize: vertical; min-height: 74px; font-family: var(--serif); font-size: 1.07rem; line-height: 1.45; }
label { display: block; font-size: 0.93rem; color: var(--ink-2); }
label input, label select, label textarea { margin-top: 3px; color: var(--ink); font-size: 1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; margin: 0; }
fieldset.row legend { font-size: 0.93rem; color: var(--ink-2); padding: 0; }
label.inline { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 1rem; }
label.inline input { width: auto; margin: 0; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0; }
.error { color: var(--bad); margin: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }

/* notebook */
.notebook { padding: 26px 22px 60px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.notebook h2 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin: 0 0 10px; letter-spacing: -0.01em; }
.notebook .block + .block { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--axis); }
.notebook form { display: grid; gap: 9px; }
.notes, .calls { list-style: none; margin: 16px 0 0; padding: 0; }
.notes li, .calls li { padding: 11px 0; border-top: 1px solid var(--rule); }
.note-body { font-family: var(--serif); font-size: 1.1rem; line-height: 1.48; white-space: pre-wrap; margin: 0 0 4px; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 0.9rem; display: flex; gap: 10px; align-items: baseline; }
.meta .quiet { margin-left: auto; }
.by-claude { border-left: 3px solid var(--accent); padding-left: 10px; }
.score { color: var(--ink-2); margin: 0 0 12px; }
.call-range { font-size: 1.13rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.call-why { font-family: var(--serif); font-size: 1.03rem; line-height: 1.45; margin: 3px 0 6px; color: var(--ink-2); }
.grade { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.grade input { width: 92px; }
.result { font-weight: 600; }
.result.hit { color: var(--good); }
.result.miss { color: var(--bad); }
.empty { color: var(--ink-2); font-family: var(--serif); font-size: 1.05rem; margin: 14px 0 0; }

dialog { border: 1px solid var(--axis); border-radius: 10px; background: var(--sheet); color: var(--ink); padding: 22px; width: min(440px, 92vw); }
dialog::backdrop { background: rgba(10, 22, 28, 0.5); }
dialog form { display: grid; gap: 11px; }
dialog h2 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin: 0; }

@media (max-width: 1180px) {
  .desk { grid-template-columns: 190px minmax(0, 1fr); }
  .notebook { grid-column: 2; position: static; height: auto; border-top: 1px solid var(--axis); }
}
@media (max-width: 760px) {
  .desk { display: block; }
  .rail { position: static; height: auto; padding: 14px; }
  .brand { margin-bottom: 8px; }
  #spots { display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; }
  .rail h2 { margin: 6px; width: 100%; }
  .rail .spot { width: auto; border-left: 0; border-bottom: 3px solid transparent; }
  .rail .spot[aria-current="true"] { border-bottom-color: #7fd0da; }
  main { padding: 20px 16px 40px; }
  .spot-head h1 { font-size: 2.2rem; }
  .pair { grid-template-columns: 1fr; }
  .head-actions { margin-left: 0; }
}

/* storm radar */
.bigmap { height: min(62vh, 560px); min-height: 360px; border: 1px solid var(--rule); background: var(--page); }
.scrub { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.scrub input[type="range"] { flex: 1 1 220px; width: auto; padding: 0; border: 0; background: none; accent-color: var(--accent); }
.frame-label { flex: 0 0 auto; min-width: 15em; font-weight: 600; font-variant-numeric: tabular-nums; }
.model-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px 14px; }
.model-map { margin: 0; }
.model-map figcaption { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.model-map figcaption span:last-child { color: var(--muted); font-size: 0.9rem; }
.minimap { aspect-ratio: 5 / 6; border: 1px solid var(--rule); background: var(--page); cursor: crosshair; }
.mini-note { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; min-height: 1.3em; }
.ramp { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; color: var(--ink-2); font-size: 0.93rem; }
.ramp-title { padding-top: 0; white-space: nowrap; }
.ramp-bar { position: relative; flex: 0 1 300px; height: 10px; border-radius: 2px; margin: 4px 14px 18px 0; }
.ramp-bar span { position: absolute; top: 13px; transform: translateX(-50%); font-size: 0.87rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.leaflet-container { font-family: var(--sans); background: var(--page); }
.leaflet-container .leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--sheet) 80%, transparent); color: var(--muted); }
.leaflet-container .leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-image-layer { image-rendering: auto; }

/* North Pacific */
.model-maps.wide { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.minimap.wide { aspect-ratio: 2 / 1; }
.low { display: flex; flex-direction: column; align-items: center; line-height: 1; color: #b3261e; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; pointer-events: none; }
.low b { font-size: 15px; font-weight: 600; }
.low span { font-size: 11px; font-weight: 600; color: #14232b; font-variant-numeric: tabular-nums; }
.low-key { color: #b3261e; }
.scrub + label.inline { margin: -2px 0 10px; color: var(--ink-2); font-size: 0.93rem; }
.head-actions .seg { margin-left: 0; }
