/* Phase 12: nested scrolling and modular dealership workspaces */
html:has(.workspace.crm-chat-open),body:has(.workspace.crm-chat-open){height:100%;overflow:hidden!important;}
.workspace.crm-chat-open{height:100vh!important;height:100dvh!important;min-height:0!important;max-height:100dvh!important;display:flex!important;overflow:hidden!important;}
.workspace.crm-chat-open>.conversation{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;}
.workspace.crm-chat-open>.conversation>.conversation-head{flex:0 0 auto!important;}
.workspace.crm-chat-open>.conversation>.conversation-body{position:relative!important;flex:1 1 0!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior-y:contain;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;}
.workspace.crm-chat-open>.conversation>.crm-v8-compose-row{position:relative!important;flex:0 0 auto!important;bottom:auto!important;z-index:12!important;min-height:72px;box-shadow:0 -5px 18px rgba(34,62,97,.07);background:#f8fbff;}
.workspace.crm-chat-open .crm-v8-popover{position:absolute;bottom:calc(100% + 12px);}
.crm12-dealership,.crm12-dealer-detail{display:block!important;min-width:0!important;overflow-y:auto;padding:34px clamp(16px,4vw,50px) 70px;background:#f5f8fd;}
.crm12-module-head,.crm12-detail-head{display:flex;gap:18px;align-items:center;justify-content:space-between;margin:0 0 25px;flex-wrap:wrap}
.crm12-module-head h1,.crm12-detail-head h1{font-size:clamp(27px,3vw,42px);line-height:1.16;letter-spacing:-.05em;margin:6px 0}
.crm12-module-head p,.crm12-detail-head p{color:#778ba6;font-size:13px}.crm12-eyebrow{font-size:10px;letter-spacing:.2em;font-weight:800;color:#8399b7}
.crm12-primary,.crm12-secondary{border:0;border-radius:13px;padding:12px 18px;min-height:43px;font-size:13px;font-weight:800;cursor:pointer}.crm12-primary{background:#236eea;color:#fff}.crm12-secondary{background:#e9f1ff;color:#205bba}
.crm12-search{max-width:780px;background:white;border:1px solid #e3eaf5;padding:18px;border-radius:20px;margin-bottom:16px}.crm12-search label{display:block;font-size:12px;color:#7487a1;font-weight:700;margin-bottom:9px}.crm12-search>div{display:flex;gap:10px}.crm12-search input{flex:1;min-width:0;padding:12px 15px;background:#f5f8fc;border-radius:12px;border:1px solid #e5edf5;font-size:15px}.crm12-search button{background:#216deb;color:white;border:0;padding:0 18px;border-radius:11px;cursor:pointer}
.crm12-dealer-count{font-size:12px;font-weight:700;color:#70839a;margin:0 0 14px}.crm12-dealer-grid{display:grid;gap:10px;max-width:1050px}.crm12-dealer-card{display:flex;align-items:center;gap:15px;min-width:0;padding:16px;border:1px solid #e1e9f3;background:white;border-radius:16px;text-decoration:none;color:#192b44;transition:transform .15s}.crm12-dealer-card:hover{transform:translateY(-1px);border-color:#b8cffa}.crm12-dealer-avatar{flex:0 0 46px;width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:#e8f0ff;color:#246cdf}.crm12-dealer-card-body{display:grid;gap:5px;min-width:0;flex:1}.crm12-dealer-card-body strong{font-size:15px}.crm12-dealer-card-body small{font-size:11px;color:#879bb3;overflow-wrap:anywhere}.crm12-open{font-size:25px;color:#8fa4bf}.crm12-empty{padding:38px;text-align:center;color:#7d90aa;background:white;border-radius:16px}.crm12-pages{display:flex;gap:18px;margin-top:20px}.crm12-pages a{color:#1968e2}
.crm12-create-dialog{border:1px solid #e0e8f2;border-radius:22px;box-shadow:0 22px 65px #1b31543b;width:min(95vw,520px);max-height:90dvh;overflow-y:auto;padding:25px;color:#16273d}.crm12-create-dialog::backdrop{background:#16273d6a}.crm12-dialog-top{display:flex;align-items:center;justify-content:space-between}.crm12-dialog-top h2{margin:0 0 20px}.crm12-dialog-top button{font-size:24px;border:0;background:#f1f5fb;border-radius:50%;width:38px;height:38px;cursor:pointer}.crm12-dealer-form{display:grid;gap:14px}.crm12-dealer-form label{display:grid;gap:6px;color:#4d6683;font-size:12px;font-weight:700}.crm12-dealer-form input,.crm12-dealer-form textarea,.crm12-info-card input,.crm12-info-card textarea{width:100%;max-width:100%;padding:11px 13px;border-radius:11px;border:1px solid #dfe7f2;background:#f9fbff;font-size:15px;color:#1e334e}.crm12-form-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.crm12-detail-layout{display:grid;grid-template-columns:minmax(0,1fr) 315px;gap:18px;align-items:start}.crm12-dealer-chat{height:calc(100dvh - 185px);min-height:420px;border-radius:19px;background:#f8fbff;border:1px solid #e1e9f5;display:flex;flex-direction:column;overflow:hidden;position:relative}.crm12-dealer-events{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:24px;display:flex;flex-direction:column;gap:14px}.crm12-history-item{padding:15px 17px;background:white;box-shadow:0 4px 13px #2639570a;border-radius:17px;max-width:min(85%,480px);align-self:flex-start}.crm12-kind-note,.crm12-kind-order{align-self:flex-end;background:#e4f7ed}.crm12-history-item header{display:flex;gap:10px;justify-content:space-between;color:#1d67d3;font-size:12px}.crm12-history-item header span{color:#758ca5}.crm12-history-item p{white-space:normal;overflow-wrap:anywhere;margin:9px 0;font-size:13px}.crm12-history-item time{display:block;text-align:right;color:#9badc2;font-size:10px}.crm12-dealer-composer{flex:0 0 auto;display:flex;gap:10px;padding:14px;background:white;border-top:1px solid #e7edf6}.crm12-dealer-composer input{flex:1;min-width:0;border-radius:25px;background:#f3f6fa;border:1px solid #e4eaf3;padding:12px 16px;font-size:15px}.crm12-dealer-composer button{border:0;background:#236eea;color:white;border-radius:50%;height:42px;width:42px;font-size:20px}.crm12-dealer-side{display:grid;gap:13px}.crm12-info-card{padding:19px;background:white;border:1px solid #e2eaf5;border-radius:17px}.crm12-info-card h2{font-size:16px;margin:0 0 12px}.crm12-info-card p{font-size:13px;color:#637994;line-height:1.65;overflow-wrap:anywhere}.crm12-info-card .crm12-dealer-form{gap:11px}.crm12-info-card textarea{resize:vertical}.crm12-back{text-decoration:none;color:#236eea;font-size:13px;font-weight:700}.crm12-flash{padding:12px 15px;background:#edf7ff;color:#265e8b;border-radius:12px;margin-bottom:18px}.crm12-delete-card{border-color:#f3dcdc}.crm12-danger-btn{background:#fff0f0;color:#a32525;border:1px solid #e7b5b5;border-radius:10px;padding:11px 15px;cursor:pointer;font-size:12px;font-weight:800}.crm12-danger-inline{margin-top:18px;padding:14px;background:#fff7f7;border:1px solid #f3dcdc;border-radius:12px}.crm12-danger-inline label{display:block;font-size:12px;margin-bottom:9px}.crm12-danger-inline input{padding:9px;border:1px solid #e7b5b5;border-radius:8px;margin-bottom:9px}.crm12-danger-inline p{font-size:12px;color:#7b6270}.crm12-create-dialog label input:focus-visible,.crm12-create-dialog textarea:focus-visible{outline:2px solid #95b9fe}
@media(max-width:1000px){.crm12-detail-layout{grid-template-columns:1fr}.crm12-dealer-chat{height:62dvh;min-height:370px}.crm12-dealer-side{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){.workspace.crm-chat-open{height:100dvh!important;padding-top:calc(54px + env(safe-area-inset-top,0px))!important;}.workspace.crm-chat-open>.conversation{height:100%!important}.workspace.crm-chat-open>.conversation>.crm-v8-compose-row{padding-bottom:calc(9px + env(safe-area-inset-bottom,0px))!important}.crm12-dealership,.crm12-dealer-detail{padding:20px 14px 55px!important}.crm12-module-head{align-items:flex-start}.crm12-dealer-chat{height:59dvh;min-height:360px}.crm12-dealer-side{grid-template-columns:1fr}.crm12-history-item{max-width:94%}.crm12-dealer-events{padding:12px}.crm12-form-two{grid-template-columns:1fr}}
