/* ============ CONFIGURATOR ============ */

.cfg-section { padding: 2rem 0 6rem; }
.cfg-container { max-width: 1380px; }

/* Top: progress + steps */
.cfg-top {
  max-width: 900px;
  margin: 0 auto 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.cfg-progress-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.75rem 1.25rem;
}
.cfg-progress-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem;
  letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600;
}
.cfg-progress-pct { color: var(--accent-light); font-size: 0.9rem; font-weight: 700; }
.cfg-progress-bar {
  height: 6px; background: rgba(22,24,41,0.07); border-radius: 50px; overflow: hidden;
}
.cfg-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 50px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cfg-steps-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 60px;
  padding: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
}
.cfg-step-tab {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-muted);
  transition: all 0.3s;
  white-space: nowrap; flex: 1; justify-content: center;
}
.cfg-step-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 15px rgba(19,139,193,0.3);
}
.cfg-step-tab:hover:not(.active) { color: var(--text-primary); background: rgba(19,139,193,0.07); }
.cfg-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  background: rgba(255,255,255,0.15); flex-shrink: 0;
}
.cfg-step-tab:not(.active) .cfg-step-num { background: var(--bg-surface); }
.cfg-step-divider { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }

/* Layout */
.cfg-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}
.cfg-form { min-width: 0; }
.cfg-panel { animation: cfgFadeIn 0.4s ease; }
@keyframes cfgFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Sidebar */
.cfg-sidebar { position: sticky; top: 100px; }
.cfg-sidebar-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cfg-preview {
  padding: 1rem;
  background: linear-gradient(180deg, var(--bg-darker) 0%, #eaf1f6 100%);
  border-bottom: 1px solid var(--border);
}
.cfg-preview-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--accent); margin-bottom: 0.5rem;
  text-align: center;
}
.cfg-preview-stage {
  display: block;
  padding: 0.6rem;
  min-height: 280px;
}
.cfg-cabin-svg { width: 100%; height: 100%; }
.cfg-shaft-diagram { width: 100%; }
.cfg-shaft-diagram svg { width: 100%; height: auto; display: block; }
.cfg-preview-stage .cfg-cabin-img { width: 100%; height: auto; object-fit: contain; border-radius: 8px; }

.cfg-sidebar-summary {
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.cfg-sidebar-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--text-muted);
  gap: 1rem;
}
.cfg-sidebar-row strong {
  color: var(--text-primary); font-weight: 600;
  text-align: right; font-size: 0.82rem;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cfg-sidebar-row-wrap strong { white-space: normal; font-size: 0.75rem; line-height: 1.4; }
.cfg-sidebar-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

.cfg-sidebar-cta {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(37,195,94,0.03);
}
.cfg-sidebar-submit {
  width: 100%; justify-content: center;
  padding: 0.85rem 1rem; font-size: 0.85rem;
}
.cfg-sidebar-response {
  font-size: 0.7rem; color: var(--text-muted);
  text-align: center; margin-top: 0.5rem;
}

/* Blocks */
.cfg-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s;
}
.cfg-block:hover { border-color: var(--border-light); }
.cfg-block-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; gap: 1rem;
}
.cfg-block-header h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.cfg-smart-hint {
  font-size: 0.7rem; color: var(--green);
  background: rgba(37,195,94,0.08);
  padding: 0.3rem 0.7rem; border-radius: 20px;
  opacity: 0; transition: opacity 0.3s;
  border: 1px solid rgba(37,195,94,0.15);
}
.cfg-smart-hint.visible { opacity: 1; }

/* Collapsible */
.cfg-collapsible .cfg-block-header { cursor: pointer; margin-bottom: 0; padding-bottom: 0; }
.cfg-collapsible .cfg-block-header.open { margin-bottom: 1.25rem; }
.cfg-chevron { transition: transform 0.3s; color: var(--text-muted); }
.cfg-block-header.open .cfg-chevron { transform: rotate(180deg); }
.cfg-collapsible-content { overflow: hidden; }

/* Rows & Fields */
.cfg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cfg-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.cfg-field { display: flex; flex-direction: column; gap: 0.4rem; }
.cfg-field label {
  font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
}
.req { color: var(--orange); }

