/* Buddy Rooms 0.21.145 · owner-locked room visual choices B/B/B.
   Scope: narrow workspace stage geometry, ORATOR AI speech CTA density, quiet chat system events.
   Inherits 0.21.144 WAT/tongue arbitration and all 0.21.140 R6/collapse/native panel behavior. */

/* B · When a work panel is open on phone/tablet, keep the camera stage fully visible above it.
   The panel is normal document flow, not a bottom-sheet overlay. Closing the panel automatically
   falls back to the existing full-stage rules because every selector is workspace-panel-open scoped. */
@media(max-width:900px){
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open #roomShell{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    gap:0!important;
    height:max-content!important;
    min-height:0!important;
    max-height:none!important;
    flex:0 0 auto!important;
    align-content:start!important;
    overflow:visible!important;
    resize:none!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .room-main{
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:16/9!important;
    justify-self:center!important;
    align-self:start!important;
    overflow:hidden!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .video-grid{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    padding:0!important;
    overflow:hidden!important;
    align-content:stretch!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .video-grid:not(.focus-mode){
    grid-auto-rows:minmax(0,1fr)!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .video-grid>.participant-tile{
    min-height:0!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .participant-tile video{
    object-fit:contain!important;
    object-position:center center!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .mobile-panel-resizer{
    display:none!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .workspace-panel{
    display:flex!important;
    position:relative!important;
    z-index:auto!important;
    inset:auto!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    height:clamp(480px,72dvh,680px)!important;
    min-width:0!important;
    min-height:480px!important;
    max-width:none!important;
    max-height:none!important;
    margin:0!important;
    border-radius:18px!important;
    border-width:1px!important;
    padding-bottom:0!important;
    box-shadow:var(--edge)!important;
  }
  /* Keep the approved Collapse C strip, but do not inherit bottom-sheet-only drag padding/air. */
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .workspace-panel::before{
    display:none!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .workspace-panel-topbar{
    padding:20px 7px 0!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open #workspaceMobileNav{
    gap:4px!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open #workspaceMobileNav .workspace-panel-tabs{
    gap:4px!important;
    padding:3px!important;
  }
  html[data-theme][data-buddy-room-view="active"] #roomView.room.workspace-panel-open .workspace-tool-slot{
    margin:0!important;
    padding:0!important;
  }
}

/* B · Make the speech action discoverable: four equal compact period buttons + one real text CTA. */
@media(max-width:680px){
  html[data-theme][data-buddy-room-view="active"] #aiAssistantPanel .speech-toolbar{
    grid-template-columns:minmax(0,1fr) clamp(152px,42vw,168px)!important;
    gap:7px!important;
    align-items:stretch!important;
  }
  html[data-theme][data-buddy-room-view="active"] #aiAssistantPanel .speech-history-modes{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:4px!important;
  }
  html[data-theme][data-buddy-room-view="active"] #aiAssistantPanel .speech-history-modes>button{
    width:100%!important;
    min-width:0!important;
    padding-inline:4px!important;
    font-size:10px!important;
  }
  html[data-theme][data-buddy-room-view="active"] #aiSpeechRecordBtn.speech-record-button{
    display:inline-flex!important;
    width:100%!important;
    min-width:152px!important;
    height:40px!important;
    min-height:40px!important;
    padding:0 10px!important;
    gap:6px!important;
    font-size:12px!important;
    font-weight:800!important;
    place-items:unset!important;
    align-items:center!important;
    justify-content:center!important;
  }
  html[data-theme][data-buddy-room-view="active"] #aiSpeechRecordBtn.speech-record-button>span{
    display:inline-block!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  html[data-theme][data-buddy-room-view="active"] #aiSpeechRecordBtn.speech-record-button svg{
    flex:0 0 18px!important;
    width:18px!important;
    height:18px!important;
    margin:0!important;
  }
}
@media(max-width:380px){
  html[data-theme][data-buddy-room-view="active"] #aiAssistantPanel .speech-toolbar{
    grid-template-columns:minmax(0,1fr) 148px!important;
    gap:5px!important;
  }
  html[data-theme][data-buddy-room-view="active"] #aiAssistantPanel .speech-history-modes{gap:3px!important}
  html[data-theme][data-buddy-room-view="active"] #aiAssistantPanel .speech-history-modes>button{padding-inline:2px!important;font-size:9px!important}
  html[data-theme][data-buddy-room-view="active"] #aiSpeechRecordBtn.speech-record-button{min-width:148px!important;padding-inline:7px!important;font-size:11px!important}
}

/* B · Human chat stays visually dominant. Only whitelisted debate milestones are projected,
   as small narrative rows rather than full chat bubbles. */
html[data-theme][data-buddy-room-view="active"] #chatMessages .debate-chat-projection{
  width:auto!important;
  max-width:100%!important;
  margin:3px 5px!important;
  padding:0!important;
  border:0!important;
  border-left:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--muted)!important;
  opacity:.74!important;
}
html[data-theme][data-buddy-room-view="active"] #chatMessages .debate-chat-projection .chat-message-body{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  min-width:0!important;
  padding:0!important;
}
html[data-theme][data-buddy-room-view="active"] #chatMessages .debate-chat-projection :is(strong,p){
  margin:0!important;
  font-size:9px!important;
  line-height:1.35!important;
  font-weight:650!important;
  color:inherit!important;
}
html[data-theme][data-buddy-room-view="active"] #chatMessages .debate-chat-projection strong::after{
  content:"·";
  margin-left:6px;
  opacity:.62;
}
html[data-theme][data-buddy-room-view="active"] #chatMessages .debate-chat-projection p{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
