/* Beta Lab — multi-agent rooms */
#betaPanel .apps-sheet {
  display: flex;
  flex-direction: column;
  height: min(92vh, 860px);
  max-height: min(92vh, 860px);
  width: min(1100px, 100%);
}
#betaCollab {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#betaCollab[hidden] { display: none !important; }

.beta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(14,165,233,.18);
  flex-wrap: wrap;
}
.beta-top .beta-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-right: auto;
}
.beta-top button {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.beta-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.beta-side {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid rgba(14,165,233,.15);
  display: flex;
  flex-direction: column;
  background: rgba(248,250,252,.9);
  min-height: 0;
}
.beta-side-h {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.beta-room-list {
  flex: 1;
  overflow: auto;
  padding: 4px 8px 10px;
}
.beta-room-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 4px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.beta-room-item.on {
  background: #e0f2fe;
  border-color: rgba(14,165,233,.35);
  color: #0369a1;
}
.beta-room-item .sub {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 2px;
}

.beta-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.beta-room-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
  flex-wrap: wrap;
}
.beta-room-bar strong { font-size: 14px; }
.beta-room-bar .ghost.danger { color: #b91c1c; }

.beta-speakers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 12px 8px;
  align-items: center;
}
.beta-speakers .lbl {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  margin-right: 4px;
}
.beta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(14,165,233,.3);
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px 3px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.beta-chip input { accent-color: #0ea5e9; margin: 0; }
.beta-chip .av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
}
.beta-chip.off { opacity: .45; }

.beta-thread {
  flex: 1;
  overflow: auto;
  padding: 12px;
  min-height: 160px;
  background: #f8fafc;
  border-radius: 8px;
  margin: 0 12px;
}
.beta-msg {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 92%;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
}
.beta-msg.user {
  background: #e0f2fe;
  margin-left: auto;
}
.beta-msg.bot {
  background: #fff;
  border: 1px solid #e2e8f0;
}
.beta-msg .who {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 700;
}
.beta-msg .who .av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
}
.beta-msg.pending { opacity: .7; font-style: italic; }

.beta-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  align-items: flex-end;
}
.beta-compose textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  resize: vertical;
  font: inherit;
}
.beta-status {
  padding: 0 12px 8px;
  font-size: 11px;
  color: #0369a1;
  min-height: 16px;
}

/* Agent drawer */
.beta-drawer {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(8, 30, 50, 0.35);
  display: flex;
  justify-content: flex-end;
}
.beta-drawer[hidden] { display: none !important; }
.beta-drawer-sheet {
  width: min(380px, 100%);
  height: 100%;
  background: #f8fbff;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(2,80,140,.18);
}
.beta-drawer-head {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(14,165,233,.15);
  font-weight: 800;
}
.beta-drawer-head button { margin-left: auto; }
.beta-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
}
.beta-agent-card {
  border: 1px solid rgba(14,165,233,.2);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
}
.beta-agent-card .row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.beta-agent-card .av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}
.beta-agent-card .meta { flex: 1; min-width: 0; }
.beta-agent-card .meta strong { display: block; font-size: 13px; }
.beta-agent-card .meta span { font-size: 11px; color: #64748b; }
.beta-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 8px 0 4px;
  color: #334155;
}
.beta-form input,
.beta-form textarea,
.beta-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
}
.beta-form textarea { min-height: 100px; resize: vertical; }
.beta-form .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.beta-form .chk {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
}

/* Room create modal (inline) */
.beta-room-form {
  padding: 10px;
  border-top: 1px solid rgba(14,165,233,.12);
}
.beta-room-form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font: inherit;
}
.beta-member-checks {
  max-height: 120px;
  overflow: auto;
  font-size: 12px;
}
.beta-member-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
  cursor: pointer;
}

#betaPanel .beta-paywall {
  padding: 16px;
  max-width: 420px;
  margin: 0 auto;
}
#betaPanel .beta-paywall h3 { margin: 0 0 8px; }
#betaPanel .beta-paywall .pay-qr {
  display: block;
  max-width: 220px;
  margin: 12px auto;
  border-radius: 8px;
}

/* Mobile */
@media (max-width: 720px) {
  #betaPanel .apps-sheet {
    height: min(96vh, 100dvh - 12px);
    max-height: min(96vh, 100dvh - 12px);
    border-radius: 14px;
  }
  .beta-body { flex-direction: column; }
  .beta-side {
    width: 100%;
    max-height: 120px;
    border-right: none;
    border-bottom: 1px solid rgba(14,165,233,.15);
  }
  .beta-room-list {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 8px 8px;
  }
  .beta-room-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 110px;
    margin: 0;
  }
  .beta-drawer-sheet { width: min(100%, 100vw); }
  .beta-msg { max-width: 98%; }
}
html[data-theme="neo"] .beta-side {
  background: rgba(24, 18, 48, 0.85);
}
html[data-theme="neo"] .beta-thread {
  background: rgba(18, 14, 36, 0.65);
}
html[data-theme="neo"] .beta-msg.bot {
  background: rgba(36, 28, 72, 0.9);
  border-color: rgba(167, 139, 250, 0.35);
  color: #f5f3ff;
}
html[data-theme="neo"] .beta-msg.user {
  background: rgba(56, 40, 110, 0.9);
  color: #e0e7ff;
}
html[data-theme="neo"] .beta-room-item { color: #e2e8f0; }
html[data-theme="neo"] .beta-room-item.on {
  background: rgba(76, 29, 149, 0.55);
  border-color: rgba(167, 139, 250, 0.5);
  color: #ddd6fe;
}
html[data-theme="neo"] .beta-drawer-sheet { background: #1a1430; color: #f5f3ff; }
html[data-theme="neo"] .beta-agent-card { background: rgba(36,28,72,.9); color: #f5f3ff; }

/* BETA_LAYOUT_V20261016a */
#betaCollab {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#betaCollab[hidden] {
  display: none !important;
}
#betaPanel .apps-sheet {
  height: min(92vh, 860px);
}
