/* 04.8.2 – compact sizing and the avatar-based profile editor */
@media(min-width:1001px){
 .workspace.focused-shell>.inbox-nav{width:160px;min-width:160px;flex:0 0 160px}
 .workspace.focused-shell.nav-collapsed>.inbox-nav{display:none}
 .workspace.focused-shell .professional-grid{grid-template-columns:236px minmax(0,1fr) 38px}
 .workspace.focused-shell .nav-scroller{padding-inline:8px}
 .workspace.focused-shell .inbox-nav-head{padding-inline:12px}
 .workspace.focused-shell .inbox-nav-item{padding:8px;gap:7px}
 .workspace.focused-shell .inbox-nav-item strong{font-size:11px}
 .workspace.focused-shell .team-inbox-item{padding:7px 5px;gap:5px;font-size:9px}
 .workspace.focused-shell .team-inbox-item>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
 .workspace.focused-shell .team-mark{height:23px;width:23px;min-width:23px;font-size:8px}
 .workspace.focused-shell .lifecycle-nav-item{padding:7px;font-size:11px}
 .workspace.focused-shell .nav-workspace-footer{font-size:8px;padding-inline:10px;gap:4px}
}
@media(min-width:721px) and (max-width:1000px){.workspace.focused-shell .professional-grid{grid-template-columns:228px minmax(0,1fr) 36px}}
.workspace.focused-shell .professional-card{padding:11px 8px;gap:7px;min-height:86px}
.workspace.focused-shell .professional-card .contact-avatar>.avatar{width:28px;height:28px;font-size:10px}
.workspace.focused-shell .professional-card .contact-avatar>.platform-icon.tiny{width:10px;height:10px;min-width:10px;max-width:10px;border:1px solid var(--ui-surface);padding:0;bottom:-1px;right:-1px}
.workspace.focused-shell .professional-card .contact-avatar>.platform-icon.tiny .platform-svg{width:6px;height:6px}
.workspace.focused-shell .composer-channel-select{max-width:140px;gap:4px;padding:0 2px}
.workspace.focused-shell .composer-channel-select .platform-icon.tiny{width:11px;height:11px;min-width:11px;max-width:11px;padding:0}
.workspace.focused-shell .composer-channel-select .platform-icon.tiny .platform-svg{width:7px;height:7px}
.workspace.focused-shell .composer-channel-select select{font-size:10px;max-width:123px;min-height:24px;padding:2px 15px 2px 2px}
.workspace.focused-shell .thread-person .contact-avatar>.platform-icon.tiny,.workspace.focused-shell .message-avatar>.platform-icon.tiny{height:10px;width:10px;min-width:10px;padding:0}
.workspace.focused-shell .thread-person .platform-icon.tiny .platform-svg,.workspace.focused-shell .message-avatar>.platform-icon.tiny .platform-svg{height:6px;width:6px}
.workspace.focused-shell .professional-controls{padding-inline:11px;gap:4px}
.workspace.focused-shell .professional-controls select{font-size:11px;padding-right:15px;min-width:0;max-width:130px}
.workspace.focused-shell .unread-toggle{font-size:10px;gap:4px}
.workspace.focused-shell .list-channel-filter{padding-inline:12px;gap:4px}
.workspace.focused-shell .activity-connection{font-size:8px;white-space:nowrap}
.workspace.focused-shell .card-title{gap:4px}.workspace.focused-shell .card-title strong{font-size:11px}
.workspace.focused-shell .card-title time{font-size:8px}.workspace.focused-shell .card-preview{font-size:10px}
.workspace.focused-shell .conversation-list{padding-inline:8px}
.workspace.focused-shell .card-side{right:8px;gap:5px}
.profile-global-panel{width:388px;max-width:100vw}.profile-global-panel .global-panel-body{padding:18px 22px}
.profile-sheet{color:var(--ui-ink)}.profile-photo-area{position:relative;width:120px;height:120px;margin:18px auto 0}
.profile-avatar-trigger{display:block;position:relative;width:120px;height:120px;padding:0!important;border:0!important;border-radius:50%;background:var(--ui-accent-soft)!important;box-shadow:0 0 0 1px var(--ui-line);color:var(--ui-accent)!important}
.profile-avatar-trigger>img{display:block;width:120px;height:120px;object-fit:cover;border-radius:50%}
.profile-initials{font-weight:600;font-size:35px;display:grid;place-items:center;height:100%;letter-spacing:-1px}
.profile-camera-badge{display:grid;place-items:center;position:absolute;right:1px;bottom:0;width:35px;height:35px;background:var(--ui-accent);color:var(--ui-on-accent);border:3px solid var(--ui-surface);border-radius:50%}
.profile-camera-badge .ui-icon{width:17px;height:17px}
.profile-avatar-trigger:hover{box-shadow:0 0 0 3px var(--ui-accent-soft)}
.profile-photo-menu{position:absolute;z-index:15;top:102px;left:50%;transform:translateX(-50%);min-width:176px;padding:5px;background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:12px;box-shadow:var(--ui-shadow)}
.profile-photo-menu>button{display:flex;align-items:center;gap:12px;width:100%;white-space:nowrap;background:transparent;border:0;border-radius:7px;font-size:12px;padding:11px 12px;text-align:left;color:var(--ui-ink)}
.profile-photo-menu .ui-icon{height:17px;width:17px;flex:none}.profile-photo-menu>button:hover{background:var(--ui-hover)}.photo-menu-divider{height:1px;background:var(--ui-line);margin:4px 5px}.profile-photo-menu>button.photo-remove{color:var(--ui-danger)}
.profile-sheet-identity{text-align:center;margin:17px 0 22px}.profile-sheet-identity h3{font-size:17px;letter-spacing:0;margin:0 0 5px;font-weight:600}.profile-sheet-identity>span{font-size:11px;color:var(--ui-muted)}
.profile-sheet-fields{margin-top:25px;border-top:1px solid var(--ui-line)}.profile-sheet-fields>div{display:flex;align-items:center;gap:14px;padding:17px 5px;border-bottom:1px solid var(--ui-line)}
.profile-sheet-fields .ui-icon{width:19px;height:19px;color:var(--ui-muted);flex:none}.profile-sheet-fields small{display:block;font-size:10px;color:var(--ui-muted);margin-bottom:5px}.profile-sheet-fields strong{display:block;font-size:12px;font-weight:500;overflow-wrap:anywhere}
.profile-sheet-foot{font-size:10px;color:var(--ui-muted);text-align:center;margin-top:25px}
.photo-stage-heading{display:flex;align-items:center;gap:8px;margin:0 0 22px}.photo-stage-heading h3{font-size:15px;font-weight:600;margin:0}.photo-stage{border-radius:14px;overflow:hidden;background:var(--ui-soft);aspect-ratio:1;display:grid;place-items:center;position:relative;border:1px solid var(--ui-line)}
.photo-stage>img,.photo-stage>video{display:block;width:100%;height:100%;object-fit:cover}.photo-placeholder{font-size:54px;color:var(--ui-muted)}
.camera-stage>video{transform:scaleX(-1)}.camera-wait{position:absolute;padding:15px;font-size:12px;text-align:center;color:var(--ui-muted)}
.photo-stage-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin-top:19px}.photo-stage-actions>button{font-size:12px;border:1px solid var(--ui-line);padding:9px 15px;border-radius:8px;display:flex;align-items:center;gap:7px}.photo-stage-actions .ui-icon{height:16px;width:16px}
.photo-stage-actions>button.photo-primary{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-on-accent)}.photo-stage-actions>button.photo-danger{color:var(--ui-danger);border-color:var(--ui-danger)}
.photo-stage-help{font-size:11px;color:var(--ui-muted);line-height:1.6;margin:15px 0}.photo-feedback{border:1px solid var(--ui-danger);background:var(--ui-danger-bg);color:var(--ui-danger);padding:10px 12px;border-radius:8px;font-size:11px;line-height:1.55;margin:15px 0}
@media(max-width:720px){.profile-global-panel{width:100vw}.workspace.focused-shell .professional-card{padding:13px 10px}.workspace.focused-shell .card-title strong{font-size:13px}.workspace.focused-shell .card-title time{font-size:9px}.workspace.focused-shell .card-preview{font-size:12px}.workspace.focused-shell .professional-card .contact-avatar>.avatar{width:32px;height:32px}.workspace.focused-shell .professional-controls select{font-size:12px;max-width:165px}}

