/* SARASOFT MOBILE RESPONSIVE PATCH v1.0.0 — scoped, additive rules */
@media (max-width: 767px) {
  .mkt-tabbar, .pre-auth-tabbar, .tabbar, #footer-spacer { display:none !important; }
  .mkt-footer { padding-bottom:24px !important; }
  body:has(#composerInput) .theme-footer, body:has(#composerInput) .mkt-footer { display:none !important; }
  body:has(#composerInput) #device, body:has(#composerInput) .device {
    width:100% !important; max-width:none !important; height:var(--nk-mobile-viewport-height,100dvh) !important;
    min-height:0 !important; margin:0 !important; border:0 !important; border-radius:0 !important;
    overflow:hidden !important; display:flex !important; flex-direction:column !important;
  }
  body:has(#composerInput) #scroll {
    flex:1 1 auto !important; min-height:0 !important; width:100% !important; max-width:100% !important;
    overflow-x:hidden !important; overflow-y:auto !important; overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch; padding:10px 12px 8px !important; scroll-padding-bottom:18px;
  }
  body:has(#composerInput) #inner, body:has(#composerInput) #messages, body:has(#composerInput) .msg-row,
  body:has(#composerInput) .msg-col, body:has(#composerInput) .answer, body:has(#composerInput) .rag-evidence-chain {
    min-width:0 !important; max-width:100% !important; overflow-wrap:anywhere; word-break:normal;
  }
  body:has(#composerInput) .msg-col { width:100%; }
  body:has(#composerInput) .answer pre, body:has(#composerInput) .answer table,
  body:has(#composerInput) .rag-evidence-quote { max-width:100% !important; overflow-x:auto; }
  body:has(#composerInput) .answer img, body:has(#composerInput) .answer video,
  body:has(#composerInput) .answer iframe { max-width:100% !important; }
  body:has(#composerInput) .composer-wrap {
    flex:0 0 auto !important; width:100% !important; max-width:100% !important;
    padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px)) !important; margin:0 !important; box-sizing:border-box !important;
  }
  body:has(#composerInput) .composer { width:100% !important; max-width:100% !important; min-width:0 !important; gap:6px !important; box-sizing:border-box !important; }
  body:has(#composerInput) #composerInput { min-width:0 !important; width:100% !important; max-height:min(26dvh,150px) !important; font-size:16px !important; overflow-y:auto !important; }
  body:has(#composerInput) .composer .send-btn, body:has(#composerInput) .composer .composer-plus {
    flex:0 0 36px !important; width:36px !important; min-width:36px !important; height:36px !important;
  }
  body:has(#composerInput) .composer-hint { display:none !important; }
  body:has(#composerInput) .rag-reasoning-grid { grid-template-columns:minmax(0,1fr) !important; }
}
@media (max-width:380px) {
  body:has(#composerInput) #scroll { padding-inline:9px !important; }
  body:has(#composerInput) .msg-row { gap:7px !important; }
  body:has(#composerInput) .msg-row .avatar { width:28px !important; height:28px !important; }
  body:has(#composerInput) .msg-col { max-width:calc(100% - 35px) !important; }
}