/* ── Room URL input ──────────────────────────────────────────── */
.room-url-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.room-url-divider {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.room-url-input-wrap {
  display: flex;
  gap: .35rem;
}

.room-url-input-wrap input[type="text"] {
  flex: 1;
  font-size: .8rem;
  padding: .4rem .6rem;
  min-width: 0;
}

.room-url-load-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  padding: .4rem .7rem;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}
.room-url-load-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-glow);
}
.room-url-load-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.room-url-load-btn.loading {
  pointer-events: none;
  opacity: .6;
}

.room-url-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.room-url-hint.hidden { display: none; }

.room-url-error {
  font-size: 12px;
  color: var(--error);
}

.room-url-progress {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-top: .2rem;
}
.room-url-progress-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--accent, #6366f1);
  width: 0%;
  transition: width .6s ease;
}
@keyframes url-progress-pulse {
  0%   { width: 35%; }
  50%  { width: 65%; }
  100% { width: 35%; }
}
.room-url-progress-bar.analysing {
  animation: url-progress-pulse 2s ease-in-out infinite;
  transition: none;
}
.room-url-progress-label {
  font-size: 12px;
  color: var(--muted);
}

/* ── Two-column input layout ─────────────────────────────────── */
.input-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--gap);
  align-items: stretch;
}

/* Left column: room photo */
.input-left {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.input-section-label {
  font-size: 12px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.input-section-label em {
  font-style: normal; color: var(--accent); font-weight: 400;
  text-transform: none; letter-spacing: 0;
}

.room-drop-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.drop-zone--room {
  width: 100%;
  min-height: 200px;
  flex: 1;
}

/* Right column: 2x2 material sections grid */
.input-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: .75rem;
  border-left: 1px solid var(--border);
  padding-left: var(--gap);
  align-content: start;
}

/* ── Material section (floor / curtain / baseboard) ─────────── */
.material-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.material-section:hover {
  border-color: var(--border-l);
}

.material-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.material-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text);
}
.material-section-title .optional-tag {
  font-style: normal; font-weight: 400; color: var(--muted);
  text-transform: none; letter-spacing: 0; font-size: 12px;
  margin-left: .35rem;
}

.material-section--optional .material-section-header {
  border-bottom: none;
}

.btn-remove-material {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color .2s, border-color .2s, background .2s;
  flex-shrink: 0;
}
.btn-remove-material svg { width: 12px; height: 12px; }
.btn-remove-material:hover {
  color: var(--error);
  border-color: var(--error);
  background: rgba(220,53,69,.08);
}

.material-body {
  display: flex;
  gap: 0;
  align-items: stretch;
}

/* Images area */
.material-images {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  flex: 0 0 auto;
}

.material-slot {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 0 0 150px;
  width: 150px;
}

.slot-label {
  font-size: 12px; color: var(--muted);
  white-space: nowrap;
}
.slot-label em {
  font-style: normal; color: var(--muted); opacity: 0.6;
}

/* ── Drop zones ───────────────────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 2px dashed var(--border-l);
  border-radius: var(--radius-sm);
  background: var(--surface);
  width: 100%;
  height: 150px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .25s, background .25s, box-shadow .25s;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: .4rem;
}

/* Override height for room photo specifically */
.drop-zone--room {
  height: auto;
  min-height: 200px;
  aspect-ratio: unset;
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 20px rgba(58,158,110,.08);
}
.drop-zone.has-file { border-style: solid; border-color: var(--accent); }

.drop-zone .drop-icon {
  width: 28px; height: 28px;
  color: var(--muted);
  opacity: .5;
  transition: opacity .2s, transform .2s;
}
.drop-zone:hover .drop-icon {
  opacity: .8;
  transform: translateY(-2px);
}
.drop-zone.has-file .drop-icon { display: none; }

.drop-hint {
  font-size: 12px; color: var(--muted);
  text-align: center; padding: 0 .5rem;
  pointer-events: none;
}
.drop-zone.has-file .drop-hint { display: none; }

.preview-slot {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  border: 2px dashed #e2e8f0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}

.preview-slot:hover {
  border-color: #cbd5e1;
}

.preview-slot.has-image {
  border-style: solid;
  border-color: #e2e8f0;
  cursor: pointer;
}

.preview-slot.has-image:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  pointer-events: none;
}

.preview-placeholder svg {
  width: 32px;
  height: 32px;
  opacity: 0.5;
}

.preview-placeholder span {
  font-size: 12px;
  font-weight: 500;
}

.preview-slot .preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.preview-slot.has-image .preview {
  opacity: 1;
}

.preview-slot.has-image .preview-placeholder {
  display: none;
}

