.internal-chat{display:grid;grid-template-columns:260px minmax(0,1fr);height:clamp(540px,76dvh,900px);min-width:0;border-radius:22px;overflow:hidden;color:var(--text-primary)}
.internal-chat>.chat-sidebar{min-height:0;overflow:hidden}
.internal-chat .chat-list{overscroll-behavior:contain}
@media(max-width:700px){.internal-chat>.chat-sidebar>.chat-more{display:none}}
@media(max-width:700px){.internal-chat .chat-message-scroll>.chat-older:not(.chat-newer){display:none}}
.chat-sidebar>.chat-new-group{margin:-6px 18px 0;min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;color:var(--text-secondary);font-size:13px}
.chat-group-dialog{width:min(580px,calc(100vw - 24px));padding:24px;color:var(--text-primary)}
.chat-group-dialog [hidden]{display:none!important}.chat-group-dialog *{box-sizing:border-box}
.chat-details>.chat-files-open{width:100%;display:flex;align-items:center;gap:12px;min-height:72px;padding:14px;text-align:left;border-radius:16px;background:var(--surface-field);box-shadow:none;color:var(--text-primary)}.chat-files-open>svg{flex:none;width:34px;height:34px;padding:7px;border-radius:10px;background:var(--accent-soft);color:var(--text-link)}.chat-files-open>span{display:grid;gap:5px;min-width:0}.chat-files-open strong{font-size:12px;font-weight:600;overflow-wrap:anywhere}.chat-files-open small{font-size:11px;color:var(--text-secondary)}.chat-details>.chat-files-open:hover{background:var(--surface-hover)}.chat-details>.chat-files-open:active{background:var(--surface-pressed)}
.chat-files-dialog{width:600px;max-width:calc(100vw - 24px);color:var(--text-primary)}.chat-files-dialog [hidden]{display:none!important}.chat-files-dialog .chat-files-context{font-size:12px;color:var(--text-secondary);margin:8px 0 0;overflow-wrap:anywhere}.chat-files-dialog .modal-content-scroll{display:grid;gap:14px}.chat-files-dialog .chat-shared{gap:10px}.chat-files-dialog .chat-shared>.chat-empty{margin:18px 0;padding:20px 12px;text-align:center;border:1px solid var(--line);border-radius:16px;background:var(--surface-field)}.chat-files-dialog .chat-image-link{display:block;overflow:hidden;border:1px solid var(--line);border-radius:12px;line-height:0}.chat-files-dialog .chat-image-link img{height:110px}.chat-files-dialog .chat-files-more,.chat-files-dialog .chat-files-retry{min-height:44px;justify-self:center;margin:0;font-size:12px}.chat-files-dialog .feedback{margin:0}
:root dialog.chat-files-dialog .modal-compact-header{padding-bottom:14px;border-bottom:1px solid var(--line)}.chat-files-dialog .chat-shared{display:flex;flex-direction:column;gap:20px}.chat-shared-section{min-width:0}.chat-shared-section>header{display:flex;align-items:center;gap:8px;margin-bottom:10px}.chat-files-dialog .chat-shared-section h3{margin:0;font-size:13px;font-weight:600;line-height:1.4;color:var(--text-primary)}.chat-shared-count{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;box-sizing:border-box;border:1px solid var(--line);border-radius:8px;background:var(--surface-field);color:var(--text-secondary);font-size:10px;line-height:1;font-variant-numeric:tabular-nums}
.chat-shared-photos{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.chat-files-dialog .chat-shared-photo{line-height:1.4;background:var(--surface-field);text-decoration:none;transition:border-color .15s}.chat-files-dialog .chat-shared-photo img{width:100%;height:108px;object-fit:cover;border-radius:0}.chat-shared-photo-caption{display:grid;gap:4px;padding:9px 10px;min-width:0}.chat-shared-photo-caption strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;color:var(--text-primary)}.chat-shared-photo-caption time{font-size:9px;color:var(--text-secondary);line-height:1.4}.chat-shared-documents{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.chat-files-dialog .chat-shared-documents .chat-file-link{grid-column:auto;min-width:0}
.chat-files-dialog .chat-shared-documents .chat-file-link{display:flex;flex-wrap:nowrap;align-items:center;gap:12px;min-height:64px;padding:10px 12px;border-radius:14px}.chat-files-dialog .chat-shared-file-type{display:grid;place-items:center;flex:0 0 38px;width:38px;height:42px;border:1px solid var(--line);border-radius:10px;background:var(--accent-soft);color:var(--text-link);font-size:10px;font-weight:600;letter-spacing:.3px}.chat-files-dialog .chat-shared-file-copy{display:grid;gap:5px;min-width:0;flex:1}.chat-shared-file-copy strong{font-size:12px;font-weight:500;color:var(--text-primary);line-height:1.4;overflow-wrap:anywhere}.chat-shared-file-meta{font-size:10px!important;line-height:1.5;color:var(--text-secondary)}.chat-files-dialog .chat-file-link:hover,.chat-files-dialog .chat-shared-photo:hover{background:var(--surface-hover)}.chat-files-dialog .chat-file-link:active,.chat-files-dialog .chat-shared-photo:active{background:var(--surface-pressed)}.chat-files-dialog .chat-image-link:focus-visible,.chat-files-dialog .chat-file-link:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}
@media(max-width:600px){.chat-shared-photos{grid-template-columns:repeat(2,minmax(0,1fr))}.chat-shared-documents{grid-template-columns:minmax(0,1fr)}.chat-files-dialog .chat-shared-photo img{height:96px}.chat-files-dialog .chat-shared-documents .chat-file-link{padding:10px;gap:10px}.chat-shared-photo-caption{padding:8px}.chat-shared-photo-caption time{font-size:9px}}
@media(max-width:600px){.chat-files-dialog .chat-shared{grid-template-columns:repeat(2,minmax(0,1fr))}.chat-files-dialog .chat-image-link img{height:96px}}
.chat-presence-label:empty{display:none}
.chat-group-dialog form{display:grid;gap:16px;min-width:0}.chat-group-dialog h3{margin:0 0 10px;font-size:14px}.chat-group-caption{font-size:12px;color:var(--text-secondary);line-height:1.5;margin:8px 0 0}
.chat-group-add-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.chat-group-dialog .chat-group-add-heading h3{margin:0;font-size:12px}.chat-group-add-heading .chat-group-selected{flex:none;font-size:10px;font-variant-numeric:tabular-nums}
.chat-group-dialog .chat-group-contact{min-height:56px;padding:8px 12px;gap:10px}.chat-group-contact-copy{flex:1;min-width:0;display:grid;gap:3px;text-align:left}.chat-group-dialog .chat-group-contact-copy strong{font-size:12px;line-height:1.35}.chat-group-contact-copy small{font-size:11px;line-height:1.3;color:var(--text-secondary)}.chat-group-dialog .chat-group-contact>.chat-avatar{width:34px;height:34px;flex-basis:34px;font-size:14px}.chat-group-dialog .chat-group-check{width:18px;flex:none;text-align:center}
:root dialog.chat-group-create{width:500px;padding:20px;border-radius:24px}:root dialog.chat-group-create .modal-content-scroll{gap:10px}:root dialog.chat-group-create form{gap:10px}:root dialog.chat-group-create .modal-compact-header{margin-bottom:10px}:root dialog.chat-group-create .customer-dialog-actions{margin-top:0;padding-top:12px}
:root dialog.chat-group-create .chat-group-photo-editor{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:8px 10px;padding:10px 12px;border-radius:14px}:root dialog.chat-group-create .chat-group-photo-copy{display:contents}:root dialog.chat-group-create .chat-group-photo-preview{grid-column:1;grid-row:1}:root dialog.chat-group-create .chat-group-photo-preview .chat-avatar.large{width:44px;height:44px;flex-basis:44px}:root dialog.chat-group-create .chat-group-photo-preview svg{width:24px;height:24px}:root dialog.chat-group-create .chat-group-photo-copy h3{grid-column:2;grid-row:1;align-self:center;margin:0;font-size:12px}:root dialog.chat-group-create .chat-group-photo-copy p{display:none}:root dialog.chat-group-create .chat-group-photo-actions{grid-column:3;grid-row:1;margin:0;justify-content:flex-end}:root dialog.chat-group-create .chat-group-photo-actions button{font-size:11px;padding:8px 10px}:root dialog.chat-group-create .chat-group-photo-editor:has(.chat-group-photo-draft:not([hidden])) .chat-group-photo-actions{grid-column:1/-1;grid-row:2;justify-content:flex-start}
:root dialog.chat-group-create .os-field{margin:0;font-size:11px}:root dialog.chat-group-create .chat-group-name{min-height:44px;padding:10px 12px;margin-top:5px}:root dialog.chat-group-create .chat-search{margin-bottom:8px}:root dialog.chat-group-create .chat-group-contacts{max-height:224px;border-radius:14px}
@media(max-width:600px){:root dialog.chat-group-create .customer-dialog-actions .chat-group-save{width:100%;flex:1;grid-column:1/-1;margin:0}}
@media(max-width:380px){:root dialog.chat-group-create .chat-group-photo-editor{grid-template-columns:44px minmax(0,1fr);gap:4px 10px}:root dialog.chat-group-create .chat-group-photo-preview{grid-row:1/span 2}:root dialog.chat-group-create .chat-group-photo-copy h3{grid-column:2;grid-row:1}:root dialog.chat-group-create .chat-group-photo-actions{grid-column:2;grid-row:2;justify-content:flex-start}:root dialog.chat-group-create .chat-group-photo-editor:has(.chat-group-photo-draft:not([hidden])) .chat-group-photo-actions{grid-column:1/-1;grid-row:3}}
.chat-group-photo-editor{display:flex;align-items:center;gap:16px;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--surface-field)}.chat-group-photo-preview{flex:none;display:grid;place-items:center}.chat-group-photo-preview .chat-avatar.large{width:76px;height:76px;flex-basis:76px}.chat-group-photo-preview svg{width:32px;height:32px}.chat-group-photo-copy{min-width:0;flex:1}.chat-group-photo-copy h3{margin:0 0 5px}.chat-group-photo-copy p{font-size:11px;color:var(--text-secondary);margin:0 0 10px;line-height:1.5}.chat-group-photo-actions{display:flex;flex-wrap:wrap;gap:6px}.chat-group-photo-actions button{min-height:44px;font-size:11px;padding:8px 11px}.chat-group-photo-draft{display:flex;flex-wrap:wrap;gap:6px;flex-basis:100%}.chat-group-photo-draft .submit-button{margin:0;width:auto}
@media(max-width:380px){.chat-group-photo-editor{gap:10px;padding:12px}.chat-group-photo-preview .chat-avatar.large{width:60px;height:60px;flex-basis:60px}.chat-group-photo-actions button{flex:1}.chat-group-photo-actions .chat-group-photo-draft button{flex:auto}}
@media(max-width:600px){.chat-group-photo-editor{display:grid;grid-template-columns:60px minmax(0,1fr);gap:6px 12px}.chat-group-photo-preview{grid-column:1;grid-row:1/span 2}.chat-group-photo-copy{display:contents}.chat-group-photo-copy h3{grid-column:2;margin:0;align-self:end}.chat-group-photo-copy p{grid-column:2;margin:0;align-self:start}.chat-group-photo-actions{grid-column:1/-1;margin-top:6px}.chat-group-photo-actions>button{flex:1}.chat-group-photo-draft>button{flex:1!important}.chat-group-photo-preview .chat-avatar.large{width:60px;height:60px;flex-basis:60px}}
.chat-group-dialog .chat-search{margin:0 0 10px}.chat-group-dialog .chat-search input{width:100%;min-width:0;min-height:44px;border:0!important;box-shadow:none!important;outline:none!important;background:transparent!important;padding:10px 0!important;color:var(--text-primary)}
.chat-group-contacts,.chat-group-member-list{max-height:240px;overflow:auto;border:1px solid var(--line);border-radius:16px}.chat-group-contact{min-height:64px;padding:10px 12px}.chat-group-contact strong{flex:1;overflow-wrap:anywhere;font-size:13px}.chat-group-check{visibility:hidden;color:var(--text-link)}.chat-group-contact[aria-pressed=true]{background:var(--accent-soft)}.chat-group-contact[aria-pressed=true] .chat-group-check{visibility:visible}
.chat-group-member{display:flex;align-items:center;gap:10px;padding:12px;border-bottom:1px solid var(--line)}.chat-group-member:last-child{border-bottom:0}.chat-group-member-copy{flex:1;min-width:0;display:grid;gap:4px;overflow-wrap:anywhere}.chat-group-member-copy strong{font-size:13px}.chat-group-member-copy small,.chat-group-selected{font-size:12px;color:var(--text-secondary)}
.chat-group-member .chat-group-direct{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;min-width:44px;width:44px;min-height:44px;height:44px;padding:11px;border-radius:12px;box-shadow:none;color:var(--text-link);background:var(--accent-soft)}.chat-group-direct .icon{width:20px;height:20px}.chat-group-member .chat-group-direct:hover{background:var(--surface-hover)}.chat-group-member .chat-group-direct:active{background:var(--surface-pressed)}.chat-group-member .chat-group-direct:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}
.chat-group-dialog .chat-group-member-search-wrap{gap:8px;margin:0 0 8px;padding-right:2px}.chat-group-member-search-clear{display:inline-grid;place-items:center;width:44px;height:44px;min-width:44px;flex:none;border:0;border-radius:10px;box-shadow:none;background:transparent;color:var(--text-secondary);cursor:pointer}.chat-group-member-search-clear:hover{background:var(--surface-hover)}.chat-group-member-search-clear:active{background:var(--surface-pressed)}.chat-group-member-search-clear:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-group-dialog .chat-group-member-empty{margin:0;padding:22px 12px;font-size:12px;text-align:center;color:var(--text-secondary)}.chat-group-member-search::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
.chat-group-member-actions{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;max-width:180px}.chat-group-member-actions button{font-size:11px;min-height:44px;padding:8px}.chat-group-leave{margin-right:auto;color:var(--text-secondary)}.chat-group-sender{display:block;color:var(--text-link);font-size:12px;margin-bottom:6px}.chat-group-manage{margin-top:14px;min-height:44px}
.chat-profile .chat-group-avatar-stack{display:inline-flex;align-items:center;justify-content:center;min-height:44px;max-width:100%;margin:0;padding:3px 5px;background:transparent;border:0;border-radius:24px;color:var(--text-secondary);box-shadow:none;cursor:pointer}.chat-group-avatar-stack .chat-avatar{box-sizing:border-box;flex:0 0 34px;width:34px;height:34px;font-size:12px;border:2px solid var(--surface-field)}.chat-group-avatar-stack .chat-avatar+.chat-avatar{margin-left:-9px}.chat-group-avatar-stack .chat-group-avatar-more{font-size:10px;background:var(--surface-field);color:var(--text-secondary);font-variant-numeric:tabular-nums}.chat-profile .chat-group-avatar-stack:hover{background:var(--surface-hover)}.chat-profile .chat-group-avatar-stack:active{background:var(--surface-pressed)}.chat-profile .chat-group-avatar-stack:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}
.chat-share-mode{display:flex;gap:8px}.chat-share-mode button{flex:1;min-height:44px}.chat-share-mode button[aria-pressed=true]{background:var(--accent-soft);color:var(--text-link);border-color:var(--accent-ring)}
@media(max-width:600px){.chat-group-dialog{padding:18px}.chat-group-member{flex-wrap:wrap}.chat-group-member-actions{max-width:none;width:100%;padding-left:46px}.chat-group-member-actions button{flex:1}.chat-group-dialog .customer-dialog-actions{flex-wrap:wrap}.chat-group-dialog .customer-dialog-actions button{flex:1}.chat-group-contacts,.chat-group-member-list{max-height:210px}}
.internal-chat [hidden],.chat-picker [hidden]{display:none!important}.internal-chat *,.chat-picker *{box-sizing:border-box}
.internal-chat button,.chat-picker button{font:inherit;cursor:pointer}.internal-chat button:disabled,.chat-picker button:disabled{cursor:default;opacity:.6}
.internal-chat button:focus-visible,.internal-chat a:focus-visible,.chat-picker button:focus-visible{outline:2px solid var(--text-link);outline-offset:-3px}
.chat-sidebar{display:flex;flex-direction:column;gap:14px;padding:20px 0 12px;border-right:1px solid var(--line);min-width:0;background:var(--surface-field)}
.chat-list-heading{display:flex;align-items:center;justify-content:space-between;padding:0 20px}.chat-list-heading h2{font-size:20px;font-weight:500;margin:0}.chat-count{font-size:11px;color:var(--text-secondary)}
.chat-sidebar>.chat-new{margin:0 18px;border-radius:24px;min-height:44px;justify-content:center;font-size:13px}
.chat-search{display:flex;align-items:center;gap:9px;min-width:0;margin:0 14px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-field);color:var(--text-secondary)}
.chat-search .icon{width:18px;height:18px;flex-shrink:0}.chat-search:focus-within{outline:2px solid var(--accent-ring);border-color:var(--text-link)}
:root .chat-search input,:root dialog:is(.chat-picker,.chat-record-picker,.chat-share-dialog,.chat-message-search-dialog) .chat-search input{min-width:0;width:100%;border:0;background:transparent;box-shadow:none;outline:none;border-radius:0;margin:0;padding:10px 0;font:inherit;font-size:13px;color:var(--text-primary);min-height:44px}
.chat-list{overflow:auto;min-height:0;flex:1}.chat-conversation,.chat-contact{display:flex;align-items:center;gap:12px;width:100%;padding:16px 18px;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left;color:var(--text-primary);border-left:2px solid transparent}
.chat-conversation:hover,.chat-contact:hover{background:var(--surface-hover)}.chat-conversation:active,.chat-contact:active{background:var(--surface-pressed)}.chat-conversation[aria-current=true]{background:var(--accent-soft);border-left-color:var(--text-link)}
.chat-sidebar .chat-conversation{position:relative;min-height:64px;padding:14px 20px;border-radius:0;box-shadow:none}
.chat-sidebar .chat-conversation[aria-current=true]::before{content:'';position:absolute;inset:0 auto 0 -2px;width:2px;background:var(--text-link);pointer-events:none}
.chat-sidebar .chat-conversation>.chat-avatar{width:36px;height:36px;flex-basis:36px;font-size:15px}
.chat-sidebar .chat-conversation-copy strong{font-weight:600}
.chat-avatar{height:42px;width:42px;flex:0 0 42px;border-radius:50%;display:grid;place-items:center;background:var(--accent-soft);color:var(--text-link);font-size:17px;font-weight:600;overflow:hidden}.chat-avatar img{width:100%;height:100%;object-fit:cover}.chat-avatar.large{height:100px;width:100px;flex-basis:100px;font-size:36px}
.chat-conversation-copy{flex:1;min-width:0;display:grid;gap:5px}.chat-conversation-copy strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-conversation-copy small{color:var(--text-secondary);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-conversation-meta{display:grid;justify-items:end;gap:6px;font-size:10px;color:var(--text-secondary)}
.chat-unread{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;box-sizing:border-box;min-width:19px;height:19px;padding:0 5px;background:var(--accent);color:var(--on-accent,#fff);border-radius:20px;font-size:10px;font-weight:600;line-height:1;text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}.chat-empty{font-size:12px;line-height:1.6;text-align:center;padding:16px;color:var(--text-secondary)}
.chat-sidebar>.glass-button,.chat-sidebar>.feedback{margin:0 14px}.chat-thread{min-width:0;min-height:0;background:var(--surface-page);position:relative}.chat-welcome{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px}.chat-welcome h2{font-size:18px;margin:20px 0 0}.chat-welcome p{font-size:13px;color:var(--text-secondary);line-height:1.6;max-width:300px}.chat-welcome-icon{display:grid;place-items:center;width:64px;height:64px;background:var(--accent-soft);color:var(--text-link);border-radius:22px}.chat-welcome-icon .icon{width:30px;height:30px}
.chat-message-search-dialog{width:min(540px,calc(100vw - 24px))}.chat-message-search-context{margin:6px 0 0;font-size:12px;color:var(--text-secondary);overflow-wrap:anywhere}.chat-message-search-form{display:flex;gap:8px;align-items:center;margin-top:18px}.chat-message-search-form .chat-search{flex:1;min-width:0;margin:0}.chat-message-search-form>button{min-height:44px;padding:8px 12px;font-size:12px}.chat-message-search-status{font-size:12px;color:var(--text-secondary);margin:12px 0}.chat-message-search-results{display:grid;gap:8px}.chat-message-search-result{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;width:100%;min-height:64px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-field);color:var(--text-primary);text-align:left;font:inherit;cursor:pointer}.chat-message-search-result strong{font-size:12px;overflow-wrap:anywhere}.chat-message-search-result time{font-size:10px;color:var(--text-secondary)}.chat-message-search-result>span{grid-column:1/-1;font-size:12px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.chat-message-search-result:hover{background:var(--surface-hover)}.chat-message-search-result:active{background:var(--surface-pressed)}.chat-message-search-result:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}.chat-message.is-search-target .chat-bubble{outline:2px solid var(--text-link);outline-offset:3px}.chat-message-search-more,.chat-message-search-retry{margin-top:12px;min-height:44px;font-size:12px}.chat-message-search-error{font-size:12px}.chat-message-search-open{flex:none}@media(max-width:400px){.chat-message-search-result{grid-template-columns:minmax(0,1fr)}.chat-message-search-result>span{grid-column:1}.chat-message-search-form{gap:5px}}
.chat-active{height:100%;display:flex;flex-direction:column;min-height:0}.chat-thread-head{display:flex;align-items:center;gap:10px;padding:14px 20px;border-bottom:1px solid var(--line);background:var(--surface-field);flex-shrink:0}.chat-contact-heading{display:flex;align-items:center;gap:12px;flex:1;min-width:0}.chat-contact-heading>div{min-width:0;display:grid;gap:4px}.chat-contact-heading strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-contact-heading small{font-size:11px;color:var(--text-secondary)}
.chat-icon-button{display:inline-grid;place-items:center;box-sizing:border-box;width:44px;min-width:44px;min-height:44px;flex-shrink:0;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--text-secondary);padding:10px;cursor:pointer}.chat-icon-button .icon{width:18px;height:18px}.chat-icon-button:hover:not(:disabled){background:var(--surface-hover);color:var(--text-link)}.chat-icon-button:active:not(:disabled){background:var(--surface-pressed)}.chat-icon-button:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-icon-button:disabled{opacity:.5;cursor:default}.chat-back{display:none}
.chat-message-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px 24px;scrollbar-gutter:stable;overflow-anchor:none}.chat-messages{display:flex;flex-direction:column;gap:20px}.chat-day{display:flex;align-items:center;gap:18px;font-size:10px;text-transform:uppercase;color:var(--text-secondary);margin:10px 0}.chat-day:before,.chat-day:after{content:'';flex:1;height:1px;background:var(--line)}
.chat-message{display:flex;align-items:flex-start;gap:12px;min-width:0}.chat-message>.chat-avatar{height:34px;width:34px;flex-basis:34px;font-size:13px}.chat-message-content{max-width:78%;min-width:0;display:grid;gap:6px}.chat-bubble{padding:14px 17px;background:var(--surface-field);border-radius:0 18px 18px;min-width:0;overflow:hidden}.chat-bubble p{margin:0;font-size:13px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.chat-message-meta{font-size:10px;color:var(--text-secondary);text-align:right;padding:0 2px}.chat-message.is-own{flex-direction:row-reverse}.chat-message.is-own .chat-bubble{background:var(--accent-soft);border-radius:18px 0 18px 18px}.chat-message.is-own .chat-message-meta{text-align:left}
.chat-file-link{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;color:var(--text-link);text-decoration:none;font-size:12px;overflow-wrap:anywhere}.chat-file-link .icon{width:20px;height:20px;flex-shrink:0}.chat-file-link span{min-width:0;flex:1}.chat-file-link small{color:var(--text-secondary);font-size:10px}.chat-file-link img{max-width:100%;width:260px;max-height:260px;object-fit:contain;border-radius:10px;display:block}.chat-bubble p+.chat-file-link{margin-top:10px}.chat-image-link img{width:100%;height:76px;object-fit:cover;border-radius:10px}.chat-shared .chat-file-link{grid-column:1/-1;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-field)}
.chat-composer{display:grid;gap:6px;margin:12px 18px 14px;flex-shrink:0}.chat-compose-row{display:flex;align-items:center;gap:6px;background:var(--surface-field);padding:5px;border:1px solid var(--line);border-radius:26px}.chat-compose-row:focus-within{border-color:var(--text-link)}
.chat-compose-row textarea{border:0;box-shadow:none;outline:0;resize:none;background:transparent;color:var(--text-primary);font:inherit;font-size:13px;line-height:1.5;padding:10px 0;width:100%;min-width:0;max-height:100px;min-height:42px}.chat-compose-row .chat-send{min-height:42px;border-radius:23px;padding:10px 22px;font-size:12px;flex-shrink:0}.chat-composer>small{font-size:10px;color:var(--text-secondary);padding-left:14px}.chat-pending{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface-field);padding:2px 4px 2px 12px;font-size:12px}.chat-pending span{min-width:0;overflow-wrap:anywhere}.chat-thread .feedback{font-size:12px;margin:6px 18px;padding:10px;border-radius:10px}.chat-thread-retry,.chat-latest{align-self:center;min-height:34px;font-size:11px;padding:6px 12px}.chat-older{display:block;margin:0 auto 16px;font-size:11px;min-height:36px;padding:7px 14px}.chat-message-empty{text-align:center;font-size:13px;color:var(--text-secondary);padding:20px}
.internal-chat.has-details{grid-template-columns:240px minmax(0,1fr) 260px}.chat-details{min-width:0;overflow:auto;padding:18px;background:var(--surface-field);border-left:1px solid var(--line)}.chat-details>header{display:flex;align-items:center;justify-content:space-between}.chat-details h2{font-size:14px;margin:0}.chat-details h3{font-size:12px;margin:28px 0 14px;color:var(--text-secondary);font-weight:500}.chat-profile{display:flex;align-items:center;flex-direction:column;gap:8px;text-align:center;padding:22px 0}.chat-profile strong{font-size:18px;overflow-wrap:anywhere;max-width:100%;margin-top:6px}.chat-profile small{font-size:12px;color:var(--text-secondary)}.chat-shared{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.chat-shared>.chat-empty{grid-column:1/-1}.chat-files-more{display:block;margin:18px auto 0;font-size:12px}
.chat-picker{width:440px}.chat-picker .chat-search{margin:0}.chat-contacts{display:grid}.chat-contact{padding:12px 6px;border-left:0}.chat-contact>span:last-child{min-width:0;display:grid;gap:5px}.chat-contact strong{font-size:13px;overflow-wrap:anywhere}.chat-contact small{font-size:11px;color:var(--text-secondary)}
@media(max-width:1200px){.internal-chat.has-details{grid-template-columns:220px minmax(0,1fr);position:relative}.chat-details{position:absolute;right:0;top:0;bottom:0;width:280px;z-index:2;box-shadow:-8px 0 30px #00000015}}
@media(max-width:700px){.internal-chat,.internal-chat.has-details{grid-template-columns:minmax(0,1fr);height:clamp(460px,76dvh,800px);border-radius:18px}.internal-chat[data-view=list]>.chat-thread{display:none}.internal-chat[data-view=thread]>.chat-sidebar{display:none}.chat-back{display:inline-grid}.chat-sidebar{border:0}.chat-thread-head{padding:10px 8px;gap:4px}.chat-contact-heading{gap:8px}.chat-message-scroll{padding:10px 12px}.chat-message-content{max-width:85%}.chat-message{gap:7px}.chat-message>.chat-avatar{display:none}.chat-bubble{padding:11px 13px}.chat-composer{margin:8px}.chat-compose-row{gap:2px}.chat-compose-row textarea{font-size:16px}.chat-compose-row .chat-send{padding:10px 13px}.chat-compose-row .chat-icon-button{width:36px;padding:7px}.chat-details{width:100%;border:0}.chat-shared{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.internal-chat *{scroll-behavior:auto!important}}
/* Global submit buttons fill forms; the chat composer keeps a compact send action. */
.internal-chat .chat-compose-row .chat-send{width:auto;margin:0}
.internal-chat .chat-sidebar>.chat-new{width:calc(100% - 36px)}
/* Compact account-wide unread badge. */
.chat-nav-unread{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:21px;height:21px;margin-left:auto;padding:0 6px;border:1px solid var(--accent-ring);border-radius:20px;background:var(--accent-soft);color:var(--text-link);font-size:10px;font-weight:700;line-height:1;white-space:nowrap;font-variant-numeric:tabular-nums}
.chat-nav-unread[hidden]{display:none!important}
/* The search shell owns both the border and focus ring. */
:root dialog:is(.chat-picker,.chat-record-picker,.chat-share-dialog,.chat-message-search-dialog).mobile-scroll-shell .chat-search>input,:root dialog:is(.chat-picker,.chat-record-picker,.chat-share-dialog,.chat-message-search-dialog).mobile-scroll-shell .chat-search>input:focus{border:0!important;outline:none!important;box-shadow:none!important;background:transparent;border-radius:0}
/* Chat access belongs to the authenticated header. */
body:not(.in-workspace) #chat-header{display:none}
.chat-top-trigger{position:relative;display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:10px;border-radius:50%;color:var(--text-secondary);text-decoration:none}
.chat-top-trigger .icon{width:21px;height:21px}
#chat-header[aria-current=page]{background:var(--accent-soft);color:var(--text-link);border-color:var(--accent-ring)}
#chat-header .chat-nav-unread{position:absolute;top:-4px;right:-5px;margin:0;min-width:18px;height:18px;padding:0 4px;background:var(--surface-field);border-color:var(--accent-ring);box-shadow:0 2px 5px #0000000a;font-size:9px}
.chat-top-trigger:hover{background:var(--surface-hover)}.chat-top-trigger:active{background:var(--surface-pressed)}.chat-top-trigger:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}
.chat-list-heading{gap:8px}.chat-list-heading h2{flex:1}.chat-sound{padding:10px}.chat-sound[aria-pressed=true]{color:var(--text-link)}
@media(max-width:700px){body.in-workspace #chat-header{grid-column:4;grid-row:2;width:44px;height:44px;min-height:44px;padding:10px;border-radius:10px;box-shadow:none}body.in-workspace #chat-header>.icon{width:18px;height:18px}}
/* Non-modal conversation preview anchored near the authenticated chat access. */
.chat-preview{position:fixed;inset:78px 24px auto auto;margin:0;width:360px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 100px);padding:0;border-radius:18px;color:var(--text-primary);overflow:hidden;z-index:1200;box-sizing:border-box}
.chat-preview[hidden],.chat-preview [hidden]{display:none!important}.chat-preview:popover-open,.chat-preview:not([hidden]){display:flex;flex-direction:column}
.chat-preview>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);flex-shrink:0}.chat-preview h2{font-size:15px;margin:0;line-height:1.4}.chat-preview header p{font-size:11px;margin:4px 0 0;color:var(--text-secondary)}
.chat-preview-list{overflow:auto;min-height:0;max-height:380px;overscroll-behavior:contain}.chat-preview-item{display:flex;align-items:center;gap:10px;width:100%;min-height:78px;padding:13px 14px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--text-primary);font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.chat-preview-item.has-unread{background:var(--accent-soft)}.chat-preview-item:hover{background:var(--surface-hover)}.chat-preview-item:active{background:var(--surface-pressed)}.chat-preview-item:focus-visible{outline:2px solid var(--text-link);outline-offset:-3px}
.chat-preview-copy{display:grid;gap:5px;flex:1;min-width:0}.chat-preview-copy strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-preview-copy small{font-size:11px;line-height:1.5;color:var(--text-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.chat-preview-meta{display:grid;justify-items:end;gap:6px;flex-shrink:0;font-size:10px;color:var(--text-secondary)}
.chat-preview>footer{padding:12px;text-align:center;border-top:1px solid var(--line);flex-shrink:0}.chat-preview footer a{display:flex;min-height:44px;align-items:center;justify-content:center;border-radius:10px;color:var(--text-link);font-size:12px;font-weight:600;text-decoration:none}.chat-preview footer a:hover{background:var(--surface-hover)}.chat-preview footer a:focus-visible{outline:2px solid var(--text-link)}
.chat-preview>.feedback{margin:12px;font-size:12px;line-height:1.5;color:var(--text-error)}.chat-preview>.chat-preview-retry{align-self:center;margin:0 12px 12px;min-height:44px;font-size:12px}
@media(max-width:700px){.chat-preview{top:116px;right:10px;width:360px;max-width:calc(100vw - 20px);max-height:calc(100dvh - 130px);border-radius:16px}.chat-preview-list{max-height:340px}.chat-preview-item{padding:12px;gap:9px}}
.chat-preview-mark-all{display:block;min-height:44px;margin:0 0 -6px -7px;padding:8px 7px;border:0;border-radius:8px;background:transparent;color:var(--text-link);font:inherit;font-size:11px;text-align:left;cursor:pointer}
.chat-preview-mark-all:hover:not(:disabled){background:var(--surface-hover)}.chat-preview-mark-all:active:not(:disabled){background:var(--surface-pressed)}.chat-preview-mark-all:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-preview-mark-all:disabled{color:var(--text-secondary);opacity:.65;cursor:default}
/* Reading and opening are separate sibling actions, with no nested buttons. */
.chat-preview-row{display:flex;align-items:center;min-width:0;border-bottom:1px solid var(--line)}
.chat-preview-row.has-unread{background:var(--accent-soft)}
.chat-preview-row .chat-preview-item{flex:1;min-width:0;width:auto;border-bottom:0;background:transparent}
.chat-preview-row .chat-preview-item:hover{background:var(--surface-hover)}.chat-preview-row .chat-preview-item:active{background:var(--surface-pressed)}
.chat-preview-mark-one{margin-right:7px;color:var(--text-link)}.chat-preview-mark-one:disabled{opacity:.55;cursor:default}
.chat-preview-mark-one:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}
.chat-preview-filters{display:flex;gap:6px;flex-shrink:0;padding:8px 12px;border-bottom:1px solid var(--line)}
.chat-preview-filters button{flex:1;min-width:0;min-height:44px;border:1px solid transparent;border-radius:10px;padding:8px 10px;background:transparent;color:var(--text-secondary);font:inherit;font-size:12px;cursor:pointer}
.chat-preview-filters button[aria-pressed=true]{background:var(--accent-soft);border-color:var(--accent-ring);color:var(--text-link);font-weight:600}
.chat-preview-filters button:hover:not(:disabled){background:var(--surface-hover)}.chat-preview-filters button:active:not(:disabled){background:var(--surface-pressed)}.chat-preview-filters button:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-preview-filters button:disabled{opacity:.6;cursor:default}
.chat-preview-show-all{display:block;min-height:44px;margin:0 auto 16px;font-size:12px}
.chat-preview-filters button{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.chat-preview-unread-count,.chat-filter-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;box-sizing:border-box;padding:2px 5px;border:1px solid var(--accent-ring);border-radius:12px;background:var(--accent-soft);color:var(--text-link);font-size:10px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums}
.chat-preview-search{flex-shrink:0;margin:10px 12px 0;padding:0 4px 0 11px;background:var(--surface-field)}
:root .chat-preview .chat-preview-search input,:root .chat-preview .chat-preview-search input:focus{border:0!important;outline:none!important;box-shadow:none!important;background:transparent;min-height:44px}
.chat-preview-search input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
.chat-preview-search-clear{width:44px;min-width:44px;margin:0;padding:11px}
.chat-preview-list[aria-busy=true]{opacity:.65}
.chat-preview-clear-empty{display:block;min-height:44px;margin:0 auto 16px;font-size:12px}
@media(max-width:700px){:root .chat-preview .chat-preview-search input{font-size:16px}}
@media(max-height:600px){.chat-preview{top:8px;max-height:calc(100dvh - 16px)}.chat-preview>header{padding-block:6px}.chat-preview>footer{padding:6px 12px}}
@media(max-height:600px){.chat-preview>.feedback{margin:6px 12px;padding:6px 8px}}
/* Desktop shares the navigation's height; mobile keeps its independent conversation view. */
@media(min-width:701px){#workspace-panel .internal-chat{height:var(--workspace-panel-height);min-height:0}}
.chat-conversation-meta time,.chat-preview-meta time{display:grid;justify-items:end;gap:3px;white-space:nowrap;line-height:1.25}
.chat-conversation-meta time>span:first-child,.chat-preview-meta time>span:first-child{font-size:9px}
.chat-receipt{display:inline-block;margin-right:4px;font-size:12px;color:var(--text-secondary)}.chat-receipt.is-read{color:var(--text-link)}
.chat-avatar.has-presence{position:relative;overflow:visible}.chat-avatar.has-presence img{border-radius:50%}
.chat-avatar.has-presence::after{content:'';position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border:2px solid var(--surface-field);border-radius:50%;background:var(--text-subtle);box-sizing:border-box}
.chat-avatar.has-presence[data-online=true]::after{background:var(--text-success)}
.chat-avatar.large.has-presence::after{width:20px;height:20px;border-width:3px;right:3px;bottom:3px}
.chat-composer{position:relative}
.chat-emoji-panel{position:absolute;bottom:calc(100% + 8px);left:0;width:320px;max-width:100%;max-height:min(280px,40dvh);overflow:auto;padding:12px;border:1px solid var(--line);border-radius:16px;background:var(--surface-field);box-shadow:0 8px 28px #0002;z-index:3;overscroll-behavior:contain}
.chat-emoji-panel>strong{display:block;font-size:12px;margin:0 0 8px;color:var(--text-secondary)}
.chat-emoji-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:2px}
.internal-chat .chat-emoji-choice{display:grid;place-items:center;min-width:0;width:100%;height:44px;margin:0;padding:4px;border:0;border-radius:9px;background:transparent;font-size:24px;line-height:1}
.chat-emoji-choice:hover{background:var(--surface-hover)}.chat-emoji-choice:active{background:var(--surface-pressed)}
.chat-emoji-trigger[aria-expanded=true]{background:var(--accent-soft);color:var(--text-link)}
.chat-presence-label{font-size:10px;line-height:1.5;color:var(--text-secondary);overflow-wrap:anywhere}
.chat-contact-heading .chat-presence-label{font-size:10px;white-space:normal}
.chat-profile .chat-presence-label{font-size:11px;max-width:100%;margin-top:0}
@media(max-width:700px){.chat-emoji-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.chat-emoji-panel{width:280px}}
.chat-photo-viewer{width:min(980px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:18px;border-radius:24px;overflow:hidden;box-sizing:border-box;color:var(--text-primary)}
.chat-photo-viewer[open]{display:flex;flex-direction:column;gap:12px}.chat-photo-viewer .customer-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;flex-shrink:0}.chat-photo-viewer header>div{min-width:0}.chat-photo-viewer h2{margin:0;font-size:18px}.chat-photo-viewer header p{margin:4px 0 0;font-size:11px;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-photo-viewer .chat-icon-button{min-width:44px;height:44px}
.chat-photo-stage{height:min(62dvh,580px);min-height:100px;min-width:0;position:relative;display:grid;place-items:center;overflow:hidden;border-radius:16px;background:var(--surface-page);touch-action:none;user-select:none;cursor:grab;flex-shrink:1}.chat-photo-stage:active{cursor:grabbing}.chat-photo-stage img{max-width:100%;max-height:100%;object-fit:contain;transform-origin:center;user-select:none}.chat-photo-stage:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}
.chat-photo-controls{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;flex-shrink:0}.chat-photo-controls label{display:flex;align-items:center;gap:6px;min-width:0;font-size:11px;color:var(--text-secondary)}.chat-photo-controls input{width:110px;min-width:0;accent-color:var(--text-link)}.chat-photo-controls output{min-width:36px}.chat-photo-controls button,.chat-photo-controls a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;margin:0;padding:8px 12px;font:inherit;font-size:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-field);color:var(--text-link);text-decoration:none;cursor:pointer}.chat-photo-controls button:hover,.chat-photo-controls a:hover{background:var(--surface-hover)}.chat-photo-controls button:active,.chat-photo-controls a:active{background:var(--surface-pressed)}
.chat-audio{width:280px;max-width:100%;min-width:0;display:grid;gap:6px}.chat-audio audio{width:100%;max-width:100%;height:44px;min-width:0}.chat-audio small{font-size:11px;color:var(--text-error);line-height:1.5}.chat-shared>.chat-audio{grid-column:1/-1;width:100%}.chat-pending{flex-wrap:wrap}.chat-pending-audio{flex:1 0 100%;width:100%;max-width:100%;height:44px;margin:4px 0}.chat-voice-recording{display:flex;align-items:center;gap:8px;min-width:0;padding:8px;border:1px solid var(--line);border-radius:16px;background:var(--surface-field);color:var(--text-primary)}.chat-voice-recording>span{flex:1;font-size:12px}.chat-voice-recording output{font-size:12px;color:var(--text-error);font-variant-numeric:tabular-nums}.chat-mic{color:var(--text-link)}
.chat-composer:has(.chat-voice-recording:not([hidden])) .chat-compose-row{display:none}.chat-voice-recording>span::before{content:'';display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:50%;background:var(--text-error)}
.chat-audio{width:280px;gap:4px;position:relative}.chat-audio audio{display:none!important}.chat-audio-controls{display:grid;grid-template-columns:44px minmax(0,1fr) 44px 44px;align-items:center;gap:3px;min-width:0}
.internal-chat .chat-audio-play{border-radius:50%;background:var(--accent-soft);color:var(--text-link);width:44px;height:44px;min-height:44px;padding:11px}.chat-audio-play .icon{width:22px;height:22px}.chat-audio-play:hover{background:var(--surface-hover)}.chat-audio-play:active{background:var(--surface-pressed)}
.chat-audio-middle{min-width:0;position:relative;height:44px}.chat-audio-wave{min-width:0;height:44px;display:flex;align-items:center;cursor:pointer;touch-action:pan-y;border-radius:8px;color:var(--text-link)}.chat-audio-wave svg{display:block;width:100%;height:24px;transform:translateY(-6px);overflow:visible}.chat-audio-wave rect{fill:var(--text-subtle);opacity:.45}.chat-audio-wave rect.is-played{fill:var(--text-link);opacity:1}.chat-audio-wave:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}.chat-audio-wave[aria-disabled=true]{cursor:default}
.chat-audio-time{position:absolute;left:0;bottom:0;pointer-events:none;font-size:10px;line-height:1.4;color:var(--text-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;min-height:14px}
.chat-bubble:has(>.chat-audio){padding-block:10px}
.internal-chat .chat-audio-speed{width:44px;min-width:44px;height:44px;padding:0;border-radius:12px;font-size:11px;font-weight:600;color:var(--text-link);font-variant-numeric:tabular-nums}.internal-chat .chat-audio-more{width:44px;min-width:44px;height:44px;padding:6px;border-radius:10px}.chat-audio-more .icon{width:18px;height:18px}
.chat-audio-menu{position:fixed;inset:auto;margin:0;width:156px;max-width:calc(100vw - 16px);padding:5px;border:1px solid var(--line);border-radius:12px;background:var(--surface-field);color:var(--text-primary);box-shadow:0 8px 24px #0002;z-index:1600;box-sizing:border-box}.chat-audio-menu[hidden]{display:none!important}.chat-audio-menu a{display:flex;align-items:center;min-height:44px;padding:8px 10px;border-radius:8px;color:var(--text-link);font-size:12px;text-decoration:none;box-sizing:border-box}.chat-audio-menu a:hover{background:var(--surface-hover)}.chat-audio-menu a:active{background:var(--surface-pressed)}.chat-audio-menu a:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}
.chat-pending-audio{height:auto;min-height:44px}.chat-pending-audio .chat-audio{width:100%}
.chat-recording-middle{flex:1;min-width:0;display:grid;gap:3px}.chat-recording-middle>span{color:var(--text-secondary);font-size:10px;line-height:1.3;white-space:nowrap}.chat-recording-middle>span::before{content:'';display:inline-block;width:6px;height:6px;margin-right:5px;border-radius:50%;background:var(--text-error)}
.chat-recording-wave{display:block;width:100%;height:28px;overflow:hidden}.chat-recording-wave rect{fill:var(--text-link)}.chat-voice-recording output{flex-shrink:0;min-width:34px;text-align:center;line-height:1;font-size:11px}.chat-voice-recording>.chat-icon-button{width:44px;min-width:44px;height:44px}
.chat-recording-status{display:flex;align-items:center;justify-content:space-between;gap:5px;min-width:0}.chat-recording-status>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:1.4;color:var(--text-secondary)}.chat-recording-status>span::before{content:'';display:inline-block;width:6px;height:6px;margin-right:5px;border-radius:50%;background:var(--text-error)}
.chat-voice-recording[data-paused=true] .chat-recording-status>span::before{background:var(--text-subtle)}.chat-voice-recording[data-paused=true] output{color:var(--text-secondary)}.chat-recording-pause[aria-pressed=true]{background:var(--accent-soft);color:var(--text-link)}
/* Operational references share the same compact card in selection, draft and conversation. */
.chat-record-card{display:grid;gap:7px;min-width:0;width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:14px;padding:13px;background:var(--surface-field);text-align:left;color:var(--text-primary);font-size:13px;overflow-wrap:anywhere}
.chat-record-card>strong{font-size:15px;line-height:1.3}.chat-record-card>small{font-size:11px;line-height:1.4;color:var(--text-secondary)}.chat-record-card>.chat-record-kind{color:var(--text-link);font-size:10px;font-weight:600}.chat-record-facts{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12px}.chat-record-status{font-size:10px;color:var(--text-secondary);padding:4px 7px;border:1px solid var(--line);border-radius:7px}.chat-record-open{min-height:44px;margin-top:3px;color:var(--text-link);font-size:12px}
.chat-bubble:has(>.chat-record-card){min-width:min(270px,100%);padding:7px}.chat-bubble>.chat-record-card{border:0;background:transparent}.chat-bubble:has(>.chat-record-card)>p{padding:6px;margin:0 0 4px}
.chat-pending-record{display:grid;gap:4px}.chat-pending-record>.chat-record-card{padding:9px 12px;gap:4px}.chat-pending-record>.chat-record-card>small:last-child{display:none}.chat-pending-record>.chat-remove-record{justify-self:end;min-height:44px;padding:4px 10px;font-size:11px}
.chat-record-picker{width:560px;max-width:calc(100vw - 24px)}.chat-record-controls{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}.chat-record-controls .os-field{margin:0;gap:6px}.chat-record-controls .chat-search{margin:0}.chat-record-unit{font-size:11px;color:var(--text-secondary);margin:0}.chat-record-options{display:grid;gap:8px;min-width:0}.chat-record-option{padding:0;min-width:0;width:100%;border:0;background:transparent;border-radius:14px;cursor:pointer}.chat-record-option:hover .chat-record-card{background:var(--surface-hover)}.chat-record-option:active .chat-record-card{background:var(--surface-pressed)}.chat-record-option:focus-visible{outline:2px solid var(--text-link);outline-offset:3px}.chat-record-nav{align-items:center;justify-content:space-between;gap:8px}.chat-record-nav>span{font-size:11px;color:var(--text-secondary)}.chat-record-nav .glass-button{min-height:44px;padding:6px 10px;font-size:12px}
.chat-pending-record[hidden],.chat-record-nav[hidden],.chat-share-record[hidden]{display:none!important}
@media(max-width:700px){.chat-record-card{padding:10px;font-size:12px}.chat-record-card>strong{font-size:14px}.chat-record-picker{border-radius:24px}.chat-bubble:has(>.chat-record-card){max-width:100%}}
@media(max-width:700px){.chat-photo-viewer{padding:12px;border-radius:18px}.chat-photo-controls{gap:5px}.chat-photo-controls input{width:90px}.chat-photo-controls button,.chat-photo-controls a{font-size:11px;padding:7px 9px}.chat-bubble:has(>.chat-audio){max-width:100%}.chat-message-content:has(.chat-audio){width:min(280px,100%);max-width:100%}.chat-compose-row:has(.chat-mic) textarea{padding-inline:2px}}

.chat-record-picker .modal-content-scroll{display:grid;gap:var(--modal-section-gap,14px)}:root dialog.chat-record-picker.mobile-scroll-shell .modal-compact-header{margin-bottom:0}.chat-record-picker .chat-record-unit{margin:0}
@media(max-width:700px){:root dialog.chat-record-picker .chat-search input{font-size:16px}}

.chat-source-share{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:8px 12px;font-size:12px;line-height:1.35;color:var(--text-secondary)}.chat-source-share svg{width:17px;height:17px;flex-shrink:0}.os-editor-controls .os-control-share{order:2}.os-kanban-card>.chat-source-share{align-self:flex-end;padding:6px 10px;box-shadow:none}
.chat-share-dialog{width:510px;max-width:calc(100vw - 24px)}.chat-share-dialog .modal-content-scroll{display:grid;gap:var(--modal-section-gap,12px)}:root dialog.chat-share-dialog.mobile-scroll-shell .modal-compact-header{margin-bottom:0}.chat-share-dialog .chat-search{margin:0}.chat-share-preview{min-width:0}.chat-share-preview .chat-record-card{padding:10px 12px;gap:4px}.chat-share-preview .chat-record-card>small:last-child{font-size:10px}.chat-share-dialog .os-field{margin:0}.chat-share-dialog textarea{resize:vertical;min-height:66px;max-height:130px}.chat-share-contacts{display:grid;max-height:220px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) transparent;min-width:0}.chat-share-contact{min-height:64px;padding:10px 8px;border-radius:0}.chat-share-contact>span:last-child{min-width:0;display:grid;gap:4px;flex:1}.chat-share-contact strong{font-size:12px;overflow-wrap:anywhere}.chat-share-contact small{font-size:10px;color:var(--text-secondary)}.chat-share-contact[aria-pressed=true]{background:var(--accent-soft);border-left-color:var(--text-link)}.chat-share-contact[aria-pressed=true]::after{content:'✓';font-size:17px;color:var(--text-link)}.chat-share-dialog .chat-share-recipient{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:0 4px 0 10px;border:1px solid var(--line);border-radius:10px;font-size:11px;color:var(--text-secondary);overflow-wrap:anywhere}.chat-share-recipient[hidden]{display:none!important}.chat-share-more,.chat-share-retry,.chat-share-preview-retry{justify-self:center;min-height:44px;padding:6px 12px;font-size:12px}.chat-share-dialog .feedback{margin:0}.chat-share-dialog .customer-dialog-actions{margin-top:0}.chat-share-dialog .chat-share-send{margin:0;width:auto}
@media(max-width:700px){:root dialog.chat-share-dialog .chat-search input{font-size:16px}.chat-share-dialog .chat-share-contacts{max-height:195px}.chat-share-dialog .chat-record-card>strong{font-size:13px}.chat-share-dialog .chat-record-card{font-size:11px}.chat-share-dialog .chat-source-share{font-size:11px}}