/* Error message */
.cfg-err {
  display: none;
  font-size: 0.75rem;
  color: var(--orange);
  margin-top: 0.15rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.cfg-err:empty { display: none; }
.cfg-err:not(:empty)::before {
  content: ''; width: 12px; height: 12px; flex-shrink: 0;
  background: var(--orange); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M12 8v4M12 16h.01' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M12 8v4M12 16h.01' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Inputs */
.cfg-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.25s;
  outline: none;
}
.cfg-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(19,139,193,0.12); }
.cfg-input::placeholder { color: var(--text-muted); }
.cfg-input-center { text-align: center; }
.cfg-invalid, .cfg-input.cfg-invalid { border-color: var(--orange) !important; }
.cfg-flash { animation: cfgFlash 0.7s ease; }
@keyframes cfgFlash {
  0% { box-shadow: 0 0 0 0 rgba(37,195,94,0.6); background: rgba(37,195,94,0.1); }
  100% { box-shadow: 0 0 0 10px rgba(37,195,94,0); background: var(--bg-surface); }
}

.cfg-input-wrap { position: relative; display: flex; align-items: center; }
.cfg-input-wrap .cfg-input { padding-right: 3rem; }
.cfg-input-wrap .cfg-unit {
  position: absolute; right: 1rem;
  color: var(--text-muted); font-size: 0.8rem; font-weight: 500;
  pointer-events: none;
}

.cfg-select {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 1rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.25s;
  outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
.cfg-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(19,139,193,0.12); }

/* Spinner */
.cfg-spinner {
  display: flex; align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-surface);
}
.cfg-spinner .cfg-input {
  border: none; border-radius: 0;
  width: 60px; background: transparent;
  padding: 0.7rem 0.5rem;
}
.cfg-spinner-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-light);
  font-size: 1.3rem; font-weight: 600;
  transition: all 0.2s;
  background: transparent;
}
.cfg-spinner-btn:hover { background: rgba(19,139,193,0.1); }

/* Calculated field */
.cfg-calculated {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: rgba(19,139,193,0.08);
  border: 1.5px solid rgba(19,139,193,0.2);
  border-radius: 10px;
  min-height: 44px;
}
.cfg-calc-value { font-weight: 700; color: var(--accent-light); font-size: 1rem; }

/* Link button */
.cfg-link-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 1rem;
  color: var(--accent-light);
  font-size: 0.85rem; font-weight: 500;
  transition: all 0.2s;
  padding: 0.5rem 0;
}
.cfg-link-btn:hover { color: var(--accent); }

/* Info button */
.cfg-info-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.2s;
}
.cfg-info-btn:hover { background: rgba(19,139,193,0.1); color: var(--accent-light); }

/* Door options */
.cfg-door-options {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
}
.cfg-door-option {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.1rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
  color: var(--text-muted);
}
.cfg-door-option input { display: none; }
.cfg-door-option span { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }
.cfg-door-option:hover { border-color: var(--border-light); background: rgba(19,139,193,0.04); color: var(--text-secondary); }
.cfg-door-option.selected {
  border-color: var(--accent);
  background: rgba(19,139,193,0.08);
  box-shadow: 0 0 0 3px rgba(19,139,193,0.1);
  color: var(--accent-light);
}
.cfg-door-option.selected span { color: var(--accent-light); }

/* Capacity options */
.cfg-capacity-options { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cfg-cap-option { cursor: pointer; transition: all 0.2s; }
.cfg-cap-option input { display: none; }
.cfg-cap-option span {
  display: block; padding: 0.55rem 1.2rem;
  border: 2px solid var(--border); border-radius: 50px;
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary); transition: all 0.2s;
}
.cfg-cap-option:hover span { border-color: var(--border-light); }
.cfg-cap-option.selected span {
  border-color: var(--accent);
  background: rgba(19,139,193,0.1);
  color: var(--accent-light);
}

/* Alert */
.cfg-alert {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.9rem 1.2rem;
  background: rgba(19,139,193,0.06);
  border: 1px solid rgba(19,139,193,0.15);
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6;
}
.cfg-alert svg { flex-shrink: 0; color: var(--accent); margin-top: 1px; }

.cfg-regulation-primary {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1.2rem;
  background: rgba(37,195,94,0.06);
  border: 1px solid rgba(37,195,94,0.2);
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem; color: var(--green); font-weight: 500;
}
.cfg-regulation-primary svg { color: var(--green); flex-shrink: 0; }
.cfg-regulations-extra { display: flex; flex-direction: column; gap: 0.65rem; }