/* 04.13.0 — reserve real grid space for unread counts and agent photos.
   The wrappers stay in the DOM; display:contents places their children in the
   same three-row grid. No absolutely-positioned badge can cover preview text.
   All grid overrides are scoped to customer list cards, not sidebar totals. */
.workspace.focused-shell .professional-card {
 display:grid;
 grid-template-columns:auto minmax(0,1fr) max-content;
 grid-template-rows:auto auto auto;
 grid-template-areas:"avatar title time" "avatar preview unread" "avatar tags agent";
 column-gap:7px;
 row-gap:4px;
 align-items:center;
 align-content:start;
}
.workspace.focused-shell .professional-card>.contact-avatar {
 grid-area:avatar;
 align-self:start;
}
.workspace.focused-shell .professional-card>.card-main,
.workspace.focused-shell .professional-card>.card-side {
 display:contents;
 position:static;
}
.workspace.focused-shell .professional-card .card-title {
 grid-area:title;
 min-width:0;
 margin:0;
 padding:0;
}
.workspace.focused-shell .professional-card .card-time {
 grid-area:time;
 justify-self:end;
 white-space:nowrap;
 color:var(--ui-muted);
 font-size:8px;
 line-height:1.4;
}
.workspace.focused-shell .professional-card .card-preview {
 grid-area:preview;
 min-width:0;
 margin:0;
 padding:0;
 overflow:hidden;
}
.workspace.focused-shell .professional-card .card-preview>span {
 flex:1 1 auto;
 min-width:0;
 white-space:nowrap;
 overflow:hidden;
 text-overflow:ellipsis;
}
.workspace.focused-shell .professional-card .card-preview>.ui-icon {
 flex:0 0 13px;
}
.workspace.focused-shell .professional-card .card-tags {
 grid-area:tags;
 min-width:0;
 margin:0;
 padding:0;
}
.workspace.focused-shell .professional-card .card-side>.client-unread {
 grid-area:unread;
 justify-self:end;
 align-self:center;
 position:static;
 margin:0;
 flex:none;
 white-space:nowrap;
}
.workspace.focused-shell .professional-card .card-side>.staff-avatar {
 grid-area:agent;
 justify-self:end;
 align-self:start;
 margin:0;
}
@media(max-width:720px) {
 .workspace.focused-shell .professional-card .card-time {font-size:9px;}
}

