/* ── Duty roster — the tasks/057 + tasks/058 redesign ─────────────────────
   Restored from 33ae7f10 (branch claude/hotelos-transport-pages-17e3e3). The
   design shipped on that branch, then merge f9ad6414 ("Merge origin/main into
   front-office-card-design") resolved the transport paths to the OTHER side and
   silently deleted the five picker partials, this stylesheet's ancestor, and the
   crew-picker Stimulus controller — reinstating the older tasks/029 "Edit crew"
   page. Nothing chose that; a merge did.

   Ported forward onto os-ds v1.3.0: the popover, option rows, entity chips and
   avatars are now GEM components (.os-pop / .os-opt / .os-chip--entity /
   .os-avatar) — the originals were written against the pre-burndown .dv-* names.
   What lives here is only the arena-side layout the gem does not own. */

/* One-row day/shift toolbar: toggle · date nav · shift · spacer · clock. The
   pre-redesign markup stacked these, which is what opened the gutter above the
   boat list. */
.hos-duty-toolbar { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.hos-duty-toolbar__nav { display: flex; align-items: center; gap: var(--space-2); }
.hos-duty-toolbar__date { min-width: 110px; text-align: center; font-weight: 600; color: var(--ink); font-size: var(--text-sm); }
.hos-duty-toolbar__spacer { flex: 1 1 auto; }

.hos-duty-banner {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 600;
}
.hos-duty-banner--warn { background: var(--status-briefing-bg); color: var(--status-briefing-fg); }
.hos-duty-banner--ok { background: var(--status-confirmed-bg); color: var(--status-confirmed-fg); }

.hos-duty-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-6); align-items: start; }
@media (max-width: 1100px) { .hos-duty-body { grid-template-columns: minmax(0, 1fr); } }
.hos-duty-boats { display: flex; flex-direction: column; gap: var(--space-2); }

/* Boat card. `overflow: visible` is load-bearing — the .os-pop picker is
   absolutely positioned inside the card and must escape it. */
.hos-dutycard {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
  overflow: visible;
}
.hos-dutycard--down { opacity: 0.6; }
.hos-dutycard__ico { width: 36px; height: 36px; flex: none; }
.hos-dutycard__body { flex: 1; min-width: 0; }
.hos-dutycard__top { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.hos-dutycard__name { font-size: var(--text-sm); font-weight: 700; color: var(--ink); }
.hos-dutycard__seats { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--muted); }
.hos-dutycard__crew {
  font-family: var(--font-mono); font-size: var(--text-2xs); font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-2);
  margin-top: var(--space-2); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
}

/* The status anchor bar (.hos-runanchor + tones) is the one HotelOS spine — run card, duty
   sheet, crew and certificate lists — defined in hotelos_ds/components.css (#485). */

/* One role-group (Captain | Crew): its label, its chips, its picker trigger. */
.hos-duty-group { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }

/* Read-only skipper slot (non-dispatch viewers). */
.hos-skipslot {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-2); padding: 3px var(--space-3);
  border: 1px dashed var(--hairline-strong); border-radius: var(--radius-pill);
  background: var(--surface-alt); font-size: var(--text-xs); font-weight: 600; color: var(--muted);
}
.hos-skipslot svg { color: var(--muted-2); }
.hos-skipslot--set { border-style: solid; color: var(--ink); }
.hos-skipslot--set svg { color: var(--accent); }

/* Chips + "Add …" trigger on one wrapping line. __chips is display:contents so the
   chips are flex items of the guides row, not a nested box — that keeps the trigger
   flowing inline after the last chip instead of dropping to its own line. */
.hos-duty-guides { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.hos-duty-guides__chips { display: contents; }
.hos-duty-guides__empty { font-size: var(--text-xs); color: var(--muted-2); }

/* The gem's .os-pop sizes itself to its anchor (min-width: max(100%, 12rem)) and
   caps its own height, which stretches this picker to the card's full width and
   clips the Done foot once the list is long. Re-assert the design's intent at
   higher specificity: a fixed 320px shell that lets .os-pop__list own the scroll,
   so the foot stays visible. */
.hos-duty-guides .os-pop {
  width: 320px; min-width: 320px; max-width: min(320px, calc(100vw - 48px));
  max-height: none; overflow: visible;
}
.hos-duty-guides .hos-pop--up { top: auto; bottom: calc(100% + var(--space-2)); }

/* Crew rail — two cards on the gem's card anatomy (__head + __body). Rows are
   avatar · name · ONE right-aligned value; the role word lives in the card head,
   not on every line. */
.hos-crewrail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: var(--space-4); }
@media (max-width: 1100px) { .hos-crewrail { position: static; } }
.hos-crewrail__body { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-3); }
.hos-crewrail__row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0; min-width: 0;
}
.hos-crewrail__row--off { opacity: 0.6; }
.hos-crewrail__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.hos-crewrail__nm { font-size: var(--text-sm); font-weight: 600; color: var(--ink); line-height: 1.2; }
/* Placement line. The boat is an attribute, so it reads as meta with a ship
   glyph — no badge. Free / On leave are states and carry a dot + colour. */
