/* Sideshore stylesheet, Rev 5 (v2 redesign, docs/05-design-critique.md §7 and design/v2/styles.css).
   CSP-compatible: this external file is the ONLY source of styling. No <style> blocks, no style="" attributes.
   Colour rules (critique §7.1): green means "good for you" and nothing else; red = danger / no-go; amber = caution;
   brand teal only for the logo and links; arrows neutral unless side-offshore (amber) or offshore (red).
   Every text-on-colour pair is checked by tools/colour_scale_check.py (WCAG AA + colour-vision simulation). */

/* ---------- 1. Tokens: light (default) ---------- */
:root {
  color-scheme: light;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #EEF2F5;
  --surface: #FFFFFF;
  --surface-2: #F5F7F9;
  --line: #D5DCE3;
  --ink: #0A1622;
  --ink-2: #3A4959;
  --ink-3: #5A6A7B;
  --brand: #0A5C70;
  --link: #0A5C70;
  --focus: #1B6FE0;

  /* verdict (per rider) */
  --v-on: #0E7A4B;        --v-on-t: #FFFFFF;
  --v-marg: #DDF1E6;      --v-marg-t: #0B4F32;  --v-marg-bd: #0E7A4B;
  --v-light: #E6EAEE;     --v-light-t: #3A4959;
  --v-nogo: #B42318;      --v-nogo-t: #FFFFFF;

  /* alerts */
  --a-red: #B42318;   --a-red-bg: #FDECEA;  --a-red-t: #5C0F0A;
  --a-amb: #B45309;   --a-amb-bg: #FFF3DC;  --a-amb-t: #4A2600;

  /* direction text: side-offshore (BC-5: >= 4.5:1 on bg, surface, surface-2) and offshore */
  --cls-xoff: #8A5C00;
  --cls-off: #B42318;

  /* wind speed scale (absolute knots; the number is always printed on the colour) */
  --w0: #E9EDF1; --w0-t: #4A5868;   /*  0–7  too light    */
  --w1: #BADDF5; --w1-t: #0A1622;   /*  8–11 foil / light */
  --w2: #93D8C2; --w2-t: #0A1622;   /* 12–15 kiteable     */
  --w3: #34B06E; --w3-t: #03140A;   /* 16–21 ideal        */
  --w4: #F4C23F; --w4-t: #1C1300;   /* 22–27 strong       */
  --w5: #EC7F32; --w5-t: #1C0A00;   /* 28–33 very strong  */
  --w6: #C8322F; --w6-t: #FFFFFF;   /* 34–40 extreme      */
  --w7: #7E3AAE; --w7-t: #FFFFFF;   /* 41+   dangerous    */

  /* chart */
  --c-wind: #0A1622;
  --c-gust: rgb(52 120 190 / 22%);
  --c-gust-line: #3478BE;
  --c-u: #B54708;
  --c-ideal: rgb(52 176 110 / 14%);
  --c-grid: #E1E6EB;
  --c-night: rgb(10 22 34 / 6%);

  --r: 14px; --r-s: 8px;
  --shadow: 0 1px 2px rgb(10 22 34 / 6%), 0 4px 14px rgb(10 22 34 / 5%);
}

