/* Keep dialogs within the visible area while mobile browser chrome/keyboard changes. */
[hidden] {display:none!important}
.field input[type=checkbox],.field input[type=radio] {
  width:18px;height:18px;min-height:18px;padding:0;margin:0;flex:0 0 18px
}
.field label.check-label {min-height:44px}
.modal-backdrop {
  top:var(--visual-top,0px);
  bottom:auto;
  height:var(--visual-height,100dvh)
}
.modal {max-height:calc(var(--visual-height,100dvh) - 48px)}
.modal-header,.modal-footer {flex-shrink:0}
.modal-body {min-height:0;overscroll-behavior:contain;scroll-padding-block:18px}
.modal:focus {outline:none}
.attachment-preview {display:block;max-width:100%;max-height:45dvh;object-fit:contain;margin-inline:auto;border-radius:8px}
.upload-status {margin-top:10px;overflow-wrap:anywhere}
.mobile-send-hint {display:none}
.file-item strong {overflow-wrap:anywhere}
@media(max-width:700px) {
  /* 16px prevents iOS focus zoom; preserve browser zoom controls. */
  input:not([type=checkbox]):not([type=radio]),select,textarea,
  .field input,.field select,.field textarea,.modal .field input,.modal .field select,
  .search-box input,.chat-composer textarea,.schedule-day input[type=time] {font-size:16px}
  .modal {max-height:calc(var(--visual-height,100dvh) - 26px)}
  .modal-header {padding:12px 16px}
  .modal-footer {padding:12px 16px;padding-bottom:max(12px,env(safe-area-inset-bottom));gap:8px}
  .modal-footer .btn {min-height:44px}
  .modal-body input,.modal-body textarea,.modal-body select {scroll-margin-block:18px}
  .mobile-nav {padding-bottom:env(safe-area-inset-bottom)}
  .desktop-send-hint {display:none}
  .mobile-send-hint {display:inline}
  .chat-composer .toolbar {flex-wrap:wrap}
  .chat-composer .toolbar button,.message-recall {min-height:36px}
  .chat-composer .btn {min-height:44px}
  .message-stream {min-height:0;overscroll-behavior:contain}
  body.keyboard-open .mobile-nav {visibility:hidden;pointer-events:none}
  body.keyboard-open.mobile-chat .inbox.has-chat {
    position:fixed;z-index:45;inset-inline:8px;top:calc(var(--visual-top,0px) + 8px);
    height:calc(var(--visual-height,100dvh) - 16px);min-height:0;margin:0;
    box-shadow:0 0 0 12px var(--bg)
  }
  body.keyboard-open.mobile-chat .chat-header {height:48px;padding:5px 12px}
  body.keyboard-open.mobile-chat .chat-context {padding:7px 12px}
  body.keyboard-open.mobile-chat .chat-composer {padding:7px 12px}
  body.keyboard-open.mobile-chat .chat-composer textarea {min-height:42px;max-height:72px}
  body.keyboard-open.mobile-chat .message-stream {padding:12px}
  body.keyboard-open .toast {bottom:auto;top:calc(var(--visual-top,0px) + 12px)}
}
@media(pointer:coarse) {
  .desktop-send-hint {display:none}
  .mobile-send-hint {display:inline}
}
