/* BUNYAN — Saudi Home Design Platform Styles */
/* ============================ RESET & BASE ============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans Arabic', -apple-system, sans-serif;
  background: #0A0F0D;
  color: #F5F1E8;
  line-height: 1.6;
  overflow-x: hidden;
  direction: rtl;
}

:root {
  --green: #0E6E4E;
  --green-light: #14A373;
  --green-dark: #084832;
  --gold: #D4AF37;
  --gold-light: #E8C66A;
  --sand: #F5F1E8;
  --dark: #0A0F0D;
  --dark-2: #11201A;
  --dark-3: #1A2E25;
  --border: rgba(212, 175, 55, 0.15);
  --grad: linear-gradient(135deg, #0E6E4E 0%, #14A373 50%, #D4AF37 100%);
  --grad-warm: linear-gradient(135deg, #D4AF37 0%, #E8C66A 100%);
}

/* ============================ TYPOGRAPHY ============================ */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.1; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.2; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; }

.grad {
  background: linear-gradient(90deg, #C9A96E 0%, #F0D080 40%, #E5C896 60%, #C9A96E 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: goldShimmer 4s linear infinite;
}
@keyframes goldShimmer {
  0%   { background-position: 0%   center; }
  100% { background-position: 200% center; }
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }

/* ============================ BUTTONS ============================ */
.btn-primary, .btn-ghost {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 20px rgba(14, 110, 78, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(14, 110, 78, 0.5); }
.btn-primary.lg { padding: 1.1rem 2.25rem; font-size: 1.1rem; }
.btn-primary.sm { padding: 0.5rem 0.85rem; font-size: 0.9rem; }
.btn-ghost {
  background: transparent;
  color: var(--sand);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: rgba(212, 175, 55, 0.08); border-color: var(--gold); }
.btn-ghost.lg { padding: 1.1rem 2.25rem; font-size: 1.1rem; }

/* ============================ NAVBAR ============================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(10, 15, 13, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo { width: 40px; height: 40px; }
.brand-ar { font-size: 1.25rem; font-weight: 700; color: var(--sand); }
.brand-en { font-size: 0.7rem; color: var(--gold); letter-spacing: 0.2em; font-family: system-ui; }
.nav-links { display: flex; gap: 2rem; margin-right: auto; }
.nav-links a {
  color: var(--sand);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; color: var(--gold-light); }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ============================ HERO ============================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  overflow: hidden;
  background: radial-gradient(ellipse at top, #1A2E25 0%, #0A0F0D 60%);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.9;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 960px;
}
.badge {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  background: rgba(201,169,110,0.12);
  border: 1px solid rgba(201,169,110,0.45);
  border-radius: 100px;
  color: var(--gold-light);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  margin-bottom: 1.8rem;
  animation: fadeDown 0.9s cubic-bezier(0.22,0.61,0.36,1) 0.2s backwards;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 40px rgba(0,0,0,0.6);
  animation: fadeUp 1s cubic-bezier(0.22,0.61,0.36,1) 0.35s backwards;
}
.lead {
  font-size: clamp(1rem, 2vw, 1.25rem);
  opacity: 0.88;
  margin-bottom: 2.8rem;
  max-width: 680px;
  margin-inline: auto;
  line-height: 1.7;
  text-shadow: 0 2px 16px rgba(0,0,0,0.7);
  animation: fadeUp 1s cubic-bezier(0.22,0.61,0.36,1) 0.5s backwards;
}
.cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  animation: fadeUp 0.8s ease 0.3s backwards;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 700px;
  margin: 0 auto;
  animation: fadeUp 0.8s ease 0.4s backwards;
}
.stat { text-align: center; }
.stat strong { display: block; font-size: 1.75rem; color: var(--gold); font-weight: 700; }
.stat span { font-size: 0.85rem; opacity: 0.7; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0.5;
  animation: bounce 2s infinite;
}
.mouse {
  width: 24px; height: 36px;
  border: 2px solid var(--sand);
  border-radius: 12px;
  margin: 0 auto 0.5rem;
  position: relative;
}
.mouse span {
  display: block;
  width: 2px; height: 6px;
  background: var(--sand);
  border-radius: 2px;
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  animation: scroll 1.5s infinite;
}

/* ============================ SECTIONS ============================ */
section { padding: 6rem 0; }
.section-head { text-align: center; margin-bottom: 4rem; }
.eyebrow {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 100px;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.section-head p { opacity: 0.7; font-size: 1.1rem; }

/* ============================ HOW IT WORKS ============================ */
.how { background: linear-gradient(180deg, transparent, #11201A 50%, transparent); }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.step-card {
  padding: 2rem;
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 20px;
  position: relative;
  transition: all 0.3s;
}
.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  background: rgba(26, 46, 37, 0.8);
}
.step-num {
  font-size: 3rem;
  font-weight: 800;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
  font-family: system-ui;
}
.step-card h3 { margin-bottom: 0.75rem; }
.step-card p { opacity: 0.75; font-size: 0.95rem; }

/* ============================ FEATURES ============================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.feat {
  padding: 2rem;
  background: rgba(26, 46, 37, 0.3);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.3s;
}
.feat:hover { transform: translateY(-4px); border-color: var(--gold); }
.feat-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.grad-bg { background: var(--grad); }
.feat h3 { margin-bottom: 0.5rem; }
.feat p { opacity: 0.75; }

/* ============================ PRICING ============================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.price-card {
  padding: 2.5rem 2rem;
  background: rgba(26, 46, 37, 0.4);
  border: 1px solid var(--border);
  border-radius: 24px;
  position: relative;
  transition: all 0.3s;
}
.price-card:hover { transform: translateY(-4px); }
.price-card.featured {
  background: linear-gradient(180deg, rgba(14, 110, 78, 0.3), rgba(212, 175, 55, 0.05));
  border: 2px solid var(--gold);
  transform: scale(1.05);
}
.feat-tag {
  position: absolute;
  top: -12px;
  right: 2rem;
  background: var(--grad-warm);
  color: var(--dark);
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
}
.price-card h3 { color: var(--gold-light); margin-bottom: 0.5rem; }
.price {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  font-family: system-ui;
}
.price small { font-size: 1rem; font-weight: 400; opacity: 0.7; }
.price-card ul { list-style: none; margin-bottom: 1.5rem; }
.price-card li { padding: 0.5rem 0; opacity: 0.9; font-size: 0.95rem; }
.price-card button { width: 100%; justify-content: center; }

/* ============================ FOOTER ============================ */
.footer {
  background: #060A08;
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer h4 { margin-bottom: 1rem; color: var(--gold); }
.footer ul { list-style: none; }
.footer li { padding: 0.3rem 0; opacity: 0.7; font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  text-align: center;
  opacity: 0.5;
  font-size: 0.85rem;
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: 2rem;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ============================ WIZARD ============================ */
.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 8, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.wizard-overlay.open { opacity: 1; pointer-events: all; }
.wizard-modal {
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 4rem);
  max-height: 900px;
  background: linear-gradient(180deg, #11201A 0%, #0A0F0D 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s;
}
.wizard-overlay.open .wizard-modal { transform: scale(1); }

.wizard-head {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--sand);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }

.progress-wrap { flex: 1; }
.progress-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}
.progress-fill {
  height: 100%;
  background: var(--grad);
  width: 14%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 100px;
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}
.pl { opacity: 0.4; transition: all 0.3s; }
.pl.active { opacity: 1; color: var(--gold); font-weight: 600; }
.pl.done { opacity: 0.8; color: var(--green-light); }

@media (max-width: 768px) {
  .progress-labels { display: none; }
}

.step-counter {
  font-family: system-ui;
  font-weight: 700;
  color: var(--gold);
  font-size: 0.95rem;
  padding: 0.3rem 0.75rem;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 10px;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.wizard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}
/* cost-pill is removed from wizard footer — kept hidden for backward compat */
.cost-pill { display: none !important; }

/* ============================ WIZARD STEPS ============================ */
.step-wrap { max-width: 900px; margin: 0 auto; animation: fadeIn 0.4s ease; }
.step-wrap.design-step { max-width: 100%; }
.step-hero { text-align: center; margin-bottom: 3rem; padding-top: 2rem; }
.step-hero h2 { font-size: 2.5rem; margin-bottom: 0.75rem; }
.step-head { margin-bottom: 2rem; }
.step-head h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.step-head p { opacity: 0.7; }

/* choice cards */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}
.choice-card {
  padding: 2.5rem 2rem;
  background: rgba(26, 46, 37, 0.4);
  border: 2px solid var(--border);
  border-radius: 20px;
  text-align: right;
  cursor: pointer;
  font-family: inherit;
  color: var(--sand);
  position: relative;
  transition: all 0.3s;
  font-size: 1rem;
}
.choice-card:hover, .choice-card.selected {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  transform: translateY(-4px);
}
.choice-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--grad);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.choice-card h3 { margin-bottom: 0.5rem; font-size: 1.25rem; }
.choice-card p { opacity: 0.75; font-size: 0.95rem; }
.choice-arrow {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-size: 1.5rem;
  color: var(--gold);
  transition: transform 0.3s;
}
.choice-card:hover .choice-arrow { transform: translateX(-8px); }
@media (max-width: 640px) { .choice-grid { grid-template-columns: 1fr; } }

/* land selection */
.land-choice {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.03);
  padding: 0.3rem;
  border-radius: 14px;
  max-width: 400px;
}
.pill-choice {
  flex: 1;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--sand);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s;
}
.pill-choice.active {
  background: var(--grad);
  opacity: 1;
  font-weight: 700;
}
.hidden { display: none !important; }

