/* R3 additions keep the approved light, restrained visual system. */
.stage-tabs{display:flex;align-items:center;gap:26px;margin:0 auto}.stage-tabs a{color:#767f8c;font-size:13px;padding:24px 3px;border-bottom:2px solid transparent}.stage-tabs a.active{color:#252a31;border-bottom-color:#292e38}.prep-shell{height:100vh;display:flex;flex-direction:column;background:#f5f5f7}.prep-toolbar{display:flex;align-items:center;gap:20px;padding:20px 28px;border-bottom:1px solid var(--line);background:#fcfcfd;flex:none}.prep-toolbar h2{font-size:20px}.prep-toolbar p{font-size:12px;color:#788393;margin-top:3px}.category-select{margin-left:auto;font-size:12px;color:#747f8e;display:flex;align-items:center;gap:12px}.category-select select{background:white;border:1px solid #dce1e8;border-radius:8px;padding:9px 12px;color:#3c4553;font-size:13px;min-width:190px}.prep-main{flex:1;min-height:0;display:grid;grid-template-columns:224px minmax(300px,38%) minmax(300px,1fr)}.module-panel{background:#f0f0f4;border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;padding:20px 14px}.module-panel h3{font-size:14px}.module-subtitle{font-size:11px;color:#818a98;line-height:1.7;margin:3px 0 17px}.module-list{overflow:auto;flex:1;min-height:0;display:flex;flex-direction:column;gap:7px}.module-item{display:flex;gap:10px;align-items:flex-start;padding:13px 10px;border:1px solid transparent;border-radius:9px;background:transparent;text-align:left;flex:none}.module-item.active{background:#fff;border-color:#e1e5ec;box-shadow:0 2px 7px #18223605}.module-item:hover{background:#fff9}.module-index{font-size:11px;color:#94a0b1;border:1px solid #dee2e9;padding:2px 4px;border-radius:4px}.module-item strong{font-size:13px;display:block;font-weight:500}.module-item small{font-size:10px;color:#858f9e;display:block;margin-top:6px}.module-bottom{padding-top:17px;border-top:1px solid #e0e1e6}.module-bottom p{font-size:11px;color:#8792a2;margin-top:10px;line-height:1.7}.module-editor{padding:28px;background:white;overflow:auto;min-height:0;border-right:1px solid var(--line)}.module-editor h2{font-size:21px;margin-top:6px}.module-order{gap:0}.module-order button{font-size:19px}.module-editor .field{margin-top:24px}.module-editor .field input{font-size:14px;min-height:40px}.module-editor .field textarea{font-size:14px;min-height:205px;height:205px;line-height:1.85;padding:13px}.field-help{font-size:12px;color:#8792a2;line-height:1.8;margin-top:10px}.module-image-head{margin:25px 0 13px}.module-images{display:grid;grid-template-columns:1fr 1fr;gap:12px}.module-images>.upload-box{grid-column:1/-1;min-height:165px}.module-image{border:1px solid #e4e7ed;border-radius:10px;position:relative;overflow:hidden;padding-bottom:8px}.module-image img{width:100%;height:135px;object-fit:contain;background:#f8f9fb;padding:8px}.module-image input{border:0;border-top:1px solid #ededf1;padding:7px 9px;width:100%;font-size:11px;background:#fff}.module-image .icon-button{position:absolute;top:4px;right:4px;background:#ffffffdc;width:25px;height:25px}.module-image small{font-size:10px;color:#8994a3;padding:3px 8px;display:block}.prep-honesty{display:flex;gap:6px;align-items:center;font-size:11px;color:#929baa;margin-top:27px;padding-top:15px;border-top:1px solid var(--line)}.prep-honesty .icon{width:14px;height:14px}.prep-preview-panel{display:flex;flex-direction:column;overflow:hidden;min-height:0;padding:22px 24px;background:#edeef2}.prep-preview-panel h3{font-size:14px}.prep-warnings{margin:14px 0 15px;font-size:12px;color:#96651d;background:#fff4e1;border-radius:8px;padding:10px 12px;max-height:160px;overflow:auto;flex:none}.prep-warnings:has(.ready-message){color:#52715f;background:#e7f1e9}.prep-warnings summary{cursor:pointer;font-weight:500}.prep-warnings button{display:block;border:0;background:transparent;padding:5px 0;color:#967641;font-size:11px;text-align:left;line-height:1.6}.prep-pages{overflow:auto;flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;gap:22px;padding:5px 12px 24px}.document-page{width:min(100%,320px);background:transparent;border:0;padding:0;color:#8a95a5}.document-page img{width:100%;background:#fff;box-shadow:0 4px 16px #1d293214;border:1px solid #e2e5eb;border-radius:3px;display:block}.document-page span{display:block;font-size:11px;margin-top:10px}.module-catalog{display:flex;gap:10px;flex-wrap:wrap}.module-catalog .button{font-size:12px}.simulation-label{background:#eef3fb;color:#4e6d96;padding:9px 12px;border-radius:8px;font-size:12px;margin:12px 0 18px;line-height:1.7}.ai-import-entry{padding:0 20px 11px;flex:none}.ai-import-entry .button{font-size:12px;min-height:30px;width:100%;border-color:#dde5ef;color:#5b7294}.ai-import-entry small{display:block;font-size:10px;color:#9aa3b1;margin-top:5px}.ai-polish-button{border:0;background:#edf3fd;color:#5379b1;border-radius:4px;padding:2px 6px;font-size:11px;min-height:20px}.ai-upload-actions{display:flex;gap:12px;margin-bottom:20px}.evidence-view{padding:15px;background:#f4f6fa;border:1px solid #e1e7ef;border-radius:11px;min-width:0}.evidence-view strong{font-size:13px}.evidence-tabs{display:flex;gap:6px;overflow:auto;margin:10px 0}.evidence-tabs button{white-space:nowrap;border:1px solid #d9e1eb;border-radius:6px;background:white;padding:4px 8px;color:#8591a3;font-size:10px}.evidence-tabs button.active{color:#3c6396;border-color:#9db7dc}.evidence-view canvas{display:block;width:100%;max-height:350px;object-fit:contain;background:#e9edf3;border-radius:6px;touch-action:none}.evidence-tools{gap:8px;margin:10px 0}.evidence-tools .button{font-size:11px;padding:5px 8px;min-height:29px}.evidence-view p{font-size:11px;line-height:1.7}.ai-review-grid{display:grid;grid-template-columns:40% minmax(0,1fr);gap:18px;align-items:start}.candidate-list{display:flex;flex-direction:column;gap:14px}.candidate{border:1px solid #e1e6ef;border-radius:10px;padding:15px;background:white}.candidate strong{font-size:14px}.candidate-source{font-size:11px;line-height:1.8;color:#8591a2;margin:4px 0 10px}.candidate-uncertain{font-size:12px;padding:10px;background:#fff4df;color:#946b25;border-radius:7px;line-height:1.8;margin:10px 0}.candidate .field{margin-top:10px}.candidate .field textarea{height:68px;min-height:68px}.candidate .dialog-check{font-size:11px;line-height:1.7;margin-top:9px}.polish-comparison{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:20px 0}.polish-comparison section{border:1px solid #e2e6ed;border-radius:10px;padding:18px;background:#fafbfd;min-height:170px}.polish-comparison section:last-child{background:#f2f6fd;border-color:#dce7f7}.polish-comparison h3{font-size:13px;color:#73849d}.polish-comparison p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.9;margin-top:12px}.ai-tone{background:#ecedf1}.color-picker{display:flex;gap:10px;margin:18px 0}.color-picker button{display:flex;align-items:center;gap:7px;border:1px solid #e2e5eb;border-radius:7px;background:white;padding:7px 10px;font-size:12px;color:#697487}.color-picker button.active{border-color:#798ea9;background:#f4f6f9}.color-picker i{display:inline-block;width:13px;height:13px;background:var(--swatch);border-radius:50%}.geometry-adjust{padding:15px 0;border-bottom:1px solid var(--line)}.geometry-adjust h3{font-size:13px}.geometry-adjust p{font-size:11px;margin-top:8px}.geometry-adjust .field{margin-top:8px}.geometry-adjust input{width:100%}.geometry-adjust .row>label{flex:1}.arrow-coordinates{display:grid;grid-template-columns:1fr 1fr;gap:7px}.canvas-advanced{gap:2px}.canvas-advanced .button{padding-left:8px;padding-right:8px;font-size:11px}.tool-rail button[data-tool=rect] .icon{color:#c84943}.work-tabs{gap:18px}.prep-preview-panel #prep-page-count{font-size:11px}.prep-shell #prep-page-count{white-space:nowrap}
@media(max-width:1400px){.prep-main{grid-template-columns:206px minmax(300px,37%) minmax(280px,1fr)}.module-editor{padding:22px}.prep-toolbar{padding:17px 22px}.module-editor .field textarea{height:180px;min-height:180px}.prep-preview-panel{padding:19px}.module-images{gap:8px}.prep-toolbar h2{font-size:18px}.category-select{gap:8px}.category-select select{min-width:165px}.work-tabs{gap:12px}.canvas-top{padding-left:20px;padding-right:14px}.ai-import-entry{padding-bottom:8px}.module-panel{padding:18px 12px}}
.issue-tabs{align-items:center}.issue-tabs input{width:91px;min-width:0;margin-left:auto;border:1px solid #e1e6ed;background:#fafbfd;border-radius:5px;font-size:11px;padding:3px 5px;color:#67768c;align-self:flex-start}.ai-review-grid .evidence-view{position:sticky;top:0}
.document-page{width:min(100%,500px)}.preflight-expanded img{width:100%;max-height:none}.evidence-view canvas{width:auto;max-width:100%;height:auto;max-height:350px;margin:0 auto;object-fit:fill}
.share-image{margin:3px 8px 4px;border:0;background:#eef3fa;color:#647f9f;border-radius:4px;padding:3px 5px;font-size:10px}

/* R4: direct manipulation and content-aware list sizing. */
#annotation-controls{position:absolute;left:0;top:0;z-index:3;pointer-events:none;overflow:visible}.canvas-paper{position:relative}.issue-list{max-height:none;min-height:64px;padding-bottom:4px}.issue-item{min-height:54px}.issue-divider{flex:none;height:14px;display:flex;align-items:center;justify-content:center;position:relative;cursor:row-resize;touch-action:none;border-top:1px solid #e7e9ed;border-bottom:1px solid #edf0f4;background:#fafbfd;user-select:none}.issue-divider>span{height:3px;width:32px;border-radius:2px;background:#c1cad6}.issue-divider small{font-size:10px;position:absolute;right:18px;color:#8a95a4}.issue-divider:hover,.issue-divider:focus-visible{background:#eaf1fc}.issue-panel .editor{min-height:220px}.geometry-adjust summary{cursor:pointer;font-size:13px;color:#5f7188}.geometry-adjust h3{margin-top:12px}
.structured-block{border:0;padding:0;margin:26px 0 0}.structured-block legend{font-size:15px;font-weight:600;color:#3a4b60}.structured-block>p{font-size:12px;line-height:1.8;color:#8592a3;margin:9px 0 15px}.structured-fields{display:grid;grid-template-columns:1fr 1fr;gap:13px}.structured-field{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#66778d;min-width:0}.structured-field.wide{grid-column:1/-1}.structured-field input,.structured-field textarea{border:1px solid #dbe2ec;border-radius:7px;min-height:39px;padding:9px;font-size:14px;line-height:1.65;min-width:0;width:100%;background:#fff;color:#283d56}.structured-field textarea{min-height:85px;resize:vertical}.structured-field input::placeholder,.structured-field textarea::placeholder{color:#9aa5b3}.structured-table{margin-top:26px}.structured-table h3{font-size:14px}.structured-row{margin-top:12px;border:1px solid #e0e6ee;background:#fafbfd;border-radius:10px;padding:14px}.structured-row strong{font-size:12px;color:#7890ae}.structured-row .structured-fields{margin-top:10px}.structured-row .icon-button{height:24px;width:24px}.module-editor #module-note{min-height:95px;height:95px}.image-role{display:flex;align-items:center;gap:7px;font-size:11px;color:#7c8ca1;padding:5px 9px}.image-role select{max-width:calc(100% - 60px);border:1px solid #e0e6ef;border-radius:5px;font-size:12px;padding:3px;background:white}.module-image .image-role+input{font-size:12px}.module-image img{height:150px}.prep-toolbar p{color:#6e7f94}.module-editor .field-help{color:#778aa1}
.canvas-viewport{justify-content:safe center;align-items:safe center}

/* R5 compact contextual options occupy their own row, outside artwork. */
.tool-options{flex:none;min-height:42px;display:flex;align-items:center;gap:12px;padding:4px 24px 6px 82px;border-bottom:1px solid #e2e5eb;background:#f5f5f7}
.tool-option-label,.tool-option-hint{font-size:12px;color:#647183;white-space:nowrap}
.tool-option-label{min-width:40px}
.quick-colors{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}
.quick-colors button{flex:none;width:26px;height:26px;border:1.5px solid transparent;background:transparent;border-radius:50%;padding:3px;display:grid;place-items:center}
.quick-colors button i{display:block;width:16px;height:16px;border-radius:50%;background:var(--swatch);border:1px solid #00000009}
.quick-colors button.active{border-color:var(--swatch);background:white}
.quick-colors button:hover{background:#fff}
.pen-modes button{min-height:28px;font-size:12px;padding:3px 10px}
.tool-rail button[data-tool] .icon{color:inherit}
.tool-option-hint{margin-left:auto;font-size:11px}

/* Keep image-to-mouse mapping stable when blank selection reveals options mid-drag. */
.tool-options{display:grid;grid-template-columns:105px minmax(0,1fr) auto;height:64px;min-height:64px;gap:8px}
.tool-option-label{white-space:normal;overflow-wrap:anywhere}
.tool-option-hint{display:none}
@media(max-width:700px){.tool-options{grid-template-columns:65px minmax(0,1fr);height:118px;min-height:118px;padding:6px 12px;gap:6px}.tool-options .tool-option-label{align-self:start;padding-top:5px}.tool-options .pen-modes{grid-column:2;justify-self:start}}
.tool-options[hidden]{display:flex!important;visibility:hidden}

/* R5.1 professional fields stay in the editor, not over the preview. */
.field-status-options { margin:12px 0; padding:10px; border:1px solid #e2e6e2; border-radius:12px; }
.field-status-options summary { cursor:pointer; font-size:13px; color:#56665c; }
.field-status-options .field { margin-top:10px; }
.image-ref { font-size:12px; margin:4px 0; }
.prep-toolbar { flex-wrap:wrap; }
