/* One conversation rhythm across both portal runtimes. */
.dc-thread{overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;min-height:260px;max-height:62dvh;padding:12px 12px 24px;overflow-anchor:none}
.dc-message{width:min(100%,780px);margin:0 auto 24px;line-height:1.75;color:#26313d;overflow-wrap:anywhere}
.dc-author{font-size:12px;font-weight:700;color:#637180;margin-bottom:8px}
.dc-body{font-size:15px}.dc-user .dc-body{white-space:pre-wrap}
.dc-user{display:flex;flex-direction:column;align-items:flex-end}.dc-user .dc-body{max-width:88%;padding:13px 19px;background:#f0f2f5;border-radius:20px 20px 5px 20px}
.dc-body p{white-space:pre-wrap;margin:0 0 14px}.dc-body p:last-child{margin-bottom:0}.dc-body ul,.dc-body ol{padding-left:25px;margin:10px 0 18px}.dc-body li{margin:5px 0}.dc-body h2,.dc-body h3,.dc-body h4{font-size:1.1em;letter-spacing:normal;margin:20px 0 10px;line-height:1.5}
.dc-body code{font:13px ui-monospace,SFMono-Regular,Consolas,monospace;background:#eef0f3;padding:2px 5px;border-radius:5px}.dc-body pre{white-space:pre;overflow-x:auto;background:#f4f5f7;border:1px solid #e2e6eb;border-radius:12px;padding:16px;font:13px ui-monospace,SFMono-Regular,Consolas,monospace}.dc-body pre code{padding:0;background:none}.dc-body a{color:#995018;text-underline-offset:3px}.dc-body blockquote{margin:12px 0;border-left:3px solid #e3a66a;padding-left:16px;color:#637180}
.dc-empty{padding:50px 20px;text-align:center;color:#637180}.dc-typing{display:flex;gap:5px;max-width:780px;margin:12px auto 25px;padding:8px 0}.dc-typing span{width:7px;height:7px;border-radius:50%;background:#8b929b;animation:dc-pulse 1.1s ease-in-out infinite}.dc-typing span:nth-child(2){animation-delay:.14s}.dc-typing span:nth-child(3){animation-delay:.28s}
.dc-enter{animation:dc-arrive .2s ease-out both}@keyframes dc-arrive{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}@keyframes dc-pulse{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.dc-activity{display:flex;align-items:center;gap:10px;max-width:780px;margin:12px auto 25px;padding:8px 0;font-size:13px;color:#7b8490}.dc-activity .dc-typing{margin:0;padding:0;flex:none}.dc-elapsed{font-variant-numeric:tabular-nums;color:#969da6}
.dc-composer{position:sticky;bottom:0;z-index:2;background:#fff;border:1px solid #dce0e6;border-radius:20px;padding:12px 14px;box-shadow:0 5px 24px #2534440a}
.dc-composer textarea{border:0;outline:none!important;box-shadow:none;background:transparent!important;padding:7px 5px;resize:none;min-height:48px;max-height:180px;font:inherit;width:100%;line-height:1.6}.dc-composer:focus-within{border-color:#e4a35f;box-shadow:0 0 0 3px #ff9b3214}.dc-composer footer,.dc-composer .composer-bottom{display:flex;align-items:center;justify-content:space-between;flex-direction:row;gap:12px;margin:4px 0 0;border:0;padding:0}.dc-composer button[type=submit]{border-radius:12px;min-height:42px;margin-left:auto}.dc-composer footer span{font-size:11px;color:#7b8490}.dc-sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
#run-form{display:flex;flex-direction:column;height:calc(100dvh - 290px);min-height:360px;max-height:900px;background:transparent;border:0;padding:0;margin-bottom:0}#run-form #run-reply{flex:1;min-height:0;max-height:none;white-space:normal;line-height:1.75}#run-form .dc-composer{flex-shrink:0}#run-status:empty{display:none}#run-status{font-size:12px;color:#637180;margin:8px 5px}#run-older{display:block;margin:0 auto 12px;background:transparent;color:#637180;font-size:12px;min-height:36px}
.ux-delivery #sofie-memory{margin-top:30px;padding:20px;border:1px solid #e2e6eb;border-radius:15px;background:#fff}.ux-legacy .chat-grid{grid-template-columns:minmax(0,1fr)}.ux-legacy #view-chat .context{display:none}.ux-legacy .conversation{border:0;padding:0;background:transparent;box-shadow:none}.ux-legacy .conversation>.card-heading{border:0;margin-bottom:0}.ux-legacy #messages{max-height:62dvh;min-height:260px;padding:12px 12px 24px}.ux-legacy .conversation #chat-form{margin-top:auto}
@media(max-width:760px){.dc-thread,.ux-legacy #messages{max-height:55dvh;min-height:210px;padding:8px 2px 20px}.dc-message{margin-bottom:20px}.dc-body{font-size:15px}.dc-composer{bottom:env(safe-area-inset-bottom,0px);border-radius:17px;padding:9px 11px}.dc-composer textarea{font-size:16px}.dc-composer footer span{font-size:10px}.dc-user .dc-body{max-width:93%;padding:11px 15px}}
@media(prefers-reduced-motion:reduce){.dc-enter,.dc-typing span{animation:none}.dc-thread{scroll-behavior:auto}}

/* Let the conversation own the page; navigation belongs in the sidebar. */
body.ux-delivery,body.ux-legacy{background:#fff}
.ux-mobile-menu{display:none}
aside .ux-detail-tabs{flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:4px;border-top:1px solid #e8eaed;border-bottom:0;padding:16px 0 0;margin:16px 0}
aside .ux-detail-tabs button{width:100%;text-align:left}
body.ux-chat-open{height:100dvh;overflow:hidden;background:#fff}
.ux-delivery.ux-chat-open{display:flex;flex-direction:column}
.ux-delivery.ux-chat-open>header{flex-shrink:0;padding-block:12px}
.ux-delivery.ux-chat-open main{flex:1;min-height:0;width:100%;max-width:none;padding:16px 32px max(28px,env(safe-area-inset-bottom));gap:28px;overflow:hidden}
.ux-delivery.ux-chat-open main>aside{position:static;min-height:0;max-height:100%;overflow-y:auto;background:#f8f9fa;border-color:#edf0f2}
.ux-delivery.ux-chat-open #delivery-detail{display:flex;flex-direction:column;min-height:0;height:100%;padding:0 16px}
.ux-delivery.ux-chat-open .heading{flex-shrink:0;padding:4px 0 12px;min-height:48px}
.ux-delivery.ux-chat-open .heading h2{font-size:23px;margin:0;letter-spacing:-.6px}
.ux-delivery.ux-chat-open .heading .eyebrow,.ux-delivery.ux-chat-open #revision{display:none}
.ux-delivery.ux-chat-open #run-form{flex:1;min-height:0;height:auto;max-height:none;gap:12px}
.ux-chat-open .dc-thread{min-height:0;max-height:none;padding:20px 12px 28px}
.ux-chat-open .dc-composer{position:relative;bottom:auto;width:min(100%,880px);margin:0 auto;flex-shrink:0;border-color:#dfe2e6;box-shadow:0 4px 24px #25344408}
.ux-chat-open .dc-composer textarea{min-height:46px}
.ux-chat-open .dc-body{font-size:16px}
.ux-legacy.ux-chat-open #workspace{height:100%;min-height:0}
.ux-legacy.ux-chat-open .sidebar{max-height:100dvh;overflow-y:auto}
.ux-legacy.ux-chat-open .shell{height:100%;display:flex;flex-direction:column;background:#fff}
.ux-legacy.ux-chat-open .topbar{flex-shrink:0}
.ux-legacy.ux-chat-open .main{flex:1;min-height:0;width:100%;max-width:none;padding:16px 32px max(28px,env(safe-area-inset-bottom));overflow:hidden}
.ux-legacy.ux-chat-open #coworker-detail{height:100%;display:flex;flex-direction:column;min-height:0}
.ux-legacy.ux-chat-open #back-overview,.ux-legacy.ux-chat-open .coworker-head .eyebrow,.ux-legacy.ux-chat-open .conversation>.card-heading{display:none}
.ux-legacy.ux-chat-open .coworker-head{flex-shrink:0;margin-bottom:12px;padding-bottom:8px}
.ux-legacy.ux-chat-open .coworker-head h1{font-size:23px;margin:0}
.ux-legacy.ux-chat-open #view-chat{display:flex;flex:1;min-height:0;flex-direction:column}
.ux-legacy.ux-chat-open .chat-grid{display:flex;flex:1;min-height:0}
.ux-legacy.ux-chat-open .conversation{display:flex;flex:1;min-height:0;flex-direction:column;gap:12px;margin:0}
.ux-legacy.ux-chat-open #messages{flex:1;min-height:0;max-height:none}
.ux-legacy.ux-chat-open #view-chat>p{margin:8px auto 0;font-size:11px}
.ux-legacy .sidebar #coworker-nav.ux-detail-tabs:not([hidden]){display:flex!important}
@media(max-width:760px){
 .ux-chat-open .ux-mobile-menu{display:block;width:100%;min-height:42px;margin:0}
 .ux-chat-open aside:not(.ux-menu-open)>.ux-mobile-menu~*{display:none!important}
 body.ux-chat-open{height:auto;min-height:100dvh;overflow:auto}
 .ux-delivery.ux-chat-open main{padding:12px 16px max(24px,env(safe-area-inset-bottom));display:block;overflow:visible}
 .ux-delivery.ux-chat-open main>aside{max-height:none;margin-bottom:14px;padding:10px 12px}
 .ux-delivery.ux-chat-open aside .ux-primary{margin:0;gap:4px}
 .ux-delivery.ux-chat-open aside h1{display:none}
 .ux-delivery.ux-chat-open #coworkers{margin:6px 0;gap:6px}
 .ux-delivery.ux-chat-open aside button{min-width:0}
 aside .ux-detail-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding-top:8px;margin:8px 0}
 .ux-delivery.ux-chat-open #delivery-detail{height:calc(100dvh - 190px);min-height:320px;padding:0}
 .ux-legacy.ux-chat-open .shell{height:auto}
 .ux-legacy.ux-chat-open .main{padding:12px 16px 24px}
 .ux-legacy.ux-chat-open #coworker-detail{height:calc(100dvh - 100px);min-height:420px}
 .ux-chat-open .dc-thread{padding:12px 2px 20px}
}

/* Keep guidance outside the input, consistently across both portal runtimes. */
.dc-composer-hint{width:min(100%,880px);margin:0 auto;flex-shrink:0;text-align:center;font-size:11px;line-height:1.5;color:#7b8490;padding:0 8px}
@media(max-width:760px){.dc-composer-hint{font-size:10px}}