.map-wrap {
  position: relative;
  height: 400px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  background: #1A2E25;
}
.map-wrap.small { height: 280px; }
.map-canvas { width: 100%; height: 100%; }
.map-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  left: 1rem;
}
.map-controls input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: rgba(10, 15, 13, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--sand);
  font-family: inherit;
}
.map-pin {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -100%);
  font-size: 2rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
  animation: bounce 2s infinite;
}

.land-inputs, .search-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 640px) { .land-inputs, .search-filters { grid-template-columns: 1fr; } }
.land-inputs label, .search-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.8;
}
.land-inputs input, .land-inputs select, .search-filters input, .search-filters select {
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--sand);
  font-family: inherit;
  font-size: 0.95rem;
}
.search-filters label strong { color: var(--gold); font-family: system-ui; margin-top: 0.3rem; }

.land-listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.land-card {
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}
.land-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.land-card.selected { border-color: var(--gold); background: rgba(212, 175, 55, 0.08); }
.land-img {
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.land-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,15,13,0.9));
}
.land-info { padding: 1rem; }
.land-info h4 { margin-bottom: 0.3rem; font-size: 1rem; }
.land-info p { font-size: 0.85rem; opacity: 0.7; }
.land-price { color: var(--gold); font-weight: 700; font-family: system-ui; font-size: 1.15rem; margin-top: 0.5rem; }

.textarea-wrap textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--sand);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

/* Design step */
.design-step {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  max-width: 100%;
  height: 100%;
  align-items: start;
}
@media (max-width: 900px) { .design-step { grid-template-columns: 1fr; } }
.design-main {
  background: linear-gradient(180deg, #0E1815 0%, #1A2E25 100%);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  /* ← المفتاح: يتناسب مع ارتفاع الـ wizard */
  height: calc(100vh - 13.5rem);
  max-height: 640px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.viewer-3d { width: 100%; height: 100%; min-height: 500px; }
.viewer-controls {
  position: absolute;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(10, 15, 13, 0.85);
  backdrop-filter: blur(12px);
  padding: 0.45rem 0.6rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  max-width: 94%;
}
.vc-btn {
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--sand);
  cursor: pointer;
  font-family: inherit;
  border-radius: 8px;
  font-size: 0.78rem;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}
.vc-btn:hover {
  background: rgba(212,175,55,0.14);
  border-color: rgba(212,175,55,0.35);
  color: var(--gold);
}
.vc-btn.vc-rotate {
  font-size: 1.05rem;
  padding: 0.3rem 0.6rem;
}

/* "دخول المنزل" floating button */
.btn-enter-interior {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0E6E4E 0%, #145E41 100%);
  color: #F5F1E8;
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: 40px;
  padding: 0.55rem 1.6rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55);
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  z-index: 5;
  letter-spacing: 0.01em;
}
.btn-enter-interior:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 7px 26px rgba(0,0,0,0.65);
  background: linear-gradient(135deg, #12885F 0%, #0E6E4E 100%);
}

.design-side {
  background: rgba(26, 46, 37, 0.4);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 13.5rem);
  max-height: 640px;
  min-height: 420px;
}
.design-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.dtab {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: none;
  color: var(--sand);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.6;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.dtab.active { opacity: 1; border-bottom-color: var(--gold); color: var(--gold); }
.dtab-panel { padding: 1.25rem; overflow-y: auto; flex: 1; }
.dtab-panel label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}
.dtab-panel label.check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}
.dtab-panel select, .dtab-panel input[type=text] {
  padding: 0.6rem 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--sand);
  font-family: inherit;
}
.dtab-panel input[type=range] { accent-color: var(--gold); }

.code-check {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem;
  background: rgba(20, 163, 115, 0.1);
  border: 1px solid rgba(20, 163, 115, 0.3);
  border-radius: 10px;
  margin-top: 1rem;
}
.ok-dot {
  width: 10px; height: 10px;
  background: var(--green-light);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--green-light);
  animation: pulse 2s infinite;
}
.code-check strong { display: block; font-size: 0.9rem; color: var(--green-light); }
.code-check small { font-size: 0.75rem; opacity: 0.7; }

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 300px;
  max-height: 400px;
}
.msg {
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  max-width: 85%;
  line-height: 1.5;
}
.msg.ai { background: rgba(14, 110, 78, 0.2); align-self: flex-start; }
.msg.user { background: var(--grad); align-self: flex-end; color: white; font-weight: 500; }
.msg.small { opacity: 0.7; font-size: 0.8rem; }

.chat-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--sand);
  font-family: inherit;
}

/* Floor plan */
.floor-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ftab {
  padding: 0.65rem 1.25rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--sand);
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}
.ftab.active { background: var(--grad); border-color: transparent; }

.floorplan {
  background: #F5F1E8;
  border-radius: 16px;
  min-height: 400px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.floorplan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.lg-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  opacity: 0.85;
}
.lg-item i {
  width: 14px; height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.1);
}

