/* Penvose Marine — planning wall
   Light only, by choice: a planning wall is read in daylight across a workshop.
   Chrome stays near-monochrome so the bookings are the only colour on screen. */

:root {
  /* neutrals — one hue angle throughout, warm-grey bias */
  --n-0:   #FFFFFF;
  --n-25:  #FBFBFA;
  --n-50:  #F6F6F4;
  --n-75:  #F1F1EE;
  --n-100: #EDEDEA;
  --n-150: #E6E6E2;
  --n-200: #E0E0DC;
  --n-300: #CACAC5;
  --n-400: #A5A5A0;
  --n-500: #7A7A75;
  --n-600: #5E5E5A;
  --n-700: #3F3F3C;
  --n-900: #1C1C1A;

  /* the only two chromatic colours in the chrome */
  --teal:      #0F6E72;
  --teal-deep: #0A5457;
  --teal-tint: #E3F0F0;
  --teal-edge: #9CC9C9;
  --burnt:     #B85C2B;
  --burnt-tint:#F6E7DE;

  --ok:    #2E7D5B;
  --warn:  #A9782A;
  --stop:  #A33C28;

  --sans: "IBM Plex Sans", ui-sans-serif, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --row-h: 40px;          /* comfortable; density toggle rewrites this */
  --lane-h: 34px;
  --res-w: 214px;
  --hair: 1px solid var(--n-200);
}

:root[data-density="compact"]     { --row-h: 30px; --lane-h: 26px; }
:root[data-density="spacious"]    { --row-h: 52px; --lane-h: 44px; }

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--n-25);
  color: var(--n-900);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums slashed-zero;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--teal); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================ sign in ==== */

.signin-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: center;
  padding: 40px 20px;
  background:
    linear-gradient(180deg, var(--n-50) 0%, var(--n-25) 340px);
}

.signin {
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  background: var(--n-0);
  border: 1px solid var(--n-200);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28, 28, 26, .04), 0 18px 44px -28px rgba(28, 28, 26, .28);
}

.signin-form { padding: 34px 36px 32px; }
.signin-aside {
  padding: 34px 32px;
  background: var(--n-50);
  border-left: 1px solid var(--n-200);
}

.mark { display: flex; align-items: baseline; gap: 9px; margin-bottom: 26px; }
.mark .rule { width: 26px; height: 2px; background: var(--teal); transform: translateY(-4px); }
.mark h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.mark .sub {
  font-family: var(--sans); font-weight: 500;
  font-size: 11.5px;
  color: var(--n-500);
}

.signin h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.signin .lede { margin: 0 0 22px; color: var(--n-600); font-size: 13px; max-width: 42ch; }

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-family: var(--sans); font-weight: 500;
  font-size: 11.5px;
  color: var(--n-500);
  margin-bottom: 5px;
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  background: var(--n-0);
  border: 1px solid var(--n-300);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13.5px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal);
  outline: 2px solid var(--teal-tint);
  outline-offset: 0;
}
.field textarea { min-height: 70px; resize: vertical; }

