:root{--mobile-viewport-height:100dvh;--mobile-viewport-top:0px;--mobile-keyboard-inset:0px;--mobile-native-top:0px;--mobile-native-bottom:0px}
.mobile-sheet{--mobile-sheet-border:var(--border,#dedee3);--mobile-sheet-muted:var(--muted,#76767e);padding:8px 2px 4px}
.mobile-sheet h2{margin:8px 0 12px;font-size:24px;letter-spacing:-.03em}.mobile-sheet h3{margin:22px 0 10px;font-size:15px}.mobile-sheet p{font-size:13px;line-height:1.75;color:var(--mobile-sheet-muted)}
.mobile-sheet-heading{display:flex;align-items:center;gap:12px;margin-bottom:16px}.mobile-sheet-heading img{width:48px;height:48px;border-radius:14px}.mobile-sheet-heading h2{font-size:22px;margin:0 0 3px}.mobile-sheet-heading small{font-size:11px;color:var(--mobile-sheet-muted)}
.mobile-install-steps{margin:16px 0;padding-left:22px;font-size:14px;line-height:2;color:var(--text,#17171b)}.mobile-install-url{overflow-wrap:anywhere;font-size:12px}.mobile-install-url a{color:inherit}
#mobile-install .mobile-ios-guide{margin-top:16px}
#mobile-install .mobile-ios-guide>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;min-height:46px;padding:12px 14px;border:1px solid var(--mobile-sheet-border);border-radius:14px;background:var(--surface-2,transparent);color:var(--text,#17171b);font-size:14px;font-weight:600;line-height:1.5;list-style:none;cursor:pointer;touch-action:manipulation}
#mobile-install .mobile-ios-guide>summary::-webkit-details-marker{display:none}
#mobile-install .mobile-ios-guide>summary::after{content:"";width:7px;height:7px;margin-right:3px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);flex:none}
#mobile-install .mobile-ios-guide[open]>summary::after{transform:rotate(225deg)}
#mobile-install .mobile-ios-guide>summary:focus-visible{outline:2px solid var(--accent,#66aaff);outline-offset:3px}
#mobile-install .mobile-ios-guide-body{padding:14px 2px 0}
#mobile-install .mobile-ios-steps{list-style:none;counter-reset:ios-step;margin:0;padding:0;display:grid;gap:14px}
#mobile-install .mobile-ios-steps>li{counter-increment:ios-step;display:grid;grid-template-columns:25px minmax(0,1fr);gap:10px;align-items:start}
#mobile-install .mobile-ios-steps>li:before{content:counter(ios-step);display:grid;place-items:center;width:25px;height:25px;border-radius:9px;background:color-mix(in srgb,var(--accent,#66aaff) 14%,transparent);color:var(--accent,#66aaff);font-size:12px;font-weight:650}
#mobile-install .mobile-ios-steps b{display:block;font-size:14px;line-height:25px;font-weight:600}
#mobile-install .mobile-ios-steps p{margin:5px 0 12px;font-size:13px;line-height:1.75}
#mobile-install .mobile-ios-site{display:block;width:fit-content;max-width:100%;color:var(--accent,#66aaff);text-underline-offset:3px;overflow-wrap:anywhere}
#mobile-install .mobile-ios-steps figure{margin:0;max-width:160px}
#mobile-install .mobile-ios-steps img{display:block;width:100%;height:auto;object-fit:contain;border:1px solid var(--mobile-sheet-border);border-radius:14px;box-sizing:border-box}
#mobile-install .mobile-ios-steps figcaption{margin-top:7px;color:var(--mobile-sheet-muted);font-size:11px;text-align:center}
#mobile-install .mobile-ios-complete{margin:14px 0 4px;padding:10px 12px;border:1px solid var(--mobile-sheet-border);border-radius:12px;font-size:12px}
.mobile-sheet .mobile-button{display:flex;align-items:center;justify-content:center;min-height:46px;width:100%;padding:12px 16px;border:1px solid var(--mobile-sheet-border);border-radius:15px;font:inherit;font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;background:var(--text,#19191d);color:var(--bg,#fff)}
.mobile-sheet .mobile-button.secondary{background:transparent;color:var(--text,#19191d)}.mobile-sheet .mobile-button:disabled{opacity:.45;cursor:default}.mobile-sheet .mobile-button+.mobile-button{margin-top:10px}
.mobile-notification-status{padding:15px;border:1px solid var(--mobile-sheet-border);border-radius:16px;background:var(--surface-2,#f6f6f7);margin:16px 0}.mobile-notification-status strong{display:block;font-size:14px}.mobile-notification-status p{margin:5px 0 0}.mobile-notification-status[data-state="ready"] strong{color:var(--accent,var(--text))}
.mobile-preferences{border:1px solid var(--mobile-sheet-border);border-radius:18px;padding:0 15px}.mobile-preference{display:flex;align-items:center;gap:15px;min-height:74px;padding:13px 0;cursor:pointer}.mobile-preference+.mobile-preference{border-top:1px solid var(--mobile-sheet-border)}.mobile-preference>span{flex:1}.mobile-preference b{display:block;font-size:14px;font-weight:600}.mobile-preference small{display:block;font-size:11px;line-height:1.6;color:var(--mobile-sheet-muted);margin-top:4px}.mobile-preference input{width:22px;height:22px;accent-color:var(--text,#222);flex-shrink:0;cursor:pointer}.mobile-preference input:disabled{cursor:default}
.mobile-device-list{border:1px solid var(--mobile-sheet-border);border-radius:16px;overflow:hidden}.mobile-device{display:flex;align-items:center;gap:12px;padding:14px}.mobile-device+.mobile-device{border-top:1px solid var(--mobile-sheet-border)}.mobile-device>span{flex:1;min-width:0}.mobile-device b{display:block;font-size:13px;overflow-wrap:anywhere}.mobile-device small{display:block;color:var(--mobile-sheet-muted);font-size:11px;margin-top:3px}.mobile-device button{border:1px solid var(--mobile-sheet-border);border-radius:10px;padding:8px 11px;background:transparent;color:var(--text);font:inherit;font-size:12px;min-height:36px}.mobile-device button:disabled{opacity:.4}
.mobile-inline-status{min-height:20px;font-size:12px!important;margin:12px 0 0!important}.mobile-inline-status[data-error="true"]{color:var(--negative,#c14848)}
#mobile-connection-status{position:fixed;z-index:90;top:max(8px,env(safe-area-inset-top),var(--mobile-native-top));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 24px);padding:10px 15px;box-sizing:border-box;border:1px solid var(--border,#333);border-radius:14px;background:var(--surface,#1b1b1f);color:var(--text,#fff);font-size:12px;line-height:1.5;box-shadow:0 4px 20px #0002;display:flex;align-items:center;gap:12px}
#mobile-connection-status[hidden]{display:none}#mobile-connection-status button{border:0;background:transparent;color:inherit;text-decoration:underline;font:inherit;white-space:nowrap;min-height:30px}
body.mobile-native .app-shell{padding-top:var(--mobile-native-top)}body.mobile-native .bottom-nav{padding-bottom:max(env(safe-area-inset-bottom),var(--mobile-native-bottom));height:calc(68px + max(env(safe-area-inset-bottom),var(--mobile-native-bottom)))}
body.mobile-native .chat-page-header{padding-top:calc(8px + max(env(safe-area-inset-top),var(--mobile-native-top)))}body.mobile-native .chat-page-footer{padding-bottom:calc(9px + max(env(safe-area-inset-bottom),var(--mobile-native-bottom)))}
@media(max-width:760px){body.chat-view .chat-page{inset:auto 0 auto;top:var(--mobile-viewport-top);height:var(--mobile-viewport-height);max-height:var(--mobile-viewport-height)}body.mobile-keyboard-open .chat-page-footer{padding-bottom:9px}body.mobile-keyboard-open .bottom-nav{display:none}.mobile-sheet{padding:4px 0}.mobile-sheet .mobile-button,.mobile-device button,.mobile-preference{touch-action:manipulation}}
@media(prefers-reduced-motion:reduce){.mobile-sheet *{scroll-behavior:auto}}

/* Home header: reserve the iPhone status bar without shrinking the button row.
   The Android native container already consumes its system-window insets. */
body.ui-polished.home-view:not(.mobile-native):not(.admin-body) .app-shell > .topbar{
  --home-header-gutter:16px;
  box-sizing:border-box;
  height:calc(68px + env(safe-area-inset-top,0px));
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:0;
  padding-left:max(var(--home-header-gutter),env(safe-area-inset-left,0px));
  padding-right:max(var(--home-header-gutter),env(safe-area-inset-right,0px));
  top:0;
}
@media(min-width:850px){body.ui-polished.home-view:not(.mobile-native):not(.admin-body) .app-shell > .topbar{--home-header-gutter:28px}}
@media(max-width:420px){body.ui-polished.home-view:not(.mobile-native):not(.admin-body) .app-shell > .topbar{--home-header-gutter:14px}}
@media(max-width:360px){body.ui-polished.home-view:not(.mobile-native):not(.admin-body) .app-shell > .topbar{--home-header-gutter:10px}}