/* Budget bar */
.budget-bar {
  padding: 1.25rem;
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1.5rem;
}
.budget-bar label { display: block; margin-bottom: 0.5rem; }
.budget-bar label strong { color: var(--gold); font-family: system-ui; }
.budget-bar input[type=range] { width: 100%; accent-color: var(--gold); }
.budget-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--green-light);
}
.budget-status.warn { color: #E88A4F; }
.budget-status.bad { color: #E85C5C; }

.brand-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.brand-chip {
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--sand);
  font-family: inherit;
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.brand-chip.active, .brand-chip:hover {
  background: var(--grad);
  border-color: transparent;
  color: white;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.product-card {
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.product-card.selected {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}
.product-card.selected::after {
  content: '✓';
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  width: 28px; height: 28px;
  background: var(--gold);
  color: var(--dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.product-img {
  height: 160px;
  background: linear-gradient(135deg, #F5F1E8, #E8DCC5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.product-info { padding: 0.85rem; }
.product-brand {
  font-size: 0.7rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: system-ui;
  margin-bottom: 0.3rem;
}
.product-name {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}
.product-price {
  font-weight: 700;
  color: var(--gold);
  font-family: system-ui;
  font-size: 1rem;
}

/* Contractors */
.contractors {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
.contractor-card {
  padding: 1.5rem;
  background: rgba(26, 46, 37, 0.5);
  border: 2px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
}
.contractor-card:hover, .contractor-card.selected {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}
.contractor-avatar {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}
.contractor-info h4 { margin-bottom: 0.3rem; }
.contractor-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  opacity: 0.75;
}
.contractor-meta span { display: flex; align-items: center; gap: 0.3rem; }
.contractor-price {
  text-align: left;
}
.contractor-price strong {
  color: var(--gold);
  font-family: system-ui;
  font-size: 1.25rem;
  display: block;
}
.contractor-price small { opacity: 0.7; }
@media (max-width: 640px) {
  .contractor-card { grid-template-columns: 1fr; text-align: center; }
  .contractor-price { text-align: center; }
}

.contract-box {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(14, 110, 78, 0.2), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 18px;
}
.contract-box h3 { color: var(--gold); margin-bottom: 1rem; }
.contract-list { list-style: none; }
.contract-list li { padding: 0.4rem 0; font-size: 0.95rem; }

/* Success */
.success-wrap { text-align: center; padding: 2rem 1rem; }
.success-anim {
  width: 140px; height: 140px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  animation: popIn 0.6s cubic-bezier(0.17, 0.67, 0.5, 1.3);
  position: relative;
}
.success-anim::before, .success-anim::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: ripple 2s infinite;
}
.success-anim::after { animation-delay: 1s; }
.success-wrap h2 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.success-sub { opacity: 0.75; margin-bottom: 2rem; }
.summary-card {
  max-width: 500px;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: right;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.summary-row:last-child { border: none; }
.summary-row.total { font-size: 1.15rem; padding-top: 1rem; }
.summary-row.total strong { color: var(--gold); font-family: system-ui; }

/* ============================ ANIMATIONS ============================ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }
@keyframes scroll { 0% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 15px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 12px var(--green-light); } 50% { box-shadow: 0 0 20px var(--green-light); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: scale(1); } }
@keyframes ripple { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* AI Generate Button */
.btn-ai-gen {
  width: 100%;
  margin: 1rem 0 .5rem;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, #C9A96E 0%, #8B6914 100%);
  color: #1a1208;
  border: none;
  border-radius: 10px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  box-shadow: 0 4px 15px rgba(201,169,110,.35);
}
.btn-ai-gen:hover { opacity: .9; transform: translateY(-1px); }
.btn-ai-gen:active { transform: translateY(0); }
.btn-ai-gen:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Download design button (below AI gen) */
.btn-download-design {
  width: 100%;
  padding: .5rem 1rem;
  background: transparent;
  color: rgba(212,175,55,0.85);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 8px;
  font-family: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
  margin-bottom: .4rem;
}
.btn-download-design:hover {
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.6);
  color: var(--gold);
}

/* Hero demo button */
.btn-demo-hero {
  padding: .9rem 1.8rem;
  background: rgba(255,255,255,0.07);
  color: var(--sand);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 40px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  backdrop-filter: blur(8px);
}
.btn-demo-hero:hover {
  background: rgba(212,175,55,0.12);
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* Final step action row */
.final-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.5); }

/* ============================ AUTH MODAL ============================ */
.auth-overlay {
  position: fixed; inset: 0;
  background: rgba(6, 10, 8, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.auth-overlay.open { opacity: 1; pointer-events: all; }
.auth-modal {
  background: linear-gradient(180deg, #11201A 0%, #0A0F0D 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
  position: relative;
  animation: fadeIn 0.3s ease;
}
.auth-close {
  position: absolute; top: 1rem; left: 1rem;
}
.auth-logo {
  display: flex; align-items: center; gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.75rem;
}
.auth-brand-name {
  font-size: 1.5rem; font-weight: 700; color: var(--sand);
}
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 0.3rem;
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1; padding: 0.7rem;
  background: transparent; border: none;
  color: var(--sand); font-family: inherit;
  font-size: 0.95rem; font-weight: 500;
  border-radius: 10px; cursor: pointer;
  opacity: 0.6; transition: all 0.2s;
}
.auth-tab.active {
  background: var(--grad); opacity: 1; font-weight: 700;
}
.auth-error {
  background: rgba(232, 60, 60, 0.1);
  border: 1px solid rgba(232, 60, 60, 0.3);
  color: #e85c5c;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.auth-form {
  display: flex; flex-direction: column; gap: 1rem;
  margin-bottom: 1rem;
}
.auth-form label {
  display: flex; flex-direction: column; gap: 0.35rem;
  font-size: 0.85rem; opacity: 0.8;
}
.auth-form input {
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--sand);
  font-family: inherit;
  font-size: 0.95rem;
}
.auth-form input:focus {
  outline: none; border-color: var(--gold);
}
.auth-submit-btn {
  width: 100%; justify-content: center;
  margin-top: 0.5rem;
}
.auth-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1rem 0; opacity: 0.4; font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}
.auth-google-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--sand); font-family: inherit;
  font-size: 0.95rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.auth-google-btn:hover {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2);
}

/* Navbar avatar */
.nav-avatar-wrap {
  position: relative;
  display: flex; align-items: center;
}
.nav-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  cursor: pointer; border: 2px solid var(--gold);
}
.nav-avatar-menu {
  position: absolute; top: 48px; left: 0;
  background: #11201A;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  min-width: 150px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  z-index: 200;
}
.nav-avatar-menu.open { opacity: 1; pointer-events: all; }
.nav-avatar-menu button {
  width: 100%; padding: 0.6rem 0.85rem;
  background: transparent; border: none;
  color: var(--sand); font-family: inherit;
  text-align: right; cursor: pointer;
  border-radius: 8px; font-size: 0.9rem;
}
.nav-avatar-menu button:hover { background: rgba(255,255,255,0.06); }

/* ============================ LEAFLET MAP OVERRIDES ============================ */
.leaflet-container {
  border-radius: 14px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
}
.map-wrap { position: relative; height: 380px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 1.5rem; background: #1A2E25; }
.map-wrap.small { height: 260px; }
.map-controls {
  position: absolute; top: 1rem; right: 1rem; left: 1rem;
  z-index: 1000;
}
.map-controls input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: rgba(10, 15, 13, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--sand);
  font-family: inherit;
}
.search-results {
  background: rgba(10, 15, 13, 0.95);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 0.35rem;
  max-height: 200px;
  overflow-y: auto;
}
.search-result-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(212,175,55,0.08); }
.map-coords {
  padding: 0.5rem 0.75rem;
  background: rgba(14, 110, 78, 0.15);
  border: 1px solid rgba(14, 110, 78, 0.3);
  border-radius: 8px;
  font-size: 0.8rem;
  margin-top: -1rem;
  margin-bottom: 1rem;
  color: var(--green-light);
}

/* Aqar.fm-style listings */
.aqar-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.aqar-header h3 { font-size: 1.1rem; color: var(--gold); }
.aqar-link-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; padding: 0.5rem 0.85rem;
}
.aqar-card {
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}
.aqar-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.aqar-card.selected { border-color: var(--gold); background: rgba(212, 175, 55, 0.08); }
.aqar-img {
  height: 140px;
  background-size: cover; background-position: center;
  position: relative;
}
.aqar-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,15,13,0.85));
}
.aqar-badge {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(212,175,55,0.9); color: #0A0F0D;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem; font-weight: 700;
  z-index: 1;
}
.aqar-info { padding: 0.85rem; }
.aqar-info h4 { margin-bottom: 0.25rem; font-size: 0.95rem; }
.aqar-info p { font-size: 0.8rem; opacity: 0.7; margin-bottom: 0.5rem; line-height: 1.4; }
.aqar-meta { display: flex; gap: 0.75rem; font-size: 0.75rem; opacity: 0.7; margin-bottom: 0.6rem; }
.aqar-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0.85rem;
  border-top: 1px solid var(--border);
}
.aqar-price { color: var(--gold); font-weight: 700; font-family: system-ui; font-size: 1rem; }
.aqar-fm-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; color: var(--gold-light);
  text-decoration: none; opacity: 0.8;
  transition: opacity 0.2s;
}
.aqar-fm-link:hover { opacity: 1; }