:root .chat-attachment-menu{position:fixed;inset:auto;margin:0;padding:7px;width:302px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto;border-radius:18px;background:var(--surface-glass);color:var(--text-primary);z-index:20}.chat-attachment-menu[hidden]{display:none!important}.chat-attachment-option{display:grid;grid-template-columns:36px minmax(0,1fr);align-items:center;gap:11px;text-align:left;width:100%;min-height:64px;margin:0;padding:10px;border:0;border-radius:12px;background:transparent;color:var(--text-primary);box-shadow:none;cursor:pointer}.chat-attachment-option>svg{box-sizing:border-box;width:36px;height:36px;padding:8px;border-radius:10px;background:var(--accent-soft);color:var(--text-link)}.chat-attachment-option>span{display:grid;gap:4px;min-width:0}.chat-attachment-option strong{font-size:12px;font-weight:600;line-height:1.35}.chat-attachment-option small{font-size:10px;line-height:1.45;color:var(--text-secondary);overflow-wrap:anywhere}.chat-attachment-option:hover{background:var(--surface-hover)}.chat-attachment-option:active{background:var(--surface-pressed)}.chat-attachment-option:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-attachment-option:disabled{opacity:.5;cursor:default}.chat-attachment-option[hidden]{display:none!important}.chat-record-stock{color:var(--text-primary);font-variant-numeric:tabular-nums}

