/* Operator workspace: quiet queue, readable conversation, one anchored editor. */
body.inbox-mode{--bg:#f3f4f7;--soft:#f3f4f7;--line:#e4e6eb;--line-strong:#ccd1d9;--ink:#252a34;--muted:#727b89;--reply-bg:#e9e6fb}
[data-theme=dark] body.inbox-mode{--bg:#151b21;--soft:#242c35;--line:#343e49;--line-strong:#536172;--ink:#edf1f5;--muted:#acb7c5;--reply-bg:#35314d}
body.inbox-mode .desk-workspace{position:relative;grid-template-columns:min(var(--queue-width),28vw) 8px minmax(0,1fr)!important;border:0;background:transparent;overflow:visible}
body.inbox-mode .desk-workspace>.proposal-pane,body.inbox-mode .desk-workspace>[data-resize=answer]{display:none}
body.inbox-mode .desk-workspace.details-open>.proposal-pane{display:flex;position:absolute;right:0;top:0;bottom:0;width:min(420px,80vw);z-index:12;border:1px solid var(--line);border-radius:12px;box-shadow:-8px 0 30px #0002;background:var(--panel);overflow:hidden}
body.inbox-mode .desk-workspace .column-resizer{background:transparent}
body.inbox-mode .desk-workspace .column-resizer:after{height:30px;opacity:0;left:3px}
body.inbox-mode .desk-workspace .column-resizer:hover:after{opacity:1}
body.inbox-mode .desk-workspace .queue,body.inbox-mode .desk-workspace .chat-main{border:1px solid var(--line);border-radius:12px;background:var(--panel);overflow:hidden;min-height:0}
body.inbox-mode .desk-workspace .chat-main{position:relative;min-width:0;display:flex;flex-direction:column;max-height:none}
body.inbox-mode .topbar{border-bottom:0}.compact-work-head #inbox-sync{opacity:.7}
/* The queue belongs to the chats, not to the filters. */
.desk-workspace .queue-heading{display:flex;align-items:center;gap:8px;padding:12px 12px 4px;flex:none}
.desk-workspace #queue-owner{flex:1;min-width:0;border:0;background:transparent;font-size:var(--ui-font,15px);font-weight:650;padding:7px 2px;color:var(--ink)}
.desk-workspace .queue-heading .icon-button{border:0;color:var(--muted)}
.desk-workspace .queue-tools{border:0;padding:6px 12px!important}
.desk-workspace .queue-tools input{font-size:14px!important;border-color:transparent;background:var(--soft);border-radius:8px;padding:9px 10px 9px 34px!important}
.desk-workspace .queue-tabs{display:none!important}
.desk-workspace .queue-fold:not([open]){display:none}
.desk-workspace .queue-fold[open]{padding:8px 12px;background:var(--soft);border:0}
.desk-workspace .queue-sort{border-bottom:1px solid var(--line);padding:2px 14px 7px!important}
.desk-workspace #desk-queue-mode{font-size:14px;border:0;background:transparent;padding:7px 0;color:var(--muted);min-width:0;width:calc(100% - 32px)}
.desk-workspace #queue-list{background:var(--panel)}
.desk-workspace .chat-item{display:flex;align-items:flex-start;gap:11px;padding:15px 14px!important;min-width:0;border:0;border-bottom:1px solid var(--line);border-left:3px solid transparent;background:var(--panel);text-align:left}
.desk-workspace .chat-item:hover{background:var(--soft)}
.desk-workspace .chat-item.active{background:color-mix(in srgb,var(--accent) 8%,var(--panel));border-left-color:var(--accent)}
.person-avatar{display:inline-flex;align-items:center;justify-content:center;flex:none;width:36px;height:36px;border-radius:50%;background:hsl(var(--person-hue) 32% 90%);color:hsl(var(--person-hue) 35% 31%);font-size:13px;font-weight:650;letter-spacing:.01em}
[data-theme=dark] .person-avatar{background:hsl(var(--person-hue) 20% 28%);color:hsl(var(--person-hue) 40% 84%)}
.person-avatar.employee{background:var(--reply-bg);color:var(--ink)}
.queue-item-body{display:block;min-width:0;flex:1}.queue-item-top{display:flex;gap:8px;align-items:baseline}
.desk-workspace .queue-item-top .name{font-size:var(--ui-font,15px);font-weight:650;min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.desk-workspace .queue-item-top time{font-size:12px;color:var(--muted);flex:none;white-space:nowrap}
.desk-workspace .chat-item .snippet{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:14px;line-height:1.5;margin:5px 0 8px;color:var(--secondary)}
.queue-item-meta{display:flex;gap:5px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.desk-workspace .queue-item-meta .assignee-label{font-size:12px;margin:0;max-width:100%;color:var(--muted)}
.queue-item-meta .assignee-label .icon{width:13px;height:13px}
.queue-reply-state{font-size:12px;color:var(--muted);white-space:nowrap}.queue-reply-state.is-waiting{color:var(--accent);font-weight:550}
.queue-reply-state.is-waiting:before{content:'';display:inline-block;width:5px;height:5px;background:currentColor;border-radius:50%;margin-right:5px;vertical-align:2px}
.desk-workspace .queue-pages{padding:7px 10px;border-top:1px solid var(--line);font-size:13px;background:var(--panel)}
.desk-workspace .queue-pages button{border:0;background:transparent;min-height:28px;padding:4px 8px}
.desk-workspace .queue-health{background:var(--panel);padding:6px 12px}.desk-workspace .queue-health summary{font-size:12px}
/* Compact header. Assignment and actions stay in view. */
body.inbox-mode .desk-workspace .chat-header{display:flex;flex-wrap:nowrap;flex:none;gap:10px;min-height:72px;padding:12px 18px;border-bottom:1px solid var(--line)}
.thread-person{display:flex;align-items:center;gap:10px;min-width:0;flex:1}.thread-person>div{min-width:0}
body.inbox-mode .desk-workspace .chat-header h3{font-size:16px;line-height:1.4;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread-person-meta{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:3px;font-size:12px;color:var(--muted)}
.desk-workspace .thread-person-meta .assignee-label{font-size:13px;margin:0;color:var(--muted)}
.thread-person-meta a{font-size:12px;color:var(--muted)}
.thread-actions,.transfer-split{display:flex;gap:5px;align-items:center;flex-wrap:nowrap}
.thread-actions button,.thread-details{background:transparent;border-color:transparent;padding:7px 9px;min-height:34px;white-space:nowrap;font-size:14px;color:var(--secondary)}
.thread-actions button:hover,.thread-details:hover{background:var(--soft);border-color:var(--line)}
.transfer-split{gap:0}.transfer-split button:first-child{padding-right:3px}.transfer-split button:last-child{padding-left:5px}
.thread-details{border-left:1px solid var(--line);border-radius:0;padding-right:0}.thread-details .icon{width:17px;height:17px}.thread-actions .icon{width:16px;height:16px}
/* Message layout: time and author aren't part of the customer's text. */
body.inbox-mode .desk-workspace .chat-messages{display:flex;flex-direction:column;align-items:stretch;gap:0;flex:1;min-height:100px;overflow:auto;padding:20px 24px;overscroll-behavior:contain;background:var(--panel)}
.thread-date{display:flex;align-items:center;gap:16px;justify-content:center;flex:none;margin:12px 0 28px;color:var(--muted);font-size:12px}
.thread-date:before,.thread-date:after{content:'';height:1px;background:var(--line);flex:1;max-width:120px}
body.inbox-mode .desk-workspace .message{display:flex;align-items:flex-end;gap:9px;max-width:min(78%,760px);width:fit-content;flex:none;margin:0 0 18px}
body.inbox-mode .desk-workspace .message.customer{align-self:flex-start}
body.inbox-mode .desk-workspace .message.employee{align-self:flex-end;flex-direction:row-reverse}
.message-body{min-width:0;flex:1}.message .person-avatar{width:30px;height:30px;font-size:11px;margin-bottom:23px}
body.inbox-mode .desk-workspace .message-head{font-size:12px;margin:0 3px 5px;color:var(--muted);line-height:1.3}
body.inbox-mode .desk-workspace .message-head strong{font-weight:500;overflow:hidden;text-overflow:ellipsis}
body.inbox-mode .desk-workspace .message .bubble{border:0;border-radius:15px;padding:12px 16px;font-size:var(--chat-font,15px);line-height:1.6;overflow-wrap:anywhere;white-space:pre-wrap}
body.inbox-mode .desk-workspace .message.customer .bubble{background:var(--soft);border-bottom-left-radius:5px}
body.inbox-mode .desk-workspace .message.employee .bubble{background:var(--reply-bg);border-bottom-right-radius:5px;color:var(--ink)}
body.inbox-mode .desk-workspace .message.employee .message-head{color:var(--muted)}
.message-time{display:block;font-size:11px;color:var(--muted);margin:4px 3px 0;line-height:1.4}.message.employee .message-time{text-align:right}
body.inbox-mode .desk-workspace .message.followup{margin-top:-10px}.message.followup .message-head{display:none}.message.followup .person-avatar{visibility:hidden}
body.inbox-mode .desk-workspace .message.note{max-width:85%;align-self:center}.message.note .bubble{background:var(--amber-soft)!important}
.thread-empty{margin:auto;color:var(--muted);font-size:14px}
body.inbox-mode .desk-workspace .attachment-card{border:0;background:var(--soft);border-radius:10px;max-width:240px;overflow:hidden}
body.inbox-mode .desk-workspace .attachment-open img{max-height:180px;object-fit:contain;background:var(--panel)}
body.inbox-mode .desk-workspace .attachment-status{font-size:11px;padding:6px 10px}
.thread-latest{position:absolute;right:24px;bottom:225px;z-index:2;min-width:36px;height:36px;padding:0;border-radius:50%;box-shadow:0 2px 8px #0001;background:var(--panel);font-size:21px;color:var(--accent)}.thread-latest[hidden]{display:none}
/* One calm editor. Extra tools are disclosed only when needed. */
.reply-composer{flex:none;border-top:1px solid var(--line);background:var(--panel);padding:0 18px 12px;max-height:55%;overflow:auto}
.composer-context{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 1px;color:var(--accent);font-size:13px;border-bottom:1px solid var(--line)}
.composer-context>span{display:flex;gap:7px;align-items:center}.composer-context .icon{width:15px;height:15px}.composer-context button{font-size:12px;color:var(--muted);border:0;background:transparent;padding:3px 0}
.reply-composer #desk-reply{display:block;width:100%;height:90px;min-height:66px;max-height:24dvh;resize:vertical;margin:0 0 9px;padding:14px 2px 8px;font-size:var(--chat-font,15px);line-height:1.6;border:0;border-radius:0;background:transparent;box-shadow:none;outline:none;color:var(--ink)}
.reply-composer:focus-within{box-shadow:inset 0 2px 0 color-mix(in srgb,var(--accent) 35%,transparent)}
.composer-tools,.composer-bottom,.composer-send,.composer-extra-tools,.quick-replies{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.composer-bottom{justify-content:space-between;gap:8px}.composer-tools button,.composer-extra-tools button{font-size:13px;padding:6px 8px;min-height:32px;border:0;background:var(--soft);color:var(--accent);border-radius:6px}
.composer-tools .icon{width:16px;height:16px}.composer-send button{font-size:14px;padding:9px 12px;min-height:36px;border-radius:7px}
.composer-send [data-send-kind=close]{border:0;background:transparent;color:var(--muted)}
.composer-extras{border-top:1px solid var(--line);margin-top:10px;padding-top:8px}.composer-extras[hidden]{display:none}
.quick-replies{margin-bottom:8px}.quick-replies button{background:var(--soft);color:var(--secondary);border:0;font-size:13px;min-height:29px;padding:4px 9px}
.composer-ai-state,.composer-status{font-size:13px;line-height:1.5;color:var(--muted)}.composer-status{margin-top:7px}.composer-status:empty{display:none}.composer-status.error-text{color:var(--red)}
.composer-suggestion{border:1px solid color-mix(in srgb,var(--accent) 25%,var(--line));border-radius:9px;background:var(--accent-soft);padding:9px 12px;margin-top:10px;font-size:13px}
.composer-suggestion[hidden]{display:none}.composer-suggestion p{white-space:pre-wrap;max-height:100px;overflow:auto;margin-top:8px}.composer-suggestion summary{cursor:pointer;font-size:13px;margin-top:5px}.composer-suggestion button{font-size:13px;padding:4px 7px}
.reply-composer .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.desk-workspace .proposal-title{display:flex;justify-content:space-between;align-items:center}
body.inbox-mode .desk-workspace .live-strip{background:var(--soft);color:var(--muted);border:0;font-size:12px;padding:5px 18px;flex:none}
body.inbox-mode .desk-workspace .live-strip:not(.image-batch-bar){display:none}
body.inbox-mode .desk-workspace .image-batch-bar{font-size:12px;padding:5px 18px;flex:none}.image-batch-bar button{font-size:12px;padding:3px 7px;border:0;background:transparent}
@media(max-width:1200px){.thread-details span{display:none}.thread-actions button{font-size:13px;padding:6px}.thread-person .person-avatar{display:none}.composer-tools button{padding:6px;font-size:12px}.composer-send button{font-size:13px;padding:8px}.thread-person-meta a{display:none}}
@media(max-width:1000px){body.inbox-mode .desk-workspace{grid-template-columns:260px 6px minmax(0,1fr)!important}.thread-actions [data-action=note]{display:none}.thread-actions button .icon{display:none}.thread-person-meta{gap:4px}.composer-bottom{align-items:flex-end}.composer-tools{max-width:210px}.thread-details{padding:5px}.thread-actions{gap:1px}}
@media(max-width:900px){body.inbox-mode .desk-workspace{display:grid;height:calc(100dvh - 140px);grid-template-columns:220px 6px minmax(0,1fr)!important}body.inbox-mode .desk-workspace .queue{max-height:none}body.inbox-mode .desk-workspace .chat-main{grid-column:3}body.inbox-mode .desk-workspace .chat-header{flex-wrap:wrap;padding:10px;gap:7px}.thread-person{flex-basis:100%}.thread-details{margin-left:auto}body.inbox-mode .desk-workspace .chat-messages{padding:14px}.reply-composer{padding-inline:12px;max-height:60%}.desk-workspace .chat-item>.person-avatar{display:none}.composer-context{font-size:12px}.composer-context button{font-size:11px}}
@media(max-width:650px){body.inbox-mode .desk-workspace{grid-template-columns:155px 4px minmax(0,1fr)!important}.desk-workspace .queue-heading{padding:5px}.desk-workspace #queue-owner{font-size:13px}.desk-workspace .chat-item{padding:10px 7px!important}.queue-item-top time,.queue-item-meta .queue-reply-state{display:none}.desk-workspace .chat-item .snippet{font-size:12px}.desk-workspace .queue-item-top .name{font-size:13px}.thread-person-meta a,.thread-actions .transfer-split button:first-child .icon{display:none}.composer-context button{display:none}.thread-details{border:0}.composer-tools{max-width:none}.composer-bottom{gap:8px}.composer-send button{font-size:12px;padding:8px 6px}.reply-composer #desk-reply{height:80px}body.inbox-mode .desk-workspace .message{max-width:96%}.message .person-avatar{display:none}}

.avatar-tone-0{--person-hue:200}.avatar-tone-1{--person-hue:280}.avatar-tone-2{--person-hue:25}.avatar-tone-3{--person-hue:160}.avatar-tone-4{--person-hue:340}.avatar-tone-5{--person-hue:220}
.composer-tools [hidden]{display:none}

/* Preparation failures must be visible where the operator expects the answer. */
.composer-context>span{min-width:0;line-height:1.45}.composer-context>span>.icon{flex:none}
.preparation-tools{display:flex;align-items:center;gap:12px;flex:none}
.composer-context .prepare-answer{border:1px solid var(--line-strong);padding:6px 9px;color:var(--accent);border-radius:7px;display:inline-flex;gap:5px;align-items:center;white-space:nowrap}
.composer-context.preparation-error{color:var(--amber,#9c5a00)}
@media(max-width:1000px){.composer-context{flex-wrap:wrap}.preparation-tools{margin-left:auto}}
@media(max-width:650px){.composer-context .prepare-answer{display:inline-flex}}

.composer-timer:not([hidden]){display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;margin:0 0 10px;border:1px solid var(--border);border-radius:10px;background:var(--accent-soft,#e8f5f3)}
.composer-timer button{white-space:nowrap}
