/* Extracted from cabinet-configurator.html (improvement-plan item 1, CSS pass). */

    :root {
      --black:      #000000;
      --dark-grey:  #383838;
      --off-white:  #F4F4F3;
      --amber:      #FFC700;
      --white:      #FFFFFF;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: 'Poppins', Arial, sans-serif;
      background: var(--off-white);
      color: var(--dark-grey);
      height: 100vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* ── Header — slim branded app bar ──
       Mirrors the website's "focused app mode" AppBar (doozie-website
       src/site/configure-app.jsx/.css): logo · context · help links · exit. */
    header {
      background: var(--white);
      border-bottom: 1px solid #e8e7e5;
      padding: 0 18px;
      height: 58px;
      display: flex;
      align-items: center;
      gap: 14px;
      flex-shrink: 0;
      z-index: 10;
    }
    .logo {
      font-family: 'Poppins', Arial, sans-serif;
      font-size: 21px;
      font-weight: 400;
      color: var(--black);
      letter-spacing: -0.4px;
      text-decoration: none;
      user-select: none;
    }
    .header-sep { width: 1px; height: 20px; background: #e0dfdd; }
    .header-title {
      font-size: 13px;
      color: #888;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .header-title b { color: var(--black); font-weight: 600; }
    .header-title .dot { color: #bbb; margin: 0 4px; }
    .header-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
    .header-link {
      font-size: 13px;
      font-weight: 500;
      color: #888;
      padding: 9px 12px;
      border-radius: 999px;
      text-decoration: none;
      transition: background 0.15s, color 0.15s;
      white-space: nowrap;
    }
    .header-link:hover { background: var(--off-white); color: var(--black); }
    .header-exit {
      display: inline-flex;
      align-items: center;
      min-height: 40px;
      padding: 0 18px;
      border-radius: 999px;
      border: 1.5px solid #e5e5e5;
      font-size: 13px;
      font-weight: 500;
      color: var(--black);
      text-decoration: none;
      white-space: nowrap;
      transition: border-color 0.18s;
    }
    .header-exit:hover { border-color: var(--black); }
    @media (max-width: 900px) { .header-title, .header-sep { display: none; } }
    @media (max-width: 560px) { .header-link { display: none; } }

    /* ── Layout ── */
    .app-body { display: flex; flex: 1; overflow: hidden; }

    /* ── Viewport ── */
    #viewport {
      flex: 1;
      position: relative;
      background: #1c1c1c;
      overflow: hidden;
    }
    #three-canvas { display: block; width: 100%; height: 100%; }

    /* Studio vignette — soft dark edge around the 3D viewport */
    #viewport::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,0.32) 100%);
      pointer-events: none;
      z-index: 1;
    }

    .viewport-controls-hint {
      position: absolute;
      bottom: 64px;   /* clears the chat bar along the viewer's bottom edge */
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0,0,0,0.55);
      color: rgba(255,255,255,0.7);
      font-size: 11px;
      padding: 5px 14px;
      border-radius: 999px;
      pointer-events: none;
      white-space: nowrap;
    }

    /* ── Viewport button row (top-right) ── */
    .vp-btn-row {
      position: absolute;
      top: 14px;
      right: 16px;
      display: flex;
      align-items: center;
      gap: 6px;
      z-index: 10;
    }

    /* ── Unified viewport button — matches cabinet-admin .vp-btn ── */
    .vp-btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      background: rgba(0,0,0,0.55);
      color: #fff;
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 999px;
      padding: 6px 14px;
      font-size: 12px;
      font-weight: 500;
      font-family: inherit;
      cursor: pointer;
      backdrop-filter: blur(4px);
      transition: background 0.15s;
      white-space: nowrap;
    }
    .vp-btn:hover { background: rgba(0,0,0,0.8); }
    .vp-btn.on    { background: #ffc700; color: #1a1814; border-color: #ffc700; }
    .vp-btn.on:hover { background: #e6b400; }

    /* Icon-only variant (bin button) */
    .vp-btn-icon { padding: 6px 10px; }
    .vp-btn-icon:hover { color: #ffc700; }

    /* ── "Can't quite nail your layout" bar (bottom edge of the 3D) ──
       The website's fallback message (doozie-website styles.css .how-fallback)
       as a slim full-width strip along the viewer's bottom edge, so it stays
       out of the 3D view; copy must stay in step with the site. */
    .vp-chat-bar {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 10;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 18px;
      padding: 9px 16px;
      background: rgba(0,0,0,0.62);
      backdrop-filter: blur(6px);
      border-top: 1px solid rgba(255,255,255,0.12);
    }
    .vp-chat-bar p { font-size: 12px; color: rgba(255,255,255,0.78); line-height: 1.45; }
    .vp-chat-bar p b { color: #fff; font-weight: 600; }
    .vp-chat-bar .btn { min-height: 34px; padding: 5px 16px; font-size: 12px; flex-shrink: 0; white-space: nowrap; }

    /* ── Info overlay ── */
    .ov-divider { border: none; border-top: 1px solid #f0f0ee; margin: 6px 0; }

    /* ── Right panel ── */
    .right-panel {
      width: 316px;
      background: var(--white);
      border-left: 1px solid #e8e7e5;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      flex-shrink: 0;
    }

    .panel-top {
      padding: 18px 20px 14px;
      border-bottom: 1px solid #f0f0ee;
    }
    .panel-top h2 { font-size: 15px; color: var(--black); margin-bottom: 2px; }
    .panel-top p  { font-size: 12px; color: #aaa; }

    /* ── Step tabs ── */
    .step-tabs {
      display: flex;
      border-bottom: 1px solid #f0f0ee;
      padding: 0 8px;
    }
    .step-tab {
      flex: 1;
      padding: 10px 4px 8px;
      text-align: center;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: border-color 0.2s, color 0.2s;
      position: relative;
      user-select: none;
    }
    .step-tab .tab-num {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #eeeceb;
      color: #bbb;
      font-size: 10px;
      margin: 0 auto 3px;
      transition: background 0.2s, color 0.2s;
    }
    .step-tab .tab-label { font-size: 10px; color: #bbb; transition: color 0.2s; }
    .step-tab.active { border-bottom-color: var(--amber); }
    .step-tab.active .tab-num { background: var(--amber); color: var(--black); }
    .step-tab.active .tab-label { color: var(--black); }
    .step-tab.done .tab-num { background: var(--black); color: var(--white); }
    .step-tab.done .tab-label { color: var(--dark-grey); }

    /* Preset links (?preset=) bypass the layout step — hide its tab. */
    body.preset-mode #tab-2 { display: none; }

    /* ── Step content ── */
    .panel-content {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
      scrollbar-width: thin;
      scrollbar-color: #ddd transparent;
    }
    .panel-content::-webkit-scrollbar { width: 4px; }
    .panel-content::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

    .step-pane { display: none; }
    .step-pane.active { display: block; }

    /* ── Form elements ── */
    .field-label {
      font-size: 11px;
      color: var(--dark-grey);
      margin-bottom: 6px;
      display: block;
    }
    .field-group { margin-bottom: 16px; }

    .dim-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .dim-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

    .input-unit-wrap { position: relative; }
    .input-unit-wrap input[type="number"] {
      width: 100%;
      padding: 8px 28px 8px 10px;
      border: 1.5px solid #e8e7e5;
      border-radius: 8px;
      font-family: 'Poppins', Arial, sans-serif;
      font-size: 13px;
      color: var(--black);
      background: var(--off-white);
      outline: none;
      transition: border-color 0.18s, background 0.18s;
      -moz-appearance: textfield;
    }
    .input-unit-wrap input[type="number"]::-webkit-outer-spin-button,
    .input-unit-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
    .input-unit-wrap input[type="number"]:focus {
      border-color: var(--amber);
      background: var(--white);
    }
    .input-unit-wrap .unit {
      position: absolute;
      right: 9px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 10px;
      color: #bbb;
      pointer-events: none;
    }
    .sub-label {
      display: block;
      font-size: 10px;
      color: #bbb;
      margin-top: 4px;
      text-align: center;
    }

    .section-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      color: #ccc;
      margin-bottom: 10px;
      margin-top: 2px;
    }

    /* ── Fitting cards ── */
    .fitting-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .fitting-card {
      border: 2px solid #ebebea;
      border-radius: 10px;
      padding: 12px 10px 10px;
      cursor: pointer;
      text-align: center;
      transition: border-color 0.18s, background 0.18s;
      user-select: none;
    }
    .fitting-card:hover { border-color: #ccc; }
    .fitting-card.selected { border-color: var(--amber); background: #fffbeb; }
    .fitting-card .fit-diagram {
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 6px;
    }
    .fitting-card .fit-name { font-size: 11px; color: var(--dark-grey); }
    .fitting-card.selected .fit-name { color: var(--black); }

    /* SVG diagrams in fitting cards — height fixed, width auto so variable viewBox widths display correctly */
    .fit-diagram svg { height: 28px; width: auto; }

    .fitting-desc {
      margin-top: 10px;
      padding: 8px 10px;
      background: var(--off-white);
      border-radius: 8px;
      font-size: 11px;
      color: #888;
      line-height: 1.5;
    }

    /* ── Range/Number hybrid ── */
    .range-number {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .range-number input[type="range"] {
      flex: 1;
      accent-color: var(--amber);
    }
    .range-number .num-box {
      width: 68px;
      flex-shrink: 0;
    }

    /* ── Summary card ── */
    .summary-card {
      background: var(--off-white);
      border-radius: 10px;
      padding: 14px;
      margin-top: 4px;
    }
    .summary-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 5px 0;
      font-size: 12px;
      border-bottom: 1px solid #e8e7e5;
      gap: 12px;
    }
    .summary-row:last-child { border-bottom: none; }
    .summary-row .sr-key { color: #999; flex-shrink: 0; }
    .summary-row .sr-val { color: var(--black); text-align: right; }
    .summary-row .sr-val.highlight {
      background: var(--amber);
      color: var(--black);
      padding: 1px 8px;
      border-radius: 999px;
      font-size: 12px;
    }

    .validation-pill {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 12px;
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 12px;
      line-height: 1.4;
    }
    .validation-pill.ok  { background: #f0fdf4; color: #15803d; }
    .validation-pill.err { background: #fef2f2; color: #b91c1c; }
    .validation-pill .pill-icon { font-size: 16px; flex-shrink: 0; }

    /* ── Price card (step 5) ── */
    .price-card {
      background: var(--off-white); border-radius: 12px;
      padding: 28px 20px; text-align: center; margin-top: 4px;
    }
    .price-card-label {
      font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
      color: #aaa; margin-bottom: 10px;
    }
    .price-card-amount {
      font-size: 28px; font-weight: 600; color: var(--black);
      letter-spacing: -0.5px; margin-bottom: 2px;
    }
    .price-card-ex-vat { font-size: 14px; font-weight: 400; color: #aaa; }
    .price-card-vat    { font-size: 12px; color: #aaa; margin-bottom: 12px; }
    .price-card-total  {
      font-size: 20px; font-weight: 600; color: var(--amber);
      border-top: 1px solid #e8e5e1; padding-top: 12px; margin-top: 6px;
    }
    .price-card-inc-label { font-size: 12px; font-weight: 400; color: #aaa; }
    .price-card-note {
      margin-top: 16px; font-size: 10px; color: #bbb; line-height: 1.5;
    }
    .price-card-empty {
      font-size: 12px; color: #bbb; text-align: center; padding: 24px 0; line-height: 1.6;
    }
    /* ── Pricing breakdown (team debug view) ── */
    .bk-details { margin-top: 12px; }
    .bk-summary {
      font-size: 11px; color: #aaa; cursor: pointer; user-select: none;
      padding: 6px 0; list-style: none;
    }
    .bk-summary::-webkit-details-marker { display: none; }
    .bk-details[open] .bk-summary { color: var(--amber); }
    .bk-body { margin-top: 8px; }
    .bk-section-title {
      font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
      color: #aaa; margin: 14px 0 4px;
    }
    .bk-table { width: 100%; border-collapse: collapse; font-size: 11px; }
    .bk-table th {
      text-align: left; color: #bbb; font-weight: 400;
      border-bottom: 1px solid #e8e5e1; padding: 3px 4px;
    }
    .bk-table td { padding: 3px 4px; color: var(--dark-grey); }
    .bk-table tr:nth-child(even) td { background: rgba(0,0,0,.02); }
    .bk-num  { text-align: right; font-variant-numeric: tabular-nums; }
    .bk-unit { text-align: left; color: #bbb; padding-left: 6px; }
    .bk-totals { margin-top: 8px; border-top: 2px solid #e8e5e1; }
    .bk-totals td { padding: 4px 4px; }
    .bk-subtotal td { font-weight: 600; border-top: 1px solid #e8e5e1; padding-top: 6px; }
    .bk-grand td { font-weight: 700; color: var(--amber); font-size: 12px; padding-top: 4px; }

    /* ── Module filter rows (step 2) ── */
    .module-filter-row {
      display: flex;
      gap: 6px;
      margin-bottom: 6px;
      align-items: center;
      flex-shrink: 0;
    }
    .module-toggle-group {
      display: flex;
      border: 1px solid #e8e7e5;
      border-radius: 8px;
      overflow: hidden;
    }
    .module-toggle-btn {
      padding: 5px 10px;
      font-size: 11px;
      font-family: inherit;
      text-align: center;
      cursor: pointer;
      background: var(--off-white);
      color: #999;
      border: none;
      border-right: 1px solid #e8e7e5;
      white-space: nowrap;
      transition: background 0.15s, color 0.15s;
    }
    .module-toggle-btn:last-child { border-right: none; }
    .module-toggle-btn.active {
      background: var(--black);
      color: var(--white);
    }
    .module-toggle-sep {
      width: 1px;
      height: 20px;
      background: #e0dedd;
      flex-shrink: 0;
    }
    .feature-tag {
      flex: 1;
      padding: 4px 6px;
      font-size: 11px;
      font-family: inherit;
      text-align: center;
      cursor: pointer;
      background: var(--off-white);
      color: #999;
      border: 1px solid #e8e7e5;
      border-radius: 999px;
      white-space: nowrap;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
    }
    .feature-tag.active {
      background: var(--amber);
      color: var(--black);
      border-color: var(--amber);
    }

    /* ── Module cards grid ── */
    .module-cards-area {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 4px;
    }

    .module-card {
      border: 2px solid #e8e7e5;
      border-radius: 8px;
      padding: 5px;
      cursor: grab;
      transition: border-color 0.18s, box-shadow 0.18s;
      user-select: none;
      display: block;
      line-height: 0;
      justify-self: center;
    }
    .module-card:hover { border-color: var(--amber); box-shadow: 0 2px 10px rgba(255,199,0,0.18); }
    .module-card.is-dragging { opacity: 0.4; cursor: grabbing; }

    /* ── Drag ghost (follows cursor) ── */
    .drag-ghost {
      position: fixed;
      pointer-events: none;
      z-index: 9999;
      background: var(--white);
      border: 2px solid var(--amber);
      border-radius: 10px;
      padding: 8px 14px;
      box-shadow: 0 8px 28px rgba(0,0,0,0.22);
      transform: translate(-50%, -65%);
      font-family: 'Poppins', Arial, sans-serif;
      font-size: 12px;
      color: var(--dark-grey);
      display: flex;
      align-items: center;
      gap: 10px;
      white-space: nowrap;
    }

    /* ── Viewport lock badge ── */
    .vp-lock-badge {
      position: absolute;
      top: 16px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0,0,0,0.58);
      color: rgba(255,255,255,0.82);
      font-size: 11px;
      padding: 6px 14px;
      border-radius: 999px;
      pointer-events: none;
      font-family: 'Poppins', Arial, sans-serif;
      white-space: nowrap;
      display: none;
      gap: 6px;
      align-items: center;
    }

    /* ── Drop hint overlay on 3D canvas ── */
    .drop-hint-bar {
      position: absolute;
      bottom: 64px;   /* clears the chat bar along the viewer's bottom edge */
      left: 50%;
      transform: translateX(-50%);
      background: rgba(255,199,0,0.92);
      color: var(--black);
      font-size: 12px;
      padding: 6px 18px;
      border-radius: 999px;
      pointer-events: none;
      font-family: 'Poppins', Arial, sans-serif;
      display: none;
      white-space: nowrap;
    }

.no-layout-notice {
      background: #fef2f2;
      border-radius: 8px;
      padding: 14px;
      font-size: 12px;
      color: #b91c1c;
      text-align: center;
      line-height: 1.5;
    }

    /* Editing-card helper line — e.g. what the depth-alignment toggle does. */
    .ec-note {
      margin-top: 6px;
      font-size: 11px;
      color: #aaa;
      line-height: 1.5;
    }

    /* Soft nudge (not an error) — e.g. a desk in a too-shallow zone. */
    .desk-depth-warn {
      position: relative;
      background: #fffbeb;
      border: 1px solid #fcd34d;
      border-radius: 8px;
      padding: 10px 30px 10px 12px;
      margin-bottom: 10px;
      font-size: 12px;
      color: #92400e;
      line-height: 1.5;
    }
    .desk-depth-warn__close {
      position: absolute;
      top: 6px;
      right: 8px;
      background: transparent;
      border: 0;
      font-size: 16px;
      line-height: 1;
      color: #b45309;
      cursor: pointer;
      padding: 2px 4px;
    }
    .desk-depth-warn__close:hover { color: #92400e; }

    /* ── Placeholder step ── */
    .placeholder-pane {
      text-align: center;
      padding: 40px 16px 20px;
    }
    .coming-soon-badge {
      display: inline-block;
      background: var(--off-white);
      border: 1px solid #e0dfdd;
      color: #bbb;
      font-size: 10px;
      padding: 3px 12px;
      border-radius: 999px;
      margin-bottom: 20px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .placeholder-icon { font-size: 44px; opacity: 0.25; margin-bottom: 16px; }
    .placeholder-pane h3 { font-size: 15px; color: var(--black); margin-bottom: 8px; }
    .placeholder-pane p  { font-size: 12px; color: #bbb; line-height: 1.65; }

    .module-preview {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 20px;
    }
    .module-chip {
      background: var(--off-white);
      border: 1px dashed #ddd;
      border-radius: 8px;
      padding: 10px 6px;
      text-align: center;
      opacity: 0.5;
    }
    .module-chip .mc-icon { font-size: 20px; }
    .module-chip .mc-name { font-size: 10px; color: #aaa; margin-top: 4px; }

    /* ── Colour swatches (step 2) ── */
    .swatch-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .swatch {
      width: 46px;
      cursor: pointer;
      border-radius: 5px;
      border: 2px solid transparent;
      transition: border-color 0.15s;
      padding: 2px;
    }
    .swatch:hover { border-color: #ccc; }
    .swatch.selected { border-color: var(--amber); }
    .swatch-chip {
      width: 42px;
      height: 34px;
      border-radius: 3px;
      border: 1px solid rgba(0,0,0,0.10);
    }
    .swatch-name {
      font-size: 8px;
      color: #666;
      text-align: center;
      margin-top: 3px;
      line-height: 1.2;
      word-break: break-word;
    }
    /* A retired item (no longer in the live catalogue / archived) that's still
       the current selection — kept and resolvable, but can't be re-added. */
    .swatch.retired { border-color: #e0e0e0; opacity: 0.8; }
    .swatch.retired .swatch-chip { filter: grayscale(0.4); }
    .swatch-retired-badge {
      display: block;
      font-size: 7px;
      color: #b06a00;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-top: 1px;
    }
    /* "Special Order" door group — collapsed by default, full-width within the
       swatch flex row, expanded on click via the native <details> element. */
    .swatch-group-collapsible {
      flex-basis: 100%;
      width: 100%;
      margin-top: 8px;
      border-top: 1px solid #eee;
      padding-top: 6px;
    }
    .swatch-group-collapsible > summary {
      cursor: pointer;
      list-style: none;
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 9px;
      color: #aaa;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      padding: 2px 0;
    }
    .swatch-group-collapsible > summary::-webkit-details-marker { display: none; }
    .swatch-group-collapsible > summary::before {
      content: '▸';
      font-size: 9px;
      transition: transform 0.15s;
    }
    .swatch-group-collapsible[open] > summary::before { transform: rotate(90deg); }
    .swatch-group-count {
      color: #c9c9c9;
      font-size: 8px;
    }
    .swatch-subgrid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 6px;
    }

    /* Handle swatches — 2-up grid, large chip, image contained on white. */
    .handle-swatch-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .handle-swatch-grid .swatch { width: auto; }
    .handle-swatch-grid .swatch-chip {
      width: 100%;
      height: auto;
      aspect-ratio: 5 / 3;
      object-fit: contain;
      background: #ffffff;
    }

    /* Handle colour finishes (e.g. black / nickel / gold). Unselected cards show
       a row of small non-interactive preview dots; the selected card expands into
       the inline picker (larger clickable dots + the chosen finish name), wrapped
       by the same amber selected border on the parent .swatch. */
    .finish-dot {
      display: inline-block;
      border-radius: 50%;
      border: 1px solid rgba(0,0,0,0.20);
      padding: 0;
      box-sizing: border-box;
    }
    .finish-dots--preview {
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      margin-top: 4px;
    }
    .finish-dot--preview {
      width: 6px;
      height: 6px;
      border-color: rgba(0,0,0,0.15);
    }
    .finish-picker {
      margin-top: 5px;
      padding-top: 5px;
      border-top: 1px solid #f0f0ee;
    }
    .finish-picker .finish-dots {
      display: flex;
      justify-content: space-evenly;
      align-items: center;
    }
    .finish-picker .finish-dot {
      width: 18px;
      height: 18px;
      cursor: pointer;
      transition: transform 0.12s, box-shadow 0.12s;
    }
    .finish-picker .finish-dot:hover { transform: scale(1.12); }
    .finish-picker .finish-dot.selected {
      box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px var(--amber);
    }
    .finish-name {
      font-size: 8px;
      color: #666;
      text-align: center;
      margin-top: 4px;
      line-height: 1.2;
    }

    /* ── Footer ── */
    .panel-footer {
      padding: 14px 20px;
      border-top: 1px solid #f0f0ee;
      display: flex;
      gap: 8px;
    }
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 10px 20px;
      border-radius: 999px;
      font-family: 'Poppins', Arial, sans-serif;
      font-size: 13px;
      cursor: pointer;
      border: none;
      min-height: 44px;
      transition: background 0.18s, opacity 0.18s;
      white-space: nowrap;
    }
    .btn:active { opacity: 0.85; }
    .btn-primary  { background: var(--amber); color: var(--black); }
    .btn-primary:hover { background: #e6b300; }
    .btn-secondary { background: var(--black); color: var(--white); }
    .btn-subtle   { background: var(--off-white); color: var(--black); }
    .btn-full     { width: 100%; }

    /* ── Price bar (above step tabs) ── */
    .price-bar {
      padding: 10px 20px;
      background: #fafaf9;
      border-bottom: 1px solid #f0f0ee;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }
    .price-bar-item { display: flex; flex-direction: column; gap: 1px; }
    .price-bar-item.stretch { flex: 1; }
    .pb-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: #bbb; }
    .pb-value { font-size: 14px; font-weight: 600; color: var(--black); }
    .pb-value.pending { font-size: 12px; color: #bbb; font-weight: 400; }
    .price-bar-sep { width: 1px; height: 28px; background: #eee; flex-shrink: 0; }

    /* ── Stacked dimension fields (step 1) ── */
    .dim-stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
    .dim-field { display: flex; flex-direction: column; }
    .dim-field-row { display: flex; align-items: center; gap: 8px; width: 100%; }
    .dim-field-label { font-size: 12px; color: var(--dark-grey); width: 52px; flex-shrink: 0; }
    .dim-field-row .input-unit-wrap { flex: 1; }
    .dim-guidance { font-size: 10px; color: #bbb; margin-top: 3px; margin-left: 60px; }
    .dim-alert {
      display: flex; align-items: flex-start; gap: 5px;
      margin-top: 5px; margin-left: 60px;
      font-size: 11px; line-height: 1.4;
      color: #a06800; background: #fffbeb;
      border: 1px solid #ffe580; border-radius: 6px; padding: 6px 8px;
    }
    .dim-alert.dim-alert-error { color: #c02020; background: #fff5f5; border-color: #ffc0c0; }
    .dim-alert .alert-icon { flex-shrink: 0; margin-top: 1px; }

    /* ── Ruler icon tooltip (opens to the left) ── */
    .measure-hint { position: relative; display: flex; align-items: center; flex-shrink: 0; }
    .measure-btn {
      width: 28px; height: 28px; border-radius: 50%;
      border: 1.5px solid #e0dfdd; background: var(--white);
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; flex-shrink: 0;
    }
    .measure-tooltip {
      display: none; position: absolute;
      right: calc(100% + 10px); left: auto;
      top: 50%; transform: translateY(-50%);
      width: 220px; background: var(--white);
      border: 1px solid #e0dfdd; border-radius: 10px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.14);
      padding: 12px 14px; z-index: 100; pointer-events: none;
    }
    .measure-tooltip::before {
      content: ''; position: absolute;
      left: 100%; right: auto; top: 50%; transform: translateY(-50%);
      border: 6px solid transparent; border-left-color: #e0dfdd;
    }
    .measure-tooltip::after {
      content: ''; position: absolute;
      left: calc(100% - 1px); right: auto; top: 50%; transform: translateY(-50%);
      border: 6px solid transparent; border-left-color: var(--white);
    }
    .measure-hint:hover .measure-tooltip { display: block; }
    .tooltip-title { font-size: 12px; font-weight: 600; color: var(--black); margin-bottom: 6px; line-height: 1.3; }
    .tooltip-body  { font-size: 11px; color: #555; line-height: 1.55; }
    .tooltip-body strong { color: var(--black); }

    /* ── Input validation states ── */
    .input-unit-wrap input[type="number"].input-warn  { border-color: var(--amber); background: #fffbeb; }
    .input-unit-wrap input[type="number"].input-error { border-color: #E04040;     background: #fff5f5; }

    /* ── localStorage warning banner ── */
    #ls-warning {
      display: none;
      background: #dc2626;
      color: #fff;
      font-size: 12px;
      padding: 8px 20px;
      text-align: center;
      flex-shrink: 0;
      z-index: 100;
    }
    #ls-warning a { color: #ffd0d0; }

    /* ── Slot edit icon overlay ── */
    .slot-edit-btn {
      position: absolute;
      width: 28px; height: 28px;
      display: flex; align-items: center; justify-content: center;
      background: rgba(26,24,20,0.72);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 6px;
      color: #d4d0c8;
      cursor: pointer;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
      pointer-events: auto;
    }
    .slot-edit-btn:hover  { background: #ffc700; color: #1a1814; border-color: #ffc700; }
    .slot-edit-btn.selected { background: #ffc700; color: #1a1814; border-color: #ffc700; }
    .slot-edit-btn.has-override::after {
      content: '';
      position: absolute;
      top: -3px; right: -3px;
      width: 7px; height: 7px;
      background: #ffc700;
      border-radius: 50%;
      border: 1.5px solid #1a1814;
    }
    .slot-edit-btn.selected.has-override::after { background: #1a1814; border-color: #ffc700; }

    /* ── Slot width inspector panel ── */
    .slot-width-inspector {
      margin-top: 14px;
      background: var(--off-white, #f5f4f1);
      border: 1px solid #e0ddd8;
      border-left: 3px solid #ffc700;
      border-radius: 8px;
      padding: 12px 14px;
    }
    .swi-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 8px;
      font-size: 12px; font-weight: 600; color: #1a1814;
    }
    .swi-close {
      background: none; border: none; cursor: pointer;
      font-size: 16px; color: #888; line-height: 1;
      padding: 0 2px;
    }
    .swi-close:hover { color: #1a1814; }
    .swi-module-name {
      font-size: 11px; color: #666;
      margin-bottom: 8px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .swi-field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
    .swi-label { font-size: 11px; color: #555; flex: 0 0 auto; }
    .swi-input-wrap { display: flex; align-items: center; gap: 4px; }
    .swi-input {
      width: 72px;
      padding: 5px 7px;
      border: 1px solid #d4d0c8;
      border-radius: 5px;
      font-size: 13px;
      background: #fff;
      color: #1a1814;
      -moz-appearance: textfield;
    }
    .swi-input::-webkit-inner-spin-button,
    .swi-input::-webkit-outer-spin-button { -webkit-appearance: none; }
    .swi-input:focus { outline: none; border-color: #ffc700; }
    .swi-unit { font-size: 11px; color: #888; }
    .swi-warning {
      font-size: 11px; color: #c02020;
      background: #fff5f5; border: 1px solid #f5c6c6;
      border-radius: 5px; padding: 6px 8px;
      margin-bottom: 8px; line-height: 1.45;
    }
    .swi-reset {
      background: none; border: none; cursor: pointer;
      font-size: 11px; color: #888;
      padding: 0; text-decoration: underline;
    }
    .swi-reset:hover { color: #1a1814; }

    /* ── Row tab strip (Step 2 multi-row mode) ──────────────────────────────── */
    .row-tab-strip {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-bottom: 10px;
      flex-wrap: wrap;
    }
    .row-tab {
      background: #2e2b27;
      border: 1px solid #444;
      border-radius: 5px;
      color: #aaa;
      cursor: pointer;
      font-size: 11px;
      padding: 4px 10px;
      line-height: 1.4;
    }
    .row-tab:hover { background: #3a362f; color: #ccc; }
    .row-tab.active {
      background: #ffc700;
      border-color: #ffc700;
      color: #1a1814;
      font-weight: 600;
    }
    .row-tab-add {
      background: none;
      border: 1px dashed #555;
      border-radius: 5px;
      color: #888;
      cursor: pointer;
      font-size: 11px;
      padding: 4px 10px;
      margin-left: 4px;
    }
    .row-tab-add:hover { border-color: #ffc700; color: #ffc700; }

    /* ── Section drag-and-drop cards (Step 2) ───────────────────────────────── */
    .section-group-label {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #888;
      margin-bottom: 6px;
    }
    .section-cards {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }
    .section-card {
      background: #ffffff;
      border: 2px solid #ebebea;
      border-radius: 10px;
      padding: 8px 12px;
      cursor: grab;
      user-select: none;
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 12px;
      transition: background 0.18s, border-color 0.18s;
    }
    .section-card:hover { border-color: #ccc; }
    .section-card:active { cursor: grabbing; }
    .section-card-icon { flex-shrink: 0; display: block; }
    .section-card-info {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }
    .section-card-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--black);
    }
    .section-card-h {
      font-size: 10px;
      color: var(--dark-grey);
      font-weight: 500;
    }
    .section-card-h strong {
      color: var(--black);
      font-weight: 700;
    }
    .section-card-desc {
      font-size: 10px;
      color: var(--dark-grey);
    }

    /* ── Step-2 multi-step hint card ── */
    .vp-hint-card {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 620px;
      max-width: calc(100% - 32px);
      background: rgba(255, 255, 255, 0.97);
      border: 2px solid var(--amber);
      border-radius: 14px;
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
      z-index: 10;
      overflow: hidden;
      pointer-events: none;
    }
    .vp-hint-card__header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 11px 12px 10px 16px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.07);
      pointer-events: auto;
    }
    .vp-hint-card__title {
      font-size: 14px;
      font-weight: 600;
      color: var(--black);
      flex: 1;
    }
    .vp-hint-card__dots {
      display: flex;
      gap: 6px;
    }
    .vp-hint-card__dot {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: none;
      background: #eeeceb;
      font-size: 10px;
      font-weight: 500;
      color: #bbb;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s, color 0.2s;
    }
    .vp-hint-card__dot--active {
      background: var(--amber);
      color: var(--black);
    }
    .vp-hint-card__close {
      background: transparent;
      border: 0;
      font-size: 20px;
      line-height: 1;
      color: #888;
      cursor: pointer;
      padding: 2px 4px;
      flex-shrink: 0;
    }
    .vp-hint-card__close:hover { color: var(--black); }
    .vp-hint-card__video {
      display: block;
      width: 100%;
      height: 390px;
      object-fit: cover;
      background: #111;
    }
    .vp-hint-card__body {
      padding: 12px 16px 14px;
      pointer-events: auto;
    }
    .vp-hint-card__step-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--black);
      margin-bottom: 4px;
    }
    .vp-hint-card__step-desc {
      font-size: 12px;
      color: var(--dark-grey);
      line-height: 1.45;
    }
    .vp-hint-card__nav {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 12px;
    }
    .vp-hint-card__nav-back,
    .vp-hint-card__nav-next {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 999px;
      font-family: 'Poppins', Arial, sans-serif;
      font-size: 13px;
      font-weight: 400;
      padding: 8px 20px;
      cursor: pointer;
      transition: background 0.18s, opacity 0.18s;
      white-space: nowrap;
    }
    .vp-hint-card__nav-back {
      background: var(--off-white);
      color: var(--black);
    }
    .vp-hint-card__nav-back:hover { background: #e8e6e3; }
    .vp-hint-card__nav-next {
      background: var(--amber);
      color: var(--black);
    }
    .vp-hint-card__nav-next:hover { background: #e6b300; }

    /* ── Step 3 viewport hint (floats over the 3D canvas) + active-zone badge ── */
    .viewport-zone-hint {
      position: absolute;
      top: 18px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      align-items: center;
      gap: 12px;
      background: rgba(255, 255, 255, 0.97);
      border: 2px solid var(--amber);
      border-radius: 12px;
      padding: 10px 14px 10px 8px;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
      z-index: 10;
      max-width: 580px;
      pointer-events: none;  /* let drag/drop pass through; only the × is interactive */
    }
    .viewport-zone-hint-close { pointer-events: auto; }
    .viewport-zone-hint-icon { flex-shrink: 0; line-height: 0; }
    .viewport-zone-hint-video {
      display: block;
      width: 240px;
      height: auto;
      max-height: 160px;
      border-radius: 6px;
      background: #000;
      object-fit: cover;
    }
    .viewport-zone-hint-text {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .viewport-zone-hint-text strong {
      font-size: 14px;
      color: var(--black);
      font-weight: 700;
    }
    .viewport-zone-hint-text span {
      font-size: 12px;
      color: var(--dark-grey);
      line-height: 1.35;
    }
    .viewport-zone-hint-close {
      background: transparent;
      border: 0;
      font-size: 20px;
      line-height: 1;
      color: #888;
      cursor: pointer;
      padding: 0 6px;
      flex-shrink: 0;
    }
    .viewport-zone-hint-close:hover { color: var(--black); }

    .active-zone-badge {
      display: flex;
      align-items: center;
      gap: 10px;
      background: #ffffff;
      border: 2px solid var(--amber);
      border-radius: 10px;
      padding: 8px 12px;
      margin-bottom: 10px;
    }
    .active-zone-badge-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }
    .active-zone-badge-label {
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--amber);
    }
    .active-zone-badge-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--black);
    }
    .active-zone-badge-meta {
      font-size: 11px;
      color: var(--dark-grey);
    }
    .active-zone-badge-clear {
      background: transparent;
      border: 1px solid #ddd;
      color: #888;
      border-radius: 6px;
      padding: 4px 8px;
      font-size: 11px;
      cursor: pointer;
      flex-shrink: 0;
    }
    .active-zone-badge-clear:hover { border-color: #999; color: var(--black); }

    /* ── Section-height preset pills (Step 2 block canvas) ─────────────────── */
    .section-palette {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }
    .section-preset-pill {
      background: #2e2b27;
      border: 1px solid #444;
      border-radius: 12px;
      color: #aaa;
      cursor: pointer;
      font-size: 11px;
      padding: 3px 10px;
      line-height: 1.4;
      transition: background 0.12s, color 0.12s;
    }
    .section-preset-pill:hover { background: #3a362f; color: #ccc; }
    .section-preset-pill.active {
      background: #ffc700;
      border-color: #ffc700;
      color: #1a1814;
      font-weight: 600;
    }
    .row-tab-remove {
      background: none;
      border: none;
      color: #888;
      cursor: pointer;
      font-size: 14px;
      line-height: 1;
      padding: 2px 4px;
    }
    .row-tab-remove:hover { color: #c02020; }

    /* ── Add-row inline dialog ───────────────────────────────────────────────── */
    .add-row-dialog {
      background: #2e2b27;
      border: 1px solid #444;
      border-radius: 8px;
      padding: 12px;
      margin-bottom: 10px;
    }
    .add-row-dialog-title {
      font-size: 12px;
      font-weight: 600;
      color: #ccc;
      margin-bottom: 8px;
    }
    .add-row-field {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
      font-size: 11px;
      color: #aaa;
    }
    .add-row-field .input-unit-wrap { width: 100px; }
    .add-row-field input {
      background: #1a1814;
      border: 1px solid #444;
      border-radius: 4px;
      color: #fff;
      font-size: 11px;
      padding: 3px 6px;
      text-align: right;
      width: 60px;
    }
    .add-row-actions {
      display: flex;
      gap: 8px;
      margin-top: 10px;
      justify-content: flex-end;
    }
    .add-row-cancel {
      background: none; border: 1px solid #555;
      border-radius: 5px; color: #888; cursor: pointer;
      font-size: 11px; padding: 4px 10px;
    }
    .add-row-cancel:hover { border-color: #888; color: #ccc; }
    .add-row-confirm {
      background: #ffc700; border: none;
      border-radius: 5px; color: #1a1814; cursor: pointer;
      font-size: 11px; font-weight: 600; padding: 4px 12px;
    }
    .add-row-confirm:hover { background: #ffd740; }

    /* ── Row settings panel ──────────────────────────────────────────────────── */
    .row-settings-panel {
      background: #2e2b27;
      border: 1px solid #444;
      border-radius: 8px;
      padding: 12px;
      margin-bottom: 10px;
    }
    .rsp-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }
    .rsp-label {
      font-size: 10px;
      font-weight: 700;
      color: #888;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }
    .rsp-delete {
      background: none;
      border: 1px solid #555;
      border-radius: 4px;
      color: #888;
      cursor: pointer;
      font-size: 10px;
      padding: 2px 8px;
    }
    .rsp-delete:hover { border-color: #c02020; color: #c02020; }
    .rsp-header {
      font-size: 10px;
      font-weight: 700;
      color: #888;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 10px;
    }
    .rsp-fields { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
    .rsp-field {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      color: #aaa;
    }
    .rsp-field .input-unit-wrap { width: 100px; }
    .rsp-value { color: #ccc; }
    .rsp-zones-head {
      font-size: 10px;
      font-weight: 700;
      color: #666;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 6px;
    }
    .rsp-zones-hint {
      font-size: 10px;
      color: #555;
      font-weight: 400;
      text-transform: none;
      letter-spacing: 0;
    }

    /* ── Editing-zone card (Step-2 selected-zone settings) ──
       --ec-accent/--ec-tint theme every active state inside the card to the
       zone's tier colour (base amber / upper indigo / tall green) so the card
       reads as part of the selected zone, not the brand chrome. Tinted active
       states (accent border + ~12% tint + dark text) keep contrast safe on
       all three tiers. Destructive actions (Remove) stay red. */
    .editing-card {
      --ec-accent: var(--amber);
      --ec-tint: rgba(245, 158, 11, 0.12);
      background: #ffffff; border: 1.5px solid var(--ec-accent);
      border-radius: 12px; padding: 14px; margin-bottom: 16px;
      font-family: 'Poppins', Arial, sans-serif;
    }
    .editing-card--base  { --ec-accent: #f59e0b; --ec-tint: rgba(245, 158, 11, 0.12); background: #FFF8EE; }
    .editing-card--upper { --ec-accent: #818cf8; --ec-tint: rgba(129, 140, 248, 0.14); background: #F1F0FE; }
    .editing-card--tall  { --ec-accent: #3acf72; --ec-tint: rgba(58, 207, 114, 0.14); background: #EBF8F0; }
    .editing-card .ec-dot { background: var(--ec-accent); }
    /* White = editable: text inputs sit white with a visible border (focus in
       the tier accent); buttons/pills sit on tinted/off-white so the two are
       visually distinct affordances. */
    .editing-card .input-unit-wrap input[type="number"] {
      background: var(--white);
      border-color: #d8d6cf;
    }
    .editing-card .input-unit-wrap input[type="number"]:focus { border-color: var(--ec-accent); }
    .ec-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9a9a93; margin-bottom: 7px; }
    .ec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
    .ec-name { font-size: 13px; font-weight: 600; color: var(--black); display: flex; align-items: center; }
    .ec-dot { width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; display: inline-block; flex-shrink: 0; }
    .ec-remove { background: none; border: none; color: #b91c1c; font-size: 12px; cursor: pointer; padding: 0; font-family: inherit; }
    .ec-field { margin-bottom: 13px; }
    .ec-field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
    .ec-label { font-size: 12px; color: #6b6b66; }
    .ec-hint { font-size: 11px; color: #9a9a93; }
    .ec-input-sm { width: 58%; }
    .ec-pill { font-size: 11px; padding: 3px 9px; border-radius: 20px; }
    .ec-pill--default { color: #5f5e5a; background: #f1efe8; }
    .ec-pill--custom { color: var(--black); background: var(--ec-tint); }
    .ec-tog {
      flex: 1; border: 1px solid #d8d6cf; border-radius: 8px;
      font-size: 12px; background: #f7f6f4; color: #444; cursor: pointer;
      font-family: inherit;
    }
    .ec-tog.active { border: 1.5px solid var(--ec-accent); background: var(--ec-tint); color: var(--black); font-weight: 600; }
    .ec-reset { margin-top: 8px; background: none; border: none; color: #3c7d3c; font-size: 12px; cursor: pointer; padding: 0; font-family: inherit; }
    /* Toggles span the card — two equal halves, room for full labels. */
    .ec-toggle { display: flex; gap: 6px; width: 100%; }
    .ec-tog { height: 34px; }
    .zones-list { display: flex; flex-direction: column; gap: 4px; }
    .zone-row {
      display: flex;
      align-items: center;
      gap: 6px;
      background: #1e1c18;
      border: 1px solid #383530;
      border-radius: 5px;
      padding: 5px 8px;
    }
    .zone-range {
      font-size: 11px;
      color: #777;
      flex: 0 0 auto;
      min-width: 72px;
    }
    .zone-h-wrap { flex: 1; }
    .zone-h-wrap .input-unit-wrap { width: auto; }
    .zone-h-wrap input[type="number"] { width: 80px; }
    .zone-actions { display: flex; gap: 3px; flex: 0 0 auto; }
    .zone-btn {
      background: #2a2723;
      border: 1px solid #444;
      border-radius: 4px;
      color: #777;
      cursor: pointer;
      font-size: 11px;
      line-height: 1;
      padding: 3px 6px;
    }
    .zone-btn:hover { border-color: #ffc700; color: #ffc700; }

    /* ── Stage 6 — Quote + capture (replaces the Save & Share modal) ───────── */
    .s6-divider { height: 1px; background: #eee; margin: 16px 0 14px; }
    .s6-quote-strip {
      background: var(--off-white); border-radius: 12px; padding: 14px 16px;
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
    }
    .s6-quote-strip .qs-label {
      font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: #aaa;
    }
    .s6-quote-strip .qs-total {
      font-size: 23px; font-weight: 600; color: var(--black); letter-spacing: -0.5px; line-height: 1.1;
    }
    .s6-quote-strip .qs-total span { font-size: 12px; font-weight: 400; color: #aaa; }
    .s6-quote-strip .qs-right { text-align: right; font-size: 10.5px; color: #999; line-height: 1.5; }
    .s6-quote-strip .qs-right b { color: #555; font-weight: 500; }
    .s6-quote-strip--pending .qs-pending { font-size: 13px; color: #888; margin-top: 2px; }
    .s6-spec {
      display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 11px 4px 0; font-size: 11.5px;
    }
    .s6-spec dt { color: #aaa; }
    .s6-spec dd { color: #555; font-weight: 500; }
    .s6-quote-note { font-size: 10px; color: #bbb; margin: 9px 4px 0; }

    .s6-lead { font-size: 14px; font-weight: 600; color: var(--black); margin-bottom: 3px; }
    .s6-lead-sub { font-size: 12px; color: #888; line-height: 1.45; margin-bottom: 14px; }

    .s6-intent-grid { display: flex; flex-direction: column; gap: 10px; }
    .s6-intent-card {
      display: flex; align-items: center; gap: 13px; padding: 16px 15px; border-radius: 14px;
      border: 2px solid #ececea; cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    }
    .s6-intent-card:hover { border-color: #d6d6d2; }
    .s6-intent-card.primary { background: #fffdf4; border-color: var(--amber); }
    .s6-intent-card.sel { box-shadow: 0 0 0 3px rgba(255,199,0,0.28); cursor: default; }
    .s6-intent-icon {
      width: 42px; height: 42px; flex-shrink: 0; border-radius: 11px;
      display: flex; align-items: center; justify-content: center; font-size: 21px; background: #f1f1ef;
    }
    .s6-intent-card.primary .s6-intent-icon { background: var(--amber); }
    .s6-intent-card.ghost .s6-intent-icon { background: #eef9f1; }
    .s6-intent-title { font-size: 14px; font-weight: 600; color: var(--black); line-height: 1.2; }
    .s6-intent-desc { font-size: 11.5px; color: #888; margin-top: 3px; line-height: 1.35; }
    .s6-intent-arrow { font-size: 18px; color: #bbb; }
    .s6-intent-card.primary .s6-intent-arrow { color: #b8930a; }

    .s6-link-route { text-align: center; margin-top: 12px; }
    .s6-link-route a {
      font-size: 12.5px; color: #777; text-decoration: none; border-bottom: 1px solid #ddd; padding-bottom: 1px; cursor: pointer;
    }
    .s6-link-route a:hover { color: #444; border-color: #aaa; }
    .s6-faqline { text-align: center; font-size: 11.5px; color: #999; margin-top: 14px; }
    .s6-faqline a { color: #b8930a; text-decoration: none; font-weight: 500; }

    .s6-next {
      background: #fbfaf7; border: 1px solid #f0eee8; border-radius: 12px; padding: 13px 15px; margin: 14px 0 16px;
    }
    .s6-next .next-h {
      font-size: 11px; font-weight: 600; color: #7a6400; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 9px;
    }
    .s6-next .next-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
    .s6-next .next-list li { display: flex; gap: 10px; font-size: 12px; color: #555; line-height: 1.4; }
    .s6-next .next-list .n {
      flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--amber);
      color: var(--black); font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin-top: 1px;
    }

    .s6-field { display: block; margin-bottom: 10px; font-size: 12px; color: #444; }
    .s6-field .req { color: #c98a00; }
    .s6-field input, .s6-field select {
      width: 100%; box-sizing: border-box; margin-top: 4px; border: 1px solid #e0e0dd; border-radius: 8px;
      padding: 9px 12px; font-size: 13px; color: #222; font-family: inherit; background: var(--white);
    }
    .s6-field select { cursor: pointer; }
    .s6-hint { font-size: 10.5px; color: #999; margin-top: 4px; display: flex; align-items: center; gap: 5px; }
    .s6-hint .wa { color: #25D366; font-weight: 600; }
    .s6-deliver-note { font-size: 10.5px; color: #999; text-align: center; margin-top: 9px; line-height: 1.5; }
    .s6-error {
      margin-bottom: 12px; padding: 9px 12px; border-radius: 8px; background: #fdecea;
      border: 1px solid #f3c2bc; color: #b3261e; font-size: 12px; line-height: 1.4;
    }
    .s6-back-link { text-align: center; margin-top: 10px; }
    .s6-back-link a { font-size: 12px; color: #999; text-decoration: none; cursor: pointer; }

    .s6-success-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
    .s6-success-head .tick {
      width: 30px; height: 30px; border-radius: 50%; background: #e9f9ee; color: #25D366;
      display: flex; align-items: center; justify-content: center; font-size: 16px;
    }
    .s6-success-head h3 { font-size: 15px; color: var(--black); }
    .s6-success-sub { font-size: 12px; color: #777; line-height: 1.5; margin: 0 0 16px 39px; }
    .s6-success-sub b { color: #444; font-weight: 500; }
    .s6-urlrow { display: flex; gap: 7px; margin-bottom: 8px; }
    .s6-urlrow input {
      flex: 1; min-width: 0; border: 1px solid #e0e0dd; border-radius: 8px; padding: 9px 12px;
      font-size: 11.5px; font-family: monospace; color: #444; background: #f8f7f5;
    }
    .s6-urlrow .copy {
      flex-shrink: 0; padding: 0 16px; border-radius: 8px; border: none; background: var(--black); color: #fff; font-size: 12px; cursor: pointer;
    }
    .s6-url-cap { font-size: 10.5px; color: #aaa; line-height: 1.5; }
    .s6-sec-label {
      font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: #ccc; margin-bottom: 8px;
    }

    /* ── Locked read-only viewer (issue #49) ────────────────────────────────
       Shared ?config= links open this view: 3D model (orbit only) + spec +
       price + CTAs. Editor chrome is hidden; the model viewport stays. */
    .viewer-summary { display: none; }

    /* In viewer mode, hide all editing chrome in the right panel… */
    .viewer-locked .panel-top,
    .viewer-locked .price-bar,
    .viewer-locked .step-tabs,
    .viewer-locked .panel-content,
    .viewer-locked .panel-footer { display: none !important; }

    /* …and the editing-only viewport affordances (orbit + door/dimension
       toggles stay; hint cards go). */
    .viewer-locked .vp-hint-card,
    .viewer-locked .vp-lock-badge,
    .viewer-locked #slotIconOverlay { display: none !important; }

    /* ── Render mode (?render=1) ─────────────────────────────────────────────
       Isolated PBR render path: strip ALL chrome, leave only the 3D canvas. */
    body.render-mode header,
    body.render-mode .right-panel,
    body.render-mode .vp-btn-row,
    body.render-mode .vp-lock-badge,
    body.render-mode .vp-chat-bar,
    body.render-mode .vp-hint-card,
    body.render-mode .viewport-controls-hint,
    body.render-mode #slotIconOverlay { display: none !important; }
    body.render-mode .app-body { overflow: hidden; }
    body.render-mode #viewport { flex: 1 1 100% !important; width: 100% !important; }

    /* The read-only summary takes over the right panel. */
    .viewer-locked .viewer-summary {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 22px 20px;
      scrollbar-width: thin;
      scrollbar-color: #ddd transparent;
    }
    .viewer-head { margin-bottom: 18px; }
    .viewer-head h2 { font-size: 17px; color: var(--black); margin-bottom: 4px; }
    .viewer-head p  { font-size: 12.5px; color: #999; line-height: 1.5; }
    .viewer-cta { margin-top: 20px; }
    .viewer-edit-note { font-size: 11px; color: #aaa; text-align: center; margin-top: 8px; line-height: 1.5; }
    .viewer-desktop-link {
      display: block; text-align: center; font-size: 13px; font-weight: 500;
      color: var(--black); background: #f4f3f1; border: 1px solid #e8e7e5;
      border-radius: 10px; padding: 13px 16px; text-decoration: none; line-height: 1.45;
    }

    /* Responsive: the editor is desktop-only, but the read-only viewer must
       work on any phone or tablet. Stack the model above the summary on any
       touch device (pointer: coarse — phones, iPads in any orientation) or any
       screen up to tablet width. A bare max-width: 760px missed iPads/large
       phones in portrait (768px+), which fell back to the cramped side-by-side
       desktop layout. Genuine wide desktops (fine pointer, > 1024px) keep the
       side-by-side viewer. */
    @media (max-width: 1024px), (pointer: coarse) {
      .viewer-locked .app-body { flex-direction: column; overflow: auto; }
      .viewer-locked #viewport { flex: none; height: 52vh; min-height: 280px; }
      .viewer-locked .right-panel {
        width: 100%; border-left: none; border-top: 1px solid #e8e7e5;
        overflow: visible; flex: none;
      }
      .viewer-locked .viewer-summary { overflow-y: visible; }
      /* The stacked viewer's 3D pane is small — keep it clear of overlays. */
      .viewer-locked .vp-chat-bar { display: none; }
      .viewer-locked .viewport-controls-hint { bottom: 16px; }
    }

    /* Touch-device insurance: JS adds .viewer-touch from navigator.maxTouchPoints
       (see preLockSharedLinkViewer). This forces the stacked layout on any phone
       regardless of the reported viewport width or pointer type — the width/
       pointer media query above can be defeated by iOS "Request Desktop Website"
       or transient viewport inflation, but maxTouchPoints cannot. */
    .viewer-locked.viewer-touch .app-body { flex-direction: column; overflow: auto; }
    .viewer-locked.viewer-touch #viewport { flex: none; height: 52vh; min-height: 280px; }
    .viewer-locked.viewer-touch .right-panel {
      width: 100%; border-left: none; border-top: 1px solid #e8e7e5;
      overflow: visible; flex: none;
    }
    .viewer-locked.viewer-touch .viewer-summary { overflow-y: visible; }
    .viewer-locked.viewer-touch .vp-chat-bar { display: none; }
    .viewer-locked.viewer-touch .viewport-controls-hint { bottom: 16px; }

    /* ── Phone guard — the editor needs a bigger screen ──
       Full-screen card shown instead of the editor on phones (see
       maybeShowPhoneGuard); the locked viewer and embeds are exempt. */
    .phone-guard {
      position: fixed;
      inset: 0;
      z-index: 200;
      background: var(--off-white);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      overflow-y: auto;
    }
    .phone-guard-card {
      max-width: 360px;
      width: 100%;
      background: var(--white);
      border: 1px solid #e8e7e5;
      border-radius: 18px;
      padding: 28px 22px;
      text-align: center;
      box-shadow: 0 14px 40px rgba(0,0,0,0.08);
    }
    .phone-guard-logo {
      font-size: 22px;
      color: var(--black);
      letter-spacing: -0.4px;
      user-select: none;
    }
    .phone-guard-card h2 {
      font-size: 18px;
      color: var(--black);
      line-height: 1.25;
      margin: 14px 0 8px;
    }
    .phone-guard-card p {
      font-size: 13px;
      color: #888;
      line-height: 1.6;
      margin-bottom: 20px;
    }
    .phone-guard-actions { display: flex; flex-direction: column; gap: 10px; }
    .phone-guard-actions .btn { text-decoration: none; }
    .phone-guard-continue {
      margin-top: 16px;
      background: none;
      border: none;
      font-family: inherit;
      font-size: 12px;
      color: #aaa;
      cursor: pointer;
      text-decoration: underline;
    }
    .phone-guard-continue:hover { color: var(--black); }

    /* ──────────────────────────────────────────────────────────────────────
       Embed mode (?embed=1) — the locked viewer inside a marketing-site iframe.
       Strips the app chrome and sizes to content (paired with the postMessage
       auto-height in initEmbedAutoHeight). Layout is driven by the iframe's own
       width (not the device), so it adapts to wherever it's placed. The page is
       still .viewer-locked; these rules win on specificity (body + 2 classes).
       view=3d | summary | both picks what renders. See docs/embedding.md.
       ────────────────────────────────────────────────────────────────────── */
    body.embedded { height: auto; overflow: visible; background: var(--white); }
    body.embedded header,
    body.embedded .viewer-head,
    body.embedded .viewer-cta,
    body.embedded .viewer-edit-note,
    body.embedded .viewer-desktop-link,
    body.embedded .s6-faqline { display: none !important; }
    body.embedded .app-body { flex: none; height: auto; overflow: visible; }
    body.embedded .right-panel { overflow: visible; }
    body.embedded .viewer-summary { overflow: visible; padding: 18px 20px; }

    /* view filters */
    body.embedded.view-3d .right-panel { display: none; }
    body.embedded.view-summary #viewport { display: none; }
    body.embedded.view-3d #viewport { height: 420px; }

    /* Wide embed → side-by-side: the 3D flexes, the card is a fixed readable width. */
    @media (min-width: 760px) {
      body.embedded .app-body { flex-direction: row; }
      body.embedded #viewport { flex: 1; height: auto; min-height: 360px; }
      body.embedded .right-panel {
        width: 340px; flex: none; border-left: 1px solid #e8e7e5; border-top: none;
      }
      body.embedded.view-summary .right-panel { width: 100%; }
    }
    /* Narrow embed → stacked: fixed-height 3D on top, full-width card below. */
    @media (max-width: 759px) {
      body.embedded .app-body { flex-direction: column; }
      body.embedded #viewport { flex: none; height: 360px; }
      body.embedded .right-panel {
        width: 100%; flex: none; border-left: none; border-top: 1px solid #e8e7e5;
      }
      /* keep the card content readable, not stretched, in a very wide stacked embed */
      body.embedded .viewer-summary > * { max-width: 600px; margin-inline: auto; }
    }

    /* Embed graceful-fail: a bad/expired config in an embed shows a small
       message instead of the editor (see failConfigLoad). Hide the 3D, centre
       the message. */
    body.embedded.embed-unavailable #viewport { display: none; }
    body.embedded.embed-unavailable .app-body { flex-direction: column; min-height: 180px; }
    body.embedded.embed-unavailable .right-panel { width: 100%; border: none; }
    body.embedded.embed-unavailable .viewer-summary {
      display: flex; align-items: center; justify-content: center; text-align: center;
      min-height: 180px;
    }
    .embed-error { padding: 24px 20px; }
    .embed-error-title { font-size: 15px; font-weight: 600; color: var(--black); margin-bottom: 4px; }
    .embed-error-sub { font-size: 12.5px; color: #999; line-height: 1.5; }


    /* ── Chat card ──
       Ported from the website ChatWidget (doozie-website styles.css
       .chat-pop); channels must stay in step with the site's. Opens
       bottom-left, over the viewport callout that triggers it; hidden
       entirely in embed mode. */
    .chat-pop {
      position: fixed;
      left: 16px;
      bottom: 72px;   /* opens above the chat bar that triggers it */
      z-index: 120;
      width: 308px;
      background: var(--white);
      border: 1px solid #E5E5E5;
      border-radius: 16px;
      box-shadow: 0 14px 40px rgba(0,0,0,0.12);
      padding: 22px;
    }
    .chat-pop h4 { font-size: 15.5px; font-weight: 600; color: var(--black); padding-right: 18px; }
    .chat-pop > p { font-size: 13px; color: #888; line-height: 1.6; margin-top: 6px; }
    .chat-opts { display: flex; flex-direction: column; gap: 9px; margin-top: 15px; }
    .chat-opt {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 11px 14px;
      border: 1px solid #E5E5E5;
      border-radius: 10px;
      font-size: 13.5px;
      font-weight: 500;
      color: var(--dark-grey);
      text-decoration: none;
      transition: border-color 0.15s, background 0.15s;
    }
    /* "Chat now" is a <button> sharing this class — normalise to match the <a> options. */
    button.chat-opt { width: 100%; background: none; font-family: inherit; text-align: left; cursor: pointer; }
    .chat-opt:hover { border-color: var(--black); background: var(--off-white); }
    .chat-opt svg { color: #B8930A; flex-shrink: 0; }   /* site --accent-deep */
    .chat-note { margin-top: 13px; font-size: 11px; color: #BBB; text-align: center; line-height: 1.5; }
    .chat-x {
      position: absolute;
      top: 13px;
      right: 13px;
      width: 26px;
      height: 26px;
      border: none;
      background: none;
      cursor: pointer;
      color: #AAA;
      font-size: 19px;
      line-height: 1;
      border-radius: 6px;
    }
    .chat-x:hover { background: var(--off-white); color: var(--black); }
    @media (max-width: 560px) {
      .chat-pop { right: 12px; left: 12px; bottom: 12px; width: auto; }
      .chat-opt-wa { order: -1; }   /* lead with the friction-free channel on phones */
    }
    /* No marketing chrome inside iframes. */
    body.embedded .vp-chat-bar, body.embedded .chat-pop { display: none !important; }
    body.embedded .viewport-controls-hint { bottom: 16px; }

    /* Kommo Live Chat: our chat card is the only launcher. Hide the whole
       Kommo launcher chrome (floating button, collapsed/minimised bubble,
       "Made by Kommo") and reveal it ONLY when the chat panel is actually
       open — the open panel carries .amo-livechat_chat. Ported from the
       website (doozie-website styles.css, verified on the live widget). */
    .amo-button-holder:not(:has(#amo-livechat.amo-livechat_chat)) { display: none !important; }
    /* Fallback for browsers without :has() — hide the initial floating button. */
    #social_iframe, .amo-button__iframe { display: none !important; }
    /* Reposition the chat window bottom-left, over the dark 3D area and clear
       of the configurator panel. The widget's own position (right/bottom 90px,
       from x/y_offset in its Kommo settings) is GLOBAL to every site using the
       widget — the website wants it bottom-right — so we override per-page
       here instead. The panel anchors to the holder's right edge and expands
       left (.amo-livechat_bottom-right), so flip its anchor too or it lands
       off-screen. Verified live against the booted widget on staging. */
    .amo-button-holder { right: auto !important; left: 16px !important; bottom: 72px !important; }
    .amo-button-holder #amo-livechat { left: 0 !important; right: auto !important; }

    /* ── Fillers & plinth (step 1 dialog) ─────────────────────────────────
       Trigger row sits below the space dimensions; opens a modal holding the
       canonical filler/plinth inputs (read by readInputs()/v()). */
    .fillers-trigger {
      display: flex; align-items: center; gap: 9px;
      width: 100%; margin: 2px 0 4px;
      padding: 11px 12px;
      background: var(--white);
      border: 1.5px solid #e8e7e5; border-radius: 10px;
      font-family: inherit; font-size: 13px; color: var(--black);
      cursor: pointer; text-align: left;
      transition: border-color .15s, background .15s;
    }
    .fillers-trigger:hover { border-color: var(--amber); background: var(--off-white); }
    .fillers-trigger-icon { color: #9a8a3a; flex: none; }
    .fillers-trigger-text { font-weight: 500; }
    .fillers-trigger-meta { margin-left: auto; font-size: 12px; color: #999; }
    .fillers-trigger-chevron { font-size: 18px; color: #bbb; line-height: 1; }

    .fillers-modal {
      position: fixed; inset: 0; z-index: 210;
      display: none; align-items: center; justify-content: center;
      padding: 20px; background: rgba(20,18,16,0.42);
      backdrop-filter: blur(3px);
    }
    .fillers-modal.open { display: flex; }
    .fillers-modal-card {
      width: 430px; max-width: 100%;
      max-height: calc(100vh - 40px); overflow-y: auto;
      background: var(--white);
      border: 1px solid #e8e7e5; border-radius: 16px;
      padding: 20px 22px 22px;
      box-shadow: 0 18px 48px rgba(0,0,0,0.18);
    }
    .fillers-modal-head { display: flex; align-items: center; justify-content: space-between; }
    .fillers-modal-title { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; color: var(--black); }
    .fillers-modal-title svg { color: #9a8a3a; }
    .fillers-modal-close {
      border: none; background: none; font-size: 22px; line-height: 1;
      color: #aaa; cursor: pointer; padding: 0 2px;
    }
    .fillers-modal-close:hover { color: var(--black); }
    .fillers-modal-sub { margin: 6px 0 12px; font-size: 13px; color: #888; line-height: 1.5; }
    .fillers-schematic { width: 100%; height: auto; margin-bottom: 14px; }
    .fillers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
    .fillers-field { display: block; font-size: 13px; color: #555; }
    .fillers-field .input-unit-wrap { margin-top: 4px; }
    .fillers-note { margin-top: 10px; font-size: 12px; color: #999; line-height: 1.4; }
    .fillers-tip {
      display: flex; align-items: center; gap: 7px;
      margin-top: 10px; padding: 8px 10px;
      background: #fff8e1; border-radius: 8px;
      font-size: 12px; color: #8a6d00; line-height: 1.4;
    }
    .fillers-tip svg { flex: none; color: #b8901a; }
    .fillers-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
    .fillers-modal-foot .btn { width: auto; padding: 8px 18px; }
