/* Viewport-sized reading workspace; account and admin keep their own widths. */
:root{--editor-height:clamp(580px,calc(100dvh - 240px),1300px);--diff-add:color-mix(in srgb,var(--green) 22%,var(--paper));--diff-remove:color-mix(in srgb,var(--red) 22%,var(--paper))}
html[data-route=rewrite] .workspace{max-width:1920px;padding:0 clamp(20px,3vw,64px) 20px}
html[data-route=rewrite] .header-inner{max-width:1920px}
.hero{padding:20px 0}.hero h1{font-size:clamp(24px,2vw,32px);letter-spacing:-.7px}
.editor-shell{display:flex;flex-direction:column;height:var(--editor-height);border-radius:16px}
.editor-topbar{padding:12px 24px;min-height:52px;flex-shrink:0}.editor-meta{align-items:center}
.columns{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.editor-pane{display:flex;flex-direction:column;min-height:0}.pane-heading{height:58px;flex-shrink:0;padding:0 28px;gap:12px}.pane-heading h2{font-size:15px}
.editor-pane textarea{height:auto;min-height:0;flex:1;padding:8px 28px 28px;line-height:2;font-size:16px;overflow-wrap:anywhere;scrollbar-gutter:stable;letter-spacing:.15px}
.editor-pane #input{resize:none}.result-area{flex:1;min-height:0;display:flex;flex-direction:column}.result-area textarea{flex:1;width:100%}.pane-bottom{flex-shrink:0;padding:12px 28px;min-height:40px;font-variant-numeric:tabular-nums}
.editor-actionbar{flex-shrink:0;padding:15px 24px;gap:20px}.editor-actionbar .cost span{font-size:11px}.history-panel{margin-top:10px}
.result-tools{align-items:center;gap:12px!important}.diff-toggle{flex-direction:row;align-items:center;gap:8px;font-size:12px;color:var(--muted);white-space:nowrap;cursor:pointer}.diff-toggle input{appearance:none;width:30px;height:18px;min-width:30px;padding:0;margin:0;border:1px solid var(--line);border-radius:12px;background:var(--bg);position:relative;transition:background 100ms ease-out}.diff-toggle input:before{content:'';position:absolute;left:3px;top:3px;width:10px;height:10px;border-radius:50%;background:var(--muted);transition:transform 100ms ease-out,background 100ms ease-out}.diff-toggle input:checked{background:var(--brand);border-color:var(--brand)}.diff-toggle input:checked:before{transform:translateX(12px);background:var(--paper)}.diff-toggle input:focus-visible{outline:2px solid var(--brand);outline-offset:3px}.diff-toggle:has(input:disabled){opacity:.45;cursor:default}
.diff-output{flex:1;min-height:0;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;padding:8px 28px 28px;font-size:16px;line-height:2;letter-spacing:.15px;scrollbar-gutter:stable}.diff-output ins{background:var(--diff-add);color:var(--ink);text-decoration:none;box-decoration-break:clone}.diff-output del{background:var(--diff-remove);color:var(--ink);text-decoration:line-through;box-decoration-break:clone}.diff-output:focus-visible{outline:2px solid var(--brand);outline-offset:-3px}
html[data-focus-editor=true][data-route=rewrite] .hero,html[data-focus-editor=true][data-route=rewrite] .history-panel{display:none}html[data-focus-editor=true][data-route=rewrite] .workspace{padding-top:16px}html[data-focus-editor=true]{--editor-height:calc(100dvh - 118px)}
@media(max-width:760px){:root{--editor-height:auto}html[data-route=rewrite] .workspace{padding:0 12px 20px}.hero{padding:14px 0}.hero h1{font-size:23px}.hero h1 span{display:inline}.columns{display:flex;flex-direction:column;flex:none}.editor-pane{height:clamp(380px,60dvh,650px)}.editor-topbar{padding:10px 16px}.editor-meta{gap:4px}.pane-heading{padding:0 18px;height:56px}.editor-pane textarea,.diff-output{padding:6px 18px 20px;font-size:15px}.pane-bottom{padding:10px 18px}.editor-actionbar{padding:14px 16px;flex-wrap:wrap}.editor-actionbar .action-buttons{margin-left:auto}.result-tools{gap:4px!important}.result-tools .button{padding:8px}.diff-toggle{gap:5px}html[data-focus-editor=true]{--editor-height:auto}html[data-focus-editor=true] .editor-pane{height:75dvh}.editor-meta #balance{font-size:11px}}
@media(prefers-reduced-motion:reduce){.diff-toggle input,.diff-toggle input:before{transition:none}}
