/* A mobile platform or compact browser uses the same safe-area-aware layout. */
.mobile-layout,.mobile-layout body{height:100%;overflow:hidden;overscroll-behavior:none}
.mobile-layout .shell{position:fixed;top:var(--viewport-top,0px);left:0;right:0;height:var(--app-height,100dvh)}
.mobile-layout #gate-pane{overflow:auto;overscroll-behavior:contain}
.mobile-layout .gate-header{height:80px;padding:calc(16px + env(safe-area-inset-top)) 24px 16px}
.mobile-layout .gate-wrap{padding:24px 24px calc(40px + env(safe-area-inset-bottom));flex:1 0 auto;overflow:visible}
.mobile-layout .gate-content{max-width:440px;width:100%;padding:0;border-radius:0;box-shadow:none;gap:24px}
.mobile-layout .gate-content h2{font-size:24px;line-height:34px}
.mobile-layout .chat-header{padding:calc(16px + env(safe-area-inset-top)) 16px 16px;min-height:84px;gap:12px}
.mobile-layout .chat-title-block{flex:1;min-width:0}
.mobile-layout .chat-header h2{font-size:20px;line-height:30px}
.mobile-layout .messages{padding:16px;-webkit-overflow-scrolling:touch;touch-action:pan-y pinch-zoom}
.mobile-layout .message{margin-bottom:16px}
.mobile-layout .message-content{max-width:calc(100% - 72px)}
.mobile-layout .message.mine .message-content{max-width:calc(100% - 64px)}
.mobile-layout .bubble{font-size:17px;padding:12px 16px;line-height:28px}
.mobile-layout .composer-area{padding:12px 12px calc(12px + env(safe-area-inset-bottom))}
.mobile-layout .composer textarea{max-height:124px;font-size:16px;scrollbar-width:thin}
.mobile-layout .new-message-pill{bottom:180px}
.mobile-layout .recording-panel{position:absolute;bottom:100%;left:24px;right:24px;display:flex;flex-direction:column;justify-content:center;gap:10px;padding:24px;min-height:244px;background:var(--paper);color:var(--accent);border-radius:24px;box-shadow:0 16px 48px -12px #41393433;z-index:10;margin-bottom:12px}
.mobile-layout .recording-panel strong{font-size:24px;line-height:34px;color:var(--ink)}
.mobile-layout #record-time{font-size:32px;line-height:40px}
.mobile-layout #record-wave{width:256px;max-width:100%;height:80px}
.mobile-layout #record-hint{display:block;font-size:14px;line-height:22px}
.mobile-layout .record-actions:has(button:not([hidden])){display:flex}
.mobile-layout .record-actions{display:none}
.mobile-layout .recording-panel.cancel-armed{background:#f6e5e1;color:var(--rose)}
.mobile-layout .composer-area:has(.recording-panel:not([hidden]))::before{content:'';position:fixed;inset:0;pointer-events:none;background:#41393421;z-index:9}
.mobile-layout .composer-area:has(.recording-panel:not([hidden])) .composer{position:relative;z-index:11}
.mobile-layout dialog{position:fixed;inset:auto 0 var(--viewport-bottom,0px);margin:0;width:100%;max-width:none;max-height:calc(var(--app-height,100dvh) - 16px);border-radius:24px 24px 0 0;padding:24px 24px calc(24px + env(safe-area-inset-bottom));overscroll-behavior:contain}
.mobile-layout .toast{bottom:calc(var(--viewport-bottom,0px) + 16px + env(safe-area-inset-bottom))}
.mobile-layout .page-loading{top:var(--viewport-top,0px);height:var(--app-height,100dvh);bottom:auto}
.mobile-layout .loading-brand{top:calc(24px + env(safe-area-inset-top));left:24px}
.mobile-layout.keyboard-open .chat-header{padding:8px 16px;min-height:60px}
.mobile-layout.keyboard-open .composer-area{padding-bottom:8px}
.mobile-layout.keyboard-open .gate-wrap{align-items:flex-start;padding-top:12px}
@media(orientation:landscape) and (max-height:500px){.mobile-layout .chat-header{padding:4px 16px;min-height:52px}.mobile-layout .chat-eyebrow{display:none}.mobile-layout .composer textarea{min-height:40px;padding-top:4px}.mobile-layout .composer-area{padding-top:4px;padding-bottom:6px}.mobile-layout .gate-wrap{align-items:flex-start}.mobile-layout .recording-panel{min-height:0;padding:12px;gap:4px}.mobile-layout #record-wave{height:40px}}
/* CSS provides the phone layout before platform detection or script loading. */
@media(max-width:640px){.gate-header{padding:16px 24px}.gate-wrap{padding:24px}.gate-content{padding:0;box-shadow:none}.gate-content h2{font-size:24px;line-height:34px}.chat-header{padding:16px}.messages{padding:16px}.composer-area{padding:12px}.loading-brand{left:24px}}