/* ============================ INTERIOR WALKTHROUGH ============================ */
.interior-viewer-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  background: #0A0F0D;
}
.interior-viewer {
  width: 100%;
  height: 420px;
  display: block;
}
.interior-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 15, 13, 0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: opacity 0.3s;
}
.interior-overlay.hidden { opacity: 0; pointer-events: none; }
.interior-start-hint {
  text-align: center; color: var(--sand);
}
.interior-start-hint svg {
  margin-bottom: 1rem; opacity: 0.8;
}
.interior-start-hint p {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem;
}
.interior-start-hint small { opacity: 0.6; }
.interior-controls-hint {
  position: absolute; bottom: 1rem; left: 50%;
  transform: translateX(-50%);
  background: rgba(10,15,13,0.8);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--sand); opacity: 0.8;
  white-space: nowrap;
  z-index: 10;
}
.interior-controls-hint kbd {
  background: rgba(212,175,55,0.15);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-family: system-ui;
  font-size: 0.7rem;
}
.floorplan-mini-wrap { margin-top: 0.5rem; }

/* ============================ PRODUCT IMAGE (replaced emoji) ============================ */
.product-img {
  height: 160px;
  background: #1A2E25;
  overflow: hidden;
}
.product-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.product-card:hover .product-img img { transform: scale(1.05); }
.product-store-link {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  color: var(--gold);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-top: 1px solid var(--border);
  opacity: 0.7;
  transition: opacity 0.2s;
}
.product-store-link:hover { opacity: 1; }

/* ============================ BUILDING MATERIALS STEP ============================ */
.materials-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.mat-summary-card {
  padding: 1rem;
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.mat-summary-card .mat-cat-name { font-size: 0.8rem; opacity: 0.7; margin-bottom: 0.5rem; }
.mat-summary-card .mat-cat-total { color: var(--gold); font-weight: 700; font-family: system-ui; font-size: 1rem; }
.mat-category-section { margin-bottom: 2rem; }
.mat-category-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 700; color: var(--gold);
}
.mat-items-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.mat-item-card {
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  display: grid; grid-template-columns: 90px 1fr;
  transition: border-color 0.2s;
  cursor: pointer;
}
.mat-item-card:hover { border-color: var(--gold); }

/* ════════════════════════════════════════════════════════════════════
   AI GALLERY (STEP 3) — magazine-style photoreal showcase
   ════════════════════════════════════════════════════════════════════ */
.ai-gallery {
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0c1512 0%, #131e19 100%);
  overflow: hidden;
}
.ai-gallery.hidden { display: none; }

/* ─── HERO IMAGE ─── */
.ai-hero {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: #0a0a0a;
}
.ai-hero-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s ease;
  animation: kenBurns 22s ease-in-out infinite alternate;
}
.ai-hero-img.loaded { opacity: 1; }
@keyframes kenBurns {
  0%   { transform: scale(1.00) translate(0, 0); }
  50%  { transform: scale(1.08) translate(-1.2%, -0.8%); }
  100% { transform: scale(1.12) translate(1%, 0.6%); }
}

/* Subtle grain texture over hero for cinematic feel */
.ai-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 120%, transparent 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 1;
}

