/* ============================================================
   Woovio Design Studio — glass UI over full-bleed render
============================================================ */
:root {
  --bg: #0b0c0f;
  --glass: rgba(16, 17, 22, .78);
  --glass2: rgba(255, 255, 255, .05);
  --glass3: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .16);
  --text: #f0f1f4;
  --muted: #969ca8;
  /* brass, matched to the main site's --brass / --brass-lt */
  --accent: #b4884e;
  --accent-hi: #d4ae78;
  --accent-soft: rgba(180, 136, 78, .18);
  --accent-glow: rgba(180, 136, 78, .32);
  --wa: #25d366;          /* WhatsApp green — send button only */
  --danger: #e06055;
  --z-modal: 100;         /* clears every other z-index in this file (max 10) */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --display: "Playfair Display", Georgia, serif;
  font-size: 15px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button { font-family: inherit; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- full-bleed render space ---------- */
#viewport { position: fixed; inset: 0; }
#scene { width: 100%; height: 100%; display: block; }

#hud {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .6px;
  color: rgba(255, 255, 255, .8);
  background: rgba(12, 13, 16, .5);
  border: 1px solid var(--line);
  padding: 6px 16px;
  border-radius: 99px;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

/* ---------- floating product switcher ---------- */
#product-tabs {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 99px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
#product-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: all .18s ease;
}
#product-tabs button svg { width: 16px; height: 16px; }
#product-tabs button:hover { color: var(--text); background: var(--glass2); }
#product-tabs button.active {
  color: #14100e;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent));
  box-shadow: 0 4px 16px rgba(180, 136, 78, .35);
}

/* ---------- camera view presets ---------- */
#view-btns {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
#view-btns button {
  padding: 7px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: all .15s ease;
}
#view-btns button:hover { color: var(--text); background: var(--glass3); }
#view-btns button:active { color: var(--accent-hi); }

/* ---------- floating corner buttons ---------- */
#btn-side, #btn-designer {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--text);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .18s ease;
}
#btn-side {
  top: 18px;
  left: 18px;
  width: 40px;
  height: 40px;
  justify-content: center;
  font-size: 15px;
  border-radius: 12px;
  color: var(--muted);
}
#btn-side:hover { color: var(--text); border-color: var(--line2); }

/* undo / redo */
#history-btns {
  position: absolute;
  top: 18px;
  left: 66px;
  z-index: 6;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
#history-btns button {
  width: 32px;
  height: 32px;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: all .15s;
}
#history-btns button:hover:not(:disabled) { background: var(--glass3); }
#history-btns button:disabled { opacity: .3; cursor: default; }

/* saved design sessions */
.text-input {
  width: 100%;
  padding: 9px 13px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--glass2);
  border: 1px solid var(--line);
  border-radius: 99px;
  outline: none;
  transition: border-color .15s;
}
.text-input::placeholder { color: var(--muted); }
.text-input:focus { border-color: var(--accent); }

.design-item { display: flex; gap: 6px; margin-top: 6px; }
.design-item .load {
  flex: 1;
  text-align: left;
  padding: 8px 13px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--glass2);
  border: 1px solid transparent;
  border-radius: 99px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all .15s;
}
.design-item .load:hover { border-color: rgba(180, 136, 78, .45); background: var(--accent-soft); }
.design-item .load small { color: var(--muted); font-size: 10.5px; margin-left: 6px; }
.design-item .del {
  width: 32px;
  color: var(--muted);
  background: var(--glass2);
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: all .15s;
}
.design-item .del:hover { color: #f2a49a; background: rgba(229, 72, 77, .15); }

#btn-designer {
  top: 18px;
  right: 18px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 99px;
}
#btn-designer svg { width: 15px; height: 15px; color: var(--accent-hi); }
#btn-designer:hover { border-color: var(--accent); background: rgba(180, 136, 78, .12); }