.checkline { display: flex; align-items: center; gap: 8px; margin: 4px 0 18px; color: var(--n-600); font-size: 12.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--n-300);
  background: var(--n-0);
  color: var(--n-900);
  white-space: nowrap;
}
.btn:hover { border-color: var(--n-400); background: var(--n-50); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.btn-primary[disabled] { background: var(--n-200); border-color: var(--n-200); color: var(--n-500); }
.btn-wide { width: 100%; padding: 10px 15px; }
.btn-quiet { border-color: transparent; color: var(--n-600); }
.btn-quiet:hover { background: var(--n-100); border-color: transparent; color: var(--n-900); }
.btn-danger { color: var(--stop); }

.signin-error {
  background: #FBEAE6;
  border: 1px solid #E8C4BA;
  color: #7A2B1C;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

.accounts { margin: 0; padding: 0; list-style: none; }
.accounts li { border-top: 1px solid var(--n-200); }
.accounts li:first-child { border-top: 0; }
.accounts button {
  width: 100%;
  text-align: left;
  padding: 10px 2px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  border-radius: 4px;
}
.accounts button:hover { background: var(--n-100); }
.accounts .who { font-weight: 500; }
.accounts .role {
  font-family: var(--sans); font-weight: 500;
  font-size: 11.5px;
  color: var(--n-500);
  align-self: center;
}
.accounts .sees { grid-column: 1 / -1; color: var(--n-600); font-size: 12px; }

.aside-title {
  font-family: var(--sans); font-weight: 500;
  font-size: 11.5px;
  color: var(--n-500);
  margin: 0 0 10px;
}
.aside-note { color: var(--n-600); font-size: 12px; margin: 16px 0 0; }
.aside-note strong { color: var(--n-700); font-weight: 500; }

/* ================================================================ shell === */

.app { display: none; height: 100vh; grid-template-rows: auto auto 1fr auto; }
.app.on { display: grid; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  height: 46px;
  background: var(--n-0);
  border-bottom: 1px solid var(--n-200);
}
.topbar .mark { margin: 0; }
.topbar .mark h1 { font-size: 15px; }
.topbar .spacer { flex: 1; }

.scenario-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--burnt-tint);
  border: 1px solid #E4C4B0;
  color: #7C3C18;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 12px;
}
.scenario-flag b { font-weight: 500; }

.whoami { display: flex; align-items: center; gap: 9px; }
.whoami .avatar {
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--teal-tint); color: var(--teal-deep);
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
}
.whoami .lines { line-height: 1.25; }
.whoami .n { font-size: 12.5px; font-weight: 500; }
.whoami .r {
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500);
}

/* ============================================================== toolbar === */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 14px;
  background: var(--n-50);
  border-bottom: 1px solid var(--n-200);
}

.seg { display: inline-flex; background: var(--n-0); border: 1px solid var(--n-300); border-radius: 6px; overflow: hidden; }
.seg button {
  padding: 5px 11px;
  font-size: 12.5px;
  color: var(--n-600);
  border-right: 1px solid var(--n-200);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--n-75); color: var(--n-900); }
.seg button[aria-pressed="true"] { background: var(--teal); color: #fff; }

.nav { display: inline-flex; align-items: center; gap: 5px; }
.nav .arrow {
  width: 27px; height: 27px; border-radius: 6px;
  border: 1px solid var(--n-300); background: var(--n-0);
  display: grid; place-items: center; color: var(--n-700);
}
.nav .arrow:hover { background: var(--n-75); }
.range {
  font-size: 13px;
  min-width: 196px;
  text-align: center;
  color: var(--n-900);
}
.range .wk {
  font-family: var(--mono); font-size: 11px; color: var(--n-500);
  margin-left: 7px;
}

.tool-label {
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500);
}

select.mini, .mini {
  background: var(--n-0);
  border: 1px solid var(--n-300);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12.5px;
  color: var(--n-700);
}
select.mini:hover, .mini:hover { border-color: var(--n-400); }

.pill {
  border: 1px solid var(--n-300);
  background: var(--n-0);
  border-radius: 4px;
  padding: 3px 9px 3px 7px;
  font-size: 11.5px;
  color: var(--n-500);
  display: inline-flex; align-items: center; gap: 6px;
}
.pill:hover { border-color: var(--n-400); }
.pill[aria-pressed="true"] { color: var(--n-900); background: var(--n-0); border-color: var(--n-400); }
.pill[aria-pressed="false"] { background: var(--n-75); color: var(--n-400); }
.pill .swatch { width: 11px; height: 11px; border-radius: 2px; border: 1px solid var(--n-400); }

.toolbar .right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }

.publish-btn {
  border-radius: 6px; padding: 7px 13px; font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ok); border: 1px solid var(--ok); color: #fff;
}
.publish-btn:hover { filter: brightness(.94); }
.publish-btn .count {
  font-family: var(--mono); font-size: 11px;
  background: rgba(255,255,255,.22); border-radius: 3px; padding: 0 5px;
}
.publish-btn[data-state="none"] {
  background: var(--n-100); border-color: var(--n-200); color: var(--n-500); cursor: default;
}
.publish-btn[data-state="none"] .count { background: var(--n-200); }
.publish-btn[data-state="partial"] { background: var(--warn); border-color: var(--warn); }

