/* ============================================================================
 * NexxeN Boardroom — joshuaaah.com color bible re-theme (2026-11-03)
 * White-dominant base, deep purple brand/structural chrome, teal interactive/
 * active states, silver dividers, orange reserved as a sparing spotlight.
 * Source of truth: memory/feedback_joshuaaah_color_bible.md — same tokens as
 * the joshuaaah.com hub (X:\WebSites\www.joshuaaah.com\styles.css).
 *
 * The round boardroom table keeps its illustrative wood/felt surface — that's
 * this app's centerpiece visual, not "chrome" — but every seat label that
 * floats directly over the wood uses a dedicated light overlay-text color so
 * it stays legible now that the surrounding page went white. Per-provider
 * avatar colors (PROVIDER_COLORS in app.js) are functional and untouched.
 * ========================================================================== */
:root {
  /* canonical Dark Obsidian Cerebrum / theCortex tokens */
  --jx-bg:             #06090d;
  --jx-surface:        #0b111b;
  --jx-surface-alt:    #0f172a;
  --jx-primary:        #080d14;
  --jx-primary-hover:  #162033;
  --jx-primary-deep:   #05080c;
  --jx-accent:         #38bdf8;
  --jx-accent-hover:   #7dd3fc;
  --jx-accent-text:    #7dd3fc;
  --jx-text:           #e6eef8;
  --jx-text-secondary: #94a3b8;
  --jx-border:         rgba(148, 163, 184, 0.18);
  --jx-success:        #34d399;
  --jx-warning:        #fbbf24;
  --jx-spotlight:      #fb923c;
  --jx-spotlight-hover:#fdba74;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --font-sans: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;

  /* legacy names used throughout this file, mapped onto the tokens above */
  --bg:          var(--jx-bg);
  --panel-bg:    var(--jx-surface);
  --panel-border: var(--jx-border);
  --text:        var(--jx-text);
  --text-dim:    var(--jx-text-secondary);
  --accent:      var(--jx-accent);      /* fills / borders / focus rings (3:1) */
  --accent-text: var(--jx-accent-text); /* teal used as literal foreground text (4.5:1) */
  --ok:   var(--jx-success);
  --warn: var(--jx-warning);
  --bad:  #DC2626;

  /* the wood boardroom table keeps its own illustrative palette */
  --wood-dark: #2c1c12;
  --wood-mid: #4a2f1d;
  --wood-light: #6b4327;
  --resin: #3a6b7a;
  --resin-light: #6fb8c9;

  /* seat labels float directly on the wood table, not on a white panel —
     they need light text regardless of the app's otherwise-light theme */
  --table-overlay-text: #FFFFFF;
  --table-overlay-text-dim: rgba(255,255,255,0.74);

  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
body { min-height: 100vh; }
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
code { background: var(--jx-surface-alt); color: var(--text); padding: 2px 6px; border-radius: var(--radius-sm); }

/* ===================== AUTH ===================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-card {
  background: linear-gradient(165deg, var(--jx-surface-alt), #ffffff);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(26,6,51,0.12);
  padding: 28px;
  max-width: 420px;
  width: 100%;
}
.auth-card h1 { margin: 0 0 4px; font-size: 1.4rem; color: var(--jx-primary); }
.glyph { font-family: Georgia, serif; }
.auth-sub { color: var(--text-dim); margin: 0 0 18px; font-size: 0.9rem; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--text-dim); }
.auth-form input {
  background: #ffffff; border: 1px solid var(--panel-border); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 0.95rem;
}
.auth-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-form button {
  margin-top: 4px; background: var(--jx-primary); border: none; color: #ffffff;
  font-weight: 600; border-radius: var(--radius-sm); padding: 10px; font-size: 0.95rem;
}
.auth-form button:hover { background: var(--jx-primary-hover); }
.auth-bootstrap { color: var(--text-dim); font-size: 0.85rem; margin-top: 8px; }
.auth-bootstrap summary { cursor: pointer; padding: 4px 0; }
.auth-error { color: var(--bad); min-height: 1.2em; font-size: 0.85rem; }
.auth-hint { color: var(--text-dim); font-size: 0.75rem; }

/* ===================== LAYOUT SHELL ===================== */
.boardroom {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.boardroom-topbar {
  display: flex; align-items: center; justify-content: space-between;
  --topbar-pad-y: 10px; --topbar-pad-x: 16px;
  padding: calc(var(--topbar-pad-y) + env(safe-area-inset-top, 0px)) calc(var(--topbar-pad-x) + env(safe-area-inset-right, 0px)) var(--topbar-pad-y) calc(var(--topbar-pad-x) + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(255,255,255,0.14);
  background: var(--jx-primary); color: #ffffff;
  flex-wrap: wrap; gap: 8px;
  position: sticky; top: 0; z-index: 50;
}
.boardroom-topbar h1 { margin: 0; font-size: 1.1rem; color: #ffffff; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fixture-toggle, .sign-out {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.38); color: #ffffff;
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.8rem;
}
.fixture-toggle:hover, .sign-out:hover { background: rgba(255,255,255,0.24); }
.session-name { color: rgba(255,255,255,0.78); font-size: 0.8rem; }

/* ===================== TABLE ===================== */
.table-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 420px;
}
.table-surface {
  position: relative;
  width: min(900px, 94vw);
  height: min(620px, 72vh);
  border-radius: 50% / 46%;
  background:
    repeating-linear-gradient(100deg, rgba(0,0,0,0.08) 0 2px, transparent 2px 7px),
    radial-gradient(ellipse at 30% 25%, var(--wood-light) 0%, var(--wood-mid) 45%, var(--wood-dark) 100%);
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.55),
    inset 0 0 2px rgba(255,255,255,0.08),
    0 18px 40px rgba(43,31,20,0.35);
  border: 6px solid #1c120b;
}
.table-river {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    118deg,
    transparent 0%, transparent 38%,
    rgba(58,107,122,0.0) 38%,
    var(--resin) 44%,
    var(--resin-light) 50%,
    var(--resin) 56%,
    rgba(58,107,122,0.0) 62%, transparent 62%, transparent 100%
  );
  mix-blend-mode: normal;
  opacity: 0.9;
  filter: blur(0.3px);
  pointer-events: none;
}
.table-river::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(118deg, transparent 46%, rgba(255,255,255,0.18) 50%, transparent 54%);
  pointer-events: none;
}