.drop-zone .preview {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
  transition: transform .3s;
}
.drop-zone.has-file .preview { display: block; }
.drop-zone.has-file:hover .preview { transform: scale(1.03); }

/* Room photo: fixed aspect ratio box, image letterboxed inside */
.drop-zone--room.has-file {
  display: block;
  padding: 0;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #000;
}
.drop-zone--room .preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Room remove button */
.room-remove-btn {
  display: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  transition: background 0.15s;
}
.room-remove-btn svg { width: 14px; height: 14px; }
.room-remove-btn:hover { background: rgba(220,38,38,0.85); }
.drop-zone--room.has-file .room-remove-btn { display: flex; }

/* Drag overlay */
.drop-zone .drag-overlay {
  position: absolute; inset: 0;
  background: rgba(58,158,110,.15);
  display: none;
  align-items: center; justify-content: center;
  z-index: 5;
  backdrop-filter: blur(4px);
  border-radius: inherit;
}
.drop-zone.dragover .drag-overlay { display: flex; }
.drag-overlay-icon {
  width: 32px; height: 32px; color: var(--accent);
}

/* Replace button */
.slot-replace-btn {
  position: absolute;
  bottom: .4rem; right: .4rem;
  z-index: 2;
  background: rgba(0,0,0,.7);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  padding: .25rem .5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, background .2s;
  line-height: 1.2;
  backdrop-filter: blur(4px);
}
.drop-zone.has-file:hover .slot-replace-btn { opacity: 1; }
.slot-replace-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ── Material meta slot (3rd column) ────────────────────────── */
.material-slot--meta {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .75rem .75rem .75rem 0;
  justify-content: flex-start;
}

.material-slot--meta:empty {
  display: none;
}

.meta-slot-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.meta-slot-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.meta-slot-rows {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.meta-slot-row {
  display: flex;
  gap: .4rem;
  align-items: baseline;
}

.meta-slot-key {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.meta-slot-val {
  font-size: 12px;
  color: var(--text-sec);
  word-break: break-word;
}

.meta-slot-palette {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin-top: .1rem;
}

.meta-slot-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.meta-slot-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  margin-top: .15rem;
  display: inline-block;
}
.meta-slot-link:hover { text-decoration: underline; }

/* ── Room URL image picker ───────────────────────────────────── */
.room-url-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .2rem;
}

.room-url-picker-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .2s, box-shadow .2s;
  background: var(--surface2);
}

.room-url-picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.room-url-picker-thumb:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.room-url-picker-thumb.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.room-url-picker-thumb.loading {
  opacity: .45;
  cursor: wait;
  pointer-events: none;
}

/* ── Pricing summary ─────────────────────────────────────────── */
.pricing-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.pricing-summary-header {
  display: flex;
  align-items: center;
}

.pricing-summary-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

#pricingM2Rows,
#wizardPricingM2Rows {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.pricing-m2-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  transition: background var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}

.pricing-m2-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex: 0 0 4.5rem;
}

.pricing-m2-input-wrap {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Status column: fixed width so input+unit stay consistently positioned */
.pricing-m2-status {
  width: 8rem;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.pricing-m2-input {
  width: 4rem;
  font-size: .8rem;
  padding: .3rem .5rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  text-align: right;
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}
.pricing-m2-input:focus {
  outline: none;
  border-color: var(--accent-h);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.pricing-m2-unit {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

/* Disabled rows: muted, no interaction */
.pricing-m2-row--disabled {
  opacity: .45;
  pointer-events: none;
  background: var(--surface);
  border-color: var(--border);
}
.pricing-m2-row--disabled .pricing-m2-label {
  color: var(--muted);
  font-weight: 400;
}
.pricing-m2-row--disabled .pricing-m2-input {
  background: var(--surface, #f5f5f5);
  border-color: var(--border);
  cursor: not-allowed;
}
.pricing-m2-row--disabled .pricing-m2-unit {
  color: var(--muted);
  font-weight: 400;
}

.wizard-pricing-section {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.pricing-section-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 .5rem;
}

.pricing-lines {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.pricing-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

.pricing-line-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.pricing-line-detail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .1rem;
}

.pricing-line-amount {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
}

.pricing-line-sub {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

.pricing-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: .4rem;
  margin-top: .15rem;
}

.pricing-total-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.pricing-total-value {
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
}

.pricing-disclaimer {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* ── Pricing result card (in results area) ──────────────── */
.pricing-result {
  background: var(--surface, #fafafa);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}
.pricing-result-title {
  font-size: .9rem;
  font-weight: 700;
  margin: 0 0 .75rem;
  color: var(--text);
}
.pricing-result-lines {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.pricing-result-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: .6rem;
  margin-top: .5rem;
}
.pricing-result-total-label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}
.pricing-result-total-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}