/* ================================================================ board === */

.board-wrap { position: relative; overflow: hidden; display: flex; min-height: 0; }
.board {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--n-0);
  min-width: 0;
}

.grid { min-width: max-content; position: relative; }

/* --- day header --- */
.head {
  position: sticky; top: 0; z-index: 30;
  display: flex;
  background: var(--n-0);
  border-bottom: 1px solid var(--n-300);
}
.head .corner {
  position: sticky; left: 0; z-index: 31;
  width: var(--res-w); flex: none;
  background: var(--n-0);
  border-right: 1px solid var(--n-300);
  display: flex; align-items: flex-end; padding: 6px 12px 7px;
}
.head .corner .t {
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500);
}
.head .cols { display: flex; flex: 1; }
.head .col {
  flex: 1 0 auto;
  border-right: 1px solid var(--n-200);
  padding: 6px 0 5px;
  text-align: center;
  min-width: 0;
}
.head .col.weekstart { border-left: 1px solid var(--n-300); }
.head .col.weekend { background: var(--n-75); }
.head .col.today { background: var(--teal-tint); }
.head .col .dow {
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--n-500); display: block;
}
.head .col .dnum { font-size: 13px; color: var(--n-700); display: block; line-height: 1.2; }
.head .col.today .dow, .head .col.today .dnum { color: var(--teal-deep); font-weight: 500; }
.head .col .bh { display: block; font-size: 10px; color: var(--burnt); }

/* --- group divider --- */
.group-row {
  position: sticky; left: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 4px;
  background: var(--n-75);
  border-bottom: 1px solid var(--n-200);
  border-top: 1px solid var(--n-200);
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--n-500);
  z-index: 12;
}
.group-row .line { flex: 1; height: 1px; background: var(--n-200); }

/* --- resource rows --- */
.row { display: flex; border-bottom: 1px solid var(--n-150); min-height: var(--row-h); }
.row:hover .res { background: var(--n-50); }
.row.quiet .res .name { color: var(--n-400); }

.res {
  position: sticky; left: 0; z-index: 10;
  width: var(--res-w); flex: none;
  background: var(--n-0);
  border-right: 1px solid var(--n-300);
  padding: 6px 12px 5px;
  display: flex; flex-direction: column; justify-content: center;
}
.board.scrolled .res { box-shadow: 6px 0 10px -8px rgba(28,28,26,.35); }
.res .name { font-size: 13px; font-weight: 500; line-height: 1.25; }
.res .detail { font-size: 11px; color: var(--n-500); line-height: 1.3; }
.res .util {
  margin-top: 4px; display: flex; align-items: center; gap: 6px;
}
.res .util .bar {
  flex: 1; height: 3px; background: var(--n-150); border-radius: 2px; overflow: hidden;
}
.res .util .bar i { display: block; height: 100%; background: var(--teal); }
.res .util .bar i.over { background: var(--burnt); }
.res .util .pc { font-family: var(--mono); font-size: 9.5px; color: var(--n-500); }
.res .util .pc.over { color: var(--burnt); }

.track { position: relative; flex: 1; display: flex; min-width: 0; }
.track .cell {
  flex: 1 0 auto;
  border-right: 1px solid var(--n-200);
  min-width: 0;
}
.track .cell.weekstart { border-left: 1px solid var(--n-300); }
.track .cell.weekend { background: var(--n-75); }
.track .cell.today { background: var(--teal-tint); }
.track .cell.bh { background: var(--burnt-tint); }
.track .cell.drop-target { background: var(--teal-tint); box-shadow: inset 0 0 0 1px var(--teal-edge); }
.track .lanes { position: absolute; inset: 0; pointer-events: none; }

