:root {
  --ink: #0f2233;
  --ink-soft: #3d5163;
  --paper: #f3f6f8;
  --panel: #ffffff;
  --line: #cfd9e1;
  --port: #c8102e;
  --stbd: #00794a;
  --flag: #ffcd00;
  --sea: #1d4e6e;
  --nogo: #e3ebf1;
  --body: "Barlow", system-ui, sans-serif;
  --head: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --measure: 68ch;
}
body.legible { --body: "Atkinson Hyperlegible", system-ui, sans-serif; --head: "Atkinson Hyperlegible", system-ui, sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 1.075rem; line-height: 1.65; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--flag); padding: .5rem 1rem; z-index: 10; }

.top { background: var(--sea); color: #fff; padding: 3rem 0 2rem; border-bottom: 6px solid var(--flag); }
.eyebrow { font-family: var(--head); text-transform: uppercase; letter-spacing: .14em; font-size: .9rem; margin: 0; opacity: .85; }
h1 { font-family: var(--head); font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; margin: .3rem 0 .8rem; font-weight: 700; }
.lede { max-width: 56ch; font-size: 1.15rem; margin: 0 0 1.4rem; }
.tools { display: flex; flex-wrap: wrap; gap: .5rem; }
button { font: inherit; font-size: .95rem; cursor: pointer; border: 2px solid currentColor; background: transparent; color: inherit; padding: .45rem .9rem; border-radius: 4px; }
.top button:hover, .top button[aria-pressed="true"] { background: #fff; color: var(--sea); }

.toc { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; }
.toc .wrap { display: flex; gap: 1.1rem; padding-top: .6rem; padding-bottom: .6rem; max-width: none; }
.toc a { color: var(--ink-soft); text-decoration: none; font-family: var(--head); font-weight: 600; font-size: 1rem; letter-spacing: .02em; }
.toc a:hover, .toc a:focus { color: var(--port); }

section { padding: 2.4rem 0 1rem; border-bottom: 1px solid var(--line); }
h2 { font-family: var(--head); font-size: 2rem; margin: 0 0 .2rem; font-weight: 700; }
.meta { color: var(--ink-soft); margin: 0 0 1.2rem; font-size: .95rem; }
p, li { max-width: var(--measure); }
li { margin-bottom: .45rem; }

.ten { padding-left: 1.4rem; }
.ten li { margin-bottom: .8rem; }
.card-section { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--port); padding: 1.6rem 1.6rem 1rem; margin-top: 2rem; border-radius: 4px; }

details { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; margin: 0 0 .7rem; }
summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; font-family: var(--body); list-style: none; position: relative; padding-left: 2.2rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; position: absolute; left: .9rem; top: .7rem; font-weight: 700; color: var(--sea); }
details[open] > summary::before { content: "\2212"; }
details[open] > summary { border-bottom: 1px solid var(--line); }
details > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
details > ol, details > ul { padding-left: 1.4rem; }
details > :last-child { margin-bottom: 1rem; }
summary label { cursor: pointer; }
summary input, .checks input { width: 1.1rem; height: 1.1rem; margin-right: .5rem; vertical-align: -2px; accent-color: var(--stbd); }
.checks { list-style: none; padding-left: 0 !important; }

.callout { background: #fff8d6; border-left: 5px solid var(--flag); padding: .9rem 1rem; border-radius: 3px; }
.note { color: var(--ink-soft); font-size: .97rem; background: var(--paper); padding: .7rem .9rem; border-radius: 3px; }
.note.warn { background: #fdeceef0; color: var(--ink); border-left: 4px solid var(--port); }

table { border-collapse: collapse; width: calc(100% - 2rem); font-size: .97rem; margin-bottom: 1rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--head); font-size: 1.02rem; letter-spacing: .02em; background: var(--paper); }

.diagram { margin: 0 0 1.4rem; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1rem; }
.diagram svg { width: 100%; max-width: 440px; display: block; margin: 0 auto; color: var(--sea); }
.diagram.buoys svg { max-width: 420px; }
figcaption { text-align: center; font-size: .95rem; color: var(--ink-soft); margin-top: .5rem; }
.svg-wind line { stroke: currentColor; stroke-width: 3; }
.svg-wind text { fill: currentColor; font: 700 14px var(--head); letter-spacing: .1em; }
.svg-nogo { fill: var(--nogo); stroke: var(--line); }
.svg-ring { fill: none; stroke: var(--line); stroke-dasharray: 4 5; }
.svg-pts circle { fill: var(--sea); }
.svg-label { fill: var(--ink); font: 600 14px var(--body); }
.svg-small { fill: var(--ink-soft); font: 12px var(--body); }
.svg-red { fill: var(--port); }
.svg-green { fill: var(--stbd); }
.svg-num-light { fill: #fff; font: 700 20px var(--head); }

.flash { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--stbd); padding: 1.4rem; border-radius: 4px; margin-bottom: 1.5rem; }
.flash-count { color: var(--ink-soft); font-size: .9rem; margin: 0 0 .4rem; }
.flash-q { font-size: 1.25rem; font-weight: 600; margin: 0 0 .8rem; }
.flash-a { background: var(--paper); padding: .8rem 1rem; border-radius: 3px; }
.flash-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.flash button { color: var(--sea); }
.flash button:hover { background: var(--sea); color: #fff; }

a { color: var(--sea); }
.foot { padding: 2rem 1.25rem 3rem; color: var(--ink-soft); font-size: .92rem; }
:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }

@media (max-width: 560px) {
  body { font-size: 1.02rem; }
  .card-section { padding: 1.2rem 1rem .6rem; }
}

@media print {
  .top .tools, .toc, .flash-btns, #quiz, .skip { display: none !important; }
  .top { background: none; color: #000; padding: 0; border: 0; }
  body { background: #fff; font-size: 10.5pt; }
  details { border: 0; break-inside: avoid; }
  details > summary::before { content: ""; }
  section { break-inside: auto; border: 0; padding: .6rem 0; }
  body.print-card main > section:not(#quick), body.print-card .foot, body.print-card .lede { display: none !important; }
}