.ai-hero-overlay {
  position: absolute; inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.5rem 1.8rem;
  gap: 1rem;
  z-index: 2;
  pointer-events: none;
}
.ai-hero-meta { pointer-events: auto; max-width: 60%; }
.ai-hero-actions { pointer-events: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

.ai-badge {
  display: inline-block;
  background: linear-gradient(135deg, #C9A96E 0%, #E5C896 100%);
  color: #1a1a1a;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
  box-shadow: 0 4px 14px rgba(201,169,110,0.3);
}
.ai-hero-title {
  color: #F5F1E8;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.25rem 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}
.ai-hero-sub {
  color: rgba(245,241,232,0.82);
  font-size: 0.88rem;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.ai-hero-btn {
  background: rgba(14,24,21,0.75);
  color: #F5F1E8;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}
.ai-hero-btn:hover { background: rgba(14,24,21,0.95); border-color: var(--gold); }
.ai-hero-btn.accent {
  background: linear-gradient(135deg, #0E6E4E 0%, #14A068 100%);
  border-color: transparent;
  color: white;
}
.ai-hero-btn.accent:hover { filter: brightness(1.1); }

/* ─── PLACEHOLDER (when no image generated yet) ─── */
.ai-hero-img.placeholder {
  opacity: 1;
  animation: placeholderShimmer 3s ease-in-out infinite;
  background: linear-gradient(135deg, #1a2e25 0%, #2d4a3e 45%, #1a2e25 100%);
}
.ai-hero-img.placeholder::before {
  content: '✨';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  opacity: 0.15;
}
@keyframes placeholderShimmer {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.2); }
}

/* ─── THUMBNAIL STRIP ─── */
.ai-thumbs {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  background: rgba(10,16,13,0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
  flex: 0 0 auto;
  scrollbar-width: thin;
}
.ai-thumbs::-webkit-scrollbar { height: 6px; }
.ai-thumbs::-webkit-scrollbar-thumb { background: rgba(201,169,110,0.4); border-radius: 3px; }

.ai-thumb {
  flex: 0 0 auto;
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.ai-thumb:hover { background: rgba(255,255,255,0.04); }
.ai-thumb.active {
  border-color: var(--gold);
  background: rgba(201,169,110,0.08);
}
.ai-thumb-img {
  width: 100%;
  height: 64px;
  border-radius: 7px;
  background-size: cover;
  background-position: center;
  background-color: #1a2e25;
  position: relative;
  overflow: hidden;
}
.ai-thumb-img:not([style*="url"])::before {
  content: attr(data-room);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  opacity: 0.5;
}
.ai-thumb-img[data-room="exterior"]:not([style*="url"])::before { content: '🏠'; }
.ai-thumb-img[data-room="majlis"]:not([style*="url"])::before { content: '🛋'; }
.ai-thumb-img[data-room="living"]:not([style*="url"])::before { content: '🛋'; }
.ai-thumb-img[data-room="kitchen"]:not([style*="url"])::before { content: '🍽'; }
.ai-thumb-img[data-room="bedroom"]:not([style*="url"])::before { content: '🛏'; }
.ai-thumb-img[data-room="bathroom"]:not([style*="url"])::before { content: '🛁'; }
.ai-thumb span {
  color: rgba(245,241,232,0.82);
  font-size: 0.75rem;
  font-weight: 600;
}
.ai-thumb.active span { color: var(--gold); }
.ai-thumb.generating .ai-thumb-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: thumbShimmer 1.4s linear infinite;
}
@keyframes thumbShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ════════════════════════════════════════════════════════════════════
   CINEMATIC BUILD VIDEO — overlay on top of gallery
   ════════════════════════════════════════════════════════════════════ */
.build-cinematic {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #000;
  overflow: hidden;
  display: none;
}
.build-cinematic.active { display: flex; flex-direction: column; }

.bc-video-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.75) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}
.bc-video-label {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  letter-spacing: 0.02em;
}

.bc-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4rem;
}
.bc-stage.visible { opacity: 1; }
.bc-label {
  background: rgba(14,24,21,0.78);
  backdrop-filter: blur(12px);
  color: #F5F1E8;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.1rem;
  border: 1px solid rgba(201,169,110,0.3);
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
  animation: bcLabelIn 0.6s ease both;
}
@keyframes bcLabelIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Stage 0: empty land (desert + sky) */
.bc-stage[data-stage="0"] {
  background:
    linear-gradient(180deg, #f7d9a8 0%, #f2c88a 35%, #d9a56e 55%, #c8935a 100%);
}
.bc-stage[data-stage="0"]::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(0,0,0,0.15), transparent 60%);
}

/* Stage 1: foundation (concrete slab on land) */
.bc-stage[data-stage="1"] {
  background: linear-gradient(180deg, #f7d9a8 0%, #d9a56e 55%, #c8935a 100%);
}
.bc-stage[data-stage="1"]::before {
  content: ''; position: absolute; left: 18%; right: 18%; bottom: 30%; height: 12%;
  background: linear-gradient(180deg, #ddd8d0 0%, #9e9a92 100%);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Stage 2: walls/skeleton (gray boxes) */
.bc-stage[data-stage="2"] {
  background: linear-gradient(180deg, #e8c89a 0%, #c8935a 100%);
}
.bc-stage[data-stage="2"]::before {
  content: ''; position: absolute; left: 20%; right: 20%; bottom: 28%; height: 46%;
  background:
    linear-gradient(180deg, #d8d2c8 0%, #aaa29a 100%);
  border: 4px solid #8a8278;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* Stage 3: roof added */
.bc-stage[data-stage="3"] {
  background: linear-gradient(180deg, #f5c884 0%, #c8935a 100%);
}
.bc-stage[data-stage="3"]::before {
  content: ''; position: absolute; left: 18%; right: 18%; bottom: 72%; height: 8%;
  background: linear-gradient(180deg, #654321 0%, #3d2412 100%);
  clip-path: polygon(5% 100%, 95% 100%, 88% 0%, 12% 0%);
}
.bc-stage[data-stage="3"]::after {
  content: ''; position: absolute; left: 20%; right: 20%; bottom: 28%; height: 44%;
  background: linear-gradient(180deg, #ded8cd 0%, #b5ab9c 100%);
  border: 3px solid #8a8278;
}

/* Stage 4: windows */
.bc-stage[data-stage="4"] {
  background: linear-gradient(180deg, #f2b56e 0%, #b8834a 100%);
}
.bc-stage[data-stage="4"]::before {
  content: ''; position: absolute; left: 18%; right: 18%; bottom: 68%; height: 10%;
  background: linear-gradient(180deg, #5a3a1e 0%, #3d2412 100%);
  clip-path: polygon(5% 100%, 95% 100%, 88% 0%, 12% 0%);
}
.bc-stage[data-stage="4"]::after {
  content: ''; position: absolute; left: 20%; right: 20%; bottom: 28%; height: 40%;
  background:
    /* Windows */
    radial-gradient(ellipse at 25% 35%, rgba(120,170,200,0.85) 0%, transparent 14%),
    radial-gradient(ellipse at 50% 35%, rgba(120,170,200,0.85) 0%, transparent 14%),
    radial-gradient(ellipse at 75% 35%, rgba(120,170,200,0.85) 0%, transparent 14%),
    radial-gradient(ellipse at 50% 75%, rgba(120,170,200,0.85) 0%, transparent 16%),
    linear-gradient(180deg, #e8ddc8 0%, #b5a892 100%);
  border: 3px solid #7a6a52;
}

/* Stage 5: exterior finish (Najdi sand-plaster + decorative crenellation) */
.bc-stage[data-stage="5"] {
  background: linear-gradient(180deg, #e8a460 0%, #995a2a 100%);
}
.bc-stage[data-stage="5"]::before {
  content: ''; position: absolute; left: 18%; right: 18%; bottom: 68%; height: 10%;
  background: linear-gradient(180deg, #3e2a16 0%, #2a1a08 100%);
  clip-path: polygon(5% 100%, 95% 100%, 88% 0%, 12% 0%, 15% 30%, 25% 10%, 35% 30%, 45% 10%, 55% 30%, 65% 10%, 75% 30%, 85% 10%);
}
.bc-stage[data-stage="5"]::after {
  content: ''; position: absolute; left: 20%; right: 20%; bottom: 28%; height: 40%;
  background:
    radial-gradient(ellipse at 25% 35%, rgba(255,220,150,0.95) 0%, transparent 14%),
    radial-gradient(ellipse at 50% 35%, rgba(255,220,150,0.95) 0%, transparent 14%),
    radial-gradient(ellipse at 75% 35%, rgba(255,220,150,0.95) 0%, transparent 14%),
    radial-gradient(ellipse at 50% 75%, rgba(255,220,150,0.95) 0%, transparent 16%),
    linear-gradient(180deg, #d6a878 0%, #a67c4a 100%);
  border: 3px solid #6a4a28;
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}

/* Stage 6: landscaping — palms & pool */
.bc-stage[data-stage="6"] {
  background: linear-gradient(180deg, #d88644 0%, #724020 100%);
}
.bc-stage[data-stage="6"]::before {
  content: '🌴🌴'; position: absolute; left: 6%; bottom: 18%;
  font-size: 3.5rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5));
}
.bc-stage[data-stage="6"]::after {
  content: ''; position: absolute; left: 20%; right: 20%; bottom: 28%; height: 42%;
  background:
    radial-gradient(ellipse at 25% 35%, rgba(255,230,170,0.98) 0%, transparent 14%),
    radial-gradient(ellipse at 50% 35%, rgba(255,230,170,0.98) 0%, transparent 14%),
    radial-gradient(ellipse at 75% 35%, rgba(255,230,170,0.98) 0%, transparent 14%),
    radial-gradient(ellipse at 50% 75%, rgba(255,230,170,0.98) 0%, transparent 16%),
    linear-gradient(180deg, #d8a878 0%, #a67c4a 100%);
  border: 3px solid #6a4a28;
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}

/* Stage 7: final — golden hour cinematic */
.bc-stage[data-stage="7"] {
  background: linear-gradient(180deg,
    #ff9060 0%,
    #f27845 28%,
    #b84620 65%,
    #5a2812 100%);
}
.bc-stage[data-stage="7"]::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 25%, rgba(255,220,120,0.9) 0%, transparent 18%),
    radial-gradient(circle at 50% 140%, rgba(14,24,21,0.8) 0%, transparent 50%);
}
.bc-stage[data-stage="7"]::after {
  content: ''; position: absolute; left: 15%; right: 15%; bottom: 25%; height: 48%;
  background:
    radial-gradient(ellipse at 25% 30%, rgba(255,200,110,1) 0%, transparent 14%),
    radial-gradient(ellipse at 50% 30%, rgba(255,200,110,1) 0%, transparent 14%),
    radial-gradient(ellipse at 75% 30%, rgba(255,200,110,1) 0%, transparent 14%),
    radial-gradient(ellipse at 50% 72%, rgba(255,200,110,1) 0%, transparent 16%),
    linear-gradient(180deg, #d88858 0%, #7a4820 100%);
  border: 3px solid #3e2410;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 80px rgba(255,180,80,0.35);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 90% 100%, 90% -4%, 80% -4%, 80% 100%, 70% 100%, 70% -4%, 60% -4%, 60% 100%, 50% 100%, 50% -4%, 40% -4%, 40% 100%, 30% 100%, 30% -4%, 20% -4%, 20% 100%, 10% 100%, 10% -4%, 0 -4%);
}

.bc-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.1);
  z-index: 3;
}
.bc-bar {
  height: 100%;
  background: linear-gradient(90deg, #C9A96E 0%, #F5E6B8 100%);
  width: 0%;
  transition: width 0.5s ease;
  box-shadow: 0 0 12px rgba(245,230,184,0.6);
}

.bc-skip {
  position: absolute;
  top: 1rem; left: 1rem;
  background: rgba(14,24,21,0.75);
  color: #F5F1E8;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  z-index: 4;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
}
.bc-skip:hover { background: rgba(14,24,21,0.95); border-color: var(--gold); }

/* ─── Cinematic waiting screen ─── */
.bc-waiting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: radial-gradient(ellipse at center, #0d1f18 0%, #060e0a 100%);
  z-index: 5;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  direction: rtl;
}
.bc-waiting-anim {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 0.5rem;
}
.bc-waiting-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--gold);
  border-right-color: rgba(212,175,55,0.3);
  animation: spin 1.4s linear infinite;
}
.bc-waiting-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: bcIconPulse 2s ease-in-out infinite;
}
@keyframes bcIconPulse {
  0%,100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.15); opacity: 0.7; }
}
.bc-waiting-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f0ebe0;
  text-align: center;
}
.bc-waiting-sub {
  font-size: 0.82rem;
  color: rgba(240,235,224,0.55);
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}
.bc-waiting-pct {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: -0.4rem;
}

/* ─── AI video generation badge ─── */
.bc-ai-badge {
  position: absolute;
  bottom: 3.8rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(10, 18, 30, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 24px;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  color: #f0ebe0;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  backdrop-filter: blur(6px);
  z-index: 25;
  transition: opacity 0.3s;
  direction: rtl;
}
.bc-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bc-badge-dot.spinning {
  background: var(--gold);
  animation: badgePulse 1.2s ease-in-out infinite;
}
.bc-badge-dot.done {
  background: #4ade80;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.4; transform: scale(0.75); }
}
.bc-badge-btn {
  background: var(--gold);
  color: #1a1a0a;
  border: none;
  border-radius: 14px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}
.bc-badge-btn:hover { opacity: 0.85; }

/* ─── secondary ai-gen button ─── */
.btn-ai-gen.secondary {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  margin-top: 0.5rem;
}
.btn-ai-gen.secondary:hover {
  background: rgba(201,169,110,0.08);
}

/* ────────── hidden utility ────────── */
.hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════════════
   PHOTO-UPLOAD ROOM-EDIT (step 6 addition)
   ════════════════════════════════════════════════════════════════════ */
.photo-edit-card {
  background: linear-gradient(135deg, rgba(14,24,21,0.6), rgba(26,46,37,0.4));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  margin-top: 1rem;
}
.photo-edit-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.photo-drop {
  border: 2px dashed rgba(201,169,110,0.35);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(14,24,21,0.35);
}
.photo-drop:hover, .photo-drop.dragover {
  border-color: var(--gold);
  background: rgba(201,169,110,0.06);
}
.photo-drop input[type="file"] { display: none; }
.photo-drop-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.6; }
.photo-drop-text { font-size: 0.88rem; color: rgba(245,241,232,0.75); }

.photo-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.photo-preview {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #0a0a0a;
  position: relative;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview-label {
  position: absolute; bottom: 0.4rem; left: 0.4rem;
  background: rgba(14,24,21,0.85);
  color: #F5F1E8;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  backdrop-filter: blur(6px);
}
.photo-edit-prompt {
  width: 100%;
  margin-top: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: rgba(14,24,21,0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 60px;
}
.photo-edit-prompt:focus { outline: none; border-color: var(--gold); }
.photo-edit-btn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #C9A96E 0%, #E5C896 100%);
  color: #1a1a1a;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.2s;
}
.photo-edit-btn:hover { filter: brightness(1.08); }
.photo-edit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.dim-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%);
}
.dim-badge {
  background: linear-gradient(135deg, rgba(201,169,110,0.95), rgba(229,200,150,0.95));
  color: #1a1a1a;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ════════════════════════════════════════════════════════════════════
   CINEMATIC HERO (landing)
   ════════════════════════════════════════════════════════════════════ */
.hero-cinematic {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}
/* بريق ذهبي خفيف في أسفل اليسار — يعطي دفئاً ملكياً */
.hero-cinematic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 90%,
    rgba(201,169,110,0.18) 0%,
    transparent 55%);
  z-index: 2;
  pointer-events: none;
}
.hero-cinematic::after {
  content: '';
  position: absolute; inset: 0;
  /* تدرج عمودي: شفاف في المنتصف، داكن في الأطراف — يُظهر الصورة بالكامل */
  background:
    linear-gradient(180deg,
      rgba(8,12,10,0.55) 0%,
      rgba(8,12,10,0.15) 35%,
      rgba(8,12,10,0.10) 55%,
      rgba(8,12,10,0.80) 100%);
}
.hero-cine-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: heroFade 24s infinite, kenBurnsHero 24s infinite;
  will-change: transform, opacity;
}
@keyframes kenBurnsHero {
  0%   { transform: scale(1.00) translate( 0%,    0%  ); }
  25%  { transform: scale(1.08) translate(-1.5%, -1%  ); }
  50%  { transform: scale(1.16) translate( 0.5%, -0.5%); }
  75%  { transform: scale(1.20) translate( 1.5%,  0.5%); }
  100% { transform: scale(1.24) translate( 0%,    1%  ); }
}
/* ── فيلا فاخرة مع infinity pool ليلي — أكثر صورة سينمائية ── */
.hero-cine-slide:nth-child(1) {
  animation-delay: 0s;
  background-image: url('https://images.unsplash.com/photo-1600566753086-00f18fb6b3ea?auto=format&fit=crop&w=1920&q=90');
  background-size: cover;
  background-position: center 60%;
}
/* ── قصر عصري — غروب ذهبي وإضاءة دافئة ── */
.hero-cine-slide:nth-child(2) {
  animation-delay: 8s;
  background-image: url('https://images.unsplash.com/photo-1564501049412-61c2a3083791?auto=format&fit=crop&w=1920&q=90');
  background-size: cover;
  background-position: center 45%;
}
/* ── فيلا منزلية فاخرة — زاوية سينمائية ── */
.hero-cine-slide:nth-child(3) {
  animation-delay: 16s;
  background-image: url('https://images.unsplash.com/photo-1580587771525-78b9dba3b914?auto=format&fit=crop&w=1920&q=90');
  background-size: cover;
  background-position: center 50%;
}

@keyframes heroFade {
  0%, 28%   { opacity: 1; }
  35%, 100% { opacity: 0; }
}
.mat-item-card.checked { border-color: var(--green-light); background: rgba(14, 110, 78, 0.08); }
.mat-item-img { width: 90px; height: 90px; object-fit: cover; display: block; }
.mat-item-info { padding: 0.65rem; display: flex; flex-direction: column; justify-content: space-between; }
.mat-item-brand { font-size: 0.65rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.mat-item-name { font-size: 0.85rem; font-weight: 600; line-height: 1.3; margin: 0.2rem 0; }
.mat-item-qty { font-size: 0.75rem; opacity: 0.65; }
.mat-item-price { color: var(--gold); font-weight: 700; font-family: system-ui; font-size: 0.9rem; }
.mat-check-row {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem; cursor: pointer;
}

/* ============================ COST BREAKDOWN STEP ============================ */
.cost-breakdown {
  display: grid; gap: 1rem; margin-bottom: 2rem;
}
.cost-section {
  background: rgba(26, 46, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.cost-section-header {
  display: flex; justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.cost-section-header .section-total { color: var(--gold); font-family: system-ui; }
.cost-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.9rem;
}
.cost-line:last-child { border-bottom: none; }
.cost-line .line-val { font-family: system-ui; color: var(--sand); opacity: 0.9; }
.cost-total-box {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(14, 110, 78, 0.2), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 14px;
}
.cost-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1.2rem; font-weight: 700;
}
.cost-grand-total {
  color: var(--gold); font-family: system-ui; font-size: 1.5rem;
}
.cost-note {
  margin-top: 0.75rem; font-size: 0.75rem; opacity: 0.5;
}

/* ════════════════════════════════════════════════════════════════════
   PHOTO UPLOAD "ADD A ROOM HERE" — before/after card
   ════════════════════════════════════════════════════════════════════ */
.photo-edit-head { margin-bottom: 1rem; }
.photo-edit-head h3 {
  margin: 0 0 0.3rem; font-size: 1.1rem; color: var(--gold); font-weight: 800;
}
.photo-edit-head p {
  margin: 0; font-size: 0.82rem; color: rgba(245,241,232,0.7); line-height: 1.55;
}
.photo-drop-inner {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.photo-icon { font-size: 2.5rem; opacity: 0.75; }
.photo-cta  { font-size: 0.95rem; font-weight: 600; color: var(--cream); }
.photo-hint { font-size: 0.72rem; opacity: 0.5; }
.photo-drop.has-file .photo-drop-inner { display: none; }
.photo-drop.has-file {
  padding: 0;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  border-style: solid;
  border-color: var(--gold);
}

.photo-prompt-input {
  width: 100%; margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  background: rgba(14,24,21,0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--cream); font-family: inherit; font-size: 0.92rem;
  direction: rtl;
}
.photo-prompt-input:focus { outline: none; border-color: var(--gold); }

.photo-actions {
  display: flex; gap: 0.8rem; align-items: center;
  margin-top: 0.8rem; flex-wrap: wrap;
}
.ref-width {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: rgba(245,241,232,0.7);
}
.ref-width input {
  width: 80px; padding: 0.4rem 0.5rem;
  background: rgba(14,24,21,0.55);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cream); font-family: system-ui;
}
.btn-generate-photo {
  flex: 1; min-width: 200px;
  padding: 0.85rem 1.2rem;
  background: linear-gradient(135deg, #C9A96E 0%, #E5C896 100%);
  color: #1a1a1a;
  border: none; border-radius: 10px;
  font-weight: 800; font-family: inherit; font-size: 0.95rem;
  cursor: pointer; transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(201,169,110,0.25);
}
.btn-generate-photo:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(201,169,110,0.40);
}
.btn-generate-photo:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-generate-photo.loading::after {
  content: ' ⏳'; animation: spin 1.2s linear infinite; display: inline-block;
}

.photo-result { margin-top: 1.2rem; }
.photo-result.hidden { display: none; }
.photo-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem;
}
.photo-compare figure {
  margin: 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: #0a0a0a;
  position: relative; aspect-ratio: 4/3;
}
.photo-compare img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.photo-compare figcaption {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(14,24,21,0.88); color: var(--gold);
  padding: 0.25rem 0.7rem; border-radius: 6px;
  font-size: 0.75rem; font-weight: 700; z-index: 2;
  backdrop-filter: blur(6px);
}
.photo-compare figure:nth-child(2) figcaption {
  background: linear-gradient(135deg, #C9A96E, #E5C896); color: #1a1a1a;
}
.photo-measurements {
  display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap;
}
.photo-measurements .meas-chip {
  padding: 0.45rem 0.9rem;
  background: rgba(201,169,110,0.12);
  border: 1px solid rgba(201,169,110,0.35);
  border-radius: 999px;
  font-size: 0.82rem; color: var(--gold); font-weight: 600;
  font-family: system-ui;
}
.photo-measurements .meas-chip strong { color: var(--cream); margin-inline-start: 0.3rem; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .photo-compare { grid-template-columns: 1fr; }
  .photo-actions { flex-direction: column; align-items: stretch; }
}

/* ════════════════════════════════════════════ */
/* Architect Brain Panel (Phase 6)              */
/* ════════════════════════════════════════════ */
.ab-loading {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--cream);
  opacity: 0.85;
}
.ab-loading small {
  display: block;
  margin-top: 0.5rem;
  opacity: 0.6;
  font-size: 0.78rem;
}
.ab-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(201,169,110,0.18);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}
.ab-content { padding: 0; }
.ab-content.hidden { display: none; }

.ab-summary {
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(201,169,110,0.08), rgba(201,169,110,0.02));
  border: 1px solid rgba(201,169,110,0.22);
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--cream);
  margin-bottom: 1rem;
}

.ab-section {
  margin-bottom: 0.7rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: rgba(20,32,28,0.55);
  overflow: hidden;
}
.ab-section[open] {
  border-color: rgba(201,169,110,0.28);
  background: rgba(20,32,28,0.85);
}
.ab-section summary {
  padding: 0.7rem 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}
.ab-section summary::-webkit-details-marker { display: none; }
.ab-section summary h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 700;
}
.ab-section summary::after {
  content: '⌃';
  font-family: monospace;
  color: var(--gold);
  transition: transform 0.2s;
  margin-inline-start: auto;
}
.ab-section[open] summary::after { transform: rotate(180deg); }
.ab-count {
  display: inline-block;
  background: rgba(201,169,110,0.22);
  color: var(--gold);
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  margin-inline-start: 0.5rem;
  font-weight: 700;
}

/* Rules grid */
.ab-rules {
  display: grid;
  gap: 0.55rem;
  padding: 0 1rem 1rem;
}
.ab-rule {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.6rem 0.7rem;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border-inline-start: 3px solid var(--gold);
}
.ab-rule-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #1a1a1a;
  background: linear-gradient(135deg, #E5C896, #C9A96E);
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  align-self: start;
}
.ab-rule-text {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--cream);
}
.ab-rule-text strong {
  display: block;
  color: var(--gold);
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
}

/* Modern features / optimizations list */
.ab-list {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 0.5rem;
}
.ab-item {
  padding: 0.55rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border-inline-start: 3px solid #4ade80;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--cream);
}
.ab-item strong {
  display: block;
  color: #4ade80;
  margin-bottom: 0.2rem;
}
.ab-item.opt { border-inline-start-color: #60a5fa; }
.ab-item.opt strong { color: #60a5fa; }

/* Upgrades with cost */
.ab-upgrades {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 0.55rem;
}
.ab-upgrade {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,169,110,0.18);
  border-radius: 6px;
}
.ab-upgrade-info { font-size: 0.82rem; line-height: 1.55; color: var(--cream); }
.ab-upgrade-info strong { display: block; color: var(--gold); margin-bottom: 0.2rem; }
.ab-upgrade-cost {
  font-family: system-ui;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--gold);
  background: rgba(201,169,110,0.12);
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  align-self: center;
}

/* Action buttons */
.ab-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  margin-top: 1rem;
}
.ab-btn {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(201,169,110,0.32);
  border-radius: 8px;
  background: rgba(20,32,28,0.7);
  color: var(--cream);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s;
}
.ab-btn:hover {
  background: rgba(201,169,110,0.14);
  border-color: var(--gold);
}
.ab-btn.primary {
  background: linear-gradient(135deg, #C9A96E, #E5C896);
  color: #1a1a1a;
  border-color: transparent;
}
.ab-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(201,169,110,0.35); }

.ab-footer {
  display: block;
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(201,169,110,0.18);
  font-size: 0.72rem;
  color: var(--cream);
  opacity: 0.55;
  line-height: 1.6;
  text-align: center;
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  PRODUCTION RESPONSIVE FIXES (Phase 1.6)                                    */
/*  Ensures the platform works smoothly on:                                    */
/*  - Mobile portrait      (<= 480px)  — iPhone SE, Galaxy A series           */
/*  - Mobile landscape     (<= 768px, max-height 500px)                       */
/*  - Tablet portrait      (<= 1024px) — iPad mini/air                        */
/*  - Tablet landscape     (<= 1280px)                                        */
/*  - Desktop              (> 1280px)                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* --- Touch target floor: all buttons ≥ 44×44px on touch devices ----------- */
@media (hover: none) and (pointer: coarse) {
  button, .btn-primary, .btn-ghost, .btn-demo-hero,
  .ai-hero-btn, .ab-btn, .vc-btn, .icon-btn, .auth-tab,
  .ai-thumb, .dtab {
    min-height: 44px;
    min-width: 44px;
  }
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], select, textarea {
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}

/* --- Tablet & below (≤ 1024px) -------------------------------------------- */
@media (max-width: 1024px) {
  .container { padding: 0 1.25rem; }
  .design-step { grid-template-columns: 1fr !important; gap: 1rem; }
  .ai-hero-meta { max-width: 100% !important; }
  .ai-hero-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  .ai-hero-btn { flex: 1 1 calc(50% - 0.5rem); justify-content: center; }
  .viewer-3d, .ai-gallery { min-height: 320px; }
  .build-cinematic { aspect-ratio: 16 / 10; }
}

/* --- Mobile (≤ 768px) ----------------------------------------------------- */
@media (max-width: 768px) {
  body { font-size: 15px; }
  .container { padding: 0 1rem; }

  /* Wizard chrome */
  .wizard-overlay { padding: 0; }
  .wizard-header { padding: 0.75rem 1rem; }
  .wizard-body { padding: 1rem; padding-bottom: 5rem; }
  .wizard-footer {
    position: sticky; bottom: 0;
    padding: 0.75rem 1rem;
    background: rgba(8,12,18,0.95);
    backdrop-filter: blur(12px);
    display: flex; gap: 0.6rem;
  }
  .wizard-footer button { flex: 1; padding: 0.85rem; font-size: 0.95rem; }

  /* Step headings & form */
  .step-wrap { padding: 0.5rem 0; }
  .step-wrap h2 { font-size: 1.4rem !important; }
  .step-wrap p { font-size: 0.9rem !important; }
  .land-inputs, .search-filters,
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }

  /* Map */
  #map-canvas { min-height: 280px; }

  /* Choice cards */
  .choice-grid { grid-template-columns: 1fr !important; gap: 0.75rem; }

  /* Hero actions: stack 2 cols, then 1 on smallest */
  .ai-hero-btn { flex-basis: calc(50% - 0.4rem); font-size: 0.82rem; padding: 0.6rem 0.7rem; }

  /* Architect panel */
  .ab-content { padding: 0.75rem !important; }
  .ab-rule { grid-template-columns: 1fr !important; gap: 0.4rem; }
  .ab-rule-id { width: fit-content; }
  .ab-upgrade { flex-direction: column !important; align-items: flex-start; gap: 0.4rem; }
  .ab-upgrade-cost { align-self: flex-end; }

  /* 3D viewer controls */
  .viewer-controls {
    flex-wrap: wrap; gap: 0.4rem;
    padding: 0.6rem;
  }
  .vc-btn { font-size: 0.78rem; padding: 0.5rem 0.7rem; }

  /* Cinematic overlay */
  .build-cinematic { border-radius: 12px; }
  .bc-skip {
    bottom: 0.7rem; left: 0.7rem;
    font-size: 0.78rem; padding: 0.5rem 0.85rem;
  }

  /* Auth modal: full screen on mobile */
  .auth-overlay .auth-modal {
    width: 100% !important; max-width: 100% !important;
    max-height: 100vh !important; min-height: 100vh;
    border-radius: 0 !important;
  }
  .auth-form { gap: 0.75rem; }

  /* Photo modify */
  .photo-compare { grid-template-columns: 1fr !important; }
  .photo-prompt-input { width: 100% !important; }

  /* Tabs */
  .dtabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dtab { flex-shrink: 0; }

  /* Thumbnails strip → horizontal scroll */
  .ai-thumbs {
    overflow-x: auto; flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.4rem;
  }
  .ai-thumb {
    flex-shrink: 0; min-width: 110px;
    scroll-snap-align: start;
  }

  /* Cost summary cards */
  .cost-grid { grid-template-columns: 1fr !important; }
  .summary-cards { grid-template-columns: 1fr !important; }
}

/* --- Mobile portrait small (≤ 480px) -------------------------------------- */
@media (max-width: 480px) {
  .ai-hero-btn { flex-basis: 100%; }
  .step-wrap h2 { font-size: 1.2rem !important; }
  .nav { padding: 0.5rem 0.75rem !important; }
  .logo-text { font-size: 1rem !important; }
  .hero h1 { font-size: 1.8rem !important; line-height: 1.3; }
  .hero .sub { font-size: 0.95rem !important; }
  .step-counter { font-size: 0.8rem; }
  /* Hide eyebrow text on tiny screens to save space */
  .ai-hero-sub { display: none; }
}

/* --- Mobile landscape (low height) ---------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 100vh; padding: 1rem; }
  .build-cinematic { aspect-ratio: 16 / 9; max-height: 80vh; }
  .wizard-body { padding-bottom: 1rem; }
  .wizard-footer { position: relative; }
}

/* --- Reduced motion: respect user preference ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Print: hide noisy chrome (in case user prints summary) -------------- */
@media print {
  .nav, .wizard-footer, .ai-hero-actions, .vc-btn,
  .bc-skip, .ab-actions, .auth-overlay, .video-overlay {
    display: none !important;
  }
  body { background: white; color: black; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Mobile UI overlap fixes (Phase 11 — post-launch)                           */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Auth-error info variant (informational, not red) */
.auth-error.auth-info {
  background: rgba(52, 211, 153, 0.10);
  border-color: rgba(52, 211, 153, 0.45);
  color: #34d399;
}
.auth-error.auth-info strong { color: var(--gold, #FFBF47); }

/* Wizard top-bar tabs (التكلفة، المواد، …) — horizontal scroll on small screens */
@media (max-width: 768px) {
  .wizard-header,
  .wizard-progress,
  .step-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    white-space: nowrap;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .wizard-header::-webkit-scrollbar,
  .step-tabs::-webkit-scrollbar { display: none; }
  .wizard-header > *,
  .step-tabs > * {
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  /* Auth modal — give breathing room and prevent input clipping */
  .auth-modal { padding: 1.25rem 1rem !important; }
  .auth-form label { font-size: 0.92rem; line-height: 1.4; }
  .auth-form input {
    font-size: 16px !important;
    padding: 0.75rem 0.85rem !important;
    width: 100% !important;
  }
  .auth-error,
  .auth-info {
    word-wrap: break-word;
    overflow-wrap: anywhere;
    line-height: 1.6;
    padding: 0.75rem 0.9rem !important;
  }
  .auth-tab {
    flex: 1;
    min-width: 0;       /* let tabs share width without overflow */
    font-size: 0.9rem;
    padding: 0.7rem 0.5rem;
  }

  /* Step counter ("3/9") — keep on its own line */
  .step-counter { white-space: nowrap; padding: 0.25rem 0.5rem; }

  /* Wizard form labels — prevent stacked inputs from overlapping */
  .wizard-body label {
    display: block;
    margin-bottom: 0.85rem;
  }
  .wizard-body label > input,
  .wizard-body label > select {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
  }
}

@media (max-width: 480px) {
  /* Tighter padding on very small screens */
  .wizard-body { padding: 0.75rem !important; }
  .auth-modal { padding: 1rem 0.85rem !important; }
  .auth-form { gap: 0.6rem !important; }
}

/* Quota-exhausted toast (used by app.js bunyan:rate-limited) */
.bunyan-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.95);
  color: var(--cream, #f4eddc);
  border: 1px solid rgba(255, 191, 71, 0.5);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  z-index: 99999;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: toast-pop 0.25s ease-out;
}
@keyframes toast-pop {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