/* --- booking blocks --- */
.blk {
  position: absolute;
  pointer-events: auto;
  border-radius: 2px;
  padding: 2px 6px 2px 7px;
  overflow: hidden;
  text-align: left;
  display: block;
  cursor: grab;
  border-left: 3px solid var(--bar, var(--n-400));
  background: var(--fill, var(--n-100));
  color: var(--ink, var(--n-700));
  transition: box-shadow .12s ease-out;
}
.blk:hover { box-shadow: inset 0 0 0 1px rgba(28,28,26,.18); }
.blk.dragging { opacity: .55; cursor: grabbing; box-shadow: 0 6px 16px -6px rgba(28,28,26,.45); z-index: 25; }
.blk.selected { box-shadow: 0 0 0 2px var(--teal); }
.blk .t1 {
  display: block; font-size: 12px; font-weight: 500; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.blk .t2 {
  display: block; font-size: 11px; line-height: 1.2; opacity: .82;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.blk .glyph {
  position: absolute; top: 2px; right: 4px;
  font-family: var(--mono); font-size: 9px; opacity: .7;
}
.blk .tri {
  position: absolute; right: 0; bottom: 0;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-bottom: 7px solid var(--bar);
  opacity: .75;
}

/* state is encoded by form, never by hue — hue says which vessel */
.blk.s-pencilled {
  background: var(--n-0);
  box-shadow: inset 0 0 0 1.5px var(--bar);
  border-left-width: 3px;
}
.blk.s-pencilled .t1 { color: var(--ink); }
.blk.s-confirmed { background: var(--fill); }
.blk.s-published { background: var(--fill); }
.blk.s-completed { background: var(--fill); opacity: .72; }
.blk.s-released {
  opacity: .45;
  background: var(--n-100);
  border-left-style: dashed;
}
.blk.s-released .t1 { text-decoration: line-through; }

/* not yet visible to the yard */
.blk.unpublished::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    135deg, transparent 0 5px, rgba(28,28,26,.085) 5px 10px);
  pointer-events: none;
}

.blk.k-leave, .blk.k-maintenance, .blk.k-meeting, .blk.k-training {
  --fill: var(--n-100); --bar: var(--n-400); --ink: var(--n-600);
  border-left-style: dotted;
  border-left-width: 4px;
}
.blk.k-leave .t1, .blk.k-maintenance .t1,
.blk.k-meeting .t1, .blk.k-training .t1 { font-weight: 400; font-style: italic; }

.blk.clash { box-shadow: inset 0 0 0 1.5px var(--stop), inset 0 -3px 0 0 var(--stop); }

.blk .grip {
  position: absolute; top: 0; bottom: 0; width: 6px;
  cursor: ew-resize;
}
.blk .grip.l { left: 0; }
.blk .grip.r { right: 0; }
.blk:hover .grip { background: rgba(28,28,26,.07); }

.ghost {
  position: absolute; z-index: 40; pointer-events: none;
  border: 1.5px dashed var(--teal);
  background: var(--teal-tint);
  border-radius: 2px;
  color: var(--teal-deep);
  font-size: 11.5px;
  display: flex; align-items: center;
  padding: 0 7px;
  white-space: nowrap; overflow: hidden;
}

/* live work, seen from inside a scenario: there to plan around, not to move */
.blk.ghosted { opacity: .38; cursor: default; filter: saturate(.55); }
.blk.ghosted:hover { box-shadow: none; }

/* --- empty states --- */
.empty {
  padding: 48px 28px;
  text-align: center;
  color: var(--n-500);
  max-width: 44ch;
  margin: 0 auto;
}
.empty h3 { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: var(--n-700); }
.empty p { margin: 0 0 14px; font-size: 13px; }

/* ================================================================= rail === */

.rail {
  width: 340px; flex: none;
  background: var(--n-0);
  border-left: 1px solid var(--n-200);
  display: flex; flex-direction: column; min-height: 0;
}
.rail .tabs { display: flex; border-bottom: 1px solid var(--n-200); flex: none; }
.rail .tabs button {
  flex: 1; padding: 9px 2px;
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500);
  border-bottom: 2px solid transparent;
}
.rail .tabs button:hover { color: var(--n-900); background: var(--n-50); }
.rail .tabs button[aria-selected="true"] { color: var(--n-900); border-bottom-color: var(--teal); }
.rail .body { flex: 1; overflow: auto; padding: 16px; }

