/* Android chat has one scroll owner. Loaded after the shared site theme. */
html.bubbles-native-overlay,
html.bubbles-native-overlay body {
  height:100%; min-height:0; margin:0; padding:0; overflow:hidden;
  background:#fff;
}
html.bubbles-native-overlay .bubbles-page,
html.bubbles-native-overlay .ba-launcher { display:none!important; }
html.bubbles-native-overlay .ba-panel {
  position:fixed; inset:0; width:100%; height:100%; max-height:none;
  min-height:0; margin:0; padding:8px; border:0; border-radius:0;
  transform:none; display:flex; flex-direction:column; gap:8px;
  overflow:hidden; box-sizing:border-box; background:#fff;
  z-index:2147483640;
}
html.bubbles-native-overlay .ba-thread {
  flex:1 1 0; min-height:0; overflow-y:auto; overflow-x:hidden;
  overscroll-behavior-y:contain; touch-action:pan-y;
  -webkit-overflow-scrolling:touch; overflow-anchor:auto;
}
html.bubbles-native-overlay .ba-panel .ba-messages {
  display:flex; flex-direction:column; flex:none; min-height:0;
  overflow:visible; padding:8px 0;
}
html.bubbles-native-overlay .ba-line { flex:none; }
html.bubbles-native-overlay .ba-message { font-size:16px; }
html.bubbles-native-overlay .ba-panel .ba-composer {
  flex:0 0 auto; padding:8px; margin:0; border:1px solid #b9a5ca;
  border-radius:14px; background:#faf8fd;
  padding-bottom:max(8px,env(safe-area-inset-bottom));
}
html.bubbles-native-overlay .ba-panel .ba-composer textarea {
  min-height:72px; height:72px; max-height:96px; resize:none;
  font-size:17px; line-height:1.4;
}
html.bubbles-native-overlay .ba-panel .ba-status {
  display:block; font-size:15px; line-height:1.35; margin:0 0 4px;
  color:#493756; overflow-wrap:anywhere;
}
html.bubbles-native-overlay .ba-panel .ba-actions { grid-template-columns:1fr; }
html.bubbles-native-overlay .ba-panel .ba-mic,
html.bubbles-native-overlay .ba-panel .ba-speak { display:none; }
html.bubbles-native-overlay .ba-panel .ba-send { min-height:48px; font-size:16px; }
html.bubbles-native-overlay .ba-panel .ba-tools,
html.bubbles-native-overlay .ba-panel .ba-notes {
  max-height:none; overflow:visible; flex:none;
}
html.bubbles-native-overlay .ba-tools summary { min-height:44px; font-size:16px; }
html.bubbles-native-overlay .ba-panel .ba-owner-status {
  font-size:14px; margin:0; border:0; border-radius:0;
}
html.bubbles-native-overlay [hidden] { display:none!important; }

/* Preview 5 accessibility repair: options remain within one scrolling chat. */
html.bubbles-native-overlay .ba-panel .ba-tools {
  display:block; position:relative; flex:none; z-index:2;
  border:1px solid #cabcd2; border-radius:12px;
  padding:9px; background:#fff;
  pointer-events:auto; touch-action:pan-y;
}
html.bubbles-native-overlay .ba-tools > summary {
  display:flex; align-items:center; min-height:54px;
  padding:10px 14px; background:#f6f0fa; border-radius:10px;
  color:#3b205a; font-size:17px; cursor:pointer;
  touch-action:manipulation; pointer-events:auto;
}
html.bubbles-native-overlay .ba-tools[open] > summary {margin-bottom:8px}
html.bubbles-native-overlay .ba-tools button,
html.bubbles-native-overlay .ba-tools a,
html.bubbles-native-overlay .ba-tools input,
html.bubbles-native-overlay .ba-tools select,
html.bubbles-native-overlay .ba-tools textarea,
html.bubbles-native-overlay .ba-link-bubbles,
html.bubbles-native-overlay .ba-pairing-card button {
  position:relative; z-index:3; pointer-events:auto;
  min-height:48px; touch-action:manipulation;
}
html.bubbles-native-overlay .ba-tools .ba-privacy-label {
  min-height:48px; padding:8px 4px; font-size:14px;
}
html.bubbles-native-overlay .ba-panel .ba-link-bubbles {width:100%; margin:5px 0;}
html.bubbles-native-overlay .ba-panel .ba-photo-upload {display:block; min-width:0;}
html.bubbles-native-overlay .ba-panel .ba-photo-file {
  width:100%; min-height:48px; max-width:100%;
  font-size:14px; padding:8px; touch-action:manipulation;
}

/* In Android, hidden website microphone controls leave Image + Send as 2 large targets. */
html.bubbles-native-overlay .ba-panel .ba-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
html.bubbles-native-overlay .ba-panel .ba-actions .ba-photo-upload{min-height:48px;display:flex}
html.bubbles-native-overlay .ba-panel .ba-actions .ba-photo-file{position:absolute;inset:0;opacity:0;min-height:0;height:100%;width:100%;z-index:5}
html.bubbles-native-overlay .ba-panel .ba-actions .ba-send{width:100%}

/* Keep assistant text readable even when the page theme mutes every paragraph. */
body .ba-panel,
body .ba-panel :is(.ba-message,.ba-muted,.ba-status,.ba-owner-status,.ba-privacy-label,.ba-owner-help) {
 color:#17212b!important; opacity:1; text-shadow:none;
}
body .ba-panel .ba-message {font-size:16px;line-height:1.55;background:#f3f5f7}
body .ba-panel .ba-you {background:#e5f3eb;color:#122b20!important}
body .ba-panel :is(.ba-muted,.ba-status,.ba-owner-status) {font-size:14px;line-height:1.45}
body .ba-panel .ba-owner-help {margin:4px 0;font-size:14px}
body .ba-panel .ba-owner-help summary {min-height:44px;display:flex;align-items:center;font-weight:700;cursor:pointer}
body .ba-panel .ba-owner-help p {color:#17212b!important;line-height:1.5}
body .ba-panel textarea {color:#17212b!important;background:#fff!important;-webkit-text-fill-color:#17212b}
body .ba-panel textarea::placeholder {color:#465462;opacity:1}
body .ba-panel button:disabled {opacity:.8}
@media(max-width:600px){
 html:not(.bubbles-native-overlay) .ba-panel {
  width:calc(100vw - 24px);max-width:390px;right:12px;bottom:80px;
  height:min(64dvh,500px);max-height:calc(100dvh - 96px);min-height:0;padding:8px;gap:6px;
 }
 body .ba-panel .ba-message {max-width:100%;padding:9px 10px}
 body .ba-panel .ba-composer textarea {min-height:48px;height:64px;max-height:80px;font-size:16px}
}
html.bubbles-native-overlay .ba-panel {padding:6px;gap:6px}
html.bubbles-native-overlay .ba-panel .ba-composer {padding:6px}
html.bubbles-native-overlay .ba-panel .ba-composer textarea {min-height:48px;height:64px;max-height:80px}

body .ba-panel .ba-composer textarea {padding:6px 8px;line-height:1.35}