.people-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}.people-row-actions>.chat-source-share{min-width:44px;width:44px;padding:8px!important}

@media(max-width:700px){:root dialog.chat-message-search-dialog .chat-search input{font-size:16px}}
:root dialog.chat-reaction-people-dialog{width:440px;padding:22px}:root dialog.chat-reaction-people-dialog h2{font-size:20px}.chat-reaction-filters{display:flex;align-items:center;gap:6px;overflow:auto;max-width:100%;padding:3px 2px 7px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) transparent}.chat-reaction-filter{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:none;min-height:44px;min-width:44px;padding:8px 12px;border:1px solid var(--line);border-radius:13px;background:var(--surface-field);color:var(--text-secondary);font:inherit;font-size:13px;cursor:pointer}.chat-reaction-filter>span:last-child{font-size:11px;line-height:1;font-variant-numeric:tabular-nums}.chat-reaction-filter[aria-pressed=true]{color:var(--text-link);background:var(--accent-soft);border-color:var(--text-link)}.chat-reaction-filter:hover{background:var(--surface-hover)}.chat-reaction-filter:active{background:var(--surface-pressed)}.chat-reaction-filter:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-reaction-people-list{max-height:min(44dvh,340px);min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) transparent}.chat-reaction-people-list:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px;border-radius:12px}.chat-reaction-person{display:flex;align-items:center;gap:10px;min-width:0;min-height:62px;padding:9px 4px;border-bottom:1px solid var(--line)}.chat-reaction-person:last-child{border-bottom:0}.chat-reaction-person>.chat-avatar{flex:0 0 36px;width:36px;height:36px;font-size:14px}.chat-reaction-person-copy{display:grid;gap:3px;min-width:0;flex:1}.chat-reaction-person-copy strong{font-size:13px;line-height:1.4;overflow-wrap:anywhere}.chat-reaction-person-copy small{font-size:11px;color:var(--text-secondary)}.chat-reaction-person-emoji{flex:none;font-size:22px;line-height:1}.chat-reaction-person-remove{flex:0 0 44px;width:44px;min-height:44px}.chat-reaction-people-status{font-size:12px;color:var(--text-secondary)}.chat-reaction-people-dialog .feedback{font-size:12px}.chat-reaction-people-status:empty{display:none}.chat-reaction-people-more,.chat-reaction-people-retry{display:block;margin:10px auto 0;min-height:44px;font-size:12px}.chat-reaction-people-dialog .customer-dialog-actions{margin-top:12px;padding-top:12px}.chat-reaction-people-change{width:100%;min-height:44px;font-size:12px}.chat-reaction-people-list .chat-empty{font-size:12px;padding:20px 10px}.chat-reaction-people-dialog button:disabled{opacity:.5;cursor:default}
.chat-message-content{max-width:min(78%,calc(100% - 102px))}.chat-message>.chat-reply-action{flex:0 0 44px;width:44px;height:44px;min-height:44px;margin-top:1px;padding:12px;border-radius:50%;color:var(--text-secondary)}.chat-reply-action .icon{width:18px;height:18px}.chat-reply-action:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-reply-action:disabled{opacity:.35;cursor:default}.chat-reply-quote{display:grid;gap:4px;width:100%;min-width:0;min-height:44px;margin:0 0 9px;padding:9px 11px;border:0;border-left:3px solid var(--text-link);border-radius:9px;background:var(--surface-hover);color:var(--text-primary);font:inherit;text-align:left;box-sizing:border-box;cursor:pointer}.chat-reply-quote strong{font-size:11px;color:var(--text-link);overflow-wrap:anywhere}.chat-reply-quote>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.chat-reply-quote:hover{background:var(--surface-pressed)}.chat-reply-quote:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}div.chat-reply-quote{cursor:default;color:var(--text-secondary);border-left-color:var(--line)}.chat-reply-draft{display:flex;align-items:center;gap:4px;min-width:0;padding:3px;border:1px solid var(--line);border-radius:14px;background:var(--surface-field)}.chat-reply-draft>.chat-reply-quote{flex:1;min-width:0;margin:0;background:transparent}.chat-reply-draft>.chat-reply-cancel{flex:0 0 44px;width:44px;min-height:44px}.chat-reply-draft button:disabled{opacity:.6}.chat-reply-draft[hidden]{display:none!important}@media(hover:hover) and (pointer:fine){.chat-reply-action{opacity:0}.chat-message:hover>.chat-reply-action,.chat-message:focus-within>.chat-reply-action{opacity:1}}@media(max-width:700px){.chat-message-content,.chat-message-content:has(.chat-audio){max-width:calc(100% - 51px)}}
.chat-message-actions{display:grid;flex:0 0 44px;width:44px;align-content:start}.chat-message-actions>.chat-icon-button{width:44px;height:44px;min-height:44px;border-radius:50%;padding:12px;opacity:1}.chat-message-actions .icon{width:18px;height:18px}.chat-message-actions>.chat-icon-button:disabled{opacity:.35}.chat-react-action:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-reactions{position:relative;z-index:1;display:flex;gap:4px;flex-wrap:wrap;min-width:0;margin:-10px 6px 0;justify-content:flex-start}.chat-message.is-own .chat-reactions{justify-content:flex-end}.chat-reactions[hidden]{display:none!important}.chat-reaction-chip{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:44px;min-height:44px;padding:5px 9px;border:1px solid var(--line);border-radius:24px;background:var(--surface-field);color:var(--text-secondary);font:inherit;cursor:pointer}.chat-reaction-chip>span:first-child{font-size:17px;line-height:1}.chat-reaction-chip>span:last-child{font-size:11px;line-height:1;font-variant-numeric:tabular-nums}.chat-reaction-chip[aria-pressed=true]{border-color:var(--text-link);background:var(--accent-soft);color:var(--text-link)}.chat-reaction-chip:hover{background:var(--surface-hover)}.chat-reaction-chip:active{background:var(--surface-pressed)}.chat-reaction-chip:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}.chat-reaction-chip:disabled{cursor:default;opacity:.65}:root dialog.chat-reaction-dialog{width:340px;padding:20px}:root dialog.chat-reaction-dialog h2{font-size:18px}.chat-reaction-context{font-size:12px;line-height:1.5;color:var(--text-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;margin:0 0 14px;white-space:pre-wrap}.chat-reaction-grid{display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));gap:8px}.chat-reaction-option{display:grid;place-items:center;min-height:48px;min-width:44px;padding:6px;border:1px solid var(--line);border-radius:13px;background:var(--surface-field);font:inherit;font-size:24px;cursor:pointer}.chat-reaction-option[aria-pressed=true]{border-color:var(--text-link);background:var(--accent-soft)}.chat-reaction-option:hover{background:var(--surface-hover)}.chat-reaction-option:active{background:var(--surface-pressed)}.chat-reaction-option:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}.chat-reaction-option:disabled{opacity:.5;cursor:default}.chat-reaction-dialog .feedback{font-size:12px}.chat-reaction-remove{width:100%;min-height:44px;font-size:12px;margin-top:12px}@media(hover:hover) and (pointer:fine){.chat-message-actions{opacity:0}.chat-message:hover>.chat-message-actions,.chat-message:focus-within>.chat-message-actions{opacity:1}}
.chat-reaction-person-profile{display:flex;align-items:center;gap:10px;flex:1;min-width:0;min-height:44px;padding:0;border:0;border-radius:10px;background:transparent;color:var(--text-primary);font:inherit;text-align:left}.chat-reaction-person-profile>.chat-avatar{flex:0 0 36px;width:36px;height:36px;font-size:14px}.chat-reaction-person-open{cursor:pointer}.chat-reaction-person-open:hover{background:var(--surface-hover)}.chat-reaction-person-open:active{background:var(--surface-pressed)}.chat-reaction-person-open:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}.chat-reaction-person-open[aria-busy=true]{cursor:wait}
:root dialog.chat-group-dialog{width:520px;padding:20px;border-radius:24px}:root dialog.chat-group-dialog .modal-content-scroll{gap:14px}:root dialog.chat-group-dialog form{gap:12px}:root dialog.chat-group-dialog .modal-compact-header{margin-bottom:0}:root dialog.chat-group-dialog .modal-compact-header h2{font-size:20px}:root dialog.chat-group-dialog .chat-group-caption{font-size:11px;margin-top:5px;line-height:1.45}.chat-group-identity{display:grid;gap:10px;padding-bottom:14px;border-bottom:1px solid var(--line);min-width:0}:root dialog.chat-group-dialog .chat-group-photo-editor{display:grid;grid-template-columns:48px minmax(0,1fr);gap:3px 12px;padding:10px 12px;border-radius:14px}:root dialog.chat-group-dialog .chat-group-photo-copy{display:contents}:root dialog.chat-group-dialog .chat-group-photo-preview{grid-column:1;grid-row:1/span 2}:root dialog.chat-group-dialog .chat-group-photo-preview .chat-avatar.large{width:48px;height:48px;flex-basis:48px}:root dialog.chat-group-dialog .chat-group-photo-preview svg{width:26px;height:26px}:root dialog.chat-group-dialog .chat-group-photo-copy h3{grid-column:2;grid-row:1;margin:0;font-size:12px;align-self:center}:root dialog.chat-group-dialog .chat-group-photo-copy p{display:none}:root dialog.chat-group-dialog .chat-group-photo-actions{grid-column:2;grid-row:2;display:flex;align-items:center;justify-content:flex-start;gap:4px;margin:0}:root dialog.chat-group-dialog .chat-group-photo-actions>button{flex:none;min-height:44px;padding:8px 10px;border-radius:10px;font-size:11px;box-shadow:none}:root dialog.chat-group-dialog .chat-group-photo-remove{width:44px;padding:12px;background:transparent;border-color:transparent}:root dialog.chat-group-dialog .chat-group-photo-remove .icon{width:18px;height:18px}:root dialog.chat-group-dialog .chat-group-photo-editor:has(.chat-group-photo-draft:not([hidden])) .chat-group-photo-actions{grid-column:1/-1;grid-row:3}:root dialog.chat-group-dialog .chat-group-photo-draft{flex-basis:auto;gap:6px}:root dialog.chat-group-dialog .chat-group-photo-draft button{min-height:44px;border-radius:10px;font-size:11px;padding:8px 12px;flex:none!important;width:auto;margin:0}.chat-group-name-row{display:flex;align-items:flex-end;gap:8px;min-width:0}.chat-group-name-row>.os-field{flex:1;min-width:0;margin:0!important}:root dialog.chat-group-dialog .chat-group-name{min-height:44px;padding:10px 12px;margin-top:5px}:root dialog.chat-group-dialog .chat-group-name-row>.chat-group-rename{flex:none;min-height:44px;border-radius:11px;padding:8px 12px;box-shadow:none;font-size:11px;width:auto}:root dialog.chat-group-dialog .chat-group-members-heading{display:flex;align-items:center;gap:8px;margin-bottom:9px}:root dialog.chat-group-dialog .chat-group-members-heading h3{margin:0;font-size:13px}.chat-group-member-count{display:inline-grid;place-items:center;min-width:23px;height:23px;padding:0 6px;border-radius:8px;border:1px solid var(--line);background:var(--surface-field);color:var(--text-secondary);font-size:10px;line-height:1}:root dialog.chat-group-dialog .chat-group-member-list{max-height:none;overflow:visible;border:1px solid var(--line);border-radius:13px}:root dialog.chat-group-dialog .chat-group-member{flex-wrap:nowrap;gap:8px;padding:8px;min-height:62px}:root dialog.chat-group-dialog .chat-group-member>.chat-avatar{width:34px;height:34px;flex-basis:34px;font-size:13px}:root dialog.chat-group-dialog .chat-group-member-copy{gap:3px}:root dialog.chat-group-dialog .chat-group-member-copy strong{font-size:12px;line-height:1.35}:root dialog.chat-group-dialog .chat-group-member-copy small{font-size:10px;line-height:1.35}:root dialog.chat-group-dialog .chat-group-direct{flex:0 0 44px;width:44px;height:44px;padding:12px;border-radius:10px;background:transparent;border-color:transparent;box-shadow:none}:root dialog.chat-group-dialog .chat-group-member-actions{position:relative;display:block;flex:0 0 44px;width:44px;max-width:44px;padding:0}:root dialog.chat-group-dialog .chat-group-member-toggle{display:grid;place-items:center;list-style:none;width:44px;height:44px;border-radius:10px;color:var(--text-secondary);cursor:pointer}.chat-group-member-toggle::-webkit-details-marker{display:none}.chat-group-member-toggle .icon{width:19px;height:19px}.chat-group-member-toggle:hover{background:var(--surface-hover)}.chat-group-member-toggle:active{background:var(--surface-pressed)}.chat-group-member-toggle:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}:root dialog.chat-group-dialog .chat-group-member-menu{position:absolute;z-index:4;right:0;top:46px;display:grid;width:200px;max-width:calc(100vw - 64px);gap:3px;padding:5px;border:1px solid var(--line);border-radius:13px;background:var(--surface-field);box-shadow:0 10px 28px #00000020}:root dialog.chat-group-dialog .chat-group-member-actions.opens-above .chat-group-member-menu{top:auto;bottom:46px}:root dialog.chat-group-dialog .chat-group-member-menu button{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;min-height:44px;border:0;border-radius:9px;background:transparent;box-shadow:none;font-size:11px;text-align:left;padding:10px;color:var(--text-primary)}:root dialog.chat-group-dialog .chat-group-member-menu button:hover{background:var(--surface-hover)}:root dialog.chat-group-dialog .chat-group-member-menu button:active{background:var(--surface-pressed)}:root dialog.chat-group-dialog .chat-group-member-menu button:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}:root dialog.chat-group-dialog .customer-dialog-actions{gap:8px;margin-top:0;padding-top:12px;flex-wrap:nowrap}:root dialog.chat-group-dialog .customer-dialog-actions button{min-height:44px;font-size:12px;padding:8px 14px;flex:none;width:auto}:root dialog.chat-group-dialog .customer-dialog-actions .chat-group-leave{margin-right:auto;border-color:transparent;background:transparent;box-shadow:none;padding-inline:5px;color:var(--text-secondary)}:root dialog.chat-group-dialog .chat-group-leave:hover,:root dialog.chat-group-dialog .chat-group-direct:hover{background:var(--surface-hover)}:root dialog.chat-group-dialog .chat-group-leave:active,:root dialog.chat-group-dialog .chat-group-direct:active{background:var(--surface-pressed)}:root dialog.chat-group-dialog .chat-group-selected:empty{display:none}@media(max-width:380px){:root dialog.chat-group-dialog .chat-group-name-row>.chat-group-rename{padding-inline:8px;font-size:10px}:root dialog.chat-group-dialog .chat-group-photo-editor{padding:8px;gap:2px 8px}:root dialog.chat-group-dialog .chat-group-photo-actions>button{padding-inline:7px}:root dialog.chat-group-dialog .chat-group-member{gap:4px;padding:6px}:root dialog.chat-group-dialog .customer-dialog-actions button{font-size:11px;padding-inline:10px}}@media(max-width:600px){:root dialog.chat-group-create .customer-dialog-actions .chat-group-save{width:100%;flex:1}}

:root dialog.chat-group-dialog .chat-group-member-menu button>.icon{flex:0 0 18px;width:18px;height:18px;color:var(--text-secondary)}:root dialog.chat-group-dialog .chat-group-member-menu button>span{flex:1;min-width:0;text-align:left;line-height:1.4}
:root dialog.chat-group-dialog .chat-group-member-toolbar{display:flex;align-items:center;gap:8px;min-width:0;margin-bottom:8px}:root dialog.chat-group-dialog .chat-group-member-toolbar>.chat-group-member-search-wrap{flex:1;min-width:0;margin:0}:root dialog.chat-group-dialog .chat-group-member-toolbar>.chat-group-add-open{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:11px;border:1px solid var(--line);border-radius:12px;background:var(--accent-soft);color:var(--text-link);box-shadow:none}:root dialog.chat-group-dialog .chat-group-member-toolbar>.chat-group-add-open>.icon{width:20px;height:20px}:root dialog.chat-group-dialog .chat-group-add-plus{position:absolute;right:4px;bottom:4px;display:grid;place-items:center;width:13px;height:13px;border-radius:50%;background:var(--surface-field);font-size:13px;font-weight:600;line-height:1}:root dialog.chat-group-dialog .chat-group-member-toolbar>.chat-group-add-open:hover{background:var(--surface-hover)}:root dialog.chat-group-dialog .chat-group-member-toolbar>.chat-group-add-open:active{background:var(--surface-pressed)}:root dialog.chat-group-dialog .chat-group-member-toolbar>.chat-group-add-open:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}
:root dialog.chat-group-dialog .chat-group-add-open{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:44px;width:100%;padding:10px 12px;border-radius:12px;box-shadow:none;font-size:12px;text-align:left}:root dialog.chat-group-dialog .chat-group-add-open>.icon{width:18px;height:18px;flex:none}.chat-picker .chat-contact>span:nth-child(2){display:grid;gap:5px;min-width:0;flex:1}.chat-picker .chat-picker-check{display:grid;place-items:center;width:24px;height:24px;flex:0 0 24px;border:1px solid var(--line);border-radius:8px;color:transparent}.chat-picker-check .icon{width:16px;height:16px}.chat-picker .chat-contact[aria-pressed=true]{background:var(--accent-soft)}.chat-picker .chat-contact[aria-pressed=true] .chat-picker-check{color:var(--text-link);border-color:var(--text-link)}.chat-picker-selected{margin-right:auto;font-size:11px;color:var(--text-secondary)}.chat-picker .customer-dialog-actions{flex-wrap:wrap;gap:8px}.chat-picker .chat-picker-add{min-height:44px;font-size:12px}.chat-picker .chat-contact:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}