.seats-layer { position: absolute; inset: 0; }

/* ===================== SEAT ===================== */
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 180px;
  gap: 6px;
}
.seat-avatar-row { position: relative; display: flex; align-items: center; justify-content: center; }
.seat-avatar {
  /* background assigned per-provider in app.js (colorFor) — functional, not themed here */
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; color: #0e1116;
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.badge-clearance {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  font-size: 0.55rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 999px; white-space: nowrap;
  border: 1px solid rgba(0,0,0,0.35);
  color: #0e1116;
}
.badge-clearance.live { background: var(--ok); }
.badge-clearance.offline { background: var(--text-dim); color: #ffffff; }
.badge-clearance.error { background: var(--bad); color: #fff; }

.badge-subagents {
  position: absolute; top: -5px; right: -5px;
  font-size: 0.55rem; min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 999px; background: #ffffff; border: 1px solid var(--panel-border);
  color: var(--text-dim); display: flex; align-items: center; justify-content: center;
  opacity: 0.9;
}

/* Traffic-light: real signal derived from this session's actual call outcomes for the seat —
   gray = no call made yet this session, yellow = in flight (or completed but slow), green = last
   call completed promptly, red = last call failed / not configured. Never defaults to green. */
.traffic-light {
  position: absolute; top: -5px; left: -5px; width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.4); background: #555;
}
.traffic-light.tl-none { background: #555; }
.traffic-light.tl-yellow { background: var(--warn); box-shadow: 0 0 5px var(--warn); }
.traffic-light.tl-green { background: var(--ok); box-shadow: 0 0 5px var(--ok); }
.traffic-light.tl-red { background: var(--bad); box-shadow: 0 0 5px var(--bad); }

.seat-name { font-size: 0.78rem; font-weight: 600; text-align: center; color: var(--table-overlay-text); }
.seat-task-tag {
  font-size: 0.62rem; color: var(--table-overlay-text-dim); text-align: center; font-style: italic;
  min-height: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.seat-status { font-size: 0.65rem; color: var(--table-overlay-text-dim); min-height: 1em; }
.seat-efficiency { font-size: 0.6rem; color: var(--table-overlay-text-dim); opacity: 0.8; min-height: 1em; }

.seat-panel {
  width: 180px;
  height: 128px;
  background: linear-gradient(165deg, var(--jx-surface-alt), #ffffff);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(43,31,20,0.25);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px;
  font-size: 0.72rem;
  line-height: 1.35;
  scroll-behavior: auto;
}
.seat-panel.scroll-paused { border-color: var(--warn); }
.seat-msg { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; }
.seat-msg.from-user { color: var(--accent-text); }
.seat-msg.from-provider { color: var(--text); }
.seat-msg.status-failed { color: var(--bad); }
.seat-msg.status-not_configured { color: var(--text-dim); font-style: italic; }
.seat-msg.status-running { color: var(--text-dim); font-style: italic; }
.scroll-pause-note {
  position: sticky; bottom: 0; background: rgba(217,119,6,0.12);
  color: var(--warn); font-size: 0.6rem; text-align: center; border-radius: 4px;
  padding: 1px 0; margin-top: 2px;
}

/* ===================== JOSH SEAT ===================== */
.josh-seat {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--panel-border); background: var(--panel-bg);
}
.josh-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent); color: #0e1116; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.prompt-form { flex: 1 1 auto; display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
#prompt-input {
  flex: 1 1 260px; min-width: 0; resize: vertical;
  background: #ffffff; border: 1px solid var(--panel-border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 1rem; line-height: 1.45; font-family: inherit;
  min-height: 6rem; max-height: 45vh;
}
#prompt-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.prompt-actions { display: flex; gap: 8px; align-items: center; }
#provider-filter {
  background: #ffffff; border: 1px solid var(--panel-border); color: var(--text);
  border-radius: var(--radius-sm); font-size: 0.7rem; max-width: 160px; height: 44px;
}
#send-button {
  background: var(--accent); color: #0e1116; border: none; font-weight: 600;
  border-radius: var(--radius-sm); padding: 10px 16px; font-size: 0.9rem;
}
#send-button:hover:not(:disabled) { background: var(--jx-accent-hover); }
#send-button:disabled { opacity: 0.5; cursor: default; }

