/* crew/css/v3-rest.css — crew v3 stream S9: who's aboard (gang-*) and hours of
   rest (rest-*, rp-* = the printable MLC record). Tokens from crew/css/app.css
   only (light + dark); print uses CSS system colours (Canvas / CanvasText) so
   the record prints black on white whatever the app theme. No animation. */

/* ── who's aboard ─────────────────────────────────────────────────────────── */
.gang-me .gang-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.gang-opt { min-height: 52px; min-width: 0; padding: 6px 10px; font-size: 15px; font-weight: 600; line-height: 1.2; white-space: normal; text-align: center; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); }
.gang-opt.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-ink); }
.gang-opt.on::after { content: '✓'; margin-left: 6px; font-weight: 700; }
.gang-note { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-style: italic; }
.gang-privacy { color: var(--text-2); }
.gang-hero .gang-q { height: 20px; padding: 0 7px; font-size: 11px; }
.gang-group .item .body .t { font-size: 15.5px; }

/* ── hours of rest: week / month ─────────────────────────────────────────── */
.rest-nav { align-items: center; gap: 8px; min-height: 44px; }
.rest-nav .icon-btn[disabled] { opacity: .35; pointer-events: none; }
.rest-total.bad { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.rest-meter { position: relative; height: 8px; border-radius: var(--pill); background: var(--surface-2); margin-top: 12px; overflow: visible; }
.rest-meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--pill); background: var(--teal); }
.rest-total.bad .rest-meter .fill { background: var(--danger); }
.rest-meter .min { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-2); }
.rest-strip { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 1px; height: 12px; margin: 4px 0 2px; max-width: 360px; }
.rest-strip i { display: block; background: var(--surface-3); border-radius: 1px; }
.rest-strip i.w { background: var(--gold); }
.rest-strip i:nth-child(12n + 1) { box-shadow: -1px 0 0 var(--text-3); }
.rest-strip.rs-none { border: 1px dashed var(--line-2); border-radius: 3px; }
.rest-strip.rs-big { height: 20px; max-width: none; }
.rest-day-row .right, .rest-crew-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rest-issue { color: var(--danger) !important; font-size: 13px !important; }
.rest-sign .rest-sign-row { gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.rest-sign .rest-sign-row:first-of-type { border-top: 0; }

/* ── day editor ───────────────────────────────────────────────────────────── */
.rest-tpls { scroll-padding-inline: var(--gutter); }   /* the first chip snaps inside the gutter, not to the screen edge */
.rest-tpls .chip { white-space: nowrap; }
.rest-legend { gap: 14px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; align-items: center; }
.rest-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rest-legend .rest-cell { width: 18px; height: 18px; display: inline-block; }
.rest-grid { display: flex; flex-direction: column; gap: 4px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.rest-hours { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rest-hours span { padding-left: 2px; border-left: 2px solid var(--line-2); line-height: 1.4; }
.rest-row { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; margin-bottom: 6px; }
.rest-cell { height: 44px; min-width: 0; border-radius: 4px; background: var(--surface); border: 1px solid var(--line-2); padding: 0; }
.rest-cell:nth-child(2n + 1) { border-left: 2px solid var(--text-3); }
/* work: filled AND striped, so colour is never the only signal */
.rest-cell.w { background-color: var(--gold); border-color: var(--gold-ink);
  background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--gold-ink) 30%, transparent) 4px 6px); }
.rest-cell:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; position: relative; z-index: 1; }
.rest-grid.locked .rest-cell { opacity: .7; cursor: default; }
@media (min-width: 720px) { .rest-cell { height: 40px; } }
.rest-fb-head { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.rest-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rest-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; line-height: 1.35; }
.rest-check svg.ico { margin-top: 1px; }
.rest-check.ok svg.ico { color: var(--ok); }
.rest-check.bad { color: var(--danger); font-weight: 600; }
.rest-check.exc svg.ico { color: var(--teal); }

/* ── captain overview ─────────────────────────────────────────────────────── */
.rest-crew-row { gap: 8px; }
.rest-crew-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; color: inherit; min-height: 44px; }
.rest-crew-row .btn.xs { min-height: 36px; }

/* ── printable MLC record ─────────────────────────────────────────────────── */
.rest-print { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.rp-head h2 { font-size: 18px; font-weight: 700; }
.rp-ref { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.rp-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; margin: 12px 0; }
.rp-meta div { min-width: 0; }
.rp-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.rp-meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.rp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rp-table { border-collapse: collapse; font-size: 10px; min-width: 860px; width: 100%; font-variant-numeric: tabular-nums; }
.rp-table th, .rp-table td { border: 1px solid var(--line-2); padding: 0; height: 16px; text-align: center; }
.rp-table thead th { font-weight: 700; padding: 2px; }
.rp-table td.w { background: var(--text); }
.rp-table tr.nr td { background: var(--surface-2); }
.rp-table .num { padding: 0 4px; white-space: nowrap; }
.rp-table .rp-rem { text-align: left; padding: 0 4px; min-width: 140px; }
.rp-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.rp-sign > div { border-top: 1px solid var(--text-3); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.rp-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.rp-legend { font-size: 11px; color: var(--text-2); margin-top: 10px; }
@media (max-width: 420px) { .rp-meta { grid-template-columns: 1fr 1fr; } .rp-sign { grid-template-columns: 1fr; } }

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  /* black on white whatever the app theme: system colours follow the color-scheme */
  :root:has(.rest-print) { color-scheme: light; }
  html:has(.rest-print), body:has(.rest-print) { background: Canvas !important; }
  body:has(.rest-print) * { visibility: hidden !important; }
  body:has(.rest-print) .rest-print, body:has(.rest-print) .rest-print * { visibility: visible !important; }
  .rest-print { position: absolute; left: 0; top: 0; width: 100%; border: 0; border-radius: 0; padding: 0; background: Canvas; color: CanvasText; }
  .rp-head h2 { font-size: 13pt; }
  .rp-ref { font-size: 8pt; }
  .rp-meta { grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 2mm 0 3mm; gap: 1mm 4mm; }
  .rp-meta dt { font-size: 7pt; }
  .rp-meta dd { font-size: 9pt; }
  .rp-scroll { overflow: visible; }
  .rp-table { min-width: 0; font-size: 7pt; }
  .rp-table th, .rp-table td { border-color: GrayText; height: 3.6mm; }
  .rp-table td.w { background: CanvasText; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-table tr.nr td { background: none; }
  .rp-ref, .rp-legend, .rp-meta dt, .rp-l { color: CanvasText; }
  .rp-sign { margin-top: 3mm; break-inside: avoid; }
  .rp-sign > div { border-top-color: CanvasText; padding-top: 1.5mm; }
  .rp-legend { font-size: 7pt; margin-top: 2mm; }
  .rp-noprint { display: none !important; }
}
