.draft-bar{margin:12px 20px;padding:14px;border:1px solid var(--accent,#668451);border-radius:12px;background:var(--paper);display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px}.draft-bar p{margin:5px 0 0;line-height:1.5}.draft-actions{display:flex;gap:8px;flex-wrap:wrap;flex-shrink:0}.draft-review{width:min(820px,96vw);max-height:90dvh;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:0}.draft-review-body{padding:20px;overflow:auto;max-height:65dvh}.draft-conflict{border:1px solid var(--line);border-radius:10px;padding:12px;margin:12px 0;min-width:0}.draft-conflict label{display:block;margin:12px 0;padding:10px;background:var(--bg);border-radius:8px;cursor:pointer}.draft-conflict pre{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;max-height:200px;overflow:auto;margin:6px 0}.draft-list article{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--line)}.draft-list small{display:block;margin-top:6px}.workspace-top-actions{display:flex;gap:4px}.workspace-top-actions button{min-width:40px;min-height:40px}.draft-review .dialog-footer{display:flex;gap:8px;flex-wrap:wrap}.draft-review h2{margin:0}.draft-bar strong{font-size:13px}@media(max-width:600px){.draft-bar{margin:8px;align-items:stretch;flex-direction:column}.draft-actions .btn{min-height:44px;flex:1}.draft-review{width:100vw;max-width:100vw;max-height:100dvh;height:100dvh;margin:0;border-radius:0;display:flex;flex-direction:column}.draft-review:not([open]){display:none}.draft-review-body{max-height:none;flex:1;min-height:0}.draft-review .dialog-footer{padding-bottom:max(14px,env(safe-area-inset-bottom));flex-shrink:0}.draft-review .dialog-footer .btn{min-height:44px;flex:1}.workspace-top-actions button{min-width:34px;min-height:40px}}
.workspace-search{width:min(800px,94vw);max-height:85dvh;padding:0;border:1px solid var(--line);border-radius:18px;background:var(--paper);color:var(--ink);box-shadow:0 20px 80px #0005}.workspace-search[open]{display:flex;flex-direction:column}.workspace-search header{padding:18px 22px;display:flex;align-items:center;justify-content:space-between}.workspace-search-controls{display:flex;gap:10px;padding:0 22px 16px}.workspace-search-controls label{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.workspace-search-controls input{width:100%;min-width:0}.workspace-search-controls input,.workspace-search-controls select,.passport-find input{border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:10px;padding:12px}.workspace-search-results{overflow:auto;min-height:100px;padding:0 10px;flex:1}.workspace-search-empty{padding:24px;line-height:1.7;color:var(--muted)}.workspace-result{display:flex;width:100%;align-items:center;gap:14px;padding:15px 12px;text-align:left;border-radius:10px;background:transparent;color:var(--ink)}.workspace-result:hover,.workspace-result:focus-visible{background:var(--bg)}.workspace-result>span:nth-child(2){flex:1;min-width:0}.workspace-result strong,.passport-item strong{display:block;overflow-wrap:anywhere}.workspace-result small,.passport-item small{display:block;margin-top:5px;color:var(--muted);overflow-wrap:anywhere}.workspace-result-icon{width:38px;height:38px;border:1px solid var(--line);border-radius:10px;display:grid;place-items:center;flex-shrink:0}.workspace-search footer{border-top:1px solid var(--line);padding:14px 22px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted)}.workspace-search [hidden]{display:none!important}.passport-head>div:first-child{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.passport-head small{color:var(--muted)}.passport-actions{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.passport-tabs{display:flex;gap:7px;overflow:auto;flex-wrap:nowrap;padding:8px 0 16px;scrollbar-width:thin}.passport-tabs .btn{flex-shrink:0}.passport-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.passport-stats>div{background:var(--bg);padding:16px;border-radius:12px;border:1px solid var(--line)}.passport-stats strong{display:block;font-size:26px}.passport-stats small{color:var(--muted);display:block;margin-top:6px}.passport-section{margin:22px 0;padding-bottom:18px;border-bottom:1px solid var(--line)}.passport-section h3{margin-bottom:12px}.passport-section p{line-height:1.6}.passport-item{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;padding:14px 10px;background:transparent;color:var(--ink);text-align:left;border-bottom:1px solid var(--line)}.passport-item:hover{background:var(--bg)}.passport-find{display:flex;gap:12px;align-items:center;margin:6px 0 14px}.passport-find input{flex:1;min-width:0}.passport-find span{font-size:12px;color:var(--muted)}#dialog:has(.machine-passport){width:min(980px,96vw)}@media(max-width:600px){.workspace-search{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}.workspace-search-controls{padding:0 14px 12px;flex-direction:column}.workspace-search-controls input{font-size:16px}.workspace-search header{padding:14px}.workspace-search footer{padding:12px 14px max(14px,env(safe-area-inset-bottom));flex-wrap:wrap}.workspace-search-results{padding:0 6px}.passport-stats{gap:6px}.passport-stats>div{padding:12px 9px}.passport-stats strong{font-size:22px}.passport-stats small{font-size:10px}.passport-actions .btn{min-height:44px;flex:1}.passport-tabs .btn{min-height:42px}.passport-item{min-height:60px}.passport-find{flex-wrap:wrap}.passport-find input{font-size:16px}#dialog:has(.machine-passport){width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}.topbar .top-meta{flex-wrap:wrap;justify-content:flex-end;gap:4px}.workspace-top-actions{flex-shrink:0}}
html:has(.workspace-search[open]),html:has(.draft-review[open]),html:has(#dialog[open] .machine-passport){overflow:hidden}
@media(max-width:600px){body .topbar,body.mobile-chat-view .topbar{height:auto;min-height:calc(60px + env(safe-area-inset-top,0px));padding-top:calc(7px + env(safe-area-inset-top,0px));padding-bottom:7px;align-items:center}body .topbar .top-meta{flex:1 1 auto;min-width:0;max-width:100%;flex-wrap:wrap;gap:4px}body .topbar .breadcrumb{flex:0 1 55px;min-width:0}.workspace-top-actions button{min-width:38px;min-height:40px}}

.draft-bar small{display:block;line-height:1.5;color:var(--muted);margin-top:6px}.draft-list article>div:first-child{min-width:0;overflow-wrap:anywhere}.draft-list .draft-actions{flex-shrink:0}@media(max-width:600px){.draft-list article{align-items:stretch;flex-direction:column}.draft-list .draft-actions{width:100%}}

/* Keep each draft action together with its explanation at every screen width. */
.draft-bar{align-items:stretch;flex-direction:column;min-width:0}
.draft-explained-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;min-width:0}
.draft-explained-action{min-width:0}
.draft-explained-action>.btn{min-height:44px;max-width:100%;white-space:normal;line-height:1.4;justify-content:center}
.draft-explained-actions .draft-explained-action>.btn{width:100%}
.draft-explained-action>.draft-action-hint{display:block;margin:6px 0 0;font-size:12px;line-height:1.5;color:var(--ink);overflow-wrap:anywhere}
.draft-explained-actions>[data-draft-delete]{grid-column:1/-1;justify-self:end;min-height:44px;white-space:normal}
.draft-list>.draft-explained-action{max-width:34rem;margin:12px 0 18px}
@media(max-width:600px){.draft-explained-actions{grid-template-columns:minmax(0,1fr);gap:14px}.draft-explained-actions>[data-draft-delete]{width:100%}.draft-list>.draft-explained-action>.btn{width:100%}}
