.msg-dialog{box-sizing:border-box;width:min(1120px,96vw);max-height:92dvh;margin:auto;padding:24px;border:1px solid #cad9e6;border-radius:18px;background:#f3f7fb;color:#172d43;box-shadow:0 20px 80px #00142855;font:15px/1.5 system-ui,sans-serif;overflow:auto}
.msg-dialog::backdrop{background:#08182d88;backdrop-filter:blur(5px)}
.msg-dialog *{box-sizing:border-box}.msg-dialog .msg-heading,.msg-dialog .msg-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.msg-dialog h2{margin:0 auto 0 0;font-size:23px}.msg-dialog h3{font-size:18px;margin:12px 0}.msg-dialog p{margin:12px 0}.msg-dialog button{min-height:42px;padding:8px 16px;border:1px solid #b5cbdc;border-radius:10px;background:#e3eef7;color:#173e58;font:600 14px system-ui;cursor:pointer}.msg-dialog button:disabled{opacity:.55;cursor:default}.msg-dialog :focus-visible{outline:2px solid #0284c7;outline-offset:3px}.msg-dialog a{display:block;color:#006ca7;margin:12px 0}.msg-dialog code{display:block;overflow-wrap:anywhere;background:#e1eaf3;padding:10px;border-radius:8px}.msg-dialog label{display:flex;flex-direction:column;gap:6px;min-width:0}.msg-dialog input,.msg-dialog select,.msg-dialog textarea{font:15px system-ui;color:inherit;background:#fff;border:1px solid #b7c9d8;border-radius:8px;padding:10px;width:100%;min-height:42px}.msg-dialog textarea{min-height:100px;resize:vertical}.msg-dialog .msg-check{flex-direction:row;align-items:center}.msg-dialog input[type=checkbox]{width:20px;min-height:20px;margin:4px;accent-color:#0284c7}.msg-dialog .msg-policy{display:flex;align-items:end;flex-wrap:wrap;gap:18px;background:#fff9;border-radius:12px;padding:16px;margin:12px 0}.msg-dialog .msg-policy h3{min-width:190px;flex:1}.msg-dialog .msg-form{display:grid;gap:16px;margin:18px 0}.msg-dialog .msg-section{margin-top:18px;background:#ffffffb8;padding:20px;border-radius:14px}.msg-dialog .msg-table{overflow:auto;max-height:370px}.msg-dialog table{border-collapse:collapse;width:100%;font-size:14px;background:#ffffffe8}.msg-dialog th,.msg-dialog td{text-align:left;padding:12px;border-bottom:1px solid #cddbe6;max-width:360px;overflow-wrap:anywhere}.msg-dialog .msg-note{font-size:14px;color:#435e74}.msg-dialog .msg-preview{white-space:pre-wrap;padding:16px;border-radius:12px;background:#dfeefa}.msg-dialog .msg-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
[data-theme=dark] .msg-dialog,html.dark .msg-dialog{background:#0f2035;color:#e4edf7;border-color:#35516c}[data-theme=dark] .msg-dialog .msg-section,[data-theme=dark] .msg-dialog .msg-policy{background:#1a3249}[data-theme=dark] .msg-dialog input,[data-theme=dark] .msg-dialog select,[data-theme=dark] .msg-dialog textarea,[data-theme=dark] .msg-dialog table{background:#10283e;color:#e4edf7;border-color:#3c566e}[data-theme=dark] .msg-dialog button,[data-theme=dark] .msg-dialog code,[data-theme=dark] .msg-dialog .msg-preview{background:#24465f;color:#e4f5ff;border-color:#52728c}[data-theme=dark] .msg-dialog th,[data-theme=dark] .msg-dialog td{border-color:#35516c}[data-theme=dark] .msg-dialog .msg-note{color:#b9cedf}[data-theme=dark] .msg-dialog a{color:#7dd3fc}
@media(max-width:600px){.msg-dialog{padding:14px;width:96vw}.msg-dialog .msg-section{padding:12px}.msg-dialog .msg-heading{gap:8px}.msg-dialog h2{font-size:19px}.msg-dialog input,.msg-dialog select,.msg-dialog textarea{font-size:16px}.msg-dialog .msg-policy{align-items:stretch;flex-direction:column}}

/* Non-modal workspace stays below the production softphone (z-index 70). */
.msg-dialog[open]{position:fixed;inset:4dvh 0 auto;z-index:60}

/* Compact messaging UI: 14px text, 36px inputs, 24px pill controls. */
.msg-dialog{font:14px/1.4 Epilogue,-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif;padding:12px;width:min(1120px,96vw);border-radius:12px}
.msg-dialog h2{font-size:18px}.msg-dialog h3{font-size:16px;margin:4px 0}.msg-dialog p{margin:6px 0}.msg-dialog .msg-heading,.msg-dialog .msg-actions{gap:8px}
.msg-dialog button{height:24px;min-height:24px;padding:0 12px;border-radius:999px;line-height:22px;font:inherit;font-size:14px;white-space:nowrap;box-shadow:none}
.msg-dialog input,.msg-dialog select{height:36px;min-height:36px;padding:8px 16px;font:inherit;font-size:14px;line-height:18px;width:min(280px,100%);max-width:100%}
.msg-dialog input::placeholder,.msg-dialog textarea::placeholder{font-size:14px;opacity:.7}
.msg-dialog textarea{font:inherit;font-size:14px;min-height:72px;padding:8px 16px;width:100%}.msg-dialog input[type=checkbox]{height:16px;min-height:16px;width:16px;padding:0;margin:0}
.msg-dialog .msg-check{gap:8px}.msg-dialog .msg-form{gap:10px;margin:10px 0}.msg-dialog .msg-section{margin-top:10px;padding:10px}.msg-dialog .msg-policy{padding:10px;gap:12px;margin:8px 0}
.msg-dialog .msg-note{font-size:12px}.msg-dialog th,.msg-dialog td{padding:8px}.msg-dialog .msg-preview{padding:8px 12px}.msg-dialog .msg-grid{gap:8px;grid-template-columns:repeat(auto-fit,minmax(180px,280px))}
.wa-chat{margin-top:10px;--wa-border:#d4dfe9;--wa-surface:#fff;--wa-soft:#edf4fa;--wa-muted:#52687a;--wa-primary:#125ca0;color:inherit}
.wa-chat [hidden]{display:none!important}.wa-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}.wa-toolbar h3{margin-right:auto}.wa-toolbar input{width:210px}.wa-toolbar select{width:auto;max-width:150px}
.wa-primary{background:var(--wa-primary)!important;color:#fff!important;border-color:var(--wa-primary)!important}
.wa-new{display:flex;align-items:end;gap:8px;flex-wrap:wrap;padding:10px;background:var(--wa-soft);border:1px solid var(--wa-border);border-radius:10px;margin-bottom:10px}
.wa-grid{display:grid;grid-template-columns:minmax(210px,28%) minmax(0,1fr);gap:10px;height:min(60dvh,600px);min-height:360px}
.wa-list{overflow:auto;border:1px solid var(--wa-border);border-radius:10px;background:var(--wa-surface);padding:4px}
.msg-dialog .wa-chat-row{display:flex;flex-direction:column;gap:3px;width:100%;height:auto;min-height:66px;white-space:normal;align-items:stretch;text-align:left;padding:9px 10px;border:0;border-bottom:1px solid var(--wa-border);border-radius:7px;background:transparent;color:inherit}
.msg-dialog .wa-chat-row:hover,.msg-dialog .wa-selected{background:var(--wa-soft)}.wa-row-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.wa-row-title strong{font-size:14px;font-weight:600}.wa-preview{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.wa-muted{color:var(--wa-muted);font-size:12px;overflow-wrap:anywhere}.wa-unread{background:var(--wa-primary);color:#fff;min-width:18px;padding:1px 5px;font-size:11px;border-radius:999px;text-align:center}
.wa-thread{display:flex;flex-direction:column;min-width:0;min-height:0;border:1px solid var(--wa-border);border-radius:10px;background:var(--wa-surface);padding:10px;gap:8px}.wa-thread-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.wa-thread-top>div:first-child{margin-right:auto}.wa-thread-top select{width:min(220px,100%)}.wa-thread-top p{flex-basis:100%}
.wa-timeline{display:flex;flex-direction:column;gap:8px;flex:1;overflow:auto;min-height:100px;padding:8px;background:var(--wa-soft);border-radius:8px;scrollbar-gutter:stable}
.wa-bubble{max-width:88%;padding:8px 12px;border:1px solid var(--wa-border);border-radius:12px;overflow-wrap:anywhere;flex-shrink:0}.wa-in{align-self:flex-start;background:var(--wa-surface)}.wa-out{align-self:flex-end;background:#dfeeff;border-color:#bdd7f2}.wa-message-text{font-size:14px;white-space:pre-wrap;margin-bottom:4px}.wa-send-warning{font-size:12px;color:#9d3c15}.wa-empty{padding:12px;color:var(--wa-muted)}
.wa-compose{display:grid;grid-template-columns:1fr auto;gap:6px 10px;border-top:1px solid var(--wa-border);padding-top:8px}.wa-window,.wa-message-fields,.wa-compose>.wa-muted{grid-column:1/-1}.wa-window{font-size:12px;color:var(--wa-muted)}.wa-compose>label{display:flex;flex-direction:row;align-items:center;gap:8px}.wa-compose>label select{width:180px}.wa-compose>button{align-self:end;justify-self:end}.wa-message-fields{display:grid;gap:6px;max-height:190px;overflow:auto}.wa-message-fields textarea{min-height:60px;height:60px;resize:vertical}.wa-template-preview{font-size:13px;white-space:pre-wrap;background:var(--wa-soft);border-radius:8px;padding:8px}.wa-variables{display:flex;gap:8px;flex-wrap:wrap}.wa-variables input{width:210px}.wa-consent{display:flex!important;flex-direction:row!important;align-items:center;gap:8px;font-size:12px}.wa-more{margin:8px}
[data-theme=dark] .wa-chat,html.dark .wa-chat{--wa-border:#35516c;--wa-surface:#10283e;--wa-soft:#182f45;--wa-muted:#b9cedf;--wa-primary:#2577bf}
[data-theme=dark] .wa-out,html.dark .wa-out{background:#214664;border-color:#376184}[data-theme=dark] .wa-send-warning,html.dark .wa-send-warning{color:#ffbd9c}
@media(max-width:720px){.wa-grid{grid-template-columns:1fr;height:auto}.wa-list{max-height:190px}.wa-thread{height:570px;max-height:78dvh}.wa-toolbar input{flex:1;min-width:150px}.wa-compose{grid-template-columns:1fr}.wa-compose>button{justify-self:start}.wa-thread-top select{width:min(200px,100%)}}
@media(pointer:coarse){.msg-dialog button{height:32px;min-height:32px}.msg-dialog .wa-chat-row{height:auto}.msg-dialog .msg-actions{gap:10px}}

@layer dp-compact {
/* Shared density applies to the existing admin, tenant and phone pages, including dialogs.
   Keep existing colours, navigation structure, icons and call controls. */
html body{font-family:Epilogue,-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif!important;font-size:14px!important}
html body :is(h1,h2,h3,h4,p,label,th,td,input,select,textarea,button){font-family:Epilogue,-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif!important}
html body :is(p,label,th,td){font-size:14px!important}
html body h1{font-size:26px!important}html body h2{font-size:18px!important}html body h3{font-size:16px!important}
html body :is(.muted,.msg-note,.wa-muted,.status){font-size:12px!important}
html body :is(.card,.activity-panel,.msg-section,dialog,[role=dialog]){padding:12px!important}
html body :is(.grid,.tools,.msg-actions,.routing-actions){gap:8px!important}
html body :is(th,td){padding:8px 12px!important}
html body button:not(.wa-chat-row):not(.dial-fab):not(.key):not(.aw-key){height:24px!important;min-height:24px!important;padding:0 12px!important;border-radius:999px!important;line-height:22px!important;font-size:14px!important;max-width:100%!important;width:fit-content!important}
html body :is(#adminNavigation,.dashboard-nav,#phoneNavigation,.aw-nav) button{height:auto!important;min-height:24px!important;padding:2px 12px!important;line-height:20px!important}
html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=color]),select,textarea){height:36px!important;min-height:36px!important;padding:8px 16px!important;font-size:14px!important;line-height:18px!important;box-sizing:border-box!important;max-width:100%!important}
html body :where(input,select):where(:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=color])){width:min(100%,30ch)!important}
html body :is(input,textarea)::placeholder{font-size:14px!important}
html body textarea{width:100%!important;resize:vertical!important;overflow:auto!important}
html body :is(.grid,.msg-grid)>label{min-width:0!important}
html body :is(#login,#change) :is(input,select){width:100%!important}
html body .wa-chat-row{width:100%!important}
html body .wa-toolbar input{width:180px!important}
html body .wa-toolbar select{width:auto!important;max-width:150px!important}
html body .wa-compose>label select{width:180px!important}
html body .wa-thread-top select{width:min(240px,100%)!important}
html body .wa-message-text{font-size:14px!important}
html body .wa-grid{height:min(50dvh,500px)!important}
@media(pointer:coarse){html body button:not(.wa-chat-row):not(.dial-fab):not(.key):not(.aw-key){height:32px!important;min-height:32px!important}}
@media(max-width:720px){html body .wa-grid{height:auto!important}}

}

.wa-assignment{display:flex;align-items:center;gap:8px;max-width:100%;margin-left:auto}
[data-theme=dark] .msg-dialog :is(input,textarea)::placeholder,html.dark .msg-dialog :is(input,textarea)::placeholder{color:#b9cedf;opacity:1}
/* Preserve the installed Refresh/Close icon controls. */
.msg-icon-button{display:inline-flex;align-items:center;justify-content:center}
.msg-icon-button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
@layer dp-compact {
html body .wa-chat-row{height:auto!important;min-height:66px!important;max-height:none!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;white-space:normal!important;padding:8px 10px!important;border-radius:7px!important}
html body .wa-chat label{max-width:100%!important;width:auto!important}
html body .wa-chat .wa-consent{flex-direction:row!important;align-items:center!important}
html body .wa-thread-top .wa-assignment{min-width:0!important}
html body .wa-chat :is(.wa-preview,.wa-message-text){overflow-wrap:anywhere!important}
html body .wa-chat .wa-primary{background:var(--wa-primary)!important;color:white!important;border-color:var(--wa-primary)!important}
}
/* The installed tenant page uses its own important cascade layer. Keep its page
   placement while giving the nested chat controls content-sized dimensions. */
@layer dpSmsTenantPage {
html body #dp-sms-tenant-page.dp-sms-tenant-page{font-size:14px!important;padding:12px!important}
html body #dp-sms-tenant-page.dp-sms-tenant-page :is(p,label,button,th,td){font-size:14px!important}
html body #dp-sms-tenant-page.dp-sms-tenant-page :is(.wa-muted,.wa-window,.msg-note){font-size:12px!important}
html body #dp-sms-tenant-page .wa-chat [hidden]{display:none!important}
html body #dp-sms-tenant-page .wa-chat .wa-toolbar{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important}
html body #dp-sms-tenant-page .wa-chat .wa-toolbar h3{margin-right:auto!important}
html body #dp-sms-tenant-page .wa-chat .wa-toolbar input{width:180px!important;max-width:100%!important}
html body #dp-sms-tenant-page .wa-chat .wa-toolbar select{width:auto!important;max-width:150px!important}
html body #dp-sms-tenant-page .wa-chat button.wa-chat-row{height:auto!important;min-height:66px!important;max-height:none!important;width:100%!important;max-width:100%!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:start!important;white-space:normal!important;line-height:1.4!important;gap:3px!important;padding:8px 10px!important;border:0!important;border-bottom:1px solid var(--wa-border)!important;border-radius:7px!important;background:transparent!important;color:inherit!important;font-weight:400!important}
html body #dp-sms-tenant-page .wa-chat button.wa-selected{background:var(--wa-soft)!important}
html body #dp-sms-tenant-page .wa-chat .wa-thread-top select{width:min(240px,100%)!important}
html body #dp-sms-tenant-page .wa-chat .wa-compose>label{display:flex!important;flex-direction:row!important;align-items:center!important;width:auto!important;max-width:none!important}
html body #dp-sms-tenant-page .wa-chat .wa-compose>label select{width:180px!important}
html body #dp-sms-tenant-page .wa-chat .wa-message-fields>label{width:100%!important;max-width:none!important}
html body #dp-sms-tenant-page .wa-chat .wa-message-fields textarea{width:100%!important;max-width:none!important}
html body #dp-sms-tenant-page .wa-chat .wa-variables label{width:auto!important;max-width:240px!important}
html body #dp-sms-tenant-page .wa-chat .wa-consent{display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important;max-width:none!important}
html body #dp-sms-tenant-page .wa-chat button.wa-primary{background:var(--wa-primary)!important;color:#fff!important;border-color:var(--wa-primary)!important}
@media(pointer:coarse){html body #dp-sms-tenant-page .wa-chat button:not(.wa-chat-row){height:32px!important;min-height:32px!important;max-height:32px!important}}
@media(max-width:720px){html body #dp-sms-tenant-page .wa-chat .wa-toolbar input{flex:1!important;min-width:120px!important}}
}
@layer dpSmsAdminPage {
html body #dp-sms-admin-page[id] :is(p,label,button){font-size:14px!important}
html body #dp-sms-admin-page[id] input[type=number]{padding:8px 16px!important}
@media(pointer:coarse){html body #dp-sms-admin-page[id] button.dp-sms-button{height:32px!important;min-height:32px!important;max-height:32px!important}}
}
@layer dpSmsAdminPage {
html body #app>#dp-sms-admin-page[id]{padding:12px!important;font-size:14px!important}
}

/* Full-page agent Inbox. Keep the existing router, navigation and dialpad. */
@layer dp-compact {
html body #agentInboxPage.dp-agent-inbox{position:static!important;inset:auto!important;z-index:auto!important;width:100%!important;max-width:none!important;min-width:0!important;max-height:none!important;margin:0!important;padding:12px!important;box-shadow:none!important;overflow:visible!important;grid-column:1/-1!important}
html body #agentInboxPage[hidden],html body .cv-launch[hidden]{display:none!important}
html body #agentInboxPage .msg-section{margin-top:10px!important;padding:12px!important}
html body #agentInboxPage .wa-grid{height:clamp(400px,52dvh,640px)!important;grid-template-columns:minmax(220px,28%) minmax(0,1fr)!important}
html body #agentInboxPage .wa-list,html body #agentInboxPage .wa-thread{min-width:0!important}
html body #agentInboxPage .wa-thread{padding:10px!important}
html body #agentInboxPage .wa-timeline{min-height:160px!important}
html body #agentInboxPage .wa-compose{margin-top:0!important;padding-top:8px!important}
html body #agentInboxPage .wa-compose p{margin:4px 0!important}
html body #agentInboxPage .wa-new[hidden],html body #agentInboxPage .wa-chat [hidden]{display:none!important}
html body #agentInboxPage .msg-heading{gap:8px!important;margin-bottom:8px!important;padding-bottom:8px!important;border-bottom:1px solid var(--wa-border,#cad9e6)!important}
@media(max-width:720px){html body #agentInboxPage .wa-grid{height:auto!important;grid-template-columns:1fr!important}html body #agentInboxPage .wa-list{max-height:220px!important}html body #agentInboxPage .wa-thread{min-height:420px!important}html body #agentInboxPage .wa-timeline{max-height:360px!important}html body #agentInboxPage .wa-toolbar input{flex:1 1 100%!important;min-width:0!important;width:100%!important}}
}

/* Inbox 1.0.2: component geometry has priority over portal-wide density rules.
   The chat module establishes this layer first, without changing other pages. */
@layer dpChatLayout {
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat) {
    font-family:Epilogue,-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif!important;
    font-size:14px!important;line-height:1.4!important;
  }
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-form label {font-family:Epilogue,-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif!important;font-size:14px!important;line-height:20px!important;gap:4px!important;min-width:0!important;padding:0!important;}
  html body #agentInboxPage[data-chat-layout="104"].dp-agent-inbox {
    display:block!important;position:static!important;inset:auto!important;transform:none!important;
    width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:12px!important;overflow:visible!important;box-sizing:border-box!important;
  }
  html body #agentInboxPage[data-chat-layout="104"] :is(.msg-body,.msg-section) {min-width:0!important;height:auto!important;max-height:none!important;overflow:visible!important;}
  html body #agentInboxPage[data-chat-layout="104"] .msg-body {padding:0!important;flex:none!important;}
  html body #agentInboxPage[data-chat-layout="104"] .msg-section {padding:12px!important;margin-top:10px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] :is(.wa-chat,.wa-chat *),html body #agentInboxPage[data-chat-layout="104"] * {box-sizing:border-box!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat {
    --wa-border:var(--ui-border,#cbdce9);--wa-surface:var(--ui-input,#fff);--wa-soft:var(--ui-selected,#edf4fa);
    --wa-muted:var(--ui-muted,#52687a);--wa-primary:var(--blue,#007eb8);
    min-width:0!important;max-width:100%!important;margin-top:10px!important;color:var(--ui-text,#172d43)!important;
    font:14px/1.4 Epilogue,-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif!important;
  }
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat :is(p,label,span,small,strong,h3,input,select,textarea,button,.dp-eg-select-trigger) {font-family:inherit!important;letter-spacing:normal!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat :is(div,section,aside,form,label) {min-width:0!important;max-width:100%!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat p {margin:0!important;padding:0!important;overflow-wrap:anywhere!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat label {display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:4px!important;margin:0!important;padding:0!important;font-size:14px!important;line-height:20px!important;color:inherit!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat h3 {font-size:16px!important;line-height:22px!important;margin:0!important;padding:0!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] :is(.wa-chat,.msg-form) button:not(.wa-chat-row) {
    display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important;
    width:fit-content!important;min-width:0!important;max-width:100%!important;height:24px!important;min-height:24px!important;max-height:24px!important;
    margin:0!important;padding:0 12px!important;border:1px solid var(--wa-border)!important;border-radius:999px!important;
    font-size:14px!important;line-height:22px!important;white-space:nowrap!important;box-shadow:none!important;background:var(--wa-soft)!important;color:inherit!important;
  }
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat button.wa-primary {background:var(--wa-primary)!important;border-color:var(--wa-primary)!important;color:#fff!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] :is(input:not([type=checkbox]),select:not(.dp-eg-select-source),textarea,.dp-eg-select-trigger),
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-body>label :is(select:not(.dp-eg-select-source),.dp-eg-select-trigger) {
    box-sizing:border-box!important;display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;
    height:36px!important;min-height:36px!important;max-height:36px!important;margin:0!important;padding:8px 16px!important;
    border:1px solid var(--wa-border,var(--ui-border,#cbdce9))!important;border-radius:8px!important;
    background:var(--ui-input,#fff)!important;color:var(--ui-text,#172d43)!important;box-shadow:none!important;
    font-size:14px!important;line-height:18px!important;font-weight:400!important;
  }
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat :is(select:not(.dp-eg-select-source),.dp-eg-select-trigger),html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-body>label .dp-eg-select-trigger {padding-right:36px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat .dp-eg-select-trigger,html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-body>label .dp-eg-select-trigger {position:relative!important;display:flex!important;align-items:center!important;gap:8px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat .dp-eg-select-value,html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-body>label .dp-eg-select-value {display:block!important;flex:1 1 auto!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:14px!important;line-height:18px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat .dp-eg-select-trigger::after,html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-body>label .dp-eg-select-trigger::after {position:absolute!important;right:14px!important;top:50%!important;margin:0!important;transform:translateY(-70%) rotate(45deg)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] select.dp-eg-select-source {position:absolute!important;width:1px!important;min-width:0!important;max-width:1px!important;height:1px!important;min-height:0!important;max-height:1px!important;padding:0!important;margin:0!important;border:0!important;outline:0!important;overflow:hidden!important;clip-path:inset(50%)!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important;transition:none!important;animation:none!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat :is(input,textarea)::placeholder {font-size:14px!important;color:var(--wa-muted)!important;opacity:1!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat textarea {max-height:160px!important;resize:vertical!important;overflow:auto!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat :is(input,select,textarea,.dp-eg-select-trigger):focus-visible {outline:2px solid var(--wa-primary)!important;outline-offset:2px!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-body>label {width:min(420px,100%)!important;min-width:0!important;margin-top:8px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar {display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;margin:0 0 10px!important;padding:0!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar h3 {flex:1 0 100px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar :is(select:not(.dp-eg-select-source),.dp-eg-select-trigger) {flex:0 1 150px!important;width:150px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar input {flex:0 1 200px!important;width:200px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-new {display:flex!important;flex-wrap:wrap!important;align-items:end!important;gap:8px!important;margin:0 0 10px!important;padding:12px!important;background:var(--wa-soft)!important;border:1px solid var(--wa-border)!important;border-radius:10px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-new>label {flex:0 1 280px!important;width:280px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-grid {display:grid!important;grid-template-columns:minmax(220px,28%) minmax(0,1fr)!important;align-items:start!important;gap:12px!important;height:auto!important;min-height:0!important;max-height:none!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-list {height:auto!important;min-height:320px!important;max-height:clamp(320px,60dvh,640px)!important;overflow:auto!important;padding:6px!important;border:1px solid var(--wa-border)!important;border-radius:10px!important;background:var(--wa-surface)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat button.wa-chat-row {
    display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;gap:4px!important;
    width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:76px!important;max-height:none!important;
    flex:none!important;margin:0!important;padding:10px!important;border:0!important;border-bottom:1px solid var(--wa-border)!important;border-radius:8px!important;
    background:transparent!important;color:inherit!important;text-align:left!important;white-space:normal!important;font-size:14px!important;font-weight:400!important;line-height:20px!important;box-shadow:none!important;
  }
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat button.wa-chat-row:is(.wa-selected,:hover) {background:var(--wa-soft)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-row-title {display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;width:100%!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-row-title strong {flex:1 1 auto!important;min-width:0!important;font-size:14px!important;line-height:20px!important;overflow-wrap:anywhere!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat-row :is(span,small,strong,.wa-row-title) {height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;transform:none!important;position:static!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-preview {display:block!important;width:100%!important;overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important;font-size:13px!important;line-height:18px!important;padding:0!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-muted {font-size:12px!important;line-height:18px!important;color:var(--wa-muted)!important;overflow-wrap:anywhere!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat .wa-unread {flex:0 0 auto!important;min-width:20px!important;padding:1px 5px!important;background:var(--wa-primary)!important;color:#fff!important;border-radius:999px!important;line-height:18px!important;font-size:11px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread {display:flex!important;flex-direction:column!important;gap:10px!important;height:auto!important;min-height:400px!important;max-height:none!important;padding:12px!important;overflow:visible!important;border:1px solid var(--wa-border)!important;border-radius:10px!important;background:var(--wa-surface)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread-top {display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;flex:0 0 auto!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread-top>div:first-child {flex:1 1 180px!important;margin-right:auto!important;overflow-wrap:anywhere!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread-top h3 {margin:0 0 2px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-assignment {display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;margin-left:auto!important;flex:0 1 330px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-assignment :is(select:not(.dp-eg-select-source),.dp-eg-select-trigger) {width:min(240px,100%)!important;flex:1 1 180px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-timeline {display:flex!important;flex-direction:column!important;flex:0 0 auto!important;gap:8px!important;min-height:160px!important;max-height:clamp(160px,28dvh,360px)!important;overflow:auto!important;padding:10px!important;background:var(--wa-soft)!important;border-radius:8px!important;scrollbar-gutter:stable!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-bubble {flex:0 0 auto!important;min-width:0!important;max-width:88%!important;padding:8px 12px!important;border:1px solid var(--wa-border)!important;border-radius:12px!important;overflow-wrap:anywhere!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-in {background:var(--wa-surface)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-message-text {font-size:14px!important;line-height:20px!important;white-space:pre-wrap!important;margin-bottom:4px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose {display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:start!important;gap:8px!important;flex:0 0 auto!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding:10px 0 0!important;border-top:1px solid var(--wa-border)!important;overflow:visible!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>* {grid-column:1/-1!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-window {font-size:12px!important;line-height:18px!important;color:var(--wa-muted)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>label {width:min(360px,100%)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-message-fields {display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;height:auto!important;max-height:none!important;overflow:visible!important;padding:0!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-message-fields>label:not(.wa-consent) {width:100%!important;max-width:none!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-message-fields>label:has(select):not(.wa-consent) {width:min(420px,100%)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat p.wa-template-preview {font-size:13px!important;line-height:20px!important;white-space:pre-wrap!important;padding:10px 12px!important;border:1px solid var(--wa-border)!important;border-radius:8px!important;background:var(--wa-soft)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-variables {display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),240px))!important;gap:8px!important;width:100%!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-variables label {width:100%!important;max-width:none!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat label.wa-consent {display:grid!important;grid-template-columns:16px minmax(0,1fr)!important;align-items:start!important;gap:8px!important;width:100%!important;max-width:none!important;font-weight:400!important;font-size:12px!important;line-height:18px!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-consent input {display:block!important;flex:none!important;width:16px!important;min-width:16px!important;max-width:16px!important;height:16px!important;min-height:16px!important;max-height:16px!important;margin:1px 0!important;padding:0!important;accent-color:var(--wa-primary)!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-consent-text {min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important;font-size:12px!important;line-height:18px!important;color:inherit!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>button {justify-self:start!important;align-self:start!important;}
  html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat :is(.wa-empty,.wa-more) {margin:0!important;padding:10px!important;}
  html body #agentInboxPage[data-chat-layout="104"][hidden],html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat [hidden][hidden],html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat p:empty {display:none!important;}
  @media(max-width:900px) {
    html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-grid {grid-template-columns:minmax(0,1fr)!important;}
    html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-list {min-height:0!important;max-height:220px!important;}
    html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread {min-height:0!important;}
    html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar input {flex:1 1 100%!important;width:100%!important;}
  }
  @media(max-width:540px) {
    html body #agentInboxPage[data-chat-layout="104"].dp-agent-inbox,html body #agentInboxPage[data-chat-layout="104"] .msg-section,html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread {padding:10px!important;}
    html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-bubble {max-width:96%!important;}
    html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-assignment {flex-basis:100%!important;width:100%!important;margin:0!important;}
  }
  @media(pointer:coarse) {html body :is(.msg-dialog,#dp-sms-tenant-page)[data-chat-layout="104"] :is(.wa-chat,.msg-form) button:not(.wa-chat-row) {height:32px!important;min-height:32px!important;max-height:32px!important;}}
}

/* Viewport chat workspace. Rules stay inside the existing priority layer. */
@layer dpChatLayout {
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat) {
    display:flex!important;flex-direction:column!important;gap:4px!important;
    height:var(--wa-frame-height,calc(100dvh - 100px))!important;min-height:0!important;max-height:none!important;
    overflow:hidden!important;padding:8px!important;margin:0!important;scroll-margin-top:76px;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat)>.msg-heading {
    flex:0 0 auto!important;margin:0!important;padding:0 0 4px!important;min-height:28px!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat)>p {
    flex:0 0 auto!important;margin:0!important;padding:0!important;font-size:12px!important;line-height:16px!important;
    max-height:32px!important;overflow:auto!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat)>.msg-body {
    position:relative!important;display:flex!important;flex-direction:column!important;flex:1 1 0!important;
    gap:4px!important;min-height:0!important;height:auto!important;max-height:none!important;padding:0!important;overflow:hidden!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat)>.msg-body>label {
    flex:0 0 auto!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important;
    width:min(580px,calc(100% - 140px))!important;max-width:none!important;margin:0!important;font-size:14px!important;line-height:20px!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat)>.msg-body>label :is(select:not(.dp-eg-select-source),.dp-eg-select-trigger) {flex:1 1 0!important;min-width:0!important;width:0!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-workspace-options {
    position:absolute!important;right:0!important;top:0!important;z-index:8!important;max-width:min(420px,100%)!important;
    padding:8px!important;border:1px solid var(--wa-border,#cad9e6)!important;border-radius:8px!important;background:var(--ui-input,#fff)!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] :is(.msg-workspace-options,.wa-channel-settings)[open] {max-height:calc(var(--wa-frame-height) - 120px)!important;overflow:auto!important;box-shadow:0 8px 24px #152e4526!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] summary {cursor:pointer!important;font-size:12px!important;line-height:18px!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat) #msgConnection {
    display:flex!important;flex-direction:column!important;flex:1 1 0!important;gap:4px!important;min-height:0!important;height:auto!important;
    max-height:none!important;min-width:0!important;overflow:hidden!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-channel-strip {position:relative!important;flex:0 0 24px!important;display:flex!important;align-items:center!important;gap:8px!important;min-height:24px!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-channel-strip>p {margin:0!important;font-size:12px!important;line-height:18px!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-channel-strip>.msg-actions:empty {display:none!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-channel-settings {
    position:absolute!important;right:0!important;top:0!important;z-index:7!important;margin:0!important;padding:2px 8px!important;
    width:fit-content!important;max-width:100%!important;border:1px solid var(--wa-border,#cad9e6)!important;border-radius:8px!important;background:var(--ui-input,#fff)!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat {
    container-type:inline-size;container-name:waViewport;display:flex!important;flex:1 1 0!important;min-height:0!important;overflow:hidden!important;margin:0!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-grid {
    display:grid!important;grid-template-columns:minmax(240px,28%) minmax(0,1fr)!important;align-items:stretch!important;
    flex:1 1 0!important;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;gap:8px!important;overflow:hidden!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-sidebar {
    display:flex!important;flex-direction:column!important;gap:8px!important;min-height:0!important;height:100%!important;padding:8px!important;
    border:1px solid var(--wa-border)!important;border-radius:10px!important;background:var(--wa-surface)!important;overflow:hidden!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar {flex:0 0 auto!important;gap:6px!important;margin:0!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar h3 {flex:1 1 calc(100% - 110px)!important;order:0!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar>.wa-primary {order:1!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar>input {order:2!important;flex:1 1 100%!important;width:100%!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar>:is(select,.dp-eg-select-trigger) {order:3!important;flex:1 1 70px!important;width:80px!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-toolbar>button:not(.wa-primary) {order:4!important;padding:0 8px!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-list {flex:1 1 0!important;min-height:0!important;max-height:none!important;height:auto!important;padding:0!important;border:0!important;overflow:auto!important;overscroll-behavior:contain;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-new {flex:0 1 auto!important;max-height:50%!important;overflow:auto!important;padding:8px!important;margin:0!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread {
    position:relative!important;display:flex!important;min-height:0!important;max-height:100%!important;height:100%!important;gap:8px!important;padding:8px!important;overflow:hidden!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread-top {gap:6px!important;flex:0 0 auto!important;max-height:30%!important;overflow:auto!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread-top>.wa-contact {flex:1 1 180px!important;margin:0 auto 0 0!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread-top>.wa-contact :is(h3,span) {display:block!important;max-width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-assignment {flex:0 1 auto!important;max-width:100%!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-assignment :is(select:not(.dp-eg-select-source),.dp-eg-select-trigger) {width:min(210px,100%)!important;flex:1 1 120px!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat button.wa-back {display:none!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-timeline {flex:1 1 0!important;min-height:0!important;max-height:none!important;overflow:auto!important;overscroll-behavior:contain;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose {
    position:static!important;display:grid!important;grid-template-columns:minmax(120px,180px) minmax(0,1fr) auto!important;
    flex:0 0 auto!important;gap:6px!important;min-height:0!important;height:auto!important;max-height:none!important;padding:8px var(--wa-action-clearance,0px) 0 0!important;overflow:visible!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>.wa-window {grid-column:1/-1!important;grid-row:1!important;max-height:36px!important;overflow:auto!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>.wa-mode {grid-column:1!important;grid-row:2!important;width:100%!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-mode :is(select:not(.dp-eg-select-source),.dp-eg-select-trigger) {width:100%!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] :is(.wa-mode,.wa-reply)>.wa-field-title {position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>.wa-message-fields {grid-column:2!important;grid-row:2!important;width:100%!important;min-height:0!important;gap:0!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat .wa-reply textarea {height:36px!important;min-height:36px!important;max-height:36px!important;resize:none!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>button[type=submit] {grid-column:3!important;grid-row:2!important;align-self:center!important;justify-self:end!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>.wa-muted {grid-column:1/-1!important;grid-row:3!important;max-height:54px!important;overflow:auto!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>.wa-template-toggle {grid-column:2!important;grid-row:2!important;align-self:center!important;justify-self:start!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose[data-mode=template]>.wa-message-fields {
    position:absolute!important;z-index:5!important;top:var(--wa-editor-top,64px)!important;bottom:var(--wa-editor-bottom,84px)!important;right:8px!important;
    display:flex!important;flex-direction:column!important;gap:10px!important;width:min(340px,calc(100% - 16px))!important;max-height:none!important;height:auto!important;
    overflow:auto!important;overscroll-behavior:contain;padding:12px!important;border:1px solid var(--wa-border)!important;border-radius:10px!important;
    background:var(--wa-surface)!important;box-shadow:0 8px 28px #122e4533!important;
  }
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose[data-mode=template]>.wa-message-fields>* {flex:0 0 auto!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-template-panel-head {display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-preview-box {min-width:0!important;max-width:100%!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-variables {grid-template-columns:minmax(0,1fr)!important;}
  html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat [hidden][hidden][hidden] {display:none!important;}
  @container waViewport (min-width:1100px) {
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread:has(.wa-compose[data-mode=template]>.wa-message-fields:not([hidden])) .wa-timeline {margin-right:348px!important;}
  }
  @container waViewport (max-width:760px) {
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-grid {grid-template-columns:minmax(0,1fr)!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat:not(.wa-thread-open) .wa-thread {display:none!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread-open .wa-sidebar {display:none!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-chat button.wa-back {display:inline-flex!important;}
  }
  @container waViewport (max-width:520px) {
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose {grid-template-columns:minmax(0,1fr) auto!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>.wa-mode {grid-column:1!important;grid-row:2!important;max-width:160px!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>button[type=submit] {grid-column:2!important;grid-row:2!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose[data-mode=reply]>.wa-message-fields {grid-column:1/-1!important;grid-row:3!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>.wa-template-toggle {grid-column:1/-1!important;grid-row:3!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-compose>.wa-muted {grid-row:4!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .wa-thread-top>.wa-contact {flex-basis:calc(100% - 140px)!important;}
  }
  @media(max-width:600px) {
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-chat)>.msg-body>label {width:100%!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-workspace-options {position:static!important;align-self:flex-end!important;flex:0 0 auto!important;padding:0 8px!important;}
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"] .msg-workspace-options[open] {position:absolute!important;}
  }
}
@layer dpChatLayout {
  html body #agentInboxPage[data-chat-layout="104"][hidden]:has(.wa-chat) {display:none!important;}
}
@layer dpChatLayout {
  @media(max-width:900px) {
    /* Back to chats restores channel controls on narrow screens. */
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-thread-open)>.msg-heading,
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-thread-open)>.msg-body>:is(label,.msg-workspace-options),
    html body :is(#agentInboxPage,#dp-sms-tenant-page)[data-chat-layout="104"]:has(.wa-thread-open) .msg-channel-strip {display:none!important;}
  }
}
