:root {
  --hall-blue: #1188d1;
  --hall-blue-dark: #075f96;
  --hall-ink: #16232c;
  --hall-muted: #6f7f8a;
  --hall-border: #dbe3e7;
  --hall-panel: #ffffff;
  --hall-soft: #f4f7f8;
  --hall-sidebar-width: 390px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--hall-ink);
  background: #edf3f5;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

/* The hall has no product-specific upper/lower bar. The viewer occupies the full
   area below the shared top bar, while Hall settings float on the right. */
.app-shell {
  position: fixed;
  inset: var(--shared-topbar-height, 52px) 0 0 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #dfe9ec;
}
.viewer-panel,
.viewer-stage,
#canvasHost { position: absolute; inset: 0; min-width: 0; min-height: 0; }
.viewer-stage {
  overflow: hidden;
  background: radial-gradient(circle at 48% 28%, #f8fbfc 0, #e9f1f3 46%, #d4e0e4 100%);
}
#canvasHost canvas { display: block; width: 100%; height: 100%; }

.sidebar {
  position: absolute !important;
  z-index: 40;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto !important;
  width: var(--hall-sidebar-width) !important;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(255,255,255,.985);
  border: 0;
  border-left: 1px solid var(--hall-border);
  box-shadow: -11px 0 32px rgba(29,50,61,.09);
  transform: translateX(0);
  transition: transform .22s ease;
}
.sidebar.is-collapsed { transform: translateX(100%) !important; margin: 0 !important; }

/* Explicit right-side geometry keeps this correct even with older shared-shell CSS. */
.shared-settings-toggle {
  position: fixed !important;
  z-index: 860 !important;
  top: calc(var(--shared-topbar-height, 52px) + 18px) !important;
  right: var(--hall-sidebar-width) !important;
  left: auto !important;
  width: 44px !important;
  height: 48px !important;
  display: grid !important;
  place-items: center;
  margin: 0 !important;
  border: 1px solid var(--hall-border) !important;
  border-right: 0 !important;
  border-radius: 13px 0 0 13px !important;
  color: #31505e;
  background: rgba(255,255,255,.985) !important;
  box-shadow: -7px 4px 18px rgba(31,52,62,.10) !important;
  transition: right .22s ease !important;
}
body.hall-sidebar-collapsed .shared-settings-toggle { right: 0 !important; }
body.hall-sidebar-collapsed .shared-settings-toggle svg { transform: rotate(180deg); }

.panel-section { padding: 24px 26px; border-bottom: 1px solid #edf0f2; }
.intro-section { padding-top: 28px; }
.eyebrow { margin: 0 0 5px; color: var(--hall-blue-dark); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: 25px; line-height: 1.12; letter-spacing: -.03em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.025em; }
.section-copy { margin: 0; color: var(--hall-muted); font-size: 13px; line-height: 1.55; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #0a74b2; background: #eaf6fd; font-size: 12px; font-weight: 850; }
.control-list { display: grid; gap: 18px; }
.range-control { display: grid; gap: 8px; }
.range-control.top-gap { margin-top: 18px; }
.compact-control { gap: 7px; }
.control-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #263741; font-size: 12px; }
.control-label b { font-size: 13px; }
.control-label output { color: var(--hall-blue-dark); font-weight: 850; }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px; align-items: center; gap: 11px; }
input[type="range"] { width: 100%; accent-color: var(--hall-blue); }
.number-input { width: 76px; height: 36px; padding: 0 7px; border: 1px solid var(--hall-border); border-radius: 9px; color: #1d303a; background: #fff; text-align: center; font-size: 12px; font-weight: 750; }
.number-input:focus, select:focus { outline: 2px solid rgba(17,136,209,.18); border-color: var(--hall-blue); }
.select-label, .color-heading { display: block; margin: 0 0 8px; color: #53636d; font-size: 11px; font-weight: 800; }
select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--hall-border); border-radius: 10px; color: #21323c; background: #fff; font-size: 12px; font-weight: 700; }
.info-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; margin-top: 15px; padding: 13px 14px; border: 1px solid #d7e5ed; border-radius: 12px; background: #f1f8fc; }
.info-card span { color: #536873; font-size: 11px; font-weight: 700; }
.info-card strong { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--hall-blue-dark); font-size: 23px; }
.info-card small { color: #70828c; font-size: 10px; }
.profile-card small:last-child { grid-column: 1 / -1; margin-top: 4px; padding-top: 7px; border-top: 1px solid rgba(59,112,142,.14); }
.hea-reference-card { margin-top: 12px; padding: 12px; border: 1px solid #d7e5ed; border-radius: 12px; background: #f8fbfd; }
.hea-reference-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.hea-reference-heading > div { display: grid; gap: 2px; }
.hea-reference-heading b { color: #263741; font-size: 12px; }
.hea-reference-heading small, .hea-reference-source { color: #748690; font-size: 9px; line-height: 1.35; }
.hea-reference-heading > span { flex: none; padding: 3px 7px; border-radius: 999px; color: #0a74b2; background: #e7f4fb; font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.hea-reference-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid #e1e9ed; border-radius: 9px; background: #fff; scrollbar-width: thin; }
.hea-reference-table { width: max-content; min-width: 690px; border-collapse: collapse; color: #405560; font-size: 9px; line-height: 1.25; user-select: text; }
.hea-reference-table th, .hea-reference-table td { min-width: 46px; padding: 6px 7px; border-right: 1px solid #edf1f3; border-bottom: 1px solid #edf1f3; text-align: center; white-space: nowrap; }
.hea-reference-table th { color: #506876; background: #f3f7f9; font-weight: 850; }
.hea-reference-table tbody th { color: #18384a; background: #eaf2f6; }
.hea-reference-table tr:last-child > * { border-bottom: 0; }
.hea-reference-table tr > *:last-child { border-right: 0; }
.hea-reference-source { display: block; margin-top: 7px; }
.toggle-stack { display: grid; gap: 10px; margin-top: 16px; }
.toggle-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: center; min-height: 62px; gap: 12px; padding: 11px 13px; border: 1px solid var(--hall-border); border-radius: 12px; background: #fff; cursor: pointer; }
.toggle-row span { display: grid; gap: 3px; }
.toggle-row b { font-size: 12px; }
.toggle-row small { color: #75858e; font-size: 10px; line-height: 1.35; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; width: 42px; height: 24px; justify-self: end; border-radius: 999px; background: #d7dfe3; box-shadow: inset 0 0 0 1px #c8d2d7; transition: .16s ease; }
.toggle-row i::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.22); transition: transform .16s ease; }
.toggle-row input:checked + i { background: var(--hall-blue); box-shadow: inset 0 0 0 1px var(--hall-blue); }
.toggle-row input:checked + i::after { transform: translateX(18px); }
.color-heading { margin-top: 17px; }
.swatch-row { display: flex; gap: 10px; }
.swatch { width: 38px; height: 38px; padding: 0; border: 3px solid #fff; border-radius: 10px; background: var(--swatch); box-shadow: 0 0 0 1px #d5dde1; }
.swatch.selected { box-shadow: 0 0 0 2px var(--hall-blue), 0 0 0 4px #d9eef9; }
.door-controls { display: grid; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #e8edef; }
.door-controls.is-disabled { opacity: .42; pointer-events: none; }

.explode-control { width: 100%; margin-top: 18px; padding: 13px; border: 1px solid #d5e0e5; border-radius: 12px; background: #f8fbfc; }
.explode-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; color: #445761; font-size: 11px; font-weight: 800; }
.explode-heading strong { color: #087bb9; }
.explode-copy { margin: 0 0 10px; color: #71818b; font-size: 10px; line-height: 1.45; }
.explode-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: center; }
.explode-row button { height: 32px; padding: 0 12px; border: 1px solid #b9d9e9; border-radius: 8px; color: #076fa7; background: #edf8fd; font-size: 10px; font-weight: 850; }
.bom-settings-button { width: 100%; min-height: 62px; margin-top: 12px; padding: 11px 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid #c7dfeb; border-radius: 12px; color: #18384a; background: #f1f9fd; text-align: left; }
.bom-settings-button span { display: grid; gap: 3px; }
.bom-settings-button b { font-size: 12px; }
.bom-settings-button small { color: #6b7e88; font-size: 10px; }
.bom-settings-button strong { color: #087bb9; font-size: 11px; }

.dimension-label { padding: 3px 6px; border: 1px solid rgba(25,45,57,.12); border-radius: 6px; color: #15252e; background: rgba(255,255,255,.92); box-shadow: 0 3px 10px rgba(27,45,53,.08); font-size: 9px; font-weight: 800; white-space: nowrap; }

.bom-panel { width: min(860px, calc(100vw - 36px)); max-height: min(760px, calc(100vh - 46px)); padding: 0; border: 1px solid #d8e1e5; border-radius: 16px; color: var(--hall-ink); background: #fff; box-shadow: 0 30px 90px rgba(16,32,41,.22); }
.bom-panel::backdrop { background: rgba(20,32,38,.38); backdrop-filter: blur(3px); }
.bom-header, .bom-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e4eaed; }
.bom-header h2 { font-size: 20px; }
.bom-close { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #52636d; background: #f1f4f5; font-size: 21px; }
.bom-scroll-region { max-height: calc(100vh - 220px); overflow: auto; padding: 18px 20px; }
.bom-disclaimer { margin-bottom: 15px; padding: 12px 14px; border: 1px solid #d7e7ef; border-radius: 11px; color: #55707d; background: #f0f8fc; font-size: 11px; line-height: 1.5; }
.bom-table-wrap { overflow-x: auto; border: 1px solid #e0e7ea; border-radius: 11px; }
.bom-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.bom-table th, .bom-table td { padding: 10px 11px; border-bottom: 1px solid #e8edef; text-align: left; }
.bom-table th { color: #677781; background: #f6f8f9; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.bom-table tr:last-child td { border-bottom: 0; }
.bom-table td strong { display: block; color: #20333e; }
.bom-assumptions { margin-top: 19px; }
.bom-assumptions h3 { margin-bottom: 10px; font-size: 13px; }
.assumption-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.assumption-grid > div { display: grid; gap: 4px; padding: 10px; border: 1px solid #e0e7ea; border-radius: 9px; background: #fafbfb; }
.assumption-grid span { color: #71818a; font-size: 9px; }
.assumption-grid strong { font-size: 12px; }
.bom-footer { border-top: 1px solid #e4eaed; border-bottom: 0; justify-content: flex-end; }
.primary-action, .secondary-action { min-height: 38px; padding: 0 16px; border-radius: 9px; font-size: 11px; font-weight: 850; }
.primary-action { border: 1px solid var(--hall-blue); color: #fff; background: var(--hall-blue); }
.secondary-action { border: 1px solid #cbd7dc; color: #35505e; background: #fff; }

/* Dark mode uses one consistent text/background pairing across Hall settings. */
.app-shell.is-dark-mode,
body.shared-ui-dark-mode .app-shell { color: #edf4f7; background: #0f1724; }
.app-shell.is-dark-mode .sidebar,
body.shared-ui-dark-mode .sidebar { background: #172235; border-color: #2a3a51; box-shadow: -11px 0 32px rgba(0,0,0,.25); }
.app-shell.is-dark-mode .panel-section,
body.shared-ui-dark-mode .panel-section { border-color: #26374c; }
.app-shell.is-dark-mode .section-copy,
.app-shell.is-dark-mode .control-label,
.app-shell.is-dark-mode .select-label,
.app-shell.is-dark-mode .color-heading,
.app-shell.is-dark-mode .toggle-row small,
.app-shell.is-dark-mode .explode-copy,
body.shared-ui-dark-mode .section-copy,
body.shared-ui-dark-mode .control-label,
body.shared-ui-dark-mode .select-label,
body.shared-ui-dark-mode .color-heading,
body.shared-ui-dark-mode .toggle-row small,
body.shared-ui-dark-mode .explode-copy { color: #aebdca; }
.app-shell.is-dark-mode .eyebrow,
.app-shell.is-dark-mode .control-label output,
body.shared-ui-dark-mode .eyebrow,
body.shared-ui-dark-mode .control-label output { color: #6dc6ff; }
.app-shell.is-dark-mode .section-number,
body.shared-ui-dark-mode .section-number { color: #8fd2ff; background: #203a53; }
.app-shell.is-dark-mode .number-input,
.app-shell.is-dark-mode select,
.app-shell.is-dark-mode .toggle-row,
body.shared-ui-dark-mode .number-input,
body.shared-ui-dark-mode select,
body.shared-ui-dark-mode .toggle-row { color: #edf4f7; background: #1d2b41; border-color: #34445d; }
.app-shell.is-dark-mode .info-card,
body.shared-ui-dark-mode .info-card { border-color: #36526a; background: #1b3247; }
.app-shell.is-dark-mode .info-card span,
.app-shell.is-dark-mode .info-card small,
body.shared-ui-dark-mode .info-card span,
body.shared-ui-dark-mode .info-card small { color: #a9bac7; }
.app-shell.is-dark-mode .info-card strong,
body.shared-ui-dark-mode .info-card strong { color: #79ccff; }
.app-shell.is-dark-mode .profile-card small:last-child,
body.shared-ui-dark-mode .profile-card small:last-child { border-color: rgba(151,199,229,.14); }
.app-shell.is-dark-mode .hea-reference-card,
body.shared-ui-dark-mode .hea-reference-card { border-color: #36526a; background: #182e42; }
.app-shell.is-dark-mode .hea-reference-heading b,
body.shared-ui-dark-mode .hea-reference-heading b { color: #d7e3eb; }
.app-shell.is-dark-mode .hea-reference-heading small,
.app-shell.is-dark-mode .hea-reference-source,
body.shared-ui-dark-mode .hea-reference-heading small,
body.shared-ui-dark-mode .hea-reference-source { color: #99adbb; }
.app-shell.is-dark-mode .hea-reference-heading > span,
body.shared-ui-dark-mode .hea-reference-heading > span { color: #85d2ff; background: #244861; }
.app-shell.is-dark-mode .hea-reference-table-wrap,
body.shared-ui-dark-mode .hea-reference-table-wrap { border-color: #35536a; background: #14283a; }
.app-shell.is-dark-mode .hea-reference-table,
body.shared-ui-dark-mode .hea-reference-table { color: #b9c8d2; }
.app-shell.is-dark-mode .hea-reference-table th,
body.shared-ui-dark-mode .hea-reference-table th { color: #b9cedb; background: #1d3a50; }
.app-shell.is-dark-mode .hea-reference-table tbody th,
body.shared-ui-dark-mode .hea-reference-table tbody th { color: #8bd2fb; background: #21455f; }
.app-shell.is-dark-mode .hea-reference-table th,
.app-shell.is-dark-mode .hea-reference-table td,
body.shared-ui-dark-mode .hea-reference-table th,
body.shared-ui-dark-mode .hea-reference-table td { border-color: #2b465a; }
.app-shell.is-dark-mode .swatch,
body.shared-ui-dark-mode .swatch { border-color: #172235; box-shadow: 0 0 0 1px #435268; }
.app-shell.is-dark-mode .explode-control,
body.shared-ui-dark-mode .explode-control { color: #dce7ee; background: #1d2b40; border-color: #34465b; }
.app-shell.is-dark-mode .explode-heading,
body.shared-ui-dark-mode .explode-heading { color: #dce7ee; }
.app-shell.is-dark-mode .bom-settings-button,
body.shared-ui-dark-mode .bom-settings-button { color: #edf4f7; background: #1b3247; border-color: #36526a; }
.app-shell.is-dark-mode .bom-settings-button small,
body.shared-ui-dark-mode .bom-settings-button small { color: #a9bac7; }
.app-shell.is-dark-mode .viewer-stage,
body.shared-ui-dark-mode .viewer-stage { background: radial-gradient(circle at 48% 28%, #26364a 0, #182538 48%, #101a28 100%); }
.app-shell.is-dark-mode .dimension-label,
body.shared-ui-dark-mode .dimension-label { color: #eef6fb; background: rgba(20,31,46,.94); border-color: rgba(255,255,255,.12); }
body.shared-ui-dark-mode .shared-settings-toggle { color: #dfeaf1 !important; background: #19283b !important; border-color: #34445d !important; }
body.shared-ui-dark-mode .bom-panel { color: #edf4f7; background: #172235; }
body.shared-ui-dark-mode .bom-header,
body.shared-ui-dark-mode .bom-footer { border-color: #2b3c52; }
body.shared-ui-dark-mode .bom-close,
body.shared-ui-dark-mode .assumption-grid > div { color: #e5eef4; background: #223149; border-color: #34455c; }
body.shared-ui-dark-mode .bom-disclaimer { color: #c1d2de; background: #1d3448; border-color: #36526a; }
body.shared-ui-dark-mode .bom-table-wrap { border-color: #34455c; }
body.shared-ui-dark-mode .bom-table th { color: #aab9c5; background: #202e43; }
body.shared-ui-dark-mode .bom-table th,
body.shared-ui-dark-mode .bom-table td { border-color: #2c3c51; }
body.shared-ui-dark-mode .bom-table td strong { color: #edf4f7; }
body.shared-ui-dark-mode .assumption-grid span { color: #aab9c5; }
body.shared-ui-dark-mode .secondary-action { color: #dfeaf1; background: #223149; border-color: #40516a; }

@media (max-width: 1200px) {
  :root { --hall-sidebar-width: 350px; }
}
@media (max-width: 820px) {
  :root { --hall-sidebar-width: min(86vw, 360px); }
  .panel-section { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 620px) {
  .assumption-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* v5 accordion settings layout — mirrors the compact pergola settings pattern. */
.accordion-section { border-bottom: 1px solid #e8edef; background: transparent; }
.accordion-toggle {
  width: 100%; min-height: 60px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 0; color: var(--hall-ink); background: transparent; text-align: left; font-size: 16px; font-weight: 850;
}
.accordion-toggle:hover { background: #f7fafb; }
.accordion-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.accordion-section.is-open .accordion-toggle { color: #0b5f91; background: #eef8fd; }
.accordion-section.is-open .accordion-toggle svg { transform: rotate(180deg); }
.accordion-panel { padding: 4px 26px 25px; }
.accordion-panel[hidden] { display: none !important; }
.top-label { margin-top: 16px; }
.service-note { margin-top: 13px; padding: 12px 13px; border: 1px solid #d7e6ee; border-radius: 10px; color: #5f7480; background: #f4f9fc; font-size: 10px; line-height: 1.5; }

.summary-section { padding-bottom: 16px; }
.summary-total-card { display: grid; gap: 4px; padding: 16px; border: 1px solid #b8dced; border-radius: 14px; background: linear-gradient(145deg,#edf8fd,#f8fcfe); }
.summary-total-card span { color: #526a78; font-size: 11px; font-weight: 750; }
.summary-total-card strong { color: #086fa9; font-size: 29px; letter-spacing: -.035em; }
.summary-total-card small { color: #788b95; font-size: 9px; line-height: 1.45; }
.summary-price-breakdown, .summary-bom-list { display: grid; gap: 0; margin-top: 13px; border: 1px solid #e0e7ea; border-radius: 11px; overflow: hidden; }
.summary-price-breakdown > div, .summary-bom-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 10px; border-bottom: 1px solid #edf0f2; background: #fff; font-size: 10px; }
.summary-price-breakdown > div:last-child, .summary-bom-list > div:last-child { border-bottom: 0; }
.summary-price-breakdown span, .summary-bom-list span { color: #637680; }
.summary-price-breakdown strong, .summary-bom-list strong { color: #263b47; text-align: right; }
.summary-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.summary-metrics > div { display: grid; gap: 3px; padding: 10px; border: 1px solid #e0e7ea; border-radius: 10px; background: #fafcfc; }
.summary-metrics span { color: #72848e; font-size: 9px; text-transform: capitalize; }
.summary-metrics strong { color: #213642; font-size: 11px; text-transform: capitalize; }
.summary-bom-preview { margin-top: 18px; }
.summary-subheading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #263b47; font-size: 12px; }
.summary-subheading span { color: #087bb9; font-size: 10px; font-weight: 850; }
.summary-bom-more { color: #73858f !important; font-size: 9px !important; font-weight: 700; }
.summary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.summary-actions button { width: 100%; }

/* Hide the old step-specific decorations even if a cached shared stylesheet still defines them. */
.section-number { display: none !important; }
.panel-section .section-heading .eyebrow { display: none !important; }

body.shared-ui-dark-mode .accordion-section { border-color: #293a50; }
body.shared-ui-dark-mode .accordion-toggle { color: #eef5f8; }
body.shared-ui-dark-mode .accordion-toggle:hover { background: #1c2a3e; }
body.shared-ui-dark-mode .accordion-section.is-open .accordion-toggle { color: #89d1ff; background: #20354a; }
body.shared-ui-dark-mode .service-note { color: #b6c7d2; background: #1d3247; border-color: #36526a; }
body.shared-ui-dark-mode .summary-total-card { background: linear-gradient(145deg,#1b3349,#1c2d42); border-color: #365b75; }
body.shared-ui-dark-mode .summary-total-card span, body.shared-ui-dark-mode .summary-total-card small { color: #b0c0cb; }
body.shared-ui-dark-mode .summary-total-card strong { color: #79ccff; }
body.shared-ui-dark-mode .summary-price-breakdown, body.shared-ui-dark-mode .summary-bom-list { border-color: #34455c; }
body.shared-ui-dark-mode .summary-price-breakdown > div, body.shared-ui-dark-mode .summary-bom-list > div { background: #1d2b41; border-color: #2c3c51; }
body.shared-ui-dark-mode .summary-price-breakdown span, body.shared-ui-dark-mode .summary-bom-list span { color: #aec0cc; }
body.shared-ui-dark-mode .summary-price-breakdown strong, body.shared-ui-dark-mode .summary-bom-list strong { color: #edf4f7; }
body.shared-ui-dark-mode .summary-metrics > div { background: #1d2b41; border-color: #34455c; }
body.shared-ui-dark-mode .summary-metrics span { color: #aebdca; }
body.shared-ui-dark-mode .summary-metrics strong, body.shared-ui-dark-mode .summary-subheading { color: #edf4f7; }

/* v6 — shared tools + hall-specific inspection controls */
.display-tool-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e3e9ec;
}
.display-tool-group:first-of-type { margin-top: 16px; }
.display-tool-heading { display: grid; gap: 4px; margin-bottom: 13px; }
.display-tool-heading b { color: #243741; font-size: 13px; }
.display-tool-heading small { color: #758690; font-size: 10px; line-height: 1.45; }
.compact-toggle-stack { margin-top: 12px; }
.display-slider { margin-top: 12px; padding: 0 4px; }
.range-row--single { grid-template-columns: minmax(0,1fr); }
.display-slider.is-disabled { opacity: .42; pointer-events: none; }

.environment-panel {
  position: fixed;
  z-index: 850;
  top: calc(var(--shared-topbar-height, 52px) + 14px);
  left: 64px;
  width: min(420px, calc(100vw - 90px));
  display: none;
  padding: 24px 26px 26px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  color: #f7fbff;
  background: #172536;
  box-shadow: 0 18px 44px rgba(7,19,31,.28);
}
.environment-panel.is-open { display: block; }
.environment-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.environment-panel__header strong { font-size: 20px; }
.environment-panel__header button { border: 0; color: #fff; background: transparent; font-size: 28px; line-height: 1; }
.environment-control { display: grid; gap: 8px; margin-top: 17px; }
.environment-control > span { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.environment-control output { color: #a9bfce; }
.environment-control input[type="range"] { width: 100%; accent-color: #168ed4; }
.environment-control > small { display: flex; justify-content: space-between; color: #8499aa; font-size: 10px; }
.scene-segmented { display: grid; grid-template-columns: repeat(3,1fr); padding: 5px; border-radius: 12px; background: #f0f3f5; }
.scene-segmented button { min-height: 38px; border: 0; border-radius: 9px; color: #697987; background: transparent; font-size: 11px; font-weight: 800; }
.scene-segmented button.is-selected { color: #075c91; background: #fff; box-shadow: 0 1px 4px rgba(11,39,59,.16); }
.night-preview-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #40536a;
  border-radius: 13px;
  background: #25364d;
}
.night-preview-row > span:nth-child(2) { display: grid; gap: 3px; }
.night-preview-row strong { color: #f6fbff; font-size: 13px; }
.night-preview-row small { color: #9eb7cb; font-size: 10px; }
.night-preview-icon { color: #eaf7ff; font-size: 26px; }
.night-preview-row input { position: absolute; opacity: 0; pointer-events: none; }
.night-preview-row i { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #c9d3da; }
.night-preview-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease; }
.night-preview-row input:checked + i { background: #1188d1; }
.night-preview-row input:checked + i::after { transform: translateX(20px); }

.compass-label {
  min-width: 18px;
  padding: 2px 4px;
  border-radius: 5px;
  color: #11384f;
  background: rgba(255,255,255,.88);
  box-shadow: 0 1px 4px rgba(22,42,52,.14);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

body.shared-ui-dark-mode .display-tool-group { border-color: #304158; }
body.shared-ui-dark-mode .display-tool-heading b { color: #eef5f8; }
body.shared-ui-dark-mode .display-tool-heading small { color: #aebdca; }
body.shared-ui-dark-mode .compass-label { color: #eaf5fb; background: rgba(22,35,52,.94); }

@media (max-width: 720px) {
  .environment-panel { left: 58px; width: min(390px, calc(100vw - 72px)); padding: 20px; }
}

/* v9 — interactive wall openings */
.opening-help {
  margin: 0 0 13px;
  color: #667b87;
  font-size: 10px;
  line-height: 1.55;
}
.opening-add-grid { display: grid; gap: 8px; }
.opening-add-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #cddde5;
  border-radius: 10px;
  color: #254453;
  background: #f9fcfd;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.opening-add-button span { color: #0b7fbe; font-size: 18px; line-height: 1; }
.opening-add-button b { font-size: 11px; }
.opening-add-button:hover { border-color: #8fc4df; background: #f1f9fd; }
.opening-add-button.is-placement-active { color: #fff; background: #bd3131; border-color: #bd3131; }
.opening-add-button.is-placement-active span { color: #fff; }
.opening-add-button:disabled:not(.is-placement-active) { opacity: .42; cursor: not-allowed; }
.opening-status {
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid #dce7ec;
  border-radius: 9px;
  color: #687b86;
  background: #f7fafb;
  font-size: 9px;
  line-height: 1.45;
}
.opening-status.is-error { color: #9d2424; border-color: #edb8b8; background: #fff4f4; }

.opening-editor {
  position: fixed;
  z-index: 960;
  width: 238px;
  padding: 13px;
  border: 1px solid rgba(18, 46, 64, .18);
  border-radius: 13px;
  color: #213946;
  background: rgba(255,255,255,.97);
  box-shadow: 0 16px 38px rgba(13, 34, 48, .24);
  backdrop-filter: blur(8px);
  transform: translate(-50%, calc(-100% - 16px));
}
.opening-editor[hidden] { display: none !important; }
.opening-editor__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.opening-editor__header > div { display: grid; gap: 2px; }
.opening-editor__header small { color: #72858f; font-size: 9px; }
.opening-editor__header strong { color: #203844; font-size: 13px; }
.opening-delete-button {
  width: 27px; height: 27px; padding: 0; border: 1px solid #ecc1c1; border-radius: 8px;
  color: #a82626; background: #fff5f5; font-size: 20px; line-height: 1; cursor: pointer;
}
.opening-delete-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.opening-editor__side,
.opening-editor__dimensions label,
.opening-editor__color { display: grid; gap: 5px; color: #687b85; font-size: 9px; font-weight: 800; }
.opening-editor__side { margin-top: 11px; }
.opening-editor__side select {
  width: 100%; height: 32px; padding: 0 8px; border: 1px solid #cfdde4; border-radius: 8px;
  color: #203844; background: #fff; font: inherit; font-size: 10px; font-weight: 750;
}
.opening-editor__dimensions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.opening-editor__dimensions label > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; }
.opening-editor__dimensions input {
  min-width: 0; width: 100%; height: 34px; padding: 0 8px; border: 1px solid #cfdde4; border-radius: 8px;
  color: #203844; background: #fff; font: inherit; font-size: 11px; font-weight: 750;
}
.opening-editor__dimensions em { color: #85949c; font-size: 9px; font-style: normal; }
.opening-editor__color { grid-template-columns: 1fr auto; align-items: center; margin-top: 11px; }
.opening-editor__color input { width: 38px; height: 28px; padding: 2px; border: 1px solid #cad9e0; border-radius: 7px; background: #fff; }
.opening-editor__warning { margin-top: 10px; padding: 8px 9px; border: 1px solid #efb7b7; border-radius: 8px; color: #9c2626; background: #fff1f1; font-size: 9px; line-height: 1.4; }
.opening-dimension-label {
  padding: 3px 6px;
  border: 1px solid rgba(14, 91, 132, .24);
  border-radius: 6px;
  color: #075e91;
  background: rgba(255,255,255,.94);
  box-shadow: 0 2px 8px rgba(17,56,79,.14);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}
.summary-validation-error {
  padding: 13px 14px;
  border: 1px solid #e9aaaa;
  border-radius: 11px;
  color: #982424;
  background: #fff2f2;
  font-size: 10px;
  line-height: 1.5;
}
.summary-validation-error strong { display: block; margin-bottom: 4px; font-size: 12px; }
.summary-content.is-blocked { display: none; }

body.shared-ui-dark-mode .opening-help { color: #aebec8; }
body.shared-ui-dark-mode .opening-add-button { color: #e7f0f5; background: #1d2c41; border-color: #3a4c62; }
body.shared-ui-dark-mode .opening-add-button:hover { background: #23354b; border-color: #4d7490; }
body.shared-ui-dark-mode .opening-status { color: #aec0cb; background: #1c2b3f; border-color: #34475e; }
body.shared-ui-dark-mode .opening-status.is-error { color: #ffb9b9; background: #49282d; border-color: #764047; }
body.shared-ui-dark-mode .opening-editor { color: #edf5f8; background: rgba(24,36,53,.97); border-color: #3c5069; }
body.shared-ui-dark-mode .opening-editor__header small,
body.shared-ui-dark-mode .opening-editor__side,
body.shared-ui-dark-mode .opening-editor__dimensions label,
body.shared-ui-dark-mode .opening-editor__color { color: #aebfca; }
body.shared-ui-dark-mode .opening-editor__header strong { color: #f0f6f8; }
body.shared-ui-dark-mode .opening-editor__side select,
body.shared-ui-dark-mode .opening-editor__dimensions input { color: #edf5f8; background: #223149; border-color: #40536a; }
body.shared-ui-dark-mode .opening-editor__color input { background: #223149; border-color: #40536a; }
body.shared-ui-dark-mode .opening-dimension-label { color: #8bd2fb; background: rgba(23,37,55,.96); border-color: #42647b; }
body.shared-ui-dark-mode .summary-validation-error { color: #ffc0c0; background: #48282d; border-color: #78434a; }

@media (max-width: 720px) {
  .opening-editor { width: min(230px, calc(100vw - 28px)); }
}