/* Checkbox */
.cfg-checkbox {
  display: flex; align-items: flex-start; gap: 0.7rem;
  cursor: pointer; font-size: 0.87rem;
  color: var(--text-secondary); line-height: 1.5;
}
.cfg-checkbox input { display: none; }
.cfg-checkmark {
  width: 20px; height: 20px;
  border: 2px solid var(--border-light);
  border-radius: 5px;
  flex-shrink: 0; transition: all 0.2s;
  position: relative; margin-top: 1px;
}
.cfg-checkbox input:checked + .cfg-checkmark {
  background: var(--accent); border-color: var(--accent);
}
.cfg-checkbox input:checked + .cfg-checkmark::after {
  content: ''; position: absolute;
  left: 5px; top: 1px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Material grid */
.cfg-material-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 0.75rem;
}
.cfg-material-option {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 0.9rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: all 0.25s;
  text-align: center;
}
.cfg-material-option input { display: none; }
.cfg-material-option span { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.3; }
.cfg-material-option:hover { border-color: var(--border-light); }
.cfg-material-option.selected {
  border-color: var(--accent);
  background: rgba(19,139,193,0.06);
}
.cfg-material-option.selected span { color: var(--accent-light); }
.cfg-material-swatch {
  width: 52px; height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(22,24,41,0.12);
}

/* Accessories */
.cfg-accessories-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Panel count */
.cfg-panel-count { font-size: 0.85rem; color: var(--text-secondary); }
.cfg-panel-count strong { color: var(--accent-light); }

/* Nav buttons */
.cfg-nav-buttons {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

/* File upload */
.cfg-file-upload {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.25rem;
  border: 2px dashed var(--border-light);
  border-radius: 10px;
  cursor: pointer; transition: all 0.25s;
  position: relative;
  color: var(--text-muted); font-size: 0.8rem;
}
.cfg-file-upload:hover { border-color: var(--accent); color: var(--accent-light); }
.cfg-file-upload.has-file { border-color: var(--green); background: rgba(37,195,94,0.05); color: var(--green); }
.cfg-file-input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}

/* Floor heights modal list */
.cfg-floor-heights-list {
  display: flex; flex-direction: column; gap: 0.6rem;
  max-height: 340px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-right: 0.5rem;
}
.cfg-floor-height-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cfg-floor-label {
  font-size: 0.85rem; color: var(--text-secondary); font-weight: 500;
  min-width: 120px;
}
.cfg-floor-height-row .cfg-input-wrap { flex: 1; }
.cfg-floor-heights-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.cfg-floor-heights-inline .cfg-floor-label { min-width: 90px; }
@media (max-width: 640px) { .cfg-floor-heights-inline { grid-template-columns: 1fr; } }

/* Submit error inline */
.cfg-submit-error {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(246,126,87,0.1);
  border: 1px solid rgba(246,126,87,0.3);
  border-radius: 8px;
  color: var(--orange);
  font-size: 0.85rem;
}

/* Modal */
.cfg-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(22,24,41,0.55);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center; justify-content: center;
  padding: 2rem;
}
.cfg-modal-overlay.open { display: flex; }
.cfg-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  max-width: 680px; width: 100%;
  max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  animation: cfgModalIn 0.3s ease;
}
.cfg-modal-sm { max-width: 480px; }
@keyframes cfgModalIn { from { opacity: 0; transform: scale(0.95) translateY(16px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.cfg-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
}
.cfg-modal-header h3 { font-size: 1.1rem; margin: 0; }
.cfg-modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.2s;
}
.cfg-modal-close:hover { background: rgba(22,24,41,0.06); color: var(--text-primary); }
.cfg-modal-body { padding: 1.75rem; }
.cfg-modal-body .cfg-row { margin-bottom: 1rem; }
.cfg-modal-footer {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border);
}
.cfg-modal-checks { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }

.cfg-info-diagram { padding: 1rem; background: var(--bg-surface); border-radius: var(--radius); }

.cfg-success { text-align: center; padding: 2rem 1rem; }
.cfg-success svg { color: var(--green); margin-bottom: 1rem; }
.cfg-success h3 { margin-bottom: 0.5rem; }
.cfg-success p { color: var(--text-secondary); }
.cfg-success code { background: rgba(19,139,193,0.1); padding: 0.2rem 0.5rem; border-radius: 4px; }

