/* ============================================================================
   A8_PROGRAM_BEGIN | program_key=AOS_AI_G1_WORKING_UIFIX_R1 | 中文=G1既有介面精準修正 | English=G1 Working UI Surgical Fix
   ============================================================================
   基線：使用者提供且已確認「語音轉文字＋語音對話可用」的 G1。
   規則：只修顯示，不改 STT / Live Voice / TTS / Provider / 語言邏輯。
   ============================================================================ */

/* 1) 左側三橫固定在品牌列右端，不壓 AOS AI Logo；收合後才顯示外部三橫。 */
.brand{padding-right:12px!important}
#collapse{
  position:static!important;
  right:auto!important;top:auto!important;
  margin-left:auto!important;margin-right:0!important;
  transform:none!important;flex:0 0 38px!important;
  width:38px!important;height:38px!important;min-width:38px!important;
}
.side.small #collapse{position:static!important;right:auto!important;top:auto!important;margin-left:auto!important}
.app:not(.a8-side-fully-collapsed) #sideToggleTop{display:none!important}
.app.a8-side-fully-collapsed #sideToggleTop{
  display:inline-flex!important;left:12px!important;top:8px!important;
}

/* 2) 右側重複的私人訓練浮標全部隱藏；正式入口保留在右上 ⋮ 選單。 */
#a8-owner-training-toggle,
#ownerStudioEdgeTab{display:none!important}

/* 3) 舊的右下人物/Listening 浮板不再出現在主聊天畫面。
      僅隱藏 UI；Live Voice 執行狀態與事件仍由原 G1 JS 維持。 */
#aosFloatingCharacter{display:none!important}

/* 4) 語音訊息送出後不再把「文字＋音波卡」綁在一起；只留辨識文字。 */
.voice-wave-message-v53104f2{display:none!important}

/* 5) 手動 STT 收音期間視覺上只看金色聲波；原本 Browser STT interim 值仍保留在記憶體/輸入框，停止後正常顯示。 */
.composer:has(#mic.recording) #chatInput,
.composer:has(#mic[data-mic-state="recognizing"]) #chatInput{
  color:transparent!important;
  -webkit-text-fill-color:transparent!important;
  caret-color:transparent!important;
}

/* 6) 文字聊天框桌機/手機自適應：Chrome 152 可用 field-sizing，內容增多時自動長高，超過上限才內捲。 */
.composer .a8-input-shell{
  height:auto!important;min-height:44px!important;max-height:132px!important;
  overflow:visible!important;align-self:end!important;
}
.composer .a8-input-shell #chatInput{
  field-sizing:content;
  height:auto!important;min-height:42px!important;max-height:120px!important;
  overflow-y:auto!important;resize:none!important;
}
@media(max-width:820px){
  .composer .a8-input-shell{min-height:40px!important;max-height:116px!important}
  .composer .a8-input-shell #chatInput{min-height:38px!important;max-height:106px!important}
}
@media(max-width:430px){
  .composer .a8-input-shell{min-height:38px!important;max-height:108px!important}
  .composer .a8-input-shell #chatInput{min-height:36px!important;max-height:98px!important}
}

/* A8 廣告導流區保護：只確保它保持顯示與可點擊，不改尺寸/Binding/內容。 */
#a8CampaignSlot{visibility:visible!important;pointer-events:auto!important}

/* ============================================================================
   A8_PROGRAM_END | program_key=AOS_AI_G1_WORKING_UIFIX_R1
   ============================================================================ */

/* ============================================================================
   R4 SIDE TAB CLEANUP + LOCAL OWNER MODE MENU
   - Keep runtime/DOM hooks; hide standalone side tabs only.
   - Global and Training remain accessible from top-right ⋮ menu.
   - Local Owner Mode keeps its real permission/entitlement logic, but its
     fixed bottom-right badge is hidden; control moved into top-right ⋮.
   ============================================================================ */
#globalReopenTab,
.global-reopen-tab,
#ownerStudioEdgeTab,
.owner-studio-edge-tab,
#a8-owner-training-toggle,
#aosOwnerModeBadge{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

