:root {
  color-scheme: light;
  --page: #f4f4f1;
  --panel: #ffffff;
  --text: #1d2429;
  --muted: #5b666d;
  --line: #d9dedb;
  --accent: #a84213;
  --accent-hover: #87340e;
  --accent-soft: #fff0e4;
  --canvas: #20282b;
  --canvas-text: #f5f7f5;
  --focus: #146b8c;
  --danger: #a52929;
  --radius: 6px;
  --header-height: 76px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Task-specific setup stays outside the editor render tree: inputs keep focus. */
#roof-setup { padding:0; border:1px solid var(--line); border-radius:10px; width:min(1120px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); color:var(--text); background:var(--panel); box-shadow:0 24px 90px #0005; }
#roof-setup::backdrop { background:#162329b3; }
#roof-setup-form { display:flex; flex-direction:column; max-height:calc(100dvh - 34px); }
.roof-setup-header { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:18px 24px; border-bottom:1px solid var(--line); }
.roof-setup-header h2 { margin:0; font-size:23px; }
.roof-setup-header .eyebrow { margin:0 0 3px; font-size:12px; color:var(--muted); }
.roof-setup-body { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(300px,1fr); min-height:0; overflow:auto; }
.roof-setup-photo { background:#20282b; color:#fff; padding:16px; position:sticky; top:0; align-self:start; }
.roof-setup-photo>p { margin:0 0 12px; font-size:13px; }
.roof-setup-photo #roof-preview-status { margin:12px 0 0; min-height:20px; }
#roof-setup-preview { width:100%; display:block; max-height:54dvh; min-height:240px; touch-action:manipulation; }
.roof-edge[role=button] { cursor:pointer; outline:none; }
.roof-edge:focus-visible line { stroke:var(--focus); }
.roof-setup-settings { padding:20px 24px; }
.roof-setup-settings fieldset { border:0; padding:0; margin:0; min-width:0; }
.roof-setup-settings legend,.roof-setup-settings h3 { font-size:15px; font-weight:650; margin:0 0 10px; }
.roof-setup-settings h3 { margin-top:24px; }
.roof-setup-settings .hint { margin:10px 0 14px; }
.roof-shapes { display:grid; gap:8px; }
.roof-shapes .button { justify-content:flex-start; }
.roof-edge-buttons { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.roof-setup-settings [aria-pressed=true],.orientation-choice [aria-pressed=true] { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.roof-edge-buttons [aria-pressed=true] { background:#e5f7f2; border-color:#00705e; color:#005448; box-shadow:inset 0 0 0 1px #00705e; }
.roof-setup-footer { display:flex; flex-shrink:0; justify-content:space-between; gap:16px; padding:14px 24px; border-top:1px solid var(--line); background:#fff; }
.roof-setup-footer .button { min-height:44px; }
.orientation-choice { display:flex; align-items:center; gap:6px; }
.orientation-choice .button { min-height:44px; flex:1; }
.module-orientation-icon { display:inline-block; border:2px solid currentColor; width:16px; height:24px; background:repeating-linear-gradient(0deg,transparent 0 5px,currentColor 5px 6px); }
.module-orientation-icon.landscape { width:24px; height:16px; }
.orientation-bar { flex-shrink:0; }
.orientation-bar .orientation-choice { flex-shrink:0; }
.orientation-bar [data-action=orientation-portrait]::before,.orientation-bar [data-action=orientation-landscape]::before { content:''; display:inline-block; border:1.5px solid currentColor; width:12px; height:19px; }
.orientation-bar [data-action=orientation-landscape]::before { width:19px; height:12px; }
#roof-setup-error:empty { display:none; }
[data-roof-rectangle][hidden],[data-roof-other][hidden] { display:none; }
[data-roof-retry][hidden] { display:none; }
@media(max-width:700px) {
 #roof-setup { width:calc(100vw - 12px); max-height:calc(100dvh - 12px); border-radius:8px; }
 #roof-setup-form { max-height:calc(100dvh - 14px); }
 .roof-setup-header { padding:12px 16px; }
 .roof-setup-header h2 { font-size:20px; }
 .roof-setup-body { display:flex; flex-direction:column; overflow:hidden; }
 .roof-setup-photo { position:static; padding:10px 12px; flex-shrink:0; align-self:stretch; }
 #roof-setup-preview { height:20dvh; min-height:105px; max-height:190px; }
 .roof-setup-photo>p { font-size:12px; margin-bottom:6px; }
 .roof-setup-photo #roof-preview-status { margin-top:6px; }
 .roof-setup-settings { padding:18px 16px; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
 .roof-setup-footer { padding:10px 12px; gap:8px; }
 .roof-setup-footer .button { font-size:13px; }
 .orientation-bar { gap:4px 8px; padding:6px 10px; }
 .orientation-bar>span { flex-basis:100%; }
 .orientation-bar .button { min-height:44px; font-size:12px; }
}

.tile-entry { width:100%; margin:0 0 16px; }
.field-panel { padding:20px 0; border-bottom:1px solid var(--line); }
.field-panel h3 { margin:0 0 10px; font-size:15px; }
.field-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.field-panel-heading h3 { margin:0; }
.field-list { display:grid; max-height:194px; overflow:auto; margin:8px 0 16px; gap:4px; }
.field-list-item { text-align:left; display:grid; gap:3px; min-height:52px; padding:8px 10px; background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:var(--radius); cursor:pointer; }
.field-list-item small { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
.field-list-item.active { background:var(--accent-soft); border-color:var(--accent); }
.field-list-item.active small { color:#79360f; }
.field-panel .field-controls { display:block; padding-top:12px; }
.field-panel .field-controls>form { margin-top:16px; }
.field-selection-summary { font-weight:600; font-variant-numeric:tabular-nums; }
.field-empty-message { font-size:13px; padding:10px; background:#f2f6f7; color:#25424d; border-radius:var(--radius); }
.field-selection-bar { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; padding:4px 16px; background:var(--accent-soft); color:#79360f; border-bottom:1px solid #e7c6af; }
.field-selection-bar>span { margin-right:auto; font-weight:600; font-size:13px; }
.field-selection-bar .button { min-height:40px; padding:6px 8px; }
.field-selection-bar .button span { white-space:nowrap; }
.roof-analysis-feedback { display:grid; gap:3px; max-width:290px; margin-top:6px; font-size:12px; }
.roof-analysis-feedback strong { font-weight:600; }
.roof-analysis-feedback span { font-size:11px; color:var(--muted); }
.field-selection-bar.orientation-bar .button { min-height:44px; }
#roof-setup [aria-pressed=true],.orientation-choice .button[aria-pressed=true] { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
#roof-setup .roof-edge-buttons [aria-pressed=true] { background:#e5f7f2; border-color:#00705e; color:#005448; }
.field-hit,.field-label { cursor:grab; }
.field-hit:active,.field-label:active { cursor:grabbing; }
@media (max-width:850px) { .field-selection-bar { padding-inline:10px; gap:2px 6px; } .field-selection-bar>span { flex:1 1 100%; } .field-selection-bar .button { flex:1; } }
.perspective-panel { padding:20px 0; border-bottom:1px solid var(--line); }
.perspective-panel h3 { margin:0 0 8px; }
.perspective-panel>.button { width:100%; margin:4px 0; white-space:normal; }
.perspective-panel.has-mismatch h3 { color:var(--danger); }
.scale-alert { flex-shrink:0; padding:10px 16px; border:0; border-bottom:1px solid #d19a66; background:#fff0df; color:#763b08; text-align:left; cursor:pointer; font:inherit; font-weight:600; }
.scale-alert:hover { background:#ffe1bd; }
.inspector[data-mode="perspective"]>.form-section:not(:has(.perspective-panel)),.inspector[data-mode="reference"]>.form-section:not(:has(#reference-form)) { display:none; }
.tile-panel { padding:24px 0; border-bottom:1px solid var(--line); }
.tile-panel h3 { margin:0 0 8px; }
.tile-panel .tile-cover { margin-top:12px; }
.tile-panel .tile-cover[hidden] { display:none; }
.tile-help { margin-top:12px; font-size:12px; color:var(--muted); }
.tile-help summary { cursor:pointer; padding:8px 0; }
.tile-panel input[readonly] { background:var(--page); color:var(--muted); }
.tile-estimate { width:100%; margin:8px 0 16px; }
.tile-counts { display:grid; gap:14px; }
.count-input { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; gap:6px; }
.count-input input { text-align:center; font-size:16px; font-variant-numeric:tabular-nums; }
.count-input button { display:grid; place-items:center; min-height:44px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); color:var(--text); cursor:pointer; }
.count-input button:hover { background:var(--accent-soft); }
.tile-result { display:grid; gap:4px; padding:16px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin:16px 0; }
.tile-result>span { color:var(--muted); font-size:12px; }
.tile-result strong { font-size:19px; font-variant-numeric:tabular-nums; }
.tile-status,.tile-message { font-size:14px; line-height:1.5; color:var(--text); }
.tile-align { margin-bottom:18px; }
.tile-align > .button { width:100%; }
.tile-align > .hint:last-child { margin:8px 0 0; }
.tile-message { margin:0 0 16px; padding:12px; background:#eef5f3; border:1px solid #a9c7bc; border-radius:var(--radius); }
.tile-message strong { display:block; }
.tile-message p { margin:5px 0 0; }
.tile-message[data-status="unavailable"],.tile-message[data-status="error"],.tile-message[data-status="partial"] { background:#fff4e8; border-color:#d3ae83; color:#673810; }
.tile-feedback strong { display:block; }
.tile-feedback span { display:block; margin-top:3px; }
.inspector[data-mode="tiles"] > .perspective-panel { display:none; }
.tile-actions { display:grid; gap:8px; margin-top:16px; }
.inspector[data-mode="tiles"]>.form-section { display:none; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-hover); }
svg { display: block; }
button svg, .button svg { width: 19px; height: 19px; flex: 0 0 auto; }
p { margin: 0 0 12px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; text-wrap: balance; }
h1 { font-size: 28px; letter-spacing: -.025em; }
h2 { font-size: 19px; letter-spacing: -.015em; }
h3 { font-size: 15px; }
small { font-size: 12px; }
::selection { background: #ffd9ba; color: #50220d; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, textarea { caret-color: var(--accent); }
::placeholder { color: #68747a; opacity: 1; }
* { scrollbar-width: thin; scrollbar-color: #aeb7b4 transparent; }
[hidden] { display: none !important; }

#app { height: 100vh; height: 100dvh; min-height: 480px; display: flex; flex-direction: column; }
.app-header {
  min-height: var(--header-height); padding: 12px 24px;
  display: flex; align-items: center; gap: 24px; flex: 0 0 auto;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 700; white-space: nowrap; }
.brand > svg { width: 29px; height: 29px; color: var(--accent); }
.brand small, .brand span small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; line-height: 1.3; letter-spacing: .015em; }
.project-title { flex: 1 1 180px; min-width: 100px; max-width: 420px; }
.project-title input, input.project-title { width: 100%; border: 1px solid transparent; background: transparent; border-radius: var(--radius); min-height: 44px; padding: 10px 12px; font-size: 15px; font-weight: 600; color: var(--text); }
.project-title input:hover, input.project-title:hover { border-color: var(--line); }
.project-title input:focus, input.project-title:focus { background: var(--page); border-color: var(--accent); outline: 2px solid #e3b69d; outline-offset: 1px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.save-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-status svg { width: 15px; height: 15px; }

.button, .tool {
  min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel); color: var(--text); font-weight: 600; line-height: 1.25;
  text-decoration: none; transition: background-color 140ms ease-out, border-color 140ms ease-out;
}
.button:hover, .tool:hover { background: #f2f4f2; border-color: #aeb8b2; }
.button.primary, button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover, button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { background: var(--panel); }
.button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button.quiet:hover { background: #edf0ed; color: var(--text); }
.button.danger { color: var(--danger); border-color: #e7c7c7; background: #fff; }
.button.danger:hover { background: #fff0ef; border-color: #ce9595; }
.button.icon-only, button.icon-only { padding: 10px; width: 44px; min-width: 44px; }
.button:disabled, .tool:disabled { opacity: .48; }
.button.primary:disabled { background: #8c7770; border-color: #8c7770; opacity: 1; }
.inline-actions, .mini-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-actions > .button { flex: 1 1 auto; }
.mini-actions .button { padding-inline: 10px; font-size: 12px; }
.busy { cursor: progress !important; }
.spinner { display: inline-block; width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr) 288px; min-height: 0; flex: 1 1 auto; }
.sidebar, .inspector { min-width: 0; min-height: 0; background: var(--panel); overflow-y: auto; overscroll-behavior: contain; }
.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); padding: 20px; }
.panel-heading, .inspector-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-heading { padding: 20px 16px 12px; }
.panel-heading h2, .inspector-heading h2 { font-size: 16px; }
.panel-heading .button { margin: -8px -6px; }
.image-card { padding: 16px; border-bottom: 1px solid var(--line); }
.image-card img { width: 100%; height: 104px; object-fit: cover; border-radius: var(--radius); background: var(--canvas); }
.image-card h3, .image-card strong { display: block; margin-top: 10px; font-size: 14px; overflow-wrap: anywhere; }
.image-card p, .image-card small { display: block; margin: 4px 0 10px; color: var(--muted); font-size: 12px; }
.image-card .button { width: 100%; }
.plane-list { display: flex; flex-direction: column; padding: 0 8px 16px; gap: 4px; }
.plane-row { display: flex; align-items: center; gap: 0; border: 1px solid transparent; border-radius: var(--radius); min-height: 68px; }
.plane-row:hover { background: #f5f6f3; }
.plane-row.active { background: var(--accent-soft); border-color: #ecc8ad; }
.plane-select { text-align: left; flex: 1; min-width: 0; min-height: 64px; padding: 10px 8px 10px 0; border: 0; background: transparent; color: var(--text); line-height: 1.35; }
.plane-select strong, .plane-select b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.plane-meta { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plane-row.active .plane-meta { color: #794425; }
.plane-row .plane-number, .plane-row .plane-letter { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; background: #e8ece8; border-radius: 4px; margin-right: 6px; font-size: 12px; }
.sidebar-bottom { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); }
.sidebar-bottom > .button { width: 100%; margin-bottom: 8px; }
.sidebar-bottom .hint { margin: 0; }
input[type="checkbox"] { appearance: none; position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; flex: 0 0 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; border-radius: var(--radius); }
input[type="checkbox"]::before { content: ""; width: 19px; height: 19px; border: 1.5px solid #77867e; background: #fff; border-radius: 4px; }
input[type="checkbox"]:checked::before { border-color: var(--accent); background: var(--accent); }
input[type="checkbox"]:checked::after { content: ""; position: absolute; top: 17px; left: 17px; width: 9px; height: 5px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg); }
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .5; }

.workarea { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--page); }
.canvas-toolbar { padding: 10px 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; background: var(--panel); border-bottom: 1px solid var(--line); flex: 0 0 auto; z-index: 3; }
.canvas-toolbar .tool { padding-inline: 10px; font-size: 12px; font-weight: 600; border-color: transparent; background: transparent; }
.canvas-toolbar .tool:hover { background: #f0f2ee; border-color: #d9dedb; }
.canvas-toolbar .tool.active, .tool[aria-pressed="true"] { background: var(--accent-soft); color: #81350f; border-color: #e8b797; }
.canvas-toolbar .toolbar-divider { height: 24px; width: 1px; background: var(--line); margin-inline: 2px; }
.tool-help { min-height: 38px; padding: 8px 14px; color: #4a575e; background: #f5f6f2; font-size: 12px; border-bottom: 1px solid var(--line); }
.canvas-stage { position: relative; isolation: isolate; min-height: 260px; min-width: 0; overflow: hidden; flex: 1 1 auto; background: var(--canvas); }
#roof-canvas { display: block; width: 100%; height: 100%; min-height: 260px; touch-action: none; user-select: none; -webkit-user-select: none; }
#roof-canvas:focus-visible { outline-offset: -4px; }
.canvas-message { position: absolute; z-index: 3; top: 12px; left: 12px; max-width: min(460px, calc(100% - 24px)); background: #ffffff; color: var(--text); padding: 10px 12px; border-radius: var(--radius); font-size: 12px; box-shadow: 0 3px 12px #00000025; pointer-events: none; }
.canvas-message p:last-child { margin-bottom: 0; }
.canvas-message strong { display: block; font-size: 13px; margin-bottom: 3px; }
.canvas-message:empty { display: none; }
.source-caption { position: absolute; z-index: 2; bottom: 10px; left: 12px; max-width: calc(100% - 24px); padding: 4px 7px; background: #20282be8; color: #edf1ee; font-size: 10px; line-height: 1.4; border-radius: 3px; pointer-events: auto; }
.source-caption a { color: #fff; }
.source-caption:empty { display: none; }
.canvas-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 16px; background: var(--panel); border-top: 1px solid var(--line); flex: 0 0 auto; }
.canvas-footer > .primary { min-width: 190px; }
.totals { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.totals > div, .totals > span { display: flex; flex-direction: column; gap: 2px; }
.totals strong { font-size: 22px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.totals small { color: var(--muted); font-size: 11px; }
.totals .hint { flex-basis: 100%; }

.inspector-heading { align-items: flex-start; margin-bottom: 12px; }
.inspector-heading h2 { overflow-wrap: anywhere; }
.status-tag { display: inline-flex; gap: 5px; align-items: center; border-radius: 4px; padding: 4px 7px; background: #f2ece0; color: #74551d; font-size: 11px; line-height: 1.3; font-weight: 600; }
.status-tag.verified, .status-tag.confirmed { background: #e8f1eb; color: #326042; }
.status-tag.warning { background: #fff0e4; color: #8c3b17; }
.form-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section h3 { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.form-grid .full, .field.full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.form-grid .field { margin-bottom: 0; }
.field label, .field > span:first-child { font-size: 12px; font-weight: 600; color: #49565d; }
.field input:not([type="checkbox"]), .field select, .field textarea, .measure-box input, .dialog input:not([type="checkbox"]), .dialog select {
  display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid #b9c3bd;
  background: #fff; color: var(--text); border-radius: var(--radius); padding: 9px 10px;
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.field input:hover, .field select:hover { border-color: #829389; }
.field input:focus, .field select:focus, .field textarea:focus, .measure-box input:focus, .dialog input:focus { border-color: var(--accent); outline: 2px solid #ebc4ad; outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--danger); background: #fff6f5; }
.field select { padding-right: 22px; }
.field textarea { min-height: 88px; resize: vertical; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 8px; overflow-wrap: anywhere; }
.hint strong { color: #49565d; font-weight: 600; }
.hint.error, .error { color: var(--danger); }
.hint.warning { color: #87511d; }
.check-line { display: flex; align-items: center; gap: 0; min-height: 44px; margin-left: -10px; font-size: 13px; cursor: pointer; }
.check-line span { flex: 1; }
.field-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.field-controls .button { flex: 1 1 auto; padding-inline: 10px; }
.measure-box { padding: 12px; margin-top: 12px; background: #f4f5ef; border: 1px solid #d6ddcf; border-radius: var(--radius); }
.measure-box h3, .measure-box strong { display: block; margin-bottom: 8px; }
.measure-box .button { margin-top: 8px; }
.empty-panel { padding: 24px 20px; color: var(--muted); line-height: 1.55; }
.empty-panel h2, .empty-panel h3, .empty-panel strong { color: var(--text); display: block; margin-bottom: 8px; }
.empty-panel > svg { color: #7c8a81; width: 32px; height: 32px; margin-bottom: 16px; }
.empty-panel .button { margin-top: 10px; }
.mobile-nav { display: none; }

.welcome { overflow-y: auto; min-height: 0; flex: 1; padding: 48px max(24px, calc((100vw - 1160px) / 2)) 40px; }
.welcome-intro { max-width: 730px; margin-bottom: 24px; }
.welcome-intro h1 { margin-bottom: 12px; }
.welcome-intro p { font-size: 16px; color: var(--muted); line-height: 1.6; max-width: 68ch; }
.start-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 40px; }
.start-actions .button { padding: 12px 20px; min-height: 48px; }
.welcome > h2 { margin: 32px 0 16px; }
.welcome > p, .welcome > .hint { max-width: 80ch; }
.examples-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.example-card { appearance: none; display: block; min-width: 0; padding: 0; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 10px; text-align: left; overflow: hidden; transition: border-color 140ms ease-out, background-color 140ms ease-out; }
.example-card:hover { border-color: var(--accent); background: #fffaf6; }
.example-card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--canvas); }
.example-copy { padding: 16px; }
.example-copy h3, .example-copy strong { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 650; }
.example-copy p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 0; }
.example-copy small { display: block; color: #77503c; margin-top: 10px; }
.example-copy > span { color: var(--muted); font-size: 12px; display: block; line-height: 1.5; }
.recent-list { display: flex; flex-direction: column; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); max-width: 740px; }
.recent-list > h2, .recent-list > h3 { margin: 12px 0; }
.recent-list > button, .recent-list .recent-item { min-height: 60px; display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; text-align: left; }
.recent-list > button:hover, .recent-list .recent-item:hover { background: #eceedf; }
.recent-list small { color: var(--muted); display: block; }
.recent-list svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: #101b22a6; overflow-y: auto; }
.dialog { width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 28px; border-radius: 10px; background: var(--panel); box-shadow: 0 16px 60px #00000035; }
.dialog h2 { margin-bottom: 14px; }
.dialog p { color: var(--muted); }
.dialog .examples-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dialog .example-copy { padding: 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 24px; }
#toast { position: fixed; z-index: 150; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 32px)); padding: 12px 18px; border-radius: var(--radius); background: #1d3028; color: #fff; font-size: 14px; line-height: 1.45; box-shadow: 0 5px 24px #00000030; pointer-events: none; }
#toast:empty, #toast[hidden] { display: none; }
#toast.error { background: #842a26; color: #fff; }

@media (max-width: 1280px) {
  .app-header { padding-inline: 16px; gap: 16px; }
  .workspace { grid-template-columns: 240px minmax(0, 1fr) 270px; }
  .inspector { padding: 16px; }
  .header-actions { gap: 6px; }
  .save-status { max-width: 130px; white-space: normal; font-size: 11px; }
  .canvas-footer { gap: 12px; }
  .totals { gap: 12px; }
  .totals strong { font-size: 20px; }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 230px minmax(0, 1fr) 250px; }
  .app-header { gap: 12px; }
  .header-actions .button { padding-inline: 10px; font-size: 12px; }
  .brand { font-size: 16px; }
  .brand > svg { width: 26px; height: 26px; }
  .project-title { max-width: 260px; }
  .canvas-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .canvas-toolbar .tool { flex: 0 0 auto; }
  .canvas-footer { padding: 12px; align-items: stretch; }
  .canvas-footer > .primary { width: 100%; }
  .examples-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome { padding-top: 36px; }
}
@media (max-width: 850px) {
  :root { --header-height: 108px; }
  #app { min-height: 100vh; min-height: 100dvh; height: auto; padding-bottom: 72px; }
  .app-header { min-height: 108px; padding: 8px 12px; gap: 4px 12px; flex-wrap: wrap; align-content: center; }
  .brand { min-height: 44px; flex: 0 0 auto; }
  .brand > svg { width: 25px; height: 25px; }
  .brand small { display: none; }
  .project-title { flex: 1 1 150px; max-width: none; }
  .project-title input, input.project-title { padding-inline: 8px; font-size: 14px; }
  .header-actions { flex: 1 1 100%; justify-content: flex-start; gap: 6px; min-width: 0; flex-wrap: wrap; }
  .header-actions .save-status { margin-left: auto; max-width: 116px; }
  .header-actions .button { font-size: 12px; }
  .header-actions .button svg { width: 17px; height: 17px; }
  .workspace { display: block; min-height: 0; flex: 1; }
  .workspace > .sidebar, .workspace > .inspector, .workspace > .workarea { display: none; }
  .workspace[data-mobile-panel="canvas"] > .workarea,
  .workspace:not([data-mobile-panel]) > .workarea { display: flex; }
  .workspace[data-mobile-panel="planes"] > .sidebar { display: flex; }
  .workspace[data-mobile-panel="details"] > .inspector { display: block; }
  .sidebar, .inspector { border: 0; min-height: calc(100dvh - 180px); overflow: visible; }
  .sidebar { padding-bottom: 16px; }
  .sidebar .image-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 16px; padding: 16px; }
  .sidebar .image-card img { grid-row: span 4; height: 100px; }
  .sidebar .image-card h3, .sidebar .image-card strong { margin-top: 0; }
  .sidebar .image-card .button { width: fit-content; }
  .panel-heading { padding-inline: 20px; }
  .plane-list { padding-inline: 12px; }
  .plane-select { min-height: 68px; }
  .plane-row { min-height: 72px; }
  .plane-row .plane-meta { font-size: 13px; }
  .sidebar-bottom { margin-top: 12px; }
  .inspector { padding: 22px 20px 28px; }
  .inspector .form-grid { gap: 14px; }
  .inspector .form-section { margin-top: 24px; padding-top: 24px; }
  .field label, .field > span:first-child { font-size: 13px; }
  .field input:not([type="checkbox"]), .field select, .field textarea, .measure-box input, .dialog input { font-size: 16px; }
  .hint, .tool-help { font-size: 12px; }
  .workarea { height: calc(100dvh - 180px); min-height: 560px; }
  .canvas-toolbar { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 8px; }
  .canvas-toolbar .tool { min-height: 44px; padding-inline: 12px; }
  .tool-help { padding: 8px 12px; min-height: 38px; }
  .canvas-stage, #roof-canvas { min-height: 340px; }
  .canvas-message { top: 10px; left: 10px; max-width: calc(100% - 20px); padding: 8px 10px; font-size: 11px; }
  .source-caption { left: 8px; bottom: 8px; max-width: calc(100% - 16px); font-size: 9px; }
  .canvas-footer { padding: 12px; gap: 10px; }
  .canvas-footer > .primary { flex: 1 1 190px; width: auto; min-width: 0; }
  .totals { flex: 1 1 150px; justify-content: flex-start; gap: 20px; }
  .totals strong { font-size: 21px; }
  .totals small { font-size: 11px; }
  .mobile-nav { position: fixed; z-index: 40; bottom: 0; inset-inline: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); min-height: 64px; background: #fff; border-top: 1px solid #cbd3cc; }
  .mobile-nav button { border: 1px solid transparent; border-radius: var(--radius); background: #fff; color: var(--muted); min-height: 48px; padding: 8px 6px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 600; }
  .mobile-nav button svg { width: 18px; height: 18px; }
  .mobile-nav button.active, .mobile-nav button[aria-selected="true"], .mobile-nav button[aria-pressed="true"] { color: #81350f; border-color: #edcbb4; background: var(--accent-soft); }
  .welcome { overflow: visible; padding: 28px 20px 40px; }
  .welcome-intro { margin-bottom: 20px; }
  .welcome-intro h1 { max-width: 24ch; }
  .welcome-intro p { font-size: 15px; }
  .start-actions { margin-block: 24px 32px; gap: 10px; }
  .start-actions .button { flex: 1 1 180px; min-height: 48px; padding-inline: 14px; }
  .examples-grid { gap: 16px; margin-top: 16px; }
  .example-copy { padding: 14px; }
  .dialog { padding: 22px; }
  #toast { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); font-size: 13px; }
}
@media (max-width: 520px) {
  .app-header { gap: 2px 8px; }
  .brand { font-size: 16px; gap: 7px; }
  .project-title { flex-basis: 120px; }
  .header-actions { gap: 4px; }
  .header-actions .button { padding-inline: 9px; gap: 5px; }
  .header-actions .save-status { max-width: 100px; font-size: 10px; }
  .canvas-footer { align-items: center; }
  .canvas-footer > .primary { flex-basis: 100%; }
  .totals { flex: 1 1 100%; justify-content: space-between; padding-inline: 2px; }
  .workarea { min-height: 584px; }
  .welcome { padding: 28px 18px 36px; }
  .welcome-intro h1 { font-size: 26px; }
  .examples-grid { grid-template-columns: 1fr; gap: 20px; }
  .example-card img { aspect-ratio: 16 / 9; }
  .example-copy p { font-size: 13px; }
  .example-copy h3, .example-copy strong { font-size: 17px; }
  .dialog-backdrop { padding: 12px; align-items: flex-start; }
  .dialog { margin-top: 12px; max-height: calc(100dvh - 48px); padding: 20px; }
  .dialog-actions .button { flex: 1 1 130px; }
  .dialog .examples-grid { grid-template-columns: 1fr; }
  .dialog .example-card { display: grid; grid-template-columns: 100px minmax(0, 1fr); }
  .dialog .example-card img { aspect-ratio: auto; height: 100%; min-height: 100px; }
  .dialog .example-copy { padding: 10px; }
}
@media (max-height: 650px) and (min-width: 851px) {
  #app { min-height: 600px; }
  .app-header { min-height: 64px; padding-block: 8px; }
  .image-card img { height: 72px; }
  .canvas-stage, #roof-canvas { min-height: 240px; }
}
@media (max-height: 500px) and (max-width: 850px) {
  #app { padding-bottom: 66px; }
  .app-header { min-height: 100px; }
  .workarea { height: auto; min-height: 560px; }
  .canvas-stage { height: 340px; flex: 0 0 340px; }
  #roof-canvas { min-height: 340px; }
  .mobile-nav { min-height: 60px; padding-block: 4px; }
  .welcome { padding-top: 24px; }
  .dialog-backdrop { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .spinner { border-right-color: currentColor; opacity: .65; }
}
@media print {
  #app, #toast, .dialog-backdrop, .mobile-nav { display: none !important; }
}


/* Integration corrections for the actual editor markup. */
body { display: flex; flex-direction: column; }
.button.icon-only { position: relative; flex: 0 0 44px; }
.button.icon-only > span {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.project-title > .save-status { margin-left: 12px; max-width: none; white-space: nowrap; }
.text-button {
  min-height: 44px; padding: 8px 6px; border: 0; border-radius: var(--radius);
  color: var(--accent); background: transparent; font-size: 12px; font-weight: 600;
  line-height: 1.35; text-align: left;
}
.text-button:hover { color: var(--accent-hover); background: var(--accent-soft); }
.text-button:disabled { opacity: .5; cursor: not-allowed; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin: 28px 0 16px; }
.section-heading h2 { font-size: 20px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.example-copy { display: block; }
.example-copy small { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.example-copy small svg { width: 16px; height: 16px; flex: 0 0 auto; }
.sidebar > .inline-actions { padding: 16px 16px 0; }
.sidebar > .inline-actions > [data-action="manual-roof"] { flex-basis:100%; }
.legacy-proposals { padding:0 12px 10px; }
.legacy-proposals .button { font-size:12px; width:100%; }
.proposal-review { flex:0 0 auto; padding:12px 16px; border-bottom:1px solid var(--line); background:#fff; }
.proposal-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; }
.proposal-heading h3 { margin:0; font-size:16px; }
.proposal-heading .button { padding:6px 8px; min-height:44px; font-size:12px; }
.proposal-status { margin:4px 0 8px; font-size:13px; line-height:1.4; }
.proposal-list,.proposal-actions { display:flex; flex-wrap:wrap; gap:6px; }
.proposal-list { margin-bottom:8px; }
.proposal-list .button { padding:7px 10px; min-height:44px; font-size:12px; }
.proposal-list .selected { background:#e7f4f9; color:#125572; border-color:#146b8c; }
.proposal-review .hint { margin:8px 0 0; }
.proposal-actions .button { min-width:0; font-size:12px; }
.proposal-shape { cursor:pointer; }
.workarea.reviewing .canvas-footer .planning-actions { display:none; }
@media(max-width:850px) { .proposal-review { padding:8px 12px; } .proposal-heading h3 { font-size:14px; } .proposal-status { font-size:12px; } .proposal-list { flex-wrap:nowrap; overflow-x:auto; } .proposal-list .button { flex-shrink:0; } .proposal-review .hint { display:none; } }
.sidebar > .hint { padding: 0 16px; margin-top: 8px; }
.sidebar .panel-heading { gap: 6px; }
.sidebar .panel-heading h2 { font-size: 15px; }
.sidebar .panel-heading .text-button { flex: 0 0 auto; padding-inline: 4px; font-size: 11px; }
.plane-check { flex: 0 0 44px; display: flex; align-items: center; justify-content: center; }
.plane-select { display: flex; align-items: flex-start; gap: 8px; }
.plane-select > span:last-child { min-width: 0; }
.plane-row .plane-number { flex: 0 0 22px; margin: 1px 0 0; }
.plane-source { display: block; margin-top: 4px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.plane-row.active .plane-source { color: #794425; }
.canvas-message > span { display: block; }
.canvas-message > small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.canvas-controls {
  position: absolute; z-index: 5; right: 12px; bottom: 42px;
  display: flex; align-items: center; gap: 4px; width: max-content;
  max-width: calc(100% - 24px); padding: 4px; border: 1px solid #c9d2ca;
  border-radius: var(--radius); background: var(--panel);
}
.canvas-controls .button { flex-shrink: 0; }
.canvas-controls .button.quiet { font-size: 12px; color: var(--text); padding-inline: 10px; }
.canvas-controls .icon-only { border-color: transparent; }
.canvas-controls .icon-only:hover { border-color: var(--line); }
.source-caption { max-width: calc(100% - 24px); line-height: 1.5; }
.tool-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.tool-help > span { flex: 1 1 180px; }
.tool-help > .button { font-size: 12px; }
.inspector-heading { align-items: flex-end; gap: 10px; }
.inspector-heading > div { flex: 1; min-width: 0; }
.inspector-heading > div > small { display: block; margin-bottom: 6px; color: var(--muted); }
.inspector-heading input {
  display: block; width: 100%; min-width: 0; min-height: 44px;
  padding: 9px 10px; border: 1px solid #b9c3bd; border-radius: var(--radius);
  background: var(--panel); color: var(--text); font-weight: 600; font-size: 14px;
}
.inspector-heading input:hover { border-color: #829389; }
.inspector-heading input:focus { border-color: var(--accent); outline: 2px solid #ebc4ad; outline-offset: 1px; }
.inspector-heading .danger { margin-bottom: 0; }
.form-grid + .button, .form-grid + label + .button { margin-top: 12px; }
.form-section.field-controls { display: block; }
.form-section.field-controls > form { width: 100%; }
.form-section.field-controls .mini-actions { margin-top: 8px; }
.obstacle-row { display: flex; align-items: center; gap: 6px; min-height: 48px; }
.obstacle-row .text-button { flex: 1; min-width: 0; overflow-wrap: anywhere; color: #49565d; }
.obstacle-row .icon-only { flex: 0 0 44px; }
details > summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 600; color: #49565d; }
.error-message { color: var(--danger); background: #fff3f0; padding: 10px; border-radius: var(--radius); font-size: 12px; line-height: 1.5; }
#toast {
  position: fixed; z-index: 150; left: 50%; right: auto;
  top: auto; bottom: 96px; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 32px));
  padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 4px 16px #00000024; font-size: 12px;
  line-height: 18px; background: #1d3028; color: #fff; text-align: center;
}
#toast:not(.visible) { display: none; }
@media (max-width: 850px) {
  .project-title > .save-status { margin-left: 8px; }
  .sidebar > .inline-actions { padding-inline: 20px; }
  .sidebar > .hint { padding-inline: 20px; }
  .sidebar .panel-heading .text-button { font-size: 12px; }
  .sidebar .panel-heading h2 { font-size: 16px; }
  .inspector-heading input { font-size: 16px; }
  .canvas-controls { right: 10px; bottom: 46px; max-width: calc(100% - 20px); }
  .source-caption { max-width: calc(100% - 16px); }
  .canvas-message > small { font-size: 10px; }
  .section-heading { margin-top: 24px; }
  .section-heading h2 { font-size: 19px; }
  #toast { bottom: calc(170px + env(safe-area-inset-bottom, 0px)); padding: 8px 16px; font-size: 12px; line-height: 17px; }
}


/* Keep the photo action above the fixed mobile navigation, including status messages. */
@media (max-width: 850px) {
  #app { height: 100vh; height: 100dvh; min-height: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .workspace { flex: 1 1 auto; min-height: 0; }
  .workarea { height: 100%; min-height: 0; }
  .canvas-stage { flex: 1 1 0; min-height: 0; height: auto; }
  #roof-canvas { min-height: 0; height: 100%; }
  .canvas-footer { flex: 0 0 auto; }
  .workarea.reviewing .canvas-stage,.workarea.reviewing #roof-canvas { min-height:180px; }
}
@media (max-height: 500px) and (max-width: 850px) {
  .workarea { height: 100%; min-height: 0; }
  .canvas-stage { min-height: 340px; height: auto; flex: 1 1 auto; }
}


/* Compact landscape keeps actions reachable while the photo captures touch gestures. */
@media (max-width: 850px) and (max-height: 500px) and (orientation: landscape) {
  body { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  #app, body:has(> #toast.visible) #app {
    flex: 1 1 0; height: auto; min-height: 0;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .app-header { min-height: 56px; padding: 6px 12px; flex-wrap: nowrap; gap: 12px; }
  .brand { min-height: 44px; font-size: 15px; gap: 7px; }
  .brand small, .brand span small, .project-title .save-status { display: none; }
  .brand > svg { width: 24px; height: 24px; }
  .project-title { flex: 1 1 160px; min-width: 90px; max-width: none; }
  .project-title input { min-height: 44px; padding-inline: 8px; font-size: 13px; }
  .header-actions { flex: 0 0 auto; flex-wrap: nowrap; min-height: 44px; gap: 4px; }
  .header-actions .button { min-height: 44px; padding-inline: 9px; }
  .header-actions .icon-only { width: 44px; flex-basis: 44px; }
  .workspace { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .workarea { height: 100%; min-height: 0; overflow: hidden; }
  .canvas-toolbar { flex: 0 0 auto; padding: 4px 8px; min-height: 52px; }
  .canvas-toolbar .tool { min-height: 44px; }
  .tool-help { min-height: 25px; flex: 0 0 auto; padding: 4px 10px; font-size: 11px; line-height: 17px; }
  .tool-help > .button { min-height: 44px; padding-inline: 10px; }
  .canvas-stage { flex: 1 1 0; min-height: 0; height: auto; }
  #roof-canvas { min-height: 0; height: 100%; }
  .canvas-message { top: 6px; left: 8px; padding: 5px 8px; font-size: 10px; }
  .canvas-message > small { display: none; }
  .canvas-controls { right: 8px; bottom: 23px; padding: 3px; }
  .canvas-controls .button { min-height: 44px; }
  .source-caption { bottom: 3px; left: 8px; padding: 2px 4px; font-size: 8px; line-height: 1.4; }
  .canvas-footer { flex: 0 0 auto; flex-wrap: nowrap; min-height: 57px; gap: 12px; padding: 6px 12px; }
  .canvas-footer > .primary { flex: 0 0 auto; min-width: 192px; width: auto; min-height: 44px; font-size: 12px; }
  .canvas-footer .totals { flex: 1 1 auto; min-width: 0; gap: 12px; justify-content: flex-start; }
  .canvas-footer .totals strong { font-size: 18px; }
  .canvas-footer .totals > span { font-size: 12px; }
  .mobile-nav { min-height: 56px; padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav button { min-height: 48px; }
  .workspace > .sidebar, .workspace > .inspector { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .workspace > .inspector { padding-top: 14px; }
  .welcome { min-height: 0; overflow-y: auto; }
  #toast { flex: 0 0 auto; max-height: 40px; overflow-y: auto; padding: 4px 12px; font-size: 11px; line-height: 16px; }
}


/* Layout transfer: show the destination before committing a copy. */
.layout-paste-dialog { max-width:640px; }
.layout-paste-dialog [data-paste-preview] { display:block; width:100%; height:220px; background:var(--canvas); border:1px solid var(--line); }
.layout-size-choice { display:flex; align-items:center; gap:10px; min-height:44px; padding-block:8px; }
.layout-size-choice input { width:20px; height:20px; flex-shrink:0; }

.module-edit-panel { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; padding:8px 12px; background:var(--panel); border-bottom:1px solid var(--line); }
.module-edit-panel>div { flex:1 1 280px; }
.module-edit-panel p { margin:4px 0 0; font-size:12px; }
.module-edit-panel>.button { min-height:44px; }
@media(max-width:850px) { .module-edit-panel>div { flex-basis:100%; } .module-edit-panel>span { margin-right:auto; } }

.workarea[data-editor-tool=erase] .planning-actions { display:none; }

/* Direct area settings: one task dialog, with a live photo beside the inputs. */
#surface-editor{padding:0;width:min(960px,calc(100vw - 32px));max-height:calc(100dvh - 32px);color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius)}
#surface-editor::backdrop{background:#14202880}
#surface-editor>header,#surface-editor>footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;background:var(--panel)}
#surface-editor>header{border-bottom:1px solid var(--line)}
#surface-editor h2{margin:0;font-size:22px}#surface-editor header p{margin:4px 0 0;color:var(--muted);font-size:14px}
#surface-editor>footer{border-top:1px solid var(--line)}
.surface-edit-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);gap:24px;padding:20px;max-height:calc(100dvh - 215px);overflow:auto}
.surface-edit-photo{position:sticky;top:0;align-self:start;min-width:0}.surface-edit-photo svg{width:100%;height:300px;display:block;background:var(--canvas);border-radius:var(--radius)}
.surface-edit-photo p{font-size:13px;line-height:1.5;margin:12px 0 0;color:var(--muted)}
#surface-edit-form{display:block;margin:0}#surface-edit-form fieldset{padding:0;margin:0 0 24px;border:0;min-width:0}#surface-edit-form legend{padding:0;margin-bottom:12px;font-weight:700;font-size:16px}
#surface-edit-form .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}#surface-edit-form input,#surface-edit-form select{width:100%;min-width:0;min-height:44px;font-size:16px}#surface-edit-form [hidden]{display:none!important}
#surface-edit-form .hint{font-size:12px;line-height:1.5;margin:10px 0}#surface-edit-form .field{margin-bottom:12px}.surface-edit-methods{display:grid;gap:8px;margin-top:12px}
@media(max-width:650px){#surface-editor{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}#surface-editor>header,#surface-editor>footer{padding:12px}.surface-edit-body{display:block;padding:12px;max-height:calc(100dvh - 175px)}.surface-edit-photo{position:static;margin-bottom:20px}.surface-edit-photo svg{height:160px}#surface-editor>footer .button{min-width:0;font-size:13px;padding-inline:10px}}
@media(max-width:650px){.surface-edit-photo{position:sticky;top:0;z-index:1;background:var(--panel);padding-bottom:12px}.surface-edit-photo svg{height:140px}.surface-edit-photo p{margin-top:6px;font-size:12px}}

/* Compact physical section beside the live mounting controls. */
.mounting-profile{display:flex;align-items:center;gap:16px;margin:8px 0;max-width:760px;color:#1d2429}
.mounting-profile svg{width:220px;height:90px;flex:none;background:#fff;border:1px solid #d9dedb;border-radius:4px}
.mounting-profile span,.mounting-profile small{display:block;line-height:1.5}.mounting-profile small{color:#5b666d}
.mounting-tilt[hidden]{display:none}.tile-side:focus-visible rect{stroke:#146b8c;stroke-width:3}
@media(max-width:650px){.mounting-profile{gap:10px;align-items:flex-start}.mounting-profile svg{width:120px;height:72px}.mounting-profile>div{font-size:12px}.mounting-profile small{font-size:11px}}

.mounting-profile-shell>summary{min-height:36px;padding:8px 0;cursor:pointer;color:#1d2429;font-size:13px}

.tile-side:focus{outline:none}
