/* CREW PANEL + DOCK KEYS (Andrew 10-01, from the Observation Deck concept: "this is what i am looking for for
   the left panel, and also I want to use the buttons on the bottom"). Layout untouched; materials only.
   · the left rail = the Build Library sheet: 12px frosted shell, plain CREW header over a hairline with the
     roster total beside it, no corner brackets
   · crew rows = agent cards (app/crewcards.js): portrait well with a housed lamp, name in the agent's colour,
     run clock or Lv on the right, status + live step under it, a gold frame while it needs your OK
   · SESSIONS / PROJECTS = glass keys, a glass search field, rows that become a card when selected
   · the dock group triggers = 8px glass keys (36px, 16px type), the badge a gold pip on the key's corner */
body.glass-demo {
  --cg-edge: rgba(var(--ph-rgb), .2);
  --cg-hair: rgba(var(--ph-rgb), .12);
  --cg-glass: linear-gradient(125deg, rgba(var(--ph-bright-rgb), .09), rgba(var(--ph-rgb), .045) 48%, rgba(var(--ph-rgb), .015));
  --cg-card: linear-gradient(165deg, rgba(var(--ph-rgb), .075), transparent 46%), color-mix(in srgb, var(--panel2) 70%, transparent);
  --cg-mute: color-mix(in srgb, var(--text) 62%, var(--panel2));
  --cg-lamp: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* ---------- 1 · the sheet ---------- */
/* Same face, edge, shadow and glass overlay as COMMS (glass-demo.css) so the two rails sit at one brightness
   (Andrew 10-01: the lighter translucent wash on the left read as a brightness change). Only the shape differs. */
body.glass-demo:not(.hud-mode) #screen-game #left { border-radius: 10px; }
body.glass-demo:not(.hud-mode) #screen-game #left::after { display: none; }
body.glass-demo:not(.hud-mode) #screen-game #left:focus-within { outline: 0; border-color: rgba(var(--ph-rgb), .38); }

/* header: CREW + find / hide, the roster total on a caption line under the title */
body.glass-demo:not(.hud-mode) #screen-game #left > h3 {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 8px; row-gap: 1px;
  background: none; box-shadow: none;
  border-bottom: 1px solid var(--cg-hair);
  border-radius: 10px 10px 0 0;
  padding: 11px 10px 9px 14px;
  font-size: 17px; letter-spacing: 2.5px; color: var(--ph-bright);
}
body.glass-demo:not(.hud-mode) #left > h3 .crew-h3-right { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
body.glass-demo:not(.hud-mode) #left > h3 #crew-sum {
  order: 3; flex: 1 0 100%; display: flex; justify-content: flex-start; gap: 0;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font-size: 13px; letter-spacing: 1.2px; line-height: 1.2; white-space: nowrap; color: var(--cg-mute);
}
body.glass-demo:not(.hud-mode) #left > h3 #crew-sum span { color: inherit; opacity: 1; background: none; border: 0; box-shadow: none; padding: 0; font-size: inherit; letter-spacing: inherit; }
body.glass-demo:not(.hud-mode) #left > h3 #crew-sum .pos::after { content: '\00a0·\00a0'; }
body.glass-demo:not(.hud-mode) #left > h3 #crew-sum:empty { display: none; }

/* ---------- 2 · agent cards ---------- */
body.glass-demo:not(.hud-mode) #crew { padding: 6px 2px; }
/* the roster dragged SHUT (leftrail.js) must measure zero: this padding outranks app.css's #crew.shut,
   so without it the closed list kept a 12px scrolling sliver under the header */