/* ---------- floating sidebar ---------- */
#sidebar {
  position: fixed;
  top: 74px;
  left: 18px;
  bottom: 18px;
  width: 324px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.22, .8, .3, 1), opacity .25s;
}
body.side-hidden #sidebar {
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent));
  color: #14100e;
  font-weight: 800;
  font-size: 19px;
  font-family: Georgia, serif;
  box-shadow: 0 4px 14px rgba(180, 136, 78, .3);
}
.brand-name h1 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .2px;
}
.brand-name p {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-top: 1px;
}

#controls {
  flex: 1;
  overflow-y: auto;
  padding: 2px 16px 16px;
}

/* ---------- sections ---------- */
.section { margin-top: 6px; border-top: 1px solid var(--line); }
.section:first-child { border-top: none; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 2px 10px;
  cursor: pointer;
  user-select: none;
}
.section-head:hover h2 { color: var(--text); }
.section-head h2 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .15s;
}
.section-head .chev {
  color: var(--muted);
  font-size: 13px;
  transform: rotate(90deg);
  transition: transform .18s ease;
}
.section-head.collapsed .chev { transform: rotate(0deg); }
.section-body {
  padding-bottom: 6px;
  overflow: hidden;
}
.section-body.hidden { display: none; }

.row { margin: 10px 0 4px; }
.row > label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 7px;
  line-height: 1.45;
}
.row > label b { color: var(--text); font-weight: 600; }

/* pills / segmented buttons */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--glass2);
  border: 1px solid transparent;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .16s ease;
}
.seg button:hover { color: var(--text); background: var(--glass3); }
.seg button.active {
  color: var(--accent-hi);
  background: var(--accent-soft);
  border-color: rgba(180, 136, 78, .45);
  font-weight: 600;
}

/* sliders */
.row input[type=range] {
  width: 100%;
  height: 4px;
  appearance: none;
  background: var(--glass3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.row input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-hi);
  border: 3px solid #1a1512;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  transition: transform .12s;
}
.row input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider-val { float: right; color: var(--accent-hi); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* swatches */
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.swatch {
  aspect-ratio: 1;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  cursor: pointer;
  position: relative;
  transition: transform .14s ease;
}
.swatch:hover { transform: scale(1.16); z-index: 2; }
.swatch.active {
  border-color: var(--accent-hi);
  box-shadow: 0 0 0 2.5px var(--accent-soft), 0 0 0 1px var(--accent);
}
.swatch .tip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #08090b;
  color: var(--text);
  border: 1px solid var(--line2);
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 10;
}
.swatch:hover .tip { opacity: 1; }

.swatch.custom {
  background: conic-gradient(#e5484d, #f5a623, #f2e34c, #46c46b, #3f9ff2, #8a63e8, #e5484d);
}
.swatch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  border: none;
}

/* hex entry — type or paste an exact code next to each colour-wheel swatch */
.color-entries {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.color-entry {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--glass2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 4px 3px 12px;
}
.color-entry:focus-within { border-color: var(--accent); }
.hex-input {
  width: 78px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 11.5px;
  font-family: "SFMono-Regular", Consolas, monospace;
  letter-spacing: .3px;
}
.hex-input::placeholder { color: var(--muted); }
.hex-copy {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  background: var(--glass3);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all .15s;
}
.hex-copy:hover { color: var(--accent-hi); background: var(--accent-soft); }

/* checkboxes */
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 5px 0;
}
.check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* ---------- sidebar footer ---------- */
.side-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #14100e;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent));
  border: none;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--accent-glow);
  transition: all .16s ease;
}
.btn-primary svg { width: 17px; height: 17px; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.footer-row { display: flex; gap: 8px; }
.btn-ghost {
  flex: 1;
  padding: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--glass2);
  border: 1px solid transparent;
  border-radius: 99px;
  cursor: pointer;
  transition: all .16s ease;
}
.btn-ghost:hover { color: var(--text); background: var(--glass3); }
.btn-ghost.active {
  color: var(--accent-hi);
  background: var(--accent-soft);
  border-color: rgba(180, 136, 78, .45);
}