/* Group creation keeps only the draft selection; discovery stays in the shared picker. */
:root dialog.chat-group-dialog .chat-group-create-people-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}:root dialog.chat-group-dialog .chat-group-create-people-heading h3{font-size:13px;margin:0 0 4px}:root dialog.chat-group-dialog .chat-group-create-people-heading small{font-size:11px}:root dialog.chat-group-dialog .chat-group-select-open{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:8px 12px;border-radius:12px;font-size:12px;box-shadow:none;color:var(--text-link);background:var(--accent-soft)}.chat-group-select-open .icon{width:18px;height:18px}:root dialog.chat-group-dialog .chat-group-select-open:hover{background:var(--surface-hover)}:root dialog.chat-group-dialog .chat-group-select-open:active{background:var(--surface-pressed)}.chat-group-selection{display:grid;gap:6px;min-width:0}.chat-group-selection-empty{margin:0;padding:14px;border:1px dashed var(--line);border-radius:12px;font-size:12px;line-height:1.5;color:var(--text-secondary)}.chat-group-selection-person{display:flex;align-items:center;gap:9px;min-width:0;padding:5px 6px 5px 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface-field)}.chat-group-selection-person>.chat-avatar{width:32px;height:32px;flex-basis:32px;font-size:13px}.chat-group-selection-person strong{font-size:12px;line-height:1.4}.chat-group-selection-person small{font-size:10px}.chat-group-selection-person>.chat-icon-button{width:44px;height:44px;padding:12px}.chat-group-selection-person .chat-icon-button .icon{width:17px;height:17px}
/* Chat entry: compact tools and a useful continuation area without opening a conversation. */
.chat-sidebar-actions{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:8px;margin:0 14px}.chat-sidebar-actions.is-single{grid-template-columns:minmax(0,1fr)}:root .chat-sidebar-actions>button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;width:100%;margin:0;padding:9px 10px;border-radius:12px;font-size:12px;line-height:1.3}.chat-sidebar-actions .icon{width:18px;height:18px;flex:none}.chat-sidebar .chat-list-heading{gap:8px}.chat-sidebar .chat-list-heading h2{flex:1;font-size:19px;font-weight:600}.chat-sidebar .chat-count{display:grid;place-items:center;min-width:23px;height:23px;padding:0 5px;border-radius:8px;border:1px solid var(--line);background:var(--surface-field);font-variant-numeric:tabular-nums;line-height:1}.chat-sidebar .chat-sound{width:36px;min-height:44px;padding:8px}.chat-sidebar .chat-list{border-top:1px solid var(--line)}
.chat-thread>.chat-welcome{display:flex;align-items:center;justify-content:flex-start;overflow:auto;padding:clamp(24px,4vw,48px);text-align:left;overscroll-behavior:contain}.chat-welcome-content{width:100%;max-width:480px;margin:auto}.chat-welcome-intro{position:relative;isolation:isolate}.chat-welcome-intro::before{content:'';position:absolute;z-index:-1;top:-22px;left:-23px;width:135px;height:135px;border-radius:50%;background:radial-gradient(circle,var(--accent-soft),transparent 70%);pointer-events:none}.chat-welcome-intro>.chat-welcome-icon{width:56px;height:56px;border-radius:18px;margin-bottom:20px}.chat-welcome-intro>.chat-welcome-icon .icon{width:28px;height:28px}.chat-welcome-intro>.eyebrow{margin:0 0 8px;font-size:10px;letter-spacing:.15em;color:var(--text-secondary)}.chat-welcome-intro>h2{margin:0;font-size:27px;line-height:1.25;letter-spacing:-.025em}.chat-welcome-intro>.chat-welcome-description{max-width:360px;margin:12px 0 0;font-size:13px;line-height:1.7}.chat-welcome-actions{display:flex;gap:10px;margin:22px 0 0;flex-wrap:wrap}:root .chat-welcome-actions>button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;width:auto;margin:0;padding:10px 15px;border-radius:12px;font-size:12px}.chat-welcome-actions .icon{width:18px;height:18px}.chat-welcome-recent{margin-top:28px;padding-top:20px;border-top:1px solid var(--line)}.chat-welcome-recent>h3{margin:0 0 12px;font-size:12px;font-weight:600;color:var(--text-secondary)}.chat-welcome-recent-list{display:grid;gap:8px}.chat-welcome-recent-item{display:flex;align-items:center;gap:12px;width:100%;min-width:0;min-height:66px;padding:11px 13px;border:1px solid var(--line);border-radius:14px;background:var(--surface-field);color:var(--text-primary);text-align:left;box-shadow:none}.chat-welcome-recent-item>.chat-avatar{width:36px;height:36px;flex-basis:36px;font-size:14px}.chat-welcome-recent-item .chat-conversation-copy strong{font-size:12px}.chat-welcome-recent-item .chat-conversation-copy small{font-size:11px}.chat-welcome-recent-item:hover{background:var(--surface-hover)}.chat-welcome-recent-item:active{background:var(--surface-pressed)}.chat-welcome-recent-item:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}@media(max-width:1000px){.chat-welcome-intro>h2{font-size:24px}.chat-thread>.chat-welcome{padding:24px}.chat-welcome-actions>button{flex:1}}@media(max-height:700px) and (min-width:701px){.chat-thread>.chat-welcome{padding:24px}.chat-welcome-intro>.chat-welcome-icon{width:44px;height:44px;margin-bottom:12px}.chat-welcome-intro>h2{font-size:23px}.chat-welcome-actions{margin-top:16px}.chat-welcome-recent{margin-top:18px;padding-top:14px}.chat-welcome-recent-item{min-height:58px;padding:8px 12px}}

