:root {
  --bg: #eef1f2;
  --surface: #ffffff;
  --surface-soft: #f6f8f8;
  --text: #171a1c;
  --muted: #687075;
  --line: #dde2e4;
  --line-strong: #cdd4d7;
  --dark: #111416;
  --accent: #2eb7b3;
  --accent-dark: #168d89;
  --warning: #8e5b07;
  --warning-bg: #fff7e7;
  --warning-line: #f0d39b;
  --radius: 16px;
  --shadow: 0 10px 32px rgba(12, 20, 24, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; min-height: 100dvh; overflow: hidden; }
button, input, select { font: inherit; }
button, select, input[type="range"], input[type="radio"], input[type="checkbox"] { cursor: pointer; }
.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 68px minmax(0, 1fr); }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:0 24px; background:var(--dark); color:#fff; border-bottom:1px solid rgba(255,255,255,.08); }
.brand { display:flex; align-items:baseline; gap:2px; letter-spacing:.08em; white-space:nowrap; }
.brand-main, .brand-accent { font-weight:800; font-size:18px; }
.brand-accent { color:var(--accent); }
.brand-subtitle { margin-left:16px; color:rgba(255,255,255,.56); font-size:11px; font-weight:600; letter-spacing:.14em; }
.version-badge { padding:7px 10px; border:1px solid rgba(255,255,255,.14); border-radius:999px; color:rgba(255,255,255,.74); font-size:10px; font-weight:700; letter-spacing:.13em; }
.workspace { min-height:0; display:grid; grid-template-columns:minmax(350px, 410px) minmax(0,1fr); }
.config-panel { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:22px; background:#f4f6f6; border-right:1px solid var(--line); }
.panel-section { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px; margin-bottom:14px; box-shadow:0 2px 10px rgba(15,25,30,.025); }
.panel-intro { background:linear-gradient(145deg, #ffffff 0%, #f8fbfb 100%); }
.panel-intro h1 { margin:4px 0 8px; font-size:22px; line-height:1.15; letter-spacing:-.03em; }
.eyebrow { margin:0; color:var(--accent-dark); font-size:10px; font-weight:800; letter-spacing:.16em; }
.muted { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.panel-section h2 { margin:0 0 16px; font-size:13px; text-transform:uppercase; letter-spacing:.08em; }
.control-block + .control-block { margin-top:18px; }
.compact-top { margin-top:18px; }
.control-block > label { display:block; margin-bottom:8px; font-size:13px; font-weight:650; }
.control-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:8px; }
.control-head label { font-size:13px; font-weight:650; }
.range-hint, .range-scale { color:#8a9397; font-size:10px; }
.number-unit-row { display:grid; grid-template-columns:1fr auto; align-items:center; gap:10px; margin-bottom:10px; }
.number-unit-row input, select { width:100%; border:1px solid var(--line-strong); border-radius:10px; background:#fff; color:var(--text); outline:none; transition:border-color .16s ease, box-shadow .16s ease; }
.number-unit-row input { height:42px; padding:0 12px; font-variant-numeric:tabular-nums; }
.number-unit-row span { width:28px; color:var(--muted); font-size:12px; font-weight:600; }
select { height:44px; padding:0 36px 0 12px; }
.number-unit-row input:focus, select:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(46,183,179,.12); }
input[type="range"] { width:100%; margin:0; accent-color:var(--accent-dark); }
.range-scale { display:flex; justify-content:space-between; margin-top:7px; }
.segmented { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:5px; border-radius:12px; background:var(--surface-soft); border:1px solid var(--line); }
.segmented label { position:relative; }
.segmented input { position:absolute; opacity:0; pointer-events:none; }
.segmented span { display:flex; align-items:center; justify-content:center; min-height:40px; padding:8px 10px; border-radius:8px; color:#60686c; text-align:center; font-size:12px; font-weight:650; transition:background .16s ease, color .16s ease, box-shadow .16s ease; }
.segmented input:checked + span { background:#fff; color:var(--text); box-shadow:0 1px 6px rgba(15,24,28,.09); }
.toggle-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; }
.toggle-row > div { display:grid; gap:3px; }
.toggle-title { font-size:13px; font-weight:650; }
.toggle-row small { color:var(--muted); font-size:10px; }
.switch { position:relative; flex:0 0 auto; width:42px; height:24px; }
.switch input { position:absolute; opacity:0; }
.switch-track { position:absolute; inset:0; border-radius:999px; background:#ccd2d5; transition:background .18s ease; }
.switch-track::after { content:""; position:absolute; width:18px; height:18px; left:3px; top:3px; border-radius:50%; background:#fff; box-shadow:0 2px 5px rgba(0,0,0,.16); transition:transform .18s ease; }
.switch input:checked + .switch-track { background:var(--accent-dark); }
.switch input:checked + .switch-track::after { transform:translateX(18px); }
.section-heading-row { display:flex; align-items:center; justify-content:space-between; margin-bottom: 14px; }
.status-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px rgba(46,183,179,.12); }
.summary-grid { margin:0; display:grid; grid-template-columns:minmax(110px, 1fr) minmax(120px, auto); gap:9px 14px; font-size:12px; align-items:start; }
.summary-grid dt { color:var(--muted); min-width:0; }
.summary-grid dd { margin:0; font-weight:650; text-align:right; font-variant-numeric:tabular-nums; min-width:120px; max-width:190px; line-height:1.35; overflow-wrap:anywhere; }
.cta-card { display:grid; gap:6px; margin-top:16px; padding:14px; border-radius:12px; background:#f6f8f8; border:1px solid var(--line); }
.cta-card span { font-size:10px; color:#6d7579; text-transform:uppercase; letter-spacing:.08em; }
.cta-card strong { font-size:14px; letter-spacing:-.01em; }
.cta-card small { font-size:11px; line-height:1.45; color:#6b7277; }
.warning-panel { display:flex; gap:12px; padding:16px; margin-bottom:14px; border:1px solid var(--warning-line); border-radius:var(--radius); background:var(--warning-bg); color:#5f430d; }
.warning-panel[hidden] { display:none; }
.warning-icon { display:grid; place-items:center; flex:0 0 28px; height:28px; border-radius:50%; background:#e6a730; color:#fff; font-weight:900; }
.warning-panel strong { font-size:12px; }
.warning-panel p { margin:4px 0 0; font-size:11px; line-height:1.45; }
.action-section { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.button { min-height:42px; border-radius:10px; border:1px solid transparent; padding:9px 12px; font-size:11px; font-weight:750; transition:transform .12s ease, background .14s ease, border-color .14s ease; }
.button:active { transform:translateY(1px); }
.button-primary { background:var(--dark); color:#fff; }
.button-primary:hover { background:#252a2d; }
.button-secondary { background:#fff; color:var(--text); border-color:var(--line-strong); }
.button-secondary:hover { background:var(--surface-soft); }
.button-accent { background:var(--accent-dark); color:#fff; }
.button-accent:hover { background:#0f7773; }
.viewer-panel { position:relative; min-width:0; min-height:0; overflow:hidden; background:radial-gradient(circle at 68% 28%, rgba(255,255,255,.98), rgba(239,243,244,.86) 42%, rgba(222,228,230,.94) 100%); }
.viewport-stage { position:absolute; inset:0; overflow:hidden; touch-action:none; }
.viewport-stage canvas { position:absolute; inset:0; display:block; width:100%; height:100%; outline:none; }
.viewer-toolbar { position:absolute; z-index:5; top:16px; right:16px; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; max-width:calc(100% - 32px); }
.viewer-button { min-height:36px; border:1px solid rgba(18,25,28,.12); border-radius:9px; padding:0 12px; background:rgba(255,255,255,.88); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); color:#24292c; box-shadow:0 3px 14px rgba(14,22,25,.06); font-size:10px; font-weight:700; }
.viewer-button:hover { background:#fff; }
.viewer-help { position:absolute; z-index:5; left:16px; bottom:16px; display:flex; flex-wrap:wrap; gap:6px; pointer-events:none; }
.viewer-help span { padding:7px 9px; border:1px solid rgba(18,25,28,.08); border-radius:8px; background:rgba(255,255,255,.78); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); color:#657075; font-size:9px; }
.viewer-help b { color:#2a3033; }
.dimension-label-layer { position:absolute; inset:0; z-index:3; pointer-events:none; overflow:hidden; }
.dimension-label { position:absolute; transform:translate(-50%, -50%); padding:5px 8px; border-radius:7px; border:1px solid rgba(22,141,137,.18); background:rgba(255,255,255,.94); color:#116f6c; box-shadow:0 2px 9px rgba(0,0,0,.06); font-size:10px; font-weight:800; font-variant-numeric:tabular-nums; white-space:nowrap; }
.loading-overlay, .fatal-error { position:absolute; z-index:8; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:24px; background:rgba(238,242,243,.92); text-align:center; }
.loading-overlay strong, .fatal-error strong { font-size:14px; }
.loading-overlay span, .fatal-error p { margin:0; color:var(--muted); font-size:11px; max-width:430px; line-height:1.5; }
.spinner { width:28px; height:28px; border-radius:50%; border:3px solid #d3dcde; border-top-color:var(--accent-dark); animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.toast { position:fixed; z-index:100; left:50%; bottom:24px; transform:translate(-50%, 18px); max-width:min(88vw, 460px); padding:10px 14px; border-radius:10px; background:#111416; color:#fff; box-shadow:var(--shadow); opacity:0; pointer-events:none; transition:opacity .18s ease, transform .18s ease; font-size:11px; text-align:center; }
.toast.is-visible { opacity:1; transform:translate(-50%, 0); }
@media (max-width: 900px) {
  body { overflow:auto; }
  .app-shell { height:auto; min-height:100vh; min-height:100dvh; grid-template-rows:60px auto; }
  .topbar { padding:0 16px; }
  .brand-subtitle { display:none; }
  .workspace { display:flex; flex-direction:column; min-height:0; }
  .viewer-panel { order:-1; height:56vh; min-height:420px; }
  .config-panel { overflow:visible; padding:14px; border-right:0; border-top:1px solid var(--line); }
  .panel-section { margin-bottom:10px; }
}
@media (max-width: 560px) {
  .topbar { height:56px; }
  .app-shell { grid-template-rows:56px auto; }
  .brand-main, .brand-accent { font-size:16px; }
  .version-badge { font-size:9px; padding:6px 8px; }
  .viewer-panel { height:54vh; min-height:340px; }
  .viewer-toolbar { top:10px; right:10px; gap:5px; }
  .viewer-button { min-height:34px; padding:0 9px; font-size:9px; }
  .viewer-help { left:10px; bottom:10px; right:10px; }
  .viewer-help span:last-child { display:none; }
  .config-panel { padding:10px; }
  .panel-section { border-radius:13px; padding:15px; }
  .panel-intro h1 { font-size:20px; }
  .action-section, .segmented { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}
.loading-overlay[hidden], .fatal-error[hidden] { display:none !important; }

/* V1.2.4 - louver orientation cards */
.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.option-card {
  position: relative;
  display: block;
}
.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.option-card span {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #3a4145;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.option-card b {
  font-size: 12px;
  font-weight: 750;
}
.option-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.option-card input:checked + span {
  border-color: rgba(22,141,137,.55);
  background: #f1fbfa;
  box-shadow: 0 0 0 3px rgba(46,183,179,.10);
  color: #135f5c;
}

.summary-grid {
  grid-template-columns: minmax(120px, 1fr) minmax(125px, auto);
}

/* --------------------------------------------------------------------------
   V1.3 - product family selector and fixed-roof controls
   -------------------------------------------------------------------------- */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.change-product-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.86);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .03em;
}
.change-product-button:hover { background: rgba(255,255,255,.11); }

.product-selector {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 74% 18%, rgba(46,183,179,.18), transparent 32%),
    linear-gradient(135deg, #0e1113 0%, #161b1e 58%, #101416 100%);
  color: #fff;
}
.product-selector[hidden] { display: none !important; }
.product-selector-shell {
  width: min(100%, 980px);
  padding: 12px 0 24px;
}
.selector-brand {
  margin-bottom: 28px;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: .09em;
}
.selector-brand b { color: var(--accent); }
.product-selector .eyebrow { color: #75d2cf; }
.product-selector h1 {
  margin: 7px 0 10px;
  max-width: 760px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.selector-lead {
  max-width: 720px;
  margin: 0;
  color: rgba(255,255,255,.64);
  font-size: 14px;
  line-height: 1.65;
}
.product-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}
.product-card {
  display: grid;
  grid-template-rows: 210px 1fr;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  background: rgba(255,255,255,.055);
  color: #fff;
  text-align: left;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(84,204,199,.58);
  background: rgba(255,255,255,.075);
}
.product-preview {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(216,229,233,.97) 0 57%, rgba(120,152,98,.95) 57% 100%);
}
.product-preview::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 23%;
  height: 44%;
  border-radius: 3px 3px 0 0;
  background: #d4cabc;
  box-shadow: inset 0 -18px 0 rgba(255,255,255,.11);
}
.product-preview::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 7%;
  bottom: 14%;
  height: 9%;
  background: #bfc0bc;
  transform: perspective(180px) rotateX(55deg);
  transform-origin: center bottom;
}
.preview-bioclimatic i,
.preview-fixed i {
  position: absolute;
  z-index: 2;
  display: block;
  background: #343b3f;
}
.preview-bioclimatic i:nth-child(1),
.preview-fixed i:nth-child(1) { left: 17%; top: 39%; width: 4px; height: 45%; }
.preview-bioclimatic i:nth-child(2),
.preview-fixed i:nth-child(2) { right: 12%; top: 39%; width: 4px; height: 45%; }
.preview-bioclimatic i:nth-child(3),
.preview-fixed i:nth-child(3) { left: 17%; right: 12%; top: 39%; height: 7px; }
.preview-bioclimatic i:nth-child(4) { left: 22%; right: 17%; top: 42%; height: 3px; transform: rotate(-4deg); }
.preview-bioclimatic i:nth-child(5) { left: 22%; right: 17%; top: 46%; height: 3px; transform: rotate(-4deg); }
.preview-bioclimatic i:nth-child(6) { left: 22%; right: 17%; top: 50%; height: 3px; transform: rotate(-4deg); }
.preview-fixed i:nth-child(3) { transform: rotate(-7deg); transform-origin: left center; }
.product-card-copy {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 20px;
}
.product-card-copy small {
  color: #65cbc7;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .13em;
}
.product-card-copy strong {
  font-size: 21px;
  letter-spacing: -.025em;
}
.product-card-copy em {
  min-height: 42px;
  color: rgba(255,255,255,.60);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}
.product-card-copy b {
  margin-top: 8px;
  color: #fff;
  font-size: 11px;
}
.selector-note {
  margin: 18px 0 0;
  color: rgba(255,255,255,.38);
  font-size: 10px;
  line-height: 1.5;
}

.roof-type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.roof-type-card { position: relative; display: block; }
.roof-type-card input { position: absolute; opacity: 0; pointer-events: none; }
.roof-type-card span {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #3a4145;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.roof-type-card b { font-size: 12px; font-weight: 750; }
.roof-type-card small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.roof-type-card input:checked + span {
  border-color: rgba(22,141,137,.55);
  background: #f1fbfa;
  box-shadow: 0 0 0 3px rgba(46,183,179,.10);
  color: #135f5c;
}
.technical-note {
  margin: 10px 0 0;
  color: #7c8589;
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .product-selector { padding: 18px 12px; align-items: start; }
  .product-selector-shell { padding-top: 20px; }
  .product-card-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-rows: 160px 1fr; }
  .topbar-actions { gap: 6px; }
  .change-product-button { padding: 0 8px; font-size: 9px; }
}

/* V1.3.1 - source-grounded fixed-roof specs */
.fixed-spec-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.fixed-spec-card > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid rgba(20,30,34,.06);
}
.fixed-spec-card span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}
.fixed-spec-card strong {
  color: var(--text);
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
}
.readonly-spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f7f9f9;
}
.readonly-spec-row > div { display: grid; gap: 3px; }
.readonly-spec-row small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.readonly-spec-row strong { color: var(--accent-dark); font-size: 18px; }
@media (max-width: 560px) {
  .fixed-spec-card { grid-template-columns: 1fr; }
}
.roof-type-card.is-disabled { opacity: .52; cursor: not-allowed; }
.roof-type-card.is-disabled span { background: #f2f4f4; }
.roof-type-card.is-disabled input { cursor: not-allowed; }
.source-note { margin: -4px 0 14px; }

/* --------------------------------------------------------------------------
   V1.4 - Bioclimatic rule-engine UI
   -------------------------------------------------------------------------- */
.segmented.three-way { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.system-info-card {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:14px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-soft);
}
.system-info-card > div {
  display:grid;
  gap:3px;
  min-width:0;
  padding:9px 10px;
  border:1px solid rgba(20,30,34,.06);
  border-radius:9px;
  background:#fff;
}
.system-info-card span { color:var(--muted); font-size:9px; line-height:1.25; }
.system-info-card strong { font-size:11px; line-height:1.3; overflow-wrap:anywhere; }
.automation-grid { display:grid; grid-template-columns:1fr; gap:7px; margin-top:8px; }
.check-card { position:relative; display:block; }
.check-card input { position:absolute; opacity:0; pointer-events:none; }
.check-card span {
  display:grid;
  gap:3px;
  min-height:48px;
  padding:9px 12px 9px 38px;
  border:1px solid var(--line-strong);
  border-radius:10px;
  background:#fff;
  transition:border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.check-card span::before {
  content:"";
  position:absolute;
  left:12px;
  top:50%;
  width:14px;
  height:14px;
  transform:translateY(-50%);
  border:1px solid #aeb7bb;
  border-radius:4px;
  background:#fff;
}
.check-card input:checked + span {
  border-color:rgba(22,141,137,.55);
  background:#f1fbfa;
  box-shadow:0 0 0 3px rgba(46,183,179,.08);
}
.check-card input:checked + span::before {
  border-color:var(--accent-dark);
  background:var(--accent-dark);
  box-shadow:inset 0 0 0 3px #fff;
}
.check-card b { font-size:11px; }
.check-card small { color:var(--muted); font-size:9px; }
.rule-status {
  display:inline-flex;
  justify-content:center;
  min-width:72px;
  padding:4px 7px;
  border-radius:999px;
  border:1px solid var(--line-strong);
  background:#f5f7f7;
  font-size:9px;
  font-weight:850;
  letter-spacing:.08em;
}
.rule-status.is-valid { color:#196c4a; border-color:#a8d8c1; background:#eff9f4; }
.rule-status.is-warning { color:#8a5a08; border-color:#ead09d; background:#fff7e8; }
.rule-status.is-invalid { color:#9c2f2f; border-color:#e7b1b1; background:#fff0f0; }
select optgroup { font-weight:800; color:#4b555a; }
select option { font-weight:500; color:#171a1c; }
@media (max-width: 560px) {
  .segmented.three-way { grid-template-columns:1fr; }
  .system-info-card { grid-template-columns:1fr; }
}
body[data-product-family="fixedRoof"] .segmented.three-way { grid-template-columns:1fr 1fr; }

/* --------------------------------------------------------------------------
   V1.5 - Opening & Side System Engine
   -------------------------------------------------------------------------- */
.openings-section { position: relative; }
.opening-count-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:64px; padding:4px 8px; border-radius:999px;
  border:1px solid rgba(22,141,137,.20); background:#eff9f8;
  color:#167f7a; font-size:9px; font-weight:850; letter-spacing:.04em;
}
.opening-intro { margin-bottom:12px; }
.opening-select-button { width:100%; margin-bottom:12px; }
.opening-select-button.is-active {
  border-color:rgba(22,141,137,.55); background:#e8f8f7; color:#116d69;
  box-shadow:0 0 0 3px rgba(46,183,179,.09);
}
.opening-list { display:grid; gap:7px; margin:4px 0 12px; }
.opening-list-empty {
  padding:11px 12px; border:1px dashed var(--line-strong); border-radius:10px;
  color:var(--muted); font-size:10px; line-height:1.45; background:#fafbfb;
}
.opening-list-item {
  width:100%; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px;
  align-items:center; text-align:left; padding:9px 10px; border:1px solid var(--line);
  border-radius:10px; background:#fff; color:var(--text); cursor:pointer;
  transition:border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.opening-list-item:hover, .opening-list-item.is-selected {
  border-color:rgba(22,141,137,.50); background:#f2fbfa; box-shadow:0 0 0 3px rgba(46,183,179,.07);
}
.opening-list-main { min-width:0; display:grid; gap:2px; }
.opening-list-main strong { font-size:10px; }
.opening-list-main small { color:var(--muted); font-size:9px; line-height:1.3; }
.opening-list-state { max-width:110px; color:#536065; font-size:9px; font-weight:700; text-align:right; line-height:1.25; }
.opening-list-item.needs-review { border-color:#ead09d; background:#fffaf0; }
.opening-editor {
  margin-top:12px; padding:12px; border:1px solid var(--line-strong); border-radius:12px;
  background:var(--surface-soft);
}
.opening-editor-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:10px; }
.opening-editor-head > div { display:grid; gap:3px; min-width:0; }
.opening-editor-head small { color:var(--accent-dark); font-size:8px; font-weight:850; letter-spacing:.10em; }
.opening-editor-head strong { font-size:13px; }
.opening-editor-head span:not(.opening-status) { color:var(--muted); font-size:10px; }
.opening-status {
  display:inline-flex; align-items:center; justify-content:center; padding:4px 7px;
  border:1px solid var(--line-strong); border-radius:999px; font-size:8px; font-weight:850; letter-spacing:.06em;
}
.opening-status.is-valid { color:#196c4a; border-color:#a8d8c1; background:#eff9f4; }
.opening-status.is-review { color:#8a5a08; border-color:#ead09d; background:#fff7e8; }
.opening-status.is-invalid { color:#9c2f2f; border-color:#e7b1b1; background:#fff0f0; }
.opening-subpanel { margin:8px 0 12px; padding:10px; border:1px solid rgba(22,141,137,.13); border-radius:10px; background:#fff; }
.opening-editor-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:10px; }
.opening-editor-actions .button { min-width:0; padding-left:8px; padding-right:8px; }
.opening-copy-details { margin-top:10px; border-top:1px solid var(--line); padding-top:9px; }
.opening-copy-details summary { cursor:pointer; color:#3d4a4e; font-size:10px; font-weight:750; }
.opening-copy-list { display:grid; gap:6px; margin:9px 0; max-height:150px; overflow:auto; }
.opening-copy-option { display:flex; align-items:center; gap:8px; padding:7px 8px; border:1px solid var(--line); border-radius:8px; background:#fff; font-size:9px; }
.opening-copy-option input { accent-color:var(--accent-dark); }
.opening-clear-all { width:100%; border:0; background:transparent; padding:8px 0 0; color:#8a5555; font:inherit; font-size:9px; cursor:pointer; }
.opening-clear-all:hover { color:#b33838; }
.opening-label {
  position:absolute; transform:translate(-50%,-50%); pointer-events:none;
  padding:4px 7px; border:1px solid rgba(22,141,137,.35); border-radius:999px;
  background:rgba(247,255,254,.94); color:#0d6b67; font-size:9px; font-weight:850;
  white-space:nowrap; box-shadow:0 3px 12px rgba(16,54,57,.10);
}
.opening-label.is-selected { background:#168d89; color:#fff; border-color:#168d89; }
.summary-opening-details { margin-top:10px; padding-top:8px; border-top:1px solid var(--line); }
.summary-opening-details summary { cursor:pointer; color:#526066; font-size:9px; font-weight:750; }
.summary-openings-details { display:grid; gap:5px; margin-top:8px; color:#657176; font-size:9px; line-height:1.4; }
.summary-openings-details div { display:flex; justify-content:space-between; gap:10px; }
body.opening-selection-active .viewport-stage canvas { cursor:crosshair; }
@media (max-width:560px) {
  .opening-editor-actions { grid-template-columns:1fr; }
  .opening-list-item { grid-template-columns:1fr; }
  .opening-list-state { max-width:none; text-align:left; }
}

/* --------------------------------------------------------------------------
   V1.5.2 - premium photographic product selector
   -------------------------------------------------------------------------- */
.product-card {
  grid-template-rows: 240px 1fr;
  background: rgba(255,255,255,.052);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(84,204,199,.66);
  box-shadow: 0 30px 80px rgba(0,0,0,.34);
}
.product-preview {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(145deg, #253033, #111719);
}
.product-preview::before,
.product-preview::after,
.preview-bioclimatic i,
.preview-fixed i {
  display: none !important;
  content: none !important;
}
.product-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 52%;
  transform: scale(1.001);
  transition: transform .32s ease, filter .32s ease;
}
.product-preview::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(9,12,13,.42), transparent);
  pointer-events: none;
}
.product-card:hover .product-preview img {
  transform: scale(1.035);
  filter: saturate(1.03) contrast(1.02);
}
.product-card-copy {
  min-height: 176px;
  padding: 21px 22px 22px;
}
.product-card-copy strong { font-size: 22px; }

@media (max-width: 720px) {
  .product-card { grid-template-rows: 180px 1fr; }
  .product-card-copy { min-height: 0; }
}

/* --------------------------------------------------------------------------
   V1.6 - Customer UX + Quick Sidewall Configurator
   -------------------------------------------------------------------------- */
.panel-intro {
  margin-bottom: 10px;
  padding: 15px 16px;
}
.panel-intro h1 { font-size: 19px; margin-bottom: 5px; }
.panel-intro .muted { font-size: 11px; line-height: 1.42; }

.config-stepper {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin: 0 0 10px;
  padding: 8px 2px 7px;
  background: rgba(244,246,246,.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.config-stepper button {
  min-width: 0;
  min-height: 48px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.82);
  color: #6d777b;
}
.config-stepper button span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #edf1f2;
  font-size: 9px;
  font-weight: 850;
}
.config-stepper button b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
  font-weight: 760;
}
.config-stepper button.is-active {
  border-color: rgba(22,141,137,.38);
  background: #f2fbfa;
  color: #126d69;
  box-shadow: 0 0 0 2px rgba(46,183,179,.06);
}
.config-stepper button.is-active span { background: var(--accent-dark); color: #fff; }

.config-step {
  overflow: hidden;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(15,25,30,.025);
}
.config-step > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
}
.config-step > summary::-webkit-details-marker { display: none; }
.config-step[open] > summary {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, #fff, #f8fbfb);
}
.config-step-heading { min-width: 0; display: flex; align-items: center; gap: 11px; }
.config-step-number {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2f2;
  color: #5c666a;
  font-size: 10px;
  font-weight: 850;
}
.config-step[open] .config-step-number { background: var(--accent-dark); color: #fff; }
.config-step-copy { min-width: 0; display: grid; gap: 3px; }
.config-step-copy b { font-size: 13px; letter-spacing: -.01em; }
.config-step-copy small {
  max-width: 275px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 9px;
  font-weight: 550;
}
.config-step-chevron { color: #7f898d; font-size: 16px; transition: transform .18s ease; }
.config-step[open] .config-step-chevron { transform: rotate(180deg); }
.config-step-body { padding: 11px; }
.config-step-body > .panel-section {
  margin: 0 0 9px;
  padding: 12px;
  border-radius: 11px;
  box-shadow: none;
  background: #fbfcfc;
}
.config-step-body > .panel-section:last-of-type { margin-bottom: 0; }
.config-step-body > .panel-section h2 { margin-bottom: 12px; font-size: 11px; }
.config-step-body .step-next { width: 100%; margin-top: 9px; }
.compact-subsection { background: #fbfcfc !important; }

.sidewall-customer-ui { display: grid; gap: 12px; }
.sidewall-intro-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sidewall-intro-row h3 { margin: 3px 0 0; font-size: 15px; letter-spacing: -.02em; }
.customer-side-note { margin: -4px 0 0; }

.side-plan {
  display: grid;
  grid-template-columns: 64px minmax(145px, 1fr) 64px;
  grid-template-rows: 24px 48px 96px 48px;
  grid-template-areas:
    ". wall ."
    ". rear ."
    "left core right"
    ". front .";
  gap: 6px;
  align-items: stretch;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, #fafcfc, #f2f6f6);
}
.side-house-wall {
  grid-area: wall;
  align-self: end;
  border-bottom: 4px solid #252b2e;
  color: #5e686c;
  text-align: center;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .10em;
}
.side-plan-core {
  grid-area: core;
  display: grid;
  place-items: center;
  border: 1px solid #aeb9bd;
  border-radius: 9px;
  background: rgba(255,255,255,.72);
  color: #7a8589;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .10em;
  box-shadow: inset 0 0 0 5px rgba(227,233,234,.55);
}
.side-pick {
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 5px 4px;
  border: 1px solid #ccd4d7;
  border-radius: 9px;
  background: #fff;
  color: #5b666a;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .12s ease;
}
.side-pick:hover { border-color: rgba(22,141,137,.48); background: #f3fbfa; }
.side-pick:active { transform: scale(.98); }
.side-pick span { font-size: 9px; font-weight: 850; letter-spacing: .04em; }
.side-pick small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 7px; color: #879094; }
.side-pick.is-configured { border-color: rgba(22,141,137,.30); background: #f3faf9; }
.side-pick.is-active,
.side-pick.is-multi-selected {
  border-color: var(--accent-dark);
  background: #eaf8f7;
  color: #106d69;
  box-shadow: 0 0 0 3px rgba(46,183,179,.08);
}
.side-pick.needs-review { border-color: #e6bd67; background: #fff8e9; }
.side-front { grid-area: front; }
.side-rear { grid-area: rear; }
.side-left { grid-area: left; }
.side-right { grid-area: right; }
.side-plan:not(.is-freestanding) .side-rear { display: none !important; }

.multi-side-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.multi-side-toolbar .button { min-height: 36px; }
.multi-side-toolbar .button.is-active { border-color: var(--accent-dark); background: #edf9f8; color: #126d69; }
.multi-side-toolbar span { color: var(--muted); font-size: 8px; text-align: right; }

.side-quick-editor {
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #f8fafa;
}
.side-quick-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.side-quick-head > div { min-width: 0; display: grid; gap: 2px; }
.side-quick-head small { color: var(--accent-dark); font-size: 7px; font-weight: 850; letter-spacing: .10em; }
.side-quick-head strong { font-size: 13px; }
.side-quick-head span:not(.side-review-badge) { color: var(--muted); font-size: 9px; }
.side-review-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border: 1px solid #e5c06f;
  border-radius: 999px;
  background: #fff8e9;
  color: #885b0b;
  font-size: 7px !important;
  font-weight: 800;
  white-space: nowrap;
}
.side-question { margin: 12px 0 8px; font-size: 10px; font-weight: 750; }
.side-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.side-type-card {
  min-width: 0;
  min-height: 75px;
  display: grid;
  grid-template-columns: 26px minmax(0,1fr);
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-content: center;
  text-align: left;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #31383b;
}
.side-type-card .side-type-icon {
  grid-row: 1 / 3;
  align-self: center;
  display: grid;
  place-items: center;
  width: 26px;
  height: 30px;
  border-radius: 7px;
  background: #eef2f2;
  color: #667176;
  font-size: 16px;
}
.side-type-card b { grid-column: 2; grid-row: 1; overflow-wrap: normal; word-break: normal; line-height: 1.3; align-self: end; min-width: 0; font-size: 10px; }
.side-type-card small { grid-column: 2; grid-row: 2; overflow-wrap: normal; word-break: normal; align-self: start; min-width: 0; color: var(--muted); font-size: 7px; line-height: 1.3; }
.side-type-card:hover { border-color: rgba(22,141,137,.45); background: #f7fcfb; }
.side-type-card.is-selected {
  border-color: var(--accent-dark);
  background: #effaf9;
  box-shadow: 0 0 0 3px rgba(46,183,179,.07);
}
.side-type-card.is-selected .side-type-icon { background: var(--accent-dark); color: #fff; }

.quick-color-row {
  display: grid;
  grid-template-columns: 1fr 145px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.quick-color-row label { font-size: 9px; font-weight: 700; }
.quick-color-row select { height: 38px; font-size: 10px; }
.multi-side-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.multi-side-actions span { color: var(--muted); font-size: 9px; }

.side-summary-block { padding-top: 1px; }
.side-summary-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.side-summary-title strong { font-size: 10px; }
.side-summary-title small { color: var(--muted); font-size: 7px; }
.side-summary-list { display: grid; gap: 5px; }
.side-summary-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.side-summary-row > span { min-width: 0; display: grid; gap: 1px; }
.side-summary-row b { font-size: 9px; }
.side-summary-row small { color: var(--muted); font-size: 7px; }
.side-summary-row strong { max-width: 130px; color: #536065; font-size: 8px; text-align: right; line-height: 1.25; }
.side-summary-row.is-active { border-color: rgba(22,141,137,.45); background: #f3fbfa; }
.side-summary-row.needs-review { border-color: #e5c06f; background: #fff9ed; }

.advanced-opening-details {
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.advanced-opening-details > summary {
  list-style: none;
  padding: 11px 12px;
  cursor: pointer;
  color: #4e5a5f;
  font-size: 9px;
  font-weight: 800;
}
.advanced-opening-details > summary::-webkit-details-marker { display: none; }
.advanced-opening-details > summary::after { content: '＋'; float: right; color: #899397; }
.advanced-opening-details[open] > summary::after { content: '−'; }
.advanced-opening-body { padding: 0 10px 10px; border-top: 1px solid var(--line); }
.advanced-opening-body .opening-select-button { margin-top: 10px; }

.viewer-mode-hint {
  position: absolute;
  z-index: 5;
  top: 62px;
  right: 16px;
  padding: 6px 9px;
  border: 1px solid rgba(18,25,28,.09);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #687276;
  font-size: 8px;
  font-weight: 750;
  pointer-events: none;
}

@media (max-width: 900px) {
  .config-stepper { top: 0; }
  .config-step > summary { min-height: 62px; }
}
@media (max-width: 560px) {
  .config-stepper { margin-left: -1px; margin-right: -1px; gap: 3px; padding-top: 6px; }
  .config-stepper button { min-height: 44px; border-radius: 8px; }
  .config-stepper button b { font-size: 7px; }
  .config-step-body { padding: 8px; }
  .config-step-copy small { max-width: 210px; }
  .side-plan { grid-template-columns: 58px minmax(120px,1fr) 58px; padding: 8px; }
  .side-type-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .side-type-card { min-height: 72px; padding: 8px; }
  .quick-color-row, .multi-side-actions { grid-template-columns: 1fr; }
  .multi-side-toolbar { align-items: stretch; flex-direction: column; }
  .multi-side-toolbar span { text-align: left; }
  .side-summary-row strong { max-width: 110px; }
  .viewer-mode-hint { display: none; }
}
.customer-summary-hidden { display: none !important; }

.side-review-badge[hidden], .side-quick-editor[hidden], .multi-side-actions[hidden], .quick-color-row[hidden] { display: none !important; }
.side-plan:not(.is-freestanding) { grid-template-rows: 24px 8px 96px 48px; }
.side-plan.is-freestanding { grid-template-rows: 0 48px 96px 48px; }


/* --------------------------------------------------------------------------
   V1.6.2 - Viewer visual controls + fixed-roof wedge closures
   Configuration stays in the left workflow; movement/presentation controls
   stay directly on the 3D viewer.
   -------------------------------------------------------------------------- */
.viewer-visual-controls {
  position: absolute;
  z-index: 6;
  right: 16px;
  bottom: 16px;
  width: min(272px, calc(100% - 32px));
  border: 1px solid rgba(18,25,28,.11);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.89);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(20,29,32,.12);
}
.viewer-visual-controls[hidden] { display: none !important; }
.viewer-visual-controls > summary {
  list-style: none;
  min-height: 42px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.viewer-visual-controls > summary::-webkit-details-marker { display: none; }
.viewer-visual-controls > summary span:first-child { display: flex; flex-direction: column; min-width: 0; }
.viewer-visual-controls > summary b { color: #263034; font-size: 10px; }
.viewer-visual-controls > summary small { color: #7b868a; font-size: 8px; margin-top: 1px; }
.visual-controls-chevron { color: var(--accent); font-size: 12px; transition: transform .18s ease; }
.viewer-visual-controls[open] .visual-controls-chevron { transform: rotate(180deg); }
.viewer-visual-controls-body { border-top: 1px solid rgba(18,25,28,.08); padding: 8px 10px 9px; }
.visual-control-row { padding: 6px 0 7px; }
.visual-control-row + .visual-control-row { border-top: 1px solid rgba(18,25,28,.07); margin-top: 3px; padding-top: 9px; }
.visual-control-row[hidden], .visual-zip-empty[hidden], #visual-zip-slider-wrap[hidden] { display: none !important; }
.visual-control-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.visual-control-head > span { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.visual-control-head b { color: #30383b; font-size: 9px; }
.visual-control-head small { overflow: hidden; color: #7a8589; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.visual-control-head strong { color: var(--accent-dark); font-size: 9px; }
.viewer-visual-controls input[type="range"] { width: 100%; margin: 1px 0 0; accent-color: var(--accent); }
.visual-control-scale { display: flex; justify-content: space-between; margin-top: 1px; color: #8a9396; font-size: 7px; }
.visual-zip-empty { padding: 5px 7px; border-radius: 7px; background: rgba(238,242,243,.86); color: #788286; font-size: 8px; line-height: 1.35; }

@media (max-width: 900px) {
  .viewer-visual-controls { right: 10px; bottom: 58px; width: min(250px, calc(100% - 20px)); }
}
@media (max-width: 560px) {
  .viewer-visual-controls { right: 10px; bottom: 54px; width: min(238px, calc(100% - 20px)); border-radius: 10px; }
  .viewer-visual-controls > summary { min-height: 40px; padding: 7px 9px; }
  .viewer-visual-controls-body { padding: 6px 9px 7px; }
}


/* V1.6.2 - compact fixed-roof wedge closure controls */
.wedge-closure-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(22,141,137,.17);
  border-radius: 11px;
  background: linear-gradient(180deg, #fbfefe 0%, #f6fbfa 100%);
}
.wedge-closure-panel[hidden] { display: none !important; }
.wedge-panel-head { display:flex; align-items:flex-end; justify-content:space-between; gap:10px; }
.wedge-panel-head > div { display:grid; gap:2px; }
.wedge-panel-head small { color:var(--accent-dark); font-size:7px; font-weight:850; letter-spacing:.09em; }
.wedge-panel-head strong { color:#263034; font-size:12px; }
.wedge-panel-head > span { color:var(--muted); font-size:7px; }
.wedge-linked-row {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 9px; border:1px solid var(--line); border-radius:9px; background:#fff;
}
.wedge-linked-row > span { display:grid; gap:2px; }
.wedge-linked-row b { font-size:9px; }
.wedge-linked-row small { color:var(--muted); font-size:7px; }
.wedge-linked-row input { width:18px; height:18px; accent-color:var(--accent-dark); }
.wedge-type-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; }
.wedge-type-grid button {
  min-height:38px; padding:6px 5px; border:1px solid var(--line); border-radius:8px;
  background:#fff; color:#445055; cursor:pointer; font:inherit;
}
.wedge-type-grid button b { font-size:8px; }
.wedge-type-grid button:hover { border-color:rgba(22,141,137,.42); background:#f8fcfb; }
.wedge-type-grid button.is-selected { border-color:var(--accent-dark); background:#edf9f7; color:var(--accent-dark); box-shadow:inset 0 0 0 1px rgba(22,141,137,.08); }
.wedge-unlinked-controls { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.wedge-unlinked-controls[hidden], .wedge-link-choice[hidden], #wedge-linked-controls[hidden] { display:none !important; }
.wedge-unlinked-controls label { display:grid; gap:5px; color:#4b575b; font-size:8px; font-weight:750; }
.wedge-unlinked-controls select { width:100%; min-width:0; }
.wedge-link-choice { padding:8px; border:1px solid #e3ca8e; border-radius:9px; background:#fff9ed; }
.wedge-link-choice > span { display:block; margin-bottom:7px; color:#725316; font-size:8px; line-height:1.35; }
.wedge-link-choice > div { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.wedge-link-choice .button { min-width:0; padding-left:6px; padding-right:6px; font-size:7px; }
.wedge-note { margin:0 !important; }
@media (max-width: 520px) {
  .wedge-unlinked-controls { grid-template-columns:1fr; }
  .wedge-type-grid { grid-template-columns:1fr 1fr 1fr; }
}


/* --------------------------------------------------------------------------
   V1.7.1 AI Export Pack
   -------------------------------------------------------------------------- */
.ai-export-section {
  padding-top: 0;
}

.ai-export-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(48, 207, 201, .34);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(48, 207, 201, .09), rgba(48, 207, 201, .025)),
    #f7fbfb;
  box-shadow: 0 10px 24px rgba(18, 37, 39, .06);
}

.ai-export-copy {
  display: grid;
  gap: 5px;
}

.ai-export-kicker {
  color: #148f8b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
}

.ai-export-copy strong {
  color: #15191b;
  font-size: 17px;
}

.ai-export-copy p,
.ai-export-note {
  margin: 0;
  color: #5f686b;
  line-height: 1.45;
}

.ai-export-copy p {
  font-size: 12px;
}

.ai-export-note {
  display: block;
  font-size: 10px;
}

.ai-export-button {
  width: 100%;
}

.ai-export-button:disabled {
  cursor: wait;
  opacity: .62;
}

.ai-export-modal[hidden] {
  display: none !important;
}

.ai-export-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(8, 12, 14, .55);
  backdrop-filter: blur(8px);
}

.ai-export-modal-card {
  width: min(430px, calc(100vw - 44px));
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px 14px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: #171c1f;
  color: #fff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .28);
}

.ai-export-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, .17);
  border-top-color: #30cfc9;
  border-radius: 50%;
  animation: aiExportSpin .85s linear infinite;
}

@keyframes aiExportSpin {
  to { transform: rotate(360deg); }
}

.ai-export-modal-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ai-export-modal-copy strong {
  font-size: 14px;
}

.ai-export-modal-copy span {
  overflow: hidden;
  color: #b8c2c4;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-export-progress {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
}

.ai-export-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #30cfc9;
  transition: width .18s ease;
}

#ai-export-progress-text {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  color: #8f9b9e;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .ai-export-modal-card {
    grid-template-columns: 34px 1fr;
  }
  #ai-export-progress-text {
    grid-column: 2;
    grid-row: auto;
    justify-self: end;
  }
}


/* --------------------------------------------------------------------------
   V1.7.3 - Mobile Live 3D Preview UX
   Persistent split view on phones/tablets: the 3D viewer stays visible while
   the configuration panel scrolls independently.
   -------------------------------------------------------------------------- */
:root { --mobile-viewer-height: 38dvh; }
.mobile-preview-resizer,
.mobile-live-badge,
.mobile-step-status { display: none; }

@media (max-width: 900px) {
  html, body { height: 100%; overscroll-behavior: none; }
  body { overflow: hidden; }
  .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    grid-template-rows: 60px minmax(0, 1fr);
    overflow: hidden;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  .viewer-panel {
    order: -2;
    flex: 0 0 var(--mobile-viewer-height);
    height: var(--mobile-viewer-height);
    min-height: 180px;
    max-height: 72dvh;
    border-bottom: 0;
    transition: height .18s ease, flex-basis .18s ease;
  }
  body.mobile-preview-dragging .viewer-panel { transition: none; }
  .mobile-preview-resizer {
    order: -1;
    display: flex;
    flex: 0 0 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-top: 1px solid rgba(18,25,28,.08);
    border-bottom: 1px solid var(--line);
    background: #f4f6f6;
    color: #8a9498;
    touch-action: none;
    user-select: none;
    cursor: ns-resize;
    z-index: 20;
  }
  .mobile-preview-resizer small { font-size: 7px; font-weight: 750; letter-spacing: .04em; }
  .mobile-preview-grip {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #bfc8cb;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.025);
  }
  .mobile-preview-resizer:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .config-panel {
    order: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px 14px calc(22px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 0;
  }
  .config-stepper { top: 0; }
  .mobile-live-badge {
    position: absolute;
    z-index: 7;
    left: 11px;
    top: 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid rgba(18,25,28,.09);
    border-radius: 999px;
    background: rgba(255,255,255,.84);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #4c585c;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .08em;
    pointer-events: none;
  }
  .mobile-live-badge span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(22,141,137,.12);
  }
}

@media (max-width: 560px) {
  :root { --mobile-viewer-height: 38dvh; }
  .app-shell { grid-template-rows: 56px minmax(0, 1fr); }
  .viewer-panel {
    min-height: 180px;
    max-height: 70dvh;
  }
  .config-panel { padding: 8px 10px calc(18px + env(safe-area-inset-bottom)); }
  .panel-intro { display: none; }

  /* Compact step navigation: current step + progress, then five small targets. */
  .config-stepper {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 8px;
    padding: 6px 2px 7px;
  }
  .mobile-step-status {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 28px;
    padding: 0 4px 3px;
  }
  .mobile-step-status-copy { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
  .mobile-step-status-copy span {
    color: var(--accent-dark);
    font-size: 9px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
  }
  .mobile-step-status-copy strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333b3e;
    font-size: 10px;
  }
  .mobile-step-progress {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: #e3e8e9;
  }
  .mobile-step-progress span {
    display: block;
    width: 20%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-dark);
    transition: width .18s ease;
  }
  .config-stepper button {
    min-height: 34px;
    padding: 4px 2px;
    border-radius: 9px;
  }
  .config-stepper button span { width: 23px; height: 23px; font-size: 9px; }
  .config-stepper button b { display: none; }

  /* Viewer controls stay usable without covering the model. */
  .viewer-toolbar { top: 9px; right: 9px; gap: 4px; }
  .viewer-button {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    font-size: 0;
    border-radius: 9px;
  }
  #camera-reset-button::before { content: "↺"; font-size: 17px; line-height: 1; }
  #screenshot-button::before { content: "▣"; font-size: 14px; line-height: 1; }
  #fullscreen-button::before { content: "⛶"; font-size: 16px; line-height: 1; }
  .viewer-help { display: none; }
  .viewer-visual-controls { right: 9px; bottom: 9px; width: min(224px, calc(100% - 18px)); }
  .viewer-visual-controls:not([open]) { width: 138px; }
  .viewer-visual-controls:not([open]) > summary small { display: none; }
  .viewer-mode-hint { display: none; }

  /* Keyboard-open mode: preserve a small live preview above the focused field. */
  body.mobile-keyboard-open .viewer-panel {
    flex-basis: clamp(150px, 22dvh, 190px);
    height: clamp(150px, 22dvh, 190px);
    min-height: 150px;
  }
  body.mobile-keyboard-open .viewer-visual-controls { display: none; }
  body.mobile-keyboard-open .mobile-preview-resizer small { display: none; }
}

@media (max-width: 390px) {
  .mobile-preview-resizer small { display: none; }
  .mobile-live-badge { padding: 5px 7px; font-size: 7px; }
}

/* --------------------------------------------------------------------------
   V1.7.4 - Compact contextual Live Controls
   The visual controls are a small viewer overlay. Only controls that actually
   exist in the active configuration are rendered by app.js.
   -------------------------------------------------------------------------- */
.viewer-visual-controls {
  right: 14px;
  bottom: 14px;
  width: min(252px, calc(100% - 28px));
  border-radius: 11px;
  background: rgba(255,255,255,.91);
  box-shadow: 0 7px 24px rgba(20,29,32,.11);
}
.viewer-visual-controls > summary {
  min-height: 38px;
  padding: 6px 9px;
  gap: 8px;
}
.viewer-visual-controls > summary span:first-child {
  flex: 1 1 auto;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}
.viewer-visual-controls > summary b {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  white-space: nowrap;
}
.viewer-visual-controls > summary b::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(22,141,137,.11);
}
.viewer-visual-controls > summary small {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #6f7b7f;
  font-size: 7.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visual-controls-chevron { flex: 0 0 auto; font-size: 11px; }
.viewer-visual-controls-body {
  padding: 5px 9px 7px;
  border-top-color: rgba(18,25,28,.07);
}
.visual-control-row { padding: 3px 0 4px; }
.visual-control-row + .visual-control-row {
  margin-top: 2px;
  padding-top: 6px;
  border-top-color: rgba(18,25,28,.055);
}
.visual-control-head { margin-bottom: 2px; }
.visual-control-head b { font-size: 8px; }
.visual-control-head small,
.visual-control-head strong { font-size: 7.5px; }
.viewer-visual-controls input[type="range"] { margin: 0; }
.visual-control-scale { margin-top: 0; font-size: 6.5px; }

@media (max-width: 900px) {
  .viewer-visual-controls {
    right: 10px;
    bottom: 10px;
    width: min(240px, calc(100% - 20px));
  }
}

@media (max-width: 560px) {
  /* Compact floating card: keep most of the live 3D preview unobstructed. */
  .viewer-visual-controls {
    left: auto;
    right: 10px;
    bottom: 10px;
    width: min(244px, calc(100% - 20px));
    max-width: 244px;
    border-radius: 11px;
  }
  .viewer-visual-controls:not([open]) {
    width: 105px;
    max-width: 105px;
  }
  .viewer-visual-controls > summary {
    min-height: 36px;
    padding: 5px 8px;
  }
  .viewer-visual-controls > summary span:first-child {
    gap: 6px;
  }
  /* Values are already visible beside the sliders when open; hide the long
     summary on phones so the header remains a small control instead of a banner. */
  .viewer-visual-controls > summary small {
    display: none !important;
  }
  .viewer-visual-controls-body {
    max-height: 98px;
    overflow-y: auto;
    padding: 4px 8px 6px;
  }
  .visual-control-row { padding: 2px 0 3px; }
  .visual-control-row + .visual-control-row {
    margin-top: 1px;
    padding-top: 5px;
  }
  .visual-control-head { margin-bottom: 1px; }
  .visual-control-scale { display: none; }
  .visual-zip-empty { display: none !important; }
}

@media (max-width: 390px) {
  .viewer-visual-controls {
    right: 8px;
    bottom: 8px;
    width: min(232px, calc(100% - 16px));
    max-width: 232px;
  }
  .viewer-visual-controls:not([open]) {
    width: 101px;
    max-width: 101px;
  }
}


/* --------------------------------------------------------------------------
   V1.8.0 - Premium Visual Engine Upgrade
   Camera presets and lighter glass-like viewer chrome. Product geometry stays
   untouched; these rules only improve the presentation layer.
   -------------------------------------------------------------------------- */
.viewer-panel {
  background: #d8e6e8;
}
.viewer-toolbar {
  align-items: flex-start;
}
.viewer-button {
  border-color: rgba(22,31,34,.10);
  background: rgba(250,252,251,.84);
  box-shadow: 0 6px 20px rgba(18,28,31,.075);
}
.camera-preset-control { position: relative; }
.camera-preset-button { min-width: 70px; }
.camera-preset-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  width: 132px;
  padding: 5px;
  border: 1px solid rgba(17,28,31,.11);
  border-radius: 10px;
  background: rgba(252,253,252,.96);
  box-shadow: 0 14px 36px rgba(13,24,27,.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.camera-preset-menu[hidden] { display: none !important; }
.camera-preset-menu button {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #364145;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
}
.camera-preset-menu button:hover,
.camera-preset-menu button:focus-visible {
  outline: none;
  background: #edf8f6;
  color: var(--accent-dark);
}
.dimension-label {
  box-shadow: 0 5px 20px rgba(14,27,31,.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 560px) {
  .camera-preset-button {
    width: 34px;
    min-width: 34px;
    padding: 0;
    font-size: 0;
  }
  .camera-preset-button::before { content: "◈"; font-size: 15px; line-height: 1; }
  .camera-preset-menu { width: 118px; }
  .camera-preset-menu button { min-height: 29px; font-size: 8px; }
}

/* --------------------------------------------------------------------------
   V1.8.5 / Phase 3.1 - CRM quote request bridge
   -------------------------------------------------------------------------- */
.quote-request-modal[hidden]{display:none!important}.quote-request-modal{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:20px;background:rgba(15,23,42,.62);backdrop-filter:blur(7px)}.quote-request-card{width:min(720px,100%);max-height:min(90vh,860px);overflow:auto;background:#fff;border-radius:22px;box-shadow:0 26px 70px rgba(0,0,0,.28);padding:24px}.quote-request-head{display:flex;gap:18px;align-items:flex-start}.quote-request-head h2{margin:4px 0 8px;font-size:1.55rem}.quote-request-head p{margin:0;color:var(--muted);line-height:1.5}.quote-request-kicker{display:block;font-size:.72rem;font-weight:800;letter-spacing:.13em;color:var(--accent,#159b96)}.quote-request-close{margin-left:auto;border:0;background:transparent;font-size:1.8rem;line-height:1;cursor:pointer;color:#64748b;padding:2px 8px;border-radius:10px}.quote-request-close:hover{background:#f1f5f9}.quote-request-form{margin-top:20px}.quote-request-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.quote-request-grid label{display:grid;gap:6px;font-size:.85rem;font-weight:700;color:#334155}.quote-request-grid input,.quote-request-grid textarea,.quote-request-grid select{width:100%;box-sizing:border-box;border:1px solid #d8e0e7;border-radius:11px;background:#fff;padding:11px 12px;font:inherit;color:#0f172a;outline:none}.quote-request-grid input:focus,.quote-request-grid textarea:focus,.quote-request-grid select:focus{border-color:#159b96;box-shadow:0 0 0 3px rgba(21,155,150,.12)}.quote-request-wide{grid-column:1/-1}.quote-request-honeypot{position:absolute!important;left:-99999px!important;width:1px!important;height:1px!important;overflow:hidden!important}.quote-request-summary{margin-top:16px;padding:12px 14px;border:1px solid #dfe7eb;border-radius:12px;background:#f8fafc;color:#475569;font-size:.88rem;line-height:1.5}.quote-request-message{margin-top:12px;padding:11px 13px;border-radius:10px;background:#fff3cd;color:#6b4d00;font-size:.88rem}.quote-request-message.is-error{background:#fff0f0;color:#8a2525}.quote-request-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.quote-request-actions button:disabled{opacity:.55;cursor:not-allowed}.quote-request-success{text-align:center;padding:18px 8px 8px}.quote-request-success-icon{width:58px;height:58px;margin:0 auto 12px;border-radius:50%;display:grid;place-items:center;background:#e7f8f1;color:#137f5f;font-size:1.8rem;font-weight:900}.quote-request-success h2{margin:0 0 10px}.quote-request-success p{color:#475569}.quote-request-success .button{margin-top:8px}@media(max-width:620px){.quote-request-modal{padding:10px}.quote-request-card{padding:18px;border-radius:18px;max-height:94vh}.quote-request-grid{grid-template-columns:1fr}.quote-request-wide{grid-column:auto}.quote-request-actions{flex-direction:column-reverse}.quote-request-actions .button{width:100%}}
/* Phase 2C.2 */
.quote-request-head[hidden]{display:none!important}
#roof-screen-status.is-invalid{color:#a12d2d;font-weight:700}

/* V1.11: progressive side closure controls */
#wedge-closure-panel { display:none !important; }
.wall-options {display:grid;gap:12px;margin:14px 0;}
.wall-options label {display:grid;gap:7px;}
.wall-options select {width:100%;min-height:44px;max-width:100%;}
.wall-options .wall-zip-toggle {display:flex;align-items:center;gap:10px;min-height:44px;}
.wall-options details {padding:10px;border:1px solid #647777;border-radius:8px;}
.wall-options summary,.roof-technical summary {cursor:pointer;min-height:38px;}
.wall-options [hidden],.wall-options[hidden] {display:none !important;}
#wall-layout-note,#wall-mixed-notice {font-size:12px;line-height:1.5;}
.side-type-card {min-height:64px;overflow-wrap:anywhere;}
@media(max-width:600px){.side-type-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.wall-options{min-width:0;}}
