/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --warm-50: #fefdfb;
  --warm-100: #fdf8f0;
  --warm-200: #f5ede0;
  --warm-300: #e8dcc8;
  --warm-400: #d4c4a8;
  --warm-500: #b8a080;
  --warm-600: #8a7560;
  --warm-700: #5e4e3c;
  --warm-800: #3d3228;
  --warm-900: #1e1914;
  --gold: #c9953c;
  --gold-light: #e8c36a;
  --gold-dark: #a07428;
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --yellow: #eab308;
  --yellow-bg: #fefce8;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --blue: #3b82f6;
  --text: #1e1914;
  --text-secondary: #6b5d4f;
  --text-muted: #a09080;
  --bg: #fefdfb;
  --card-bg: #ffffff;
  --border: #e8dcc8;
  --shadow: 0 1px 3px rgba(30,25,20,0.08), 0 1px 2px rgba(30,25,20,0.06);
  --shadow-md: 0 4px 12px rgba(30,25,20,0.1), 0 2px 4px rgba(30,25,20,0.06);
  --shadow-lg: 0 10px 30px rgba(30,25,20,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── Landing Page (Public Homepage) ────────────────────────── */
.landing-page {
  min-height: 100vh;
}

.hero {
  position: relative;
  height: 340px;
  background: linear-gradient(135deg, #3d3228 0%, #5e4e3c 50%, #8a7560 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30,25,20,0.3);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  padding: 24px;
}

.hero-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 15px;
  opacity: 0.8;
  margin-bottom: 8px;
  font-weight: 300;
}

.hero-tagline {
  font-size: 17px;
  opacity: 0.9;
  font-weight: 400;
  margin-top: 12px;
}

.landing-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px;
}

/* Neighborhoods */
.neighborhoods-section {
  margin-bottom: 40px;
}

.section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 8px;
}

.section-heading-sm {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 12px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.neighborhood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.neighborhood-card {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.neighborhood-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.neighborhood-img {
  position: relative;
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: var(--warm-300);
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.neighborhood-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30,25,20,0.7) 0%, transparent 60%);
}

.neighborhood-name {
  position: relative;
  z-index: 1;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: white;
}

/* Direct login */
.landing-login-section {
  background: var(--warm-100);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 40px;
}

.direct-login-form {
  display: flex;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto;
}

.direct-login-form .form-input {
  flex: 1;
}

.direct-login-form .btn {
  white-space: nowrap;
  width: auto;
}

/* Footer */
.landing-footer {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: var(--warm-700);
  margin-bottom: 4px;
}

.footer-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-admin {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-admin:hover { color: var(--gold-dark); }

/* ─── Neighborhood Page ────────────────────────────────────── */
.neighborhood-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
}

.neighborhood-header {
  margin-bottom: 24px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  font-size: 16px;
}

.builds-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.build-list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.build-list-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.build-list-address {
  font-weight: 600;
  font-size: 16px;
  color: var(--warm-800);
  margin-bottom: 2px;
}

.build-list-owner {
  font-size: 14px;
  color: var(--text-muted);
}

.build-list-arrow {
  font-size: 20px;
  color: var(--gold);
  font-weight: 600;
}

/* ─── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--warm-100) 0%, var(--warm-50) 50%, #fff 100%);
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 4px;
}

.login-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: var(--warm-50);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,149,60,0.15);
}

.form-input::placeholder { color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
  width: 100%;
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(201,149,60,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--warm-100);
  color: var(--warm-700);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover { background: var(--warm-200); }

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  min-height: 36px;
}

.btn-help {
  background: var(--warm-100);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  width: 100%;
  margin-top: 8px;
}

.login-error {
  color: var(--red);
  font-size: 14px;
  margin-top: 12px;
  display: none;
}

/* ─── Build Home Page ──────────────────────────────────────── */
.build-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.build-header {
  padding: 24px 0 16px;
}

.build-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.build-welcome {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--warm-800);
}

.build-address {
  font-size: 14px;
  color: var(--text-muted);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.logout-btn:hover { background: var(--warm-100); color: var(--text-secondary); }

/* Elevation Image */
.elevation-section {
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.elevation-img {
  width: 100%;
  display: block;
  background: var(--warm-200);
}

/* Progress Bar */
.progress-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--warm-700);
}

.progress-pct {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-dark);
}