:root dialog.chat-group-create .chat-group-photo-editor:has(.chat-group-photo-draft:not([hidden])) .chat-group-photo-actions{grid-column:2;grid-row:2}

/* A persistent runtime changes containers without duplicating the conversation or polling. */
.chat-runtime{min-width:0}.chat-float-panel{position:fixed;z-index:90;right:20px;bottom:calc(20px + var(--chat-keyboard-offset,0px));width:min(410px,calc(100vw - 32px));height:min(620px,calc(var(--chat-visible-height,100dvh) - 100px));max-height:calc(var(--chat-visible-height,100dvh) - 32px);display:flex;flex-direction:column;border:1px solid var(--line);border-radius:22px;overflow:hidden;box-shadow:0 18px 60px #0003;color:var(--text-primary)}.chat-float-panel[hidden],.chat-float-launcher[hidden]{display:none!important}.chat-float-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px;padding:2px 6px 2px 16px;border-bottom:1px solid var(--line);flex:none}.chat-float-bar>span{font-size:11px;font-weight:600;color:var(--text-secondary)}.chat-float-actions{display:flex;gap:0}.chat-float-actions>.chat-icon-button{width:44px;height:44px;border:0;cursor:pointer}.chat-float-actions .icon{width:18px;height:18px}.chat-float-body{flex:1;min-height:0;display:flex;flex-direction:column}.chat-float-body>.chat-runtime{flex:1;min-height:0}.chat-float-body>.chat-float-error{margin:12px;font-size:12px;line-height:1.6;color:var(--text-secondary)}:root .chat-float-panel .internal-chat{height:100%;min-height:0;width:100%;max-height:none;grid-template-columns:minmax(0,1fr);border:0;border-radius:0;box-shadow:none;position:relative}:root .chat-float-panel .chat-sidebar,:root .chat-float-panel .chat-back,:root .chat-float-panel .chat-float-open{display:none}:root .chat-float-panel .chat-thread{display:block;min-width:0;min-height:0;height:100%}:root .chat-float-panel .chat-thread-head{padding:10px;gap:5px}:root .chat-float-panel .chat-contact-heading{gap:9px}:root .chat-float-panel .chat-contact-heading>.chat-avatar{width:34px;height:34px;flex-basis:34px;font-size:14px}:root .chat-float-panel .chat-contact-heading strong{font-size:13px}:root .chat-float-panel .chat-contact-heading small{font-size:10px}:root .chat-float-panel .chat-details{position:absolute;z-index:3;inset:0;width:100%;border:0;box-shadow:none}:root .chat-float-panel .chat-message-scroll{padding:12px}:root .chat-float-panel .chat-message{gap:6px}:root .chat-float-panel .chat-message>.chat-avatar{display:none}:root .chat-float-panel .chat-message-content{max-width:calc(100% - 44px)}:root .chat-float-panel .chat-bubble{padding:10px 12px}:root .chat-float-panel .chat-bubble p{font-size:12px;line-height:1.6}:root .chat-float-panel .chat-composer{margin:8px;gap:5px}:root .chat-float-panel .chat-compose-row{flex-wrap:wrap;gap:0;border-radius:18px}:root .chat-float-panel .chat-compose-row textarea{flex:1 0 calc(100% - 10px);order:-1;padding:9px 10px;min-height:42px;font-size:16px}:root .chat-float-panel .chat-compose-row .chat-send{margin-left:auto;width:auto;min-height:40px;padding:8px 14px;font-size:12px}:root .chat-float-panel .chat-composer>small{display:none}:root .chat-float-panel .chat-compose-row .chat-icon-button{width:40px;min-height:44px;padding:10px}:root .chat-float-panel .chat-voice-recording{gap:3px;padding:4px}:root .chat-float-panel .chat-recording-middle{min-width:0}:root .chat-float-panel .chat-audio{max-width:100%}
.chat-float-launcher{position:fixed;z-index:90;right:20px;bottom:max(20px,env(safe-area-inset-bottom));display:grid;place-items:center;width:60px;height:60px;padding:5px;border:1px solid var(--line);border-radius:50%;color:var(--text-link);box-shadow:0 8px 30px #0003;cursor:pointer}.chat-float-launcher>.chat-avatar{width:48px;height:48px;font-size:19px;flex-basis:48px}.chat-float-launcher>.chat-unread{position:absolute;right:-3px;top:-3px;min-width:22px;height:22px;font-size:11px;border:2px solid var(--surface-field)}.chat-float-launcher:hover{background:var(--surface-hover)}.chat-float-launcher:active{background:var(--surface-pressed)}.chat-float-launcher:focus-visible,.chat-float-actions button:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}.chat-float-actions button:disabled{opacity:.4;cursor:default}.chat-float-placeholder{display:grid;justify-items:center;gap:10px;padding:32px;border:1px solid var(--line);border-radius:20px;text-align:center}.chat-float-placeholder h2{font-size:18px;margin:0}.chat-float-placeholder p{font-size:13px;color:var(--text-secondary);margin:0}.chat-float-placeholder button{cursor:pointer}@media(max-width:700px){.chat-float-panel{right:8px;bottom:calc(max(8px,env(safe-area-inset-bottom)) + var(--chat-keyboard-offset,0px));width:calc(100vw - 16px);height:min(600px,calc(var(--chat-visible-height,100dvh) - 84px));max-height:calc(var(--chat-visible-height,100dvh) - 16px);border-radius:18px}.chat-float-launcher{right:14px;bottom:max(14px,env(safe-area-inset-bottom))}.chat-float-panel .chat-float-bar{min-height:44px}.chat-float-panel .chat-float-actions>.chat-icon-button{min-height:44px}.chat-float-panel .chat-reply-quote>span{font-size:11px}}@media(prefers-reduced-motion:reduce){.chat-float-panel *{scroll-behavior:auto!important}}

/* Drag only the title bar or bubble; messages keep normal selection and scrolling. */
.chat-float-panel,.chat-float-launcher{--chat-safe-top:env(safe-area-inset-top,0px);--chat-safe-right:env(safe-area-inset-right,0px);--chat-safe-bottom:env(safe-area-inset-bottom,0px);--chat-safe-left:env(safe-area-inset-left,0px)}.chat-float-panel{max-height:calc(var(--chat-visible-height,100dvh) - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)))}.chat-float-bar{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}.chat-float-bar>.chat-float-drag-handle{display:inline-flex;align-items:center;gap:5px;min-height:44px;min-width:0;border-radius:8px;outline-offset:2px}.chat-float-grip{display:grid;place-items:center;flex:none;opacity:.7}.chat-float-grip .icon{width:14px;height:18px}.chat-float-drag-handle:focus-visible{outline:2px solid var(--text-link)}.chat-float-launcher{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}.chat-float-panel.is-dragging{border-color:var(--text-link)}.chat-float-panel.is-dragging .chat-float-bar,.chat-float-launcher.is-dragging{cursor:grabbing}.chat-float-launcher.is-dragging{background:var(--surface-pressed);border-color:var(--text-link)}.chat-float-actions{cursor:default}.chat-float-actions button{touch-action:manipulation}
.chat-position-error{flex:none;display:flex;align-items:center;gap:8px;margin:8px;padding:8px 10px;border:1px solid var(--line);border-radius:12px;font-size:11px;color:var(--text-secondary);background:var(--surface-field)}.chat-position-error[hidden]{display:none}.chat-position-error>span{flex:1;min-width:0}.chat-position-error>button{flex:none;min-height:44px;padding:6px 10px;font-size:11px}
.chat-float-bar>.chat-float-drag-handle{overflow:hidden;white-space:nowrap;flex:1}.chat-float-actions{flex:none}.chat-float-resize{touch-action:none!important;cursor:nwse-resize!important}.chat-float-panel.is-resizing{border-color:var(--text-link);user-select:none}.chat-float-edge{position:absolute;z-index:5;touch-action:none}.chat-float-edge-n,.chat-float-edge-s{left:16px;right:16px;height:6px;cursor:ns-resize}.chat-float-edge-n{top:0}.chat-float-edge-s{bottom:0}.chat-float-edge-w,.chat-float-edge-e{top:16px;bottom:16px;width:6px;cursor:ew-resize}.chat-float-edge-w{left:0}.chat-float-edge-e{right:0}.chat-float-panel{max-width:calc(100vw - 16px)}@media(max-width:700px){.chat-float-panel{width:calc(100vw - 32px);max-width:calc(100vw - 32px);right:16px}}
.chat-float-settings{position:absolute;z-index:7;top:54px;right:10px;width:max-content;max-width:calc(100% - 20px);padding:5px;border:1px solid var(--line);border-radius:14px;box-shadow:0 10px 30px #0002}.chat-float-settings[hidden]{display:none}.chat-float-restore{display:flex;align-items:center;gap:9px;min-height:44px;width:100%;padding:8px 11px;border:0;border-radius:10px;background:transparent;color:var(--text-primary);font:inherit;font-size:12px;text-align:left;cursor:pointer}.chat-float-restore .icon{width:18px;height:18px;flex:none;color:var(--text-secondary)}.chat-float-restore:hover{background:var(--surface-hover)}.chat-float-restore:active{background:var(--surface-pressed)}.chat-float-restore:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}@media(max-width:700px){:root .chat-float-panel .chat-composer{margin:6px;gap:4px}:root .chat-float-panel .chat-compose-row{padding:4px;border-radius:16px}:root .chat-float-panel .chat-compose-row textarea{min-height:32px;padding:6px 8px;font-size:14px;line-height:1.4}:root .chat-float-panel .chat-compose-row .chat-icon-button{padding:10px}:root .chat-float-panel .chat-compose-row .chat-icon-button .icon{width:18px;height:18px}@supports(-webkit-touch-callout:none){:root .chat-float-panel .chat-compose-row textarea{font-size:16px;line-height:1.25}}}
.chat-conversation-copy small.chat-draft-preview,.chat-preview-copy small.chat-draft-preview{display:flex;align-items:baseline;gap:4px;min-width:0}.chat-draft-label{flex:none;font-weight:600;color:var(--text-link)}.chat-draft-excerpt{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text-secondary)}@media(min-width:701px){:root .chat-float-panel .chat-composer{margin:6px;gap:4px}:root .chat-float-panel .chat-compose-row{padding:4px;border-radius:16px}:root .chat-float-panel .chat-compose-row textarea{min-height:32px;padding:6px 8px;font-size:14px;line-height:1.4}:root .chat-float-panel .chat-compose-row .chat-icon-button .icon{width:18px;height:18px}}
@media(min-width:701px){.internal-chat:not(.is-floating) .chat-compose-row textarea{font-size:12px;min-height:36px;padding-block:8px}.internal-chat .chat-compose-row .chat-icon-button .icon{width:18px;height:18px}}