.hos-crewrail__val {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); line-height: 1.2; min-width: 0;
}
.hos-crewrail__val .os-dot { width: 6px; height: 6px; }
.hos-crewrail__val--on { color: var(--slate-700); font-weight: 600; }
.hos-crewrail__val--on svg { color: var(--muted-2); }
.hos-crewrail__val--free { color: var(--status-confirmed-fg); font-weight: 600; }
.hos-crewrail__val--free .os-dot { background: var(--status-confirmed-fg); }
.hos-crewrail__val--off { color: var(--muted-2); }
.hos-crewrail__val--off .os-dot { background: var(--hairline-strong); }

/* Jetty cash custody — same card anatomy, figures on a right-aligned column so
   the amounts stack column-true down the card. */
.hos-cashcard__body { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-3); }
.hos-cashcard__row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; min-width: 0; }
.hos-cashcard__who {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--text-sm); font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hos-cashcard__amt { flex: none; min-width: 88px; text-align: right; }

/* ── #486 Day sheet — the day as the team's own roster lists it (muf, 2026-10-26) ──
   One line per movement: time · what · who (captain first) · boat. A line is a <details>;
   it opens in place onto the run's Captain + Crew pickers. The status bar shows ONLY on a
   line that is missing people — a crewed day is a clean list. `overflow: visible` on the
   card is load-bearing: the .os-pop pickers must escape it. */
.hos-duty-runs { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.hos-dsheet { padding: 0; overflow: visible; }
.hos-dsheet__line + .hos-dsheet__line { border-top: 1px solid var(--hairline); }
.hos-dsheet__line--past { opacity: 0.66; }
.hos-dsheet__sum {
  position: relative; list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 88px minmax(0, 1.3fr) minmax(0, 1.4fr) 112px;
  gap: var(--space-4); align-items: center;
  min-height: var(--control-h-touch); padding: var(--space-3) var(--space-5);
}
.hos-dsheet__sum::-webkit-details-marker { display: none; }
.hos-dsheet__sum:hover, .hos-dsheet__line[open] > .hos-dsheet__sum { background: var(--surface-alt); }
.hos-dsheet__sum .hos-runanchor { top: var(--space-2); bottom: var(--space-2); }
.hos-dsheet__time {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 600; color: var(--ink);
}
.hos-dsheet__what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hos-dsheet__title { font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 600; color: var(--ink); }
.hos-dsheet__route { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--muted); }
.hos-dsheet__who {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2);
  font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--ink); min-width: 0;
}
.hos-dsheet__lead { font-weight: 600; }
.hos-dsheet__sep { color: var(--muted-2); }
.hos-dsheet__boat {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 600; color: var(--slate-700);
}
.hos-dsheet__none { font-weight: 400; color: var(--muted-2); }
.hos-dsheet__panel {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-3) var(--space-5) var(--space-4) calc(var(--space-5) + 88px + var(--space-4));
  background: var(--surface-alt);
}
.hos-dsheet__people { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); }
.hos-dutyrun__people { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.hos-dutyrun__open { align-self: flex-start; }

/* Rail cards: a kind / shift eyebrow over a comma line of names (Off today), or over rows of
   duties (Shore duties) — each a name-over-meta pair that opens in place to edit. */
.hos-dsheet__group { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); }
.hos-dsheet__grp { display: flex; flex-direction: column; gap: var(--space-1); }
.hos-dsheet__names { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--ink); }
.hos-dsheet__dutysum {
  list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-1) 0; border-radius: var(--radius-sm);
}
.hos-dsheet__dutysum::-webkit-details-marker { display: none; }
.hos-dsheet__dutyname { font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 600; color: var(--ink); }
.hos-dsheet__dutywho { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--muted); }
.hos-dsheet__dutypanel { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) 0; }
.hos-dsheet__shoreacts { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); margin: 0; }
.hos-dsheet__shoreacts form { display: contents; }

/* Tablet: the same four columns, tighter. Phone: one column — time, what, who, boat. */
@media (max-width: 900px) {
  .hos-dsheet__sum { grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr) 96px; gap: var(--space-3); padding-inline: var(--space-4); }
  .hos-dsheet__panel { padding-left: calc(var(--space-4) + 56px + var(--space-3)); }
}
@media (max-width: 640px) {
  .hos-dsheet__sum { grid-template-columns: 56px minmax(0, 1fr); row-gap: var(--space-1); align-items: start; }
  .hos-dsheet__who, .hos-dsheet__boat { grid-column: 2; }
  .hos-dsheet__panel { padding-left: var(--space-5); }
  .hos-dsheet__people { grid-template-columns: minmax(0, 1fr); }
}

/* Touch widths: every control in the open line is a real 48px box (Fitts). The chip ✕ and
   the "Open run" link keep their compact look — the box grows by padding and a matching
   negative margin, so the layout does not move, and the ✕'s hover fill stays on its glyph. */
@media (max-width: 640px) {
  .hos-dsheet .os-btn, .hos-dsheet .os-opt, .hos-crewrail .os-btn,
  .hos-dsheet__dutysum { min-height: var(--control-h-touch); }
  .hos-dsheet__dutysum { justify-content: center; }
  .hos-dsheet .os-chip__x {
    /* the gem draws it 22px square; grow the box to the touch size around that */
    box-sizing: content-box;
    padding: calc((var(--control-h-touch) - 22px) / 2); margin: calc((var(--control-h-touch) - 22px) / -2);
    background-clip: content-box;
  }
  .hos-dutyrun__open {
    display: inline-flex; align-items: center; min-height: var(--control-h-touch);
    margin-block: calc((var(--control-h-touch) - 1lh) / -2);
  }
}
