/* Professional inbox: independent lists, history and fixed composer inside the viewport. */
body[data-page=conversations] #shell>main{overflow:hidden;height:100%;padding-bottom:14px}body[data-page=conversations] #shell>main>footer{display:none}body[data-page=conversations] #content{display:flex!important;flex-direction:column;flex:1 1 0!important;min-height:0;overflow:hidden!important}.conversation-toolbar,.conversation-filters{flex:none;margin-bottom:12px!important}.conversation-toolbar p{margin:0}.conversation-toolbar .actions{display:flex;gap:7px;flex-wrap:wrap}.conversation-filters{display:grid!important;grid-template-columns:1.4fr 1fr 1fr auto;gap:12px}.conversation-filters>*{min-width:0;margin:0}.conversation-layout{display:grid!important;grid-template-columns:290px minmax(0,1fr);gap:16px;height:auto!important;min-height:0!important;flex:1;overflow:hidden}.conversation-list{overflow-y:auto!important;min-height:0;max-height:none!important;height:100%;padding-right:5px}.conversation-list button{position:relative;display:block;text-align:left;padding:17px 16px;border:1px solid var(--tone-border-253d54,#253d54);background:var(--tone-bg-102133,#102133);border-radius:10px;margin-bottom:8px}.conversation-list button.selected{border-color:var(--tone-border-3edabd,#3edabd);background:var(--tone-bg-153c3b,#153c3b)}.conversation-list .row{margin-bottom:9px;gap:8px}.conversation-list strong{font-size:14px;font-weight:650}.conversation-list small{display:block;color:var(--tone-text-95adc6,#95adc6);font-size:11px;line-height:1.6;padding-right:18px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chat-unread-count,.chat-nav-count{display:inline-grid;place-items:center;background:var(--tone-bg-41dfbc,#41dfbc);color:var(--tone-text-062a23,#062a23);font:700 11px/1 system-ui;min-width:21px;height:21px;padding:0 5px;border-radius:6px}.chat-unread-count{position:absolute;right:12px;bottom:14px}.chat-nav-count{margin-left:auto}.chat-nav-count[hidden]{display:none}.conversation-panel{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;border:1px solid var(--tone-border-2b435a,#2b435a);background:var(--tone-bg-0c1928,#0c1928);border-radius:12px;padding:0!important}.conversation-heading{display:flex;gap:12px;align-items:center;padding:16px 20px;border-bottom:1px solid var(--tone-border-294056,#294056);background:var(--tone-bg-102133,#102133);flex:none}.conversation-heading #conversation-back{display:none}.chat-contact-heading{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.chat-contact-heading h3{font-size:17px;margin:0 0 5px!important}.chat-contact-heading p{font-size:11px;margin:0;color:var(--tone-text-9cb5ce,#9cb5ce)}.chat-avatar{display:grid;place-items:center;width:43px;height:43px;flex:none;background:var(--tone-bg-355876,#355876);color:var(--tone-text-e7f3ff,#e7f3ff);border-radius:50%;font-size:16px;font-weight:650}.chat-heading-actions{display:flex;gap:7px;align-items:center}.chat-heading-actions button,.chat-heading-actions summary{font:12px/1.5 'Segoe UI',Arial,sans-serif;padding:9px 13px;border:1px solid var(--tone-border-34516a,#34516a);background:var(--tone-bg-122a3d,#122a3d);border-radius:6px;cursor:pointer;list-style:none}.chat-heading-actions details{position:relative}.chat-heading-actions details>div{position:absolute;z-index:25;right:0;top:44px;width:280px;padding:16px;background:var(--tone-bg-142b40,#142b40);border:1px solid var(--tone-border-375673,#375673);border-radius:9px;box-shadow:0 10px 30px var(--tone-bg-0009,#0009)}.chat-heading-actions details label{font-size:12px}.chat-heading-actions details p{font-size:12px;color:var(--tone-text-9cb6cf,#9cb6cf)}.chat-menu-body{display:grid;gap:10px}.chat-notices{flex:none;max-height:180px;overflow:auto;padding:0 16px}.chat-notices:empty{display:none}.chat-notices>.sub{margin:8px 0;font-size:11px}.chat-notices .handoff-summary{margin:9px 0}.chat-body{display:grid;grid-template-columns:minmax(0,1fr) 230px;flex:1;min-height:0;overflow:hidden}.chat-stream{display:flex;flex-direction:column;min-height:0;overflow:hidden}.chat-stream #chat-load-older{flex:none;align-self:center;margin:10px;font-size:11px}.chat-stream #chat-load-older[hidden]{display:none}body[data-page=conversations] #content .conversation-panel .messages{display:flex;flex-direction:column;gap:12px;flex:1;min-height:0!important;height:auto!important;max-height:none!important;overflow-y:scroll!important;overflow-x:hidden;padding:22px!important;background:var(--tone-bg-0c1928,#0c1928);scrollbar-gutter:stable}.conversation-panel .message{flex:none;max-width:83%;padding:13px 16px;border-radius:0 12px 12px 12px;background:var(--tone-bg-183047,#183047);color:var(--tone-text-e0edf8,#e0edf8);font:14px/1.65 'Segoe UI',Arial,sans-serif;white-space:normal;align-self:flex-start;overflow-wrap:anywhere;margin:0}.conversation-panel .message.assistant{background:var(--tone-bg-104a44,#104a44);border-radius:12px 0 12px 12px;align-self:flex-end}.chat-message-text{white-space:pre-wrap}.conversation-panel .message>small{display:block;text-align:right;margin-top:8px;color:var(--tone-text-a0b8ca,#a0b8ca);font-size:10px}.chat-media{margin-top:10px;max-width:360px}.chat-media audio,.chat-media video{width:100%;max-width:360px;min-width:180px}.chat-media video,.chat-media img{max-height:220px;object-fit:contain;border-radius:7px}.chat-media button{margin-top:9px;font-size:11px;padding:7px 10px}.chat-media a{color:var(--tone-text-65e7d0,#65e7d0)}.chat-transcription{margin-top:12px;border-top:1px solid var(--tone-border-3a5f6e,#3a5f6e);padding-top:10px;font-size:12px}.chat-transcription p{white-space:pre-wrap;margin:8px 0 0}.chat-contact-details{position:static!important;display:block!important;inset:auto!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow-y:auto;padding:22px!important;background:var(--tone-bg-102133,#102133);border-right:0;border-left:1px solid var(--tone-border-284159,#284159)}.chat-contact-details h4{font-size:13px;margin:0 0 14px}.chat-contact-details h4:not(:first-child){margin-top:28px}.chat-contact-details p{font-size:12px;color:var(--tone-text-a6bdd2,#a6bdd2);line-height:1.7}.chat-os-card{margin:12px 0;padding:14px;border:1px solid var(--tone-border-31516a,#31516a);border-radius:7px}.chat-os-card strong,.chat-os-card span{display:block;font-size:12px;margin-bottom:8px}.chat-os-card span{color:var(--tone-text-54dfc1,#54dfc1)}.chat-os-card button{font-size:11px;padding:8px}.chat-composer-wrap{flex:none;border-top:1px solid var(--tone-border-29465d,#29465d);background:var(--tone-bg-102133,#102133);padding:10px 16px 14px}.chat-composer-state{text-align:right;margin:0 0 8px;font-size:11px;color:var(--tone-text-9bb5cc,#9bb5cc)}.chat-composer-wrap .test-form{display:flex;gap:10px;align-items:center;margin:0}.chat-compose-tools{display:flex;gap:4px;align-items:center}.chat-compose-tools button{background:transparent;font-size:11px;padding:8px;color:var(--tone-text-bed3e8,#bed3e8)}.chat-compose-tools #chat-emoji{font-size:24px;padding:0 5px}.chat-compose-tools #chat-file-input{display:none}.chat-compose-tools .recording{color:var(--tone-text-ff9a9a,#ff9a9a);background:var(--tone-bg-51252c,#51252c)}.chat-composer-wrap textarea{font:14px/1.5 'Segoe UI',Arial,sans-serif;min-height:48px;max-height:110px;resize:vertical;margin:0;flex:1;padding:12px;background:var(--tone-bg-091b2c,#091b2c)}.chat-composer-wrap button[type=submit]{align-self:stretch;font-size:13px}.chat-composer-wrap small{font-size:10px;color:var(--tone-text-92adc3,#92adc3)}#chat-emoji-picker{display:flex;flex-wrap:wrap;gap:4px;max-width:440px;padding:10px;margin-bottom:10px;border:1px solid var(--tone-border-355169,#355169);border-radius:8px;background:var(--tone-bg-152b40,#152b40)}#chat-emoji-picker[hidden]{display:none}#chat-emoji-picker button{font-size:22px;padding:5px;background:none;border:0}#chat-file-preview:not(:empty){display:flex;align-items:center;gap:16px;padding:12px;border:1px solid var(--tone-border-355872,#355872);border-radius:8px;margin-bottom:10px}#chat-file-preview strong,#chat-file-preview small{display:block}#chat-file-preview img{width:80px;height:65px;object-fit:contain}#chat-file-preview audio{height:36px;max-width:250px}#chat-file-preview button{font-size:11px}.chat-alert-stack{z-index:120}#chat-alert-stack{position:fixed;top:22px;right:24px;z-index:120;display:grid;gap:12px;width:min(400px,calc(100vw - 28px));pointer-events:none}.chat-alert{display:grid;grid-template-columns:38px 1fr 24px;gap:12px;align-items:start;background:var(--tone-bg-112a3c,#112a3c);border:1px solid var(--tone-border-3c796e,#3c796e);box-shadow:0 12px 45px var(--tone-bg-0007,#0007);border-radius:12px;padding:18px;pointer-events:auto;animation:chat-notice-in .18s ease-out}.chat-alert-icon{color:var(--tone-text-44e1bd,#44e1bd);font-size:25px}.chat-alert strong{font-size:14px}.chat-alert p{font-size:12px;margin:6px 0 10px;color:var(--tone-text-a9c2d5,#a9c2d5)}.chat-alert button[data-open]{font-size:12px;padding:7px 11px;border-color:var(--tone-border-38cba7,#38cba7);color:var(--tone-text-55eac6,#55eac6);background:var(--tone-bg-103a35,#103a35)}.chat-alert-close{width:24px;height:24px;padding:0;border:0;background:none;font-size:22px;color:var(--tone-text-acc4d5,#acc4d5)}@keyframes chat-notice-in{from{opacity:0;transform:translateY(-7px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:1250px){.chat-body{grid-template-columns:minmax(0,1fr)}.chat-contact-details{display:none!important}.conversation-layout{grid-template-columns:260px minmax(0,1fr)}.chat-contact-heading>.badge{display:none}.chat-compose-tools{gap:0}.chat-compose-tools button{padding:6px}.conversation-filters{grid-template-columns:1.3fr 1fr 1fr}.conversation-filters small{grid-column:1/-1}}
@media(max-width:760px){body[data-page=conversations] #shell:not([hidden]){grid-template-rows:minmax(0,25dvh) minmax(0,1fr)}body[data-page=conversations] #shell:has(.conversation-open){grid-template-rows:minmax(0,1fr)}body[data-page=conversations] #shell:has(.conversation-open)>aside{display:none}body[data-page=conversations] #shell:has(.conversation-open)>main>header{display:none}body[data-page=conversations] #shell>main{padding:0 10px 10px;height:100%}.conversation-toolbar{padding-top:12px}.conversation-toolbar p{display:none}.conversation-toolbar .actions{gap:5px}.conversation-toolbar button{padding:8px 10px;font-size:11px}.conversation-filters{grid-template-columns:1fr 1fr;gap:7px}.conversation-filters input{grid-column:1/-1}.conversation-filters small{display:none}.conversation-filters select{font-size:11px;padding:8px}.conversation-layout{grid-template-columns:minmax(0,1fr);gap:0}.conversation-list{display:block}.conversation-panel{display:none}.conversation-open .conversation-panel{display:flex!important;height:100%!important;min-height:0!important}.conversation-open .conversation-list,.conversation-open .conversation-filters,.conversation-open .conversation-toolbar{display:none!important}.conversation-heading{padding:12px 10px;gap:8px;flex-wrap:wrap}.conversation-heading #conversation-back{display:block;padding:6px 9px;font-size:11px}.chat-avatar{display:none}.chat-contact-heading h3{font-size:14px}.chat-contact-heading p{font-size:10px}.chat-heading-actions{margin-left:auto}.chat-heading-actions button,.chat-heading-actions summary{padding:7px 9px;font-size:11px}.chat-heading-actions details>div{width:240px}.chat-composer-wrap{padding:8px}.chat-composer-wrap .test-form{flex-wrap:wrap;gap:7px}.chat-compose-tools{width:100%;justify-content:flex-start}.chat-composer-state{text-align:left;font-size:10px}.chat-composer-wrap textarea{min-width:0;font-size:14px}.chat-composer-wrap button[type=submit]{padding:9px 13px}.conversation-panel .message{max-width:91%;font-size:13px;padding:12px}body[data-page=conversations] #content .conversation-panel .messages{padding:14px!important}#chat-file-preview:not(:empty){flex-wrap:wrap}#chat-alert-stack{top:14px;right:14px}.chat-media audio{min-width:165px}.chat-contact-details{display:none!important}}

/* Keep contact identity readable beside mobile controls. */
body[data-page=conversations] #content,.chat-alert{font-family:Segoe UI,Arial,sans-serif}.chat-media audio{display:block}.chat-media button{display:block}.chat-contact-heading>div{min-width:0}.chat-contact-heading h3,.chat-contact-heading p{overflow-wrap:normal;word-break:normal}
@media(max-width:760px){.conversation-heading .chat-contact-heading{flex:1 1 calc(100% - 110px);min-width:170px}.chat-heading-actions{flex:1 1 100%;justify-content:flex-end}.conversation-heading #conversation-back{flex:none}.chat-heading-actions details>div{max-width:calc(100vw - 55px)}.chat-contact-heading h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}

/* Dropdowns must not inherit the narrow width of their summary button. */
.conversation-heading{position:relative;z-index:30;overflow:visible}.chat-heading-actions details{position:relative;flex:none;overflow:visible}.chat-heading-actions details>div{width:280px!important;min-width:min(260px,calc(100vw - 40px))!important;max-width:min(300px,calc(100vw - 40px))!important;max-height:min(70dvh,500px);overflow-y:auto;overflow-x:hidden;box-sizing:border-box;word-break:normal;overflow-wrap:normal}.chat-heading-actions .chat-menu-body{display:flex;flex-direction:column;gap:8px}.chat-heading-actions .chat-menu-body button{display:block;width:100%;max-width:none!important;min-width:0;white-space:normal;word-break:normal;overflow-wrap:break-word;text-align:left;font:13px/1.5 'Segoe UI',Arial,sans-serif;padding:11px 12px}.chat-heading-actions details label,.chat-heading-actions details p{white-space:normal;word-break:normal}.chat-heading-actions details[open]>summary{border-color:var(--tone-border-46debd,#46debd);color:var(--tone-text-62e5cb,#62e5cb)}

.chat-heading-actions{flex-wrap:wrap}.chat-block-notice{margin:12px 0;padding:14px;border:1px solid var(--tone-border-b18a41,#b18a41);border-radius:8px;background:var(--tone-bg-393122,#393122);color:var(--tone-text-f0deb5,#f0deb5)}.chat-block-notice p{font:12px/1.5 Segoe UI,Arial,sans-serif;margin:7px 0}.chat-block-notice button{font-size:12px}.at-dialog .check{display:flex;align-items:flex-start;gap:9px}.at-dialog .check input{width:auto;flex:none;margin:4px 0 0}#chat-guidance-dialog hr{border:0;border-top:1px solid var(--tone-border-355068,#355068);margin:24px 0}

/* Wrap controls before squeezing customer identity. */
.conversation-heading{flex-wrap:wrap}.chat-contact-heading{flex:1 1 240px}.chat-contact-heading>div{min-width:0;flex:1}.chat-contact-heading h3{overflow-wrap:break-word;word-break:normal}.chat-heading-actions{flex-wrap:wrap;max-width:100%}.chat-contact-heading>.badge{flex-shrink:0}

/* WhatsApp delivery and preserved deletion indicators. */
.chat-stamp .chat-receipt-read{color:var(--tone-text-0876b9,#0876b9);font-weight:700}.chat-deleted-notice{display:flex;align-items:center;gap:7px;border:1px solid var(--border,var(--tone-border-8194a4,#8194a4));border-radius:7px;padding:7px 10px;margin-bottom:9px;font-size:12px;font-weight:650;color:var(--text,inherit);background:var(--panel,transparent)}.message-deleted{border-left:3px solid var(--tone-border-ba7c16,#ba7c16)}.chat-participant{display:block;font-size:12px;font-weight:700;margin-bottom:5px}.chat-avatar{position:relative;overflow:hidden}.chat-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.chat-avatar img[hidden]{display:none}

/* Compact controls: fixed icon slots and no wrapped toolbar rows. */
body[data-page=conversations] .conversation-toolbar{display:flex!important;flex-direction:column;gap:7px;padding:10px 12px 0!important;box-sizing:border-box}
body[data-page=conversations] .conversation-toolbar .chat-toolbar-actions{display:grid!important;grid-template-columns:minmax(44px,1fr) minmax(65px,1.25fr) repeat(4,30px);gap:4px!important;flex-wrap:nowrap!important;width:100%;min-width:0}
body[data-page=conversations] .chat-toolbar-actions>button{display:flex!important;align-items:center;justify-content:center;gap:0;min-width:0!important;width:100%;height:36px;min-height:36px;padding:0 5px!important;margin:0!important;font:600 11px/1 Segoe UI,Arial,sans-serif;white-space:nowrap;border-radius:8px;box-sizing:border-box}
.chat-toolbar-actions svg{width:17px;height:17px;flex:none;pointer-events:none}.conversation-toolbar .chat-delete-archived{align-self:flex-start;font-size:11px}
body[data-page=conversations] #chat-privacy[aria-pressed=false]{color:var(--muted)!important;background:var(--panel)!important;border-color:var(--line)!important}
body[data-page=conversations] #chat-privacy[aria-pressed=true],body[data-page=conversations] #chat-enable-sound[aria-pressed=true]{color:var(--on-accent)!important;background:var(--accent)!important;border-color:var(--accent)!important}
/* Presentation privacy only: server permissions remain authoritative. */
body.chat-privacy-on .conversation-row-content,body.chat-privacy-on .conversation-list .chat-avatar,body.chat-privacy-on .conversation-list .chat-unread-count,body.chat-privacy-on .chat-contact-heading,body.chat-privacy-on .conversation-panel .chat-body,body.chat-privacy-on .conversation-panel .chat-notices,body.chat-privacy-on .conversation-panel #chat-file-preview,body.chat-privacy-on .conversation-panel #reply-form textarea,body.chat-privacy-on .chat-alert p{filter:blur(7px);user-select:none}
body.chat-privacy-on .conversation-panel .chat-body{pointer-events:none}

/* Compact ordering and four fixed tabs, including selected WhatsApp groups. */
body[data-page=conversations] .conversation-order{flex:none;display:flex;align-items:center;gap:8px;margin:0;padding:6px 12px;font-size:11px;color:var(--muted)}
body[data-page=conversations] .conversation-order select{flex:1;min-width:0;margin:0;padding:6px 8px;font-size:11px;height:34px;background:var(--panel);color:var(--text);border:1px solid var(--line)}
body[data-page=conversations] .chat-list-tabs{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px!important;flex:none}
body[data-page=conversations] .chat-list-tabs button{min-width:0!important;margin:0!important;padding:7px 3px!important;font-size:11px!important;white-space:nowrap}

body[data-page=conversations] .chat-list-tabs button.selected{color:var(--accent)!important;background:var(--accent-soft,var(--panel))!important;border-color:var(--accent)!important;font-weight:600}

#group-observer-dialog .group-observer-source{white-space:pre-wrap;overflow-wrap:anywhere}#group-observer-dialog textarea{width:100%;max-width:100%}#group-observer-dialog [data-reports] .actions{gap:8px;flex-wrap:wrap}

/* Higher specificity than global palette button rules: equal geometry and a visible selected state. */
html[data-theme] body[data-page=conversations] #content .conversation-sidebar .chat-list-tabs{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important;align-items:stretch!important;padding:8px 10px!important}
html[data-theme] body[data-page=conversations] #content .conversation-sidebar .chat-list-tabs button{display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;height:34px!important;min-height:34px!important;min-width:0!important;width:100%!important;margin:0!important;padding:6px 3px!important;border:1px solid var(--line)!important;border-radius:8px!important;color:var(--text)!important;background:var(--panel)!important;font:600 11px/1.2 'Segoe UI',Arial,sans-serif!important;white-space:nowrap!important;box-shadow:none!important;transform:none!important}
html[data-theme] body[data-page=conversations] #content .conversation-sidebar .chat-list-tabs button.selected{background:var(--accent)!important;color:var(--on-accent)!important;border-color:var(--accent)!important}
html[data-theme] body[data-page=conversations] #content .chat-list-tabs button:focus-visible{outline:2px solid var(--accent)!important;outline-offset:2px}
html[data-theme] body[data-page=conversations] #content .conversation-heading{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:14px 18px}
html[data-theme] body[data-page=conversations] #content .chat-contact-heading>div{min-width:0;flex:1}
html[data-theme] body[data-page=conversations] #content .chat-contact-heading h3{overflow-wrap:anywhere}
html[data-theme] body[data-page=conversations] #content .chat-heading-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-start;min-width:0}
html[data-theme] body[data-page=conversations] #content .chat-heading-actions>button,html[data-theme] body[data-page=conversations] #content .chat-heading-actions>details>summary{min-height:34px;box-sizing:border-box;white-space:nowrap}
html[data-theme] body[data-page=conversations] #content .chat-heading-actions .chat-archive-direct{color:var(--accent)!important;background:var(--accent-soft)!important;border-color:var(--accent)!important;font-weight:600}
.conversation-panel.chat-file-dragging{outline:3px dashed var(--accent)!important;outline-offset:-5px}.conversation-panel.chat-file-dragging .chat-composer-wrap{box-shadow:inset 0 0 0 2px var(--accent)}
@media(max-width:760px){html[data-theme] body[data-page=conversations] #content .conversation-heading{padding:10px 12px;gap:8px}html[data-theme] body[data-page=conversations] #content .chat-heading-actions>button,html[data-theme] body[data-page=conversations] #content .chat-heading-actions>details>summary{font-size:10px;padding:6px 8px}html[data-theme] body[data-page=conversations] #content #conversation-back{justify-self:start}}

.chat-previous-attendance{display:block!important;text-align:left!important;margin:0 0 6px!important;font-size:10px!important;font-weight:600;color:var(--muted)!important}.chat-history-preserved{border-left:2px solid var(--accent);padding-left:8px}

#group-observer-dialog button:not(:disabled){background:var(--panel);color:var(--text);opacity:1;-webkit-text-fill-color:currentColor}#group-observer-dialog button.primary:not(:disabled){background:var(--accent);color:var(--on-accent);opacity:1}#group-observer-dialog .actions{display:flex;gap:8px;flex-wrap:wrap}
.chat-bulk-actions{display:flex;justify-content:flex-end;padding:3px 12px 7px}.chat-bulk-actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:5px 9px;font-size:11px;border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:8px}.chat-bulk-actions svg{width:15px;height:15px;flex:0 0 15px;color:var(--accent)}.chat-bulk-actions button:hover{border-color:var(--accent);background:var(--accent-soft)}

@media(max-width:760px){body[data-page=conversations] #content .chat-heading-actions .chat-transfer-menu[open]>div{position:fixed;left:12px;right:12px;top:clamp(60px,18dvh,150px);width:auto;max-width:none;max-height:calc(100dvh - 180px);overflow-y:auto;overscroll-behavior:contain;z-index:1000}}

/* Agent-scoped inbox and dated history, using the current theme tokens. */

.conversation-row-content .row time{white-space:normal;max-width:125px;text-align:right;font-size:10px;line-height:1.4}
.chat-message-order{display:flex;gap:10px;align-items:center;justify-content:flex-end;padding:8px 12px;flex-shrink:0}
.chat-message-order select{width:auto;max-width:240px;padding:7px}
.chat-day-divider{align-self:center;text-align:center;margin:16px auto 8px;padding:6px 14px;border:1px solid var(--border,var(--tone-border-455c70,#455c70));border-radius:18px;background:var(--panel,var(--tone-bg-102434,#102434));color:var(--text,var(--tone-text-dbeaf2,#dbeaf2));font-size:12px;width:fit-content}
.chat-contact-card{border:1px solid var(--border,var(--tone-border-455c70,#455c70));border-radius:12px;padding:14px;white-space:pre-wrap}
.config-removal-dialog,.chat-share-contact-dialog{width:min(540px,calc(100vw - 32px));max-height:85vh;overflow:auto;padding:24px}
.config-removal-dialog::backdrop,.chat-share-contact-dialog::backdrop{background:var(--tone-bg-0008,#0008)}
.config-removal-dialog form,.chat-share-contact-dialog form{display:grid;gap:16px}
@media(max-width:600px){.chat-message-order{justify-content:space-between;font-size:11px}.chat-message-order select{max-width:210px}.conversation-row-content .row time{max-width:100px}}

/* Compact selectors and paired archive actions remain inside the sidebar at any width. */
body[data-page=conversations] .conversation-agent-select select{font-weight:600}
body[data-page=conversations] .chat-bulk-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:4px 10px;flex:none;min-width:0}
body[data-page=conversations] .chat-bulk-actions button{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;min-width:0;margin:0;padding:7px 4px;font-size:10px;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
body[data-page=conversations] .chat-bulk-actions svg{width:14px;height:14px;flex:none}

/* Chat timeline follows WhatsApp: latest at bottom, history stays anchored. */
.chat-stream{position:relative}.conversation-panel .messages{overflow-anchor:none;scroll-behavior:auto}.chat-jump-latest{position:absolute;right:18px;bottom:18px;z-index:5;display:inline-flex;align-items:center;gap:8px;max-width:calc(100% - 36px);padding:10px 16px;border-radius:24px;background:var(--panel,var(--tone-bg-102434,#102434));color:var(--text,var(--tone-text-dbeaf2,#dbeaf2));border:1px solid var(--line,var(--tone-border-455c70,#455c70));box-shadow:0 4px 16px var(--tone-bg-0003,#0003);cursor:pointer;font-size:12px}.chat-jump-latest[hidden]{display:none!important}

.conversation-panel .messages::before{content:"";margin-top:auto}

body[data-page=conversations] .chat-bulk-actions #archive-clean{grid-column:1 / -1}