.rail h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; letter-spacing: -.008em; }
.rail .sub2 { font-family: var(--mono); font-size: 10.5px; color: var(--n-500); margin-bottom: 14px; }

.kv { display: grid; grid-template-columns: 86px 1fr; gap: 6px 10px; font-size: 12.5px; margin-bottom: 16px; }
.kv dt {
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500); padding-top: 2px;
}
.kv dd { margin: 0; color: var(--n-700); }

.chip {
  display: inline-block; border-radius: 4px; padding: 1px 7px;
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; border: 1px solid transparent;
}
.chip.pencilled { background: var(--n-0); border-color: var(--n-400); color: var(--n-600); }
.chip.confirmed { background: #FAEFDC; color: #8A5A0B; }
.chip.published { background: #DCEFE8; color: #14573F; }
.chip.released  { background: var(--n-100); color: var(--n-500); text-decoration: line-through; }
.chip.completed { background: #E5EAF3; color: #3A4E72; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.actions .btn { padding: 5px 10px; font-size: 12.5px; }

.panel {
  border: 1px solid var(--n-200);
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 14px;
  background: var(--n-25);
}
.panel .hd {
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500);
  display: flex; justify-content: space-between; margin-bottom: 8px;
}
.panel .line { display: flex; justify-content: space-between; padding: 2px 0; font-size: 12.5px; }
.panel .line b { font-weight: 600; }
.panel .total { border-top: 1px solid var(--n-200); margin-top: 6px; padding-top: 7px; }

.locked {
  border: 1px dashed var(--n-300);
  border-radius: 8px; padding: 11px 12px;
  color: var(--n-500); font-size: 12.5px; margin-bottom: 14px;
}

.note-box {
  background: var(--n-50); border-radius: 6px; padding: 9px 11px;
  font-size: 12.5px; color: var(--n-700); margin-bottom: 12px;
  border-left: 2px solid var(--n-300);
}
.note-box .lbl {
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500); display: block; margin-bottom: 3px;
}

.warn-box {
  background: #FBEAE6; border: 1px solid #E8C4BA; color: #6E2A1B;
  border-radius: 6px; padding: 9px 11px; font-size: 12.5px; margin-bottom: 14px;
}
.warn-box b { color: var(--stop); }

.audit { list-style: none; margin: 0; padding: 0; }
.audit li { padding: 9px 0; border-bottom: 1px solid var(--n-150); }
.audit li:last-child { border-bottom: 0; }
.audit .w {
  display: flex; gap: 9px; font-family: var(--mono); font-size: 9.5px; color: var(--n-500);
  margin-bottom: 2px;
}
.audit .s { font-size: 12.5px; color: var(--n-700); }
.audit .delta {
  margin-top: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--n-500);
  display: flex; flex-direction: column; gap: 1px;
}
.audit .delta s { color: var(--n-400); }

.help dl { margin: 0 0 16px; }
.help dt {
  font-family: var(--mono); font-size: 11px; color: var(--n-900);
  background: var(--n-75); border: 1px solid var(--n-200);
  border-radius: 3px; padding: 0 5px; display: inline-block; margin-bottom: 3px;
}
.help dd { margin: 0 0 9px; font-size: 12.5px; color: var(--n-600); }
.help h4 {
  margin: 16px 0 8px; font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500);
}

.legend { display: grid; gap: 7px; margin-bottom: 4px; }
.legend .row2 { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: center; font-size: 12.5px; color: var(--n-600); }
.legend .sample { height: 19px; border-radius: 2px; border-left: 3px solid #3B6EA5; background: #DDE6F2; position: relative; }
.legend .sample.pencilled { background: #fff; box-shadow: inset 0 0 0 1.5px #3B6EA5; }
.legend .sample.unpub::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(28,28,26,.085) 5px 10px);
}
.legend .sample.released { opacity: .45; background: var(--n-100); border-left-style: dashed; }
.legend .sample.completed { opacity: .72; }

