/* The conversation scrolls; the composer stays within the visible viewport. */
.chat-screen.viewport-chat{box-sizing:border-box;height:var(--chat-height,60dvh)!important;min-height:0!important;max-height:none!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important;overflow:hidden;padding:0!important;border-radius:0 0 18px 18px}
.viewport-chat>.message-list{flex:1 1 0!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;padding:14px!important;scroll-padding-bottom:12px;-webkit-overflow-scrolling:touch}
.viewport-chat>.chat-compose,.viewport-chat>.support-compose,.viewport-chat>.chat-media-tools{flex:0 0 auto;position:relative;background:var(--card,#fff);margin:0!important;padding:10px!important;border-top:1px solid #dce7e1}
.viewport-chat textarea[name=body]{font-size:16px!important;min-height:44px!important;max-height:100px!important;resize:none;overflow-y:auto}
.viewport-chat .chat-media-tools{padding:5px 10px!important;max-height:95px;overflow:auto}
.viewport-chat .chat-image-preview img{max-height:48px}
.viewport-chat .modern-message{flex-shrink:0}

.chat-keyboard-open .bottom-nav{visibility:hidden;pointer-events:none}
.chat-compose-toolbar{display:none}
@media(max-width:900px){
 body.chat-keyboard-open{overflow:hidden!important}
 .chat-screen.viewport-chat.chat-composing{position:fixed!important;z-index:10000;top:var(--chat-top,0px)!important;left:0!important;right:0!important;bottom:auto!important;width:100%!important;max-width:none!important;margin:0!important;border:0!important;border-radius:0!important;height:var(--chat-height)!important;min-height:0!important;box-shadow:0 0 0 100vmax rgba(0,0,0,.2);background:#f0f5f2!important}
 .chat-composing>.chat-compose-toolbar{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;padding:8px 14px;background:#fff;border-bottom:1px solid #dce7e1;color:#24533b}
 .chat-compose-toolbar button{width:auto;min-height:36px;margin:0;padding:6px 14px;border:1px solid #b9d6c8;border-radius:12px;background:#e9f6ef;color:#145d40;font:600 15px system-ui}
 .chat-composing>.message-list{padding:10px 12px!important}
 .chat-composing>.chat-compose,.chat-composing>.support-compose{padding:8px 10px!important;padding-bottom:10px!important}
 .chat-composing .support-compose>label{grid-template-columns:auto minmax(0,1fr)}
 .chat-composing .support-compose>small{display:none}
}

/* V3.11.259 – options are reachable without scrolling past the composer. */
.viewport-chat>.chat-compose-toolbar.has-chat-options{display:flex;align-items:center;gap:8px;flex:0 0 auto;padding:8px 12px;border-bottom:1px solid #dce7e1;background:#fff;color:#24533b}
.chat-compose-toolbar strong{margin-right:auto}
.chat-compose-toolbar button{width:auto;min-height:40px;margin:0;padding:7px 12px;border:1px solid #b9d6c8;border-radius:12px;background:#e9f6ef;color:#145d40;font:600 14px system-ui}
.chat-compose-toolbar .chat-keyboard-done{display:none}
.chat-composing>.chat-compose-toolbar .chat-keyboard-done{display:block}
.chat-options-dialog{box-sizing:border-box;position:fixed;inset:0;width:min(560px,calc(100% - 24px));max-width:none;max-height:calc(100dvh - 24px);margin:auto;padding:0;border:1px solid #d5e5db;border-radius:18px;background:#f6faf7;color:#263e31;box-shadow:0 18px 70px #102b2855;overflow-y:auto;overscroll-behavior:contain}
.chat-options-dialog::backdrop{background:rgba(12,32,22,.48)}
.chat-options-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid #dce7e1;background:#fff}
.chat-options-head h2{margin:0;font-size:18px}
.chat-options-head .btn{width:auto;min-height:42px;margin:0}
.chat-options-content{display:grid;gap:12px;padding:14px}
.chat-options-content>.chat-controls{display:grid!important;gap:10px!important;width:100%!important;max-width:none!important;margin:0!important;padding:12px!important;border:1px solid #dce7e1!important;border-radius:12px!important;background:#fff}
.chat-options-content>.chat-controls form{margin:0;min-width:0}
.chat-options-content>.chat-controls .btn{min-height:44px!important;width:100%;font-size:14px!important}
.chat-options-content .chat-delete-more>summary{padding:12px;font-size:14px!important}
.chat-options-content>.safety-panel,.chat-options-content>.card{margin:0;min-width:0}
.chat-options-content textarea,.chat-options-content select,.chat-options-content input{max-width:100%;box-sizing:border-box;font-size:16px}