/* ===================== FIXTURES (calendar / projector) ===================== */
.fixture {
  position: fixed; top: 60px; right: 12px; z-index: 40;
  width: min(320px, 90vw); max-height: 70vh;
  background: linear-gradient(165deg, var(--jx-surface-alt), #ffffff);
  border: 1px solid var(--panel-border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(26,6,51,0.22); display: flex; flex-direction: column; overflow: hidden;
}
.projector-fixture { top: auto; bottom: 90px; right: 12px; }
.fixture-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--panel-border); font-size: 0.85rem;
}
.fixture-close { background: none; border: none; color: var(--text-dim); font-size: 1rem; }
.calendar-body, .projector-body { padding: 10px; overflow-y: auto; }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 0.68rem; text-align: center;
}
.calendar-grid .cal-head { color: var(--text-dim); font-weight: 600; padding-bottom: 4px; }
.calendar-grid .cal-day {
  padding: 6px 2px; border-radius: 4px; background: var(--jx-surface-alt); color: var(--text-dim); min-height: 1.4em;
}
.calendar-grid .cal-day.today { outline: 1px solid var(--accent); color: var(--text); }
.calendar-grid .cal-day.empty { background: transparent; }
.fixture-status { color: var(--text-dim); font-size: 0.72rem; margin: 8px 0 0; }
.projector-screen {
  background: #000; border: 2px solid #333; border-radius: var(--radius-sm); aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center;
  color: var(--table-overlay-text-dim); font-size: 0.72rem; overflow: hidden;
}
.projector-image { width: 100%; height: 100%; object-fit: contain; }
.projector-form { display: flex; gap: 6px; margin-top: 8px; }
.projector-form input {
  flex: 1 1 auto; background: #ffffff; border: 1px solid var(--panel-border); color: var(--text);
  border-radius: var(--radius-sm); padding: 6px 8px; font-size: 0.78rem;
}
.projector-form button {
  background: var(--accent); color: #0e1116; border: none; border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.78rem;
}
#projector-clear { background: #ffffff; color: var(--text); border: 1px solid var(--panel-border); }