/* ============================================================ staff view = */

.staff-page { overflow: auto; flex: 1; background: var(--n-25); }
.staff {
  max-width: 620px; margin: 0 auto; padding: 26px 18px 70px;
}
.staff-head { margin-bottom: 22px; }
.staff-head h2 { margin: 0 0 3px; font-size: 21px; font-weight: 600; letter-spacing: -.015em; }
.staff-head p { margin: 0; color: var(--n-600); font-size: 13px; }

.subscribe {
  margin: 18px 0 26px; padding: 12px 14px;
  border: 1px solid var(--n-200); border-radius: 8px; background: var(--n-0);
}
.subscribe .hd { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.subscribe p { margin: 0 0 9px; font-size: 12.5px; color: var(--n-600); }
.subscribe .url {
  display: flex; gap: 8px; align-items: center;
}
.subscribe input {
  flex: 1; font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--n-300); border-radius: 6px; padding: 6px 8px;
  background: var(--n-50); color: var(--n-600);
}

.sday { margin-bottom: 18px; }
.sday h3 {
  margin: 0 0 7px; padding-bottom: 5px;
  border-bottom: 1px solid var(--n-200);
  font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500);
  display: flex; justify-content: space-between;
}
.sday h3.today { color: var(--teal); border-bottom-color: var(--teal-edge); }
.sitem {
  display: flex; gap: 13px;
  background: var(--n-0); border: 1px solid var(--n-200);
  border-left: 3px solid var(--bar, var(--n-400));
  border-radius: 6px; padding: 11px 13px; margin-bottom: 7px;
}
.sitem .when {
  font-family: var(--mono); font-size: 11.5px; color: var(--n-600);
  white-space: nowrap; padding-top: 1px; min-width: 58px;
}
.sitem .what { min-width: 0; }
.sitem .what b { display: block; font-size: 14px; font-weight: 600; }
.sitem .what span { display: block; color: var(--n-600); font-size: 12.5px; }
.sitem .what .brief { color: var(--n-700); margin-top: 4px; font-size: 12.5px; }
.sitem .what .ref { font-family: var(--mono); font-size: 10px; color: var(--n-400); margin-top: 5px; }
.sitem .what .flag { color: var(--burnt); font-size: 12px; margin-top: 3px; }
.sitem.off { --bar: var(--n-300); background: var(--n-50); }
.sday .none { color: var(--n-400); font-size: 12.5px; padding: 2px 0 6px; }

/* ============================================================== footer === */

.footer {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 5px 14px;
  background: var(--n-0); border-top: 1px solid var(--n-200);
  font-family: var(--mono); font-size: 10px; color: var(--n-400);
}
.footer .dot { color: var(--n-300); }
.footer .exports { display: inline-flex; gap: 14px; align-items: center; }
.footer a { color: var(--n-500); text-decoration: none; }
.footer a:hover { color: var(--teal); text-decoration: underline; }

/* ============================================================== dialog === */