/* 04.13.0: discreet rail/bell badges, preserving legibility and the full button hit area. */
.professional-shell .app-rail .count-badge.rail-count{height:13px;min-width:13px;padding:0 3px;border:1px solid var(--ui-rail);border-radius:8px;font-size:8px;line-height:1;font-weight:600;top:1px;right:1px;box-sizing:border-box}
.professional-shell .notification-bell .count-badge.rail-count{top:2px;right:0}
.ig-shared-card{min-width:220px;max-width:100%;border-radius:10px;overflow:hidden;background:var(--ui-soft);color:var(--ui-ink)}
.ig-shared-heading{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:600;margin-bottom:8px}.ig-shared-heading .ui-icon{width:15px;height:15px}
.ig-shared-card p{font-size:12px;margin:7px 0;line-height:1.5}.ig-shared-card small{display:block;font-size:10px;color:var(--ui-muted);line-height:1.5}
.ig-shared-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:8px}.ig-shared-controls button,.ig-shared-controls a{font-size:11px;color:var(--ui-accent);border:0;background:none;padding:4px 0;text-decoration:none;cursor:pointer}
.ig-shared-controls button:disabled{opacity:.5;cursor:wait}.ig-shared-frame{display:block;border:0;border-radius:9px;width:340px;max-width:100%;height:540px;background:#fff}
.ig-shared-poster{display:block;max-width:100%;max-height:320px;object-fit:contain;border-radius:8px}.message.has-media:has(.ig-shared-card){max-width:min(420px,90%)}
@media(max-width:720px){.ig-shared-frame{width:300px;height:500px}.message.has-media:has(.ig-shared-card){max-width:94%}.ig-shared-card{min-width:0}}


/* 04.24.3 channel-capability actions */
.action-dialog:has(#call-device-form){width:min(460px,calc(100vw - 48px))}
.action-dialog #call-device-form{display:grid;gap:14px}
.action-dialog #call-device-form header{display:grid;gap:5px;margin:0}
.action-dialog #call-device-form header strong{display:none}
.action-dialog #call-device-form header span{color:var(--ui-muted);font-size:11px;line-height:1.55}
.call-number{display:grid;gap:5px;padding:13px 14px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-soft)}
.call-number span{font-size:10px;color:var(--ui-muted)}
.call-number strong{font-size:15px;color:var(--ui-ink);overflow-wrap:anywhere}
.call-link{display:flex;align-items:center;justify-content:center;gap:8px;min-height:40px;text-decoration:none;border-radius:9px;padding:9px 14px;background:var(--ui-accent);color:var(--ui-on-accent)!important;font-weight:700}
.call-link:hover,.call-link:focus-visible{background:var(--ui-accent-hover);color:var(--ui-on-accent)!important}
.messenger-reply-composer .compact-alert{margin:4px 0 7px}
@media(max-width:720px){.action-dialog:has(#call-device-form){width:min(460px,calc(100vw - 24px))}}

/* 04.24.3 — Inbox conversation context & SLA UX */
@media(min-width:1001px){.workspace.focused-shell .professional-grid{grid-template-columns:286px minmax(0,1fr) 38px}}
@media(min-width:721px) and (max-width:1000px){.workspace.focused-shell .professional-grid{grid-template-columns:270px minmax(0,1fr) 36px}}
.workspace.focused-shell .professional-card{
 grid-template-columns:auto minmax(0,1fr) max-content;
 grid-template-rows:auto auto auto;
 grid-template-areas:"avatar title time" "avatar preview preview" "avatar tags tail";
}
.workspace.focused-shell .professional-card .card-preview{padding-right:2px}
.workspace.focused-shell .professional-card .card-tags{padding-right:0;gap:4px;flex-wrap:wrap}
.workspace.focused-shell .professional-card .card-tail{grid-area:tail;display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;align-self:center;min-height:24px}
.workspace.focused-shell .professional-card .card-tail .client-unread{position:static;margin:0;min-width:18px;height:18px;padding:0 5px;font-size:8px}
.workspace.focused-shell .professional-card .card-tail .staff-avatar{position:static;margin:0;flex:none}
.reply-window-chip{display:inline-flex;align-items:center;gap:3px;border-radius:999px;padding:2px 6px;font-size:8px;font-weight:650;line-height:1.25;white-space:nowrap;border:1px solid transparent;max-width:98px}
.reply-window-chip .ui-icon{width:9px;height:9px;flex:none}
.reply-window-chip.active{background:#e6f7ef;color:#18794e;border-color:#bfe6d2}
.reply-window-chip.closed{background:#fff4d8;color:#8a5a00;border-color:#ecd8a4}
.thread-person-copy{display:flex;flex-direction:column;min-width:0;gap:3px;align-items:flex-start}
.thread-person-copy .thread-name-line{max-width:100%}
.thread-brief{display:block;max-width:min(610px,52vw);font-size:9px;line-height:1.35;color:var(--ui-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.composer-window-chip{display:inline-flex;align-items:center;gap:6px;flex:none;border:1px solid transparent;border-radius:999px;padding:4px 9px;font-size:9px;font-weight:650;line-height:1.2;white-space:nowrap}
.composer-window-chip>i{width:7px;height:7px;border-radius:50%;background:currentColor;flex:none}
.composer-window-chip.active{background:#e9fbf3;border-color:#b8ead2;color:#098754}
.composer-window-chip.closed{background:#fff5d8;border-color:#ecd398;color:#8a5b00}
.timeline-internal-note{width:min(72%,760px);margin:12px auto;padding:10px 12px;border:1px solid #e7c75c;border-radius:10px;background:#fff7c9;color:#5b4913;box-shadow:0 1px 4px rgba(85,68,18,.08)}
.timeline-internal-note header,.timeline-internal-note footer{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:8px;color:#8a6e19}
.timeline-note-title{display:inline-flex;align-items:center;gap:6px;min-width:0}.timeline-note-title .ui-icon{width:13px;height:13px;flex:none}
.timeline-note-title strong{font-size:9px;color:#725812}.timeline-note-title em{font-style:normal;font-weight:700}
.timeline-note-body{font-size:11px;line-height:1.55;margin:8px 0;color:#4f431c;white-space:pre-wrap;overflow-wrap:anywhere}
.timeline-internal-note footer .text-button{font-size:8px;color:#795d0d;padding:2px 0}
[data-theme="dark"] .reply-window-chip.active{background:#163c2e;color:#8ae1b5;border-color:#285844}
[data-theme="dark"] .reply-window-chip.closed{background:#493a16;color:#f2d584;border-color:#695727}
[data-theme="dark"] .composer-window-chip.active{background:#123b2c;border-color:#286347;color:#8ee8b8}
[data-theme="dark"] .composer-window-chip.closed{background:#443716;border-color:#6a5725;color:#f3d987}
[data-theme="dark"] .timeline-internal-note{background:#3b3217;border-color:#7b6728;color:#f4e4a0;box-shadow:none}
[data-theme="dark"] .timeline-internal-note header,[data-theme="dark"] .timeline-internal-note footer{color:#ddc56e}
[data-theme="dark"] .timeline-note-title strong,[data-theme="dark"] .timeline-note-body,[data-theme="dark"] .timeline-internal-note footer .text-button{color:#f4e4a0}
@media(max-width:720px){.thread-brief{max-width:72vw}.composer-window-chip{padding:3px 7px;font-size:8px;max-width:145px;overflow:hidden;text-overflow:ellipsis}.composer-window-chip span{overflow:hidden;text-overflow:ellipsis}.timeline-internal-note{width:92%}}
