:root {
  --primary: #FF6F00;
  --secondary: #FFB300;
  --accent: #FDD835;
  --light: #C0CA33;
  --bg: #FFFFFF;
  --white: #FFFFFF;
  --off-white: #F5FAF9;
  --text: #1B3A34;
  --text-secondary: #4A6E66;
  --text-muted: #7A9E95;
  --border: #B2DFDB;
  --border-light: #D4EFEC;
  --danger: #C62828;
  --danger-light: #FFEBEE;
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --warning: #F57F17;
  --shadow-sm: 0 1px 3px rgba(0, 77, 64, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 77, 64, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 77, 64, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

::selection {
  background: var(--light);
  color: var(--white);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0, 77, 64, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-icon {
  font-size: 1.5rem;
}

.header-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn-add {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-add:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

/* Tabs */
.tab-bar {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  padding: 0 1rem;
}

.tab-btn {
  flex: 1;
  max-width: 200px;
  padding: 0.875rem 1rem;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--accent);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-icon {
  font-size: 1rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Skeleton */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.skeleton-img {
  height: 160px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 14px;
  margin: 0.75rem 1rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; margin-bottom: 1rem; }

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

/* Filters */
.filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrapper {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.1);
}

.filter-controls {
  display: flex;
  gap: 0.5rem;
}

.filter-select {
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Apartment Grid */
.apt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.apt-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.25s ease;
  animation: fadeInUp 0.4s ease both;
  position: relative;
}

.apt-card:nth-child(1) { animation-delay: 0s; }
.apt-card:nth-child(2) { animation-delay: 0.05s; }
.apt-card:nth-child(3) { animation-delay: 0.1s; }
.apt-card:nth-child(4) { animation-delay: 0.15s; }
.apt-card:nth-child(5) { animation-delay: 0.2s; }
.apt-card:nth-child(6) { animation-delay: 0.25s; }

.apt-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--border);
}

.card-image-wrapper {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--border-light) 100%);
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.apt-card:hover .card-image {
  transform: scale(1.03);
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.4;
}

.rating-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  backdrop-filter: blur(4px);
}

.badge-great { background: var(--primary); }
.badge-good { background: var(--secondary); }
.badge-okay { background: var(--accent); }
.badge-poor { background: var(--text-muted); }

.card-body {
  padding: 1rem 1.25rem;
}

.card-address {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  line-height: 1.3;
  color: var(--text);
}

.card-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.375rem;
}