/* ---------- 2. Tokens: dark (system preference unless forced light, or forced dark) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #081018; --surface: #0F1A25; --surface-2: #142230; --line: #22364A;
    --ink: #E8EEF4; --ink-2: #B4C2D0; --ink-3: #8898AA; --brand: #6CCBD8; --link: #7FD3DF; --focus: #7FB2FF;
    --v-on: #3CC486; --v-on-t: #03140A;
    --v-marg: #103826; --v-marg-t: #A9EDC9; --v-marg-bd: #3CC486;
    --v-light: #1B2834; --v-light-t: #AEBBC8;
    --v-nogo: #F2716A; --v-nogo-t: #2A0503;
    --a-red: #F2716A; --a-red-bg: #3A1210; --a-red-t: #FFE1DE;
    --a-amb: #F0B25A; --a-amb-bg: #33230A; --a-amb-t: #FFE9C2;
    --cls-xoff: #F0B25A; --cls-off: #F2716A;
    --w0: #1A2631; --w0-t: #9AA9B9;
    --w1: #1E4861; --w1-t: #E6F3FB;
    --w2: #1F6E5C; --w2-t: #E6FFF6;
    --w3: #33A866; --w3-t: #03140A;
    --w4: #E3B237; --w4-t: #1C1300;
    --w5: #E0762C; --w5-t: #1C0A00;
    --w6: #C63E3B; --w6-t: #FFFFFF;
    --w7: #9052BE; --w7-t: #FFFFFF;
    --c-wind: #E8EEF4; --c-gust: rgb(110 170 230 / 22%); --c-gust-line: #6EAAE6; --c-u: #F08C4A;
    --c-ideal: rgb(60 196 134 / 12%); --c-grid: #1C2D3E; --c-night: rgb(0 0 0 / 28%);
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081018; --surface: #0F1A25; --surface-2: #142230; --line: #22364A;
  --ink: #E8EEF4; --ink-2: #B4C2D0; --ink-3: #8898AA; --brand: #6CCBD8; --link: #7FD3DF; --focus: #7FB2FF;
  --v-on: #3CC486; --v-on-t: #03140A;
  --v-marg: #103826; --v-marg-t: #A9EDC9; --v-marg-bd: #3CC486;
  --v-light: #1B2834; --v-light-t: #AEBBC8;
  --v-nogo: #F2716A; --v-nogo-t: #2A0503;
  --a-red: #F2716A; --a-red-bg: #3A1210; --a-red-t: #FFE1DE;
  --a-amb: #F0B25A; --a-amb-bg: #33230A; --a-amb-t: #FFE9C2;
  --cls-xoff: #F0B25A; --cls-off: #F2716A;
  --w0: #1A2631; --w0-t: #9AA9B9;
  --w1: #1E4861; --w1-t: #E6F3FB;
  --w2: #1F6E5C; --w2-t: #E6FFF6;
  --w3: #33A866; --w3-t: #03140A;
  --w4: #E3B237; --w4-t: #1C1300;
  --w5: #E0762C; --w5-t: #1C0A00;
  --w6: #C63E3B; --w6-t: #FFFFFF;
  --w7: #9052BE; --w7-t: #FFFFFF;
  --c-wind: #E8EEF4; --c-gust: rgb(110 170 230 / 22%); --c-gust-line: #6EAAE6; --c-u: #F08C4A;
  --c-ideal: rgb(60 196 134 / 12%); --c-grid: #1C2D3E; --c-night: rgb(0 0 0 / 28%);
  --shadow: none;
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--font); font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 2px; }
b, strong { font-weight: 700; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.vh { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; }
/* scroll containers are the containing block of visually hidden text, so it cannot widen the page */
.strip, .tbl-wrap, .daybar-in, .week, .fold-body, .hero { position: relative; }

