/* KES Scheduling Wall Board — 75" conference-room touchscreen
   Design targets: 1920x1080 landscape, viewed from 6-12 ft, finger input only.
   Rules: no hover-only affordances, min 56px touch targets, min 16px text,
   one scroll region per view, dark surface to kill glare. */

@import url('https://api.fontshare.com/v2/css?f[]=satoshi@700,500,900,400&display=swap');

:root {
  /* Surfaces — dark wall-board variant of the app's Studio theme */
  --bg: #070b12;
  --surface: #0e1420;
  --surface-2: #151d2c;
  --surface-3: #1c2637;
  --line: #24304a;
  --line-soft: #1a2233;

  --fg: #eef3fb;
  --fg-dim: #9aa8c0;
  --fg-faint: #63718c;

  /* Accent — teal-500, the app's teal-700 read at distance */
  --teal: #14b8a6;
  --teal-dim: #0d9488;
  --teal-glow: rgba(20, 184, 166, 0.18);

  --job: #fb923c;
  --task: #2dd4bf;
  --yard: #facc15;
  --crew: #60a5fa;
  --deadline: #f87171;
  --owner: #a78bfa;

  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;

  --r: 12px;
  --r-lg: 18px;
  --tap: 56px;

  --font: 'Satoshi', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  user-select: none;
}

.tnum { font-variant-numeric: tabular-nums lining-nums; }

/* ============ SHELL ============ */
.board {
  display: grid;
  /* Rows are assigned explicitly rather than left to auto-placement: the
     connection bar comes and goes, and an auto-placed layout would slide every
     row up by one whenever it hid. Its `auto` track collapses to zero height
     when the bar is display:none. */
  grid-template-rows: 84px auto 76px 64px 1fr 44px;
  height: 100dvh;
}
.board > .topbar    { grid-row: 1; }
.board > .connbar   { grid-row: 2; }
.board > .tabs      { grid-row: 3; }
.board > .filters   { grid-row: 4; }
.board > .stage     { grid-row: 5; }
.board > .statusbar { grid-row: 6; }

/* --- top bar --- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #0d1421 0%, #0a1018 100%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand svg { color: var(--teal); }
.brand .logo { height: 42px; width: auto; display: block; }
.brand-txt { border-left: 1px solid var(--line); padding-left: 16px; }
.brand-txt { line-height: 1.05; }
.brand-txt b { display: block; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.brand-txt span { font-size: 13px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }

.topbar .spacer { flex: 1; }

.clock { text-align: right; line-height: 1.1; }
.clock b { display: block; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.clock span { font-size: 14px; color: var(--fg-dim); font-weight: 500; }

.live {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 14px; color: var(--fg-dim); font-weight: 600;
}
.live.stale { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.live.stale .pulse { background: var(--warn); }

/* Environment badge. Reads TEST when the board holds real Test rows and SAMPLE
   when it does not — from across a conference room that difference has to be
   readable at a glance, so it is a colour change, not just a word. */
.envpill {
  align-self: center; margin-left: 12px;
  padding: 5px 11px; border-radius: 7px;
  font-size: 13px; font-weight: 800; letter-spacing: .09em;
  color: #04201d; background: var(--teal);
}

.connbar {
  padding: 11px 26px; font-size: 15px; font-weight: 600;
  border-bottom: 1px solid var(--line);
  color: var(--fg-dim);
}
.connbar.warn { background: color-mix(in srgb, var(--warn) 13%, var(--surface-2)); color: #f8e6bd; }
.connbar.bad  { background: color-mix(in srgb, var(--bad) 15%, var(--surface-2));  color: #fbd5d5; }
.connbar b { color: var(--fg); }

.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52,211,153,.7); }
.pulse.beat { animation: beat 1.1s ease-out; }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.7); }
  100% { box-shadow: 0 0 0 16px rgba(52,211,153,0); }
}

.who {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px 8px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--teal-dim); color: #04201d;
  display: grid; place-items: center; font-weight: 900; font-size: 15px;
}
.who-txt { line-height: 1.15; }
.who-txt b { display: block; font-size: 15px; font-weight: 700; }
.who-txt span { font-size: 12px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }

/* --- tabs --- */
.tabs {
  display: flex; align-items: stretch; gap: 10px;
  padding: 10px 24px 0;
  background: #0a1018;
  border-bottom: 1px solid var(--line);
}
.tab {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 0 20px; flex: none;
  border: 1px solid var(--line); border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--surface);
  color: var(--fg-dim);
  font: inherit; font-size: 19px; font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.tab:active { transform: scale(.985); }