.chat-list-filters{padding:0 12px 8px;border-bottom:0}.chat-preview-filters button{padding-inline:5px;gap:4px;font-size:11px}.chat-preview-more{display:block;margin:8px auto;min-height:44px;font-size:12px}

.chat-list-row{display:flex;align-items:center;min-width:0;border-bottom:1px solid var(--line)}.chat-list-row:has([aria-current=true]){background:var(--accent-soft)}.chat-sidebar .chat-list-row>.chat-conversation{min-width:0;flex:1;border-bottom:0}.chat-list-row:has(.chat-draft-discard:not([hidden]))>.chat-conversation{padding-right:4px}.chat-draft-discard{margin-right:5px;color:var(--text-secondary);cursor:pointer}.chat-draft-discard .icon{width:17px;height:17px}.chat-draft-discard[hidden]{display:none!important}.chat-draft-discard:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}.chat-draft-discard:disabled{opacity:.45;cursor:default}.chat-preview-row-actions{display:flex;flex-direction:column;align-items:center;flex-shrink:0;padding-block:2px}.chat-preview-row-actions>.chat-icon-button{margin-right:5px}.chat-list-resume{display:none}
:root .chat-float-panel .chat-back{display:inline-grid}:root .chat-float-panel .internal-chat[data-view=list]>.chat-sidebar{display:flex;min-height:0;height:100%;padding-top:10px;gap:8px}:root .chat-float-panel .internal-chat[data-view=list]>.chat-thread{display:none}:root .chat-float-panel .internal-chat[data-view=list] .chat-list-resume:not([hidden]){display:inline-grid}:root .chat-float-panel .chat-sidebar-actions>button{min-height:44px;font-size:11px}:root .chat-float-panel .chat-sidebar .chat-list-heading{margin-block:0}:root .chat-float-panel .chat-sidebar .chat-list-heading h2{font-size:16px}:root .chat-float-panel .chat-sidebar .chat-conversation{padding-block:10px;padding-left:14px}:root .chat-float-panel .chat-sidebar .chat-search{margin-inline:12px}:root .chat-float-panel .chat-sidebar .chat-search input{font-size:12px}:root .chat-float-panel .chat-sidebar .chat-list-filters{padding-bottom:0}

.chat-back{position:relative}.chat-back-unread{display:none;position:absolute;top:1px;right:-1px;min-width:19px;height:19px;padding:0 4px;border:2px solid var(--surface-field);box-sizing:border-box;font-size:9px;line-height:1;pointer-events:none}:root .chat-float-panel .chat-back-unread:not([hidden]){display:inline-flex}.chat-back-unread[hidden]{display:none!important}