.progress-bar-wrap {
  height: 8px;
  background: var(--warm-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Urgency Alerts */
.urgency-alerts { margin-bottom: 16px; }

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-red {
  background: var(--red-bg);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-yellow {
  background: var(--yellow-bg);
  color: #92400e;
  border: 1px solid #fef08a;
}

.alert-green {
  background: var(--green-bg);
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-icon { font-size: 18px; flex-shrink: 0; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.alert-red .alert-icon { animation: pulse 1.5s ease infinite; }

/* Stalled Banner — impossible to miss */
.stalled-banner {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 2px solid #ef4444;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  animation: stalledPulse 2s ease infinite;
}

@keyframes stalledPulse {
  0%, 100% { border-color: #ef4444; }
  50% { border-color: #f87171; box-shadow: 0 0 20px rgba(239,68,68,0.15); }
}

.stalled-icon { font-size: 32px; flex-shrink: 0; }
.stalled-title { font-size: 18px; font-weight: 700; color: #991b1b; margin-bottom: 4px; }
.stalled-desc { font-size: 14px; color: #b91c1c; margin-bottom: 8px; }
.stalled-list { margin: 0; padding-left: 20px; font-size: 14px; color: #991b1b; }
.stalled-list li { margin-bottom: 4px; }
.stalled-cta { font-size: 13px; font-weight: 600; color: #dc2626; margin-top: 8px; }

/* Category card urgency states */
.category-card.card-stalled {
  border: 2px solid #ef4444;
  animation: stalledCard 2s ease infinite;
}
@keyframes stalledCard {
  0%, 100% { border-color: #ef4444; }
  50% { border-color: #f87171; box-shadow: 0 0 12px rgba(239,68,68,0.2); }
}

.category-card.card-urgent { border-color: #ef4444; }
.category-card.card-warning { border-color: #eab308; }

.category-card-status.stalled { color: #dc2626; font-weight: 700; }
.category-card-status.urgent { color: #dc2626; font-weight: 600; }
.category-card-status.warning { color: #ca8a04; font-weight: 600; }

/* Phase Groups */
.phase-group {
  margin-bottom: 28px;
}

.phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--warm-200);
}

.phase-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--warm-800);
}

.phase-progress {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-dark);
  background: var(--warm-100);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Category Grid */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 14px;
  padding-top: 8px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-card.card-confirmed {
  border-color: var(--green);
  opacity: 0.85;
}

.category-card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: var(--warm-200);
}

.category-card-body { padding: 12px; }

.category-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 4px;
  line-height: 1.3;
}

.category-card-status {
  font-size: 12px;
  color: var(--text-muted);
}

.category-card-status.confirmed {
  color: var(--green);
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-dot.green { background: var(--green); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.red { background: var(--red); }
.status-dot.gray { background: var(--text-muted); }

/* ─── Category Detail Page ────────────────────────────────── */
.category-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  padding: 8px 0;
  margin-bottom: 8px;
}

.back-link:hover { color: var(--gold-dark); }

.category-header { margin-bottom: 20px; }

.category-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 4px;
}

.category-desc {
  font-size: 14px;
  color: var(--text-muted);
}

.category-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.current-selection {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-sel-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.current-sel-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--warm-800);
}

.current-sel-status {
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
}

/* Options Grid */
.options-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--warm-700);
  margin-bottom: 12px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.option-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid var(--border);
  position: relative;
}

.option-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.option-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-md);
}

.option-card.confirmed {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green);
}

.option-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--warm-200);
}

.option-card-body { padding: 10px 12px; }

.option-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--warm-800);
  line-height: 1.3;
}

.option-card-tier {
  font-size: 11px;
  color: var(--gold-dark);
  margin-top: 2px;
}

.option-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow);
}

.option-card.selected .option-check,
.option-card.confirmed .option-check { display: flex; }
.option-card.confirmed .option-check { background: var(--green); }

/* Confirm Bar */
.confirm-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  z-index: 100;
}

.confirm-bar.visible { display: flex; }

.confirm-bar-info {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.confirm-bar-name {
  font-weight: 600;
  color: var(--warm-800);
}

.confirm-bar .btn-primary { width: 100%; }

.sub-category-header {
  font-size: 16px;
  font-weight: 600;
  color: var(--warm-700);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ─── Admin Page ──────────────────────────────────────────── */
.admin-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
}

.admin-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--warm-800);
}

.builds-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.builds-table th {
  background: var(--warm-100);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.builds-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.builds-table tr:hover td { background: var(--warm-50); }

.builds-table .pct-bar {
  height: 6px;
  background: var(--warm-200);
  border-radius: 3px;
  overflow: hidden;
  width: 80px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.builds-table .pct-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
}

.admin-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.admin-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--warm-700);
  margin-bottom: 12px;
}

.sel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--warm-100);
}

.sel-row:last-child { border-bottom: none; }
.sel-name { font-size: 14px; font-weight: 500; }

