:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --border: #e7e3dc;
  --border-strong: #d6d0c6;
  --text: #1d1b19;
  --muted: #77716a;
  --accent: #23503f;
  --accent-hover: #1a3f31;
  --accent-soft: #e9f1ec;
  --accent-ring: rgba(35, 80, 63, 0.22);
  --danger: #b4231b;
  --danger-soft: #fdecea;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(29, 27, 25, 0.05);
  --shadow: 0 1px 2px rgba(29, 27, 25, 0.04), 0 8px 24px rgba(29, 27, 25, 0.06);
  --header-h: 64px;
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 500; font-size: 0.8rem; margin-left: 6px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: rgba(244, 242, 238, 0.85);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
}
.brand-mark svg { width: 20px; height: 20px; }
.header-badges { display: flex; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 500; color: var(--muted);
  padding: 6px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
}
.badge svg { width: 14px; height: 14px; color: var(--accent); }

/* ---------- Layout ---------- */

.layout {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 24px;
  align-items: start;
}

/* ---------- 3D viewer ---------- */

.viewer {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  height: calc(100vh - var(--header-h) - 40px);
  height: calc(100dvh - var(--header-h) - 40px);
  min-height: 460px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #ece8e1 0%, #e2ddd4 100%);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.viewer-stage { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.viewer-stage:active { cursor: grabbing; }
.viewer-stage canvas { display: block; width: 100% !important; height: 100% !important; outline: none; }

.viewer-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); font-size: 0.9rem;
  transition: opacity .4s ease;
}
.viewer-loading.done { opacity: 0; pointer-events: none; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(35, 80, 63, 0.15);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.viewer-overlay { position: absolute; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.viewer-overlay > * { pointer-events: auto; }
.viewer-overlay.top-left { top: 16px; left: 16px; }
.viewer-overlay.top-right { top: 16px; right: 16px; }
.viewer-overlay.bottom-center { bottom: 16px; left: 0; right: 0; justify-content: center; }

.chip {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-sm);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.hint {
  font-size: 0.78rem; color: #5f5952;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px; border-radius: 999px;
  transition: opacity .6s ease;
}
.hint.faded { opacity: 0; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text);
  transition: background .15s, transform .15s;
}
.icon-btn:hover { background: #fff; }
.icon-btn:active { transform: scale(0.96); }
.icon-btn svg { width: 18px; height: 18px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-sm);
}
.segmented button, .segmented label span {
  border: 0; background: transparent;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  display: block;
}
.segmented button.active, .segmented input:checked + span { background: var(--accent); color: #fff; }

/* ---------- Config panel ---------- */

.config { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.config-intro { padding: 6px 4px 4px; }
.config-intro h1 { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -0.025em; line-height: 1.15; }
.config-intro p { margin: 0; color: var(--muted); }

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-sm);
}
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.step-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: -0.01em; display: flex; align-items: baseline; }
.step-num {
  width: 24px; height: 24px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.78rem; font-weight: 700;
  display: grid; place-items: center;
}
.field-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 8px;
}