.internal-chat .chat-list>.chat-empty:has(+.chat-list-empty-action){margin:18px 12px 4px;padding:8px 4px}
.internal-chat .chat-list>.chat-list-empty-action{display:block;box-sizing:border-box;width:auto;min-height:44px;max-width:calc(100% - 24px);margin:0 auto 12px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:transparent;box-shadow:none;color:var(--text-secondary);font:inherit;font-size:12px;font-weight:500;line-height:1.4;cursor:pointer}
.internal-chat .chat-list>.chat-list-empty-action:hover{background:var(--surface-hover);color:var(--text-primary)}
.internal-chat .chat-list>.chat-list-empty-action:active{background:var(--surface-pressed)}
.internal-chat .chat-list>.chat-list-empty-action:focus-visible{outline:2px solid var(--text-link);outline-offset:2px}

.chat-list-filters .chat-filter-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-list-filters .chat-filter-count{flex-shrink:0}:root .chat-float-panel .chat-list-filters button{font-size:10px;gap:3px;padding-inline:4px}
/* Record sharing: quiet surfaces, clear context and compact selectable rows. */
:root dialog:is(.chat-record-picker,.chat-share-dialog) .modal-compact-header{padding-bottom:12px;border-bottom:1px solid var(--line);align-items:flex-start}
:root dialog:is(.chat-record-picker,.chat-share-dialog) .chat-share-caption{margin:5px 0 0;font-size:11px;line-height:1.5;color:var(--text-secondary);font-weight:400}
:root dialog:is(.chat-record-picker,.chat-share-dialog) .modal-content-scroll{align-content:start;grid-auto-rows:max-content;gap:12px}
:root dialog.chat-record-picker .chat-record-controls{grid-template-columns:minmax(150px,.8fr) minmax(0,1.2fr);align-items:end;gap:10px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-field)}
:root dialog.chat-record-picker .chat-record-controls .os-field{display:grid;gap:6px;font-size:11px;color:var(--text-secondary)}
:root dialog.chat-record-picker .chat-record-controls select{min-width:0;width:100%;min-height:44px;margin:0;font-size:12px;border-radius:10px}
:root dialog:is(.chat-record-picker,.chat-share-dialog) .chat-search{border-radius:11px;min-height:44px;padding-inline:12px;gap:9px}
:root dialog.chat-record-picker .chat-record-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-inline);padding:var(--space-inline)}
:root dialog.chat-record-picker .chat-record-controls:has(.chat-record-state:not([hidden])){grid-template-columns:repeat(2,minmax(0,1fr))}
@container(max-width:480px){:root dialog.chat-record-picker .chat-record-controls:has(.chat-record-state:not([hidden])){grid-template-columns:minmax(0,1fr)}}
:root dialog.chat-record-picker .chat-record-query{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) var(--control-target);gap:var(--space-inline);min-width:0}
:root dialog.chat-record-picker .chat-record-state[hidden]{display:none!important}
:root dialog.chat-record-picker .chat-record-controls:has(.chat-record-state[hidden])>.os-field:first-child{grid-column:1/-1}
:root dialog.chat-record-picker .chat-record-clear{min-height:var(--control-target);min-width:var(--control-target);padding:var(--action-padding-block);border-radius:var(--action-radius)}
.chat-record-context{display:flex;align-items:center;gap:7px;min-width:0;color:var(--text-secondary)}
.chat-record-context>.icon{width:14px;height:14px;flex-shrink:0}
.chat-record-context .chat-record-unit{font-size:10px;line-height:1.4;overflow-wrap:anywhere}
.chat-record-count[hidden]{display:none!important}
.chat-share-section-heading{display:flex;align-items:center;gap:8px;min-width:0}
:root dialog .chat-share-section-heading h3{font-size:12px;line-height:1.4;font-weight:600;margin:0;color:var(--text-primary)}
.chat-record-symbol{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:11px;background:var(--accent-soft);color:var(--text-link);box-sizing:border-box;flex-shrink:0}
.chat-record-symbol>.icon{width:20px;height:20px}
:root dialog.chat-record-picker .chat-record-options{gap:8px}
:root dialog.chat-record-picker .chat-record-option{display:grid;grid-template-columns:38px minmax(0,1fr) 16px;align-items:start;gap:11px;text-align:left;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-field);box-shadow:none;color:var(--text-primary)}
:root dialog.chat-record-picker .chat-record-option:hover{background:var(--surface-hover)}
:root dialog.chat-record-picker .chat-record-option:active{background:var(--surface-pressed)}
:root dialog.chat-record-picker .chat-record-option .chat-record-card{padding:0;border:0;border-radius:0;background:transparent;gap:5px;font-size:12px}
:root dialog.chat-record-picker .chat-record-option .chat-record-kind{display:none}
:root dialog.chat-record-picker .chat-record-option .chat-record-card>strong{font-size:13px}
:root dialog.chat-record-picker .chat-record-option .chat-record-card>span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.5}
:root dialog.chat-record-picker .chat-record-option .chat-record-card>small:last-child{font-size:10px}
:root dialog.chat-record-picker .chat-record-facts{gap:6px;font-size:11px;justify-content:flex-start}
:root dialog.chat-record-picker .chat-record-facts>strong{margin-left:auto}
.chat-record-pick-arrow{align-self:center;display:flex;color:var(--text-secondary)}
.chat-record-pick-arrow>.icon{width:16px;height:16px;transform:rotate(-90deg)}
:root dialog.chat-share-dialog .chat-share-preview.has-record{display:grid;grid-template-columns:38px minmax(0,1fr);align-items:start;gap:11px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-field)}
:root dialog.chat-share-dialog .chat-share-preview .chat-record-card{padding:0;border:0;background:transparent;gap:5px}
:root dialog.chat-share-dialog .chat-share-preview .chat-record-card>strong{font-size:13px}
:root dialog.chat-share-dialog .chat-share-preview .chat-record-card>span{font-size:12px;line-height:1.5}
:root dialog.chat-share-dialog .chat-share-mode{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface-field)}
:root dialog.chat-share-dialog .chat-share-mode button{display:flex;justify-content:center;align-items:center;gap:7px;border-color:transparent;background:transparent;box-shadow:none;border-radius:9px;padding:8px;font-size:11px;min-height:44px}
:root dialog.chat-share-dialog .chat-share-mode button[aria-pressed=true]{background:var(--accent-soft);color:var(--text-link);border-color:var(--accent-ring)}
:root dialog.chat-share-dialog .chat-share-mode button:hover{background:var(--surface-hover)}
:root dialog.chat-share-dialog .chat-share-mode button:active{background:var(--surface-pressed)}
.chat-share-mode .icon{width:16px;height:16px;flex-shrink:0}
:root dialog.chat-share-dialog .chat-share-contacts{gap:4px;min-height:70px;border:1px solid var(--line);border-radius:13px;padding:4px;background:var(--surface-field)}
:root dialog.chat-share-dialog .chat-share-contact{border:1px solid transparent;border-radius:9px;padding:8px;gap:10px;min-height:60px;background:transparent}
:root dialog.chat-share-dialog .chat-share-contact[aria-pressed=true]{background:var(--accent-soft);border-color:var(--accent-ring)}
:root dialog.chat-share-dialog .chat-share-contact:hover{background:var(--surface-hover)}
:root dialog.chat-share-dialog .chat-share-contact:active{background:var(--surface-pressed)}
:root dialog.chat-share-dialog .chat-share-contact>.chat-avatar{width:34px;height:34px;flex-basis:34px;font-size:14px}
:root dialog.chat-share-dialog .chat-share-recipient{background:var(--surface-field);border-radius:10px}
:root dialog.chat-share-dialog textarea{font-size:12px;padding:10px 12px;border-radius:11px;min-height:58px}
:root dialog.chat-share-dialog .customer-dialog-actions{gap:8px;padding-top:12px}
:root dialog.chat-share-dialog .customer-dialog-actions>button{min-height:44px;font-size:12px;border-radius:11px;box-shadow:none}
:root dialog.chat-share-dialog .chat-share-cancel{background:transparent;border-color:transparent;color:var(--text-secondary)}
@container(max-width:480px){:root dialog.chat-record-picker .chat-record-controls{grid-template-columns:minmax(0,1fr);gap:9px;padding:10px}:root dialog.chat-record-picker .chat-record-option{grid-template-columns:32px minmax(0,1fr) 14px;padding:10px;gap:9px}:root dialog.chat-record-picker .chat-record-symbol{width:32px;height:34px;border-radius:9px}:root dialog.chat-record-picker .chat-record-symbol>.icon{width:18px;height:18px}:root dialog.chat-record-picker .chat-record-option .chat-record-card{font-size:11px}:root dialog.chat-share-dialog .chat-share-preview.has-record{padding:10px;gap:9px}}
/* Prepared references sit beside their removal action, without a second full card. */
:root .chat-pending-record{display:grid;grid-template-columns:34px minmax(0,1fr) 44px;align-items:center;gap:10px;box-sizing:border-box;width:100%;max-width:520px;padding:8px 8px 8px 10px;border:1px solid var(--line);border-radius:13px;background:var(--surface-field)}
:root .chat-pending-record>.chat-record-symbol{width:34px;height:36px;border-radius:10px}
.chat-pending-record{container-type:inline-size}
.chat-record-draft-copy{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;align-items:baseline}
.chat-record-draft-copy>small{grid-column:1/-1;font-size:10px;line-height:1.4;color:var(--text-secondary)}
.chat-record-draft-copy>strong{min-width:0;font-size:12px;font-weight:600;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-record-draft-copy>span{font-size:10px;line-height:1.4;color:var(--text-secondary);white-space:nowrap}
:root .chat-pending-record>.chat-remove-record{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:12px;border:1px solid transparent;border-radius:10px;background:transparent;box-shadow:none;color:var(--text-secondary)}
:root .chat-pending-record>.chat-remove-record .icon{width:17px;height:17px}
:root .chat-pending-record>.chat-remove-record:hover{background:var(--surface-hover);color:var(--text-primary)}
:root .chat-pending-record>.chat-remove-record:active{background:var(--surface-pressed)}
:root .chat-pending-record>.chat-remove-record:focus-visible{outline:2px solid var(--text-link);outline-offset:-2px}
:root .chat-bubble>.chat-record-card:has(>.chat-record-symbol){grid-template-columns:34px minmax(0,1fr);gap:6px 10px;padding:7px;min-width:0}
:root .chat-bubble>.chat-record-card>.chat-record-symbol{grid-column:1;grid-row:1/span 3;width:34px;height:36px;border-radius:10px}
:root .chat-bubble>.chat-record-card:has(>.chat-record-symbol)>:not(.chat-record-symbol){grid-column:2}
:root .chat-bubble>.chat-record-card:has(>.chat-record-symbol)>.chat-record-kind{font-size:9px;font-weight:500;color:var(--text-secondary)}
:root .chat-bubble>.chat-record-card:has(>.chat-record-symbol)>strong{font-size:13px}
:root .chat-bubble>.chat-record-card:has(>.chat-record-symbol)>span:not(.chat-record-symbol){font-size:12px;line-height:1.5}
:root .chat-bubble>.chat-record-card:has(>.chat-record-symbol)>.chat-record-open{grid-column:1/-1;display:flex;justify-content:flex-start;align-items:center;gap:8px;min-height:44px;padding:9px 3px 3px;margin:3px 0 0;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent;box-shadow:none;font-size:11px;text-align:left}
:root .chat-bubble>.chat-record-card:has(>.chat-record-symbol)>.chat-record-open:hover{background:var(--surface-hover)}
:root .chat-bubble>.chat-record-card:has(>.chat-record-symbol)>.chat-record-open:active{background:var(--surface-pressed)}
:root .chat-bubble>.chat-record-card>.chat-record-open>.icon{width:15px;height:15px;margin-left:auto;flex-shrink:0}
@container(max-width:360px){.chat-record-draft-copy{grid-template-columns:minmax(0,1fr)}.chat-record-draft-copy>span{font-size:9px}:root .chat-pending-record{gap:8px;padding:7px}}

/* Shared chat rhythm; glyph size is independent from the touch target. */
.internal-chat{width:100%;box-sizing:border-box;container-type:inline-size;--chat-radius:12px;--chat-control-size:44px;--chat-icon-size:18px}
.internal-chat :is(.chat-list,.chat-message-scroll,.chat-details),.chat-preview-list{scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) transparent}
.internal-chat :is(.chat-conversation,.chat-contact):focus-visible{outline:2px solid var(--text-link);outline-offset:-3px}
.internal-chat .chat-list-filters{gap:4px;padding-inline:10px}
.internal-chat .chat-list-filters button{font-size:10px;gap:3px;padding-inline:4px;line-height:1.4;flex:1.15}
.internal-chat .chat-list-filters button:first-child{flex:.65}
.internal-chat .chat-list-filters button:last-child{flex:1.3}
.internal-chat .chat-compose-row .chat-icon-button{width:var(--chat-control-size);min-width:var(--chat-control-size);height:var(--chat-control-size);padding:12px}
.internal-chat .chat-compose-row .chat-icon-button .icon{width:var(--chat-icon-size);height:var(--chat-icon-size)}
.internal-chat :is(.chat-older,.chat-thread-retry,.chat-latest,.chat-more){min-height:44px;border-radius:10px;font-size:11px}
.internal-chat .chat-thread-head>.chat-icon-button{height:44px;min-width:44px}
.internal-chat .chat-contact-heading strong{font-weight:600;line-height:1.4}
.internal-chat .chat-contact-heading small{line-height:1.4}
.internal-chat .chat-contact-heading>div{flex:1;grid-template-columns:minmax(0,max-content) minmax(0,1fr);gap:3px 7px}
.internal-chat .chat-contact-heading strong{grid-column:1/-1}
.internal-chat .chat-contact-heading small{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.internal-chat .chat-contact-heading small:not(.chat-presence-label){max-width:90px}
.internal-chat .chat-contact-heading .chat-presence-label:not(:empty)::before{content:'·';margin-right:6px}
.internal-chat .chat-conversation-meta,.chat-preview-meta{font-variant-numeric:tabular-nums}
.internal-chat .chat-message-meta{line-height:1.4}
.chat-preview .chat-avatar{width:36px;height:36px;flex-basis:36px;font-size:15px}
.chat-preview .chat-preview-item{min-height:72px;padding-block:10px}
.chat-preview .chat-preview-filters{gap:4px}
.chat-preview .chat-preview-filters button{font-size:11px;padding-inline:4px}
@container(max-width:480px){
 .internal-chat .chat-compose-row{flex-wrap:wrap;gap:0;padding:4px;border-radius:16px}
 .internal-chat .chat-compose-row textarea{order:-1;flex:1 0 calc(100% - 10px);min-height:32px;padding:6px 8px;font-size:14px;line-height:1.4}
 .internal-chat .chat-compose-row .chat-send{margin-left:auto}
}
@container(max-width:480px){
 :root .internal-chat .chat-thread-head{display:grid;grid-template-columns:44px minmax(0,1fr) repeat(4,44px);grid-template-rows:44px;grid-auto-rows:44px;gap:0;padding:6px 8px}
 :root .internal-chat .chat-thread-head>.chat-back{grid-area:1/1/2/2;z-index:1}
 :root .internal-chat .chat-contact-heading{grid-area:1/2/2/3;margin-left:0;min-width:0;gap:6px}
 :root .internal-chat .chat-contact-heading>.chat-avatar{width:28px;height:28px;flex-basis:28px}
 :root .internal-chat .chat-thread-head>.chat-call-trigger{grid-area:1/3/2/4}
 :root .internal-chat .chat-thread-head>.chat-message-search-open{grid-area:1/4/2/5}
 :root .internal-chat .chat-thread-head>.chat-info{grid-area:1/5/2/6}
 :root .internal-chat .chat-thread-head>.chat-float-open{grid-area:1/6/2/7}
 :root .internal-chat .chat-thread-head>.chat-icon-button .icon{width:18px;height:18px}
 :root .chat-float-panel .internal-chat .chat-thread-head>.chat-call-trigger{grid-column:3}
 :root .chat-float-panel .internal-chat .chat-thread-head>.chat-message-search-open{grid-column:4}
 :root .chat-float-panel .internal-chat .chat-thread-head>.chat-info{grid-column:5}
}
@container(max-width:360px){:root .internal-chat:not(.is-floating) .chat-contact-heading>.chat-avatar{display:none}}
:root .chat-float-panel .internal-chat .chat-thread-head{display:grid;grid-template-columns:44px minmax(0,1fr) repeat(3,44px);grid-template-rows:44px;grid-auto-rows:44px;gap:0;padding:6px 8px}
:root .chat-float-panel .internal-chat .chat-thread-head>.chat-back{grid-area:1/1/2/2}
:root .chat-float-panel .internal-chat .chat-contact-heading{grid-area:1/2/2/3;margin-left:0;min-width:0;gap:6px}
:root .chat-float-panel .internal-chat .chat-contact-heading>.chat-avatar{width:28px;height:28px;flex-basis:28px}
:root .chat-float-panel .internal-chat .chat-thread-head>.chat-call-trigger{grid-area:1/3/2/4}
:root .chat-float-panel .internal-chat .chat-thread-head>.chat-message-search-open{grid-area:1/4/2/5}
:root .chat-float-panel .internal-chat .chat-thread-head>.chat-info{grid-area:1/5/2/6}
@supports(-webkit-touch-callout:none){.internal-chat .chat-compose-row textarea{font-size:16px!important}}
@media(prefers-reduced-motion:reduce){.chat-preview *,.chat-contained-dialog *,.chat-float-panel *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
/* Inspection videos keep the OS card compact and use the viewer's current palette. */
.chat-record-video-indicator{display:inline-flex;align-items:center;gap:4px;color:var(--text-secondary);font-size:10px;line-height:1.4}
.chat-record-video-indicator>.icon{width:13px;height:13px;flex-shrink:0}
:root .chat-bubble>.chat-record-card>.chat-record-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:6px;border-top:1px solid var(--line);padding-top:6px;margin-top:2px}
:root .chat-record-actions>:is(.chat-record-open,.chat-record-video){display:flex;align-items:center;justify-content:center;gap:5px;min-height:44px;min-width:0;padding:6px;border:0;border-radius:8px;background:transparent;color:var(--text-link);box-shadow:none;font-size:11px;line-height:1.4;box-sizing:border-box}
:root .chat-record-actions>button:hover{background:var(--surface-hover)}:root .chat-record-actions>button:active{background:var(--surface-pressed)}
.chat-record-actions .icon{width:15px;height:15px;flex-shrink:0}
:root dialog.chat-inspection-video .customer-dialog-header{margin:0;padding:4px 2px 12px;gap:10px;border-bottom:1px solid var(--line)}
:root dialog.chat-inspection-video h2{font-size:15px;margin:0}.chat-inspection-video header p{font-size:11px;margin:5px 0 0;color:var(--text-secondary)}
:root dialog.chat-inspection-video>video{display:block;width:100%;flex:1;min-height:0;object-fit:contain;background:#111;border-radius:10px;margin:12px 0}
.chat-inspection-video>footer{display:flex;justify-content:flex-end;flex-shrink:0;border-top:1px solid var(--line);padding-top:10px}
.chat-inspection-video footer>a{display:inline-flex;align-items:center;min-height:44px;padding:8px 12px;font-size:11px;border-radius:9px;box-sizing:border-box;text-decoration:none}
.chat-inspection-video footer>a:hover{background:var(--surface-hover)}.chat-inspection-video footer>a:active{background:var(--surface-pressed)}
.chat-inspection-video .feedback{font-size:12px;margin:0 0 10px}
/* Customer decisions retain the shared reference card and its access checks. */
:root .chat-message.is-system .chat-group-sender{font-size:10px;font-weight:500;color:var(--text-secondary)}
:root .chat-bubble>.chat-record-card.is-quote-decision>.chat-record-kind{font-size:12px;font-weight:600;line-height:1.4;color:var(--text-success)}
:root .chat-bubble>.chat-record-card.is-quote-decision[data-decision=declined]>.chat-record-kind{color:var(--text-warning)}
:root .chat-record-card.is-quote-decision>span:not(.chat-record-symbol){display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
:root .chat-message.is-notification-target .chat-bubble{outline:2px solid var(--text-link);outline-offset:3px;background:var(--accent-soft)}
:root .chat-unread-divider{display:flex;align-items:center;gap:8px;min-width:0;margin:7px 0;padding:3px 0;color:var(--text-link);font-size:10px;font-weight:600;line-height:1.4;text-align:center}
:root .chat-unread-divider::before,:root .chat-unread-divider::after{content:"";height:1px;flex:1;min-width:8px;background:var(--accent-ring)}
:root .chat-unread-divider>span{padding:3px 8px;border-radius:7px;background:var(--accent-soft);overflow-wrap:anywhere}

.chat-report-share-dialog .chat-share-preview{display:grid;gap:var(--space-inline)}
.chat-report-share-dialog .chat-share-preview strong{font-size:var(--type-body)}
.chat-report-share-dialog .chat-share-preview :is(small,p){margin:0;font-size:var(--type-meta);line-height:1.5;color:var(--text-secondary)}

.chat-record-card.is-signature-notice .chat-record-facts{display:grid;gap:var(--space-inline);font-size:var(--type-meta)}.chat-record-card.is-signature-notice .chat-signature-pdf{color:var(--text-primary);font-weight:600;overflow-wrap:anywhere}

:root .chat-record-actions>.chat-signature-retry{display:flex;align-items:center;justify-content:center;gap:var(--space-inline);min-height:var(--control-target);min-width:0;padding:var(--action-padding-block) var(--action-padding-inline);border:0;border-radius:8px;background:transparent;color:var(--text-link);box-shadow:none;font-size:var(--type-action);line-height:1.4;white-space:normal}.chat-signature-retry>.icon{width:15px;height:15px;flex-shrink:0}.chat-signature-retry:hover{background:var(--surface-hover)}.chat-signature-retry:active{background:var(--surface-pressed)}

:root .chat-bubble>.chat-record-card.is-signature-notice:has(>.chat-record-symbol)>.chat-record-actions:has(>.chat-signature-retry){grid-column:1/-1;grid-template-columns:minmax(0,1fr) var(--control-target);min-width:0}:root .chat-bubble>.chat-record-card.is-signature-notice>.chat-record-actions:has(>.chat-signature-retry):has(>.chat-record-video){grid-template-columns:minmax(0,1fr) var(--control-target) var(--control-target)}:root .chat-record-card.is-signature-notice .chat-record-actions:has(>.chat-signature-retry)>.chat-record-open>.icon{display:none}

.chat-order-receipt-summary{display:grid;gap:var(--space-inline);flex-basis:100%;min-width:0;overflow-wrap:anywhere;font-size:var(--type-meta)}
:root .chat-bubble>.chat-record-card.has-order-receipts>.chat-record-actions{grid-column:1/-1;grid-template-columns:minmax(0,1fr) var(--control-target)}
:root .chat-bubble>.chat-record-card.has-order-receipts>.chat-record-actions:has(>.chat-record-video){grid-template-columns:minmax(0,1fr) var(--control-target) var(--control-target)}
:root .chat-record-actions>.chat-record-receipts,.chat-order-receipts-dialog .chat-receipt-icon{width:var(--control-target);min-width:var(--control-target);height:var(--control-target);min-height:var(--control-target);display:grid;place-items:center;padding:var(--action-padding-block);box-sizing:border-box;box-shadow:none;color:var(--text-link);border-radius:var(--action-radius)}
:root .chat-record-actions>.chat-record-receipts{border:0;background:transparent}.chat-record-actions>.chat-record-receipts:hover{background:var(--surface-hover)}.chat-record-actions>.chat-record-receipts:active{background:var(--surface-pressed)}
.chat-order-receipts-dialog .chat-receipt-icon>span{display:none}.chat-order-receipts-dialog{width:min(640px,calc(100vw - 24px));color:var(--text-primary)}.chat-order-receipts-body,.chat-order-receipts-list{display:grid;gap:var(--space-inline);min-width:0}.chat-order-receipts-toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--space-inline);min-width:0}.chat-order-receipts-toolbar>p{margin:0;min-width:0;overflow-wrap:anywhere}.chat-order-receipt{display:grid;grid-template-columns:minmax(0,1fr) var(--control-target);gap:var(--space-inline);align-items:center;border-bottom:1px solid var(--line);padding-block:var(--space-inline);min-width:0}.chat-order-receipt-copy{display:grid;gap:var(--space-inline);min-width:0;overflow-wrap:anywhere}.chat-order-receipt-heading{display:flex;justify-content:space-between;gap:var(--space-inline);flex-wrap:wrap;font-size:var(--type-body)}.chat-order-receipt-copy>small{font-size:var(--type-meta);color:var(--text-secondary)}.chat-order-receipts-dialog [hidden]{display:none!important}

:root .chat-bubble>.chat-record-card.has-order-receipts>.chat-record-actions:has(>.chat-signature-retry){grid-template-columns:minmax(0,1fr) var(--control-target) var(--control-target)}
:root .chat-bubble>.chat-record-card.has-order-receipts>.chat-record-actions:has(>.chat-signature-retry):has(>.chat-record-video){grid-template-columns:minmax(0,1fr) repeat(3,var(--control-target))}
:root .chat-record-card.has-order-receipts .chat-record-open>.icon{display:none}

:root .chat-bubble:has(>.chat-record-card.has-receipt-tools){padding:0}
:root .chat-bubble>.chat-record-card.has-receipt-tools{padding:var(--space-inline)}
:root .chat-bubble>.chat-record-card.has-receipt-tools>.chat-record-actions{grid-template-columns:minmax(var(--control-target),1fr) repeat(3,var(--control-target));gap:var(--space-inline);width:calc(100% + var(--space-inline) + var(--space-inline));margin-inline:calc(0px - var(--space-inline))}

:root .chat-bubble>.chat-record-card.has-order-receipts.has-receipt-tools>.chat-record-actions:has(>.chat-signature-retry):has(>.chat-record-video){grid-template-columns:minmax(var(--control-target),1fr) repeat(3,var(--control-target))}

.chat-card-cost-summary{display:grid;gap:var(--space-inline);min-width:0;font-size:var(--type-meta)}
.chat-card-cost-summary>small{color:var(--text-secondary);font-size:var(--type-meta);overflow-wrap:anywhere}.chat-card-cost-summary dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-inline);margin:0;min-width:0}.chat-card-cost-summary dl>div{min-width:0}.chat-card-cost-summary dt{font-size:var(--type-meta);color:var(--text-secondary);overflow-wrap:anywhere}.chat-card-cost-summary dd{font-size:var(--type-body);font-weight:600;font-variant-numeric:tabular-nums;margin:var(--space-inline) 0 0;overflow-wrap:anywhere}.chat-card-cost-summary.is-divergent dd:last-child{color:var(--text-primary)}
.chat-card-cost-dialog{width:min(640px,calc(100vw - 24px))}.chat-card-cost-body{display:grid;gap:var(--space-fields);min-width:0}.chat-card-cost-body>strong{font-size:var(--type-section-title)}.chat-card-cost-body p{margin:0;overflow-wrap:anywhere}.chat-card-cost-state{font-size:var(--type-body);font-weight:600}.chat-card-cost-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-fields);margin:0;padding-block:var(--space-fields);border-block:1px solid var(--line)}.chat-card-cost-details>div{min-width:0}.chat-card-cost-details dt{font-size:var(--type-label);color:var(--text-secondary)}.chat-card-cost-details dd{font-size:var(--type-body);margin:var(--space-inline) 0 0;overflow-wrap:anywhere}.chat-card-cost-body h3{font-size:var(--type-label);margin:0}.chat-card-cost-notes{white-space:pre-wrap;font-size:var(--type-body)}
@media(max-width:400px){.chat-card-cost-summary dl{grid-template-columns:repeat(2,minmax(0,1fr))}.chat-card-cost-summary dl>div:last-child{grid-column:1/-1}.chat-card-cost-details{grid-template-columns:minmax(0,1fr)}}
:root .chat-bubble>.chat-record-card.has-manual-receipt-delivery>.chat-record-actions{grid-template-columns:minmax(0,1fr) var(--control-target);gap:var(--space-inline)}
:root .chat-bubble>.chat-record-card.has-manual-receipt-delivery>.chat-record-actions>.chat-record-receipt-send{min-width:var(--control-target);min-height:var(--control-target);justify-content:center;padding:var(--space-inline)}
@keyframes chat-unread-nudge{0%,16%,100%{transform:translateY(0) scale(1)}5%{transform:translateY(-1.5px) scale(1.035)}10%{transform:translateY(0) scale(1)}}
#chat-header>.icon.chat-unread-loop{transform-origin:center;animation:chat-unread-nudge 5.6s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){#chat-header>.icon.chat-unread-loop{animation:none;transform:none}}

.chat-purchase-facts{display:grid;gap:var(--space-inline);grid-column:1/-1;min-width:0;padding-top:var(--space-inline);border-top:1px solid var(--line)}.chat-purchase-facts>div{display:flex;justify-content:space-between;align-items:start;gap:var(--space-fields);min-width:0}.chat-purchase-facts small{min-width:0;overflow-wrap:anywhere}.chat-purchase-facts strong{flex-shrink:0;font-size:var(--type-body);font-variant-numeric:tabular-nums}
.chat-pending-record .chat-purchase-facts,.chat-record-option .chat-purchase-facts{display:none}
