/* Guided layout; processing controls and IDs remain the original application. */
.build-stages { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; margin:0 0 14px; }
.build-stages button { padding:10px 4px; border:1px solid var(--line); border-radius:5px; font-size:12px; background:transparent; color:var(--green); }
.build-stages button[aria-current=step] { background:var(--green); color:white; }
.build-stage-actions { border-top:1px solid var(--line); padding-top:14px; margin-top:20px; }
#build-stage-error { padding:12px; border:1px solid #e6c9bc; background:#fff5ee; border-radius:6px; overflow-wrap:anywhere; }
#part-settings[data-legacy=true] { display:none!important; }
.build-wireframe { display:flex; align-items:center; gap:8px; margin:12px 0; font-size:12px; max-width:100%; }
#quality-wireframe { width:16px; height:16px; flex:0 0 16px; margin:0; padding:0; }
.build-stage-actions button,#apply-geometry-quality { white-space:normal; }
#build-stage-result #geometry-quality-controls { border-top:0; padding-top:0; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
body[data-workflow=loading] main { visibility:hidden; }
body[data-workflow] { --muted:#65756a; --line:#dce3d8; }
header { height:72px; padding:0 max(24px,calc((100vw - 1600px)/2)); }
.workflow-title { color:var(--muted); font-size:12px; }
.step-nav { border-bottom:1px solid var(--line); background:#f4f7ef; padding:12px max(24px,calc((100vw - 1600px)/2)); }
#workflow-tabs { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px; }
#workflow-tabs button { display:flex; align-items:center; text-align:left; gap:10px; border:1px solid transparent; padding:12px 10px; background:transparent; color:var(--ink); border-radius:8px; min-width:0; }
#workflow-tabs button:hover:not(:disabled) { background:#e7eedf; }
#workflow-tabs button[aria-selected=true] { background:var(--green); color:#fff; }
#workflow-tabs button[aria-selected=true]:hover { background:var(--green); }
#workflow-tabs button,.segmented button { transition:none; }
#workflow-tabs strong { display:block; font-size:13px; font-weight:650; }
#workflow-tabs small { display:block; font-size:10px; line-height:1.5; margin-top:3px; color:var(--muted); }
#workflow-tabs [aria-selected=true] small { color:#d7e7d0; }
.step-number { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#e5ecde; color:#52684a; font-size:11px; flex-shrink:0; }
[aria-selected=true] .step-number { background:#ffffff25; color:white; }
body[data-workflow=ready] main { display:grid; grid-template-columns:350px minmax(0,1fr); gap:32px; padding:28px max(24px,calc((100vw - 1600px)/2)); min-height:calc(100vh - 204px); }
.workflow-controls { padding:0; min-width:0; border:0; }
.step-heading { margin-bottom:22px; }
.step-heading h1 { font-size:24px; line-height:1.2; margin:10px 0; }
.step-heading p { font-size:13px; color:#65756a; }
.step-panel fieldset { border:0; padding:0; margin:0; min-width:0; }
.step-panel section { padding:0; margin:0; border:0; }
.step-panel p { font-size:12px; }
.step-panel .field,.step-panel .range-label { font-size:12px; }
.step-panel input:not([type=range]):not([type=file]):not([type=color]):not([type=checkbox]),.step-panel select { font-size:13px; padding:11px; }
.step-panel .wide { font-size:12px; min-height:40px; }
.step-panel .field { margin:15px 0; }
.step-panel .pair .field { margin-top:0; }
.step-panel .help { font-size:11px; color:var(--muted); }
.step-panel small { font-size:11px; }
.step-note { background:#eef3e8; padding:12px 14px; border-radius:7px; font-size:12px!important; color:#566d4c; line-height:1.6; }
.group-heading { margin:22px 0 12px; }
.group-heading h2 { margin:0 0 6px; font-size:14px; }
.group-heading p { margin:0; font-size:12px; }
#local-color-settings.inactive { opacity:.55; }
#pixel-media { order:8; }
.option-group { border-top:1px solid var(--line); padding-top:12px; margin:16px 0; }
.option-group summary { font-size:12px; color:var(--green); font-weight:600; padding:3px 0; }
.option-group[open]>summary { margin-bottom:10px; }
#volume-options { background:transparent; padding:0; border:0; margin:0; }
#volume-options details summary { color:var(--green); font-size:12px; }
#model-reset-note { color:#865b25; background:#fbf1dc; }
.step-panel .note { margin-bottom:16px; }
.step-panel .palette-list { margin-top:20px; }
.step-panel .palette-list { display:block; }
.step-panel .palette-info strong { font-size:12px; }
.step-panel .palette-info small { font-size:11px; }
.step-panel .palette-row .share { font-size:11px; }
.step-panel .palette-summary { padding:12px 0; border-top:1px solid var(--line); margin-top:16px; }
body[data-workflow=ready] .workspace { padding:0; min-width:0; display:block; }
.workspace-heading { margin-bottom:14px; min-height:50px; }
.workspace-heading h2 { font-size:19px; }
#viewport { height:clamp(390px,58vh,700px); min-height:390px; max-height:none; }
.view-toolbar .tool { font-size:11px; }
.view-caption { font-size:11px; bottom:42px; }
.view-help { font-size:10px; }
body:not([data-step=finish]) .color-tool,body:not([data-step=model]) #view-parts,body:not([data-step=model]) #view-supports { display:none; }
.color-tool kbd { font:inherit; opacity:.6; margin-left:4px; }
.view-toolbar .color-tool[aria-pressed=true] { color:white; border-color:var(--green); background:var(--green); }
#viewer canvas:focus-visible { outline:2px solid #81a672; outline-offset:-2px; }
#brush-mm:disabled { color:#8b9683; background:var(--tint); opacity:.65; }
#polygon-outline { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:1; display:none; }
#polygon-outline polygon { fill:var(--polygon-fill,#28594726); stroke:#285947; stroke-width:2; stroke-dasharray:6 3; }
#polygon-outline circle { fill:white; stroke:#285947; stroke-width:2; }
#polygon-outline circle:first-of-type { fill:#285947; stroke:white; }
#polygon-outline circle.close-ready { fill:#edb634; stroke:#285947; stroke-width:3; }
#polygon-actions { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:10px; background:var(--tint); border-radius:6px; }
#polygon-actions[hidden] { display:none; }
#polygon-status { width:100%; font-size:11px; color:var(--green); }
body[data-step=source] .view-toolbar > .segmented,body[data-step=source] #ai-compare { display:none; }
body[data-step=source] #reset-camera { margin-left:auto; }
body:not([data-step=source]) .source-texture-toggle { display:none; }
.source-texture-toggle { display:flex; align-items:center; gap:7px; cursor:pointer; }
.source-texture-toggle input { width:auto!important; margin:0!important; }
body[data-step=ai] .view-toolbar > .segmented { display:none; }
body[data-step=ai] #reset-camera { margin-left:auto; }
body[data-has-model=false] .view-toolbar,body[data-has-model=false] .lighting-toggle,body[data-has-model=false] .view-caption,body[data-has-model=false] .view-help { display:none; }
#workflow-alert { display:flex; gap:16px; align-items:center; justify-content:space-between; padding:13px 15px; margin:0 0 18px; border:1px solid #e2d4a8; border-radius:8px; color:#775b20; background:#fff9e8; font-size:12px; line-height:1.6; }
#workflow-alert button { padding:9px 12px; flex-shrink:0; }
.step-navigation { display:flex; align-items:center; gap:14px; margin:20px 0 6px; border-top:1px solid var(--line); padding-top:18px; }
.step-navigation button { padding:12px 16px; font-size:12px; min-height:42px; white-space:nowrap; }
.step-navigation p { margin:0; flex:1; font-size:11px; }
#step-next { margin-left:auto; }
/* Step 5 has its own ordered actions in the left column. */
body[data-step="model"] #step-next,
body[data-step="model"] #step-guidance { display:none; }
#status { font-size:12px; padding:8px 0; line-height:1.5; }
.edit-tools { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:0; }
.edit-tools .field:first-child { grid-column:1/-1; }
.editor-tool-slot { grid-column:1/-1; }
.edit-tools > details { grid-column:1/-1; margin:0; }
.filament-picker { position:relative; display:block; width:100%; min-width:0; margin-top:6px; }
.field > .filament-picker { float:none; font:inherit; }
.filament-native { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:0!important; clip-path:inset(50%); overflow:hidden; pointer-events:none; }
.filament-choice { display:flex; align-items:center; gap:10px; width:100%; min-height:46px; padding:9px 11px; border:1px solid var(--line); border-radius:5px; background:white; color:var(--ink); text-align:left; font:inherit; }
.filament-choice::after { content:'▾'; margin-left:auto; color:var(--muted); }
.filament-choice:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.filament-choice:disabled { opacity:.5; }
.filament-swatch { display:block; width:24px; height:24px; flex:0 0 24px; border:1px solid #0003; border-radius:4px; }
.filament-swatch.automatic { background:linear-gradient(135deg,#e9eee5 48%,#9ba99a 49%,#9ba99a 51%,#f8faf4 52%); }
.filament-choice-text { display:grid; gap:2px; min-width:0; white-space:normal; }
.filament-choice-text small { font:10px monospace; color:var(--muted); }
.filament-options { position:absolute; z-index:20; top:calc(100% + 4px); left:0; right:0; max-height:260px; overflow-y:auto; overscroll-behavior:contain; padding:4px; border:1px solid var(--line); border-radius:6px; background:white; box-shadow:0 5px 18px #20372f26; }
.open-up .filament-options { top:auto; bottom:calc(100% + 4px); }
.filament-options [role=option] { display:flex; align-items:center; gap:10px; min-height:44px; padding:7px; border-radius:4px; cursor:pointer; }
.filament-options [role=option]:hover,.filament-options .focused { background:#eef3e8; }
.filament-options [aria-selected=true] { box-shadow:inset 3px 0 var(--green); }
.filament-options [aria-disabled=true] { opacity:.4; cursor:default; }
.merge-picker { flex:0 1 145px; margin:0; }
.merge-picker .filament-choice { font-size:11px; padding:5px; gap:5px; }
.edit-tools details { grid-column:1/-1; margin-top:0; }
.edit-tools button { font-size:12px; }
.step-panel #ai-tools { border:0; background:transparent; padding:0; margin:0; }
.step-panel #ai-badge { float:none; display:inline-block; font-size:11px; color:var(--green); background:#e6eedf; padding:6px 9px; border-radius:5px; margin-top:6px; }
.step-panel .ai-fields { grid-template-columns:1fr; gap:0; }
.step-panel .ai-actions { gap:8px; margin:10px 0; }
.step-panel .ai-actions button { flex:1 1 130px; font-size:12px; padding:10px; min-height:40px; }
#ai-stop { background:#fff4df; color:#745b27; }
#ai-apply { flex-basis:100%; }
#ai-regions { max-height:none; }
.ai-region { font-size:12px; border-bottom:1px solid var(--line); padding:10px 0; }
#ai-review .group-heading { margin-top:22px; }
#ai-review-help { display:block; padding:8px 0; }
#ai-status { padding:12px; background:#eef3e8; border-radius:6px; line-height:1.6; overflow-wrap:anywhere; }
#ai-status.error { background:#fff3e8; }
.workspace-extra { margin-top:28px; padding:20px; border:1px solid var(--line); border-radius:10px; background:#f4f7f0; scroll-margin-top:20px; }
.workspace-extra .group-heading { margin:0 0 15px; }
.ai-views { gap:10px; }
.ai-views figcaption { font-size:11px; text-align:left; line-height:1.5; margin:8px 0 15px; }
.ai-image-button { border:1px solid var(--line); background:#fafcf7; border-radius:6px; padding:4px; overflow:hidden; }
.ai-image-button img { border:0; }
.ai-image-button .compare-label { display:block; padding:10px 5px; color:var(--green); font-weight:600; font-size:11px; line-height:1.5; }
#ai-quantized-section { margin-top:18px; }
#ai-quantized-section p { font-size:11px; }
#ai-image-dialog { padding:20px; overflow:auto; }
.ai-dialog-heading { position:sticky; top:-20px; z-index:1; background:#f4f7f0; margin:0 -4px 12px; padding:12px 4px; }
.ai-dialog-decision { position:sticky; bottom:-20px; background:#f4f7f0; border-top:1px solid var(--line); padding:12px 0 4px; }
.ai-dialog-decision p { font-size:12px; }
#ai-image-review { padding:12px 16px; font-size:13px; background:var(--green); color:white; }
.export-summary { display:grid; grid-template-columns:1fr 1.5fr; gap:12px; padding:16px; background:#f0f4eb; border-radius:8px; margin:0 0 24px; font-size:12px; }
.export-summary dt { color:var(--muted); }
.export-summary dd { margin:0; text-align:right; overflow-wrap:anywhere; }
@media(min-width:761px){body[data-step=ai] #viewport,body[data-step=model] #viewport { position:sticky; top:16px; z-index:3; } body[data-step=ai] .workspace-extra { position:relative; z-index:4; }}
@media(max-width:760px){
  body[data-workflow=ready] .workspace { display:contents; }
  .workspace-heading,#workflow-alert { order:0; }
  #viewport { order:1; flex:none; }
  .build-wireframe,#data-attribution,#wall-check-result { order:1; }
  .workflow-controls { order:2; }
  .metrics,.report,#status { order:3; }
  .step-navigation { order:4; }
  #ai-media { order:5; }
  body[data-step=source] .workflow-controls { order:-1; }
}
@media(min-width:1600px){body[data-workflow=ready] main { grid-template-columns:370px minmax(0,1fr); gap:40px; }}
@media(max-width:1150px){body[data-workflow=ready] main { grid-template-columns:310px minmax(0,1fr); gap:22px; }.workflow-title{display:none;}#workflow-tabs small{display:none;}#workflow-tabs button{gap:7px;padding:10px 7px;}#workflow-tabs strong{font-size:12px;}.ai-views{grid-template-columns:repeat(3,1fr);}.step-navigation{flex-wrap:wrap;}.step-navigation p{flex-basis:100%;order:3;}}
@media(max-width:760px){header{height:64px;padding:0 16px;}.step-nav{padding:10px 14px;}#workflow-tabs{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;}#workflow-tabs button{padding:9px 7px;}body[data-workflow=ready] main{display:flex;flex-direction:column;padding:20px 16px;gap:24px;}.workflow-controls{order:1;}body[data-has-model=true]:not([data-step=source]) .workspace{order:0;}body[data-step=source] .workspace{order:2;}.step-heading h1{font-size:23px;}#viewport{height:380px;min-height:380px;}.workspace-heading h2{font-size:16px;}.workspace-heading{min-height:0;}.view-caption{font-size:9px;}.view-help{font-size:9px;}.ai-compare small{font-size:9px;}.workspace-extra{padding:14px;margin-top:18px;}.ai-views{grid-template-columns:repeat(2,minmax(0,1fr));}.step-navigation button{padding:11px;font-size:11px;}.step-navigation{gap:8px;}#workflow-alert{flex-direction:column;align-items:flex-start;gap:8px;}#ai-image-dialog{padding:14px;}.ai-dialog-heading{top:-14px;}.ai-dialog-decision{bottom:-14px;}.ai-image-pair{grid-template-columns:1fr;}.edit-tools{grid-template-columns:1fr 1fr;}.step-panel .ai-actions button{width:auto;}footer{height:auto;min-height:42px;gap:12px;padding:12px 16px;line-height:1.5;}}

@media(max-width:760px){ body[data-workflow=ready] .workflow-controls { order:2; } body[data-step=source][data-workflow=ready] .workflow-controls { order:-1; } }

#google-map-workspace { margin-bottom:20px; border:1px solid var(--line,#d7dfcf); padding:14px; border-radius:8px; }
#google-map-viewer,#google-coverage-viewer { height:clamp(640px,76vh,1100px); position:relative; min-width:0; overflow:hidden; border-radius:6px; }
#google-coverage-viewer { background:#eef2ea; }
#google-coverage-viewer iframe { width:100%; height:100%; display:block; border:0; }
.google-map-actions { display:flex; gap:8px; flex-wrap:wrap; }
#google-coverage-toggle[aria-pressed=true] { background:var(--green); color:white; }
.coverage-swatch { display:inline-block; width:12px; height:12px; margin-right:6px; background:#2a76ff80; border:1px solid #2a76ff; vertical-align:middle; }
#google-map-workspace.coverage-open #google-loaded-note,#google-map-workspace.coverage-open #google-map-status { display:none; }
.google-map-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.google-map-heading h2 { margin:0 0 6px; }
#google-map-dimensions { color:var(--green); font-weight:600; margin:0; }
#google-map-workspace button { padding:9px 12px; font-size:12px; min-height:38px; }
#google-expand { flex:none; }
#google-search-form { display:flex; gap:8px; }
#google-search-form input { margin:0; flex:1; }
#google-search-form button { flex:none; }
.google-map-tools { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.google-map-hint { font-size:11px; margin:6px 0 10px; line-height:1.5; }
.google-overlay-tools { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; margin:10px 0 6px; }
.google-overlay-tools label { display:flex; gap:6px; align-items:center; font-size:12px; }
.google-overlay-tools input[type=checkbox] { width:auto; margin:0; accent-color:var(--green); }
.google-overlay-tools select { width:auto; max-width:100%; margin:0; }
.google-map-options { margin:6px 0; font-size:12px; }
.google-map-options .field { max-width:300px; margin:10px 0; }
#google-tile-limit-field[hidden] { display:none; }
#google-plan-status.error { color:#a74236; }
#google-labels-status.error { color:#a74236; }
#google-search-results { list-style:none; padding:0; margin:8px 0; max-height:145px; overflow:auto; }
#google-search-results button { width:100%; text-align:left; margin:3px 0; }
#google-search-status,#google-map-status { font-size:12px; margin:8px 0 0; }
#google-search-status.error,#google-map-status.error,#google-status.error { color:#a74236; }
#google-map-dialog { position:fixed; inset:0; width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:12px; border:0; background:#f4f7f0; color:var(--ink); }
#google-map-dialog::backdrop { background:#24382bea; }
#google-map-dialog #google-map-workspace { height:100%; margin:0; display:flex; flex-direction:column; min-height:0; }
#google-map-dialog #google-map-viewer,#google-map-dialog #google-coverage-viewer { flex:1; height:auto; min-height:150px; }
#google-map-dialog #google-map-workspace > :not(#google-map-viewer):not(#google-coverage-viewer) { flex-shrink:0; }
body.google-map-expanded { overflow:hidden; }
@media(max-width:760px){
  #google-map-workspace { padding:10px; width:100%; }
  #google-map-viewer,#google-coverage-viewer { height:72vh; min-height:430px; }
  .google-map-heading { flex-wrap:wrap; gap:8px; }
  #google-map-dialog { padding:4px; }
  #google-map-workspace button { padding:8px 10px; }
  #google-map-dialog .google-map-hint { font-size:10px; margin:4px 0; }
}
#google-map-viewer .cesium-viewer-bottom { background:#fff; color:#222; padding:3px; }
#google-map-viewer .cesium-credit-textContainer { font-size:12px; }
#data-attribution { font-size:12px; margin:4px 0 0; color:#35453c; }
#google-source .field input { width:100%; min-width:0; }
#google-connect { margin-bottom:8px; }
#google-coverage-open { margin-bottom:16px; }
#google-status { font-size:12px; line-height:1.5; }
.part-list { max-height:240px; overflow:auto; border:1px solid var(--line); border-radius:5px; margin:12px 0 8px; padding:6px; font-size:12px; }
.step-panel .check-field input[type=checkbox] { width:16px; height:16px; margin:0; padding:0; flex:0 0 16px; }
#part-preflight .pair { gap:8px; margin-top:8px; }
#part-preflight .pair button { padding:9px 6px; font-size:11px; line-height:1.35; }
#part-preflight .check-field { line-height:1.5; padding:5px 3px; cursor:pointer; }
.preflight-part-row { padding:5px 0; border-bottom:1px solid var(--line); }
.preflight-part-row:last-child { border-bottom:0; }
#part-preflight small { display:block; line-height:1.65; font-size:11px; color:var(--muted); }
.part-choice { display:flex; align-items:center; gap:10px; padding:9px 6px; cursor:pointer; border-radius:3px; }
.part-choice:has(:checked) { background:#fff2b2; color:var(--ink); }
.part-choice:has(:disabled) { cursor:default; opacity:.6; }
#part-list input { flex:0 0 auto; width:16px; height:16px; margin:0; padding:0; accent-color:var(--green); }
.part-choice span { line-height:1.5; }
#parts-selection-info { display:block; margin:8px 0 12px; }
.step-panel .palette-row { display:grid; grid-template-columns:18px 32px minmax(70px,1fr) auto 28px; gap:9px; }
.step-panel .palette-row input.palette-check { width:17px; height:17px; margin:0; padding:0; accent-color:var(--green); }
.step-panel .palette-row input[type=color] { width:32px; height:34px; margin:0; }
.step-panel .palette-row.chosen { border-color:var(--green); background:#eef4eb; }
.step-panel .palette-row.marked { box-shadow:inset 3px 0 #d824bd; }
.palette-eye { border:0; background:none; color:var(--muted); font-size:24px; padding:0; line-height:1; }
.palette-eye[aria-pressed=true] { color:#b719a3; }
#palette-generation { border-bottom:1px solid var(--line); padding-bottom:14px; margin:18px 0; }
#palette-eyedropper[aria-pressed=true] { background:var(--green); color:white; }
.palette-merge-selection { padding:16px; background:var(--tint); border:1px solid var(--line); border-radius:6px; margin:14px 0; font-size:13px; }
.palette-actions { display:flex; gap:12px; flex-wrap:wrap; margin:8px 0 12px; }
.palette-merge-preview { display:flex; align-items:center; gap:10px; }
#palette-merge-swatch { display:inline-block; width:26px; height:26px; border:1px solid #808080; border-radius:3px; }
#palette-merge-custom { width:100%; height:40px; }
.palette-distance-help { margin:8px 0 14px; font-size:11px; color:var(--muted); }
#panel-palette .palette-list { max-height:550px; overflow-y:auto; scrollbar-gutter:stable; padding:3px; }
#palette-texture-note { background:transparent; border-radius:0; padding:0; font-size:11px!important; }
#footprint-settings { border:1px solid var(--line); border-radius:8px; padding:12px 14px; background:#f4f7ee; }
#footprint-settings summary { color:var(--green); font-weight:600; }
#footprint-preview { display:block; width:100%; height:150px; margin:8px auto; }
#footprint-settings [hidden] { display:none!important; }
#footprint-settings .field small { margin-top:10px; font-weight:400; }
#print-finishing { margin:24px 0 0; padding:18px; border:1px solid var(--line); border-radius:8px; background:#f4f7ee; min-width:0; }
#print-finishing legend { padding:0 6px; color:var(--green); font-size:14px; font-weight:650; }
#print-finishing .check { display:flex; gap:9px; align-items:center; font-size:13px; margin:15px 0; }
#print-finishing input[type=checkbox] { width:16px; height:16px; flex-shrink:0; margin:0; padding:0; accent-color:var(--green); }
#print-finishing input[type=color] { width:100%; height:38px; margin-top:8px; cursor:pointer; }
#print-finishing [hidden], #print-finishing[hidden] { display:none!important; }
#print-finishing .error { color:#a43f2b; }
@media (min-width:1000px) and (min-height:700px) {
  body[data-step=palette] .workspace,body[data-step=model] .workspace { position:sticky; top:18px; align-self:start; }
}

#polygon-outline polyline { fill:none; stroke:var(--polygon-fill,#28594766); stroke-linecap:round; stroke-linejoin:round; }

/* Plan camera images before any paid request. Keep removal beside each image. */
.ai-direction-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:16px 0; }
#ai-preparation > button { width:100%; margin:14px 0 0; }
#ai-extra-views { border:0; padding-top:0; }
#ai-views { grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); }
#ai-views figure { min-width:0; padding-bottom:8px; }
#ai-views figcaption { margin:8px 0; }
#ai-views [data-remove-view] { width:100%; padding:6px; }
#ai-views .ai-image-button { width:100%; }
#ai-view-dialog { width:min(90vw,850px); max-height:92vh; padding:20px; border:1px solid var(--line); border-radius:12px; background:#f4f7f0; }
#ai-view-image { display:block; width:100%; max-height:72vh; object-fit:contain; }

#ai-preparation > button { padding:10px; min-height:40px; font-size:12px; }
.ai-direction-grid .check { display:flex; align-items:center; gap:8px; font-size:13px; margin:0; }
.ai-direction-grid input[type=checkbox] { width:16px; height:16px; margin:0; padding:0; accent-color:var(--green); }
#ai-extra-views > button { margin-top:8px; }
#ai-plan-count[data-effort=medium],#ai-effort-warning[data-effort=medium] { background:#fff3c4; color:#725000; border:1px solid #d7b94d; }
#ai-plan-count[data-effort=high],#ai-effort-warning[data-effort=high] { background:#fce5e1; color:#922c21; border:1px solid #d18a7e; }
/* Keep the model and live paint visible while resolving precise colour edges. */
#busy.compact { inset:auto 12px 12px auto; max-width:calc(100% - 24px); flex-direction:row; flex-wrap:wrap; gap:8px; padding:10px 14px; border:1px solid var(--line); border-radius:8px; background:#fafbf7ed; pointer-events:none; box-shadow:0 2px 12px #213d3615; }
#busy.compact .spinner { width:16px; height:16px; flex:none; }
#busy.compact strong { font-size:11px; }
#busy.compact small { display:none; }
.viewer-quality-note{position:absolute;top:100px;left:16px;right:16px;z-index:3;pointer-events:none;margin:0;padding:8px 12px;border-radius:6px;background:#f6f8eef0;color:#285346;font-size:12px;text-align:center;}
.quality-limited{background:#fff4d6!important;color:#805115!important;border:1px solid #d8b563;}
#cancel-calculation{margin-top:16px;pointer-events:auto;}
/* Guided prototype: primary choices first, details available on demand. */
.basic-card{padding:18px;border:1px solid var(--line);border-radius:12px;background:#f2f6ed;margin:14px 0 22px;}
.basic-card h2{font-size:18px;margin:0 0 12px;}
.expert-settings{margin:22px 0;border-top:1px solid var(--line);padding-top:16px;}
.expert-settings>summary{font-size:13px;cursor:pointer;color:var(--muted);}
.wait-card{padding:18px;border:1px solid #d7bb62;border-radius:10px;background:#fff6d9;color:#684e16;font-size:13px;line-height:1.75;margin:18px 0;}
.shape-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0;}
.shape-choices button,.choice-cards button{border:1px solid var(--line);background:#fffef8;border-radius:9px;color:var(--green);padding:12px 6px;cursor:pointer;font-size:12px;}
.shape-choices button span{display:block;font-size:26px;line-height:1.2;margin-bottom:5px;}
.shape-choices button[aria-pressed=true],.choice-cards button[aria-pressed=true]{border-color:var(--green);background:#dfeddf;box-shadow:inset 0 0 0 1px var(--green);}
.choice-cards{display:grid;grid-template-columns:1fr;gap:10px;}
.choice-cards strong,.choice-cards small{display:block;line-height:1.5;}
.choice-cards strong{font-size:14px;}.choice-cards small{font-size:12px;margin-top:3px;}
#shadow-result-choice .segmented{display:flex;}#shadow-result-choice button{flex:1;}
#terra-settings{width:min(92vw,590px);max-height:90vh;overflow:auto;padding:24px;border:1px solid var(--line);border-radius:16px;background:#fafbf7;color:var(--ink);}
#terra-settings::backdrop{background:#122a2566;}
.settings-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;}
.settings-heading h2{font-size:22px;}.settings-trigger{margin-left:12px;white-space:nowrap;}
#settings-keys{margin-top:22px;}#settings-keys input{width:100%;}
.audience-options{display:flex;flex-wrap:wrap;gap:20px;padding:16px;border:1px solid var(--line);border-radius:8px;}
.audience-options label{display:flex;align-items:center;gap:8px;font-size:14px;}
.audience-options input{width:auto;margin:0;}
body[data-shadow-expert=false] #ai-media,body[data-shadow-expert=false] #ai-compare{display:none!important;}
#build-defaults .help{font-size:14px;line-height:1.8;}
#build-button{min-height:52px;font-size:15px;white-space:normal;}
#build-return-result{margin-top:10px;}#refresh-download{margin-bottom:10px;}
#panel-export #print-finishing{margin-top:0;}
#export-experts #wall-check-result{padding:0;border:0;}
@media(max-width:760px){header .local{display:none;}header .settings-trigger{margin-left:auto;}#terra-settings{padding:18px;} .settings-heading h2{font-size:20px;}}
.estimate-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:14px 0}
.estimate-grid>div{background:var(--paper,#fafbf6);border:1px solid #dce3d5;border-radius:8px;padding:12px;min-width:0}
.estimate-grid span{display:block;font-size:12px;margin-bottom:6px}
.estimate-grid strong{display:block;font-size:19px;color:#254f42;overflow-wrap:anywhere}

.step-fields .basic-card{padding:18px;border:1px solid var(--line);border-radius:12px;margin:14px 0 22px;}
#display-diagnostics .lighting-toggle{position:static;display:flex;margin:14px 0;font-size:12px;}
.expert-settings #display-diagnostics .metrics{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0;padding:10px;}
.expert-settings #display-diagnostics .metric{border:0;padding:0;}
#display-diagnostics .tool{margin:4px 4px 4px 0;}
/* Independent provider controls: a source switch never mixes map content. */
body[data-source="hamburg"] #google-map-workspace,
body[data-source="file"] #google-map-workspace { display:none !important; }
body[data-source="hongkong"] #google-map-workspace,body[data-source="helsinki"] #google-map-workspace,body[data-source="melbourne"] #google-map-workspace { display:none !important; }
.source-choice { margin-bottom:18px; }
.hamburg-map-workspace { margin-bottom:24px; padding:18px; background:var(--panel,#f3f6ee); border:1px solid #dbe3d1; border-radius:10px; }
.hamburg-map-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.hamburg-map-heading h2 { margin:0; font-size:18px; }
.hamburg-map-heading button { min-width:40px; }
.hamburg-map-style { display:flex; align-items:center; flex-wrap:wrap; gap:14px 24px; margin-top:14px; }
.hamburg-map-style label { display:flex; align-items:center; gap:8px; font-size:12px; white-space:nowrap; }
.hamburg-map-style input[type=checkbox] { width:16px; height:16px; margin:0; padding:0; flex:none; accent-color:var(--green); }
.hamburg-map-style select { width:auto; min-width:110px; padding:7px 10px; }
#hamburg-map-imagery-status[data-state="loading"] { color:#6e786b; }
.orientation-map { display:block; position:relative; z-index:0; width:100%; aspect-ratio:5/3; min-height:260px; border-radius:6px; overflow:hidden; background:#edf1e5; }
.orientation-map .leaflet-tile { max-width:none !important; max-height:none !important; }
.orientation-map .hongkong-vector-labels { z-index:3; pointer-events:none; }
.orientation-map .hongkong-map-credit { max-width:calc(100% - 20px); background:rgba(255,255,255,.88); padding:3px 5px; font:10px/1.3 sans-serif; }
.hongkong-map-credit a { display:flex; align-items:center; gap:5px; color:#273d35; }
.hongkong-map-credit img { flex:none; }
.orientation-map:focus-visible { outline:2px solid var(--green); outline-offset:3px; }
#city-map { display:block; width:100%; aspect-ratio:5/3; cursor:crosshair; touch-action:none; border-radius:6px; overflow:hidden; }
#hamburg-coverage { pointer-events:none; }
#hamburg-source .file-drop { margin-bottom:8px; }
body[data-source="file"] #source-dimensions { display:none; }