.tab .cnt {
  min-width: 32px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--fg-dim);
  font-size: 14px; font-weight: 800; text-align: center;
}
.tab[aria-selected="true"] {
  background: var(--surface-3); color: var(--fg);
  box-shadow: inset 0 3px 0 0 var(--teal);
}
.tab[aria-selected="true"] .cnt { background: var(--teal); color: #04201d; }

.tabs .spacer { flex: 1; }
.rangenav { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; flex: none; }
.rangenav .rangelabel {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 230px; height: var(--tap); padding: 0 16px;
  border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 17px; font-weight: 800; color: var(--fg-dim);
}
.zoomgroup { display: flex; align-items: center; gap: 6px; padding-bottom: 10px; flex: none; }
.zoomgroup .btn { min-height: var(--tap); }

/* --- filter bar --- */
.filters {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.filters::-webkit-scrollbar { height: 0; }
.fgroup { display: flex; align-items: center; gap: 8px; }
.flabel {
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-faint); margin-right: 2px; white-space: nowrap;
}
.divider { width: 1px; height: 32px; background: var(--line); margin: 0 8px; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--fg-dim); font: inherit; font-size: 15px; font-weight: 700;
  white-space: nowrap; cursor: pointer; transition: all .14s;
}
.chip:active { transform: scale(.96); }
.chip .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; opacity: .45; }
.chip[aria-pressed="true"] { color: var(--fg); background: var(--surface-3); border-color: #3b4b6d; }
.chip[aria-pressed="true"] .dot { opacity: 1; }
.chip.locked { opacity: .4; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--fg); font: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all .14s;
}
.btn:active { transform: scale(.97); }
.btn.icon { padding: 0; width: 48px; }
.btn.primary { background: var(--teal); color: #04201d; border-color: var(--teal); }
.btn.ghost { background: transparent; }
.btn.lg { min-height: var(--tap); font-size: 18px; padding: 0 24px; }
.btn[aria-pressed="true"] { background: var(--teal); color: #04201d; border-color: var(--teal); }

select.btn { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--fg-dim) 50%), linear-gradient(135deg, var(--fg-dim) 50%, transparent 50%); background-position: right 20px center, right 14px center; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }

/* --- stage --- */
.stage { position: relative; overflow: hidden; }
.view { display: none; height: 100%; overflow: hidden; }
.view.on { display: block; }

/* --- status strip --- */
.statusbar {
  display: flex; align-items: center; gap: 22px;
  padding: 0 28px; background: #0a1018; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--fg-faint); font-weight: 600;
}
.statusbar b { color: var(--fg-dim); font-weight: 800; }
.legend { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.legend i { display: inline-flex; align-items: center; gap: 7px; font-style: normal; }
.legend i s { width: 14px; height: 8px; border-radius: 2px; text-decoration: none; }

/* ============ CALENDAR ============ */
.cal { display: grid; grid-template-rows: 40px minmax(0, 1fr); height: 100%; overflow: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-dow span { display: grid; place-items: center; font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-faint); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(4, minmax(0, 1fr)); min-height: 0; overflow: hidden; }
.cal-cell {
  border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: 7px 7px 5px; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg); transition: background .12s;
}
.cal-cell.off { background: #05080e; }
.cal-cell.today { background: rgba(20,184,166,.07); box-shadow: inset 0 0 0 2px var(--teal); }
.cal-cell.dropzone { background: var(--teal-glow); box-shadow: inset 0 0 0 2px var(--teal); }
.cal-cell.dropbad { background: rgba(248,113,113,.14); box-shadow: inset 0 0 0 2px var(--bad); }
.cal-daynum { display: flex; align-items: baseline; gap: 8px; line-height: 1; padding-bottom: 1px; font-size: 19px; font-weight: 800; color: var(--fg-dim); }
.cal-cell.today .cal-daynum { color: var(--teal); }
.cal-daynum em { font-size: 12px; font-style: normal; font-weight: 700; color: var(--fg-faint); letter-spacing: .08em; text-transform: uppercase; }
.cal-load { margin-left: auto; font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 6px; }

.bar {
  display: flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 5px 10px; border-radius: 7px;
  font-size: 15px; font-weight: 700; line-height: 1.15;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: grab; touch-action: none;
}
.bar.static { cursor: pointer; }
.bar small { font-size: 12px; font-weight: 800; opacity: .72; }
.bar.hatch { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.22) 0 6px, transparent 6px 12px); }
.bar.dragging { opacity: .3; }
.bar .lock { font-size: 12px; opacity: .7; }
.cal-more { font-size: 13px; font-weight: 800; color: var(--fg-faint); padding-left: 4px; }