dialog {
  border: 1px solid var(--n-300);
  border-radius: 10px;
  background: var(--n-0);
  color: var(--n-900);
  padding: 0;
  max-width: 520px;
  width: 92vw;
  box-shadow: 0 1px 2px rgba(28,28,26,.05), 0 24px 60px -30px rgba(28,28,26,.5);
}
dialog::backdrop { background: rgba(28,28,26,.36); }
dialog .dh { padding: 17px 20px 0; }
dialog .dh h3 { margin: 0 0 5px; font-size: 16px; font-weight: 600; }
dialog .dh p { margin: 0; color: var(--n-600); font-size: 12.5px; }
dialog .db { padding: 16px 20px; }
dialog .df {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 0 20px 18px;
}
dialog .df .left { margin-right: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.clash-list { list-style: none; margin: 0 0 14px; padding: 0; }
.clash-list li {
  border: 1px solid #E8C4BA; background: #FBEAE6;
  border-radius: 6px; padding: 9px 11px; margin-bottom: 6px; font-size: 12.5px;
}
.clash-list .who { font-weight: 600; color: #6E2A1B; }
.clash-list .det { color: #7A3B2B; }

.slot-list { list-style: none; margin: 10px 0 0; padding: 0; }
.slot-list li { border-top: 1px solid var(--n-200); }
.slot-list button {
  width: 100%; text-align: left; padding: 9px 2px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.slot-list button:hover { background: var(--n-50); }
.slot-list .d { font-size: 13px; }
.slot-list .n { font-family: var(--mono); font-size: 11px; color: var(--n-500); }

/* =============================================================== toast === */

#toasts {
  position: fixed; left: 14px; bottom: 14px; z-index: 90;
  display: flex; flex-direction: column; gap: 7px;
  max-width: 400px;
}
.toast {
  background: var(--n-900); color: var(--n-25);
  border-radius: 7px; padding: 9px 13px; font-size: 12.5px;
  box-shadow: 0 10px 26px -12px rgba(0,0,0,.6);
  display: flex; align-items: center; gap: 12px;
}
.toast b { font-weight: 600; }
.toast button {
  color: #8FD6D0; font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.toast.bad { background: #6E2A1B; }

/* ============================================================== overlay == */

.kbd-overlay {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(28,28,26,.4);
  display: grid; place-items: center; padding: 24px;
}
.kbd-card {
  background: var(--n-0); border-radius: 10px; border: 1px solid var(--n-300);
  padding: 22px 26px; max-width: 560px; width: 100%;
  box-shadow: 0 30px 70px -32px rgba(0,0,0,.55);
}
.kbd-card h3 { margin: 0 0 14px; font-size: 16px; }
.kbd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
.kbd-grid h4 {
  margin: 0 0 7px; font-family: var(--sans); font-weight: 500; font-size: 11.5px; color: var(--n-500);
}
.kbd-grid dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: baseline; }
.kbd-grid dt {
  font-family: var(--mono); font-size: 11px;
  background: var(--n-75); border: 1px solid var(--n-200); border-radius: 3px;
  padding: 0 5px; justify-self: start;
}
.kbd-grid dd { margin: 0; font-size: 12.5px; color: var(--n-600); }

/* ============================================================ responsive = */

@media (max-width: 1100px) {
  .rail { width: 300px; }
  :root { --res-w: 176px; }
}
@media (max-width: 860px) {
  .rail { display: none; }
  .signin { grid-template-columns: 1fr; }
  .signin-aside { border-left: 0; border-top: 1px solid var(--n-200); }
  .toolbar { gap: 7px; }
  .range { min-width: 150px; font-size: 12.5px; }
}

/* ================================================================ print == */

@media print {
  @page { size: A3 landscape; margin: 10mm; }

  body { background: #fff; font-size: 10px; }
  .topbar, .toolbar, .rail, .footer, #toasts, .kbd-overlay, dialog { display: none !important; }
  .app { display: block !important; height: auto; }
  .board-wrap, .board { overflow: visible !important; height: auto !important; }
  .grid { min-width: 0; }

  .head { position: static; border-bottom: 1.5px solid #333; }
  .head .corner, .res { position: static; box-shadow: none !important; }
  .row { break-inside: avoid; page-break-inside: avoid; min-height: 26px; }
  .group-row { break-after: avoid; }

  .blk {
    box-shadow: none !important;
    border: 1px solid #555 !important;
    border-left-width: 3px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* status has to survive a greyscale printer */
  .blk.s-pencilled .t1::after  { content: " (pencilled)"; font-weight: 400; }
  .blk.unpublished .t1::after  { content: " (not published)"; font-weight: 400; }
  .blk.s-released .t1::after   { content: " (released)"; font-weight: 400; }
  .blk.clash .t1::after        { content: " (double-booked)"; font-weight: 400; }
  .blk .grip, .blk .tri { display: none; }

  .grid::after {
    content: "Penvose Marine — yard schedule · " attr(data-print-range)
             " · printed " attr(data-print-stamp);
    display: block;
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 9px;
    color: #555;
  }
}