/* ===================== NARROW / PHONE LAYOUT ===================== */
@media (max-width: 760px) {
  .table-surface { display: none; } /* overhead-table view doesn't reflow sensibly this narrow */
  .table-wrap { padding: 8px; min-height: 0; }
  .boardroom.stacked .seats-layer-stacked {
    display: flex; flex-direction: column; gap: 10px; padding: 8px 10px 4px; width: 100%;
  }
  .seat.stacked-seat {
    position: static; transform: none; width: 100%; flex-direction: row; align-items: flex-start;
    gap: 10px;
  }
  /* The stacked phone layout has no wood table underneath, so seat labels
     need to read against the page's white background instead of the
     table-overlay light color used in the overhead view. */
  .seat.stacked-seat .seat-name { color: var(--text); }
  .seat.stacked-seat .seat-task-tag,
  .seat.stacked-seat .seat-status,
  .seat.stacked-seat .seat-efficiency { color: var(--text-dim); }
  .seat.stacked-seat .seat-avatar-row { flex: 0 0 auto; }
  .seat.stacked-seat .seat-text-col { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .seat.stacked-seat .seat-panel { width: 100%; height: 110px; }
  .fixture { right: 50%; transform: translateX(50%); top: 56px; }
  .projector-fixture { bottom: 96px; }
  #provider-filter { max-width: 110px; }

  /* With up to 8 stacked seat panels, the page can run well past one screen tall — pin Josh's own
     input to the bottom of the viewport so he never has to scroll past every seat just to type,
     per the brief's "bottom-center seat" requirement actually being reachable on a phone. */
  .josh-seat {
    position: sticky; bottom: 0; z-index: 30;
    box-shadow: 0 -8px 16px rgba(43,31,20,0.18);
  }
}

.google-signin { display:flex; justify-content:center; margin: 8px 0; min-height: 44px; }
.google-or { text-align:center; margin: 4px 0 8px; }

/* ---- Group room panel (NEX-006) ---- */
.room-panel { position: fixed; z-index: 40; top: 56px; right: 0; bottom: 0; width: min(560px, 100vw); display: flex; flex-direction: column;
  background: var(--jx-bg); border-left: 1px solid var(--jx-border); box-shadow: -8px 0 24px rgba(15,3,32,.18); }
.room-panel.hidden { display: none; }
.room-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--jx-border); background: var(--jx-surface); }
.room-head strong { color: var(--jx-primary); }
.room-tunnels {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: #06090d;
  flex: 0 0 auto;
}
.room-tunnels::-webkit-scrollbar { display: none; }
.room-tunnel-btn {
  --tunnel-accent: #F2F6FC;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe4f0;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
.tunnel-dm {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tunnel-accent) 18%, #0b1017);
  color: var(--tunnel-accent);
  line-height: 1.25;
}
.room-tunnel-btn[data-theme="antigravity"] { --tunnel-accent: #F2F6FC; }
.room-tunnel-btn[data-theme="claude"] { --tunnel-accent: #FF7A1A; }
.room-tunnel-btn[data-theme="codex"] { --tunnel-accent: #00A8FF; }
.room-tunnel-btn[data-theme="nexx"] { --tunnel-accent: #00A8FF; }
.room-tunnel-btn[data-theme="council"] { --tunnel-accent: #F2F6FC; padding-left: 10px; }
.room-tunnel-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--tunnel-accent) 65%, transparent);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.room-tunnel-btn.active {
  border-color: var(--tunnel-accent);
  background: color-mix(in srgb, var(--tunnel-accent) 16%, #0b1017);
  color: #ffffff;
  box-shadow: 0 0 14px color-mix(in srgb, var(--tunnel-accent) 32%, transparent);
}
.room-tunnel-btn[data-theme="nexx"].active {
  border-color: #00A8FF;
  background: linear-gradient(120deg, rgba(0, 168, 255, 0.2), rgba(242, 246, 252, 0.1), rgba(255, 122, 26, 0.2));
  box-shadow: -4px 0 14px rgba(0, 168, 255, 0.28), 4px 0 14px rgba(255, 122, 26, 0.28);
}
.room-tunnel-btn:disabled { opacity: 0.6; cursor: wait; }
.tunnel-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 16%;
  background: #06090d;
  border: 1.5px solid color-mix(in srgb, var(--tunnel-accent) 65%, transparent);
  flex: 0 0 24px;
}
.room-tunnel-btn[data-theme="nexx"] .tunnel-avatar {
  border-color: #00A8FF;
  box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.6);
}
.tunnel-glyph {
  font-size: 0.95rem;
  line-height: 1;
  color: #F2F6FC;
}
.tunnel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  background: #ff3b4f;
  box-shadow: 0 0 7px rgba(255, 59, 79, 0.75);
}
.room-tunnel-btn[data-led-state="offline"] .tunnel-dot,
.room-tunnel-btn[data-status="standby"] .tunnel-dot {
  background: #ff3b4f;
  box-shadow: 0 0 7px rgba(255, 59, 79, 0.75);
}
.room-tunnel-btn[data-status="online"] .tunnel-dot,
.room-tunnel-btn[data-status="thinking"] .tunnel-dot,
.room-tunnel-btn[data-led-state="ready"] .tunnel-dot {
  background: #1a9fff;
  box-shadow: 0 0 7px rgba(26, 159, 255, 0.8);
}
.room-tunnel-btn.active[data-status="online"] .tunnel-dot,
.room-tunnel-btn.active[data-status="thinking"] .tunnel-dot,
.room-tunnel-btn[data-led-state="selected"] .tunnel-dot {
  background: #2bff88;
  box-shadow: 0 0 8px rgba(43, 255, 136, 0.85);
}
.room-tunnel-btn[data-status="thinking"] .tunnel-dot {
  animation: tunnel-dot-pulse 1.1s ease-in-out infinite;
}
@keyframes tunnel-dot-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.65; }
  50% { transform: scale(1.35); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .room-tunnel-btn, .room-tunnel-btn[data-status="thinking"] .tunnel-dot { animation: none; transition: none; }
}
.room-status { flex: 1; font-size: .78rem; color: #92400E; }
.room-pause { font-size: .78rem; }
.room-members { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--jx-border); }
.room-chip { border: 1px solid var(--jx-border); background: var(--jx-surface); color: var(--jx-text); border-radius: 999px; padding: 3px 10px; font-size: .78rem; cursor: pointer; }
.room-chip::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #ff3b4f; box-shadow: 0 0 6px rgba(255, 59, 79, 0.7); }
.room-chip.presence-online::before, .room-chip.presence-busy::before { background: #1a9fff; box-shadow: 0 0 6px rgba(26, 159, 255, 0.75); }
.room-chip.presence-online.picked::before, .room-chip.presence-busy.picked::before { background: #2bff88; box-shadow: 0 0 7px rgba(43, 255, 136, 0.8); }
.room-chip.presence-degraded::before, .room-chip.presence-offline::before { background: #ff3b4f; box-shadow: 0 0 6px rgba(255, 59, 79, 0.7); }
.room-chip.picked { border-color: var(--jx-accent); background: var(--jx-accent); color: #fff; }
.room-chip:disabled { cursor: default; }
.room-paused { padding: 8px 12px; background: #FEF3C7; color: #78350F; font-size: .8rem; }
.room-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.room-msg { background: var(--jx-surface); border: 1px solid var(--jx-border); border-radius: 10px; padding: 10px 12px; max-width: 94%; align-self: flex-start; }
.room-msg.mine { align-self: flex-end; background: var(--jx-surface-alt); }
.room-msg-head { display: flex; gap: 8px; align-items: baseline; font-size: .78rem; color: var(--jx-text-secondary); }
.room-msg-head strong { color: var(--jx-primary); }
.room-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; color: var(--jx-text); font-size: 1rem; line-height: 1.5; }
.room-typing { min-height: 1.2em; padding: 0 12px; font-size: .78rem; color: var(--jx-text-secondary); font-style: italic; }
.room-form { border-top: 1px solid var(--jx-border); padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 6px; }
.room-form textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 6.5rem; max-height: 45vh; padding: 10px 12px; font-size: 1rem; line-height: 1.45; font-family: inherit; }
.room-form button[type=submit] { padding: 8px 20px; font-size: 1rem; }
.room-panel.expanded { left: 0; width: auto; border-left: 0; }
.room-panel.expanded .room-messages, .room-panel.expanded .room-form, .room-panel.expanded .room-members { width: min(1000px, 100%); box-sizing: border-box; margin-left: auto; margin-right: auto; }
.room-panel.expanded .room-msg { max-width: 80%; }
.room-form-row { display: flex; align-items: center; gap: 10px; }
.room-to { flex: 1; font-size: .78rem; color: var(--jx-text-secondary); }
.room-to-warn { color: var(--jx-warning); font-weight: 600; }
.room-rounds { font-size: .78rem; color: var(--jx-text-secondary); }
@media (max-width: 600px) {
  /* phone: the room is a full-screen sheet above the top bar, sized to the visible viewport so the keyboard never hides the composer */
  .room-panel { top: 0; bottom: auto; height: 100vh; height: 100dvh; left: 0; right: 0; width: auto; max-width: 100%; box-sizing: border-box; z-index: 60; border-left: 0; }
  .room-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .room-head button { min-height: 40px; padding: 0 12px; font-size: .9rem; }
  .room-chip { padding: 6px 12px; font-size: .85rem; }
  #room-expand { display: none; }   /* the sheet is already full screen on a phone */
  #room-close { min-width: 44px; min-height: 44px; font-size: 1.6rem; line-height: 1; }
  .room-form button[type=submit] { min-height: 44px; }
  .room-panel.expanded .room-messages, .room-panel.expanded .room-form, .room-panel.expanded .room-members { width: 100%; }
}

/* ---- NEX-014: the legacy provider table and fan-out composer are never shown ---- */
.table-wrap, .josh-seat { display: none !important; }

/* ---- NEX-013: the group chat is the Boardroom home screen ---- */
/* Keep the normal transcript scroller; short viewports can also scroll the shell
   when the fixed-height controls are taller than the available space. */
.boardroom.view-chat { height: 100vh; height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.boardroom.view-chat .table-wrap, .boardroom.view-chat .josh-seat { display: none; }
.boardroom.view-seats .room-panel { display: none; }
.room-panel.home { position: static; z-index: auto; flex: 1 1 auto; min-height: 0; width: 100%; max-width: 1000px; margin: 0 auto;
  border-left: 1px solid var(--jx-border); border-right: 1px solid var(--jx-border); box-shadow: none; }
.room-panel.home .room-head #room-close, .room-panel.home .room-head #room-expand { display: none; }
.room-panel.home .room-messages { padding: 14px; }
.room-panel.home .room-msg { max-width: 86%; }
@media (max-width: 600px) {
  .boardroom-topbar { --topbar-pad-y: 6px; --topbar-pad-x: 12px; gap: 6px; }
  .boardroom-topbar h1 { font-size: 1rem; }
  .boardroom-topbar .session-name { display: none; }
  .boardroom-topbar .fixture-toggle, .boardroom-topbar .sign-out { padding: 6px 8px; font-size: .75rem; }
  /* home layout overrides the full-screen overlay sheet above: the chat sits under the top bar and fills the rest */
  .room-panel.home { position: static; height: auto; width: 100%; left: auto; right: auto; border-left: 0; border-right: 0; }
  .room-panel.home .room-head { padding-top: 10px; }
  .room-panel.home .room-msg { max-width: 94%; }
}
.room-earlier { padding: 0 12px 4px; font-size: .78rem; color: var(--jx-text-secondary); }
.room-earlier summary { cursor: pointer; padding: 2px 0; }
.room-earlier-row { padding: 2px 0; opacity: .85; }

/* NEX-013 phone density: one-row top bar, one-line scrolling recipients, shorter composer, so the chat gets most of a 640 px screen */
@media (max-width: 600px) {
  .boardroom-topbar h1 { display: none; }
  .boardroom-topbar { justify-content: flex-end; --topbar-pad-y: 6px; --topbar-pad-x: 10px; }
  .boardroom-topbar .topbar-actions { width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 4px; }
  .boardroom-topbar .fixture-toggle, .boardroom-topbar .sign-out { padding: 6px 6px; font-size: .72rem; white-space: nowrap; }
  .room-panel.home .room-head { padding: 6px 10px; }
  .room-panel.home .room-head strong { font-size: .95rem; }
  .room-panel.home .room-members { flex-wrap: nowrap; overflow-x: auto; padding: 6px 10px; gap: 6px; }
  .room-panel.home .room-chip { flex: 0 0 auto; white-space: nowrap; padding: 4px 10px; }
  .room-panel.home .room-form { padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 4px; }
  .room-panel.home .room-form textarea { min-height: 3.4rem; max-height: 30vh; padding: 8px 10px; }
  .room-panel.home .room-form button[type=submit] { padding: 6px 16px; min-height: 40px; }
  .room-panel.home .room-form-row { gap: 6px; }
}
@media (max-height: 700px) { .room-panel.home .room-form textarea { min-height: 3.4rem; } }

.room-msg.flash { outline: 3px solid var(--jx-accent); outline-offset: 2px; }

/* Shared review links keep the conversation open and wrap on phones. */
.message-link { color: #126e70; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.message-link:visited { color: #663d85; }
.message-link:focus-visible, .links-panel button:focus-visible { outline: 3px solid #13898b; outline-offset: 3px; }
.links-panel { width: min(860px, calc(100vw - 24px)); max-height: 85dvh; padding: 24px; border: 1px solid #d8cfdf; border-radius: 14px; color: #251437; background: #fffefa; box-sizing: border-box; }
.links-panel::backdrop { background: #25143799; }
.links-panel header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.links-panel h2 { margin: 0; font: 600 1.7rem 'Space Grotesk', sans-serif; }
.links-panel button { min-height: 40px; padding: 8px 12px; border: 1px solid #d7cde0; border-radius: 7px; background: white; color: #3b1f6b; cursor: pointer; }
.links-panel > p { color: #61546a; line-height: 1.5; }
.links-list section { margin-top: 24px; }
.links-list h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.links-list article { padding: 14px 0; border-top: 1px solid #e5dfe9; overflow-wrap: anywhere; }
.links-list article a { font-size: 1.05rem; font-weight: 600; display: inline-block; padding: 4px 0; }
.links-list small { display: block; margin-top: 5px; color: #71617d; }
.links-list p { line-height: 1.5; margin: 8px 0 0; }
@media (max-width: 600px) { .links-panel { padding: 18px; } .topbar-actions { flex-wrap: wrap !important; } }

.app-update { flex: 0 0 auto; position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; background: #eee7f8; color: #3b1f6b; border-bottom: 1px solid #c8b7df; font-size: 14px; }
.app-update[hidden] { display: none; }
.app-update button { min-height: 44px; padding: 8px 16px; border: 0; border-radius: 8px; background: #3b1f6b; color: white; font: inherit; font-weight: 600; cursor: pointer; }
.app-update button:focus-visible { outline: 3px solid #007e86; outline-offset: 3px; }

.room-message-actions { display: flex; align-items: center; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.room-message-actions button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; border: 0; border-radius: 6px; background: transparent; color: #68577d; cursor: pointer; }
.room-message-actions button:hover, .room-message-actions button:focus-visible { background: #ede5f8; color: #3b1f6b; }
.room-message-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.room-action-status { font-size: 12px; color: #68577d; }
.room-copy-buffer { position: fixed; left: -10000px; top: 0; }
.voice-waiting .room-msg-body, .voice-waiting .room-message-actions { display: none; }
.room-voice-pending { padding: 8px 0; color: #68577d; font-size: 14px; }
#room-clear-recipients { border: 0; padding: 4px 8px; background: transparent; color: #68577d; font-size: 12px; cursor: pointer; }
#room-clear-recipients[hidden] { display: none; }
@media (pointer: coarse) { .room-message-actions button { width: 44px; height: 44px; } #room-clear-recipients { min-height: 44px; } }