/* ============================================================
   Cabinet Designer — floating glass dock
============================================================ */
#designer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  width: min(1060px, calc(100% - 36px));
  max-height: 62%;
  z-index: 7;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.dz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
}
.dz-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--glass2);
  border-radius: 99px;
}
.dz-tabs button {
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: all .16s ease;
}
.dz-tabs button:hover { color: var(--text); }
.dz-tabs button.active {
  color: #14100e;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent));
}
.dz-tabs button.off { opacity: .5; }

#dz-close {
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: var(--glass2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all .15s;
}
#dz-close:hover { color: var(--text); background: var(--glass3); }

#dz-opts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 2px 18px 6px;
  font-size: 12.5px;
  color: var(--muted);
}
#dz-opts .check { padding: 0; font-size: 12.5px; }
#dz-opts input[type=range] {
  width: 130px;
  height: 4px;
  appearance: none;
  background: var(--glass3);
  border-radius: 2px;
  vertical-align: middle;
  cursor: pointer;
}
#dz-opts input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-hi);
  border: 3px solid #1a1512;
}
#dz-opts .val { color: var(--accent-hi); font-variant-numeric: tabular-nums; }
#dz-opts .mod-btns button {
  width: 26px;
  height: 26px;
  font-size: 15px;
  color: var(--text);
  background: var(--glass2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  margin: 0 3px;
}
#dz-opts .mod-btns button:hover { background: var(--glass3); }

