/* Approved Onebook UX v2, adapted to the existing server-rendered application. */
:root{--bg:#faf9f7;--paper:#fff;--ink:#3f4751;--graphite:#3f4751;--muted:#626972;--line:#dcdedc;--accent:#c82f50;--accent-hover:#ab2542;--selected:#eeefed;--radius:16px;--shadow:none;--focus:#714555;color-scheme:light}
html{font-size:100%;scroll-padding-block:24px}
body{font-size:18px;line-height:1.55;background:var(--bg);color:var(--ink)}
.shell,body[data-screen] .shell{width:calc(100% - 80px);max-width:1280px}
h1,body[data-screen] h1{font-size:48px;line-height:1.12;letter-spacing:-.025em;overflow-wrap:anywhere}
h2,body[data-screen] h2{font-size:28px;line-height:1.3;letter-spacing:-.012em}
h3,body[data-screen] h3{font-size:22px;line-height:1.35}
.lead,body[data-screen] .lead{font-size:20px;line-height:1.55;max-width:70ch}
.help,.small,.muted.small,.required,.eyebrow,.badge,.quiet-link,.text-button,.save-status,.previous-note,.sample-explanation,.metadata-suggestion p,.input-formats,.source-promise,.version,.local-badge{font-size:16px;line-height:1.55}
button,input,select,textarea{font:inherit}
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),select,textarea{font-size:18px;line-height:1.5;padding:12px 14px;border-radius:8px;min-height:52px;max-width:100%}
input[type=checkbox],input[type=radio]{accent-color:var(--graphite);width:22px;height:22px;flex-shrink:0}
textarea{resize:vertical;min-height:120px}
label{font-size:18px;line-height:1.5}
.field label{margin-bottom:8px}.field .help{display:block;margin-top:8px}
.btn,body[data-screen] .btn{min-height:52px;padding:13px 22px;font-size:18px;line-height:1.4;border-radius:9px;white-space:normal}
.btn.secondary{background:#fff;color:var(--graphite);border-color:#b6babd}
.text-button,.quiet-link{min-height:44px;line-height:1.5}.text-button{padding:10px 0}
:is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid var(--focus);outline-offset:4px}
.panel,.upload-card,.analysis-card,.source-strip{border-radius:16px;box-shadow:none}
.panel{padding:30px}.field-grid{gap:20px 24px}.field-grid.three{gap:20px}
.header-right a[href="/history"],.history-return,.book-return-links a {display:inline-flex;align-items:center;min-height:44px;text-decoration:underline;text-underline-offset:.2em}
.book-return-links {display:flex;flex-wrap:wrap;gap:8px 24px}
body[data-screen=review] .actionbar .quiet-link {display:inline-flex;align-items:center;min-height:44px;margin-inline-end:16px}
.header-inner{min-height:110px;gap:24px;align-items:center}.brand{gap:16px}.brand-mark{width:72px}.wordmark{font-size:18px;letter-spacing:.22em}.brand-product{font-size:16px}.header-right{flex-wrap:wrap;justify-content:flex-end;gap:12px 24px}.version{color:var(--muted)}
.site-header{background:var(--bg)}.site-footer{padding-top:28px;padding-bottom:32px;margin-top:64px;font-size:16px;line-height:1.5}
.stepper{margin-block:34px 48px}.stepper ol{gap:28px}.stepper li{font-size:17px}.step-number{width:32px;height:32px;font-size:16px}
.page-heading{margin-bottom:32px}.page-heading .eyebrow{margin-bottom:14px}.page-heading .lead{margin-top:16px}
.disclosure summary{font-size:19px;line-height:1.5;min-height:52px;padding-block:14px}.disclosure-body{font-size:18px;line-height:1.6}.disclosure-body .help{font-size:16px}
.message{font-size:18px;line-height:1.55;padding:22px 24px;border-radius:12px}.message h2{font-size:24px}.message p{overflow-wrap:anywhere}
/* Actions remain in document flow: large text, zoom and a phone keyboard cannot cover fields. */
.actionbar,body[data-screen] .actionbar{position:static;bottom:auto;box-shadow:none;background:transparent;border:0;border-top:1px solid var(--line);border-radius:0;padding:28px 0;margin:36px 0 0;gap:24px;align-items:center}
.actionbar .save-status{font-size:16px}.actionbar p{display:block}.actionbar-left{gap:14px 24px;flex-wrap:wrap}.actionbar .btn{font-size:18px}.actionbar .quiet-link{font-size:18px}
.source-strip strong,.analysis-file strong{overflow-wrap:anywhere}.source-strip .muted{font-size:16px}.source-strip{padding:20px 24px;gap:20px}
.structure-toolbar{gap:18px;flex-wrap:wrap}.structure-row{padding:24px 0;gap:26px}.row-text{font-size:20px;line-height:1.55;overflow-wrap:anywhere}.paragraph-position,.row-warning,.diagnostic-row-note,.filter-count{font-size:16px;line-height:1.5}.role-field{flex:0 0 260px}.role-field select{width:100%}.structure-row[data-role=h2] .row-content{padding-left:24px}.context-current{font-size:22px;line-height:1.6}.context-muted{font-size:18px;line-height:1.6}.search-hit{gap:16px;font-size:18px}
dialog{border-radius:16px;padding:28px;max-width:calc(100% - 32px);max-height:calc(100dvh - 32px);overflow:auto}.dialog-head{gap:24px}.dialog-head h2{font-size:26px}.dialog-actions{gap:16px}
.build-panel{padding:40px;max-width:900px;margin:32px auto}.build-status{font-size:22px}.build-meter strong{font-size:80px}.build-meter span,.build-times .help{font-size:16px}.build-stages{font-size:18px;line-height:1.8}.build-panel progress{height:14px}
.result-heading{align-items:flex-start;gap:40px}.result-heading h1{font-size:48px}.result-heading .lead{font-size:22px}.book-spec{font-size:18px;line-height:1.6}.download-actions{gap:12px}.download-actions .help{font-size:16px}.result-toolbar{gap:20px 30px;flex-wrap:wrap;margin:28px 0 36px}.result-toolbar .quiet-link{font-size:18px}.result-viewer{margin-top:32px}.result-paper-stage{padding:32px;background:#eeefec;border-radius:12px}.result-paper-stage #book-open{width:min(480px,100%)}.current-page-placeholder{width:min(480px,100%);font-size:18px}.page-picker{font-size:18px;gap:12px}.page-picker input{width:100px}.viewer-controls{gap:18px}.zoom-hint{font-size:16px}.thumb-number,.thumb-placeholder,.thumb-retry{font-size:16px}.page-gallery .page-thumbs{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:20px 16px}.page-gallery h3{font-size:24px}.result-bottom-grid{grid-template-columns:minmax(0,1fr);gap:24px}.result-summary-group h3{font-size:20px}.report-summary{font-size:18px}.book-dialog .viewer-controls{position:static;flex-wrap:wrap}.large-page-placeholder{font-size:18px}
.history-list{padding:0 28px}.history-item{padding:24px 0;gap:24px}.history-item strong{font-size:22px;line-height:1.45;overflow-wrap:anywhere}.history-item p,.history-item .badge{font-size:16px}.history-heading{gap:24px}
.report-summary dt{font-size:16px;line-height:1.5}.report-summary dd{font-size:18px;line-height:1.5}.source-strip .muted{font-size:16px}
@media(max-width:1050px){.brand-product,.local-badge{display:none}.header-inner{gap:16px}.result-heading{gap:24px}.role-field{flex-basis:230px}}
@media(max-width:700px){
 .shell,body[data-screen] .shell{width:calc(100% - 32px)}
 h1,body[data-screen] h1,.result-heading h1{font-size:34px;line-height:1.15}h2,body[data-screen] h2{font-size:26px}h3,body[data-screen] h3{font-size:22px}.lead,body[data-screen] .lead{font-size:19px}
 .header-inner{min-height:96px;padding-block:20px;flex-wrap:wrap;align-items:center;gap:14px}.brand-mark{width:56px}.wordmark{font-size:16px}.header-right{gap:10px 22px;justify-content:flex-start}.header-right .quiet-link{font-size:16px}.version{font-size:16px}.site-footer{font-size:16px;gap:12px;margin-top:48px}
 .stepper{margin-block:24px 32px}.stepper ol{gap:8px}.stepper li{font-size:14px}.step-number{width:30px;height:30px;font-size:15px}.stepper a,.step-label{gap:8px}.stepper .step-label,.stepper a{white-space:normal}
 .panel{padding:24px 18px}.field-grid,.field-grid.three{grid-template-columns:minmax(0,1fr);gap:20px}.source-strip{padding:20px 18px;gap:12px}.source-strip>a{margin-left:0}.source-strip>div{min-width:0;flex-basis:calc(100% - 50px)}
 .actionbar,body[data-screen] .actionbar{flex-direction:column;align-items:stretch;padding:24px 0;margin:28px 0 0;gap:20px}.actionbar-left{align-items:flex-start;flex-direction:column;gap:14px}.actionbar .btn{width:100%}.actionbar .save-status{font-size:16px}.actionbar p{display:block}.actionbar .btn{font-size:18px;padding:14px 20px}
 .structure-row{flex-direction:column;gap:18px}.row-text{font-size:19px}.role-field{flex-basis:auto;width:100%}.structure-row[data-role=h2] .row-content{padding-left:12px}.structure-toolbar select{width:100%}
 .build-panel{margin:20px 0;padding:28px 18px}.build-meter strong{font-size:68px}.build-panel h1{font-size:32px}.build-stages{font-size:17px}
 .result-heading{flex-direction:column;gap:24px}.download-actions{width:100%;align-items:stretch}.download-actions .btn{width:100%}.download-actions .help{text-align:left;max-width:none}.result-toolbar{gap:14px 20px}.result-paper-stage{padding:14px}.page-picker{gap:8px;font-size:16px}.page-picker input{width:76px}.viewer-controls{gap:10px}.page-gallery .page-thumbs{grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:16px 12px}.thumb-placeholder{font-size:15px;padding:4px}.thumb-number,.thumb-retry{font-size:16px}.history-list{padding:0 18px}.history-item{align-items:flex-start;flex-wrap:wrap;gap:12px}.history-item strong{font-size:20px}.history-item .badge{max-width:none;font-size:16px}.history-heading{align-items:flex-start;flex-direction:column}
 dialog{padding:22px 18px;max-height:calc(100dvh - 16px);max-width:calc(100% - 16px)}.dialog-head h2{font-size:24px}.dialog-actions{flex-direction:column}.dialog-actions .btn{width:100%}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
