/* Cabarrus Interpreter / Dispatch role switch (Oct 29 2026, Jeremy). cabarrus.html only.
   Same idea as CMC: a chooser after the PIN door, Interpreter → tap your name → your own page.
   Dispatch = the full monitor, unchanged. Cards reuse .gate / .gate-card so all three themes style them. */

/* ---------- chooser + name picker ---------- */
.cab-role-gate.hidden { display: none !important; }
.cab-role-card { width: min(440px, 100%); text-align: center; }
.cab-role-card.cab-name-card { width: min(620px, 100%); }
.cab-role-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
html body .cab-role-btns .btn.cab-role-btn {
  width: 100%; min-height: 68px; height: auto; padding: 12px 18px; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 14px; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.cab-role-t { font: 700 17px/1.2 Outfit, system-ui, sans-serif; }
.cab-role-d { font: 500 12.5px/1.3 Outfit, system-ui, sans-serif; opacity: .82; }
html body .cab-role-btns .btn.cab-role-interp {
  background: rgba(232,121,249,.08); color: var(--fg); border: 1px solid rgba(232,121,249,.38);
  box-shadow: none;
}
html body .cab-role-btns .btn.cab-role-interp:hover { background: rgba(232,121,249,.16); }
.cab-role-btn:focus-visible { outline: 2px solid #E2B65C; outline-offset: 3px; }
.cab-role-foot { margin: 16px 0 0 !important; font-size: 12.5px !important; }

.cab-name-find {
  width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 14px; margin: 2px 0 12px;
  border-radius: 12px; font-size: 15px; border: 1px solid rgba(232,121,249,.28);
  background: rgba(0,0,0,.35); color: var(--fg);
}
.cab-name-find:focus { outline: none; border-color: rgba(226,182,92,.8); box-shadow: 0 0 0 3px rgba(226,182,92,.22); }
.cab-name-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px;
  max-height: min(52vh, 440px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; text-align: left;
}
.cab-name-btn {
  -webkit-appearance: none; appearance: none; min-height: 50px; padding: 8px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--fg); cursor: pointer;
  font: 600 14.5px/1.25 Outfit, system-ui, sans-serif; text-align: left; transition: background .15s, border-color .15s;
}
.cab-name-btn:hover { border-color: rgba(226,182,92,.7); background: rgba(226,182,92,.10); }
.cab-name-btn:focus-visible { outline: 2px solid #E2B65C; outline-offset: 2px; }
.cab-name-btn.is-sel { border-color: #E2B65C; box-shadow: inset 0 0 0 1px #E2B65C; }
.cab-name-btn[hidden] { display: none; }
.cab-name-none { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13.5px; padding: 14px 0; }
html body .btn.cab-name-back { width: 100%; margin-top: 14px; min-height: 46px; }

/* ---------- header: Switch + role pill ---------- */
.cab-switch-btn.hidden, .cab-role-pill.hidden { display: none !important; }
.cab-role-pill {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; white-space: nowrap;
  font: 700 12px/1 Outfit, system-ui, sans-serif; padding: 7px 12px; border-radius: 999px;
  border: 1px solid rgba(226,182,92,.55); background: rgba(226,182,92,.14); color: #F6E7C6;
}
.cab-role-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #E2B65C; }

/* ---------- interpreter page: "My status" card ---------- */
.cab-me-card.hidden { display: none !important; }
html body .panel.cab-me-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 22px;
  margin: 0 0 16px; padding: 18px 22px;
  border: 1.5px solid rgba(226,182,92,.65);
  background: linear-gradient(120deg, rgba(226,182,92,.16), rgba(232,121,249,.08) 55%, var(--card));
  box-shadow: 0 0 0 4px rgba(226,182,92,.10), 0 10px 34px rgba(0,0,0,.22);
}
.cab-me-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cab-me-kicker { font: 700 11px/1 Outfit, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #E2B65C; }
html body .cab-me-card h2.cab-me-name { margin: 2px 0 0; font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; }
.cab-me-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.cab-me-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.cab-me-card[data-st="available"] .cab-me-state::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.22); }
.cab-me-card[data-st="busy"] .cab-me-state::before { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.22); }
.cab-me-card[data-st="stale"] .cab-me-state::before { background: #f59e0b; }
.cab-me-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.28); }
.cab-me-tog {
  -webkit-appearance: none; appearance: none; border: 0; margin: 0; cursor: pointer;
  min-height: 52px; min-width: 128px; padding: 0 22px; border-radius: 999px;
  font: 700 16px/1 Outfit, system-ui, sans-serif; color: var(--muted); background: transparent;
  transition: background .18s, color .18s, box-shadow .18s;
}
.cab-me-tog:hover { color: var(--fg); background: rgba(255,255,255,.07); }
.cab-me-tog:focus-visible { outline: 2px solid #E2B65C; outline-offset: 2px; }
.cab-me-tog:disabled { cursor: progress; opacity: .7; }
.cab-me-tog-available[aria-pressed="true"] { background: #16A34A; color: #fff; box-shadow: 0 2px 10px rgba(22,163,74,.4); }
.cab-me-tog-busy[aria-pressed="true"] { background: #DC2626; color: #fff; box-shadow: 0 2px 10px rgba(220,38,38,.4); }
/* your own row in Interpreters today */
.lais-st-row.cab-is-me { box-shadow: inset 3px 0 0 #E2B65C; background: rgba(226,182,92,.10); }

/* ---------- interpreter page: show only My status, Interpreters today, Team chat, New case ---------- */
html.cab-interp-mode body #cabStrip,
html.cab-interp-mode body .cab-totals-panel,
html.cab-interp-mode body .cab-pending-panel,
html.cab-interp-mode body #eodPanel,
html.cab-interp-mode body #stoplightPanel,
html.cab-interp-mode body .cases-panel,
html.cab-interp-mode body .cab-interp-hide,
html.cab-interp-mode body #app .top-actions a[href*="map=1"],
html.cab-interp-mode body #app .top-actions a[href*="cabarrus-manager"] { display: none !important; }

/* Jeremy 10:30: Team chat comes FIRST for interpreters — leftmost column on wide screens, top section on phones.
   >=1200px: Team chat | My status + Interpreters today | New case.  861–1199px: Team chat | status, then New case.
   Phones/tablets (stacked): Team chat → My status + Interpreters today → New case. */
html.cab-interp-mode body .layout.cab-3col > .cab-chat-panel { order: 1; }
html.cab-interp-mode body .layout.cab-3col > .cab-avail-panel { order: 2; display: block !important; }
html.cab-interp-mode body .layout.cab-3col > .cab-newcase-panel { order: 3; }
html.cab-interp-mode body .cab-avail-panel > .panel.cab-me-card { margin: 0 0 16px; }
html.cab-interp-mode body .cab-avail-panel > .lais-st { margin-top: 0; padding-top: 0; }
@media (min-width: 861px) {
  html.cab-interp-mode body .layout.cab-3col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; }
  html.cab-interp-mode body .layout.cab-3col > .cab-chat-panel {
    grid-column: 1; grid-row: 1 / span 2; align-self: start; height: clamp(560px, calc(100vh - 150px), 880px);
    position: sticky; top: 12px; display: flex; flex-direction: column; min-height: 0; margin-top: 0;
  }
  html.cab-interp-mode body .layout.cab-3col > .cab-avail-panel { grid-column: 2; grid-row: 1; margin-top: 0; }
  html.cab-interp-mode body .layout.cab-3col > .cab-newcase-panel { grid-column: 2; grid-row: 2; }
  html.cab-interp-mode body .layout.cab-3col > .cab-avail-panel .lais-st-list { max-height: 320px; overflow-y: auto; }
  html.cab-interp-mode body .layout.cab-3col > .cab-chat-panel .cab-chat-list { flex: 1 1 0; height: auto; min-height: 200px; }
}
@media (min-width: 1200px) {
  html.cab-interp-mode body .layout.cab-3col {
    --cabi-h: clamp(560px, calc(100vh - 150px), 880px);
    grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto;
  }
  html.cab-interp-mode body .layout.cab-3col > .cab-chat-panel,
  html.cab-interp-mode body .layout.cab-3col > .cab-avail-panel {
    grid-row: 1; align-self: start; height: var(--cabi-h); min-height: 0; overflow: hidden;
    display: flex !important; flex-direction: column; margin-top: 0; position: sticky; top: 12px;
  }
  html.cab-interp-mode body .layout.cab-3col > .cab-chat-panel { grid-column: 1; }
  html.cab-interp-mode body .layout.cab-3col > .cab-avail-panel { grid-column: 2; }
  html.cab-interp-mode body .layout.cab-3col > .cab-newcase-panel { grid-column: 3; grid-row: 1; }
  html.cab-interp-mode body .layout.cab-3col > .cab-avail-panel > .panel.cab-me-card { flex: 0 0 auto; }
  html.cab-interp-mode body .layout.cab-3col > .cab-avail-panel > .lais-st { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  html.cab-interp-mode body .layout.cab-3col > .cab-avail-panel .lais-st-list { flex: 1 1 0; min-height: 0; max-height: none; align-content: start; }
  html.cab-interp-mode body .layout.cab-3col .lais-st-has-toggle .lais-st-since { display: none; }
  html.cab-interp-mode body .layout.cab-3col .lais-st-has-toggle .lais-st-name { flex-basis: 84px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.cab-interp-mode body .layout.cab-3col .lais-st-toggle button { min-width: 62px; padding: 0 9px; }
  /* My status inside the narrower middle column: name on top, the big switch full width under it */
  html.cab-interp-mode body .cab-avail-panel .cab-me-toggle { width: 100%; }
  html.cab-interp-mode body .cab-avail-panel .cab-me-tog { flex: 1 1 0; min-width: 0; }
}
@media (min-width: 1600px) {
  html.cab-interp-mode body .layout.cab-3col .lais-st-has-toggle .lais-st-since { display: inline; }
}
@media (max-width: 860px) {
  html.cab-interp-mode body .layout.cab-3col > .cab-chat-panel .cab-chat-list { height: 46vh; min-height: 260px; }
  html body .panel.cab-me-card { padding: 16px; }
  html body .cab-me-card h2.cab-me-name { font-size: 20px; }
  .cab-me-toggle { width: 100%; }
  .cab-me-tog { flex: 1 1 0; min-width: 0; min-height: 50px; font-size: 15.5px; padding: 0 10px; }
}
@media (max-width: 420px) {
  .cab-name-grid { grid-template-columns: 1fr 1fr; }
  .cab-name-btn { font-size: 14px; padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) { .cab-me-tog, .cab-name-btn { transition: none; } }

/* ---------- Maroon + Enterprise (light themes) ---------- */
html[data-theme="maroon"] body .cab-role-btns .btn.cab-role-interp,
html[data-theme="enterprise"] body .cab-role-btns .btn.cab-role-interp {
  background: #fff !important; color: var(--q-ink) !important; border: 1.5px solid var(--q-maroon) !important; box-shadow: none !important;
}
html[data-theme="maroon"] body .cab-role-btns .btn.cab-role-interp:hover { background: #FBF3F6 !important; }
html[data-theme="enterprise"] body .cab-role-btns .btn.cab-role-interp:hover { background: #EEF4F9 !important; }
html[data-theme="maroon"] .cab-name-find, html[data-theme="enterprise"] .cab-name-find { background: #fff; color: var(--q-ink); border-color: #CFC3C8; }
html[data-theme="enterprise"] .cab-name-find { border-color: #C4CFDB; }
html[data-theme="maroon"] .cab-name-btn, html[data-theme="enterprise"] .cab-name-btn { background: #fff; color: var(--q-ink); border-color: var(--q-line); }
html[data-theme="maroon"] .cab-name-btn:hover { background: #FBF3F6; border-color: var(--q-maroon); }
html[data-theme="enterprise"] .cab-name-btn:hover { background: #EEF4F9; border-color: var(--q-maroon); }
html[data-theme="maroon"] .cab-name-btn.is-sel, html[data-theme="enterprise"] .cab-name-btn.is-sel { border-color: var(--q-maroon); box-shadow: inset 0 0 0 1px var(--q-maroon); }
html[data-theme="maroon"] .cab-role-pill, html[data-theme="enterprise"] .cab-role-pill { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.55); color: #fff; }
html[data-theme="maroon"] .cab-role-pill::before, html[data-theme="enterprise"] .cab-role-pill::before { background: var(--q-gold); }
html[data-theme="maroon"] body .panel.cab-me-card {
  background: linear-gradient(120deg, #FBF1DE, #FFFFFF 62%) !important; border: 1.5px solid var(--q-gold) !important;
  border-left: 6px solid var(--q-maroon) !important; box-shadow: 0 6px 22px rgba(92,6,50,.10) !important;
}
html[data-theme="enterprise"] body .panel.cab-me-card {
  background: linear-gradient(120deg, #E8F1F8, #FFFFFF 62%) !important; border: 1.5px solid #9DB7CC !important;
  border-left: 6px solid var(--q-maroon) !important; box-shadow: 0 6px 22px rgba(15,53,80,.10) !important;
}
html[data-theme="maroon"] .cab-me-kicker { color: var(--q-maroon); }
html[data-theme="enterprise"] .cab-me-kicker { color: #1A6E8E; }
html[data-theme="maroon"] .cab-me-state, html[data-theme="enterprise"] .cab-me-state { color: var(--q-muted, #405068); }
html[data-theme="maroon"] .cab-me-toggle { background: #F6F3F1; border-color: #DDD3CF; }
html[data-theme="enterprise"] .cab-me-toggle { background: #F2F5F9; border-color: #CBD5E1; }
html[data-theme="maroon"] .cab-me-tog { color: #5E5459; }
html[data-theme="enterprise"] .cab-me-tog { color: #405068; }
html[data-theme="maroon"] .cab-me-tog:hover, html[data-theme="enterprise"] .cab-me-tog:hover { color: #1F1A1D; background: rgba(0,0,0,.05); }
html[data-theme="maroon"] .cab-me-tog-available[aria-pressed="true"], html[data-theme="enterprise"] .cab-me-tog-available[aria-pressed="true"] { background: #15803D; color: #fff; }
html[data-theme="maroon"] .cab-me-tog-busy[aria-pressed="true"], html[data-theme="enterprise"] .cab-me-tog-busy[aria-pressed="true"] { background: #B91C1C; color: #fff; }
html[data-theme="maroon"] .lais-st-row.cab-is-me { box-shadow: inset 4px 0 0 var(--q-maroon); background: #FBF1DE; }
html[data-theme="enterprise"] .lais-st-row.cab-is-me { box-shadow: inset 4px 0 0 var(--q-maroon); background: #E8F1F8; }
