/* Chart Kit viewer — tokens come from config.js (build.js derives them from client.json). */

@font-face {
  font-family: "Open Sans";
  src: url("./fonts/open-sans-latin-wdth-normal.woff2") format("woff2");
  font-weight: 300 800; font-stretch: 75% 100%; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  src: url("./fonts/open-sans-latin-ext-wdth-normal.woff2") format("woff2");
  font-weight: 300 800; font-stretch: 75% 100%; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* brand (overridden by config.js) */
  --brand: #14407C; --brand-2: #0C71C3; --accent: #F2840A; --accent-ink: #B05A00; --sky: #2EA3F2;
  --bg: #F2F2F2; --paper: #FFFFFF; --ink: #333333; --ink-2: #5F6670; --line: #DDE3EA; --line-2: #C5CFDA;
  --sky-tint: #EAF5FD; --accent-tint: #FEF1E4;
  /* statuses: meaning fixed, tones per client */
  --ok: #1F8A5B; --ok-ink: #17704A; --ok-tint: #E4F3EB;
  --bk: #D2453F; --bk-ink: #A8302B; --bk-tint: #FBE8E6;
  --op: #F0B90F; --op-ink: #7A5800; --op-tint: #FDF3D6;
  --nc: #67727F; --nc-ink: #4D5763; --nc-tint: #ECEFF2;
  --wt: #5A86B8; --wt-ink: #3B5F8A; --wt-tint: #E7EEF6;
  --np: #A3ACB6; --np-tint: #F6F7F8;
  --font: "Open Sans", "Segoe UI", Arial, sans-serif;
  --toolbar-h: 56px;
  --head-top: var(--toolbar-h);
  --week-w: 168px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 var(--font); font-variant-numeric: tabular-nums;
}
a { color: var(--brand-2); }
button { font: inherit; color: inherit; }
.vh, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--paper); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------- masthead ---------------- */
.masthead { background: var(--paper); }
.brand { display: inline-block; line-height: 0; }
.brand img { height: 56px; width: auto; }
.wordmark { font-size: 26px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-2); }
.title { margin: 2px 0 0; font-weight: 600; font-stretch: 87.5%; color: var(--brand); letter-spacing: -.01em; line-height: 1.1; }
.subtitle { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.subtitle:empty { display: none; }

/* ---------------- toolbar ---------------- */
.toolbar { position: sticky; top: 0; z-index: 30; background: var(--paper); }
.toolbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; }
.months { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { cursor: pointer; background: transparent; border: 1px solid var(--line-2); color: var(--ink); padding: 5px 11px; font-size: 13px; font-weight: 600; line-height: 1.2; }
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.toggle { margin-left: auto; cursor: pointer; background: none; border: 0; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink); padding: 6px 0; }
.toggle-box { width: 18px; height: 18px; border: 1.5px solid var(--line-2); background: var(--paper); display: inline-grid; place-items: center; }
.toggle[aria-pressed="true"] .toggle-box { background: var(--ok); border-color: var(--ok); }
.toggle[aria-pressed="true"] .toggle-box::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------------- page / table ---------------- */
.page { max-width: 1180px; margin: 0 auto; padding: 20px 16px 8px; }
.plan-wrap, .plan-body { position: relative; }
.status-msg { background: var(--paper); border: 1px solid var(--line); padding: 40px 20px; text-align: center; color: var(--ink-2); }
.plan { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); table-layout: fixed; }
.plan col.col-week { width: var(--week-w); }
.plan thead th { position: sticky; top: var(--head-top); z-index: 5; background: var(--paper); text-align: left; vertical-align: bottom; }
.corner { padding: 14px 14px 12px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.corner small { display: block; font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.bh-in { display: flex; flex-direction: column; gap: 1px; padding: 14px 14px 12px; }
.bh-name { font-size: 18px; font-weight: 700; font-stretch: 87.5%; color: var(--brand); line-height: 1.15; }
.bh-meta { font-size: 13px; color: var(--ink); }
.bh-layout { font-size: 12px; color: var(--ink-2); }
.bh-album { margin-top: 6px; font-size: 12px; font-weight: 700; text-decoration: none; color: var(--brand-2); letter-spacing: .02em; }
.bh-album i { font-style: normal; margin-left: 3px; }
.bh-album:hover { text-decoration: underline; }

.band-h, .band-r { text-align: left; font-weight: 400; vertical-align: middle; }
.band-dates { display: block; font-weight: 700; color: var(--brand); font-size: 14px; }
.band-h small { color: var(--ink-2); font-size: 12px; }
.rate { display: block; font-size: 13px; color: var(--ink); }
.rate b { font-size: 15px; color: var(--brand); }
.rate small { color: var(--ink-2); font-size: 12px; }
.rate s, .pr s { color: var(--ink-2); font-weight: 400; }
.rate-wk { display: block; font-size: 12px; color: var(--ink-2); }
.rate-none { color: var(--ink-2); font-style: italic; }

.wh { text-align: left; font-weight: 400; vertical-align: middle; padding: 9px 14px; white-space: nowrap; }
.mlabel { display: block; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-2); margin-bottom: 1px; }
.wd { font-size: 14px; color: var(--ink-2); }
.wd b { color: var(--ink); font-weight: 600; }
.wd i { font-style: normal; margin: 0 5px; color: var(--line-2); }

.c { padding: 0; vertical-align: stretch; height: 1px; }
.cell { height: 100%; min-height: 54px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 12px; position: relative; }
.pr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.pr b { font-size: 15px; font-weight: 700; color: var(--brand); }
.pr s { font-size: 12px; }
.off { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent-ink); padding: 1px 5px; }
.st { font-size: 12px; color: var(--ink-2); }
.rt { white-space: nowrap; font-weight: 600; letter-spacing: .03em; }
.rt i { font-style: normal; margin: 0 3px; font-weight: 400; }
.tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dash { font-size: 18px; line-height: 1; color: var(--np); }
.c.dim .cell { opacity: .22; filter: grayscale(.4); }
.row-dim .wh { opacity: .45; }