.meta-rent {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

.meta-beds {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.stars {
  display: flex;
  gap: 1px;
}

.star {
  color: var(--border);
  font-size: 0.85rem;
}

.star.filled {
  color: var(--warning);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-weight: 500;
}

.tag-pro {
  background: var(--success-light);
  color: var(--success);
}

.card-actions {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 1rem 0.75rem;
  border-top: 1px solid var(--border-light);
}

.btn-icon {
  background: none;
  border: none;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: var(--bg);
}

.btn-delete:hover {
  background: var(--danger-light);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  animation: fadeInUp 0.5s ease;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.list-summary {
  text-align: center;
  padding: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  margin-top: 1.5rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 30, 25, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

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

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-modal {
  max-width: 560px;
}

.detail-modal {
  max-width: 640px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  line-height: 1;
}

.btn-close:hover {
  background: var(--bg);
  color: var(--text);
}

/* Form */
.apt-form {
  padding: 1.25rem 1.5rem 1.5rem;
}

.form-section {
  margin-bottom: 1.125rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.flex-1 {
  flex: 1;
}

/* Rating Picker */
.rating-picker {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.rating-star {
  font-size: 1.75rem;
  color: var(--border);
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}

.rating-star.active {
  color: var(--warning);
}

.rating-star:hover {
  transform: scale(1.15);
}

.rating-label {
  margin-left: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Photo Grid */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.photo-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.photo-upload-btn {
  width: 72px;
  height: 72px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.photo-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg);
}

/* List Inputs (Pros/Cons) */
.list-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.list-icon {
  font-size: 0.85rem;
  font-weight: 700;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.pro-icon { color: var(--success); }
.con-icon { color: var(--danger); }

.btn-remove-item {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
  transition: color 0.15s;
}

.btn-remove-item:hover {
  color: var(--danger);
}

.btn-add-item {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
  font-family: inherit;
  transition: color 0.15s;
}

.btn-add-item:hover {
  color: var(--primary);
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--border-light);
}

/* Map */
.map-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.map-wrapper {
  height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.map-skeleton {
  height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.skeleton-pulse {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.map-legend {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.legend-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.625rem;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-stats {
  margin-top: 0.75rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
}

.unmapped-note {
  color: var(--warning);
}

.unmapped-listings {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-light);
}

.unmapped-listings h4 {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.unmapped-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.unmapped-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.unmapped-item:hover {
  background: var(--bg);
}

.unmapped-address {
  font-size: 0.85rem;
  font-weight: 500;
}

.unmapped-rating {
  color: var(--warning);
  font-size: 0.8rem;
}

.unmapped-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Detail Modal */
.detail-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 0;
}

.detail-photo {
  width: 100%;
  flex-shrink: 0;
  max-height: 300px;
  object-fit: cover;
  scroll-snap-align: start;
}

.detail-body {
  padding: 1.5rem;
}

.detail-header {
  margin-bottom: 1.25rem;
}

.detail-address {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.detail-rating-big {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-stars .star {
  font-size: 1.25rem;
}

.detail-rating-num {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.detail-section {
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pros-title {
  color: var(--success);
}

.cons-title {
  color: var(--danger);
}

.pros-cons-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.pro-item, .con-item {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.pro-item {
  background: var(--success-light);
  color: var(--success);
  border-left: 3px solid var(--success);
}

.con-item {
  background: var(--danger-light);
  color: var(--danger);
  border-left: 3px solid var(--danger);
}

.detail-notes {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--off-white);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--light);
}

.detail-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
}

/* Map popup */
.map-popup {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.map-popup strong {
  font-weight: 600;
  color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .app-header {
    padding: 0.875rem 1rem;
  }

  .header-title {
    font-size: 1.1rem;
  }

  .btn-add {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
  }

  .main-content {
    padding: 1rem;
  }

  .apt-grid {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
  }

  .filter-controls {
    width: 100%;
  }

  .filter-select {
    flex: 1;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .modal-content {
    max-height: 95vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-top: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .map-wrapper {
    height: 350px;
  }

  .detail-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .tab-btn {
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
  }
}


<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to ApartmentTracker — your personal apartment hunting companion. Let's explore the interface.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "The Listings tab shows all your saved apartments as cards with photos, rent, bedrooms, and ratings at a glance.", "view": "user", "highlight_selector": ".tab-btn:first-child", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Click '+ Add Listing' to save a new apartment with address, rent, bedrooms, photos, pros, cons, rating, and map coordinates.", "view": "user", "highlight_selector": ".btn-add", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Rate each apartment from 1-5 stars to help you compare options later.", "view": "user", "highlight_selector": ".rating-picker", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Upload photos of the apartment to remember what each place looks like.", "view": "user", "highlight_selector": ".photo-upload-btn", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Add latitude and longitude coordinates so the apartment appears on the map with a color-coded marker.", "view": "user", "highlight_selector": ".form-row", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "Switch to the Map View tab to see all apartments with coordinates plotted on an interactive map. Markers are color-coded by rating — darker teal means higher rated.", "view": "user", "highlight_selector": ".tab-btn:last-child", "wait_for": "user_interaction"},
  {"step": 8, "narration": "Use search and filters to find apartments by address, sort by rating or rent, and filter by minimum rating.", "view": "user", "highlight_selector": ".filters-bar", "wait_for": "tap_to_continue"},
  {"step": 9, "narration": "Click any apartment card to see the full detail view with all photos, stats, pros, cons, and notes.", "view": "user", "highlight_selector": ".apt-card", "wait_for": "user_interaction"},
  {"step": 10, "narration": "Your data syncs across all your devices automatically. Happy apartment hunting!", "view": "user", "highlight_selector": ".app-shell", "wait_for": "tap_to_continue"}
]
-->

.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top, var(--bg), #d6eeeb 60%, #cde7e3 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border-light);
}

.auth-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.auth-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.auth-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-signout {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-signout:hover {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 640px) {
  .header-actions {
    gap: 0.5rem;
  }

  .user-chip {
    display: none;
  }
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
}

.score-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.score-value {
  color: var(--primary);
  font-weight: 700;
}

.score-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.score-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.comparison-view {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1.25rem;
}

.comparison-header {
  margin-bottom: 1rem;
}

.comparison-header h2 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.comparison-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.comparison-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--off-white);
  display: flex;
  flex-direction: column;
}

.comparison-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.9rem 0;
}

.comparison-rank {
  font-weight: 700;
  color: var(--primary);
}

.comparison-card-image-wrapper {
  height: 140px;
  margin: 0.75rem 0.9rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg) 0%, var(--border-light) 100%);
  cursor: pointer;
}

.comparison-card-image,
.comparison-card-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.comparison-card-body {
  padding: 0.9rem;
}

.comparison-address {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.comparison-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.comparison-details {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.comparison-score-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.comparison-score-line strong {
  color: var(--text);
}

.comparison-extra {
  margin-top: 0.75rem;
}

.comparison-rating-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.comparison-rating-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.comparison-actions {
  margin-top: auto;
}

.ai-parse-section {
  background: var(--off-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.ai-source-input {
  min-height: 96px;
}

.ai-parse-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-parse-message {
  font-size: 0.82rem;
  color: var(--success);
}

.ai-parse-error {
  font-size: 0.82rem;
  color: var(--danger);
}

.share-section {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1.25rem;
}

.share-section-header {
  margin-bottom: 0.75rem;
}

.share-section-header h2 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.share-section-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.shortlist-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.share-card {
  background: var(--off-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.share-card-header h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.share-card-header p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.share-card-summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.share-link-row,
.share-actions-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.share-link-input {
  flex: 1;
  min-width: 220px;
}

.share-payload {
  min-height: 140px;
  resize: vertical;
  margin-bottom: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
}

.shortlist-select-btn {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.shortlist-select-btn.selected {
  background: var(--primary);
  color: var(--white);
}

.apt-card-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 137, 123, 0.12), var(--shadow-sm);
}

.shortlist-share-btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .shortlist-tools,
  .share-link-row,
  .share-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .share-link-input {
    min-width: 0;
  }

  .shortlist-select-btn {
    left: 0.5rem;
    bottom: 0.5rem;
  }
}
