/* Conversation task UI follows the Connector scale without changing other products. */
.crm-tasks .care-desk{grid-template-columns:260px minmax(0,1fr) 280px;min-height:620px}
.crm-tasks .thread-panel{grid-template-rows:auto minmax(200px,1fr) auto;max-height:900px}
.crm-tasks #back-to-conversations{display:none}
.crm-tasks button:disabled{opacity:.5;cursor:not-allowed}
.crm-tasks .thread-head{padding:20px;gap:12px;min-width:0}
.crm-tasks .thread-head>div{min-width:0}
.crm-tasks .thread-head h2{font-size:16px;overflow-wrap:anywhere}
.crm-tasks .thread-head .eyebrow{font:500 11px/1.5 Inter,sans-serif;letter-spacing:normal}
.crm-tasks .thread-actions{flex-wrap:wrap;justify-content:flex-end;gap:12px}
.crm-tasks .thread-scroll{padding:20px;min-width:0}
.crm-tasks .timeline-item{width:min(92%,720px);padding:16px;overflow-wrap:anywhere}
.crm-tasks .timeline-meta{gap:12px;flex-wrap:wrap;font-size:11px}
.crm-tasks .composer{padding:20px;display:grid;gap:16px;min-width:0}
.crm-tasks .composer>div{margin:0;gap:12px}
.crm-tasks .composer .composer-options{margin:0!important;gap:16px!important;grid-template-columns:repeat(2,minmax(0,1fr))}
.crm-tasks .composer label{min-width:0;display:block}
.crm-tasks .composer textarea,.crm-tasks .composer select{font:400 12px/1.55 Inter,sans-serif;width:100%;max-width:100%;box-sizing:border-box;margin:8px 0 0}
.crm-tasks .composer textarea{min-height:100px}
.crm-tasks .composer-actions{flex-wrap:wrap}
.crm-tasks .composer-help{margin:0;font-size:12px}
.crm-tasks .composer-error{margin:0;color:var(--error);overflow-wrap:anywhere}
.crm-tasks .composer-error:empty{display:none}
.crm-tasks .context-panel{padding:20px;min-width:0}
.crm-tasks .conversation-context-controls{border:0;padding:0;margin:0;min-width:0}
.crm-tasks .conversation-context-controls:disabled{opacity:.8}
.crm-tasks .context-panel section{display:grid;gap:12px;padding:20px 0}
.crm-tasks .context-panel section>*{margin:0}
.crm-tasks .context-panel input,.crm-tasks .context-panel select,.crm-tasks .context-panel textarea{max-width:100%;box-sizing:border-box;margin:8px 0 0;font-size:12px}
.crm-tasks .context-panel .toggle-line input{margin:0;width:18px;flex:0 0 18px}
.crm-tasks .service-context-grid{display:grid;gap:16px}
.crm-tasks .reply-draft{width:100%;margin:24px 0;padding:20px;box-sizing:border-box}
.crm-tasks .reply-draft textarea{font:400 12px/1.55 Inter,sans-serif}
.conversation-resolution{padding:24px;max-width:640px;max-height:calc(100dvh - 32px);overflow:auto}
.conversation-resolution h2{font:600 18px/1.4 Inter,sans-serif;letter-spacing:normal;margin:0 0 24px}
.conversation-resolution label{font-size:12px;margin:0 0 24px}
.conversation-resolution [role=alert]{color:var(--error)}
.conversation-resolution [role=alert]:empty{display:none}
.crm-tasks .service-operation-notice{font:400 12px/1.55 Inter,sans-serif;color:var(--error);overflow-wrap:anywhere}
.crm-tasks .service-operation-notice:empty{display:none}
.service-merge p{overflow-wrap:anywhere}
.service-merge button:disabled{background:var(--line);color:var(--muted);cursor:wait}
.conversation-resolution footer{gap:12px}
.conversation-resolution button{min-height:44px}
.conversation-macro{width:min(640px,calc(100vw - 32px));box-sizing:border-box;font:400 12px/1.55 Inter,sans-serif}
.conversation-macro h2{font:600 14px/1.4 Inter,sans-serif}
.conversation-macro [data-macro-changes]{display:grid;gap:24px;min-width:0}
.conversation-macro form{display:grid;gap:24px;min-width:0}
.conversation-macro form>*,.conversation-macro h2,.conversation-macro label{margin:0}
.conversation-macro .macro-preview{display:grid;gap:12px;margin:0}
.conversation-macro .macro-preview>div{display:grid;grid-template-columns:100px minmax(0,1fr);gap:16px;font:400 12px/1.55 Inter,sans-serif}
.conversation-macro dt{color:var(--muted)}
.conversation-macro dd{margin:0;overflow-wrap:anywhere}
.conversation-macro .macro-note-preview{display:grid;gap:12px;border:1px solid var(--line);padding:16px;border-radius:8px;min-width:0}
.conversation-macro .macro-note-preview h3{font:600 12px/1.55 Inter,sans-serif;margin:0}
.conversation-macro .macro-note-preview p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.conversation-macro input,.conversation-macro textarea,.conversation-macro select{width:100%;box-sizing:border-box;max-width:100%;margin-top:8px;font:400 12px/1.55 Inter,sans-serif}
.conversation-macro footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:12px}
@media(max-width:760px){.conversation-macro textarea,.conversation-macro select{font-size:16px}.conversation-macro .macro-preview>div{grid-template-columns:80px minmax(0,1fr)}}
.crm-tasks:has(.has-selection) .thread-panel{height:clamp(640px,calc(100dvh - 400px),800px);grid-template-rows:auto minmax(100px,1fr) auto}
@media(max-width:1280px){.crm-tasks .care-desk{grid-template-columns:240px minmax(0,1fr)}.crm-tasks .context-panel{display:none;position:fixed;right:0;top:0;bottom:0;width:min(360px,92vw);box-sizing:border-box;z-index:30;box-shadow:-20px 0 50px #18232133}.crm-tasks .context-panel.open{display:block}.crm-tasks .context-head button,.crm-tasks .thread-actions #toggle-context{display:block}}
@media(max-width:900px){.crm-tasks .care-desk{grid-template-columns:210px minmax(0,1fr);overflow:hidden}.crm-tasks .thread-head{flex-direction:column}.crm-tasks .thread-actions{justify-content:flex-start}.crm-tasks .timeline-item{width:100%}}
@media(max-width:760px){.crm-tasks .care-desk{display:block;overflow:visible;min-height:0}.crm-tasks .thread-panel{max-height:none;display:flex;flex-direction:column}.crm-tasks .thread-scroll{max-height:500px;min-height:160px}.crm-tasks .composer .composer-options{grid-template-columns:minmax(0,1fr)}.crm-tasks .composer-actions{display:grid;grid-template-columns:minmax(0,1fr);width:100%}.crm-tasks .conversation-list{max-height:260px}.crm-tasks .thread-head,.crm-tasks .thread-scroll,.crm-tasks .composer{padding:20px}.crm-tasks .reply-draft{padding:16px}.crm-tasks .care-desk.is-first-use .thread-panel{display:block}}
@media(max-width:760px){.crm-tasks:has(.has-selection) .inbox-controls,.crm-tasks:has(.has-selection) .case-tools,.crm-tasks .has-selection .conversation-list,.crm-tasks:has(.has-selection) #new-ticket{display:none}.crm-tasks .has-selection{margin-top:0}.crm-tasks .has-selection .thread-panel{margin:0;height:auto}.crm-tasks .has-selection #back-to-conversations{display:inline-flex;min-height:44px}.crm-tasks .has-selection .thread-scroll{max-height:360px}}
/* Keep pagination outside the rows; short screens may scroll the page, not lose controls. */
.crm-tasks .conversation-list{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-height:0;overflow:hidden}
.crm-tasks #case-list-scroll{min-height:0;min-width:0;overflow:auto;scrollbar-gutter:stable;scroll-padding-block:12px}
.crm-tasks #case-list-scroll:focus-visible,.crm-tasks .thread-scroll:focus-visible,.crm-tasks .context-panel:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
.crm-tasks .case-pagination{margin:0;background:#fff}
.crm-tasks .thread-scroll{min-height:0;scrollbar-gutter:stable;overflow-anchor:none}
.crm-tasks .reply-draft :is(.draft-review-controls,label){min-width:0}
.crm-tasks .reply-draft :is(textarea,select){min-width:0;width:100%;max-width:100%;box-sizing:border-box}
.crm-tasks .reply-draft .draft-actions{display:flex;flex-wrap:wrap;gap:12px}
.crm-tasks .reply-draft .draft-actions button{max-width:100%;white-space:normal}
@media(min-width:761px){
 .crm-tasks .care-desk:not(.is-first-use){height:clamp(520px,calc(100dvh - 400px),1000px);min-height:0;align-items:stretch}
 .crm-tasks .care-desk:not(.is-first-use) .thread-panel{height:100%;max-height:none;min-height:0;overflow:hidden;grid-template-rows:auto minmax(100px,1fr) auto}
 .crm-tasks .care-desk:not(.is-first-use) .context-panel{height:100%;min-height:0;overflow:auto;scrollbar-gutter:stable}
 .crm-tasks .composer{max-height:360px;min-height:0;overflow:auto;box-sizing:border-box}
 .crm-tasks .thread-head{max-height:180px;overflow:auto}
}
@media(max-width:760px){.crm-tasks .conversation-list{height:clamp(280px,calc(100dvh - 400px),420px);max-height:none}.crm-tasks .has-selection .conversation-list{display:none}}
/* A tablet with the global sidebar cannot fit a usable second Inbox column. */
@media(min-width:761px) and (max-width:900px){
 .crm-tasks .care-desk:not(.is-first-use){display:block;height:auto;min-height:0;overflow:visible}
 .crm-tasks .conversation-list{height:clamp(280px,calc(100dvh - 400px),420px);max-height:none}
 .crm-tasks:has(.has-selection) .inbox-controls,.crm-tasks:has(.has-selection) .case-tools,.crm-tasks:has(.has-selection) #new-ticket,.crm-tasks .has-selection .conversation-list{display:none}
 .crm-tasks .has-selection{margin-top:0}
 .crm-tasks .care-desk:not(.is-first-use) .thread-panel{height:auto;max-height:none;display:flex;flex-direction:column}
 .crm-tasks .has-selection #back-to-conversations{display:inline-flex;min-height:44px}
 .crm-tasks .thread-scroll{max-height:360px;min-height:160px}
 .crm-tasks .composer{max-height:none;overflow:visible}
 .crm-tasks .composer .composer-options{grid-template-columns:minmax(0,1fr)}
 .crm-tasks .composer-actions{display:flex;flex-wrap:wrap;gap:12px}
}