/* ---------------- legend / footer ---------------- */
.stale { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.legend { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink); }
.legend li { display: inline-flex; gap: 7px; align-items: center; }
.sw { width: 22px; height: 14px; display: inline-block; }
.contact { margin-top: 28px; background: var(--paper); }
.contact-inner { max-width: 1180px; margin: 0 auto; padding: 22px 16px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.contact-lead { margin: 0; font-weight: 600; color: var(--brand); font-size: 17px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cl { display: inline-block; padding: 8px 14px; text-decoration: none; font-weight: 700; font-size: 14px; border: 1px solid var(--brand); color: var(--brand); }
.cl-wa { background: var(--brand); color: #fff; }
.foot { margin-top: 28px; }
.foot-inner { max-width: 1180px; margin: 0 auto; padding: 22px 16px 28px; display: grid; gap: 14px; font-size: 13px; color: var(--ink-2); }
.notes p { margin: 0; }
.ports { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ports b { color: var(--ink); font-weight: 700; margin-right: 3px; }
.ports-h { font-weight: 700; color: var(--ink); letter-spacing: .12em; text-transform: uppercase; font-size: 11px; align-self: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { font-weight: 600; }
.foot-meta { display: flex; gap: 12px; font-size: 11px; color: var(--np); }
.foot-meta a { color: inherit; }
.wa { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #25D366; color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18); }

/* status fills shared by cells and legend swatches */
.k-booked .cell, .legend .k-booked .sw { --tone: var(--bk); }
.k-option .cell, .legend .k-option .sw { --tone: var(--op); }

/* ---------------- Mets look: light ledger, hairlines, square corners, centred masthead,
   sky / orange period bands as on the sheet ---------------- */
.masthead { border-top: 4px solid var(--sky); text-align: center; }
.masthead-inner { max-width: 1180px; margin: 0 auto; padding: 26px 16px 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.title { font-size: 34px; }
.titles { position: relative; padding-top: 14px; }
.titles::before { content: ""; position: absolute; top: 0; left: 50%; width: 44px; height: 2px; margin-left: -22px; background: var(--accent); }
.toolbar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan { border: 1px solid var(--line); }
.plan thead th { border-bottom: 2px solid var(--brand); }
.bh { border-left: 1px solid var(--line); }
.bh-in { border-top: 3px solid var(--accent); }
.corner { border-top: 3px solid transparent; }
.band > * { background: var(--sky-tint); padding: 10px 14px; border-top: 1px solid var(--line); }
.band-h { box-shadow: inset 4px 0 0 var(--sky); }
.peak .band > * { background: var(--accent-tint); }
.peak .band-h { box-shadow: inset 4px 0 0 var(--accent); }
.band-r { border-left: 1px solid var(--line); }
.wk > * { border-top: 1px solid var(--line); }
.wk .c { border-left: 1px solid var(--line); }
.wk.new-month > * { border-top-color: var(--line-2); }
.cell { padding-left: 15px; }
.cell::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--np); }
.k-available .cell::before { background: var(--ok); }
.k-available .st { color: var(--ok-ink); }
.k-booked .cell { background: var(--bk-tint) repeating-linear-gradient(135deg, rgba(210,69,63,.10) 0 2px, transparent 2px 7px); }
.k-booked .cell::before { background: var(--bk); }
.k-booked .tag { color: var(--bk-ink); }
.k-part .cell { background: linear-gradient(90deg, var(--bk-tint) 0 50%, var(--paper) 50%); }
.k-part .cell::before { background: linear-gradient(var(--bk) 0 50%, var(--ok) 50%); }
.k-part .tag { color: var(--bk-ink); }
.k-option .cell { background: var(--op-tint) radial-gradient(rgba(176,130,0,.18) 1px, transparent 1.4px) 0 0 / 6px 6px; }
.k-option .cell::before { background: var(--op); }
.k-option .tag { color: var(--op-ink); }
.k-nocharter .cell { background: var(--nc-tint); }
.k-nocharter .cell::before { background: var(--nc); }
.k-nocharter .tag { color: var(--nc-ink); text-transform: none; letter-spacing: 0; }
.k-winter .cell { background: var(--wt-tint); }
.k-winter .cell::before { background: var(--wt); }
.k-winter .tag { color: var(--wt-ink); }
.legend .sw { border-left: 3px solid var(--np); background: var(--np-tint); }
.legend .k-available .sw { border-color: var(--ok); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.legend .k-booked .sw { border-color: var(--bk); background: var(--bk-tint) repeating-linear-gradient(135deg, rgba(210,69,63,.18) 0 2px, transparent 2px 6px); }
.legend .k-part .sw { border-color: var(--bk); background: linear-gradient(90deg, var(--bk-tint) 0 50%, var(--paper) 50%); box-shadow: inset 0 0 0 1px var(--line); }
.legend .k-option .sw { border-color: var(--op); background: var(--op-tint) radial-gradient(rgba(176,130,0,.3) 1px, transparent 1.4px) 0 0 / 5px 5px; }
.legend .k-nocharter .sw { border-color: var(--nc); background: var(--nc-tint); }
.legend .k-winter .sw { border-color: var(--wt); background: var(--wt-tint); }
.contact { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.foot { border-top: 4px solid var(--sky); background: var(--paper); }

/* ---------------- narrow screens ---------------- */
@media (max-width: 760px) {
  :root { --week-w: 104px; }
  body { font-size: 14px; }
  .brand img { height: 42px; }
  .masthead-inner { padding: 18px 16px 16px; gap: 10px; }
  .title { font-size: 26px; }
  .toolbar-inner { padding: 8px 16px; gap: 6px; }
  .months { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .months::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .toggle { margin-left: 0; }
  .page { padding: 12px 16px 8px; }
  .wh { padding: 8px 8px; white-space: normal; }
  .wd { display: flex; flex-direction: column; font-size: 13px; }
  .wd i { display: none; }
  .corner, .bh-in { padding: 10px 8px; }
  .bh-name { font-size: 14px; }
  .bh-meta { font-size: 11px; }
  .bh-layout { display: none; }
  .bh-album { font-size: 11px; margin-top: 2px; }
  .corner { font-size: 10px; }
  .band-dates { font-size: 13px; }
  .rate-wk { font-size: 11px; }
  .wh { font-size: 13px; }
  .cell { padding: 7px 8px 7px 11px; min-height: 50px; }
  .band > * { padding: 8px !important; }
  .rate b { font-size: 14px; }

  /* scroll mode: yachts scroll sideways, week column stays; names in a synced sticky strip */
  .plan-wrap.is-scroll .plan-body { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .plan-wrap.is-scroll .plan { width: calc(var(--week-w) + var(--n) * 150px); min-width: 100%; }
  .plan-wrap.is-scroll .plan-head { position: sticky; top: var(--toolbar-h); z-index: 10; overflow: hidden; background: var(--paper); }
  .plan-wrap.is-scroll .plan-head .plan thead th { position: static; }
  .plan-wrap.is-scroll .plan-body thead th { position: static; height: 0; padding: 0; border: 0 !important; }
  .plan-wrap.is-scroll .plan-body thead th > * { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; border: 0; }
  .plan-wrap.is-scroll .wh, .plan-wrap.is-scroll .band-h, .plan-wrap.is-scroll .corner { position: sticky; left: 0; z-index: 3; }
  .plan-wrap.is-scroll .wh { background: var(--paper); box-shadow: 1px 0 0 var(--line); }
  .plan-wrap.is-scroll .plan-head .corner { position: static; }

  /* select mode: one yacht at a time */
  .boatpick { position: sticky; top: var(--toolbar-h); z-index: 20; display: flex; gap: 0; margin: 0 0 10px; background: var(--paper); border: 1px solid var(--line-2); }
  .boatpick button { flex: 1 1 0; min-width: 0; cursor: pointer; border: 0; background: transparent; padding: 9px 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); line-height: 1.2; }
  .boatpick button + button { border-left: 1px solid var(--line-2); }
  .boatpick button[aria-selected="true"] { background: var(--brand); color: #fff; }
  .plan-wrap.is-select .plan thead th { top: calc(var(--toolbar-h) + var(--pick-h, 40px)); }
  .plan-wrap.is-select .bh-in { flex-direction: row; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
  .plan-wrap.is-select .bh-name { display: none; }
  .plan-wrap.is-select .bh-album { margin-top: 0; }
  .contact-inner { padding: 18px 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .c .cell { transition: opacity .15s; }
}
@media print {
  .toolbar, .wa, .boatpick { display: none !important; }
  .plan thead th { position: static; }
}
.pr .pw { font-size: 11px; color: var(--ink-2); margin-left: -3px; }