/* ---------- 4. Top bar ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand .ico { color: var(--brand); width: 22px; height: 22px; }
.brand-spot { font-weight: 600; color: var(--ink-2); font-size: 15px; }
.top-nav { display: none; gap: 20px; margin-left: 16px; }
.top-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
.top-nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
.rider { white-space: nowrap; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 14px var(--font); text-decoration: none; cursor: pointer; }
.rider .ico { width: 16px; height: 16px; }
.banner { background: var(--a-amb-bg); color: var(--a-amb-t); border-bottom: 2px solid var(--a-amb); font-size: 15px; }
.banner .wrap { display: flex; gap: 10px; align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.banner .ico { color: var(--a-amb); width: 22px; height: 22px; margin-top: 1px; }

/* ---------- 5. Layout ---------- */
main { padding: 12px 0 32px; }
.grid { display: grid; gap: 12px; }
.col { display: grid; gap: 12px; align-content: start; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card--flush > .sec-h { padding: 16px 16px 6px; margin: 0; }
.sec-h { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; margin-bottom: 10px; }
.sec-h h2 { font-size: 20px; font-weight: 800; }
.sec-h a { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-weight: 700; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.page-head { padding: 16px 0 12px; }
.page-head h1 { font-size: 28px; }

/* ---------- 6. Safety banner (red) and amber lines ---------- */
.safety { display: grid; gap: 8px; }
.alert { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 10px; padding: 14px 16px; border-radius: var(--r); border: 2px solid var(--a-red); background: var(--a-red-bg); color: var(--a-red-t); }
.alert > .ico { width: 26px; height: 26px; color: var(--a-red); grid-row: span 2; }
.alert > :not(svg) { grid-column: 2; }
.alert h2 { font-size: 18px; font-weight: 800; }
.alert p { font-size: 15px; }
.alert .why { font-size: 13px; margin-top: 4px; }
.alert .more-red { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--a-red); font-size: 14px; }
.alert a { color: inherit; font-weight: 700; }
.alert--amber { border-color: var(--a-amb); background: var(--a-amb-bg); color: var(--a-amb-t); }
.alert--amber > .ico { color: var(--a-amb); }
.flag { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; padding: 8px 10px; border-radius: var(--r-s); background: var(--a-amb-bg); color: var(--a-amb-t); border-left: 4px solid var(--a-amb); }
.flag .ico { color: var(--a-amb); margin-top: 2px; }
.flag-more > summary { cursor: pointer; font-weight: 700; color: var(--link); min-height: 32px; list-style: none; }
.flag-more > summary::-webkit-details-marker { display: none; }
.flag-more[open] { display: grid; gap: 6px; }

/* ---------- 7. Verdict chips ---------- */
.v { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 14px; white-space: nowrap; border: 1.5px solid transparent; }
.v .ico { width: 15px; height: 15px; }
.v-on { background: var(--v-on); color: var(--v-on-t); }
.v-marg { background: var(--v-marg); color: var(--v-marg-t); border-color: var(--v-marg-bd); }
.v-light { background: var(--v-light); color: var(--v-light-t); }
.v-nogo { background: var(--v-nogo); color: var(--v-nogo-t); }

/* ---------- 8. Hero ---------- */
.hero { padding: 0; overflow: hidden; }
.hero-band { height: 6px; background: var(--v-on); }
.hero-band.b-marg { background: var(--v-marg-bd); opacity: .5; }
.hero-band.b-light { background: var(--line); }
.hero-band.b-nogo { background: repeating-linear-gradient(135deg, var(--v-nogo) 0 10px, transparent 10px 16px); height: 8px; }
.hero-in { padding: 14px 16px 16px; display: grid; gap: 12px; }
.hero-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.verdict { font-size: 32px; font-weight: 850; letter-spacing: -0.01em; line-height: 1.05; }
.verdict .when { display: block; font-size: 22px; font-weight: 700; color: var(--ink-2); margin-top: 4px; letter-spacing: 0; }
.verdict.is-on { color: var(--v-on); }
.verdict.is-marg { color: var(--v-marg-t); }
.verdict.is-nogo { color: var(--a-red); }
.facts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.fact { background: var(--surface-2); border-radius: var(--r-s); padding: 8px 10px; min-width: 0; }
.fact .k { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.fact .val { font-size: 22px; font-weight: 800; line-height: 1.1; margin-top: 2px; display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.fact .val svg { align-self: center; }
.fact .val small { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.fact .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.fact .arr { width: 24px; height: 24px; }
.fact--bad { background: var(--a-red-bg); color: var(--a-red-t); }
.fact--bad .sub, .fact--bad .k { color: var(--a-red-t); }
.local { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.local .ico { color: var(--c-u); margin-top: 2px; }
.local b { color: var(--ink); }
.hero-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-3); }
.conf { display: inline-flex; gap: 3px; align-items: flex-end; margin-right: 2px; vertical-align: -1px; }
.conf i { display: inline-block; width: 4px; border-radius: 1px; background: var(--line); }
.conf i:nth-child(1) { height: 6px; } .conf i:nth-child(2) { height: 9px; } .conf i:nth-child(3) { height: 12px; }
.conf.c3 i, .conf.c2 i:nth-child(-n+2), .conf.c1 i:nth-child(1) { background: var(--ink-2); }

/* ---------- 9. Hour strip and wind cells ---------- */
.strip { display: grid; grid-template-columns: 40px repeat(15, minmax(0, 1fr)); gap: 2px; align-items: center; font-size: 12px; }
.strip .lab { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.strip .h { text-align: center; color: var(--ink-3); font-size: 11px; }
.strip .h.now { color: var(--ink); font-weight: 800; }
.cell { text-align: center; border-radius: 4px; font-weight: 800; font-size: 13px; line-height: 26px; min-height: 26px; }
.g { text-align: center; font-size: 12px; color: var(--ink-2); }
.a { display: flex; justify-content: center; color: var(--ink-2); }
.ok { height: 6px; border-radius: 3px; background: transparent; }
.ok.y { background: var(--v-on); }
.ok.k { background: var(--v-on); opacity: .5; }
.ok.m { background: var(--v-marg-bd); opacity: .25; }
.ok.x { background: repeating-linear-gradient(90deg, var(--v-nogo) 0 4px, transparent 4px 6px); }  /* shape cue as well as colour */
.nowcol { box-shadow: 0 0 0 2px var(--ink); }
.strip-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.strip-key span { display: inline-flex; align-items: center; gap: 5px; }
.strip-key .sw { width: 14px; height: 6px; border-radius: 3px; display: inline-block; }
.sw.y { background: var(--v-on); } .sw.k { background: var(--v-on); opacity: .5; } .sw.x { background: var(--v-nogo); }
.strip--key { grid-template-columns: 40px repeat(8, minmax(0, 1fr)); }
.strip--key .cell { font-size: 11px; }
.w0 { background: var(--w0); color: var(--w0-t); }
.w1 { background: var(--w1); color: var(--w1-t); }
.w2 { background: var(--w2); color: var(--w2-t); }
.w3 { background: var(--w3); color: var(--w3-t); }
.w4 { background: var(--w4); color: var(--w4-t); }
.w5 { background: var(--w5); color: var(--w5-t); }
.w6 { background: var(--w6); color: var(--w6-t); }
.w7 { background: var(--w7); color: var(--w7-t); }
.nodata { background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, var(--surface) 5px 9px); color: var(--ink-2); }

/* arrows point downwind; the rotation lives in the SVG transform attribute (CSP-safe) */
.arr { fill: currentColor; flex: none; }
.cls-off { color: var(--cls-off); }
.cls-xoff { color: var(--cls-xoff); }

/* ---------- 10. Right now ---------- */
.nowrow { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 15px; align-items: baseline; margin: 0; }
.nowrow dt { font-weight: 700; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.nowrow dd { margin: 0; }
.tag.tag--obs { text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-2); vertical-align: 1px; }

/* ---------- 11. Week rows ---------- */
.week { list-style: none; margin: 0; padding: 0; }
.week li + li { border-top: 1px solid var(--line); }
.day { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto 20px; grid-template-areas: "d v p c" "m m m m"; gap: 8px 10px; align-items: center; padding: 12px 16px; color: var(--ink); text-decoration: none; min-height: 64px; }
.day:hover { background: var(--surface-2); }
.day .d { grid-area: d; line-height: 1.15; }
.day .d b { display: block; font-size: 16px; }
.day .d span { font-size: 13px; color: var(--ink-3); }
.day .vv { grid-area: v; display: flex; align-items: center; gap: 4px 8px; min-width: 0; flex-wrap: wrap; }
.day .win { font-weight: 700; font-size: 15px; }
.day .pk { grid-area: p; text-align: right; font-size: 15px; white-space: nowrap; }
.day .pk b { font-size: 17px; }
.day .pk .pu { color: var(--ink-2); font-size: 14px; }
.day .pk svg { vertical-align: -2px; }
.day .mini { grid-area: m; display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 2px; padding-bottom: 4px; }
.mini i { display: block; height: 18px; border-radius: 2px; font-style: normal; }
.mini b { display: block; font-size: 10px; line-height: 18px; text-align: center; font-weight: 800; }
.mini i.y { box-shadow: 0 4px 0 -1px var(--v-on); }
.mini i.x { box-shadow: 0 4px 0 -1px var(--v-nogo); }
.day .chev { grid-area: c; color: var(--ink-3); }
.hint { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.week-note { padding: 10px 16px 14px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }

/* ---------- 12. Conditions ---------- */
.cond { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cond .fact .val { font-size: 20px; white-space: normal; }

/* ---------- 13. Folds ---------- */
details.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 700; min-height: 52px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .ico:last-child { margin-left: auto; color: var(--ink-3); transition: transform .15s; }
details.fold[open] > summary .ico:last-child { transform: rotate(90deg); }
details.fold > summary small { font-weight: 500; color: var(--ink-3); font-size: 13px; }
.fold-body { padding: 0 16px 16px; display: grid; gap: 12px; font-size: 15px; min-width: 0; }
.fold-body ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.terms { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.terms dt { font-weight: 700; }
.terms dd { margin: 0; color: var(--ink-2); }
details.more-rows > summary { cursor: pointer; font-weight: 700; color: var(--link); padding: 10px 0 0; list-style: none; min-height: 40px; }
details.more-rows > summary::-webkit-details-marker { display: none; }

/* direction rose */
.compass-holder { display: grid; justify-items: center; gap: 6px; }
.compass { width: 100%; max-width: 240px; height: auto; }
.cp-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.cp-sector { stroke: var(--surface); stroke-width: 2; }
.cp-sector.s-on { fill: #8FA8C0; } .cp-sector.s-xon { fill: #BFE6D3; } .cp-sector.s-cross { fill: #7FCBA6; }
.cp-sector.s-xoff { fill: #F3C77F; } .cp-sector.s-off { fill: #F0948C; }
.cp-shore { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.cp-land { fill: var(--surface-2); }
.cp-t { fill: #0A1622; font-size: 10px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
.cp-t--card { fill: var(--ink-3); font-size: 12px; }
.cp-t--sea { fill: var(--link); font-size: 12px; }
.cp-wind { fill: var(--ink); }
.cp-wind-line { stroke: var(--ink); stroke-width: 2.5; }

/* ---------- 14. Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 20px 0 40px; font-size: 14px; color: var(--ink-2); }
.foot .wrap { display: grid; gap: 12px; }
.sos { display: flex; flex-wrap: wrap; gap: 8px; }
.sos a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--ink); color: var(--ink); font-weight: 800; text-decoration: none; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- 15. Day view ---------- */
.daybar { position: sticky; top: 0; z-index: 5; background: var(--bg); margin: -12px -16px 0; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.daybar-in { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: stretch; }
.daybar-in::-webkit-scrollbar { display: none; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; text-decoration: none; min-height: 44px; padding-right: 6px; flex: none; }
.dchip { flex: none; display: grid; justify-items: center; gap: 3px; min-width: 50px; min-height: 44px; padding: 6px 6px 7px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; }
.dchip b { font-size: 14px; }
.dchip i { display: block; width: 28px; height: 5px; border-radius: 3px; background: var(--line); }
.dchip i.y { background: var(--v-on); } .dchip i.x { background: var(--v-nogo); } .dchip i.m { background: var(--v-marg-bd); opacity: .5; }
.dchip[aria-current] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.view-day .grid--day { margin-top: 12px; }
.chart-box { width: 100%; min-height: 250px; }
.chart-box--models, .chart-box--tide { min-height: 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.chart .grid-l { stroke: var(--c-grid); stroke-width: 1; }
.chart .ideal { fill: var(--c-ideal); }
.chart .night { fill: var(--c-night); }
.chart .gust { fill: var(--c-gust); }
.chart .gust-l { fill: none; stroke: var(--c-gust-line); stroke-width: 1.5; }
.chart .wind { fill: none; stroke: var(--c-wind); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .u { fill: none; stroke: var(--c-u); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .ax { font-size: 11px; font-weight: 600; fill: var(--ink-3); }
.chart .lbl { font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .lbl-w { fill: var(--c-wind); } .chart .lbl-g { fill: var(--c-gust-line); } .chart .lbl-u { fill: var(--c-u); } .chart .lbl-i { fill: var(--v-on); }
.chart .okbar { fill: var(--v-on); } .chart .okbar.k { fill-opacity: .5; } .chart .xbar { fill: var(--v-nogo); }
.chart .arrw { fill: var(--ink-2); }
.chart .arrw.off { fill: var(--cls-off); } .chart .arrw.xoff { fill: var(--cls-xoff); }
.chart .nowl { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 2 3; }
.chart .m-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.chart .m-icon { stroke-dasharray: 9 4; } .chart .m-gfs { stroke-dasharray: 3 3; } .chart .m-arpege { stroke-dasharray: 1 4; stroke-linecap: round; stroke-width: 2; }
.chart .m-cons { fill: none; stroke: var(--c-wind); stroke-width: 3; }
.chart .m-ens { fill: var(--c-gust); }
.chart .t-area { fill: var(--c-gust); }
.chart .t-curve { fill: none; stroke: var(--c-gust-line); stroke-width: 2.5; }
.chart .t-ev { fill: var(--surface); stroke: var(--c-gust-line); stroke-width: 2; }
.chart .t-ev-t { fill: var(--ink); font-weight: 700; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.hours { border-collapse: separate; border-spacing: 2px; font-size: 13px; min-width: 100%; }
table.hours th, table.hours td { text-align: center; padding: 0; height: 30px; min-width: 34px; white-space: nowrap; }
table.hours th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding-right: 8px; font-size: 12px; color: var(--ink-3); font-weight: 700; min-width: 64px; }
table.hours thead th { font-size: 12px; color: var(--ink-3); font-weight: 700; }
table.hours thead th.now { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
table.hours th.night { color: var(--ink-3); opacity: .7; }
table.hours td.cell { font-size: 14px; }
table.hours td.a, table.hours td .a { justify-content: center; }
table.hours td.sh { font-size: 11px; font-weight: 700; color: var(--ink-2); }
table.hours td.sh.bad { color: var(--cls-off); }
table.hours td.sh.warn { color: var(--cls-xoff); }
table.hours td.rt > span:not(.vh) { display: block; height: 8px; border-radius: 4px; margin: 0 3px; }
.rt .y { background: var(--v-on); } .rt .k { background: var(--v-on); opacity: .5; } .rt .m { background: var(--v-marg-bd); opacity: .25; } .rt .n { background: var(--line); } .rt .x { background: repeating-linear-gradient(90deg, var(--v-nogo) 0 4px, transparent 4px 6px); }
table.hours td.kite { font-weight: 700; }
.tbl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; }
.models-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.models-table caption { text-align: left; color: var(--ink-2); padding-bottom: 6px; }
.models-table th, .models-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.models-table thead th { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.daynav-bottom { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 8px; margin: 16px -16px -32px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
.daynav-bottom a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); font-weight: 800; color: var(--ink); text-decoration: none; }

/* ---------- 16. Other pages, forms, sheets, states ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 32px; margin-bottom: 8px; font-size: 22px; }
.prose h3 { margin-top: 16px; margin-bottom: 8px; font-size: 17px; }
.prose p, .prose li { font-size: 16px; line-height: 26px; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 22px; }
.prose details { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); }
.prose details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--link); }
.prose table, .runs { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 12px; }
.prose th, .prose td, .runs th, .runs td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.prose .card + .card, .card + .card { margin-top: 12px; }
.col > .card + .card, .grid .card + .card { margin-top: 0; }
.draft { display: inline-block; margin-top: 8px; }
.credit-list { display: grid; gap: 12px; padding-left: 22px; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--ink-3); color: var(--ink-2); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge--old { background: var(--a-amb-bg); border-color: var(--a-amb); color: var(--a-amb-t); }
.btn-plain { font: inherit; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--link); background: var(--surface); color: var(--link); font-weight: 700; cursor: pointer; }
.btn-s { min-height: 40px; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: 92vw; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.has-daynav .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
.noscript { margin: 16px 0; }
.state-msg { margin: 24px 0; }
.err h2 { margin-bottom: 8px; }
.err .sos { margin: 12px 0; }
.skel-block { display: block; border-radius: var(--r); background: var(--surface-2); }
.skel-hero { height: 360px; } .skel-strip { height: 200px; } .skel-side { height: 240px; }
.loading-line { color: var(--ink-3); font-size: 14px; margin-top: 8px; }
dialog.sheet { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(560px, 94vw); max-height: 88vh; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog.sheet::backdrop { background: rgb(0 0 0 / 45%); }
dialog.sheet[open] { animation: sheet-in .18s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-body { padding: 16px; display: grid; gap: 16px; }
.close-btn { font: inherit; min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.form-group { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.form-group legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px 8px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-height: 44px; }
.radio-card input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--v-on); }
.radio-card b { display: block; }
.radio-card span { color: var(--ink-2); font-size: 14px; }
.radio-card:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface); }
.seg label { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:checked) { background: var(--ink); color: var(--surface); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { font: inherit; min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper input { font: inherit; font-size: 16px; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 88px; text-align: center; }
.form-note { font-size: 14px; color: var(--ink-2); }
.saved { font-size: 14px; color: var(--ink-2); min-height: 20px; }

/* ---------- 17. Wider screens ---------- */
@media (min-width: 600px) {
  .day { grid-template-columns: 96px minmax(0, 1fr) auto 20px; grid-template-areas: "d v p c" "d m m c"; }
  .mini i { height: 24px; }
  .mini b { font-size: 12px; line-height: 24px; }
}
@media (min-width: 960px) {
  .top-nav { display: flex; }
  main { padding-top: 20px; }
  .grid--home, .grid--day { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .col { gap: 16px; }
  .verdict { font-size: 40px; }
  .verdict .when { display: inline; margin: 0 0 0 10px; font-size: 26px; }
  .fact .val { font-size: 28px; }
  .strip { grid-template-columns: 56px repeat(15, minmax(0, 1fr)); gap: 3px; }
  .cell { font-size: 15px; line-height: 32px; min-height: 32px; }
  .mini i { height: 26px; }
  .mini b { font-size: 12px; line-height: 26px; }
  .daybar { margin: -20px 0 0; padding: 8px 0; }
  .daynav-bottom { display: none; }
  table.hours th, table.hours td { min-width: 40px; height: 34px; }
  table.hours td.cell { font-size: 15px; }
}
@media (max-width: 479px) {
  .brand-spot { display: none; }
  .fact .val small { font-size: 13px; }
  .fact { padding: 8px; }
}

/* ---------- 18. Preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .v, .cell, .mini i, .alert, .flag, .card, .fold, .dchip, .fact, .tag { border: 1px solid CanvasText; }
  .ok, .rt span, .conf i, .sw { background: CanvasText; forced-color-adjust: none; }
  .arr, .arrw { fill: CanvasText; }
  .chart .wind, .chart .m-cons, .chart .t-curve { stroke: CanvasText; }
}
@media print {
  .top, .daybar, .daynav-bottom, .banner { display: none; }
  body { background: #fff; color: #000; }
}
