/* Shared chat controls for installed apps, customer conversations and admin. */
.conversation-tools{display:flex;align-items:center;gap:8px;padding:6px 12px;background:var(--panel);border-bottom:1px solid var(--line);flex:none;min-width:0;flex-wrap:wrap}
.conversation-tools button,.conversation-search button,.message-quick-actions button{font:inherit;color:inherit;min-height:40px;border:1px solid var(--line);border-radius:12px;background:var(--panel);padding:6px 10px;font-size:14px;cursor:pointer;margin:0}
.conversation-tools button:first-child{margin-right:auto}.chat-tools-feedback{font-size:13px;color:var(--muted)}
.conversation-search{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:8px 12px;background:var(--panel);flex:none}
.conversation-search input{flex:1;min-width:80px;width:0;margin:0;font-size:16px;min-height:44px}.conversation-search span{font-size:13px}
.conversation-search[hidden]{display:none}.chat-search-match{outline:1px solid var(--accent);outline-offset:3px;border-radius:16px}.chat-search-current{outline:3px solid var(--accent)}
.message-quick-actions{display:flex;align-items:center;gap:6px;flex-basis:100%;justify-content:flex-start;margin:4px 0 0;opacity:.8}.own .message-quick-actions{justify-content:flex-end}
.message-quick-actions button{font-size:12px;min-height:32px;padding:3px 9px}.chat-message{flex-wrap:wrap}.chat-message> .message-quick-actions{border:0;background:transparent;box-shadow:none;padding:0;animation:none}
.app-message .message-quick-actions{align-self:flex-start}.app-message.own .message-quick-actions{align-self:flex-end}
#chat-body,#app-message{min-width:0;width:100%;font-size:18px!important;line-height:1.5!important;scrollbar-width:thin;overscroll-behavior:contain}
.chat-message p,.message-bubble{overflow-wrap:anywhere;word-break:normal;user-select:text}.chat-attachment img,.chat-attachment video,.chat-file img,.chat-file video{max-width:100%;height:auto;object-fit:contain}
.chat-composer,.app-composer,.chat-composer>label{min-width:0}.chat-composer>label:not(.check){flex:1}.chat-composer button,.app-composer button{touch-action:manipulation;flex-shrink:0}
@media(max-width:650px){.conversation-tools{padding:5px 10px}.conversation-tools button{min-height:38px}.message-quick-actions button{min-height:40px}.chat-tools-feedback:empty{display:none}.chat-tools-feedback:not(:empty){flex-basis:100%}.chat-composer{padding:8px!important}.app-composer{padding:8px}.chat-message,.app-message{max-width:100%;min-width:0}.message-bubble{max-width:92%;font-size:18px}.chat-message>div:not(.message-quick-actions){min-width:0}.chat-toolbar{flex-wrap:wrap}.chat-room-heading{min-width:0}.chat-room-heading h2{overflow-wrap:anywhere}}
@media(max-height:560px){.conversation-heading,.chat-room-heading{padding:6px 10px!important;min-height:40px!important}.conversation-tools{padding:2px 8px}.conversation-tools button{min-height:32px}.conversation-search{padding:4px 8px}.app-header{padding:6px 12px}.app-chat .attachment-preview{max-height:80px}}
@media(prefers-reduced-motion:reduce){.chat-message,.app-message,.message-bubble{animation:none!important}}

