/* Observed Charter Choice: dark, dense, colourful like the original suite.
   Count colour is one teal ramp (never the EUR ramp); states are patterns and words, not faded colour. */
.ch-wrap { max-width: 1560px; margin: 0 auto; padding: 22px 20px 140px; }
.ch-wrap h1 { font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -0.4px; }
.ch-wrap h2 { font-size: 18px; font-weight: 800; color: #fff; }
.ch-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--sc-text-3); margin-bottom: 6px; }
.ch-lede { color: var(--sc-text-2); font-size: 14px; margin: 4px 0 12px; max-width: 96ch; }
.ch-lede b { color: #fff; }
.ch-sub { color: var(--sc-text-2); font-size: 13px; margin: 4px 0 10px; max-width: 120ch; }
.ch-sub b { color: #fff; }
.ch-fine { font-size: 12px; color: var(--sc-text-3); }
.ch-wrap code { font-size: 12px; background: #16294a; border: 1px solid #243a5c; border-radius: 4px; padding: 0 4px; color: var(--sc-accent); }

.ch-measure { display: grid; gap: 6px; background: var(--sc-panel); border: 1px solid var(--sc-line); border-left: 4px solid var(--sc-accent); border-radius: 10px; padding: 10px 14px; margin: 6px 0 12px; font-size: 13px; color: var(--sc-text-2); max-width: 130ch; }
.ch-measure b { color: #fff; }
.ch-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.ch-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-chip { font-size: 12px; color: var(--sc-text); background: var(--sc-panel); border: 1px solid var(--sc-line); border-left: 4px solid var(--c, #93a9c0); border-radius: 8px; padding: 5px 9px; }
.ch-chip i { font-style: normal; color: var(--sc-text-3); margin-right: 3px; }

/* six boat groups */
.ch-groups { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.ch-g { font: inherit; text-align: left; color: var(--sc-text-2); background: var(--sc-panel); border: 1px solid var(--sc-line); border-top: 5px solid var(--hull); border-radius: 10px; padding: 8px 10px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-height: 64px; }
.ch-g:hover { border-color: var(--sc-accent); border-top-color: var(--hull); }
.ch-g.on { background: var(--sc-panel-2); color: #fff; box-shadow: inset 0 0 0 2px var(--sc-accent); }
.ch-gn { font-size: 14px; font-weight: 800; color: #fff; }
.ch-gc { font-size: 12px; font-weight: 700; color: var(--cab); }
.ch-gb { font-size: 12px; color: var(--sc-text-3); }
.ch-gb b { color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }

.ch-controls { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; align-items: start; margin-bottom: 10px; }
.ch-modes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ch-ml { font-size: 12px; color: var(--sc-text-3); margin-right: 4px; }
.ch-mode { font: inherit; font-size: 13px; font-weight: 700; color: var(--sc-text-2); background: var(--sc-panel); border: 1px solid var(--sc-line); border-radius: 8px; min-height: 44px; padding: 0 12px; cursor: pointer; }
.ch-mode.on { color: #06202a; background: var(--sc-accent); border-color: var(--sc-accent); }
.ch-legendbox { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: flex-start; }
.ch-scale { display: grid; gap: 3px; width: min(100%, 360px); font-size: 12px; color: var(--sc-text-2); }
.ch-sl { color: var(--sc-text); font-weight: 600; }
.ch-gradbar { display: block; height: 12px; border-radius: 6px; border: 1px solid #2a4060; }
.ch-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--sc-text-2); font-variant-numeric: tabular-nums; }
.ch-warn { color: #f4cf85; font-size: 12px; }
.ch-states { max-width: 640px; }

.ch-section { background: var(--sc-panel); border: 1px solid var(--sc-line); border-radius: 14px; padding: 14px 16px 16px; margin: 12px 0; }
.ch-strip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ch-stepper { display: flex; align-items: center; gap: 8px; }
.ch-step { font: inherit; font-size: 13px; font-weight: 700; color: var(--sc-text); background: var(--sc-panel-2); border: 1px solid var(--sc-line); border-radius: 8px; min-height: 44px; min-width: 76px; padding: 0 12px; cursor: pointer; }
.ch-step:disabled { opacity: .45; cursor: default; }
.ch-step-now { font-size: 14px; font-weight: 800; color: var(--sc-amber); min-width: 90px; text-align: center; }

/* grids */
.ch-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ch-grid { --lw: 210px; --yw: 118px; min-width: 0; font-variant-numeric: tabular-nums; }
.ch-row { display: grid; grid-template-columns: var(--lw) repeat(12, minmax(54px, 1fr)) var(--yw); gap: 3px; align-items: stretch; margin-bottom: 3px; }
.ch-strip .ch-row { grid-template-columns: var(--lw) repeat(var(--n, 5), minmax(84px, 1fr)) minmax(96px, 1fr); }
.ch-lab { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 2px 6px 2px 4px; background: var(--sc-panel); position: sticky; left: 0; z-index: 3; }
.ch-rn { font-size: 12px; font-weight: 700; color: var(--sc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-rc { font-size: 11px; color: var(--sc-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-pk { font-size: 11px; color: #f4cf85; }
.ch-corner { font-size: 11px; font-weight: 700; color: var(--sc-text-3); text-transform: uppercase; letter-spacing: .6px; justify-content: flex-end; }
.ch-head { position: sticky; top: 0; z-index: 4; background: var(--sc-panel); padding-bottom: 2px; }
.ch-mh { font: inherit; width: 100%; font-size: 12px; font-weight: 800; color: var(--sc-accent); background: transparent; border: 1px solid transparent; border-bottom: 2px solid var(--sc-line); min-height: 36px; cursor: pointer; border-radius: 6px 6px 0 0; }
.ch-mh:hover { background: rgba(78,205,196,.1); }
.ch-mh.on { color: #06202a; background: var(--sc-accent); border-color: var(--sc-accent); }
.ch-yh { font-size: 11px; font-weight: 700; color: var(--sc-text-3); display: flex; align-items: flex-end; justify-content: flex-end; text-align: right; }
.ch-yv { display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-size: 12px; font-weight: 700; color: var(--sc-text); }
.ch-wh { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-size: 12px; color: var(--sc-text-2); padding-bottom: 3px; border-bottom: 2px solid var(--sc-line); }
.ch-wh b { color: #fff; font-size: 13px; } .ch-wh span { font-size: 11px; color: var(--sc-text-3); }
.ch-wh.ch-mo b { color: var(--sc-amber); }

.ch-row.all .ch-lab { border-bottom: 2px solid var(--sc-line); }
.ch-row.all { margin-bottom: 8px; }
.ch-row.none { margin-top: 8px; opacity: .95; }
.ch-row.none .ch-lab { border-top: 1px dashed var(--sc-q-unmapped); }
.ch-row.pinned .ch-lab { box-shadow: inset 4px 0 0 var(--sc-focus); }

.ch-c { font: inherit; position: relative; width: 100%; min-height: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; border: 1px solid transparent; border-radius: 6px; background: #0e1b30; color: var(--sc-text); cursor: pointer; overflow: hidden; }
.ch-strip .ch-c { min-height: 46px; }
.ch-c:hover { border-color: #fff; }
.ch-v { position: relative; z-index: 1; font-size: 12px; font-weight: 800; }
.ch-strip .ch-v { font-size: 14px; }
.ch-w { position: relative; z-index: 1; font-size: 11px; font-weight: 600; opacity: .95; }
.ch-c.agg { background: #27456b; color: #fff; --pill: #27456b; }
/* the number and state word sit on a solid chip of the cell's own fill so the pattern never crosses the digits */
.ch-c.st-partial .ch-v, .ch-c.st-partial .ch-w, .ch-c.st-carried .ch-v, .ch-c.st-carried .ch-w { background: var(--pill, #0e1b30); border-radius: 4px; padding: 0 5px; line-height: 1.25; }
.ch-c.sel { outline: 3px solid #fff; outline-offset: 1px; z-index: 6; }
.ch-c.st-partial::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(6,20,36,.38) 0 2px, transparent 2px 6px); pointer-events: none; }
.ch-c.st-carried::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(6,20,36,.7) 1.4px, transparent 1.8px) 0 0 / 6px 6px; pointer-events: none; }
.ch-c.st-none_recorded { background: transparent; border: 2px solid var(--sc-text); border-radius: 50%/60%; color: var(--sc-text); }
.ch-c.st-missing { background: transparent; border: 1px dashed var(--sc-q-missing); color: var(--sc-text-2); }
.ch-c.st-failed { background: repeating-linear-gradient(45deg, rgba(255,122,122,.55) 0 2px, transparent 2px 5px), repeating-linear-gradient(-45deg, rgba(255,122,122,.55) 0 2px, transparent 2px 5px); border: 1px solid var(--sc-q-failed); color: #fff; }
.ch-c.agg.st-partial, .ch-c.agg.st-carried { color: #fff; }
.ch-mon { box-shadow: inset 0 0 0 1px rgba(232,180,72,.6); }

.ch-cov { font-size: 13px; color: var(--sc-text-2); margin: 14px 2px 0; max-width: 150ch; }
.ch-cov b { color: #fff; }
.ch-cov .sc-tag { vertical-align: baseline; }
.ch-unavail { border: 1px dashed var(--sc-amber); border-radius: 12px; padding: 14px 18px; color: var(--sc-text); background: rgba(232,180,72,.08); font-size: 13px; margin: 14px 0; max-width: 150ch; }
.ch-unavail h2 { font-size: 16px; color: var(--sc-amber); margin-bottom: 4px; }
div.ch-unavail { font-size: 14px; }
.ch-notes ul { margin: 12px 2px 0 18px; display: grid; gap: 6px; font-size: 13px; color: var(--sc-text-2); max-width: 130ch; }
.ch-notes b { color: var(--sc-text); }
#ch-main[hidden], .ch-detail[hidden] { display: none; }

/* persistent detail */
.ch-detail { position: fixed; z-index: 50; left: 50%; bottom: 0; transform: translateX(-50%); width: min(1100px, 100%); max-height: 58vh; overflow: auto; background: #0e1b30; border: 1px solid var(--sc-accent); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.55); padding: 14px 18px 20px; color: var(--sc-text); }
.ch-dh { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.ch-dh h3 { font-size: 17px; font-weight: 800; color: #fff; }
.ch-dsub { font-size: 12px; color: var(--sc-text-3); }
.ch-x { font: inherit; font-size: 13px; font-weight: 700; color: var(--sc-text); background: var(--sc-panel-2); border: 1px solid var(--sc-line); border-radius: 8px; min-height: 44px; padding: 0 14px; cursor: pointer; flex: none; }
.ch-ks { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 8px 0; }
.ch-k { display: flex; flex-direction: column; font-size: 12px; color: var(--sc-text-3); }
.ch-k b { font-size: 16px; color: #fff; }
.ch-k small { font-size: 12px; color: var(--sc-text-3); }
.ch-k.big b { font-size: 28px; color: var(--sc-amber); }
.ch-q { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--sc-text-2); margin: 6px 0; }
.ch-obs { font-size: 13px; color: var(--sc-text-2); margin: 4px 0 8px; }
.ch-wt { border-collapse: collapse; width: 100%; font-size: 12px; margin-top: 6px; }
.ch-wt caption { text-align: left; font-size: 12px; color: var(--sc-text-3); padding-bottom: 4px; }
.ch-wt th, .ch-wt td { padding: 4px 6px; border-bottom: 1px solid #1e3050; text-align: left; white-space: nowrap; }
.ch-wt thead th { color: var(--sc-text-3); font-weight: 600; }
.ch-pickweek { font: inherit; font-size: 12px; font-weight: 700; color: var(--sc-accent); background: transparent; border: 1px solid var(--sc-line); border-radius: 6px; min-height: 36px; padding: 0 8px; cursor: pointer; }
.ch-fb { margin-top: 8px; font-size: 13px; }
.ch-fb summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--sc-accent); font-weight: 600; }
.ch-fb ul { margin: 6px 0 0 18px; display: grid; gap: 3px; color: var(--sc-text-2); }
.ch-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.ch-open { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px; background: var(--sc-accent); color: #06202a; font-weight: 800; text-decoration: none; font-size: 14px; }
body.ch-has-detail .ch-wrap { padding-bottom: 60vh; }

@media (max-width: 1100px) {
  .ch-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ch-controls { grid-template-columns: 1fr; }
}
/* phones: the grids scroll locally with sticky labels and headers; text stays at its desktop size */
@media (max-width: 720px) {
  .ch-wrap { padding: 14px 12px 90px; }
  .ch-wrap h1 { font-size: 24px; }
  .ch-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-section { padding: 10px 8px 12px; }
  .ch-scroll { max-height: 72vh; overflow: auto; }
  .ch-grid { --lw: 112px; --yw: 92px; width: max-content; min-width: 100%; }
  .ch-row { grid-template-columns: var(--lw) repeat(12, 56px) var(--yw); }
  .ch-strip .ch-row { grid-template-columns: var(--lw) repeat(var(--n, 5), 76px) 92px; }
  .ch-c { min-height: 40px; }
  .ch-strip .ch-c { min-height: 52px; }
  .ch-lab { white-space: normal; }
  .ch-rn { white-space: normal; font-size: 12px; line-height: 1.15; max-height: 2.4em; }
  .ch-rc { display: none; }
  .ch-detail { max-height: 76vh; padding: 12px 12px 18px; }
  body.ch-has-detail .ch-wrap { padding-bottom: 76vh; }
  .ch-wt th, .ch-wt td { white-space: normal; padding: 4px 3px; }
}
