/* Outside the document box, inherit the existing app's workspace.css. */
.staging-note{font-size:11px;line-height:1.6;color:var(--mut);margin:0 0 12px}
.wb-controls select{font:inherit;font-size:13px;color:var(--ink);padding:9px 12px;background:#fff;border:1px solid var(--bd2);border-radius:7px;max-width:190px}
/* The technical rewrite workspace remains scoped to these two panes. */
.wb-split{border:1px solid #ccc!important;background:#fff!important;border-radius:0!important;box-shadow:none!important;overflow:hidden}
.wb-split .ph{background:#f4f4f1!important;color:#777!important;font:10px ui-monospace,monospace!important;letter-spacing:.02em!important;border-bottom:1px solid #ddd!important;padding:9px 16px!important;min-height:0!important}
.wb-split #txt{font:14px/1.85 system-ui,sans-serif!important;background:#fff!important;color:#555!important;padding:22px 24px!important;height:650px!important;resize:none!important;border:0!important}
.wb-split .wb-pane+.wb-pane{border-color:#ccc!important}
@media(max-width:700px){.wb-split #txt{height:240px!important;min-height:200px!important;padding:18px!important}}
.staging-note{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:15px 0 0;font-size:10px;color:#879087}.staging-note select{font:11px system-ui;color:#667168;background:transparent;border:1px solid #d8ddd7;border-radius:4px;padding:5px 9px}.preview-signin{border:1px solid var(--bd2);border-radius:7px;background:white;padding:8px 14px;color:var(--ink)!important}.preview-analysis{white-space:pre-wrap;font:14px/1.85 system-ui,sans-serif;color:#555;padding:22px 24px;box-sizing:border-box;height:650px;overflow:auto}.pane-body>.journey[hidden],.rewrite-header-tools[hidden]{display:none!important}.wb-bar .journey-score{margin-left:0}.wb-bar .journey-score b{font-size:20px}.wb-bar .journey-score small{font:11px system-ui}.wb-bar .journey-score{font:12px system-ui}.wb-controls button:disabled{cursor:default;opacity:.5}@media(max-width:700px){.preview-analysis{height:400px}.staging-note{flex-wrap:wrap}}
.rewrite-header .journey-steps{flex-basis:auto;gap:12px}.rewrite-header .journey-toolbar{gap:8px}.rewrite-header .journey-views{margin-left:0}@media(max-width:700px){.rewrite-header .journey-steps{flex-basis:100%}.rewrite-header .journey-views{margin-left:auto}}

body:not(.embed) .wb-bar{padding:12px 20px}body:not(.embed) .wb-controls{gap:10px}.wb-controls>.wb-result{flex:1;min-width:0}.wb-controls .journey-score{display:flex;gap:4px;justify-content:flex-start;margin:0}.primary-actions{align-items:center;gap:8px;flex-shrink:0}.wb-controls #upl{display:grid;place-items:center;width:36px;height:36px;padding:7px!important;line-height:1}.wb-controls #upl svg{display:block}.wb-controls #upl:disabled{opacity:.55}@media(max-width:600px){body:not(.embed) .wb-bar{padding:10px 12px}.wb-controls>.wb-result{flex-basis:100%}.primary-actions{margin-left:auto}.wb-controls .journey-score{flex-wrap:wrap}}
.staging-det-status{margin-left:auto;font-size:.8rem;color:var(--mut,#777)}
.preview-analysis span{border-radius:2px}
@media(max-width:600px){.app-top{flex-wrap:wrap;gap:10px}.app-top .nav{display:flex!important;flex-wrap:wrap;gap:10px;justify-content:flex-end;width:100%}}
/* The default staging app is the release view, without experiment controls. */
.staging-note[hidden]{display:none!important}

/* Display-scale verdict stays beside the score; wraps on narrow screens. */
.wb-controls .journey-score{flex-wrap:wrap}
.journey-score .score-verdict{font:12px system-ui;margin:0 7px 0 3px;color:#425448}
.journey-score[data-band="uncertain"] .score-verdict{color:#826317}
.journey-score[data-band="uncertain"] .score-indicator{background:#a78029}
.journey-score[data-band="high"] .score-verdict{color:#9c3a35}

.detector-status{display:block;color:#666;font-size:12px;margin:4px 0;min-height:16px}.detector-status:empty{display:none}

.analysis-legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12px;margin:0 0 14px;color:#596458}.ai-key::before,.human-key::before{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px}.ai-key::before{background:#c36b60}.human-key::before{background:#6b9565}.journey-candidates{display:flex;align-items:flex-start;gap:10px}.journey-candidates[hidden]{display:none}.journey-candidates .journey-map{flex:1}.candidate-help{position:relative;flex:none;margin-top:8px;margin-right:12px;font:12px/1.5 system-ui}.candidate-help summary{cursor:pointer;list-style:none;border:1px solid #aab5a5;border-radius:50%;width:20px;height:20px;text-align:center}.candidate-help summary::-webkit-details-marker{display:none}.candidate-help p{position:absolute;right:0;top:18px;width:min(310px,75vw);background:#fff;border:1px solid #cbd3c5;border-radius:4px;padding:12px;box-shadow:0 4px 16px #0001;z-index:10;color:#354333}.app-top .nav{flex-wrap:wrap}

/* Compact scores align with the document columns. */
.analysis-legend{padding:14px 24px 0;margin-bottom:0}
body:not(.embed) .wb-bar.split-scorebar{display:grid;grid-template-columns:1fr 1fr;padding:0;border-radius:0;gap:0;border:1px solid #ccc;border-bottom:0;background:#fff}
.split-scorebar>.wb-controls{padding:12px 16px;min-width:0;margin:0;display:flex;flex-wrap:wrap;align-items:center}
.split-scorebar .rewrite-top-right{border-left:1px solid #ccc;padding:12px 16px;display:flex;align-items:center;min-width:0}
.split-scorebar .rewrite-top-score[hidden]{display:none}
.split-scorebar .journey-score{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:0;font:12px system-ui}
.split-scorebar .journey-score b{font:500 25px/1.2 system-ui;font-variant-numeric:tabular-nums;letter-spacing:-.6px}
.split-scorebar .journey-score small{font:11px system-ui;color:#777}
.split-scorebar .journey-score .score-verdict{font-size:11px}
.split-scorebar .journey-score[data-band=high] b{color:#9c3a35}.split-scorebar .journey-score[data-band=low] b{color:#386847}
.split-scorebar .primary-actions{margin-left:auto}
@media(min-width:701px){.wb-split .ph{min-height:48px!important;box-sizing:border-box}}
@media(max-width:700px){body:not(.embed) .wb-bar.split-scorebar{grid-template-columns:1fr}.split-scorebar .rewrite-top-right{border-left:0}.split-scorebar .rewrite-top-right:has(>[hidden]){display:none}.analysis-legend{padding-left:18px;padding-right:18px}}

/* Scores belong to the labelled document columns. */
.split-scorebar .journey-score>.score-indicator,.split-scorebar .journey-score>span:first-of-type,.split-scorebar .journey-score>small{display:none}
.wb-split .wb-pane:first-child .ph{display:flex;align-items:center;justify-content:space-between}
.wb-pane .ph #upl{display:grid;place-items:center;background:transparent;border:0;padding:4px;width:28px;height:28px;cursor:pointer;color:#687266}
.rewrite-retry-tip{font:12px/1.5 system-ui;color:#6e745f;padding:10px 24px;margin:0;background:#fafbf6;border-top:1px solid #e3e7dd}.rewrite-retry-tip[hidden]{display:none}
#rwBtn.pen-rewrite{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:158px;height:40px;transition:background .2s,border-color .2s;color:#fff}
body:not(.embed) #rwBtn.pen-rewrite.is-rewriting{background:#7b817d;border-color:#7b817d;color:#fff;opacity:1;cursor:progress}
.pen-rewrite .lines-icon{display:none;width:44px;height:28px;overflow:visible;flex:none}.pen-rewrite.is-rewriting .lines-icon{display:block}
.pen-rewrite .minimal-line{fill:none;stroke:#e9eee6;stroke-width:1.5;stroke-linecap:round;visibility:hidden}
.pen-rewrite .mono-pen{fill:#e9eee6;stroke:#e9eee6;stroke-width:.75;stroke-linejoin:round;stroke-linecap:round}.pen-rewrite .mono-pen path:last-child{fill:none;stroke:#7b817d;stroke-width:1}

/* One compact header row, with elapsed times beside the live status. */
.wb-split .rewrite-header{flex-wrap:nowrap!important;gap:10px;min-height:48px!important}
.rewrite-header:has(.rewrite-header-tools:not([hidden]))>span:first-child{display:none}
.rewrite-header .rewrite-header-tools{order:0;width:auto;flex:1;min-width:0;display:block}
.rewrite-header .rewrite-header-tools[hidden]{display:none!important}
.rewrite-header .rewrite-header-actions{order:1;align-self:center;margin-left:auto}
.rewrite-header .journey-toolbar{margin:0;padding:0;border:0;flex-wrap:nowrap;gap:0;order:0}
.rewrite-header .journey-toolbar .journey-steps,.rewrite-header .journey-toolbar.text-view .journey-steps{display:flex;flex-basis:auto;gap:10px;font-size:10px}
.journey-monitor .journey-wait{white-space:nowrap;flex:none;color:#777;font:10px ui-monospace,monospace}
.journey-monitor .journey-detail{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:480px){.wb-split .rewrite-header{padding-left:10px!important;padding-right:10px!important;gap:6px}.rewrite-header .journey-toolbar .journey-steps{gap:3px;font-size:9px}.rewrite-header-actions{gap:4px}.rewrite-header-actions button{padding:4px 5px!important;font-size:9px!important}.journey-monitor{padding:0 10px;gap:5px}}

.split-scorebar .rewrite-top-right{gap:12px;justify-content:space-between}.rewrite-top-right>#rwBtn{margin-left:auto;flex-shrink:0}.rewrite-top-right .rewrite-top-score{min-width:0}@media(max-width:700px){.split-scorebar .rewrite-top-right:has(>[hidden]){display:flex}.split-scorebar .rewrite-top-right{border-top:1px solid #e3e7dd}}

body:not(.embed) #rwBtn.pen-rewrite:not(.is-rewriting){background:#284b39;border-color:#284b39;color:white}body:not(.embed) #rwBtn.pen-rewrite:not(:disabled){opacity:1;cursor:pointer}

/* Reading and comparison share the same text treatment. */
.wb-split #txt,.preview-analysis,.journey-paper,.journey-reading{color:#414b43!important;font:14px/1.85 system-ui,sans-serif!important}
.rewrite-header .journey-toolbar .journey-steps,.rewrite-header .journey-toolbar.text-view .journey-steps{font-size:11px;color:#626b60}
.journey-monitor{font-size:12px;color:#596253}.journey-monitor .journey-wait{font-size:11px;color:#66715f}
.split-scorebar .journey-score .score-verdict{font-size:12px}
.rewrite-retry-tip{display:flex;gap:10px;align-items:center;flex-wrap:wrap;color:#596253}
.rewrite-retry-tip .use-result{background:transparent;border:0;padding:0;color:#284b39;font:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.rewrite-retry-tip .use-result:focus-visible{outline:2px solid #739f72;outline-offset:3px}

/* Status belongs inside the left grid cell, never a third toolbar column. */
.split-scorebar>.wb-controls>.detector-status{flex:0 0 100%;order:3;min-width:0;max-width:100%;margin:0;overflow-wrap:anywhere;white-space:normal;line-height:1.4}
.split-scorebar>.wb-controls>.detector-status:empty{display:none}

body:not(.embed) .wb-bar.split-scorebar{align-items:stretch}

/* Status occupies the space before Check text; the button stays anchored. */
.split-scorebar .wb-controls .primary-actions{margin-left:auto;display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0;flex:0 1 auto}
.split-scorebar .primary-actions>.detector-status{order:0;flex:0 1 auto;min-width:0;max-width:180px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
.split-scorebar .primary-actions>#go{flex:none}
.split-scorebar>.wb-controls{flex-wrap:nowrap}
@media(max-width:600px){.split-scorebar .wb-controls>.wb-result{flex-basis:auto}.split-scorebar .primary-actions>.detector-status{max-width:110px}}
/* Centre navigation text and give account controls matching dimensions. */
body:not(.embed) .app-top .nav{align-items:center}
body:not(.embed) .app-top .nav>a,body:not(.embed) .app-top .nav>.account-words{line-height:20px}
body:not(.embed) .app-top .nav>.account-words{font-size:13px;color:var(--mut)}
body:not(.embed) .app-top .nav>.preview-signin{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:36px;padding:0 12px;margin:0;font:400 13px/20px system-ui;white-space:nowrap}
body:not(.embed) .app-top .nav>.preview-signin[hidden]{display:none!important}