/* Cards */
.cards { display: grid; gap: 10px; margin-top: 12px; }
.field-label + .cards { margin-top: 0; }
.cards.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards.list { grid-template-columns: 1fr; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.card:hover { border-color: var(--border-strong); background: #fff; }
.card:active { transform: scale(0.99); }
.card:focus-visible, .pill:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.card-icon { width: 40px; height: 40px; color: var(--accent); }
.card-icon svg { width: 100%; height: 100%; }
.card-title { font-weight: 600; font-size: 0.92rem; line-height: 1.25; }
.card-sub { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.card-check {
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.card-check svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.card.selected .card-check { background: var(--accent); border-color: var(--accent); }
.card.selected .card-check svg { opacity: 1; }
.toggles .card-check { border-radius: 6px; }

.cards.list .card { flex-direction: row; align-items: center; gap: 14px; padding: 14px 44px 14px 14px; }
.cards.list .card-icon { flex-shrink: 0; width: 46px; height: 46px; }
.cards.list .card-check { top: 50%; transform: translateY(-50%); right: 14px; }

.cards.compact .card { align-items: center; padding: 12px 6px 10px; gap: 6px; }
.cards.compact .card-icon { width: 46px; height: 28px; }
.cards.compact .card-title { font-size: 0.82rem; }
.cards.compact .card-check { display: none; }

.toggles .card { flex-direction: row; align-items: center; gap: 10px; padding: 12px 36px 12px 12px; }
.toggles .card-icon { width: 30px; height: 30px; flex-shrink: 0; }
.toggles .card-title { font-size: 0.86rem; }
.toggles .card-check { top: 50%; transform: translateY(-50%); }

/* Pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 0.86rem; font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.pill:hover { border-color: var(--border-strong); background: #fff; }
.pill.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: 0 0 0 1px var(--accent) inset; }
.pill-sub { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.pill.selected .pill-sub { color: var(--accent); opacity: 0.8; }
.swatch { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* ---------- Summary ---------- */

.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.summary-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; }
.summary-sub { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.summary-lines { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.summary-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); color: #4a4540; }
.summary-lines li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 16px; font-weight: 600; }
.total-amount { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.total-amount small, .mobile-total-amount small { font-size: 0.55em; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.summary-note { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); text-align: center; }
.updating { opacity: 0.55; transition: opacity .2s; }

.primary-btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(35, 80, 63, 0.25);
}
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { opacity: 0.6; cursor: default; }
.primary-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.secondary-btn {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 18px; font-weight: 600; cursor: pointer;
}
.secondary-btn:hover { border-color: var(--border-strong); }

/* ---------- Mobile bottom bar ---------- */

.mobile-bar { display: none; }

/* ---------- Modal ---------- */

.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(24, 22, 20, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .2s ease;
}
.modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 30px 28px 28px;
  max-width: 440px; width: 100%;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: rise .25s cubic-bezier(.2, .8, .2, 1);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  border: none; background: var(--surface-2); cursor: pointer; color: var(--muted);
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-card h2 { margin: 0 0 6px; font-size: 1.35rem; letter-spacing: -0.02em; }
.modal-sub { color: var(--muted); margin: 0 0 16px; font-size: 0.9rem; }
.modal-total {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--accent-soft); color: var(--accent);
  padding: 12px 14px; border-radius: 12px; margin-bottom: 6px;
  font-size: 0.88rem; font-weight: 600;
}
.modal-total strong { font-size: 1.15rem; }

.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-ring); }
.field input.invalid { border-color: var(--danger); }

.contact-pref { border: none; margin: 16px 0 0; padding: 0; }
.contact-pref legend { font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; padding: 0; }
.segmented.wide { display: flex; background: var(--surface-2); border-color: var(--border); box-shadow: none; }
.segmented.wide label { flex: 1; }
.segmented.wide label span { text-align: center; padding: 10px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 0.85rem; margin-top: 14px; }
#quote-form .primary-btn { margin-top: 20px; }

.form-success { text-align: center; padding: 10px 0 0; }
.form-success p { color: var(--muted); margin: 0 0 22px; }
.success-icon {
  width: 60px; height: 60px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.success-icon svg { width: 30px; height: 30px; }

/* ---------- Builder detail ---------- */

.viewer-overlay.bottom-left { bottom: 16px; left: 16px; }
.viewer-overlay.bottom-right { bottom: 16px; right: 16px; }
.viewer-overlay.bottom-center { bottom: 64px; }
#viewer-collapse { display: none; }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.dim-label {
  font: 600 11px/1 var(--font);
  color: #fff;
  background: rgba(35, 80, 63, 0.92);
  padding: 4px 7px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}

.step { scroll-margin-top: calc(var(--header-h) + 16px); }
.step-head { align-items: flex-start; }
.step-head .step-num { margin-top: 1px; flex-shrink: 0; }
.step-desc { margin: 3px 0 0; font-size: 0.84rem; color: var(--muted); }
.field-note { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }

.step-nav {
  display: flex; flex-wrap: wrap; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 2px 2px 4px; margin: 0 -2px;
}
.step-nav::-webkit-scrollbar { display: none; }
.step-nav a {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 7px 12px 7px 7px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 600; color: var(--muted); text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.step-nav a span {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 0.72rem;
}
.step-nav a.current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.step-nav a.current span { background: var(--accent); color: #fff; }

.cards.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-meta { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-price { font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-top: 2px; font-variant-numeric: tabular-nums; }
.card-price.zero { color: var(--muted); font-weight: 500; }
.card-price.minus { color: #2c6e9b; }
.card-illus { width: 100%; height: 64px; color: var(--accent); }
.card-illus svg { width: 100%; height: 100%; }
.cards.compact .card-body { align-items: center; text-align: center; }
.cards.compact .card-price { margin-top: 0; }
.cards.compact .card-icon { width: 54px; height: 32px; }
.pill .pill-price { font-size: 0.74rem; color: var(--muted); font-weight: 500; }
.pill.selected .pill-price { color: var(--accent); }

.spec-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.spec {
  font-size: 0.76rem; color: #5f5952; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px;
}
.spec b { color: var(--text); font-weight: 600; }

.notice {
  margin-top: 14px; padding: 11px 13px; border-radius: 10px;
  background: #fff6e0; color: #7a5300; font-size: 0.84rem; line-height: 1.4;
  border: 1px solid #f3e0ae;
}

.summary-lines li { flex-wrap: wrap; }
.summary-lines .line-label { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.summary-lines .line-detail { font-size: 0.76rem; color: var(--muted); }
.gst-note { font-weight: 500; color: var(--muted); font-size: 0.74rem; margin-left: 4px; }
.link-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin-top: 10px; padding: 10px; border: none; background: none;
  color: var(--accent); font-weight: 600; font-size: 0.86rem; cursor: pointer; border-radius: 10px;
}
.link-btn:hover { background: var(--accent-soft); }
.link-btn svg { width: 16px; height: 16px; }
.included { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.included-title { font-size: 0.78rem; font-weight: 700; margin-bottom: 8px; }
.included ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.82rem; color: #4a4540; }
.included li { display: flex; gap: 8px; align-items: flex-start; }
.included li::before {
  content: ''; flex-shrink: 0; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%2323503f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat;
}

.modal-summary { font-size: 0.82rem; color: #4a4540; margin: 0 0 10px; display: grid; gap: 4px; }
.modal-summary div { display: flex; justify-content: space-between; gap: 10px; }
.modal-summary div span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field span em { font-style: normal; color: var(--muted); font-weight: 500; }
.field input, .field textarea { font-size: 16px; }
.field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 16px; background: var(--surface-2); resize: vertical;
}
.field textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-ring); }

.webgl-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-size: 0.9rem; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; padding: 16px 16px 40px; }
}

@media (max-width: 860px) {
  .header-badges { display: none; }
  .header-inner { padding: 0 16px; }
  .layout { grid-template-columns: 1fr; padding: 0 0 110px; gap: 0; }
  .viewer {
    position: sticky;
    top: var(--header-h);
    z-index: 5;
    height: 46vh; height: 46dvh;
    min-height: 300px;
    border-radius: 0;
    border-left: 0; border-right: 0; border-top: 0;
  }
  .config { padding: 16px; }
  .config-intro h1 { font-size: 1.35rem; }
  .summary .primary-btn { display: none; }
  .mobile-bar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.06);
  }
  .mobile-total { display: flex; flex-direction: column; }
  .mobile-total-label { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
  .mobile-total-amount { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .mobile-bar .primary-btn { width: auto; padding: 13px 22px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { border-radius: 20px 20px 0 0; max-width: none; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 860px) {
  :root { --header-h: 56px; --viewer-h: max(260px, 42vh); }
  @supports (height: 1dvh) { :root { --viewer-h: max(260px, 42dvh); } }
  body.viewer-collapsed { --viewer-h: 150px; }
  .viewer { height: var(--viewer-h); min-height: 0; transition: height .25s ease; }
  body.viewer-collapsed #viewer-collapse svg { transform: rotate(180deg); }
  #viewer-collapse { display: grid; }
  .viewer-overlay.top-left { top: 10px; left: 10px; }
  .viewer-overlay.top-right { top: 10px; right: 10px; }
  .viewer-overlay.bottom-left { bottom: 10px; left: 10px; }
  .viewer-overlay.bottom-right { bottom: 10px; right: 10px; }
  .viewer-overlay.bottom-center { display: none; }
  body.viewer-collapsed .viewer-overlay.bottom-left, body.viewer-collapsed #dims-toggle { display: none; }
  .chip { font-size: 0.76rem; padding: 6px 10px; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .segmented button { padding: 7px 10px; font-size: 0.78rem; }
  .icon-btn { width: 36px; height: 36px; }
  .step-nav {
    position: sticky; top: calc(var(--header-h) + var(--viewer-h)); z-index: 4;
    flex-wrap: nowrap;
    background: var(--bg); margin: 0 -16px; padding: 8px 16px;
    border-bottom: 1px solid var(--border);
  }
  .step, .summary { scroll-margin-top: calc(var(--header-h) + var(--viewer-h) + 60px); }
  .step { padding: 16px 14px 18px; }
  .card { padding: 12px; }
  .card:hover { background: var(--surface-2); }
  .card.selected:hover { background: var(--accent-soft); }
  .pill { padding: 10px 14px; }
}

@media (max-width: 520px) {
  .cards.cols-2.toggles { grid-template-columns: 1fr; }
  .cards.cols-3.compact .card { padding: 10px 4px; }
  .field-row { grid-template-columns: 1fr; }
  .card-illus { height: 52px; }
}

@media (max-height: 640px) and (max-width: 860px) {
  :root { --viewer-h: max(200px, 36vh); }
  body.viewer-collapsed { --viewer-h: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Desk colour swatches ---------- */

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.swatch-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; text-align: center; min-width: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.swatch-btn:hover { border-color: var(--border-strong); }
.swatch-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.swatch-btn.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.swatch-chip {
  width: 40px; height: 40px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}
.swatch-btn.selected .swatch-chip { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch-name { font-size: 0.74rem; font-weight: 600; line-height: 1.2; }
.swatch-price { font-size: 0.7rem; color: var(--muted); font-weight: 500; }

.brand-note {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; font-size: 0.84rem;
  background: var(--accent-soft); color: var(--accent);
}
.card.byo .card-meta { color: #7a5300; font-weight: 600; }

/* ---------- Setup time picker ---------- */

.slot-picker { border: none; padding: 0; margin: 16px 0 0; min-width: 0; }
.slot-picker legend { font-size: 0.82rem; font-weight: 600; margin-bottom: 8px; padding: 0; }
.slot-picker legend em { font-style: normal; color: var(--muted); font-weight: 500; }
.slot-days { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; padding-right: 2px; }
.slot-day { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot-date { font-size: 0.82rem; font-weight: 600; min-width: 92px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot span {
  display: inline-block; padding: 7px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
}
.slot input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }
.slot.taken span { color: var(--muted); background: var(--surface-2); text-decoration: line-through; cursor: not-allowed; }
.slot-flex { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.84rem; color: var(--muted); }
.slot-loading { font-size: 0.84rem; color: var(--muted); }
.check-field {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 10px 12px;
  border-radius: 10px; background: #fff6e0; border: 1px solid #f3e0ae; color: #7a5300; font-size: 0.86rem; font-weight: 600;
}
.check-field input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.check-field.invalid { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner {
  max-width: 1480px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; font-size: 0.9rem;
}
.footer-phone {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; letter-spacing: 0.01em;
}
.footer-phone:hover { background: var(--accent-hover); }
.footer-phone svg { width: 16px; height: 16px; }
.footer-company { margin-left: auto; color: var(--muted); font-size: 0.8rem; }

@media (max-width: 860px) {
  .site-footer { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .footer-inner { padding: 16px; }
  .footer-company { margin-left: 0; width: 100%; }
}
@media (max-width: 520px) {
  .swatches { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
}

.footer-link { color: var(--muted); font-size: 0.85rem; }
.form-privacy { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); text-align: center; }
.form-privacy a { color: inherit; }

.brand-logo { height: 40px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