/* tool palette */
#dz-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 6px 18px 10px;
  flex-shrink: 0;
  max-height: 118px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.dz-pal-group { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dz-pal-group > span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 3px;
}
.dz-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--glass2);
  border: 1px solid transparent;
  border-radius: 99px;
  cursor: pointer;
  transition: all .15s ease;
}
.dz-tool::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tc, #5a5f6a);
  flex-shrink: 0;
}
.dz-tool:hover { background: var(--glass3); }
.dz-tool.active {
  border-color: var(--tc, var(--accent));
  background: color-mix(in srgb, var(--tc, #888) 22%, transparent);
  font-weight: 700;
}

/* elevation grid */
#dz-grid-wrap { overflow: auto; padding: 8px 18px 6px; border-top: 1px solid var(--line); }
#dz-grid { display: flex; gap: 6px; width: max-content; }
.dz-col { display: flex; flex-direction: column; gap: 5px; }
.dz-col.labels .dz-cell {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  justify-content: flex-end;
  padding-right: 10px;
  width: 62px;
  cursor: default;
  box-shadow: none !important;
}
.dz-cell {
  width: 70px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, var(--cc, #3a3f4a) 30%, rgba(255,255,255,.03));
  border: 1px solid color-mix(in srgb, var(--cc, #ffffff) 22%, transparent);
  border-radius: 11px;
  cursor: pointer;
  user-select: none;
  transition: transform .1s ease, border-color .15s;
}
.dz-cell:hover { transform: scale(1.07); border-color: var(--line2); z-index: 2; }
.dz-cell.blank {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, .16);
  color: var(--muted);
  font-weight: 400;
}
.dz-cell.lock {
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.035), rgba(255,255,255,.035) 5px, transparent 5px, transparent 10px);
  border: 1px solid var(--line);
  color: rgba(255, 255, 255, .3);
  cursor: not-allowed;
  font-weight: 400;
}
/* subtle highlight on cells the armed tool can drop into */
.dz-cell.placeable {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent-soft), 0 0 10px rgba(180, 136, 78, .28);
  animation: placeable-pulse 1.6s ease-in-out infinite;
}
@keyframes placeable-pulse {
  0%, 100% { box-shadow: 0 0 0 1.5px var(--accent-soft), 0 0 8px rgba(180, 136, 78, .22); }
  50%      { box-shadow: 0 0 0 1.5px var(--accent-soft), 0 0 14px rgba(180, 136, 78, .42); }
}

/* plan view (top-down room grid) */
.plan-wrap { padding: 4px 2px 2px; }
.plan-grid {
  display: grid;
  gap: 3px;
  width: max-content;
  padding: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.p-cell {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.p-cell:hover { background: rgba(255, 255, 255, .1); }
.p-wall {
  background: rgba(201, 176, 138, .38);
  color: #14100e;
  font-size: 10px;
  cursor: default;
}
.p-unit {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  color: #fff;
}
.p-unit.sel {
  background: linear-gradient(150deg, var(--accent-hi), var(--accent));
  box-shadow: 0 0 0 2px rgba(240, 147, 122, .5);
  color: #14100e;
}
/* seating / clearance side of an island — shown, but not draggable */
.p-seat {
  background: repeating-linear-gradient(45deg, rgba(180, 136, 78, .16), rgba(180, 136, 78, .16) 4px, transparent 4px, transparent 8px);
  cursor: default;
}
/* live preview of where a dragged unit will land */
.p-ghost {
  outline: 2px solid var(--accent-hi);
  outline-offset: -2px;
  background: rgba(240, 147, 122, .3);
}
.p-ghost-bad {
  outline: 2px dashed rgba(229, 72, 77, .8);
  outline-offset: -2px;
  background: rgba(229, 72, 77, .18);
}
.plan-legend {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.plan-legend span.pl-wall, .plan-legend span.pl-unit {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
.plan-legend .pl-wall { background: rgba(201, 176, 138, .45); }
.plan-legend .pl-unit { background: var(--accent); }

.dz-hint {
  padding: 6px 18px 11px;
  font-size: 10.5px;
  letter-spacing: .3px;
  color: rgba(255, 255, 255, .35);
}

/* ============================================================
   Request a Quote — modal, toast, and the branding back-link
============================================================ */

/* Back to the main site. Sits above the brand as its own row — a small icon
   button here was too easy to miss, and a dead-end tool loses visitors. */
.back-to-site {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 16px 0;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--glass2);
  border: 1px solid var(--line);
  border-radius: 99px;
  transition: all .16s ease;
}
.back-to-site:hover {
  color: var(--accent-hi);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.back-to-site .bts-arrow {
  font-size: 15px;
  line-height: 1;
  transition: transform .16s ease;
}
.back-to-site:hover .bts-arrow { transform: translateX(-3px); }

/* the brand block sits under the back link now */
.brand { padding-top: 14px; }

/* outlined variant of the primary button, for the demoted Save Render */
.btn-primary.alt {
  color: var(--text);
  background: var(--glass2);
  border: 1px solid var(--line2);
  box-shadow: none;
}
.btn-primary.alt:hover { background: var(--glass3); }

/* ---------- modal ---------- */
.q-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(6, 7, 9, .62);
  backdrop-filter: blur(6px);
}
.q-backdrop.open { display: grid; animation: qFade .18s ease both; }
@keyframes qFade { from { opacity: 0 } to { opacity: 1 } }

.q-modal {
  width: min(420px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow-y: auto;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  animation: qRise .22s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes qRise { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }

.q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.q-title { font-family: var(--display); font-size: 18px; font-weight: 600; }
.q-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--glass2);
  border: none; border-radius: 9px; cursor: pointer;
  transition: all .15s;
}
.q-close:hover { color: var(--text); background: var(--glass3); }

.q-body { padding: 16px 18px 18px; }
.q-intro { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }

.q-est {
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(180, 136, 78, .3);
  border-radius: var(--r-md);
}
.q-est-range { font-size: 18px; font-weight: 700; color: var(--accent-hi); }
.q-est-note { margin-top: 3px; font-size: 10.5px; letter-spacing: .3px; color: var(--muted); }

.q-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.q-field > label {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.q-field .req { color: var(--accent-hi); }
.q-field .opt { text-transform: none; letter-spacing: .2px; opacity: .7; font-weight: 400; }

/* the only genuinely new control — everything else reuses .text-input */
.select-input {
  width: 100%;
  padding: 9px 34px 9px 13px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--glass2);
  border: 1px solid var(--line);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23969ca8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  transition: border-color .15s;
}
.select-input:focus { border-color: var(--accent); }
/* native dropdown popups do NOT inherit the glass background — without this the
   options render white-on-white on Windows/Chrome */
.select-input option { background: #16171c; color: var(--text); }

.q-err { font-size: 11.5px; color: var(--danger); min-height: 13px; }
.text-input[aria-invalid="true"] { border-color: var(--danger); }

.q-details { margin: 4px 0 14px; }
.q-details summary {
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
}
.q-details summary:hover { color: var(--text); }
.q-spec {
  margin-top: 8px;
  padding: 10px 12px;
  max-height: 180px;
  overflow: auto;
  font-family: ui-monospace, Consolas, "SF Mono", monospace;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  background: var(--glass2);
  border-radius: var(--r-sm);
}

.q-actions { display: flex; flex-direction: column; gap: 8px; }
.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #06301a;
  background: var(--wa);
  border: none;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, .28);
  transition: all .16s ease;
}
.btn-wa:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-wa:active { transform: translateY(0); }

.q-fine { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--muted); }

/* stop OrbitControls stealing drags through the backdrop */
body.modal-open #viewport { pointer-events: none; }

/* ---------- toast ---------- */
.q-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 90px);
  z-index: calc(var(--z-modal) + 10);
  max-width: 90vw;
  padding: 12px 22px;
  font-size: 12.5px;
  color: var(--text);
  background: rgba(16, 17, 22, .95);
  border: 1px solid var(--line2);
  border-radius: 99px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.22, .8, .3, 1);
  pointer-events: none;
}
.q-toast.show { transform: translate(-50%, 0); }
.q-toast.err { border-color: var(--danger); color: #f2a49a; }

@media (prefers-reduced-motion: reduce) {
  .q-backdrop.open, .q-modal { animation: none; }
  .q-toast { transition: none; }
}

/* full-screen sheet on phones */
@media (max-width: 640px) {
  .q-backdrop { padding: 0; }
  .q-modal {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    border: none;
  }
}

/* "Saved on this device only" caption in the My Designs panel */
.side-note {
  font-size: 10.5px;
  letter-spacing: .3px;
  color: var(--muted);
  margin-bottom: 7px;
}

/* ============================================================
   Touch devices + the small-screen notice
============================================================ */

/* Sticky hover leaves grid cells stuck enlarged after a tap, and 40px is under
   the touch-target minimum. Helps tablets, which DO get the full tool. */
@media (hover: none) {
  .dz-cell:hover { transform: none; }
  .dz-cell { height: 44px; }
}

/* The designer needs real screen width to be usable — the control panel alone
   is 324px. Rather than ship a cramped, broken tool on phones, show an honest
   notice with a way to reach us. */
#small-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 26px;
  text-align: center;
  background: var(--bg);
  color: var(--text);
}
#small-screen .ss-mark {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent));
  color: #14100e;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
}
#small-screen h1 {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
  max-width: 15ch;
}
#small-screen p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 34ch;
}
#small-screen .ss-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  margin-top: 6px;
}
#small-screen a {
  display: block;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 99px;
  transition: filter .15s;
}
#small-screen .ss-wa { background: var(--wa); color: #06301a; }
#small-screen .ss-back { background: var(--glass2); color: var(--text); border: 1px solid var(--line2); }
#small-screen a:hover { filter: brightness(1.06); }

@media (max-width: 820px) {
  #small-screen { display: flex; }
}