/* ============ CREW BOARD ============ */
.crewboard { display: grid; grid-template-columns: 268px 1fr; height: 100%; }
.pool {
  background: var(--surface); border-right: 1px solid var(--line);
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
}
.pool h3, .panelhead {
  margin: 0; padding: 14px 18px; font-size: 13px; font-weight: 900;
  letter-spacing: .14em; text-transform: uppercase; color: var(--fg-faint);
  border-bottom: 1px solid var(--line-soft);
}
.pool-list { overflow-y: auto; overscroll-behavior: contain; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.person {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 10px 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  cursor: grab; touch-action: none;
}
.person.dragging { opacity: .3; }
.person .av { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--fg-dim); display: grid; place-items: center; font-size: 13px; font-weight: 900; flex: none; }
.person > div:last-child { min-width: 0; }
.person b { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person span { display: block; font-size: 12px; color: var(--fg-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person.busy { opacity: .5; }
.person.busy .av { background: rgba(248,113,113,.2); color: var(--bad); }

.grid-scroll { overflow: auto; overscroll-behavior: contain; }
.cgrid { display: grid; min-width: 100%; }
.cgrid > .hcell {
  position: sticky; top: 0; z-index: 3;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 12px 14px; font-size: 15px; font-weight: 800; color: var(--fg-dim);
}
.cgrid > .hcell.today { color: var(--teal); }
.cgrid > .hcell em { display: block; font-style: normal; font-size: 12px; color: var(--fg-faint); letter-spacing: .1em; text-transform: uppercase; }
.cgrid > .rowhead {
  position: sticky; left: 0; z-index: 2;
  background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-soft);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
}
.cgrid > .rowhead.corner { z-index: 4; top: 0; position: sticky; }
.cgrid > .cell {
  border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: 8px; min-height: 92px; display: flex; flex-direction: column; gap: 6px;
}
.cgrid > .cell.weekend { background: #05080e; }
.cgrid > .cell.dropzone { background: var(--teal-glow); box-shadow: inset 0 0 0 2px var(--teal); }
.cgrid > .cell.dropbad { background: rgba(248,113,113,.14); box-shadow: inset 0 0 0 2px var(--bad); }
.cgrid > .cell.conflict { background: rgba(248,113,113,.10); }

.card {
  border-radius: 10px; padding: 9px 11px; cursor: grab; touch-action: none;
  border-left: 5px solid transparent; background: var(--surface-2);
  border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.card.dragging { opacity: .3; }
.card b { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; }
.card span { font-size: 12px; font-weight: 700; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .06em; }
.card .who-mini { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.card.warn { box-shadow: 0 0 0 2px var(--bad); }

/* ============ GANTT ============ */
.gantt { display: grid; grid-template-rows: 1fr 168px; height: 100%; }
.gantt-scroll { overflow: auto; overscroll-behavior: contain; padding-bottom: 14px; }
.grow { display: grid; grid-template-columns: 330px 1fr; border-bottom: 1px solid var(--line-soft); }
.grow.jobhead { background: var(--surface); position: sticky; z-index: 2; }
.glabel { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.glabel b { font-size: 16px; font-weight: 800; }
.glabel span { font-size: 12px; color: var(--fg-faint); font-weight: 800; letter-spacing: .08em; }
.glabel.sub { padding-left: 34px; background: var(--bg); }
.glabel.sub b { font-size: 15px; font-weight: 600; color: var(--fg-dim); }
.glabel > div { min-width: 0; }
.glabel b, .glabel span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtrack { position: relative; height: 56px; }
.gtrack.head { height: 44px; }
.gcolline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); }
.gcolline.wk { background: var(--line); }
.gcolline.today { background: var(--teal); width: 2px; box-shadow: 0 0 12px var(--teal); }
.gtick { position: absolute; top: 0; height: 44px; display: flex; flex-direction: column; justify-content: center; padding-left: 8px; font-size: 12px; font-weight: 800; color: var(--fg-faint); letter-spacing: .06em; }
.gtick b { font-size: 14px; color: var(--fg-dim); font-weight: 800; }
.gbar {
  position: absolute; top: 8px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  font-size: 14px; font-weight: 800; overflow: hidden; white-space: nowrap;
  cursor: grab; touch-action: none;
}
.gbar.dragging { opacity: .35; }
.gbar .grip { position: absolute; top: 0; bottom: 0; width: 22px; cursor: col-resize; touch-action: none; }
.gbar .grip.l { left: 0; } .gbar .grip.r { right: 0; }
.gbar .grip::after { content: ''; position: absolute; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: rgba(0,0,0,.35); }
.gbar .grip.l::after { left: 6px; } .gbar .grip.r::after { right: 6px; }
.gbar .pct { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.22); border-radius: 8px 0 0 8px; }
.gbar > * { position: relative; }

.heat { border-top: 1px solid var(--line); background: var(--surface); display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.heat-head { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
.heat-head h3 { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-faint); }
.heat-scale { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; color: var(--fg-faint); }
.heat-scale s { width: 26px; height: 12px; border-radius: 3px; text-decoration: none; }
.heat-body { display: grid; grid-template-columns: 330px 1fr; overflow: hidden; }
.heat-body .glabel { border-bottom: none; }
.heat-track { position: relative; overflow: hidden; }
.hcol { position: absolute; top: 8px; bottom: 8px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; gap: 3px; }
.hcol b { font-size: 15px; font-weight: 900; }
.hcol span { font-size: 11px; font-weight: 800; opacity: .8; }

/* ============ YARD ============ */
.yard { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.yard-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 16px 22px 6px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px; }
.kpi span { display: block; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-faint); }
.kpi b { display: block; font-size: 34px; font-weight: 900; letter-spacing: -.02em; margin-top: 4px; }
.kpi em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--fg-dim); }
.yard-list { overflow-y: auto; overscroll-behavior: contain; padding: 12px 22px 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-content: start; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--yard); border-radius: var(--r-lg); padding: 16px 18px; }
.ticket.archived { opacity: .55; border-left-color: var(--fg-faint); }
.ticket.ranch { border-left-color: var(--owner); }
.ticket-top { display: flex; align-items: center; gap: 12px; }
.ticket-top b { font-size: 21px; font-weight: 900; letter-spacing: -.01em; }
.ticket-top .pill { margin-left: auto; }
.ticket p { margin: 10px 0 12px; font-size: 15px; color: var(--fg-dim); line-height: 1.4; font-weight: 500; white-space: normal; }
.ticket-meta { display: flex; gap: 22px; margin-bottom: 12px; }
.ticket-meta div span { display: block; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-faint); }
.ticket-meta div b { font-size: 20px; font-weight: 800; }
.ticket-actions { display: flex; gap: 10px; }