.admin-chat-workspace.admin-chat-workspace .chat-message>.message-quick-actions{background:transparent;border:0;padding:0;box-shadow:none;animation:none;width:100%;max-width:100%}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace){height:var(--admin-chat-height,100dvh);min-height:0;overflow:hidden;display:flex;flex-direction:column}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace)>.app{flex:1;min-height:0;width:100%;max-width:1100px;display:flex;flex-direction:column;margin:0 auto;padding:0 12px}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .top{position:relative;flex:none;margin:0 -12px;padding:8px 12px;min-height:58px;gap:8px;flex-wrap:nowrap}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .top .brand{max-width:none}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .top .display-settings small{display:none}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .top .display-settings>summary{min-height:40px}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) main{display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) main>.notice,body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) main>.error-summary{flex:none;max-height:20dvh;overflow:auto;margin:6px 0;padding:8px 12px;font-size:14px}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .admin-chat-workspace.admin-chat-workspace{display:flex;flex:1;min-height:0;flex-direction:column;margin:0 auto;padding-bottom:8px}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .page-heading{flex:none}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .chat-app{flex:1;min-height:0}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .chat-sidebar{flex:none}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .chat-room{flex:1;min-height:0;height:auto}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .admin-app-nav{position:static;transform:none;left:auto;bottom:auto;width:100%;max-width:1100px;flex:none;margin:0 auto;padding:6px 8px calc(6px + env(safe-area-inset-bottom));border-radius:0}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .admin-app-nav a,body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .admin-app-nav button{min-width:0;min-height:54px;font-size:12px;padding:4px 2px}
body.chat-screen:has(.admin-chat-workspace.admin-chat-workspace) .admin-app-nav .unread-badge{min-width:18px;height:18px;font-size:11px}

body.chat-screen:has(.admin-chat-workspace) footer{flex:none;margin:0;padding:2px 8px;border:0;display:flex;justify-content:flex-end}body.chat-screen:has(.admin-chat-workspace) footer>span{display:none}body.chat-screen:has(.admin-chat-workspace) footer button{min-height:32px;padding:3px 9px;font-size:13px}body.admin-app:has(.admin-chat-workspace) footer{display:none}
body.chat-screen:has(.admin-chat-workspace) .top nav{display:flex;flex:1;min-width:0;overflow-x:auto;white-space:nowrap;flex-wrap:nowrap;scrollbar-width:thin}
body.chat-screen:has(.admin-chat-workspace) .top nav a{flex:none;font-size:13px;padding:6px 9px}
body.chat-screen:has(.admin-chat-workspace) .top>form{display:none}
@media(max-width:650px){body.chat-screen:has(.admin-chat-workspace) .top .brand{width:38px;min-width:38px;overflow:hidden}.admin-chat-workspace.admin-chat-workspace .page-heading>.button{font-size:12px;padding:6px 8px}.admin-chat-workspace.admin-chat-workspace .chat-sidebar{padding:6px 8px}.admin-chat-workspace.admin-chat-workspace .conversation{min-width:136px;flex-basis:136px;max-width:136px}.admin-chat-workspace.admin-chat-workspace .admin-translation-control .fine{max-height:32px;overflow:auto}.admin-chat-workspace.admin-chat-workspace .chat-room-heading{padding:8px 12px;min-height:48px}.admin-chat-workspace.admin-chat-workspace .chat-message p{font-size:18px}.admin-chat-workspace.admin-chat-workspace .chat-messages{padding:10px}}

body.chat-screen:has(.admin-chat-workspace) .top #express-update-offer{min-width:0;max-width:120px;flex:none;margin:0;font-size:12px;padding:0;overflow:hidden}
body.chat-screen:has(.admin-chat-workspace) .top #express-update-offer button{font-size:12px;padding:5px 7px;min-height:36px;white-space:normal}
.chat-conversation-settings{margin:3px 0 0;padding:0;border:0;font-size:13px}.chat-conversation-settings summary{cursor:pointer;padding:3px 0;min-height:30px}.chat-conversation-settings[open]{max-height:30dvh;overflow:auto}

.chat-emoji-picker{display:flex;gap:6px;flex-wrap:wrap;flex-basis:100%}.chat-emoji-picker[hidden]{display:none}.chat-emoji-picker button{font-size:22px;min-width:44px;min-height:44px}