body.glass-demo:not(.hud-mode) #crew.shut { padding-block: 0; }
body.glass-demo:not(.hud-mode) #crew .crew-row {
  gap: 11px; margin: 4px 8px; padding: 8px 9px;
  border: 1px solid transparent; border-radius: 10px;
}
body.glass-demo:not(.hud-mode) #crew .crew-row:is(:hover, :focus-visible, .selected) {
  background: var(--cg-card); border-color: var(--cg-edge);
  box-shadow: inset 0 1px 0 rgba(var(--ph-bright-rgb), .06), 0 2px 8px rgba(0, 0, 0, .2);
}
body.glass-demo:not(.hud-mode) #crew .crew-row.asking {
  border-color: rgba(var(--gold-rgb), .55);
  background: linear-gradient(165deg, rgba(var(--gold-rgb), .09), transparent 50%), color-mix(in srgb, var(--panel2) 70%, transparent);
}
/* the portrait well, its figure and the housed lamp in its corner */
body.glass-demo:not(.hud-mode) #crew .crew-portrait {
  position: relative; width: 48px; height: 56px; align-items: flex-end;
  border-radius: 8px; border: 1px solid var(--cg-hair);
  background: rgba(0, 0, 0, .3); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45);
}
body.glass-demo:not(.hud-mode) #crew .crew-portrait img { width: 40px; height: 50px; object-fit: contain; object-position: 50% 100%; }
body.glass-demo:not(.hud-mode) #crew .crew-portrait > .dot {
  position: absolute; left: auto; bottom: auto; right: 4px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%; outline: 0; animation: none;
  background: var(--ok, #7fd89a); box-shadow: var(--cg-lamp);
}
body.glass-demo:not(.hud-mode) #crew .crew-row.working .crew-portrait > .dot { background: var(--ph); }
body.glass-demo:not(.hud-mode) #crew .crew-row.asking .crew-portrait > .dot { background: var(--gold); }
/* name line: NAME ........ 4:12  (or Lv 2 while idle) */
body.glass-demo:not(.hud-mode) #crew .crew-main { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0; }
body.glass-demo:not(.hud-mode) #crew .crew-name {
  flex: 1 0 100%; display: flex; align-items: baseline; gap: 6px;
  font-size: 19px; letter-spacing: 1.2px; line-height: 1.15;
}
body.glass-demo:not(.hud-mode) #crew .crew-name .crew-room { margin-left: auto; font-size: 13px; letter-spacing: .5px; opacity: 1; color: var(--cg-mute); }
body.glass-demo:not(.hud-mode) #crew .crew-name .crew-clock {
  font-size: 19px; color: var(--ph-bright); font-variant-numeric: tabular-nums; letter-spacing: .5px;
}
body.glass-demo:not(.hud-mode) #crew .crew-name .crew-clock:empty { display: none; }
body.glass-demo:not(.hud-mode) #crew .crew-row.has-clock .crew-room { display: none; }
body.glass-demo:not(.hud-mode) #crew .crew-row.has-clock .crew-clock { margin-left: auto; }
/* status line: working · web.search */
body.glass-demo:not(.hud-mode) #crew :is(.crew-status, .crew-step) {
  margin-top: 3px; font-size: 14px; letter-spacing: .4px; line-height: 1.3; opacity: 1;
  color: var(--cg-mute); text-transform: lowercase;
}
body.glass-demo:not(.hud-mode) #crew .crew-status { flex: none; }
body.glass-demo:not(.hud-mode) #crew .crew-step { flex: 1 1 0; min-width: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; }
body.glass-demo:not(.hud-mode) #crew .crew-step:not(:empty)::before { content: '\00a0·\00a0'; }
body.glass-demo:not(.hud-mode) #crew .crew-row.asking :is(.crew-status, .crew-step) { color: var(--gold); }
body.glass-demo:not(.hud-mode) #crew .crew-row.asking .crew-status { display: none; }
body.glass-demo:not(.hud-mode) #crew .crew-row.asking .crew-step::before { content: none; }
body.glass-demo:not(.hud-mode) #crew .crew-prog { display: none; }

/* ---------- 3 · sessions / projects ---------- */
body.glass-demo:not(.hud-mode) #screen-game #left #ws-wrap { margin: 0; border-radius: 0; background: none; box-shadow: none; }
body.glass-demo:not(.hud-mode) #screen-game #left .ws-head {
  background: none; box-shadow: none; border-radius: 0; border-block: 1px solid var(--cg-hair); padding: 10px 10px 8px; gap: 6px; flex-wrap: wrap;
}
body.glass-demo:not(.hud-mode) #left .ws-head .ws-view { display: inline-flex; gap: 6px; }
body.glass-demo:not(.hud-mode) #left .ws-head :is(.ws-tab, #ws-new, #ws-addproject) {
  min-height: 32px; padding: 4px 8px; font-size: 14px; letter-spacing: .4px;
  color: var(--ph); border: 1px solid var(--cg-edge); border-radius: 8px;
  background: var(--cg-glass); box-shadow: inset 0 1px 0 rgba(var(--ph-bright-rgb), .07); text-shadow: none;
}
body.glass-demo:not(.hud-mode) #left .ws-head :is(.ws-tab, #ws-new, #ws-addproject):is(:hover, :focus-visible) {
  color: var(--ph-bright); border-color: rgba(var(--ph-rgb), .45); background: rgba(var(--ph-rgb), .1);
}
body.glass-demo:not(.hud-mode) #left .ws-head .ws-tab.on {
  color: var(--ph-bright); border-color: var(--ph); background: rgba(var(--ph-rgb), .16);
  box-shadow: inset 0 1px 0 rgba(var(--ph-bright-rgb), .07);
}
body.glass-demo:not(.hud-mode) #left .ws-rail-search { padding: 10px 10px 6px; }
body.glass-demo:not(.hud-mode) #left #ws-search {
  min-height: 38px; border-radius: 8px; border: 1px solid var(--cg-edge);
  background: rgba(0, 0, 0, .18); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .15);
}
body.glass-demo:not(.hud-mode) #left #ws-search:focus { border-color: var(--ph); outline: 0; box-shadow: 0 0 0 2px rgba(var(--ph-rgb), .1); }
body.glass-demo:not(.hud-mode) #left #workstreams .ws-row { border-radius: 8px; margin-inline: 6px; }
body.glass-demo:not(.hud-mode) #left #workstreams .ws-row:is(.sel, :focus-visible) { background: var(--cg-card); border-color: var(--cg-edge); }