.sel-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sel-badge.pending { background: var(--warm-200); color: var(--text-muted); }
.sel-badge.confirmed { background: var(--green-bg); color: #166534; }
.sel-badge.locked { background: var(--warm-300); color: var(--warm-700); }

/* ─── Success Animation ────────────────────────────────────── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,25,20,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.success-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: bounceIn 0.5s ease 0.2s both;
}

@keyframes bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--warm-800);
  margin-bottom: 8px;
}

.success-msg {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Loading ──────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 15px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--warm-200);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 12px;
}

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

img[data-src] { background: var(--warm-200); }

.img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--warm-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 24px;
}

/* ─── Tour CTA on Build Page ──────────────────────────────── */
.tour-cta {
  margin-top: 32px;
  margin-bottom: 32px;
  padding: 32px 24px;
  background: linear-gradient(135deg, var(--warm-100), var(--warm-50));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.tour-cta-icon { font-size: 48px; margin-bottom: 12px; }

.tour-cta-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 8px;
}

.tour-cta-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ─── Tour Page (Room Grid) ───────────────────────────────── */
.tour-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.tour-header { margin-bottom: 24px; }

.tour-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 4px;
}

.tour-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

.room-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-bottom: 32px;
}

.room-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.room-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.room-card-hero {
  grid-column: 1 / -1;
}

.room-card-icon {
  font-size: 48px;
  text-align: center;
  padding: 32px 16px 16px;
  background: var(--warm-100);
}

.room-card-hero .room-card-icon {
  font-size: 64px;
  padding: 40px 16px 24px;
}

.room-card-render {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--warm-200);
}

.room-card-hero .room-card-render { height: 200px; }

.room-card-body { padding: 14px 16px; }

.room-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--warm-800);
  margin-bottom: 2px;
}

.room-card-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Room Tour Page ──────────────────────────────────────── */
.room-tour-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 100px;
}

.room-tour-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.room-tour-icon { font-size: 36px; }

.room-tour-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--warm-800);
}

/* Selection Strips */
.selection-strips { margin-bottom: 20px; }

.selection-strip { margin-bottom: 20px; }

.strip-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-700);
  margin-bottom: 8px;
}

.strip-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.strip-scroll::-webkit-scrollbar { display: none; }

.strip-option {
  flex-shrink: 0;
  width: 80px;
  scroll-snap-align: start;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.strip-option:hover { border-color: var(--warm-400); }

.strip-option.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
}

.strip-option.confirmed {
  border-color: var(--green);
}

.strip-option img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  display: block;
}

.strip-option-name {
  font-size: 10px;
  padding: 4px;
  text-align: center;
  line-height: 1.2;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strip-check {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Render Area */
.render-area {
  margin: 20px 0;
  min-height: 200px;
}

.render-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.render-shimmer {
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--warm-200) 25%, var(--warm-100) 50%, var(--warm-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.render-message {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: opacity 0.3s;
}

.render-result img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.5s ease;
}

.render-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.render-confirm-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.render-confirm-link:hover { color: var(--gold); }

.render-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--warm-100);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.render-empty-icon { font-size: 48px; margin-bottom: 12px; }

.render-empty-text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 300px;
  margin: 0 auto;
}

/* Generate Bar (sticky bottom) */
.generate-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  z-index: 100;
  text-align: center;
}

.generate-btn {
  width: 100%;
  max-width: 500px;
  font-size: 16px;
}

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.generate-count {
  font-weight: 400;
  opacity: 0.8;
  font-size: 13px;
}

.generate-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .options-grid { grid-template-columns: repeat(3, 1fr); }
  .category-card-img { height: 160px; }
  .option-card-img { height: 180px; }
  .confirm-bar {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }
  .confirm-bar .btn-primary { width: auto; }
  .neighborhood-img { height: 200px; }
  .room-grid { grid-template-columns: repeat(3, 1fr); }
  .room-card-hero { grid-column: 1 / -1; }
  .room-card-render { height: 180px; }
  .room-card-hero .room-card-render { height: 240px; }
  .strip-option { width: 90px; }
  .strip-option img { width: 90px; height: 68px; }
}

@media (min-width: 960px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .options-grid { grid-template-columns: repeat(4, 1fr); }
  .build-page { padding: 24px; }
}

@media (max-width: 480px) {
  .hero { height: 280px; }
  .hero-title { font-size: 26px; }
  .neighborhood-grid { grid-template-columns: 1fr; }
  .direct-login-form { flex-direction: column; }
  .builds-table th:nth-child(2),
  .builds-table td:nth-child(2) { display: none; }
}
