/* Beta review: one canvas workspace, one properties scrollbar, stable actions. */
html body.planner-ui .ux-project-details,
html body.planner-ui .ux-check-details,
html body.planner-ui .ux-details { border-top: 1px solid #dde5e0; margin-top: 14px; padding-top: 10px; }
html body.planner-ui details > summary { cursor: pointer; }
html body.planner-ui .ux-project-details > summary,
html body.planner-ui .ux-check-details > summary,
html body.planner-ui .ux-details > summary { padding: 8px 0; color: #45564e; font-weight: 650; }
html body.planner-ui .ux-project-details > fieldset { margin-top: 12px; }
html body.planner-ui .ux-check-details > article { padding: 10px; margin-top: 8px; border-radius: 8px; background: #f5f8f6; }
html body.planner-ui .ux-check-details :is(small,strong) { display: block; }
html body.planner-ui #project-code-error { margin: 8px 0 0; }
html body.planner-ui .variant-dialog { width: min(640px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); overflow: auto; }
html body.planner-ui .variant-dialog .actions { position: static; margin: 20px 0 0; padding: 14px 0 0; min-height: 0; gap: 12px; flex-wrap: wrap; }
html body.planner-ui .variant-dialog form { min-width: 0; }
html body.planner-ui .variant-dialog :is(input,select) { width: 100%; }
html body.planner-ui .variant-dialog table { min-width: 600px; }
html body.planner-ui .ux-surface-menu { padding: 0; }
html body.planner-ui .ux-surface-menu > summary { padding: 10px 12px; border: 1px solid #d4deda; border-radius: 8px; white-space: nowrap; }
html body.planner-ui .ux-surface-menu > div { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
html body.planner-ui #editor-variant-label { letter-spacing: 0; text-transform: none; font-weight: 500; }
html body.planner-ui #result-variant-label { display: block; margin-top: 4px; color: #637268; }
html body.planner-ui .result-completion-head { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; }
html body.planner-ui .result-completion-head .result-metrics { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 18px; }
html body.planner-ui .result-completion-head .result-metrics > article { min-width: 0; padding: 10px !important; border: 1px solid #dce5df !important; border-radius: 8px; }
html body.planner-ui .result-completion-head .result-metrics strong { font-size: 19px !important; }
html body.planner-ui .result-completion-head .result-metrics small { font-size: 11px !important; }
html body.planner-ui .result-status-grid { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)); }
html body.planner-ui .result-status-grid > article { min-width: 0; padding: 10px !important; }
html body.planner-ui .result-followup-actions { padding: 8px; }
html body.planner-ui .result-more-actions { margin-top: 6px; }

html body.planner-ui .roof-total-title { margin: 18px 0 8px !important; padding-top: 14px; border-top: 1px solid #dce5df; }
html body.planner-ui .roof-active-group-info { margin: 10px 0; color: #69766e; font-size: 12px !important; }
html body.planner-ui .roof-property-result output { font-weight: 750; color: #1c4636; }
html body.planner-ui .roof-property-row[hidden],
html body.planner-ui .ux-roof-workspace #roof-fields-panel > .roof-property-row:has(> .roof-placement-type),
html body.planner-ui .roof-snap-properties label[hidden] { display: none !important; }
html body.planner-ui .roof-system-properties h3 { font-size: 16px !important; }
html body.planner-ui .ux-details .plan-advanced { margin: 0; border: 0; padding: 0; }
html body.planner-ui .ux-details .plan-advanced > h3,
html body.planner-ui .ux-details .roof-snap-title h3 { display: none; }
html body.planner-ui .roof-totals .windload-card { margin: 12px 0; padding: 10px; }
html body.planner-ui .roof-totals .wind-detail-grid,
html body.planner-ui .roof-totals .technical-image-grid { grid-template-columns: 1fr; }
html body.planner-ui .roof-totals .table-scroll { overflow-x: auto; }
html body.planner-ui .roof-totals .wind-table { min-width: 460px; }

/* The existing toolbar controls are retained, including angle and undo/redo. */
html body.planner-ui .ux-roof-workspace .plan-toolbar { display: flex !important; flex-wrap: wrap; align-items: start; gap: 10px; margin: 0 0 8px !important; padding: 8px !important; }
html body.planner-ui .ux-roof-workspace .plan-tools-group { display: flex !important; min-width: 0; flex: 1 1 240px; padding: 0 !important; border: 0 !important; }
html body.planner-ui .ux-roof-workspace .plan-tools-group:nth-child(2) { flex-basis: 490px; }
html body.planner-ui .ux-roof-workspace .plan-tools-group > small { display: none !important; }
html body.planner-ui .ux-roof-workspace .plan-tools-group > div { display: flex !important; flex-wrap: wrap; align-items: center; gap: 5px; }
html body.planner-ui .ux-roof-workspace .plan-toolbar .module-rotation-group { flex-wrap: wrap; }
html body.planner-ui .ux-roof-workspace .plan-toolbar button,
html body.planner-ui .ux-roof-workspace .plan-toolbar .plan-more > summary,
html body.planner-ui .ux-roof-workspace .module-snap-toggle { min-height: 34px !important; padding: 6px 8px !important; font-size: 12px !important; }
html body.planner-ui .ux-roof-workspace .roof-occupancy-sidebar { min-width: 0; padding: 14px !important; }
html body.planner-ui .ux-wall-workspace .placement-controls { grid-template-columns: 1fr !important; }
html body.planner-ui .ux-wall-workspace .placement-action-panel { padding: 8px !important; }
html body.planner-ui .ux-wall-workspace .variant-control { padding: 0 !important; border: 0 !important; margin-bottom: 12px; }
html body.planner-ui .ux-wall-workspace .placement-variant-buttons { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
html body.planner-ui .ux-wall-workspace .placement-variant { min-height: 48px !important; padding: 5px !important; }
html body.planner-ui .ux-wall-workspace .placement-variant strong { font-size: 12px !important; }
html body.planner-ui .ux-wall-workspace .placement-variant small { display: none; }
html body.planner-ui .ux-wall-workspace .layout-summary .module-select { margin: 10px 0 18px; }

@media (min-width: 760px) {
  html body.planner-ui.project-master-embed[data-fence-step="2"] { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  html body.planner-ui.project-master-embed[data-fence-step="2"] .fence-head { flex: 0 0 auto; position: static; padding: 6px 10px; }
  html body.planner-ui.project-master-embed[data-fence-step="2"] .fence-head > div:first-child,
  html body.planner-ui.project-master-embed[data-fence-step="2"] .fence-head .editor-master-nav { display: none !important; }
  html body.planner-ui.project-master-embed[data-fence-step="2"] > main { min-height: 0; width: 100%; flex: 1 1 0; display: flex; padding: 0 8px !important; }
  html body.planner-ui.project-master-embed .ux-fence-workspace.active { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; padding: 6px 0 !important; overflow: hidden; }
  html body.planner-ui.project-master-embed .ux-fence-workspace > .section-title { margin: 0 0 8px; gap: 8px; }
  html body.planner-ui.project-master-embed .ux-fence-workspace > .section-title :is(small,p) { display: none; }
  html body.planner-ui.project-master-embed .ux-fence-workspace > .section-title h1 { font-size: 16px !important; margin: 0; }
  html body.planner-ui.project-master-embed .ux-fence-workspace .editor-grid { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 10px; overflow: hidden; }
  html body.planner-ui.project-master-embed .ux-fence-workspace .canvas-panel { min-height: 0; height: 100%; align-self: stretch; display: flex; flex-direction: column; overflow: hidden; }
  html body.planner-ui.project-master-embed .ux-fence-workspace #fence-plan { width: 100%; height: 100% !important; min-height: 0 !important; flex: 1 1 0; }
  html body.planner-ui.project-master-embed .ux-fence-workspace .ux-fence-properties { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px; border: 1px solid #dce5df; border-radius: 8px; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
  html body.planner-ui .ux-fence-properties .selection-properties { max-height: none !important; overflow: visible !important; padding: 0; border: 0; }
  html body.planner-ui .ux-fence-properties .fence-obstacle-panel { margin: 12px 0 0 !important; padding: 0 !important; }
  html body.planner-ui .ux-fence-properties .fence-obstacle-panel input { width: 100%; }
  html body.planner-ui .ux-fence-properties .fence-obstacle-panel label { width: 100%; }
  html body.planner-ui.project-master-embed .ux-fence-workspace > footer { flex: 0 0 auto; margin: 8px 0 0; padding: 8px 0 0; position: static; }
  html body.planner-ui.project-master-embed .ux-fence-workspace .toolbar button { min-height: 34px !important; padding: 6px 8px !important; font-size: 12px !important; }
  html body.planner-ui.project-master-shell[data-step="3"] > main { grid-template-columns: minmax(0,1fr) !important; grid-template-rows: auto minmax(0,1fr) !important; gap: 0; padding: 8px 12px !important; max-width: none; }
  html body.planner-ui.project-master-shell[data-step="3"] > main > .steps { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)); position: static; overflow: visible; }
  html body.planner-ui.project-master-shell[data-step="3"] > main > .workspace { grid-column: 1; grid-row: 2; }
  html body.planner-ui.project-master-shell[data-step="3"] .planning-head { grid-template-columns: minmax(120px,180px) minmax(160px,1fr) auto; margin: 0; padding: 8px 12px !important; }
  html body.planner-ui.project-master-shell[data-step="3"] #surface-editor { min-height: 0 !important; flex: 1 1 0 !important; height: auto !important; }
  html body.planner-ui.project-master-embed:has(.ux-roof-workspace.active),
  html body.planner-ui.project-master-embed:has(.ux-wall-workspace.active) { height: 100dvh !important; min-height: 0; overflow: hidden; }
  html body.planner-ui.project-master-embed:has(.ux-roof-workspace.active) main,
  html body.planner-ui.project-master-embed:has(.ux-wall-workspace.active) main { height: 100dvh !important; min-height: 0; padding: 0 8px !important; display: block !important; }
  html body.planner-ui.project-master-embed:has(.ux-roof-workspace.active) .app-shell,
  html body.planner-ui.project-master-embed:has(.ux-wall-workspace.active) .planner-shell { height: 100% !important; }
  html body.planner-ui.project-master-embed:has(.ux-wall-workspace.active) .intro,
  html body.planner-ui.project-master-embed:has(.ux-wall-workspace.active) .steps { display: none !important; }
  html body.planner-ui.project-master-embed:has(.ux-roof-workspace.active) .panel,
  html body.planner-ui.project-master-embed:has(.ux-wall-workspace.active) .planner-shell,
  html body.planner-ui.project-master-embed:has(.ux-wall-workspace.active) .workspace { height: 100% !important; min-height: 0; display: block !important; }
  html body.planner-ui.project-master-embed .ux-roof-workspace.active,
  html body.planner-ui.project-master-embed .ux-wall-workspace.active { height: 100% !important; min-height: 0; padding: 8px !important; display: flex !important; flex-direction: column; gap: 0; overflow: hidden; }
  html body.planner-ui.project-master-embed .ux-wall-workspace.active > .section-head { display: none !important; }
  html body.planner-ui.project-master-embed .ux-roof-workspace .roof-occupancy-layout,
  html body.planner-ui.project-master-embed .ux-wall-workspace .layout-stage { display: grid !important; grid-template-columns: minmax(0,1fr) 310px !important; flex: 1 1 0; min-height: 0; gap: 10px; overflow: hidden; }
  html body.planner-ui.project-master-embed .ux-roof-workspace .roof-occupancy-sidebar,
  html body.planner-ui.project-master-embed .ux-wall-workspace .layout-summary { height: 100%; min-height: 0; max-height: none !important; overflow-y: auto !important; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
  html body.planner-ui.project-master-embed .ux-roof-workspace .plan-card,
  html body.planner-ui.project-master-embed .ux-wall-workspace .layout-stage > .canvas-panel { min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  html body.planner-ui.project-master-embed .ux-roof-workspace .solar-canvas { flex: 1 1 0; height: auto; min-height: 0 !important; display: flex; flex-direction: column; }
  html body.planner-ui.project-master-embed :is(.ux-roof-workspace #module-plan,.ux-wall-workspace #wall-layout) { display: block; width: 100% !important; height: 100% !important; min-height: 0 !important; flex: 1 1 0; }
  html body.planner-ui.project-master-embed :is(.ux-roof-workspace,.ux-wall-workspace) > .actions { position: static !important; flex: 0 0 auto; margin: 8px 0 0 !important; padding: 8px 0 0 !important; min-height: 0; }
  html body.planner-ui.project-master-embed .ux-roof-workspace :is(.plan-toolbar,.validation-bar,.ballast-alert,.error),
  html body.planner-ui.project-master-embed .ux-wall-workspace :is(.placement-controls,.validation,.error) { flex: 0 0 auto; }
  html body.planner-ui.project-master-embed .ux-roof-workspace .plan-head { padding: 7px 10px; }
  html body.planner-ui.project-master-embed .ux-roof-workspace .plan-legend { padding: 6px 10px; font-size: 11px; }
}
@media (max-width: 759px) {
  html body.planner-ui .ux-fence-workspace .editor-grid { grid-template-columns: minmax(0,1fr); }
  html body.planner-ui .ux-fence-properties { margin-top: 12px; }
  html body.planner-ui.project-master-shell[data-step="3"] { height: auto; overflow: auto; }
  html body.planner-ui.project-master-shell[data-step="3"] > main { overflow: visible; height: auto; min-height: 0; }
  html body.planner-ui .ux-roof-workspace .plan-toolbar { position: sticky; top: 0; z-index: 30; background: white; }
  html body.planner-ui .ux-roof-workspace .roof-occupancy-layout,
  html body.planner-ui .ux-wall-workspace .layout-stage { grid-template-columns: minmax(0,1fr) !important; }
  html body.planner-ui .ux-roof-workspace .roof-occupancy-sidebar,
  html body.planner-ui .ux-wall-workspace .layout-summary { overflow: visible; max-height: none !important; }
  html body.planner-ui .result-completion-head { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 600px) {
  html body.planner-ui .result-completion-head .result-metrics,
  html body.planner-ui .result-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html body.planner-ui .ux-roof-workspace .plan-tools-group:nth-child(2) { flex-basis: 100%; }
}