/* ============ CABIN GALLERIES (step 2) ============ */
.cfg-count { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.cfg-selected-detail {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.cfg-selected-name { font-weight: 700; color: var(--text-primary); font-size: 0.95rem; }
.cfg-selected-desc { color: var(--text-secondary); font-size: 0.83rem; margin-top: 0.3rem; line-height: 1.55; white-space: pre-line; }
.cfg-selected-desc:empty { display: none; }
.cfg-selected-usage { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.45rem; font-style: italic; line-height: 1.5; }
.cfg-selected-usage:empty { display: none; }

.cfg-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100px, 100%), 1fr));
  gap: 0.6rem;
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.25rem;
}
.cfg-gallery-item {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}
.cfg-gallery-item input { display: none; }
.cfg-gallery-item img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}
.cfg-gallery-noimg {
  width: 100%; height: 110px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface); border-radius: 6px;
  font-size: 0.72rem; color: var(--text-muted);
}
.cfg-gallery-item:hover { border-color: var(--border-light); }
.cfg-gallery-item.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(19,139,193,0.12); }
.cfg-gallery-code { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; line-height: 1.2; }
.cfg-gallery-item.selected .cfg-gallery-code { color: var(--accent-light); }

.cfg-cabin-img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .cfg-layout { grid-template-columns: 1fr; }
  .cfg-sidebar { position: static; }
  .cfg-sidebar-inner {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
  }
  .cfg-preview { border-bottom: none; border-right: 1px solid var(--border); }
  .cfg-sidebar-cta { grid-column: 1 / -1; border-top: 1px solid var(--border); }
  .cfg-sidebar-summary { grid-column: 2; }
}

@media (max-width: 768px) {
  .cfg-steps-nav { flex-direction: column; border-radius: var(--radius-lg); }
  .cfg-step-divider { width: 100%; height: 1px; }
  .cfg-row, .cfg-row-3 { grid-template-columns: 1fr; }
  .cfg-door-options { grid-template-columns: repeat(2, 1fr); }
  .cfg-material-grid { grid-template-columns: repeat(2, 1fr); }
  .cfg-accessories-list { grid-template-columns: 1fr; }
  .cfg-block { padding: 1.25rem; }
  .cfg-modal { margin: 1rem; }
  .cfg-modal-body { padding: 1.25rem; }
  .cfg-step-label { font-size: 0.8rem; }
  .cfg-capacity-options { gap: 0.375rem; }
  .cfg-cap-option span { padding: 0.5rem 0.875rem; font-size: 0.8rem; }
  .cfg-sidebar-inner { grid-template-columns: 1fr; }
  .cfg-preview { border-right: none; border-bottom: 1px solid var(--border); }
  .cfg-sidebar-summary { grid-column: 1; }
  .cfg-smart-hint { font-size: 0.65rem; padding: 0.25rem 0.5rem; }
  .cfg-block-header h3 { font-size: 0.95rem; }
  /* iOS Safari auto-zoom guard — keep configurator inputs at 16px on phones */
  .cfg-input, .cfg-select { font-size: 16px; }
  .cfg-modal-overlay { padding: 1rem; }
  /* ≥44px tap targets on phones */
  .cfg-modal-close { min-width: 44px; min-height: 44px; }
  .cfg-input, .cfg-select { min-height: 44px; }
  .cfg-sidebar-submit { min-height: 44px; }
  .cfg-checkbox { min-height: 44px; }
}
/* Touch devices in any orientation: keep all configurator fields at 16px (no iOS zoom) */
@media (hover: none) and (pointer: coarse) {
  .cfg-input, .cfg-select, .cfg-file-input { font-size: 16px; }
}
/* Wall material plan diagram */
.cfg-wall-diagram-wrap { display: flex; justify-content: center; margin-top: 1.4rem; }
.cfg-wall-diagram { width: 100%; max-width: 320px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem; }
.cfg-wall-diagram svg { width: 100%; height: auto; display: block; }

/* The close (X) must never be squeezed by a long modal title */
.cfg-modal-close { flex-shrink: 0; }
/* Hide the floating chat bubble while a configurator modal is open (no overlap with Submit) */
body.cfg-modal-open .chat-widget { display: none !important; }
