/* Task chat owns its scroll area; controls remain reachable above the keyboard. */
body:has(.thread-workspace) .pw-detail>.pw-detail-head,body:has(.thread-workspace) .pw-detail>.pw-back,body:has(.thread-workspace) .pw-detail>.install-hint,body:has(.thread-workspace) .pw-detail>.pw-next-banner,body:has(.thread-workspace) .pw-public-footer,body:has(.thread-workspace) .pw-manager-launcher,body:has(.thread-workspace) .pw-manager-preview{display:none!important}
.pw-experience .thread-workspace{display:block;max-width:1000px;margin:0 auto;min-width:0}
.pw-experience .thread-chat{position:relative;top:auto;display:flex;flex-direction:column;height:calc(100dvh - 120px);min-height:420px;width:100%;max-width:none;border:1px solid #dce8e3;border-radius:20px;background:#fff;overflow:hidden;box-shadow:0 8px 30px #163b2910}
.thread-chat .pw-chat-heading{padding:14px 18px;gap:12px;flex:none;border-bottom:1px solid #e8eeeb;background:#fff}
.thread-back{display:grid;place-items:center;width:44px;height:44px;flex:none;border-radius:12px;color:#1b6357;text-decoration:none;font-size:24px;background:#f0f6f3}
.thread-title{flex:1;min-width:0}.pw-experience .thread-title h1{font-size:19px!important;line-height:1.2;margin:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.thread-chat .thread-title p{font-size:12px;color:#61766c;margin:4px 0 0!important}
.thread-menu{flex:none}.thread-menu>summary{list-style:none;cursor:pointer;border:1px solid #dce8e3;padding:12px;border-radius:10px;font-size:12px;color:#315d51;min-height:44px;box-sizing:border-box}.thread-menu>summary::-webkit-details-marker{display:none}.thread-menu[open]>summary{background:#e9f4ee}
.thread-menu-body{position:absolute;z-index:35;right:12px;top:72px;width:min(440px,calc(100% - 24px));max-height:calc(100% - 90px);overflow:auto;overscroll-behavior:contain;background:white;border:1px solid #dce8e3;box-shadow:0 12px 36px #163b2926;border-radius:14px;padding:18px;box-sizing:border-box}.thread-menu-body>h2{font-size:18px!important;margin:0 0 12px}.thread-menu-body>label{font-size:12px}.thread-menu-body select{display:block;width:100%;max-width:100%;font-size:16px;padding:12px;margin:6px 0 18px;border:1px solid #cbded4;border-radius:10px;background:white}
.thread-nav{flex:none;padding:10px 18px;background:#f2f8f5;border-bottom:1px solid #e1ece6}.thread-pin{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;font-size:13px}.thread-pin>div:first-child{flex:1;min-width:0}.thread-pin b{font-weight:650;color:#285648}.thread-pin small{display:block;color:#61766c;font-size:12px;margin-top:3px}.thread-pin .btn{min-height:40px;padding:8px 12px!important;margin:0!important}.thread-pin .notice-panel{flex:1 1 100%;max-height:110px;overflow:auto;margin:0!important;padding:10px!important}
.pw-experience .thread-chat .pw-chat{flex:1;min-height:0;height:auto;display:flex;gap:0;padding:22px;background:#f6f8f7;overflow-y:auto;overscroll-behavior:contain;scroll-behavior:auto;scroll-padding:16px}
.thread-entry{flex-shrink:0;min-width:0;margin:0 0 16px;overflow-wrap:anywhere}.thread-entry .pw-chat-day{display:none}.thread-entry .pw-message{max-width:85%;width:fit-content;padding:12px 15px;border-radius:16px 16px 16px 4px;border:1px solid #dce6e0;background:#fff;box-shadow:0 2px 5px #173a2610}.thread-entry .pw-message.is-mine{margin-left:auto;border-radius:16px 16px 4px 16px;background:#e0f1e7;border-color:#c5e2d1}.pw-operator .thread-entry .pw-message.is-mine{background:#e9e5fa;border-color:#dcd4f3}.thread-entry .pw-message>b{font-size:12px;color:#345d4f}.pw-experience .thread-entry .pw-message p{font-size:15px;line-height:1.55;color:#223e32}.thread-entry .pw-message footer{font-size:11px;color:#657c70}.thread-entry .pw-chat-event{font-size:12px;max-width:100%;color:#728579;margin:0 auto}.thread-entry .pw-chat-file{min-height:48px}.thread-entry .pw-chat-file>span{font-size:14px}.thread-entry .pw-chat-file small{font-size:11px}
.thread-order,.thread-entry>.result-card,.thread-entry>.simple-terms{padding:20px!important;border:1px solid #dbe6e0;border-radius:16px;background:#fff;margin:0!important}.thread-order>small{font-size:11px;color:#708276}.thread-order h2,.thread-entry .simple-terms h2{font-size:18px!important;margin:8px 0 12px!important}.thread-order p{white-space:pre-wrap;font-size:15px!important}.thread-entry .result-card{display:block}.thread-entry .simple-metrics{gap:12px;margin:14px 0!important;grid-template-columns:1fr 1fr}.thread-entry .simple-metrics strong{font-size:20px!important}.thread-entry .simple-metrics span{font-size:11px}.thread-entry .simple-terms h3{font-size:14px;margin:10px 0 5px}.thread-entry .simple-terms p{font-size:14px;line-height:1.5}.thread-entry .simple-terms .btn{min-height:44px}.thread-entry #ask-terms{border:0;background:transparent;font-size:13px;color:#3c6556;margin-top:6px}.thread-entry .result-actions .btn{min-height:46px}.thread-entry .pw-result-review-helper{font-size:13px!important}
.thread-tools,.thread-context{border-top:1px solid #e5ece7;padding:14px 0}.thread-tools>summary,.thread-context>summary{cursor:pointer;font-weight:600;font-size:14px;min-height:32px}.thread-tools>.pw-work-main{display:block;padding-top:14px}.thread-tools>small{display:block;color:#738094;margin:8px 0}.thread-context .pw-message{margin-top:14px}.thread-chat [hidden]{display:none!important}
.pw-experience .thread-chat .pw-composer{flex:none;position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;background:#fff;border:0;border-top:1px solid #dce8e0;border-radius:0;margin:0;padding:12px 16px;box-shadow:none}.pw-experience .thread-chat .pw-composer textarea{font-size:16px;min-height:44px!important;max-height:110px;padding:10px 4px;line-height:1.45}.thread-chat .pw-composer-actions{align-self:end;gap:6px}.thread-chat .pw-composer-actions>span{display:none}.thread-chat .pw-attach,.thread-chat .pw-send{width:44px;height:44px;border-radius:12px}.thread-chat .pw-chat-uploads{grid-column:1/-1;padding:0;max-height:100px;overflow:auto}.thread-chat .pw-keyboard-hint{grid-column:1/-1;font-size:10px!important;margin:2px 0 0}.thread-chat .pw-new-messages{position:absolute;z-index:5;bottom:100px;left:50%;transform:translateX(-50%);min-height:40px;box-shadow:0 3px 12px #173c2620;background:#fff;margin:0;white-space:nowrap}
@media(max-width:720px){
 body:has(.thread-workspace){overflow:hidden}body:has(.thread-workspace) .top,body:has(.thread-workspace) .mobile{display:none!important}
 .pw-experience .thread-chat{position:fixed;z-index:30;left:0;right:0;top:var(--thread-viewport-top,0px);height:var(--thread-viewport-height,100dvh);min-height:0;width:100%;border:0;border-radius:0;box-shadow:none}
 .thread-chat .pw-chat-heading{padding:calc(8px + env(safe-area-inset-top)) 10px 8px;gap:8px}.pw-experience .thread-title h1{font-size:17px!important}.thread-chat .thread-title p{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.thread-menu>summary{font-size:11px;padding:12px 8px}.thread-menu-body{top:calc(66px + env(safe-area-inset-top));padding:14px}
 .thread-nav{padding:8px 12px}.thread-pin{font-size:12px;gap:6px}.thread-pin small{font-size:11px}.thread-pin .btn{font-size:12px;min-height:40px}
 .pw-experience .thread-chat .pw-chat{padding:14px 12px}.thread-entry .pw-message{max-width:90%;padding:10px 12px}.thread-order,.thread-entry>.result-card,.thread-entry>.simple-terms{padding:16px!important}.thread-entry .simple-metrics{grid-template-columns:1fr 1fr!important}.thread-entry .simple-metrics strong{font-size:17px!important}.thread-entry .result-actions{display:flex;flex-direction:column;gap:8px}
 .pw-experience .thread-chat .pw-composer{padding:8px 10px calc(8px + env(safe-area-inset-bottom));gap:0 4px}.thread-chat .pw-keyboard-hint{display:none}.thread-chat .pw-new-messages{bottom:88px}.thread-chat .pw-chat-uploads:empty{display:none}
}
@media(max-height:450px){.thread-nav{padding:5px 12px}.thread-chat .pw-chat-heading{padding-top:4px;padding-bottom:4px}.thread-title p{display:none}.thread-chat .pw-chat-uploads{max-height:54px}}

.pw-experience .thread-menu>summary{font-size:12px!important;line-height:18px!important;white-space:nowrap;font-weight:600!important}.thread-entry>.notice-panel{margin:0;padding:14px;border-radius:12px;font-size:14px}

.thread-card-details{border-top:1px solid #dce6df;padding:10px 0;margin:8px 0;font-size:13px}.thread-card-details>summary{cursor:pointer;min-height:32px;display:list-item;font-size:13px!important;color:#416856}.thread-card-details p{font-size:13px!important}

/* Keep file actions readable and tappable with long filenames on phones. */
@media(max-width:700px){
 .pw-experience .thread-entry .result-card .file{display:grid;grid-template-columns:36px minmax(0,1fr);gap:10px;align-items:center}
 .pw-experience .thread-entry .result-card .file-info{min-width:0;width:auto}
 .pw-experience .thread-entry .result-card .file-info b{overflow-wrap:anywhere}
 .pw-experience .thread-entry .result-card .file>:is(.download,.get-file){grid-column:1/-1;width:100%;min-height:44px;white-space:nowrap;word-break:normal;overflow-wrap:normal}
 .pw-experience .thread-entry .result-card .file>.delete-file{grid-column:1/-1;justify-self:end;min-height:44px;white-space:nowrap}
}
