/* Keep navigation and save controls outside the review form's scroll area. */
.model-annotation-review,.model-annotation-review fieldset,.model-annotation-review label,.model-annotation-review .row>*{min-width:0;box-sizing:border-box}
.model-annotation-review input:not([type=checkbox]),.model-annotation-review select{max-width:100%;min-width:0}
.model-annotation-review-head{position:relative}
.compact-layout .model-annotation-review-head .model-review-more{position:static}
.compact-layout .model-annotation-review-head .model-review-more>div{left:0;right:0;width:auto;max-width:100%;top:100%;max-height:45dvh;overflow:auto;box-sizing:border-box}
.opening-view-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0}
.opening-view-actions small{flex-basis:100%;color:var(--ui-text-secondary)}
.direction-definition{background:var(--ui-surface-soft);padding:8px;border-radius:6px;line-height:1.6}
.review-delete-menu{position:relative;align-self:center}
.review-delete-menu>button{position:absolute;bottom:100%;right:0;white-space:nowrap;z-index:20;box-shadow:0 2px 8px rgba(var(--ui-text-rgb), 0.1882)}
.login-card label{display:grid;gap:6px;text-align:left}
.image2-workflow-shell:has(.review-workbench) > .ui-navbar{display:none}
.image2-workflow-shell:has(.review-workbench) > .draft-presence-banner{display:none}
.unified-workbench.review-workbench{grid-template-columns:minmax(0,1.4fr) minmax(340px,1fr);grid-template-rows:auto minmax(0,1fr);height:calc(100dvh - 88px);min-height:420px;gap:10px;align-items:stretch}
.review-workbench > .unified-mode-bar{display:none}
.review-workbench > .ui-workflow-guide{grid-area:1/1/2/3;padding:6px 10px;gap:6px}
.review-workbench > .ui-workflow-guide span{font-size:12px}
.review-workbench > .model-annotation-review{grid-area:2/2/3/3;display:flex;flex-direction:column;min-height:0;max-height:none;overflow:auto;padding:10px;gap:8px}
.unified-workbench.review-workbench .unified-map-panel{grid-area:2/1/3/2;position:static;height:100%;min-height:0;padding:8px;display:flex;flex-direction:column;overflow:hidden}
.unified-workbench.review-workbench .unified-map-stage,.unified-workbench.review-workbench .unified-map-stage .canvas-stage,.unified-workbench.review-workbench .unified-map-stage .canvas-viewport{height:100%;min-height:0;flex:1}
.review-workbench .model-annotation-review-head{display:flex;align-items:center;gap:8px;flex-shrink:0;margin:0;padding:0}
.review-workbench .model-annotation-review-head h3{margin:0;flex:1;font-size:16px}
.model-review-more{position:relative;font-size:12px}
.model-review-more>div{position:absolute;right:0;top:100%;width:165px;padding:10px;display:grid;gap:8px;background:white;border:1px solid var(--ui-border);border-radius:6px;z-index:12;box-shadow:0 4px 16px rgba(var(--ui-text-rgb), 0.1255)}
.model-review-categories{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;flex-shrink:0}
.model-review-categories button{padding:5px;min-height:32px;background:var(--ui-bg);border:1px solid var(--ui-border);color:var(--ui-primary);white-space:normal}
.model-review-categories button[aria-pressed=true]{background:var(--ui-primary);border-color:var(--ui-primary);color:white}
.model-review-categories small{color:inherit}
.model-review-scroll{flex:1;min-height:180px;overflow:auto;overscroll-behavior:contain;padding-right:4px;display:flex;flex-direction:column;gap:8px}
.model-review-scroll > *{flex-shrink:0}
.model-review-scroll .subtle-banner{padding:8px;gap:5px;margin:0}
.model-review-scroll .subtle-banner[aria-label="当前待办"]>span:last-child{display:none}
.review-workbench .model-annotation-review-grid{gap:8px}
.review-workbench .model-annotation-object-list{display:flex;flex-wrap:wrap;gap:5px;padding:6px;max-height:112px}
.review-workbench .model-annotation-object{width:auto;flex:1 0 100px;padding:5px 8px;gap:6px}
.review-workbench .model-annotation-editor{padding:8px;gap:8px}
.model-review-footer{flex-shrink:0;display:grid;gap:7px;padding-top:8px;border-top:1px solid var(--ui-border);background:white}
.review-workbench .model-review-footer .model-annotation-actions{position:static;border:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:6px}
.model-review-footer>button{width:100%;background:var(--ui-surface-soft);border:1px solid var(--ui-primary-border);color:var(--ui-primary)}
.model-review-footer p{margin:0}
.review-workbench button{min-height:32px;padding:5px 9px}
.review-workbench input[type=range]{width:100%;min-width:0}
.review-workbench .unified-map-panel>.section-head{margin:0 0 6px;align-items:center;gap:8px}
.review-workbench .unified-map-panel>.section-head>div:first-child{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.review-workbench .unified-map-panel>.section-head>div:first-child>.tag{display:none}
.review-workbench .unified-map-panel>.section-head h3{font-size:14px;margin:0}
.review-workbench .unified-map-panel>.section-head .tag{font-size:11px;padding:3px 6px}
@media(max-width:850px){
 .review-workbench > .ui-workflow-guide span{display:none}
 .unified-workbench.review-workbench{grid-template-columns:minmax(0,1fr) minmax(280px,1fr)}
}
@media(max-width:580px){
 .unified-workbench.review-workbench{height:auto;min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:auto 300px minmax(460px,70dvh)}
 .review-workbench > .ui-workflow-guide{grid-area:1/1/2/2}
 .unified-workbench.review-workbench .unified-map-panel{grid-area:2/1/3/2}
 .review-workbench > .model-annotation-review{grid-area:3/1/4/2;overflow:hidden}
 .review-workbench button{min-height:36px}
}
@media(min-width:581px) and (max-height:600px){
 .unified-workbench.review-workbench{height:calc(100dvh - 52px);min-height:300px}
 .model-review-categories{grid-template-columns:repeat(3,minmax(0,1fr))}
 .review-workbench > .model-annotation-review{padding:6px;gap:5px}
 .review-workbench button{min-height:28px;padding:3px 6px;font-size:12px}
 .model-review-footer{padding-top:4px;gap:4px}
}
/* Four focused review steps; secondary controls stay outside the working area. */
.compact-layout .review-context-row,.compact-layout .review-value-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.compact-layout .review-area-filter{display:flex;align-items:center;gap:8px;font-size:12px}
.compact-layout .review-area-filter select{flex:1;width:auto;min-height:30px;padding:4px 7px}
.compact-layout .review-four-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.compact-layout .review-four-steps button{display:grid;gap:2px;text-align:left;background:var(--ui-surface-soft);color:var(--ui-primary);border:1px solid var(--ui-border);padding:6px 8px;min-height:44px}
.compact-layout .review-four-steps button[aria-current=step]{border-color:var(--ui-primary);background:var(--ui-primary-soft);box-shadow:inset 0 -2px var(--ui-primary)}
.compact-layout .review-four-steps small{font-size:11px;font-weight:400}
.compact-layout .review-four-steps .ready{color:var(--ui-success)}.compact-layout .review-four-steps .missing{color:var(--ui-danger)}
.compact-layout .review-step-editor{display:grid;gap:10px;padding:12px;background:var(--ui-surface-soft);border:1px solid var(--ui-border);border-radius:7px}
.compact-layout .review-step-editor h4{display:flex;align-items:center;gap:7px;margin:0;font-size:14px}
.compact-layout .review-step-editor p{margin:0;font-size:12px}
.compact-layout .review-step-editor label{font-size:12px}
.compact-layout .review-step-editor fieldset{margin:0;min-width:0}
.compact-layout .review-role-options{display:flex;gap:8px;flex-wrap:wrap}
.compact-layout .review-role-options label{display:inline-flex;gap:4px;align-items:center;min-width:62px}
.compact-layout .review-role-options input{margin:0}
.compact-layout .review-step-navigation{display:flex;justify-content:space-between;gap:6px}
.compact-layout .review-save-actions{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px}
.compact-layout .model-review-more>div{width:min(310px,70vw);max-height:55dvh;overflow:auto;z-index:50}
.compact-layout .model-review-more p{font-size:12px;margin:6px 0}
.compact-layout .model-review-more label{font-size:12px}
.compact-layout .model-annotation-object-list:empty{display:none}
.compact-layout .model-correction-message{font-size:12px;padding:6px 8px}
.compact-layout:has(.review-workbench) .layout-editor-launch{display:none}
.compact-layout .review-step-editor .model-required.complete{border:1px solid var(--ui-primary-border);border-radius:5px;padding:8px;background:var(--ui-surface-soft)}
/* Content-sized review card: primary actions immediately follow the current step. */
.compact-layout .review-workbench > .model-annotation-review{align-self:start;height:auto;max-height:100%;gap:6px}
.compact-layout .review-workbench .model-review-scroll{flex:0 1 auto;gap:6px}
.compact-layout .review-workbench .model-review-footer{margin-top:0;padding-top:8px;gap:6px}
.compact-layout .review-step-editor{padding:10px;gap:8px}
.compact-layout .review-four-steps.door-steps{grid-template-columns:repeat(2,minmax(0,1fr))}
.compact-layout .door-bed-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.compact-layout .door-bed-options label{display:flex;align-items:center;gap:7px;border:1px solid var(--ui-border);border-radius:5px;padding:7px;background:#fff}
.compact-layout .door-bed-options small{display:block;color:var(--ui-muted);font-size:11px}
.compact-layout .review-missing-action{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 8px;border:1px solid #ce5151;border-radius:5px;background:var(--ui-danger-soft);font-size:12px;color:var(--ui-danger)}
.compact-layout .review-save-actions>button:first-child{font-weight:700;min-height:36px}
.compact-layout .unified-workbench.review-workbench>.model-annotation-review{height:auto;align-self:start;max-height:100%}
@media(max-width:580px){
 .compact-layout:has(.review-workbench) .floating-operation-guide:not([style]){top:8px;bottom:auto;left:8px;width:240px}
 .compact-layout:has(.review-workbench) .floating-operation-guide:not([style]) .floating-guide-content{top:calc(100% + 5px);bottom:auto}
}

.compact-layout .bed-residents{margin:0;padding:7px 9px;border-radius:6px;flex-shrink:0;min-width:0;font-size:12px}
.compact-layout .bed-residents .row{gap:5px 9px}
.compact-layout .bed-residents .row>label{display:inline-flex;align-items:center;gap:3px;white-space:nowrap;font-size:12px}
.compact-layout .bed-residents input{margin:0;width:14px;height:14px}
.compact-layout .bed-residents select{width:auto;min-height:29px;font-size:12px;padding:3px 6px}
.compact-layout .resident-frame-actions{display:flex;flex-wrap:wrap;gap:5px;margin:5px 0}
.compact-layout .resident-frame-actions button{font-size:12px;min-height:30px;padding:4px 8px}
.compact-layout .resident-0{border-color:var(--ui-info-text);color:var(--ui-info-text)}
.compact-layout .resident-1{border-color:#a24db5;color:#a24db5}
.compact-layout .review-step-editor[aria-label="确定收口"]>label{display:grid;grid-template-columns:82px minmax(0,1fr);align-items:center;gap:6px}
.compact-layout .review-step-editor[aria-label="确定收口"]>label select{min-height:30px;padding:4px 6px;font-size:12px}
@media(max-width:850px){
 .compact-layout .unified-workbench.review-workbench>.model-annotation-review{height:auto;max-height:none;overflow:visible}
 .compact-layout .unified-workbench.review-workbench .model-review-scroll{overflow:visible;max-height:none;flex:0 0 auto}
 .compact-layout .unified-workbench.review-workbench .model-review-footer{position:sticky;bottom:0;z-index:5;background:#fff}
}

@media(min-width:851px){
.compact-layout .model-review-categories{grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
.compact-layout .model-review-categories button{font-size:11px;padding:5px 2px;min-height:32px;white-space:nowrap}
.compact-layout .model-annotation-review:has(.review-four-steps) .review-context-row,.compact-layout .model-annotation-review:has(.review-four-steps) .review-area-filter{display:none}
.compact-layout .review-four-steps button{padding:5px 7px;min-height:40px;gap:2px}
.compact-layout .model-annotation-object-list .model-annotation-object{min-height:30px;padding:5px 7px}
}

.compact-layout .review-four-steps{grid-template-columns:repeat(var(--review-steps,4),minmax(0,1fr))}
.compact-layout .review-four-steps:has(>button:only-child){grid-template-columns:1fr}
.compact-layout .review-step-editor .row>select[aria-label="补框收口类型"]{width:72px;min-height:30px;padding:4px;font-size:12px}
@media(min-width:851px){.compact-layout .model-review-categories{grid-template-columns:repeat(7,minmax(0,1fr))}.compact-layout .model-review-categories button{font-size:10px;padding:5px 1px}}

.review-room-complete{padding:10px;background:var(--ui-surface-soft);border:1px solid var(--ui-primary-border);border-radius:8px;display:grid;gap:8px}.review-room-actions{display:flex;gap:8px}.review-room-actions button{flex:1;min-height:34px}.review-room-complete small{color:var(--ui-text-secondary);font-size:12px}.review-room-complete details{font-size:12px}.review-room-complete details button{margin:6px 6px 0 0}

.room-count-form{padding:12px;display:grid;gap:10px}.room-count-form h4,.room-count-form p{margin:0}.room-count-form input{max-width:140px}.room-count-form label{display:flex;align-items:center;gap:12px}.room-count-bar{display:flex;align-items:center;justify-content:space-between;padding:4px 0;font-size:12px;gap:8px}.room-count-bar button{font-size:11px;min-height:26px;padding:3px 7px}.room-count-warning{color:var(--ui-danger);background:var(--ui-danger-soft);padding:8px;border-radius:6px}

.ui-dialog:has(.room-count-form){width:min(430px,calc(100vw - 24px))}.ui-dialog .room-count-form{padding:0;gap:14px}.ui-dialog .room-count-form h4{font-size:16px;line-height:1.6}.ui-dialog .room-count-form input{font-size:16px;min-height:36px}.ui-dialog .room-count-form .row button{flex:1;min-height:36px}

@media(min-width:851px){.compact-layout .model-review-categories button{font-size:11px}}
/* Compact, actionable validation stays next to the workflow without a tall banner. */
.compact-progress-bar .input-issues-toolbar {order:3;display:flex;align-items:center;gap:6px;flex:1 1 320px;min-width:0;max-width:680px;margin-left:auto;}
.input-issues-toolbar button {min-height:30px;padding:5px 9px;font-size:12px;line-height:1.4;border:1px solid var(--ui-border,#cfdddd);background:var(--ui-soft,#eef5f5);color:var(--ui-text,#35565a);box-shadow:none;}
.input-issues-toolbar .input-issue-first {display:flex;gap:10px;align-items:center;min-width:0;flex:1;text-align:left;}
.input-issue-first .input-issue-text {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;}
.input-issue-first span:last-child,.input-issues-all {white-space:nowrap;flex-shrink:0;}
.input-issue-list {display:grid;gap:7px;max-height:52vh;overflow:auto;padding:2px;}
.input-issue-list button {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 12px;padding:10px 12px;text-align:left;background:var(--ui-soft,#eef5f5);border:1px solid var(--ui-border,#cfdddd);color:var(--ui-text,#35565a);font-size:13px;line-height:1.5;}
.input-issue-list button strong {grid-column:1;font-size:14px;}
.input-issue-list button span {grid-column:1;overflow-wrap:anywhere;}
.input-issue-list button small {grid-column:2;grid-row:1 / 3;align-self:center;white-space:nowrap;}
.review-step-editor:focus {outline:2px solid var(--ui-primary);outline-offset:2px;}
.compact-layout .canvas-toolbar.result-camera-tools{width:auto!important;display:flex;flex-direction:row;align-items:center;gap:5px}
.compact-layout .canvas-toolbar.result-camera-tools button{width:auto;flex:none;white-space:nowrap;font-size:12px!important;padding:4px 8px}
.compact-layout .canvas-toolbar.result-camera-tools button:nth-child(-n+2){width:30px;padding:4px;font-size:16px!important}
.input-issue-return {justify-self:start;font-size:12px;}
/* Optional original-A objects share the review canvas and stay compact. */
.model-annotation-review .extra-add-entry {font-size:12px;padding:5px 8px;white-space:nowrap;}
.model-review-categories .extra-category {border-style:dashed;}
.extra-object-picker {margin:8px 0;padding:10px;border:1px solid var(--ui-primary-border);border-radius:8px;background:var(--ui-surface-soft);font-size:12px;}
.extra-object-picker .row {justify-content:space-between;}
.extra-object-fields {display:grid;grid-template-columns:minmax(0,1.4fr) minmax(110px,1fr);gap:8px;}
.extra-object-picker label {display:grid;gap:3px;margin-top:6px;font-size:12px;}
.extra-object-picker input,.extra-object-picker select {min-width:0;width:100%;box-sizing:border-box;min-height:32px;padding:5px 8px;font-size:13px;}
.extra-object-picker button {font-size:12px;min-height:30px;padding:5px 9px;}
.extra-object-bottom {display:flex;align-items:center;gap:8px;justify-content:space-between;margin-top:8px;}
.extra-object-bottom span,.extra-empty-actions span {color:var(--ui-text-secondary);font-size:12px;}
.extra-object-bottom button {flex-shrink:0;}
.extra-empty-actions,.extra-legacy-notice {display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0;font-size:12px;}
@media(max-width:600px){.extra-object-fields{grid-template-columns:1fr}.extra-object-bottom{flex-wrap:wrap}}

/* One scrolling form and a stable footer on desktop and narrow windows. */
@media(min-width:851px){
 .compact-layout .unified-workbench.review-workbench.base-setup-workbench{min-height:0}
 .compact-layout .unified-workbench.review-workbench>.model-annotation-review{height:100%;max-height:100%;overflow:auto;min-width:0;min-height:0;scroll-padding-bottom:96px}
 .compact-layout .review-workbench .model-review-scroll{min-height:0;overflow:visible;flex:0 0 auto;max-height:none}
 .compact-layout .review-workbench .model-review-categories{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(36px,auto)}
 .compact-layout .review-workbench .model-review-categories button{white-space:normal;overflow-wrap:normal;line-height:1.4}
 .compact-layout .review-workbench .model-review-categories .extra-category{grid-column:1/-1}
}
.compact-layout .model-review-footer{position:sticky;bottom:0;z-index:8;padding-bottom:6px;background:#fff}
.compact-layout .model-review-footer .review-save-actions{grid-template-columns:minmax(0,1fr) auto auto}
.compact-layout .model-review-footer .review-save-actions>button{white-space:normal}
.model-annotation-review .review-guided-question{margin:8px 0 14px;display:grid;gap:8px}
.model-annotation-review .review-guided-question h4{font-size:18px;line-height:1.55;margin:0;color:var(--ui-primary)}
.model-annotation-review .review-guided-question p{margin:0;color:var(--ui-text-secondary);line-height:1.65}
.model-annotation-review .review-step-editor>.review-guided-question~h4{display:none}
.review-area-first-card{align-self:start;gap:16px}
.review-area-first-card>label{display:grid;gap:8px}
.review-area-first-card select{width:100%;min-width:0}
.review-area-first-card .review-save-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin:16px 0}
.review-area-first-card button{white-space:normal;min-height:40px}
.review-step-editor details>button,.opening-view-actions button{margin:6px 6px 4px 0}
@media(max-width:520px){.review-area-first-card .review-save-actions{grid-template-columns:1fr}.model-annotation-review .review-guided-question h4{font-size:16px}}
@media(max-width:520px){.compact-layout .model-review-footer .review-save-actions{grid-template-columns:1fr auto}.compact-layout .review-save-actions>button:first-child{grid-column:1/-1}}

.input-issues-toolbar button.is-error,.input-issue-list button.is-error{background:var(--ui-danger-soft);border-color:var(--ui-danger-border);color:var(--ui-danger);}
.simplified-opening .opening-candidate-confirm{padding:14px 16px;box-shadow:none;min-height:0;}
.simplified-opening h4{margin:0;font-size:17px;line-height:1.6;}
.simplified-opening .opening-location-link{padding:5px 0;margin-top:8px;min-height:30px;border:0;text-decoration:underline;text-underline-offset:3px;}
.simplified-opening .opening-more{margin-top:10px;}
.simplified-opening .opening-more>summary{font-size:13px;color:var(--ui-muted,#687d80);cursor:pointer;}
.simplified-opening .opening-more[open]{display:flex;flex-direction:column;gap:8px;}
.review-saved-summary{padding:14px;border:1px solid var(--ui-border,#cfdddd);border-radius:10px;background:var(--ui-soft,#eef5f5);}
.review-saved-summary h4{margin:0;}
.result-export-notice{margin:6px 0;padding:8px 12px;color:var(--ui-text,#35565a);background:var(--ui-soft,#eef5f5);border-radius:6px;font-size:13px;}

/* Direct, recoverable deletion and entrance navigation. */
.review-direct-delete{display:flex;justify-content:flex-end;order:9}
.review-direct-delete button{min-height:40px;background:#fff6f4;color:#a13228;border:1px solid #ddb3ad;padding:8px 14px}
.review-opening-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px;border-bottom:1px solid var(--ui-border);background:#fff}
.review-opening-toolbar span{font-size:14px;color:var(--ui-text-muted)}
.compact-layout .model-review-footer .review-direct-delete{grid-column:1/-1;grid-row:3;display:flex;justify-content:flex-end}
.compact-layout .model-review-footer .review-direct-delete>button{position:static;min-height:44px}

.opening-highlight-layer .opening-navigation{pointer-events:auto;min-height:32px;cursor:pointer}
.desktop-drawing-tools{position:absolute;z-index:7;top:8px;left:56px;right:8px;display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;pointer-events:none}
.desktop-drawing-tools [role="group"]{display:flex;gap:3px;padding:3px;background:rgba(255,255,255,.96);border:1px solid var(--ui-border);border-radius:6px;pointer-events:auto}
.compact-layout .desktop-drawing-tools button{height:30px;min-height:30px;padding:3px 10px;font-size:12px;white-space:nowrap}
.desktop-drawing-tools button[aria-pressed="true"]{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}
.desktop-drawing-tools>span{padding:4px 6px;background:rgba(255,255,255,.92);border-radius:4px;color:var(--ui-text-secondary);font-size:11px;line-height:1.5}
.desktop-drawing-tools~.model-canvas-guide{top:88px}