/* ---------- 4 · dock keys ---------- */
body.glass-demo:not(.hud-mode) #screen-game #bottombar .bb-group > .bb-grp {
  position: relative; min-width: 0; height: 36px; padding: 0 15px; gap: 8px;
  font: 16px/1 'VT323', monospace; letter-spacing: 1px;
  color: var(--ph); border: 1px solid var(--cg-edge); border-radius: 8px;
  background: var(--cg-glass);
  box-shadow: inset 0 1px 0 rgba(var(--ph-bright-rgb), .07);
  text-shadow: none;
}
body.glass-demo:not(.hud-mode) #screen-game #bottombar .bb-group > .bb-grp:is(:hover, :focus-visible) {
  color: var(--ph-bright); border-color: rgba(var(--ph-rgb), .45); background: rgba(var(--ph-rgb), .1);
}
body.glass-demo:not(.hud-mode) #screen-game #bottombar .bb-group.open > .bb-grp {
  color: var(--ph-bright); border-color: var(--ph); background: rgba(var(--ph-rgb), .16);
  box-shadow: inset 0 1px 0 rgba(var(--ph-bright-rgb), .07);
}
/* a window from this group is open: a gold hairline under the label, no glow */
body.glass-demo:not(.hud-mode) #screen-game #bottombar .bb-group.has-active > .bb-grp { box-shadow: inset 0 -2px 0 var(--gold), inset 0 1px 0 rgba(var(--ph-bright-rgb), .07); }
body.glass-demo:not(.hud-mode) #screen-game #bottombar .bb-gi { opacity: 1; }
body.glass-demo:not(.hud-mode) #screen-game #bottombar .bb-grp-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  font-size: 15px; line-height: 20px; color: #140c04; background: var(--gold);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .6); animation: none;
}

/* ---------- 5 · per-agent threads (trunk 638d8c217) in the card language ---------- */
/* the row whose sessions the rail shows: the card, plus a solid edge bar (an edge, never a glow) */
body.glass-demo:not(.hud-mode) #crew .crew-row.filtering.crew-row {
  background: var(--cg-card); border-color: rgba(var(--ph-rgb), .45);
  box-shadow: inset 3px 0 0 var(--ph), inset 0 1px 0 rgba(var(--ph-bright-rgb), .06);
}
body.glass-demo:not(.hud-mode) #crew .crew-dossier {
  bottom: 8px; right: 9px; padding: 2px 8px; font-size: 13px; letter-spacing: .8px;
  border-radius: 6px; border-color: var(--cg-edge); background: rgba(0, 0, 0, .35);
}
body.glass-demo:not(.hud-mode) #crew .crew-row:is(:hover, :focus-within, .filtering):has(.crew-dossier) .crew-step { padding-right: 66px; }
/* the chip that names whose sessions are showing */
body.glass-demo:not(.hud-mode) #left .ws-agent-filter {
  margin: 8px 10px 0; min-height: 34px; padding: 5px 10px 5px 7px;
  border-radius: 8px; border-color: var(--cg-edge); background: var(--cg-card);
}
body.glass-demo:not(.hud-mode) #left .ws-agent-filter:hover { border-color: rgba(var(--ph-rgb), .45); background: rgba(var(--ph-rgb), .1); }