/* ============ DETAIL SHEET ============ */
.scrim { position: absolute; inset: 0; background: rgba(3,6,12,.72); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: 520px; z-index: 41;
  background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.22,.61,.36,1);
  display: grid; grid-template-rows: auto 1fr auto;
}
.sheet.on { transform: none; }
.sheet-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line-soft); }
.sheet-head .eyebrow { font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-faint); }
.sheet-head h2 { margin: 6px 0 0; font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.field label { display: block; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg);
  font: inherit; font-size: 17px; font-weight: 600;
}
.field textarea { min-height: 84px; resize: none; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sheet-foot { display: flex; gap: 12px; padding: 18px 24px; border-top: 1px solid var(--line-soft); }
.sheet-foot .btn { flex: 1; }
.crewpick { display: flex; flex-wrap: wrap; gap: 9px; }

.note { font-size: 14px; line-height: 1.5; color: var(--fg-dim); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-weight: 500; }
.note.bad { border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.1); color: #fecaca; }

/* ============ TOASTS ============ */
.toasts { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; border-radius: var(--r-lg);
  background: var(--surface-3); border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  font-size: 17px; font-weight: 700; max-width: 900px;
  animation: rise .2s cubic-bezier(.22,.61,.36,1);
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.toast.bad { border-color: rgba(248,113,113,.6); background: #2a1418; }
.toast.good { border-color: rgba(52,211,153,.5); background: #0d2420; }
.toast .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; flex: none; }
.toast.bad .ic { background: var(--bad); color: #2a1418; }
.toast.good .ic { background: var(--ok); color: #06251f; }
.toast small { display: block; font-size: 14px; font-weight: 600; color: var(--fg-dim); margin-top: 2px; }

/* ============ DRAG GHOST ============ */
/* named .dragghost, not .ghost — .btn.ghost is the secondary button style */
.dragghost {
  position: fixed; z-index: 90; pointer-events: none;
  transform: translate(-50%, -50%) scale(1.04) rotate(-1.2deg);
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
  opacity: .96; border-radius: 10px; overflow: hidden;
}

/* empty state */
.empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--fg-faint); }
.empty b { font-size: 22px; font-weight: 800; color: var(--fg-dim); }
.empty span { font-size: 16px; font-weight: 600; }

/* ============ KIOSK VIEW ============ */
/* Chrome collapses so the board owns the full 75" panel; the toggle stays
   reachable as a floating corner button. */
body.kiosk .topbar, body.kiosk .filters, body.kiosk .connbar { display: none; }
body.kiosk .board { grid-template-rows: 0 0 76px 0 minmax(0, 1fr) 44px; }
body.kiosk .tabs { padding-top: 12px; }

/* --- yard ticket task rows --- */
.ytasks { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.ytask {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 0 14px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--fg); font: inherit; cursor: pointer;
}
.ytask i { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--fg-faint); }
.ytask span { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ytask em { flex: none; font-size: 13px; font-weight: 700; color: var(--fg-faint); font-style: normal; }
.ytask.st-in_progress i { border-color: var(--task); background: color-mix(in srgb, var(--task) 45%, transparent); }
.ytask.st-done i { border-color: var(--ok); background: var(--ok); }
.ytask.st-done .ytask-main span { color: var(--fg-dim); text-decoration: line-through; text-decoration-color: var(--fg-faint); }
.ytask.muted { cursor: default; color: var(--fg-faint); font-size: 14px; font-weight: 600; justify-content: flex-start; }

/* --- yard task assignment --- */
.ytask { flex-wrap: wrap; padding: 8px 12px; gap: 10px; cursor: default; }
.ytask.unassigned { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.ytask-main {
  display: flex; align-items: center; gap: 12px; flex: 1 1 240px; min-width: 0;
  background: none; border: 0; padding: 6px 0; color: inherit; font: inherit;
  text-align: left; cursor: pointer;
}
.ytask-main span { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ytask-main .tstat { flex: none; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); }
.ytask-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 0 12px 0 4px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--fg); cursor: pointer;
}
.who.static { cursor: default; }
.who-av {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal); color: #0b0f16; font-size: 12px; font-weight: 900; letter-spacing: .02em;
}
.assign-btn {
  min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 800;
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  border: 1px dashed color-mix(in srgb, var(--warn) 65%, transparent);
  color: var(--warn); cursor: pointer;
}
.assign-btn.sm { padding: 0 14px; background: none; border-style: solid; border-color: var(--line); color: var(--fg-faint); }
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pick {
  display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--fg); font: inherit; text-align: left; cursor: pointer;
}
.pick[aria-pressed="true"] { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 18%, var(--surface-2)); }
.pick.blocked { opacity: .45; cursor: not-allowed; }
.pick.blocked .who-av { background: var(--fg-faint); }
.pick-txt { display: flex; flex-direction: column; min-width: 0; }
.pick-txt b { font-size: 15px; font-weight: 800; }
.pick-txt em { font-size: 12px; font-style: normal; font-weight: 700; color: var(--fg-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Sign-in gate

   Covers the entire board until real rows arrive. Sized for a 75" panel read
   from across a conference room: the title carries at distance, and the button
   is a comfortable touch target for someone standing at the screen.

   Rendered visible by default in index.html and lifted only by app.js, so a
   failed script load cannot expose an empty board.
   ============================================================ */
.gate {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 48px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(20, 184, 166, 0.10), transparent 60%),
    var(--bg);
}
.gate[hidden] { display: none; }

.gate-card {
  width: min(760px, 100%);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.gate-mark { width: 76px; height: 76px; border-radius: 17px; }

.gate-title {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 50px);
  font-weight: 900; letter-spacing: -0.025em; line-height: 1.1;
  color: var(--fg);
  text-wrap: balance;
}
.gate-body {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(16px, 1.35vw, 21px); line-height: 1.55;
  color: var(--fg-dim);
  text-wrap: pretty;
}
.gate-body b { color: var(--fg); font-weight: 800; }

.gate.bad .gate-title { color: var(--bad); }

.gate-btn {
  margin-top: 6px;
  min-height: 62px; padding: 0 40px;
  font-size: 20px; font-weight: 800;
}
.gate-btn[hidden] { display: none; }

/* Three dots rather than a ring: it reads as "waiting on someone else" instead
   of "this page is busy", which is what is actually true here. */
.gate-spin { display: flex; gap: 10px; margin-top: 4px; }
.gate-spin[hidden] { display: none; }
.gate-spin i {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--teal);
  animation: gatepulse 1.25s ease-in-out infinite;
}
.gate-spin i:nth-child(2) { animation-delay: 0.16s; }
.gate-spin i:nth-child(3) { animation-delay: 0.32s; }
@keyframes gatepulse {
  0%, 70%, 100% { opacity: 0.22; transform: scale(0.82); }
  35%           { opacity: 1;    transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .gate-spin i { animation: none; opacity: 0.6; }
}

.envpill[hidden] { display: none; }
