/* PREVIEW (Oct 22 2026) — CMC Dispatch Hub layout + Interpreter availability colours.
   Row 1 (monitors >=1100px): 1 Incoming requests · 2 Waiting for an interpreter · 3 Interpreter availability.
   Row 2: Live updates · On the way or with a patient · Team chat.
   861–1099px: Incoming full width, then Waiting | Availability. Phones: one column, flow order.
   Colours (Jeremy): green = available, amber = on a case, grey = lunch / not in. Scoped to CMC ids only. */

/* ---------- layout ---------- */
#dispatchPanel .cmc-flow { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
#dispatchPanel .cmc-flow > .panel { margin: 0 !important; min-width: 0; }
@media (min-width: 861px) {
  #dispatchPanel .cmc-flow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #dispatchPanel .cmc-flow > .dispatch-paste-panel { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  #dispatchPanel .cmc-flow { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); }
  #dispatchPanel .cmc-flow > .dispatch-paste-panel { grid-column: auto; }
  #dispatchPanel .dispatch-grid.cmc-board { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; }
  #dispatchPanel .dispatch-grid.cmc-board { align-items: start; }
  #dispatchPanel .dispatch-grid.cmc-board > .panel { grid-row: auto; align-self: start; margin-top: 0 !important; }
  #dispatchPanel .dispatch-grid.cmc-board > .cmc-chat-panel { position: sticky; top: 16px; }
}
/* the chat card sits in the board grid; keep its own look but grid spacing */
#dispatchPanel .dispatch-grid.cmc-board > .cmc-chat-panel { margin-top: 0; display: flex; flex-direction: column; min-height: 0; }
#dispatchPanel .cmc-chat-panel .cab-chat-list { flex: 1 1 auto; min-height: 220px; max-height: 420px; }
#dispatchPanel .cmc-chat-panel .cab-chat-form { margin-top: 12px; }

/* Waiting + Availability cards: same density as the board cards */
#dispatchPanel .cmc-flow > .cmc-waiting-panel,
#dispatchPanel .cmc-flow > .cmc-avail-panel { padding: 18px 16px 16px; display: flex; flex-direction: column; }
#dispatchPanel .cmc-avail-panel .lais-st { margin-top: 0; padding-top: 0; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#dispatchPanel .cmc-avail-panel .lais-st-head { margin: 0 0 10px; }
#dispatchPanel .cmc-avail-panel .lais-st-head h2 { margin: 0; }
#dispatchPanel .cmc-avail-panel .lais-st-list { max-height: 440px; }

/* submit row (replaces the removed "Send to an interpreter working today" picker) */
#dispatchPanel .dispatch-submit-row { display: flex; justify-content: flex-end; margin-top: 14px; }

/* strip spacing inside the hub */
#dispatchPanel > .lais-strip { margin: 0 0 14px !important; }

/* ---------- colours: amber "on a case" + grey lunch (Classic / dark) ---------- */
#cmcAvail .lais-st-busy, #cmcStrip .lais-st-busy {
  --st-rail: #f59e0b; --st-ink: #fcd34d; --st-tint: rgba(245,158,11,.16);
  --st-pill-bg: rgba(245,158,11,.18); --st-pill-ink: #fde68a; --st-pill-line: rgba(252,211,77,.5); }
#cmcAvail .lais-st-lunch { --st-pill-bg: rgba(148,163,184,.16); }
#cmcAvail .lais-st-lunch .lais-st-text, #cmcAvail .lais-st-none .lais-st-text, #cmcAvail .lais-st-stale .lais-st-text { font-weight: 500; }
#cmcAvail .lais-st-available .lais-st-dot, #cmcAvail .lais-st-busy .lais-st-dot { box-shadow: 0 0 0 3px var(--st-tint); }

/* Maroon + Enterprise (light) */
html[data-theme="maroon"] #cmcAvail .lais-st-busy, html[data-theme="enterprise"] #cmcAvail .lais-st-busy,
html[data-theme="maroon"] #cmcStrip .lais-st-busy, html[data-theme="enterprise"] #cmcStrip .lais-st-busy {
  --st-rail: #D97706; --st-ink: #92400E; --st-tint: rgba(217,119,6,.12);
  --st-pill-bg: #FEF3C7; --st-pill-ink: #78350F; --st-pill-line: #FCD34D; }

/* legend */
.cmc-av-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 2px 0; font-size: 11.5px; color: var(--muted); }
.cmc-av-legend .k { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cmc-av-legend .k::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #9CA3AF; }
.cmc-av-legend .k.av::before { background: #22c55e; }
.cmc-av-legend .k.busy::before { background: #f59e0b; }
.cmc-av-note { flex-basis: 100%; opacity: .9; }
html[data-theme="maroon"] .cmc-av-legend { color: #6B4A57; }
html[data-theme="enterprise"] .cmc-av-legend { color: #4A5F75; }
html[data-theme="maroon"] .cmc-av-legend .k.av::before, html[data-theme="enterprise"] .cmc-av-legend .k.av::before { background: #16A34A; }
html[data-theme="maroon"] .cmc-av-legend .k.busy::before, html[data-theme="enterprise"] .cmc-av-legend .k.busy::before { background: #D97706; }

/* Desktop: show the whole CMC roster (19) without an inner scroll. */
@media (min-width: 1100px) {
  #dispatchPanel .cmc-avail-panel .lais-st-list { max-height: 720px; }
}
