/* Existing V01 fallback and login rules are retained; enhancement is scoped. */
.pilot-bar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;padding:.65rem 1rem;background:#133b32;color:#fff;font:14px system-ui}.pilot-bar button,.pilot-bar select{padding:.45rem;border-radius:.35rem;border:1px solid #cdd9d4;font:inherit;background:#fff;color:#17332b}.pilot-bar button:disabled{opacity:.5}#pilot-message{flex:1 1 100%;font-size:13px}.login-page{font:16px system-ui;background:#f2f5f2;color:#18362c;display:grid;place-items:center;min-height:100vh;margin:0}.login-panel{background:white;padding:2rem;width:min(420px,calc(100% - 48px));border-radius:12px;box-shadow:0 5px 30px #0001}.login-panel form{display:grid;gap:1rem}.login-panel label{display:grid;gap:.4rem}.login-panel input,.login-panel button{font:inherit;padding:.7rem;border:1px solid #9aada3;border-radius:5px}.login-panel button{background:#133b32;color:white}.login-panel small{display:block;margin-top:1rem;line-height:1.5}

.pilot-bar.pilot-header{--pilot-ink:#173f3d;--pilot-muted:#546c68;--pilot-line:#cddbd5;--pilot-teal:#146b62;--pilot-sand:#efe5d2;display:grid;grid-template-columns:minmax(270px,1fr) auto;gap:16px 24px;padding:20px 24px 12px;background:linear-gradient(120deg,#f9f7f1,#f2f7f4);color:var(--pilot-ink);border-bottom:1px solid var(--pilot-line);box-shadow:0 3px 12px #173f3d08;font:14px/1.4 system-ui,Segoe UI,sans-serif}
.pilot-header .pilot-identity{display:flex;align-items:center;gap:18px;min-width:0}
.pilot-header .brand{color:var(--pilot-ink);font-size:22px;gap:12px;min-width:0}
.pilot-header .brand small{color:var(--pilot-muted);font-size:10px;letter-spacing:.8px}
.pilot-header .brand-mark{display:grid;place-items:center;width:44px;min-width:44px;height:44px;line-height:1;background:var(--pilot-ink);border-color:var(--pilot-ink);color:#edd7aa;border-radius:12px;font-size:32px}
.pilot-header .pilot-account{display:flex;align-items:flex-start;flex-direction:column;gap:4px;font-size:11px;white-space:nowrap;color:var(--pilot-muted)}
.pilot-header .pilot-badge{font-size:10px;font-weight:650;padding:4px 8px;background:var(--pilot-sand);border:1px solid #ded1b6;border-radius:20px;color:#665033}
.pilot-header .pilot-primary{display:flex;align-items:center;justify-content:flex-end;gap:12px;min-width:0}
.pilot-header .pilot-control{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 13px;border:1px solid var(--pilot-line);border-radius:9px;background:white;color:var(--pilot-ink);font:600 12px/1.35 system-ui,Segoe UI,sans-serif;text-align:center;text-decoration:none;cursor:pointer;transition:background-color .15s,border-color .15s}
.pilot-header .pilot-control:hover:not(:disabled){background:#e8f1ed;border-color:#789f93}
.pilot-header .pilot-control:disabled{opacity:.45;cursor:default}
.pilot-header #pilot-save{background:var(--pilot-teal);border-color:var(--pilot-teal);color:white;white-space:nowrap}
.pilot-header #pilot-save:hover:not(:disabled){background:#10564f;border-color:#10564f}
.pilot-header .pilot-icon{width:18px;height:18px;min-width:18px;flex:none;vertical-align:middle;pointer-events:none}
.pilot-header .pilot-action-group{display:flex;flex-wrap:wrap;align-items:center;gap:7px;min-width:0}
.pilot-header .pilot-group-title{font-size:10px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--pilot-muted);flex:1 0 100%}
.pilot-header .pilot-history{flex-wrap:nowrap;gap:5px}
.pilot-header .pilot-history .pilot-group-title{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.pilot-header .pilot-project-picker{display:grid;grid-template-columns:minmax(160px,1fr) auto;align-items:end;gap:5px 8px;min-width:0;max-width:620px}
.pilot-header .pilot-project-label{grid-column:1/-1;font-size:11px;font-weight:700;color:var(--pilot-muted)}
.pilot-header .pilot-select-wrap{display:flex;align-items:center;min-width:0;border:1px solid #a9c0b6;border-radius:9px;background:white;padding-left:12px}
.pilot-header .pilot-select-wrap .pilot-icon{color:var(--pilot-teal);margin-right:7px}
.pilot-header #pilot-projects{min-width:0;width:100%;min-height:44px;border:0;border-radius:9px;padding:10px 30px 10px 4px;background:transparent;color:var(--pilot-ink);font-size:13px;cursor:pointer}
.pilot-header .pilot-action-menu{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:12px 18px;min-width:0}
.pilot-header .pilot-action-menu .pilot-action-group{max-width:390px}
.pilot-header .file-button{position:relative}
.pilot-header .file-button input{position:absolute;width:1px;height:1px;padding:0;border:0;opacity:0;overflow:hidden;clip-path:inset(50%)}
.pilot-header :is(button,select,a):focus-visible,.pilot-header .file-button:focus-within{outline:3px solid #bb8429;outline-offset:3px}
.pilot-header .pilot-menu-toggle{display:none}
.pilot-header [hidden]{display:none!important}
.pilot-header #pilot-message{grid-column:1/-1;min-width:0;overflow-wrap:anywhere;border-top:1px solid var(--pilot-line);padding-top:9px;font-size:11px;line-height:1.5;color:var(--pilot-muted)}
@media(max-width:1160px){.pilot-bar.pilot-header{gap:14px 18px}.pilot-header .pilot-identity{flex-wrap:wrap;gap:10px}.pilot-header .pilot-project-picker{max-width:none}.pilot-header .pilot-action-menu{grid-column:1/-1;justify-content:flex-start;border-top:1px solid var(--pilot-line);padding-top:12px}.pilot-header .pilot-action-menu .pilot-action-group{max-width:none}.pilot-header .pilot-project-picker{grid-column:1/-1}}
@media(max-width:760px){.pilot-bar.pilot-header{grid-template-columns:minmax(0,1fr);padding:14px;gap:12px}.pilot-header .pilot-identity{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 10px}.pilot-header .brand{font-size:20px;grid-column:1;grid-row:1}.pilot-header .brand small{font-size:9px;letter-spacing:.4px}.pilot-header .pilot-account{grid-column:1/-1;flex-direction:row;align-items:center;gap:8px}.pilot-header .pilot-menu-toggle{display:inline-flex;grid-column:2;grid-row:1}.pilot-header .pilot-primary{justify-content:space-between;gap:8px}.pilot-header .pilot-history .pilot-control{padding:10px;gap:5px}.pilot-header .pilot-action-menu{flex-direction:column;align-items:stretch;gap:16px}.pilot-header .pilot-action-menu .pilot-action-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.pilot-header .pilot-action-menu .pilot-group-title{grid-column:1/-1}.pilot-header .pilot-action-menu .pilot-control{width:100%}.pilot-header .pilot-action-menu .pilot-action-group:last-child{grid-template-columns:1fr}.pilot-header .pilot-project-picker{grid-template-columns:minmax(0,1fr) auto}.pilot-header #pilot-projects{font-size:16px}.pilot-header .pilot-control{font-size:12px}.pilot-header .pilot-menu-label{font-size:11px}}
@media(max-width:380px){.pilot-header .pilot-menu-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%)}.pilot-header .pilot-primary{flex-wrap:wrap}.pilot-header .pilot-history{flex:1}.pilot-header #pilot-save{flex:1}.pilot-header .pilot-action-menu .pilot-action-group{grid-template-columns:1fr}.pilot-header .brand{font-size:18px}}
@media(prefers-reduced-motion:reduce){.pilot-header .pilot-control{transition:none}}
@media print{.pilot-bar.pilot-header{display:none!important}}

/* V12: presentation-only entrance camera. Physical project coordinates stay unchanged. */
.room-preview{width:100%;min-width:0}
.room-view-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 12px;padding:10px 12px;background:white;border:1px solid var(--line);border-radius:8px}
.room-view-controls label{font-size:12px;display:block;min-width:150px;max-width:100%}
.room-view-controls select{display:block;margin-top:5px;padding:6px}
.room-view-controls input[type=range]{display:block;margin-top:9px}
.room-view-controls .room-front-label{min-width:auto}
.room-view-controls output{font-variant-numeric:tabular-nums;font-weight:600}
.room-view-controls button{font-size:12px;min-height:44px}
.room-preview .scene{height:550px;perspective:none;overflow:hidden;outline-offset:-4px;border-radius:8px;background:linear-gradient(#f2f5f1,#fcfdfb)}
.room-preview .world{left:50%;top:50%;transform-origin:0 0;transition:none}
.room-preview .scene[data-room-mode=material] .room-wall,.room-preview .scene[data-room-mode=material] .room-wall.is-active{opacity:1}
.room-preview .scene[data-room-mode=contour] .room-wall{opacity:.26}
.room-preview .scene[data-room-mode=contour] .room-wall.is-active{opacity:.5}
.room-preview .scene[data-room-mode=contour] .room-floor{opacity:.8}
/* V13: caption has its own normal-flow area below the fitted camera viewport. */
.room-preview .room-camera-help{position:static;display:block;margin:12px 0 0;padding:10px 12px;font-size:11px;line-height:1.6;color:var(--muted);background:#f5f7f4;border:1px solid var(--line);border-radius:8px;overflow-wrap:anywhere}
.steps button{min-width:0;overflow-wrap:anywhere}
@media(max-width:800px){.room-preview .scene{height:480px}.room-view-controls{gap:8px}.room-view-controls label{min-width:135px}.room-view-controls .room-front-label{flex-basis:100%}}
@media(max-width:480px){.steps{grid-template-columns:repeat(2,minmax(0,1fr))}.room-view-controls label{min-width:0;flex:1 1 125px}.room-view-controls button{flex:1 1 140px}}

/* V15: additive current-plan stock overview; V13 camera/caption styles retained. */
.stock-overview{width:100%;margin-top:20px;padding:18px;background:white;border:1px solid var(--line);border-radius:12px;overflow-wrap:anywhere}.stock-overview h2{font-size:20px;margin:0 0 12px}.stock-overview p,.stock-item p{font-size:12px;line-height:1.6}.stock-overview .footer-actions{margin-bottom:18px}.stock-item{border-top:1px solid var(--line);padding:12px 0}.stock-item summary{cursor:pointer;font-size:12px;font-weight:650;min-height:44px;display:flex;align-items:center}.stock-table-wrap{overflow:auto}.stock-identity{overflow-wrap:anywhere}.stock-print svg{display:block;width:100%;height:auto;max-height:80mm}.stock-print .data-table{font-size:8pt}@media(max-width:800px){.stock-overview{padding:12px}.stock-overview .footer-actions button{min-height:44px;flex:1 1 180px}.stock-item .data-table{min-width:460px}}@media print{.stock-overview{display:none!important}.stock-print svg{max-height:80mm}.stock-print table{overflow-wrap:anywhere}}


/* V16: only the material stage with a direct stock overview leaves the shared flex row. */
@media screen{#stage.stage:has(> .stock-overview){display:block}}

/* V20: wrap report titles; preserve focused menu toggle until existing JS transfers focus. */
@media screen{#stage.stage > .report-card h2{overflow-wrap:anywhere}.pilot-header .pilot-menu-toggle:focus{display:inline-flex}}

/* V21: wrap only direct explanatory handover paragraphs; existing status and print rules stay unchanged. */
@media screen{#stage.stage > .report-card #handover-panel > p:not(.article-json){overflow-wrap:anywhere}}
