/* LAMOI Portal v0.47.13 - mobile admin polish, menu layering, chat, footer, ChatGPT helper */

/* v0.47.20: launcher speech bubble is visible on laptop/tablet; hidden only on phones. */
.lamoi-chat-callout{display:block}
@media(max-width:600px){.lamoi-chat-callout{display:none!important}}

/* Admin footer: centered and safe-area aware on curved/notched phones. */
.admin-footer{justify-content:center!important;text-align:center!important;padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important}
.admin-footer span{margin-inline:auto}

/* ChatGPT outside-system card: compact and aligned. */
.chatgpt-external-card .admin-card-head{align-items:flex-start}
.chatgpt-external-card .admin-card-head>.admin-form-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.chatgpt-external-card>small{display:block;margin-top:10px;line-height:1.55;color:#68766c}

/* Login notice when another device becomes the active session. */
.auth-session-message{margin:0 0 14px;padding:11px 13px;border:1px solid #f0cf8e;border-radius:12px;background:#fff7e6;color:#80530a;font-size:13px;line-height:1.45;text-align:center}

@media(max-width:900px){
  /* Sidebar must visually own the screen while open. Chat and sticky compare controls disappear until menu closes. */
  .admin-nav-toggle:checked ~ .lamoi-chat-widget,
  .admin-nav-toggle:checked ~ .admin-shell .lamoi-chat-widget,
  .admin-nav-toggle:checked ~ .admin-shell .clinical-compare-bar,
  .admin-nav-toggle:checked ~ .admin-shell .customer-compare-toolbar{visibility:hidden!important;opacity:0!important;pointer-events:none!important}
}

@media(max-width:700px){
  /* Three-column top bar avoids doctor-role text colliding with the centered LAMOI brand. */
  .admin-topbar{display:grid!important;grid-template-columns:minmax(0,1fr) 118px auto!important;gap:8px!important;align-items:center!important;padding:9px max(12px,env(safe-area-inset-right)) 9px max(12px,env(safe-area-inset-left))!important}
  .admin-topbar-left{min-width:0!important;gap:8px!important}
  .admin-topbar-left>div{max-width:none!important;min-width:0!important}
  .admin-topbar-left small{font-size:7.5px!important;letter-spacing:.09em!important;white-space:normal}
  .admin-topbar-left strong{font-size:12.5px!important;white-space:nowrap!important;margin-top:2px!important}
  .admin-menu-button{width:38px!important;height:38px!important;padding:9px!important;flex:0 0 38px}
  .admin-mobile-brand{display:grid!important;position:static!important;left:auto!important;top:auto!important;transform:none!important;width:118px!important;text-align:center!important;line-height:1.05!important;pointer-events:none}
  .admin-mobile-brand strong{font-size:14px!important;letter-spacing:.12em!important}
  .admin-mobile-brand small{font-size:6.2px!important;line-height:1.2!important;letter-spacing:.04em!important;white-space:nowrap}
  .admin-account-menu{justify-self:end}
  .admin-avatar{width:42px!important;height:42px!important}

  .admin-footer{font-size:11px!important;line-height:1.4!important}

  .chatgpt-external-card .admin-card-head{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
  .chatgpt-external-card .admin-card-head>.admin-form-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important}
  .chatgpt-external-card .admin-card-head>.admin-form-actions>*{width:100%!important;min-width:0!important;justify-content:center!important;text-align:center!important}
  .chatgpt-external-card .chatgpt-link-form{grid-template-columns:1fr!important}
  .chatgpt-external-card .chatgpt-link-form>*{width:100%!important;min-width:0!important}

  /* Launcher slightly larger; the panel fills the usable phone viewport. */
  .lamoi-chat-launcher{width:58px!important;height:58px!important;border-radius:19px!important;touch-action:none!important;will-change:left,top}
  .lamoi-chat-launcher img{width:39px!important;height:39px!important}
  .lamoi-chat-widget.is-dragging .lamoi-chat-launcher{box-shadow:0 8px 22px rgba(20,74,42,.22)!important}
  .lamoi-chat-widget.is-open{left:0!important;top:0!important;right:auto!important;bottom:auto!important;transform:none!important}
  .lamoi-chat-widget.is-open .lamoi-chat-panel{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;border-radius:0!important}
  .lamoi-chat-header{padding-left:max(12px,env(safe-area-inset-left))!important;padding-right:max(12px,env(safe-area-inset-right))!important}
  .lamoi-chat-compose{padding-bottom:max(10px,env(safe-area-inset-bottom))!important}

  /* Select lists in chatbot training: smaller text/wrapping on iOS. */
  .knowledge-question-form select{font-size:15px!important;line-height:1.25!important}
}

@media(max-width:390px){
  .admin-topbar{grid-template-columns:minmax(0,1fr) 104px auto!important;gap:5px!important}
  .admin-mobile-brand{width:104px!important}
  .admin-mobile-brand strong{font-size:13px!important}
  .admin-mobile-brand small{font-size:5.7px!important}
  .admin-topbar-left strong{font-size:11.5px!important}
}
