/* Sync owns its navigation and viewport on desktop, PWA and native shells. */
body[data-app-area=sync] .shell{grid-template-columns:minmax(0,1fr)}
.sync-tabs{display:flex;justify-content:space-around;align-items:center;flex:none;gap:4px;padding:6px 12px max(7px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid #e3e9e5;z-index:25}
.sync-tabs button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;flex:1;max-width:190px;min-height:48px;border:0;border-radius:22px;background:none;color:#687870;font:600 11px system-ui;cursor:pointer}
.sync-tabs button svg{height:23px;width:23px;padding:3px;box-sizing:content-box}
.sync-tabs button[aria-current]{background:#e7f1e9;color:#175c46}.sync-tabs button:hover{background:#f0f5f1}
.sync-tabs button:focus-visible,.sync-new-contact:focus-visible{outline:2px solid #1d7961;outline-offset:-2px}
.sync-workspace .cp304-contact-panel>.card-content{display:block;padding:0 12px 16px;overflow:auto;overscroll-behavior:contain}
.sync-workspace .cp304-contact-panel>.card-head{display:flex;justify-content:space-between;gap:10px;padding:13px 18px;border:0;flex:none}
.sync-workspace .cp304-contact-panel>.card-head h2{font-size:22px;letter-spacing:-.4px;margin:0;flex:1}
.sync-new-contact{background:#1b7656;color:#fff;width:40px;height:40px;font-size:27px;font-weight:300}.sync-new-contact:hover{background:#155d44;color:#fff}
.sync-workspace .sync-contact-search{display:block;position:sticky;top:0;background:#fff;z-index:2;padding:0 0 10px;margin:0!important}
.sync-workspace #cp304-find-contact{height:42px;font-size:15px}
.sync-list-pane[hidden],.sync-contact-search[hidden]{display:none!important}
.sync-workspace .cp304-contact-list{max-height:none;overflow:visible;gap:0;display:flex;flex-direction:column}
.sync-workspace .cp304-contact,.sync-workspace .sync-thread-row{display:flex;align-items:center;gap:12px;border:0;border-radius:12px;min-height:82px;padding:12px 8px;flex-shrink:0;width:100%;text-align:left;overflow:hidden}
.sync-workspace .cp304-contact>span:last-child,.sync-thread-copy{flex:1;min-width:0;border-bottom:1px solid #eef1ef;padding:7px 0 14px}
.sync-workspace .cp304-contact strong,.sync-thread-top strong{font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sync-workspace .cp304-contact small{font-size:12px;line-height:1.5;margin-top:4px}
.sync-workspace .cp304-avatar,.sync-client-avatar,.sync-assistant-avatar{width:48px;height:48px;flex:0 0 48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#e9efec;color:#386452;font:600 16px system-ui}
.sync-workspace .cp304-avatar img,.sync-assistant-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.sync-assistant-avatar{background:#0b203b}.sync-thread-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.sync-thread-top time{font-size:11px;color:#89928e;flex:none}
.sync-thread-preview{font-size:13px;line-height:1.5;color:#76847c;display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}.sync-thread-preview .cp308-unread-count{margin-left:auto;flex:none}
.sync-workspace .cp292-thread-list{display:block;max-height:none;overflow:visible}.sync-empty-note{font-size:14px;line-height:1.6;color:#75857c;padding:12px;margin:0}.sync-contact-note{font-size:11px;line-height:1.5;color:#849088;padding:14px 10px}
.sync-start-contact{border:0;border-radius:18px;min-height:42px;background:#edf5ef;color:#24644d;width:100%;font:600 13px system-ui;margin:12px 0;cursor:pointer}
.sync-workspace .cp308-chat-search{margin:16px 8px;font-size:12px;color:#62756a}.sync-workspace .cp308-chat-search .field{font-size:12px}
.sync-profile{padding:8px 4px}.sync-profile-heading{display:flex;align-items:center;gap:12px;margin:0 0 20px}.sync-profile h3{font-size:16px;margin:6px 0}.sync-profile p{font-size:12px;line-height:1.5;color:#63776b}
.sync-profile .cp304-photo-form{border:0;box-shadow:none;margin:18px 0}.sync-profile .cp304-photo-form .card-head,.sync-profile .cp304-photo-form .card-content{padding:10px 0}.sync-profile .cp304-photo-form h2{font-size:15px}.sync-profile .field{font-size:12px!important}.sync-profile .btn{font-size:12px;padding:9px 12px;min-height:40px}.sync-profile input[type=file]{font-size:12px;max-width:100%}.sync-profile .action-row{flex-wrap:wrap}.sync-persona-settings{border-top:1px solid #e6ece8;padding-top:16px}.sync-persona-settings .sync-assistant-avatar{margin:12px 0}.sync-persona-settings select{font-size:14px;max-width:100%}
.sync-workspace .sync-back{display:inline-flex;order:-1;flex:0 0 40px;min-width:40px;height:40px}.sync-workspace .cp308-conversation-card>.card-head{justify-content:flex-start;gap:8px}.sync-contact-heading{flex:1;min-width:0}.sync-contact-heading>div{min-width:0}.sync-contact-heading h2{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sync-contact-heading p{font-size:11px;margin:3px 0}
.sync-workspace .sync-workspace-menu{z-index:30}.sync-workspace .sync-management-content{width:min(430px,calc(100vw - 28px))}
.chefe-native body[data-app-area=sync]{padding-bottom:0}.chefe-native body[data-app-area=sync]>.native-nav{display:none}.chefe-native body[data-app-area=sync] .shell,.chefe-native body[data-app-area=sync] .body{height:calc(100dvh - env(safe-area-inset-top));min-height:0}.native-keyboard .sync-tabs{display:none}
@media(min-width:761px){.sync-tabs{justify-content:flex-start}.sync-tabs button{max-width:150px}.sync-workspace .cp304-messaging.cp373-sync{grid-template-columns:minmax(300px,32%) minmax(0,1fr)}}
@media(max-width:760px){
 .sync-workspace .sync-management-content{position:fixed;left:12px;right:12px;top:calc(108px + env(safe-area-inset-top));width:auto;max-height:calc(100dvh - 190px - env(safe-area-inset-top));box-sizing:border-box}
 .sync-workspace .header{min-height:44px;height:44px;padding:5px 12px}.sync-workspace .header-left strong{font-size:15px}.sync-workspace .header-right{gap:7px}.sync-workspace .cp322-sync-head{display:none}
 .sync-workspace .cp304-contact-panel>.card-head{min-height:64px;padding:10px 16px}.sync-workspace .cp304-contact-panel>.card-content{padding:0 12px 12px}.sync-workspace .cp304-contact-panel>.card-head h2{font-size:24px}
 .sync-workspace .cp304-contact,.sync-workspace .sync-thread-row{min-height:82px;padding:9px 4px}.sync-workspace .cp304-contact strong,.sync-thread-top strong{font-size:16px}.sync-workspace .cp304-contact small{font-size:13px}
 .sync-workspace .cp308-conversation-card>.card-head{min-height:64px;padding:8px}.sync-workspace .cp308-conversation-card .cp304-avatar,.sync-workspace .cp308-conversation-card .sync-assistant-avatar{width:38px;height:38px;flex-basis:38px}.sync-workspace .sync-back{flex-basis:32px;min-width:32px;width:32px}
 .sync-workspace .cp311-chat-composer textarea,.sync-workspace .cp312-sync-composer textarea{font-size:16px}.sync-workspace .chefe-chat-form#chefe-chat-question,.sync-workspace #cp292-send-chat{padding-bottom:8px}
 .sync-workspace .sync-profile{padding:12px 6px}.sync-workspace #cp293-thread-state{display:none}.sync-thread-preview{font-size:14px}.sync-workspace #cp308-recipient-presence{font-size:10px}
 .sync-tabs{gap:2px;padding:5px 8px max(7px,env(safe-area-inset-bottom))}.sync-tabs button{min-height:50px;font-size:10px}
}

.sync-workspace #cp304-find-contact{width:100%;box-sizing:border-box}.sync-workspace .sync-tabs .cp304-avatar{width:27px;height:27px;flex:0 0 27px;font-size:10px;margin:3px 0}.sync-profile #cp332-sync-notifications{margin:8px 0 12px}

/* CP378: an open conversation has only its header and composer. */
.sync-workspace:has(.cp373-thread-open) .sync-tabs{display:none}
@media(max-width:760px){.sync-workspace:has(.cp373-thread-open) .header{display:none}.sync-workspace:has(.cp373-thread-open) #cp292-send-chat,.sync-workspace:has(.cp373-thread-open) #chefe-chat-question{padding-bottom:max(10px,env(safe-area-inset-bottom))}.sync-workspace .cp312-sync-composer{gap:5px}.sync-workspace .cp312-sync-composer textarea{min-width:0}}
.sync-camera-action{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border:0;border-radius:50%;background:none;color:#567367;cursor:pointer}.sync-camera-action svg{width:22px;height:22px}.sync-camera-action input{display:none}
.sync-status{padding:6px}.sync-status .form-column{gap:10px;margin-top:14px}.sync-status input,.sync-status textarea{max-width:100%;box-sizing:border-box}.sync-status textarea{width:100%}.sync-status label{font-size:13px}.sync-status details{border:1px solid #dae7df;border-radius:16px;padding:14px}.sync-status summary{cursor:pointer;font-weight:600;color:#176346}.sync-status-row{display:flex;align-items:center;border-bottom:1px solid #eef1ee}.sync-status-open{display:flex;align-items:center;gap:12px;flex:1;min-width:0;border:0;background:none;text-align:left;padding:16px 0;cursor:pointer}.sync-status-open>span:last-child{min-width:0;display:flex;flex-direction:column;gap:5px}.sync-status-open strong,.sync-status-open small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sync-status-open .cp304-avatar{outline:2px solid #2ba870;outline-offset:3px}.sync-status-open small{color:#738178;font-size:12px}
.sync-status-viewer{position:fixed;inset:0;border:0;border-radius:0;box-sizing:border-box;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:max(12px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom));background:#10251f;color:#fff;overflow:hidden}.sync-status-viewer[open]{display:flex;flex-direction:column;gap:12px}.sync-status-viewer::backdrop{background:#10251f}.status-progress{display:flex;gap:3px;flex:none}.status-progress span{height:3px;flex:1;background:#ffffff45;overflow:hidden}.status-progress i{display:block;width:100%;height:100%;background:white;transform:scaleX(0);transform-origin:left}.status-progress i.completed{transform:scaleX(1)}.sync-status-viewer header{display:flex;align-items:center;gap:12px}.sync-status-viewer header strong{flex:1}.sync-status-viewer button{border:0;background:#ffffff20;color:#fff;border-radius:50%;width:44px;height:44px;font-size:26px;cursor:pointer}.status-stage{flex:1;min-height:0;display:grid;place-items:center;overflow:hidden;touch-action:manipulation}.status-stage img,.status-stage video{max-width:100%;max-height:100%;height:100%;object-fit:contain}.status-stage>p{font-size:clamp(22px,5vw,40px);line-height:1.4;text-align:center;overflow-wrap:anywhere;max-width:700px}.status-caption{margin:0;text-align:center;overflow-wrap:anywhere}.sync-status-viewer nav{display:flex;justify-content:space-between}.status-player-note{font-size:12px;text-align:center;margin:0;color:#c3d8ce;min-height:30px}

/* CP379: pin the complete mobile thread, not just its composer. */
@media(max-width:760px){
 html:has(body.sync-conversation-viewport){overflow:hidden;overscroll-behavior:none}
 body.sync-conversation-viewport{overflow:hidden;overscroll-behavior:none;padding:0!important}
 body.sync-conversation-viewport #app-shell{position:fixed;left:0;right:0;top:var(--sync-visible-top,0px);height:var(--sync-visible-height,100dvh);min-height:0;max-height:none;padding-top:env(safe-area-inset-top);overflow:hidden}
 body.sync-conversation-viewport #app-shell>.body{height:100%;min-height:0;overflow:hidden}
 body.sync-conversation-viewport #workspace{margin:0;max-width:none}
 body.sync-conversation-viewport .cp308-conversation-card>.card-head,body.sync-conversation-viewport #cp332-guest-conversation>.card-head{flex:0 0 auto;position:relative;z-index:10;min-height:60px;display:flex;align-items:center;gap:8px;padding:8px;background:#f7faf9}
 body.sync-conversation-viewport .sync-back{display:inline-flex;min-width:40px;width:40px;flex:0 0 40px;height:40px;color:#174b3d;background:#e9f0ec;border:1px solid #dfe8e2}
 body.sync-conversation-viewport .sync-contact-heading{gap:8px}
 body.sync-conversation-viewport .sync-contact-heading h2{font-size:15px}
 body.sync-conversation-viewport .sync-contact-heading small{display:block;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.sync-conversation-viewport .chefe-chat-history,body.sync-conversation-viewport #cp293-transcript{overscroll-behavior:contain;overflow-anchor:none;-webkit-overflow-scrolling:touch}
 body.sync-conversation-viewport .cp311-chat-composer textarea,body.sync-conversation-viewport .cp312-sync-composer textarea{font-size:16px!important;height:40px;min-height:40px;max-height:104px;line-height:24px;padding:8px 4px;box-sizing:border-box;overflow-y:auto}
 body.sync-conversation-viewport #chefe-chat-question,body.sync-conversation-viewport #cp292-send-chat{padding:8px 8px max(8px,env(safe-area-inset-bottom))}
 body.sync-conversation-viewport .cp311-chat-composer,body.sync-conversation-viewport .cp312-sync-composer{gap:2px;min-height:54px}
 body.sync-conversation-viewport #cp378-assistant-camera{flex-basis:32px;width:32px}
 body.sync-conversation-viewport .chefe-chat-bubble{max-width:90%}
 body.sync-conversation-viewport #cp332-guest-conversation>.card-head h2{font-size:15px;flex:1}
}
.cp308-message-meta{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin-top:4px;font-size:10px;color:#7b8b83}
.chefe-chat-bubble .cp308-message-meta time{margin:0;display:inline}
.cp308-receipt{display:inline-flex;align-items:center;justify-content:center;flex:none;width:22px;height:18px;color:#768780;vertical-align:middle;letter-spacing:normal}
.cp308-receipt svg{display:block;width:22px;height:17px;overflow:visible}
.cp308-receipt-read,.cp308-receipt-answered{color:#269bc0}

.sync-workspace .card-head>#chefe-chat-tools{position:relative;top:auto;right:auto;flex:none;z-index:20}.sync-workspace .card-head>#chefe-chat-tools[open]{position:absolute;top:8px;right:8px;max-height:calc(var(--sync-visible-height,100dvh) - 85px);width:min(380px,calc(100% - 16px))}

.status-report-link{color:inherit;font-size:13px;padding:10px;flex:none}

/* Mobile Sync correction: one flexible transcript, with the composer in its flow.
   These scoped rules retire the CP312 390px/650px limits that overrode CP379. */
.sync-workspace #cp312-assistant-slot>.chefe-chat-panel.cp312-in-sync{
 height:auto!important;min-height:0!important;max-height:none!important;flex:1 1 0!important;
}
.sync-workspace .cp308-conversation-card .cp292-chat-transcript,
.sync-workspace .cp312-inline-assistant .chefe-chat-history{
 height:auto!important;min-height:0!important;max-height:none!important;flex:1 1 0!important;
}
.sync-workspace #chefe-chat-question{max-height:none;overflow:visible;order:20}
.sync-workspace #chefe-chat-status{order:19;min-height:0;max-height:28px;padding:4px 12px;margin:0}
.sync-workspace #chefe-chat-recording{order:18}
.sync-workspace #cp292-send-chat{max-height:none;overflow:visible}
.sync-workspace #cp306-file-ready[hidden],.sync-workspace #cp293-chat-result[hidden]{display:none}
.sync-workspace .cp304-contact-panel{max-height:none;flex:1;overflow:hidden}
.sync-workspace .sync-context-bar{display:flex;align-items:center;gap:10px;padding:10px 16px;background:#fff;border-bottom:1px solid #e5ebe7;flex:none;min-width:0}
.sync-context-bar a{display:inline-flex;align-items:center;gap:4px;color:#23634e;font-size:13px;text-decoration:none;min-height:36px;flex:none}
.sync-context-bar a svg{width:17px;height:17px}
.sync-context-bar>span{min-width:0;flex:1;font-size:12px;color:#62756a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sync-context-bar button{border:1px solid #dbe6df;border-radius:16px;padding:7px 10px;background:#f4f8f5;color:#23634e;font-size:12px;flex:none;min-height:36px}
.sync-workspace .cp373-thread-open .sync-context-bar{display:none}
.sync-inbox-filters{display:flex;gap:7px;margin:0 0 9px;padding:2px 0}
.sync-inbox-filters button{border:1px solid #dce5df;border-radius:19px;background:#fff;padding:7px 12px;color:#586b60;font-size:13px;min-height:36px}
.sync-inbox-filters button[aria-pressed=true]{background:#e1f3e5;border-color:#a8d5b6;color:#185b3c}
.sync-thread-row.has-unread .sync-thread-top strong{font-weight:750;color:#153c2d}
.sync-thread-row.has-unread .sync-thread-top time{color:#1d9258;font-weight:650}
.sync-thread-row.has-unread .sync-thread-preview{color:#3d5b4a}
.sync-workspace .sync-thread-row[hidden],.sync-workspace .sync-guest-contact[hidden]{display:none!important}
.sync-tabs button{position:relative}
.sync-tabs .sync-inbox-badge{position:absolute;top:2px;left:calc(50% + 8px);min-width:18px;height:18px;padding:0 5px;border-radius:10px;background:#c93845;color:#fff;font-size:10px;line-height:18px;text-align:center}
.sync-tabs .sync-inbox-badge[hidden]{display:none}
.sync-workspace #cp293-chat-result{flex:none;max-height:35px;overflow:hidden}
.sync-workspace #cp292-send-chat>.cp373-delivery-help{display:none}
@media(max-width:760px){
 body.sync-conversation-viewport #app-shell>.body{height:100%;min-height:0;max-height:100%}
 body.sync-conversation-viewport #workspace{height:auto;flex:1 1 0;min-height:0}
 body.sync-conversation-viewport .cp304-messaging.cp373-sync{height:auto;flex:1 1 0;min-height:0}
 body.sync-conversation-viewport .cp304-chat-panel{height:100%;min-height:0}
 body.sync-conversation-viewport #cp312-assistant-slot{min-height:0}
 body.sync-conversation-viewport #chefe-chat-question,
 body.sync-conversation-viewport #cp292-send-chat,
 body.sync-conversation-viewport #cp332-guest-reply{padding-bottom:max(8px,var(--sync-safe-bottom,env(safe-area-inset-bottom)))}
 body.sync-conversation-viewport.sync-keyboard-open{--sync-safe-bottom:0px}
 body.sync-conversation-viewport .cp311-chat-composer,
 body.sync-conversation-viewport .cp312-sync-composer{align-items:flex-end}
 body.sync-conversation-viewport .chefe-chat-form#chefe-chat-question textarea{max-height:104px}
 .sync-workspace .cp304-contact-panel>.card-head{gap:7px;padding:9px 12px}
 .sync-workspace .cp304-contact-panel>.card-head h2{font-size:22px}
}

.sync-workspace .sync-guest-contact .cp308-unread-count{display:inline-flex;width:20px;min-width:20px;max-width:20px;height:20px;padding:0;align-items:center;justify-content:center;border-radius:50%;margin:4px 0 0 auto}

/* Guests use the same transcript/composer geometry as internal conversations. */
.sync-workspace #cp332-guest-transcript{height:auto!important;min-height:0!important;max-height:none!important;flex:1 1 0;padding:16px 12px;border:0;border-radius:0;overflow:auto;overscroll-behavior:contain;overflow-anchor:none;background-color:#f1f4f1;background-image:radial-gradient(#dbe6df .65px,transparent .65px);background-size:19px 19px}
.sync-workspace #cp332-guest-conversation>.record{gap:0;overflow:hidden}
.sync-workspace #cp332-guest-reply{flex:none;margin:0;padding:8px 8px max(8px,var(--sync-safe-bottom,env(safe-area-inset-bottom)));background:#f1f4f1}
.sync-workspace #cp373-guest-status{flex:none;margin:0;padding:4px 12px;font-size:12px;max-height:42px;overflow:auto;background:#f1f4f1}
.sync-workspace #cp373-guest-status[hidden]{display:none}

.sync-workspace .sync-guest-contact .cp308-unread-count.muted{background:#e9eeeb;color:#607269}

.sync-assistant-avatar.atlas-avatar-no-tile{background:transparent}
