/* Buddy Rooms 0.21.140 · control-pass popup parity over owner-approved unified surfaces.
   Inherits 0.21.138 panel geometry parity, docked composer placement, and responsive Together policy.
   Inherits owner-selected collapse C and stable Rooms R6 typography from 0.21.137.
   Loaded after the shared R6 component on purpose: this is Rooms-only layout policy,
   not a mutation of the approved segmented animation engine. */
html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip{display:none}
html[data-theme][data-buddy-room-view="active"] #chatStatus:empty{display:none!important}

@media(max-width:1359px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel [data-orator-segmented="rooms-panel"].orator-segmented :is(.os-button,.os-label-copy),
  html[data-theme][data-buddy-room-view="active"] #participantPanel #participantMobileToolTabs.orator-segmented :is(.os-button,.os-label-copy),
  html[data-theme][data-buddy-room-view="active"] #workspaceMobileNav #workspaceMobileRoomTabs.orator-segmented :is(.os-button,.os-label-copy),
  html[data-theme][data-buddy-room-view="active"] #workspaceMobileNav #workspaceMobileToolTabs.orator-segmented :is(.os-button,.os-label-copy){
    font-size:13px!important;font-weight:700!important;line-height:1.2!important;letter-spacing:normal!important
  }
}

@media(max-width:760px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-actions{display:none!important}
  html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-nav-stack{width:100%!important}
  html[data-theme][data-buddy-room-view="active"] :is(#participantPanel .panel-topbar,.room.workspace-panel-open .workspace-panel-topbar){
    position:relative!important;padding:22px 8px 8px!important;min-height:0!important
  }
  html[data-theme][data-buddy-room-view="active"] :is(.participant-panel,.room.workspace-panel-open .workspace-panel)::before{display:none!important}
  html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip{
    position:absolute!important;z-index:7!important;top:-1px!important;left:50%!important;transform:translateX(-50%)!important;
    width:102px!important;height:20px!important;min-height:20px!important;margin:0!important;padding:0 9px!important;
    display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;
    border:1px solid color-mix(in srgb,var(--line-strong) 78%,transparent)!important;border-top:0!important;
    border-radius:0 0 9px 9px!important;background:color-mix(in srgb,var(--room-inset) 94%,var(--accent) 2%)!important;
    color:var(--muted-strong)!important;box-shadow:0 5px 14px rgba(0,0,0,.13),inset 0 1px rgba(255,255,255,.025)!important;
    font-family:inherit!important;font-size:9px!important;font-weight:700!important;line-height:1!important;letter-spacing:.015em!important;
    cursor:pointer!important;-webkit-tap-highlight-color:transparent!important;transition:color .16s ease,border-color .16s ease,background .16s ease!important
  }
  html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip-chevron{font-size:11px!important;line-height:1!important;transform:translateY(-1px);opacity:.72}
  html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip:hover,
  html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip:focus-visible{
    color:var(--accent)!important;border-color:color-mix(in srgb,var(--accent) 42%,var(--line))!important;background:color-mix(in srgb,var(--room-inset) 90%,var(--accent) 6%)!important
  }
  html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip:focus-visible{outline:2px solid var(--segmented-focus)!important;outline-offset:2px!important}
  html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip:active{top:0!important}
}


/* 0.21.138 · stable room-panel geometry. Navigation owns the whole top row;
   the single global action cluster follows the active room content header. */