body.chat-screen:has(.customer-chat-workspace){height:var(--conversation-height,100dvh);min-height:0;overflow:hidden;display:flex;flex-direction:column}
body.chat-screen:has(.customer-chat-workspace)>.app{flex:1;min-height:0;width:100%;max-width:1100px;margin:0 auto;padding:0 8px;display:flex;flex-direction:column}
body.chat-screen:has(.customer-chat-workspace) main{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
body.chat-screen:has(.customer-chat-workspace) main>.app-promotion,body.chat-screen:has(.customer-chat-workspace) main>.notification-permission,body.chat-screen:has(.customer-chat-workspace) footer{display:none}
body.chat-screen:has(.customer-chat-workspace) main>.notice{flex:none;margin:4px 0;padding:5px 10px;font-size:13px}
body.chat-screen:has(.customer-chat-workspace) .top{flex:none;position:relative;margin:0;padding:6px 8px;gap:6px;flex-wrap:wrap;min-height:52px}
body.chat-screen:has(.customer-chat-workspace) .top nav{display:flex;flex:1;min-width:0;overflow-x:auto;flex-wrap:nowrap;white-space:nowrap}.top nav>a{flex-shrink:0}
body.chat-screen:has(.customer-chat-workspace) .top #express-update-offer{max-width:120px;min-width:0;margin:0;padding:0;font-size:12px}
body.chat-screen:has(.customer-chat-workspace) .top #express-update-offer button{font-size:12px;min-height:32px;padding:4px 6px}
.customer-chat-workspace{display:flex;flex:1;min-height:0;flex-direction:column;min-width:0}
.customer-chat-workspace .page-heading{display:flex;align-items:center;gap:6px;margin:6px 0;flex:none}.customer-chat-workspace .page-heading>div{flex:1;min-width:0}.customer-chat-workspace .page-heading h1{font-size:20px;margin:0}.customer-chat-workspace .page-heading .eyebrow,.customer-chat-workspace .page-heading p{display:none}.customer-chat-workspace .page-heading>.button{font-size:12px;padding:6px 8px;min-height:38px;margin:0}
.customer-chat-workspace .chat-app{display:flex;flex-direction:column;flex:1;min-height:0;gap:6px}.customer-chat-workspace .chat-sidebar{flex:none;padding:4px 8px;margin:0;max-height:70px;overflow:auto}.customer-chat-workspace .chat-sidebar h2{display:none}.customer-chat-workspace .conversation-list{display:flex;overflow-x:auto;gap:6px}.customer-chat-workspace .conversation{flex:none;padding:4px 8px}.customer-chat-workspace .conversation small{display:none}.customer-chat-workspace .conversation .avatar{width:28px;height:28px;flex:none}
.customer-chat-workspace .chat-room{flex:1;min-height:0;padding:0;margin:0;display:flex;flex-direction:column;overflow:hidden}.customer-chat-workspace .chat-room:before,.customer-chat-workspace .chat-room:after{display:none}.customer-chat-workspace .chat-room-heading{flex:none;padding:6px 10px;margin:0;min-height:40px}.customer-chat-workspace .chat-room-heading h2{font-size:16px;margin:0}.customer-chat-workspace .chat-room-heading small{display:none}.customer-chat-workspace .chat-progress-prompt{flex:none;margin:0;padding:4px 10px;font-size:12px}.customer-chat-workspace .chat-progress-prompt>span{display:none}.customer-chat-workspace .chat-progress-prompt .button{min-height:30px;font-size:12px;padding:3px 8px}
.customer-chat-workspace #chat-delete{display:flex;flex-direction:column;flex:1;min-height:0;margin:0}.customer-chat-workspace #chat-messages{flex:1;min-height:0;height:auto;margin:0;padding:12px;overflow:auto}
.customer-chat-workspace .chat-composer{flex:none;margin:0;display:block;border-radius:0;padding:8px}.customer-chat-workspace .chat-composer>label{margin:0}.customer-chat-workspace .chat-composer>label>span{display:none}.customer-chat-workspace .composer-bottom{margin:4px 0 0;display:flex;justify-content:space-between}.customer-chat-workspace .emoji-tools{display:none}.customer-chat-workspace .composer-bottom>button{min-height:38px;padding:5px 12px;font-size:14px}
.customer-chat-workspace .chat-upload-panel{flex:none;padding:3px 10px;margin:0;max-height:35%;overflow:auto}.customer-chat-workspace .chat-upload-panel summary{font-size:13px;padding:4px 0}.customer-chat-workspace .chat-bottom{flex:none;max-height:28%;overflow:auto;font-size:12px;margin:0;padding:3px 10px}.customer-chat-workspace .chat-bottom>.fine{display:none}.customer-chat-workspace .chat-bottom button{font-size:12px;min-height:28px;padding:3px 8px}
@media(max-width:650px){body.chat-screen:has(.customer-chat-workspace) .top .brand{width:32px;min-width:32px;overflow:hidden}body.chat-screen:has(.customer-chat-workspace) .top nav a,body.chat-screen:has(.customer-chat-workspace) .top nav button{font-size:12px;min-height:32px;padding:4px 6px}body.chat-screen:has(.customer-chat-workspace) .top>form label{font-size:0}body.chat-screen:has(.customer-chat-workspace) .top>form select{font-size:12px;min-height:32px;width:88px;padding:3px}body.chat-screen:has(.customer-chat-workspace) .top .theme-hint{display:none}body.chat-screen:has(.customer-chat-workspace) .top .display-settings summary{font-size:12px;min-height:32px;padding:4px}}

body.chat-screen:has(.customer-chat-workspace) .device-notification-prompt{display:none}
.customer-chat-workspace .page-heading{flex-direction:row!important;flex-wrap:nowrap;text-align:left;align-items:center}.customer-chat-workspace .page-heading h1{font-size:20px;line-height:1.3}.customer-chat-workspace .page-heading>.button{white-space:nowrap}
.customer-chat-workspace #chat-body{font-weight:400}.customer-chat-workspace .chat-bottom{min-height:32px}.chat-screen #to-top{display:none}

.customer-chat-workspace .chat-sidebar:has(.conversation-list>a:only-child){display:none}@media(max-width:650px){.customer-chat-workspace .chat-progress-prompt{display:none}.customer-chat-workspace .page-heading h1{font-size:17px}.customer-chat-workspace .page-heading>.button{font-size:11px}}
.chat-image-open{display:block!important;width:100%;max-width:100%;padding:0!important;min-height:0!important;border:0!important;background:transparent!important;cursor:zoom-in;border-radius:12px;overflow:hidden}.chat-image-open img{display:block;max-width:100%;margin:auto}.chat-image-open:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
dialog.chat-image-viewer{box-sizing:border-box;width:min(1100px,calc(100vw - 24px));max-width:calc(100vw - 24px);height:min(850px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);padding:16px;border:1px solid var(--line);border-radius:20px;background:var(--panel,#fff);color:var(--ink,#14282d)}.chat-image-viewer::backdrop{background:rgba(5,12,20,.85)}.chat-image-viewer[open]{display:flex;flex-direction:column;gap:12px}.chat-image-viewer-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;flex-shrink:0}.chat-image-viewer-bar strong{flex:1 1 100%;overflow-wrap:anywhere;font-size:17px}.chat-image-viewer-bar button,.chat-image-viewer-bar a{font-size:16px!important;min-height:44px!important;padding:8px 14px!important}.chat-image-viewer-stage{flex:1;min-height:0;overflow:auto;display:grid;place-items:center;background:rgba(127,127,127,.08);border-radius:12px;overscroll-behavior:contain;touch-action:pan-x pan-y pinch-zoom}.chat-image-viewer-stage img{display:block;max-width:100%!important;max-height:100%!important;width:auto;height:auto;object-fit:contain}.chat-image-viewer.image-zoomed .chat-image-viewer-stage{display:block}.chat-image-viewer.image-zoomed .chat-image-viewer-stage img{max-width:none!important;max-height:none!important;margin:auto}.chat-image-viewer-stage p{padding:16px;font-size:17px}
