/* MMS enhancement r1. Original routes, stores and send handlers remain authoritative. */
html[data-mms-mobile="1"] { height: 100%; }
html[data-mms-mobile="1"] body {
  position: fixed; inset: var(--mms-visible-top, 0px) 0 auto;
  width: 100%; height: var(--mms-visible-height, 100dvh) !important; overflow: hidden;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
html[data-mms-mobile="1"] #app,
html[data-mms-mobile="1"] .app-root,
html[data-mms-mobile="1"] .auth-app-shell,
html[data-mms-mobile="1"] #layout.is-mobile-layout {
  width: 100% !important; max-width: 100%; min-width: 0;
  height: 100% !important; min-height: 0; box-sizing: border-box;
}
html[data-mms-mobile="1"] .login-box {
  box-sizing: border-box; width: 100%; height: 100%; border-radius: 0 !important;
  padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-x: hidden; overflow-y: auto !important; -webkit-overflow-scrolling: touch;
}
html[data-mms-mobile="1"] .login-manual-panel { margin: clamp(16px, 5vh, 44px) auto 16px !important; width: 100%; max-width: 420px; }
html[data-mms-mobile="1"] .login-manual-form { width: calc(100% - 24px) !important; max-width: 360px; height: auto !important; }
html[data-mms-mobile="1"] .login-manual-form .n-input,
html[data-mms-mobile="1"] .login-manual-submit { min-height: 48px; border-radius: 12px; }
html[data-mms-mobile="1"] input:not([type=checkbox]):not([type=radio]),
html[data-mms-mobile="1"] textarea { font-size: 16px !important; }
html[data-mms-mobile="1"] .login-manual-action { min-height: 44px; }
html[data-mms-mobile="1"] .login-version-text { position: static !important; padding: 16px 8px max(12px, env(safe-area-inset-bottom)); }
html[data-mms-mobile="1"] .login-box .app-action-bar { display: none !important; }
html[data-mms-mobile="1"] #layout.is-mobile-layout .layout-panels { min-height: 0; }
html[data-mms-mobile="1"] #layout .mobile-bottom-nav {
  min-height: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
html[data-mms-mobile="1"] #layout.has-mobile-bottom-nav .center-pane { bottom: calc(62px + env(safe-area-inset-bottom)); }
html[data-mms-mobile="1"] #layout .mobile-nav-item { min-height: 52px; font-size: 12px; touch-action: manipulation; }
html[data-mms-mobile="1"] #layout .mobile-secondary-back { min-width: 44px; min-height: 44px; touch-action: manipulation; }
html[data-mms-mobile="1"] #layout .chat-header { padding-top: max(6px, env(safe-area-inset-top)); }
html[data-mms-mobile="1"] .n-modal { max-height: calc(var(--mms-visible-height, 100dvh) - 24px) !important; max-width: calc(100vw - 24px) !important; }
html[data-mms-mobile="1"][data-mms-keyboard="1"] #layout .n-split-pane:last-child { padding-bottom: 0; }
html[data-mms-mobile="1"][data-mms-keyboard="1"] .login-manual-panel { margin-top: 0 !important; gap: 8px !important; }
html[data-mms-mobile="1"][data-mms-keyboard="1"] .login-manual-panel .welcome { width: 48px !important; height: 48px !important; }
@media (prefers-reduced-motion: reduce) {
  html[data-mms-mobile="1"] .login-box { animation: none !important; }
}

/* Actual served Naive UI nodes are n-split-pane-1/2 (not n-split-pane). */
html[data-mms-mobile="1"] #layout .n-split--vertical[data-v-95facd7d] > .n-split-pane-1 {
  flex: 1 1 0 !important; min-height: 0;
}
html[data-mms-mobile="1"] #layout .n-split--vertical[data-v-95facd7d] > .n-split-pane-2 {
  flex: 0 0 auto !important; height: calc(132px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; min-height: 0;
}
html[data-mms-mobile="1"] #layout #message-form > div {
  display: grid; grid-template-columns: minmax(0, 1fr) 104px; align-items: end;
  gap: 8px; padding: 6px 8px 8px; box-sizing: border-box;
}
html[data-mms-mobile="1"] #layout #message-form .desktop-msg-input-shell {
  height: 54px; min-height: 44px; padding-right: 0; border-radius: 12px;
}
html[data-mms-mobile="1"] #layout #message-input { font-size: 16px; line-height: 22px !important; overflow-wrap: anywhere; }
html[data-mms-mobile="1"] #layout #message-form > div > div:last-child { margin: 0; padding: 0; border: 0; align-items: center; min-height: 44px; }
html[data-mms-mobile="1"] #layout #message-form .n-button { min-height: 44px; touch-action: manipulation; }
html[data-mms-mobile="1"] #layout #message-form .n-button-group > .n-button:last-child { min-width: 36px; }
html[data-mms-mobile="1"] #layout .n-split-pane-2 > main > div > .n-flex:first-child { padding: 0 8px !important; min-height: 44px; align-items: center; }
html[data-mms-mobile="1"][data-mms-keyboard="1"] #layout .n-split--vertical[data-v-95facd7d] > .n-split-pane-2 { padding-bottom: 0; height: 132px; }