html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-nav-stack{width:100%!important;min-width:0!important;flex:1 1 auto!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-topbar{display:block!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .participant-panel-head-meta{margin-left:auto;display:flex;align-items:center;justify-content:flex-end;gap:7px;min-width:0;flex:0 0 auto}
html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex:0 0 auto;padding:0!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-actions .icon-button{width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;border-radius:10px!important;flex:0 0 34px!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-actions .icon-button svg{width:18px!important;height:18px!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-head{min-height:34px;align-items:center!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-head>div{min-width:0}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-head .panel-actions{margin-left:auto}

/* Keep workspace navigation in row 1 and every active tool in row 2. If the
   topbar is hidden, row 1 collapses and Support/AI/Transcript still fill the panel. */
html[data-theme][data-buddy-room-view="active"] #workspacePanelTopbar{grid-row:1}
html[data-theme][data-buddy-room-view="active"] #workspacePanel>.workspace-tool-slot{grid-row:2;min-height:0;height:100%}

/* Together is desktop-only. Narrow mobile/tablet surfaces expose Participants + Chat. */
@media(max-width:900px){
  html[data-theme][data-buddy-room-view="active"] #hybridTabBtn,
  html[data-theme][data-buddy-room-view="active"] #workspaceMobileTogetherTabBtn{display:none!important}
}

/* Broaden only the owner-selected collapse C tap target; height/type stay intact. */
@media(max-width:760px){
  html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip{width:132px!important}
  html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-actions{display:none!important}
}

/* 0.21.138 control-pass corrective: beat legacy important rules without touching shared R6. */
@media(max-width:900px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel #hybridTabBtn,
  html[data-theme][data-buddy-room-view="active"] #participantPanel.panel-fullscreen #hybridTabBtn,
  html[data-theme][data-buddy-room-view="active"] #workspaceMobileNav #workspaceMobileTogetherTabBtn{display:none!important}
}

/* The old 64px dock-clearance spacer belonged to an earlier centered-dock layout.
   Docked Support now owns a side/workspace slot, so its composer can sit on the real bottom edge. */
html[data-theme][data-buddy-room-view="active"] #supportPanel.is-docked::after{content:none!important;display:none!important;min-height:0!important;flex-basis:0!important}

/* Chat uses the same header action language as Support/AI. Legacy chat CSS hid all header icon buttons. */
@media(min-width:901px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel #participantPanelActions :is(#panelDetachBtn,#panelCloseBtn){display:grid!important;place-items:center!important}
}
@media(min-width:761px) and (max-width:900px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel #participantPanelActions #panelCloseBtn{display:grid!important;place-items:center!important}
}
/* `.chat-head > div` is a legacy column rule; action host must stay horizontal like Support/AI. */
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-head>#participantPanelActions{flex-direction:row!important;align-items:center!important;width:auto!important;height:34px!important;gap:6px!important}

/* Keep the room sheet and workspace sheet on the same side-column contract while tools are open. */
@media(min-width:901px) and (max-width:1359px){
  html[data-theme][data-buddy-room-view="active"] .room.workspace-tools-available:not(.workspace-panel-open):not(.transcript-panel-open) .room-shell{
    grid-template-columns:minmax(0,1fr) minmax(310px,370px)!important
  }
}
@media(min-width:761px) and (max-width:900px){
  html[data-theme][data-buddy-room-view="active"] .room.workspace-panel-open .workspace-panel{
    left:6px!important;right:6px!important
  }
}


/* Buddy Rooms 0.21.139 · owner-approved Patch86 A + unified panel/popout/fullscreen surfaces.
   Shared R6 segmented assets are intentionally untouched. */

/* Patch86 owner-selected A: one compact content header, darker navigation material,
   fewer decorative separators, and Support-like anchored composer grammar. */
html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-topbar{
  background:var(--panel)!important;border-bottom:0!important;padding-bottom:7px!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-tabs.orator-segmented{
  border:1px solid var(--line)!important;border-radius:12px!important;
  background:color-mix(in srgb,var(--room-inset) 90%,#000 10%)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.018)!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel .participant-panel-head{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:7px!important;
  min-height:42px!important;padding:6px 12px 5px!important;border-bottom:0!important;background:var(--panel)!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel .participant-panel-head>div:first-child{
  display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;
  gap:0!important;min-width:auto!important;flex:0 0 auto!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel .participant-panel-head>div:first-child small{display:none!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .participant-panel-head>div:first-child b{font-size:12px!important;line-height:1!important;white-space:nowrap!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .participant-panel-head-meta{
  display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;
  gap:6px!important;align-self:center!important;flex:1 1 auto!important;margin-left:0!important;min-width:0!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel #participantCount{
  display:inline-flex!important;align-items:center!important;align-self:center!important;white-space:nowrap!important;
  min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;
  background:transparent!important;color:var(--muted-strong)!important;font-size:10px!important;font-weight:750!important;
  line-height:12px!important;box-shadow:none!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel .participant-panel-head-meta .panel-actions{margin-left:auto!important;align-self:center!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel :is(.participants-pane,.chat-panel){background:var(--room-section)!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .participants-pane{padding-top:5px!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel #participantList{padding-top:2px!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-head{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;
  min-height:42px!important;padding:6px 12px 5px!important;border-bottom:0!important;background:var(--panel)!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-head>div{display:flex!important;flex-direction:row!important;align-items:center!important;min-width:0!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-head b{font-size:12px!important;line-height:1!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-head>#participantPanelActions{margin-left:auto!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-panel{
  padding:0!important;gap:0!important;grid-template-rows:auto auto minmax(0,1fr) auto auto!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-history-controls{
  padding:5px 12px!important;background:var(--panel)!important;border:0!important;box-shadow:none!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel .chat-messages{
  padding:10px 12px!important;background:color-mix(in srgb,var(--room-inset) 46%,transparent)!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel #chatForm{
  margin:0!important;padding:10px 12px 8px!important;border-top:1px solid var(--line)!important;background:var(--panel)!important
}
html[data-theme][data-buddy-room-view="active"] #participantPanel #chatStatus:empty{display:none!important}
html[data-theme][data-buddy-room-view="active"] #participantPanel #chatStatus{margin:0!important;padding:0 12px 9px!important;background:var(--panel)!important}

/* One expand action, two platform contracts: browser popup on desktop, in-page fullscreen on <=900px. */
html[data-theme][data-buddy-room-view="active"] #participantPanel #panelFullscreenBtn{display:none!important}
@media(max-width:900px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel :is(.participant-panel-head,.chat-head){min-height:40px!important;padding:5px 10px!important}
  html[data-theme][data-buddy-room-view="active"] #participantPanel .panel-actions{display:flex!important}
  html[data-theme][data-buddy-room-view="active"] #participantPanel #panelDetachBtn{display:grid!important;place-items:center!important}
  html[data-theme][data-buddy-room-view="active"] #participantPanel #panelFullscreenBtn{display:none!important}
}
@media(max-width:760px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel #panelCloseBtn{display:none!important}
}

/* Room Chat/Participants fullscreen on phone + tablet. Together remains hidden by 0.21.138 policy. */
@media(max-width:900px){
  html[data-theme][data-buddy-room-view="active"] .room.panel-fullscreen .participant-panel,
  html[data-theme][data-buddy-room-view="active"] .room.panel-fullscreen .room.panel-closed .participant-panel{
    display:grid!important;position:fixed!important;z-index:96!important;inset:0!important;
    width:100%!important;height:var(--app-viewport-height,100dvh)!important;max-width:none!important;max-height:none!important;
    min-width:0!important;min-height:0!important;margin:0!important;transform:none!important;visibility:visible!important;opacity:1!important;
    pointer-events:auto!important;border:0!important;border-radius:0!important;padding-bottom:env(safe-area-inset-bottom,0px)!important;box-shadow:none!important
  }
  html[data-theme][data-buddy-room-view="active"] .room.panel-fullscreen .participant-panel::before,
  html[data-theme][data-buddy-room-view="active"] .room.panel-fullscreen #participantPanel .panel-collapse-strip{display:none!important}
  html[data-theme][data-buddy-room-view="active"] .room.panel-fullscreen #participantPanel .panel-topbar{padding-top:8px!important}
  html[data-theme][data-buddy-room-view="active"] .room.panel-fullscreen .room-main{visibility:hidden!important}
}

/* Workspace Support / AI / Transcript fullscreen. The live node is never cloned. */
@media(max-width:900px){
  html[data-theme][data-buddy-room-view="active"] .room.workspace-tool-fullscreen .workspace-panel{
    display:flex!important;position:fixed!important;z-index:96!important;inset:0!important;
    width:100%!important;height:var(--app-viewport-height,100dvh)!important;max-width:none!important;max-height:none!important;
    min-width:0!important;min-height:0!important;margin:0!important;border:0!important;border-radius:0!important;
    padding:0 0 env(safe-area-inset-bottom,0px)!important;box-shadow:none!important
  }
  html[data-theme][data-buddy-room-view="active"] .room.workspace-tool-fullscreen .workspace-panel::before,
  html[data-theme][data-buddy-room-view="active"] .room.workspace-tool-fullscreen .workspace-panel .panel-collapse-strip{display:none!important}
  html[data-theme][data-buddy-room-view="active"] .room.workspace-tool-fullscreen .workspace-panel-topbar{padding:8px!important}
  html[data-theme][data-buddy-room-view="active"] .room.workspace-tool-fullscreen .room-main{visibility:hidden!important}
}

/* Real same-origin desktop popup windows reuse the exact live panel node and its listeners. */
html[data-rooms-tool-window][data-theme][data-buddy-room-view="active"],
html[data-rooms-tool-window][data-theme][data-buddy-room-view="active"] body{
  width:100%;height:100%;min-width:0;min-height:0;margin:0;overflow:hidden;background:var(--bg);color:var(--text)
}
html[data-rooms-tool-window][data-theme][data-buddy-room-view="active"] .tool-window-host,
html[data-rooms-tool-window][data-theme][data-buddy-room-view="active"] .tool-window-shell{
  width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important
}
html[data-rooms-tool-window][data-theme][data-buddy-room-view="active"] .tool-window-shell{display:flex!important;overflow:hidden!important}
html[data-rooms-tool-window][data-theme][data-buddy-room-view="active"] .tool-window-root{
  position:static!important;inset:auto!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;
  min-width:0!important;min-height:0!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important
}
html[data-rooms-tool-window="transcript"][data-theme][data-buddy-room-view="active"] #transcriptCard{
  display:flex!important;flex-direction:column!important;padding:14px!important;background:var(--panel)!important;overflow:hidden!important
}
html[data-rooms-tool-window="transcript"][data-theme][data-buddy-room-view="active"] #transcriptCard .transcript-sessions{min-height:0!important;max-height:none!important;flex:1 1 auto!important}
html[data-rooms-tool-window][data-theme][data-buddy-room-view="active"] :is(#aiAssistantPanel,#supportPanel).tool-window-root{display:flex!important;flex-direction:column!important}

/* Keep the selected compact collapse affordance; larger target, same 20px height/type. */
@media(max-width:760px){
  html[data-theme][data-buddy-room-view="active"] .panel-collapse-strip{width:132px!important;height:20px!important;font-size:9px!important}
}

/* 0.21.139 fullscreen header parity: legacy category2 fullscreen rules used to
   absolutize the room panel action cluster over the segmented navigation.
   Keep the approved compact header grammar in fullscreen as well. */
@media(max-width:900px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel.panel-fullscreen .participant-panel-head-meta .panel-actions,
  html[data-theme][data-buddy-room-view="active"] #participantPanel.panel-fullscreen .chat-head > #participantPanelActions{
    position:static!important;
    inset:auto!important;
    top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;
    transform:none!important;
    margin-left:auto!important;
    width:auto!important;height:34px!important;
    min-width:0!important;min-height:34px!important;
    display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;
    gap:6px!important;
    z-index:auto!important
  }
  html[data-theme][data-buddy-room-view="active"] #participantPanel.panel-fullscreen .panel-actions #panelDetachBtn{
    display:grid!important;width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;
    padding:0!important;place-items:center!important
  }
  html[data-theme][data-buddy-room-view="active"] #participantPanel.panel-fullscreen .panel-actions #panelFullscreenBtn{display:none!important}
  html[data-theme][data-buddy-room-view="active"] #participantPanel.panel-fullscreen .panel-topbar{
    padding-right:8px!important
  }
}
@media(max-width:760px){
  html[data-theme][data-buddy-room-view="active"] #participantPanel.panel-fullscreen .panel-actions #panelCloseBtn{display:none!important}
}


/* Buddy Rooms 0.21.140 control pass: the Chat/Participants browser popout is a
   desktop surface even when its OS window is only ~540px wide. The popup root
   marker therefore wins over viewport-only tablet/mobile rules. This keeps the
   approved desktop navigation/action grammar without changing the shared R6 engine. */
html[data-rooms-panel-window][data-theme][data-buddy-room-view="active"] #roomView #participantPanel .panel-collapse-strip{
  display:none!important
}
html[data-rooms-panel-window][data-theme][data-buddy-room-view="active"] #roomView #participantPanel .panel-topbar{
  position:relative!important;padding:8px!important;min-height:0!important
}
html[data-rooms-panel-window][data-theme][data-buddy-room-view="active"] #roomView #participantPanel #hybridTabBtn{
  display:flex!important
}
html[data-rooms-panel-window][data-theme][data-buddy-room-view="active"] #roomView #participantPanel #panelDetachBtn{
  display:grid!important;place-items:center!important;width:34px!important;min-width:34px!important;
  height:34px!important;min-height:34px!important;padding:0!important;border-radius:10px!important
}
html[data-rooms-panel-window][data-theme][data-buddy-room-view="active"] #roomView #participantPanel #panelDetachBtn [data-panel-return-label]{
  display:none!important
}
html[data-rooms-panel-window][data-theme][data-buddy-room-view="active"] #roomView #participantPanel #panelCloseBtn{
  display:none!important
}
