:root {
  --ink: #1f2933;
  --muted: #73777b;
  --line: #e8e4df;
  --paper: #fdfcf9;
  --cream: #f6f2eb;
  --coral: #f2694c;
  --coral-hover: #d9563c;
  --peach: #fde6db;
  --lav: #e9e7fa;
  --yellow: #f7edc7;
  --green-bg: #eaf5ee;
  --green-text: #206d3e;
  --red-bg: #fdeee9;
  --red-text: #a83820;
  --blue-badge: #e8f0fe;
  --blue-text: #2354c4;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.content-view {
  display: block;
  animation: fadeInView 0.15s ease;
}

.content-view.hidden {
  display: none !important;
}

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


body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.sidebar {
  width: 252px;
  background: #f6f3ee;
  border-right: 1px solid var(--line);
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
}

.sidebar-toggle-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: #ede6db;
  color: var(--ink);
  border-color: var(--line);
}

.sidebar-mobile-close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}

.brand {
  font-family: 'Playfair Display', serif;
  font-size: 25px;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.brand-mark {
  font: 700 24px/36px 'Playfair Display', serif;
  height: 36px;
  width: 36px;
  text-align: center;
  border-radius: 12px;
  background: var(--coral);
  color: white;
  flex-shrink: 0;
}

.search-wrap {
  display: flex;

  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  color: #99a0a2;
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: 13px 'DM Sans', sans-serif;
}

.nav-item,
.filter,
.settings {
  border: 0;
  background: none;
  font: 500 14px 'DM Sans', sans-serif;
  color: #62696c;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  margin-top: 6px;
  border-radius: 8px;
}

.nav-item span {
  font-size: 18px;
}

.nav-item b {
  margin-left: auto;
  font: 11px 'DM Mono', monospace;
  color: #8d9294;
}

.nav-item.active {
  color: #252d30;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.sidebar-section {
  margin: 28px 9px 0;
}

.eyebrow {
  letter-spacing: 1.25px;
  color: #92989a;
  font: 10px 'DM Mono', monospace;
  margin: 0 0 9px;
  text-transform: uppercase;
}

.sidebar-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.sidebar-swap-tour-btn {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-swap-tour-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: #fffcfb;
  transform: translateY(-1px);
}

.filter {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  text-align: left;
  transition: all 0.15s ease;
  color: var(--ink);
}

.filter:hover {
  background: rgba(255,255,255,0.7);
}

.filter.active {
  background: white;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.filter-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  margin-right: 8px;
  font-size: 10px;
  font-weight: bold;
  color: transparent;
  transition: all 0.15s ease;
  flex-shrink: 0;
  background: #ffffff;
}

.filter.active .filter-check {
  border-color: var(--coral);
  background: var(--coral);
  color: #ffffff;
}

.filter-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter .filter-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 7px;
  border-radius: 10px;
}

.filter.active .filter-count {
  background: rgba(226, 92, 70, 0.12);
  color: var(--primary);
}

.filter-only-btn {
  font-size: 10px;
  text-transform: uppercase;
  color: #64748b;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0,0,0,0.06);
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  letter-spacing: 0.3px;
  cursor: pointer;
  flex-shrink: 0;
}

.filter:hover .filter-only-btn {
  opacity: 1;
}

.filter-only-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 600;
}

.filter i {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #303b40;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.filter i.blue { background: #3b82f6; }
.filter i.green { background: #10b981; }
.filter i.orange { background: #f59e0b; }
.filter i.gray { background: #9ca3af; }

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 17px 8px 0;
}

.people {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.avatar {
  height: 24px;
  width: 24px;
  border-radius: 50%;
  color: white;
  display: grid;
  place-items: center;
  font-size: 10px;
  border: 2px solid #f6f3ee;
  font-weight: 700;
}

.avatar + .avatar {
  margin-left: -11px;
}

.coral { background: var(--coral); }
.ink { background: #53636a; }
.emerald { background: #059669; }
.indigo { background: #4f46e5; }
.purple { background: #7c3aed; }
.amber { background: #d97706; }
.teal { background: #0d9488; }
.rose { background: #e11d48; }

/* Active User Profile in Sidebar */
.user-profile-badge-wrap {
  width: 100%;
  padding: 4px 0 0;
}

.sidebar-user-profile-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 10px 6px 8px;
  border-radius: 10px;
  border: 1.5px solid #e2ddd5;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.sidebar-user-profile-btn:hover {
  border-color: #cbd5e1;
  background: #fafaf8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font: 600 12.5px 'DM Sans', sans-serif;
  color: #1f2933;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font: 400 10.5px 'DM Mono', monospace;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-gear {
  font-size: 13px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sidebar-user-profile-btn:hover .sidebar-user-gear {
  color: #475569;
  transform: rotate(30deg);
}

.user-avatar-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #ffffff;
  font: 700 11px 'DM Sans', sans-serif;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
/* Unauthenticated Sign-in button in sidebar */
.unauth-signin-wrap {
  padding: 4px 0 0;
  width: 100%;
}

.sidebar-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--coral);
  background: #fff8f6;
  color: var(--coral);
  font: 600 12px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-signin-btn:hover {
  background: var(--coral);
  color: #ffffff;
}

.people span { margin-left: 3px; font-weight: 500; }
.settings { padding: 14px 0 0; font-size: 12px; }

main {
  margin-left: 252px;
  width: calc(100% - 252px);
  max-width: 1450px;
  padding: 42px 56px 68px;
  box-sizing: border-box;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed Desktop Sidebar (Compact Icon Rail) */
.shell.sidebar-collapsed .sidebar {
  width: 68px;
  padding: 20px 8px 16px;
}

.shell.sidebar-collapsed .sidebar .brand-text,
.shell.sidebar-collapsed .sidebar .search-wrap input,
.shell.sidebar-collapsed .sidebar .nav-label,
.shell.sidebar-collapsed .sidebar .nav-item b,
.shell.sidebar-collapsed .sidebar .sidebar-section,
.shell.sidebar-collapsed .sidebar #userNameLabel,
.shell.sidebar-collapsed .sidebar .profile-switch-badge,
.shell.sidebar-collapsed .sidebar .user-name-text,
.shell.sidebar-collapsed .sidebar .more-auth-btn,
.shell.sidebar-collapsed .sidebar .settings {
  display: none !important;
}

.shell.sidebar-collapsed .sidebar .quick-user-pills {
  flex-direction: column;
  gap: 6px;
}

.shell.sidebar-collapsed .sidebar .quick-user-btn {
  padding: 4px;
  border-radius: 50%;
  justify-content: center;
}

.shell.sidebar-collapsed .sidebar .sidebar-top-row {
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0;
  align-items: center;
}

.shell.sidebar-collapsed .sidebar .brand {
  padding: 0;
  justify-content: center;
}

.shell.sidebar-collapsed .sidebar .search-wrap {
  padding: 8px 0;
  justify-content: center;
  width: 38px;
  margin: 0 auto 12px;
  cursor: pointer;
}

.shell.sidebar-collapsed .sidebar .nav-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
  border-radius: 8px;
}

.shell.sidebar-collapsed .sidebar .nav-item span {
  font-size: 20px;
}

.shell.sidebar-collapsed .sidebar .sidebar-bottom .people {
  justify-content: center;
  padding: 4px 0;
}

.shell.sidebar-collapsed main {
  margin-left: 68px;
  width: calc(100% - 68px);
}


header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
}

h1 {
  font: 600 40px/1.15 'Playfair Display', serif;
  letter-spacing: -1.2px;
  margin: 0;
}

h1 em {
  color: var(--coral);
  font-style: italic;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.primary,
.secondary,
.icon-button {
  border: 0;
  border-radius: 8px;
  font: 600 13px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
}

.primary {
  background: var(--coral);
  color: white;
  padding: 11px 18px;
  box-shadow: 0 2px 0 #d9563c;
}

.primary:hover {
  background: var(--coral-hover);
}

.secondary {
  background: #efebe5;
  color: #5e6567;
  padding: 10px 15px;
}

.secondary:hover {
  background: #e4dfd7;
}

.icon-button {
  width: 39px;
  background: white;
  border: 1px solid var(--line);
  font-size: 18px;
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.5fr;
  gap: 14px;
  margin-bottom: 36px;
}

.stat,
.score-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 96px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
}

.stat {
  gap: 14px;
}

.clickable-stat {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.clickable-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  border-color: #d1c7ba;
}

.clickable-stat.active-stat-card {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(242, 105, 76, 0.25), 0 6px 16px rgba(0,0,0,0.06);
  background: #fffcfb;
}


.stat-icon {
  height: 42px;
  width: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.peach { background: var(--peach); }
.lavender { background: var(--lav); }
.yellow { background: var(--yellow); }
.green { background: var(--green-bg); color: var(--green-text); }

.stat strong {
  display: block;
  font: 600 24px 'Playfair Display', serif;
}

.stat small {
  color: var(--muted);
  font-size: 12px;
}

.score-card {
  background: #253137;
  color: white;
  justify-content: space-between;
}

.score-card span {
  font-size: 12px;
  color: #b9c4c5;
}

.score-card strong {
  display: block;
  font: 600 28px 'Playfair Display', serif;
  color: #ffd277;
}

.mini-bars {
  height: 42px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.mini-bars i {
  width: 7px;
  background: #687879;
  border-radius: 2px;
}

.mini-bars i:nth-child(1) { height: 17px; }
.mini-bars i:nth-child(2) { height: 25px; }
.mini-bars i:nth-child(3) { height: 21px; }
.mini-bars i:nth-child(4) { height: 38px; background: #f1bc6c; }
.mini-bars i:nth-child(5) { height: 29px; }
.mini-bars i:nth-child(6) { height: 42px; background: #f1bc6c; }
.mini-bars i:nth-child(7) { height: 33px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
}

.section-heading h2,
.dialog-head h2 {
  margin: 0;
  font: 600 24px 'Playfair Display', serif;
  letter-spacing: -0.5px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sort {
  font-size: 12px;
  color: var(--muted);
}

select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 7px 10px;
  font: 12px 'DM Sans', sans-serif;
  color: var(--ink);
}

/* Multi-Status Filter Toolbar */
.status-toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 22px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  flex-wrap: wrap;
}

.status-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-toolbar-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.status-pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font: 500 12.5px 'DM Sans', sans-serif;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.status-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.status-chip.active {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.status-chip.chip-tour.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.status-chip.chip-toured.active {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.status-chip.chip-offer.active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
}

.status-chip.chip-passed.active {
  background: #4b5563;
  border-color: #4b5563;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(75, 85, 99, 0.25);
}

.status-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-chip-dot.blue { background: #3b82f6; }
.status-chip-dot.green { background: #10b981; }
.status-chip-dot.orange { background: #f59e0b; }
.status-chip-dot.gray { background: #9ca3af; }

.status-chip-count {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 6px;
  border-radius: 10px;
}
.status-chip.active .status-chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.status-toolbar-right {
  display: flex;
  align-items: center;
}

.swap-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #fed7aa;
  background: #fffaf5;
  font: 600 12px 'DM Sans', sans-serif;
  color: #c2410c;
  cursor: pointer;
  transition: all 0.15s ease;
}

.swap-status-btn:hover {
  background: #ffedd5;
  border-color: #fb923c;
  transform: translateY(-1px);
}

/* Home Grid & Cards */
.homes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.home-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(31, 41, 51, 0.08);
}

.home-image {
  height: 160px;
  position: relative;
  padding: 12px;
  background: #2b3338;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-image .photo-carousel-wrap {
  position: absolute;
  inset: 0;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.home-image .photo-carousel {
  width: 100%;
  height: 100%;
}

.home-image .photo-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-image .photo-carousel-track::-webkit-scrollbar {
  display: none;
}

.home-image .photo-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
}

.home-image .card-cover-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  z-index: 1;
  border-radius: 14px 14px 0 0;
  pointer-events: none;
}

.home-card:hover .home-image .photo-carousel:not(.is-multi) .card-cover-img {
  transform: scale(1.04);
}

.photo-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 4;
  pointer-events: none;
}

.photo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.photo-dot.active {
  background: #fff;
  width: 14px;
  border-radius: 999px;
}

.photo-carousel-count {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  font: 600 11px 'DM Mono', monospace;
  color: #fff;
  background: rgba(15, 23, 42, 0.55);
  padding: 3px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.home-image .card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.45) 0%, rgba(15,23,42,0.05) 45%, rgba(15,23,42,0.55) 100%);
  z-index: 2;
  pointer-events: none;
  border-radius: 14px 14px 0 0;
}

.home-image .photo-carousel-dots {
  z-index: 4;
  bottom: 8px;
}

.home-image .status-pill-container,
.home-image .status-pill,
.home-image .action-btn-status-swap,
.home-image .card-top-actions,
.home-image .card-bottom-actions {
  position: relative;
  z-index: 3;
}

.action-btn-compare {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 3px 9px;
  font: 600 11px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn-compare:hover,
.action-btn-compare.active {
  background: var(--coral);
  border-color: var(--coral);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(224, 90, 71, 0.4);
}

.neighborhood-vibe-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 3px 8px;
  font: 600 10.5px 'DM Sans', sans-serif;
  letter-spacing: 0.1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  max-width: 175px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Top 1-Click Status Swap Button */
.action-btn-status-swap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3.5px 9px;
  border-radius: 20px;
  font: 600 10.5px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.18s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid transparent;
  user-select: none;
}

.action-btn-status-swap.swap-to-toured {
  background: rgba(16, 185, 129, 0.92);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.action-btn-status-swap.swap-to-toured:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.45);
}

.action-btn-status-swap.swap-to-tour {
  background: rgba(37, 99, 235, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.action-btn-status-swap.swap-to-tour:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.45);
}

.action-btn-status-swap.swap-general {
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.action-btn-status-swap.swap-general:hover {
  background: #334155;
  transform: translateY(-1px);
}

/* Status Pill & Interactive Popover */
.status-pill-container {
  position: relative;
  display: inline-block;
}

.status-pill {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 4px 10px;
  font: 600 10px 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.status-pill-btn-interactive {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.status-pill-btn-interactive:hover {
  background: #ffffff;
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.status-pill-arrow {
  font-size: 8.5px;
  margin-left: 2px;
  opacity: 0.65;
  transition: transform 0.15s ease;
}

.status-pill.tour { color: #1d4ed8; }
.status-pill.toured { color: #047857; }
.status-pill.offer { color: #b45309; }
.status-pill.passed { color: #4b5563; }

.status-quick-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 25px -4px rgba(0,0,0,0.22), 0 6px 10px -4px rgba(0,0,0,0.1);
  padding: 5px;
  min-width: 146px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 99;
  border: 1px solid #e2e8f0;
}

.status-dropdown-header {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px 3px;
}

.status-opt-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font: 500 12px 'DM Sans', sans-serif;
  color: #334155;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.12s ease;
}

.status-opt-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.status-opt-btn.selected {
  background: #f0fdf4;
  font-weight: 700;
  color: #047857;
}

.status-opt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-opt-dot.blue { background: #3b82f6; }
.status-opt-dot.green { background: #10b981; }
.status-opt-dot.orange { background: #f59e0b; }
.status-opt-dot.gray { background: #9ca3af; }

.status-pill.tour { color: #1d4ed8; }
.status-pill.toured { color: #047857; }
.status-pill.offer { color: #b45309; }
.status-pill.passed { color: #4b5563; }

.card-top-actions {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.action-btn {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #555e62;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: #ffffff;
  transform: scale(1.08);
}

.action-btn.favorite {
  font-size: 16px;
  color: #334155;
}

.action-btn.favorite.saved {
  color: var(--coral);
  background: #fff1ee;
  box-shadow: 0 0 0 1px rgba(224, 90, 71, 0.25), 0 2px 6px rgba(0,0,0,0.08);
}

.shortlist-icon {
  display: inline-block;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

.action-btn .shortlist-icon {
  display: block;
  vertical-align: middle;
}

.home-view-actions .secondary .shortlist-icon,
.map-popup-btn .shortlist-icon,
.map-filter-btn .shortlist-icon {
  margin-right: 6px;
  vertical-align: -0.25em;
}

.nav-item .shortlist-nav-icon,
.mobile-bottom-tab .shortlist-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.stat-icon.shortlist-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b45309;
}

.mobile-bottom-tab.active .shortlist-icon path[fill="none"] {
  fill: currentColor;
  stroke: none;
}

.action-btn.del-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}

.action-btn.edit-btn:hover {
  color: #2563eb;
  background: #eff6ff;
}

.btn-danger-link {
  background: transparent;
  border: none;
  color: #dc2626;
  font-size: 12.5px;
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 500;
  border-radius: 6px;
  margin-right: auto;
}

.btn-danger-link:hover {
  background: #fee2e2;
}


.compare-check {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 10px 'DM Mono', monospace;
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.compare-check input {
  accent-color: var(--coral);
  cursor: pointer;
}

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.card-title h3 {
  font: 600 17px 'Playfair Display', serif;
  margin: 0;
  line-height: 1.25;
}

.price {
  font: 600 14px 'DM Mono', monospace;
  white-space: nowrap;
  color: var(--ink);
}

.location {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 12px;
}

.sqft-tag {
  font-size: 11.5px;
  color: #555d61;
  font-weight: 500;
}

/* Monthly & Cost breakdown */
.costs-panel {
  background: #fbf9f5;
  border: 1px solid #eee8df;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.cost-row strong {
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  white-space: nowrap;
}

.cost-total-row {
  font-size: 12px;
  color: #1f2933;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 1px dashed #e8e2d8;
  margin-bottom: 1px;
}

.cost-total-row strong {
  font-size: 13px;
  font-weight: 700;
  color: #1f2933;
}

.cost-sunk-row {
  color: #64748b;
}

.cost-sunk-row strong {
  color: #b45309;
  font-weight: 600;
}

.cost-equity-row {
  color: #64748b;
}

.cost-equity-row strong {
  color: #059669;
  font-weight: 600;
}

.cost-primary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}

.cost-primary-row strong {
  font-family: 'DM Mono', monospace;
  color: #273034;
}

.cost-secondary-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* Collapsible Itemized Cost Details */
.cost-details-accordion {
  margin-top: 4px;
  border-top: 1px dashed #e8e2d8;
  padding-top: 3px;
}

.cost-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  color: #8b8f94;
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
  list-style: none;
  transition: color 0.15s ease;
}

.cost-details-summary::-webkit-details-marker,
.cost-details-summary::marker {
  display: none;
}

.cost-details-summary:hover {
  color: #1f2933;
}

.cost-summary-chevron {
  font-size: 11px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.cost-details-accordion[open] .cost-summary-chevron {
  transform: rotate(180deg);
}

.cost-details-drawer {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
  padding: 7px 9px;
  background: #f4efe6;
  border-radius: 6px;
  font-size: 11px;
}

.cost-drawer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #475569;
}

.cost-drawer-row strong {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #1f2933;
}

.cost-drawer-subrow {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #718096;
  padding-left: 6px;
  margin-bottom: 2px;
}

.cost-drawer-subrow strong {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
}

.cost-drawer-closing {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10.5px;
  color: #64748b;
  border-top: 1px dashed #ded6c9;
  padding-top: 4px;
  margin-top: 2px;
}

.cost-drawer-closing strong {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: #1f2933;
}

.unit-tag {
  color: #059669;
  font-weight: 600;
  font-size: 9.5px;
}

/* Pros and Cons tags */
.pros-cons-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  line-height: 1.3;
}

.tag.pro {
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid #d1ebd8;
}

.tag.con {
  background: var(--red-bg);
  color: var(--red-text);
  border: 1px solid #f9d8cf;
}

/* Notes & Links */
.notes-box {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.4;
  margin-bottom: 14px;
  background: #fafaf8;
  border-left: 3px solid #dfd8cc;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  word-break: break-word;
}

.notes-box a {
  color: var(--coral);
  font-weight: 600;
  text-decoration: underline;
}

/* Card bottom meta */
.home-meta {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.star-rating {
  color: #eab308;
  font-size: 13px;
  letter-spacing: 1px;
}

.rating-num {
  font: 600 11px 'DM Mono', monospace;
  color: #4b5563;
  margin-left: 4px;
}

.fit {
  font: 500 11px 'DM Mono', monospace;
  color: #bd664d;
}

.fit b {
  font-size: 14px;
}

/* Comparison Table */
.comparison {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 320px;
}

.comparison table {
  border-collapse: collapse;
  width: 100%;
  min-width: 680px;
}

.comparison th,
.comparison td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.comparison th {
  font: 600 16px 'Playfair Display', serif;
  background: #fdfcfb;
}

.comparison td:first-child {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 150px;
  background: #fbf9f6;
  border-right: 1px solid var(--line);
}

.bullet-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.5;
}

.bullet-list.pro { color: var(--green-text); }
.bullet-list.con { color: var(--red-text); }

.empty {
  grid-column: 1 / -1;
  border: 1px dashed #d6d0c7;
  border-radius: 12px;
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  font-size: 13px;
}

.compare-link {
  color: var(--coral);
  border: 0;
  background: none;
  cursor: pointer;
  font: 600 13px 'DM Sans', sans-serif;
  text-decoration: underline;
}

/* Modern Dialog & Form (Linear / Stripe Design System) */
dialog.modern-home-dialog,
dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  width: min(780px, calc(100vw - 32px));
  box-shadow: 0 30px 100px rgba(15, 23, 42, 0.35);
  max-height: 90vh;
  overflow: hidden;
  background: #ffffff;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modern-home-dialog form,
dialog form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
  padding: 0;
  margin: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* Modal Header */
.modal-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  z-index: 10;
}

.modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-eyebrow {
  font: 700 10.5px 'DM Mono', monospace;
  letter-spacing: 0.8px;
  color: var(--coral);
  text-transform: uppercase;
}

.modal-title {
  font: 700 21px 'Playfair Display', serif;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
}

.modal-subtitle {
  font: 500 12.5px 'DM Sans', sans-serif;
  color: #64748b;
  margin: 2px 0 0;
  line-height: 1.35;
}

.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}

/* Modal Scrollable Body */
.modal-scroll-body {
  padding: 18px 24px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  background: #faf8f5;
  box-sizing: border-box;
}

/* Smart Import Card & Voice Controller */
.smart-import-card {
  background: linear-gradient(135deg, #fffbf5 0%, #fff7ed 100%);
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.06);
}

.smart-import-card.collapsed {
  display: none;
}

.smart-import-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.smart-import-title {
  font: 700 13px 'DM Sans', sans-serif;
  color: #9a3412;
}

.smart-import-sub {
  font: 400 11.5px 'DM Sans', sans-serif;
  color: #b45309;
}

/* Mode Tabs */
.import-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(253, 186, 116, 0.4);
  padding-bottom: 8px;
}

.import-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 5px 12px;
  font: 600 12px 'DM Sans', sans-serif;
  color: #78350f;
  cursor: pointer;
  transition: all 0.2s ease;
}

.import-tab-btn:hover {
  background: rgba(254, 215, 170, 0.4);
}

.import-tab-btn.active {
  background: #ffffff;
  border-color: #fdba74;
  color: #c2410c;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.15);
}

.tab-badge-ai {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.3);
}

/* Voice Rambler Card */
.voice-rambler-card {
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  padding: 12px 14px;
}

.voice-cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 8px 18px;
  font: 600 13px 'DM Sans', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
  transition: all 0.2s ease;
}

.voice-record-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
}

.voice-mic-icon {
  font-size: 15px;
}

.voice-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 7px 14px;
  font: 500 12px 'DM Sans', sans-serif;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-upload-label:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

.voice-hint {
  margin: 8px 0 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #78350f;
}

/* Active Recording Tray */
.voice-recording-tray {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-recording-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-pulse-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 13px 'DM Sans', sans-serif;
  color: #b91c1c;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc2626;
  animation: pulseDot 1.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { transform: scale(1.15); opacity: 0.8; box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.rec-timer {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Sound Wave Bars */
.sound-wave-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.sound-wave-bars .bar {
  width: 3px;
  height: 6px;
  background: #ea580c;
  border-radius: 2px;
  animation: soundWave 1s ease-in-out infinite alternate;
}

.sound-wave-bars .b1 { animation-delay: 0.1s; }
.sound-wave-bars .b2 { animation-delay: 0.3s; }
.sound-wave-bars .b3 { animation-delay: 0.5s; }
.sound-wave-bars .b4 { animation-delay: 0.2s; }
.sound-wave-bars .b5 { animation-delay: 0.6s; }
.sound-wave-bars .b6 { animation-delay: 0.4s; }
.sound-wave-bars .b7 { animation-delay: 0.15s; }

@keyframes soundWave {
  0% { height: 4px; }
  100% { height: 18px; }
}

/* Live Transcript Box */
.voice-transcript-preview {
  background: #fffbeb;
  border: 1px dashed #fcd34d;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 54px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  color: #78350f;
}

.transcript-placeholder {
  color: #b45309;
  font-style: italic;
}

.live-transcript-text {
  margin: 0;
  color: #1e293b;
  font-weight: 500;
}

.voice-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.voice-cancel-btn {
  padding: 6px 12px;
  font-size: 12px;
}

.voice-finish-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
  border-color: #6d28d9 !important;
  padding: 7px 16px;
  font-size: 12.5px;
  box-shadow: 0 2px 6px rgba(109, 40, 217, 0.3);
}

/* Processing State */
.voice-processing-state {
  padding: 14px 10px;
  background: #faf5ff;
  border-radius: 8px;
}

.processing-spinner-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-sparkle-anim {
  font-size: 22px;
  animation: sparkleSpin 1.8s infinite linear;
}

@keyframes sparkleSpin {
  0% { transform: rotate(0deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(0.9); }
}

.processing-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.processing-text-group strong {
  font: 600 13px 'DM Sans', sans-serif;
  color: #581c87;
}

.processing-text-group small {
  font-size: 11.5px;
  color: #7e22ce;
}

/* Field Glow Animation when populated */
@keyframes fieldGlow {
  0% { background-color: #fef08a; border-color: #eab308; }
  50% { background-color: #ede9fe; border-color: #a855f7; }
  100% { background-color: transparent; }
}

.just-extracted {
  animation: fieldGlow 1.8s ease-out !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.smart-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #fdba74;
  border-radius: 8px;
  padding: 4px 6px 4px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.smart-sparkle {
  font-size: 15px;
  color: #ea580c;
}

.smart-input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  font: 500 13px 'DM Sans', sans-serif;
  color: var(--ink);
  outline: none;
  background: transparent;
  padding: 6px 0;
}

.btn-autofill {
  white-space: nowrap;
  padding: 7px 14px;
  font: 600 12px 'DM Sans', sans-serif;
  background: var(--coral);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-autofill:hover {
  background: var(--coral-hover);
}

.reimport-toggle-wrap {
  display: flex;
  justify-content: flex-end;
}

.reimport-toggle-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  font: 600 11.5px 'DM Sans', sans-serif;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reimport-toggle-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Card Sections */
.form-card-section {
  background: #ffffff;
  border: 1px solid #e8e4dc;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.section-badge-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-step {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1e293b;
  color: #ffffff;
  font: 700 11px 'DM Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-badge-header h3 {
  font: 700 15px 'Playfair Display', serif;
  color: #0f172a;
  margin: 0;
}

.section-title-with-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.live-outflow-pill {
  font: 600 11px 'DM Mono', monospace;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 3px 9px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Inputs with Adornments (Prefix/Suffix) */
.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.field-label {
  font: 600 11.5px 'DM Sans', sans-serif;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-label small {
  font-weight: 400;
  color: #64748b;
  font-size: 11px;
}

.input-with-adornment {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  overflow: hidden;
}

.input-with-adornment:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(224, 90, 71, 0.14);
}

.input-prefix {
  padding-left: 10px;
  font: 600 13px 'DM Mono', monospace;
  color: #64748b;
  user-select: none;
}

.input-suffix {
  padding-right: 10px;
  font: 500 11.5px 'DM Mono', monospace;
  color: #94a3b8;
  user-select: none;
  white-space: nowrap;
}

.input-with-adornment input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none !important;
  background: transparent !important;
  padding: 8px 10px;
  font: 600 13.5px 'DM Mono', monospace;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
}

/* Steppers Grid */
.steppers-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .steppers-grid {
    grid-template-columns: 1fr;
  }
}

.stepper-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stepper-label {
  font: 600 11.5px 'DM Sans', sans-serif;
  color: #334155;
}

.segmented-control {
  display: flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.segmented-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 6px 3px;
  font: 600 11.5px 'DM Sans', sans-serif;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.segmented-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.7);
}

.segmented-btn.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Financials 3x2 Grid */
.fin-numbers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .fin-numbers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Status and Rating Grid */
.status-rating-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 14px;
  align-items: flex-start;
}

@media (max-width: 640px) {
  .status-rating-grid {
    grid-template-columns: 1fr;
  }
}

.status-col,
.rating-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.status-segmented-control {
  display: flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.status-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 7px 4px;
  font: 600 11px 'DM Sans', sans-serif;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.status-seg-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #0f172a;
}

.status-seg-btn.active {
  background: var(--coral);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(224, 90, 71, 0.3);
}

.star-rating-control {
  display: flex;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.star-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 7px 3px;
  font: 700 11px 'DM Sans', sans-serif;
  color: #b45309;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.star-seg-btn.unrated {
  font-weight: 600;
  color: #78350f;
  font-size: 11px;
  flex: 1.35;
}

.star-seg-btn:hover {
  background: #fef3c7;
}

.star-seg-btn.active {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.35);
}

.star-seg-btn.unrated.active {
  background: #475569;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(71, 85, 105, 0.3);
}

/* Modal Sticky Footer */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 10;
  box-sizing: border-box;
}

.modal-footer-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.btn-modal-cancel {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 16px;
  font: 600 12.5px 'DM Sans', sans-serif;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-modal-save {
  background: var(--coral);
  border: 1px solid var(--coral);
  border-radius: 8px;
  padding: 8px 20px;
  font: 600 12.5px 'DM Sans', sans-serif;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(224, 90, 71, 0.3);
}

.btn-modal-save:hover {
  background: var(--coral-hover);
  transform: translateY(-1px);
}

.btn-delete-home {
  background: transparent;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  padding: 8px 14px;
  font: 600 12.5px 'DM Sans', sans-serif;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-delete-home:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* More Details Drawer */
.more-details-toggle-wrap {
  text-align: center;
  margin-top: 4px;
}

.more-details-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font: 600 12px 'DM Sans', sans-serif;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.more-details-btn:hover {
  color: var(--coral);
}

.more-details-drawer {
  background: #fbf9f6;
  border: 1px solid #e2dacd;
  border-radius: 10px;
  padding: 14px;
}



.scrape-status-banner {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font: 500 12px 'DM Sans', sans-serif;
}

.scrape-status-banner.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.scrape-status-banner.success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.scrape-status-banner.error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.field-highlight {
  animation: fieldFlash 1.5s ease;
}

@keyframes fieldFlash {
  0% { background-color: #fef3c7; }
  100% { background-color: #ffffff; }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.form-grid.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-grid label {
  font-size: 12px;
  color: #596164;
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  font: 13px 'DM Sans', sans-serif;
  outline-color: var(--coral);
  background: #fff;
}

textarea {
  min-height: 60px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}


#toast {
  position: fixed;
  bottom: 25px;
  right: 28px;
  background: #253137;
  color: white;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#toast.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.toast-undo-btn {
  background: #f2694c;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.toast-undo-btn:hover {
  background: #d85438;
}

/* Civ x Animal Crossing x Catan Hex Board */
.view-mode-toggle {
  display: inline-flex;
  background: #ebe4d8;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.view-toggle-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font: 600 12px 'DM Sans', sans-serif;
  color: #555d61;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  color: var(--ink);
}

.view-toggle-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Financials & Equity Breakdown View */
.fin-assumptions-details {
  margin-top: 16px;
  background: #fbf9f5;
  border: 1px solid #e5ded2;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.fin-assumptions-details[open] {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.fin-assumptions-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  cursor: pointer;
  user-select: none;
  font: 600 13px 'DM Sans', sans-serif;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease;
}

.fin-assumptions-summary:hover {
  background: #f1f5f9;
}

.fin-assumptions-details[open] .fin-assumptions-summary {
  border-bottom-color: #e2e8f0;
  background: #f1f5f9;
}

.fin-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fin-summary-title {
  color: var(--ink);
  font-weight: 600;
}

.fin-summary-badge {
  font: 500 11.5px 'DM Mono', monospace;
  color: #475569;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 6px;
}

.fin-summary-chevron {
  font-size: 12px;
  color: var(--coral);
  font-weight: 600;
}

.fin-assumptions-panel {
  background: #fbf9f5;
  border: none;
  border-radius: 0;
  padding: 14px 18px;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.fin-assumption-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fin-assumption-group.highlight-horizon {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 6px 10px;
  border-radius: 8px;
}

.fin-assumption-group.highlight-horizon label {
  color: #c2410c;
}

.fin-assumption-group.highlight-horizon input[type="range"] {
  accent-color: #ea580c;
}

.fin-assumption-group.highlight-buyer-cost {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 6px 10px;
  border-radius: 8px;
}

.fin-assumption-group.highlight-buyer-cost label {
  color: #15803d;
}

.fin-assumption-group.highlight-buyer-cost input[type="range"] {
  accent-color: #16a34a;
}

.fin-assumption-group.highlight-seller-cost {
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  padding: 6px 10px;
  border-radius: 8px;
}

.fin-assumption-group.highlight-seller-cost label {
  color: #be185d;
}

.fin-assumption-group.highlight-seller-cost input[type="range"] {
  accent-color: #db2777;
}


.fin-assumption-group label {
  font: 600 12px 'DM Sans', sans-serif;
  color: var(--ink);
}


.fin-assumption-group input[type="range"] {
  width: 130px;
  accent-color: var(--coral);
  cursor: pointer;
}

.fin-pill-hint {
  font: 500 11px 'DM Mono', monospace;
  color: var(--muted);
  background: #ede6db;
  padding: 2px 8px;
  border-radius: 6px;
  width: fit-content;
}

.fin-legend-inline {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: auto;
  font: 500 11.5px 'DM Sans', sans-serif;
  color: #4b5563;
}

.fin-legend-inline span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot.principal { background: #10b981; }
.dot.interest { background: #f59e0b; }
.dot.common { background: #f97316; }
.dot.tax { background: #64748b; }
.dot.insurance { background: #06b6d4; }
.dot.parking { background: #8b5cf6; }

.financials-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.fin-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(35, 45, 50, 0.08);
}

.fin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.fin-card-title h3 {
  font: 600 19px 'Playfair Display', serif;
  margin: 0 0 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.fin-card-title h3:hover {
  color: var(--coral);
}

.fin-card-title p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.fin-card-price {
  text-align: right;
}

.fin-price-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.fin-card-price .price-big {
  font: 700 20px 'DM Mono', monospace;
  color: var(--ink);
  display: inline-block;
}

.fin-card-price .price-big.negotiated-active {
  color: #047857;
}

.fin-negotiated-tag {
  font: 600 10.5px 'DM Sans', sans-serif;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 1.5px 7px;
  display: inline-block;
  vertical-align: middle;
}

.fin-truth-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
}

.fin-truth-ask {
  color: #94a3b8;
  font-family: 'DM Mono', monospace;
}

.fin-truth-ask del {
  color: #94a3b8;
}

.fin-delta-pill {
  font: 600 11px 'DM Mono', monospace;
  padding: 1px 6px;
  border-radius: 6px;
  display: inline-block;
}

.fin-delta-pill.discount {
  color: #047857;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
}

.fin-delta-pill.premium {
  color: #c2410c;
  background: #ffedd5;
  border: 1px solid #fed7aa;
}

.fin-card-price .ppsqft-tag {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* Negotiation & Scenario Toolbar */
.fin-negotiation-toolbar {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fin-scenario-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.fin-scenario-row + .fin-scenario-row {
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.fin-card.has-negotiated-price {
  border-color: #fdba74;
  box-shadow: 0 4px 18px rgba(234, 88, 12, 0.06);
}

.fin-card.has-custom-rent {
  border-color: #93c5fd;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.06);
}

.fin-card.has-negotiated-price.has-custom-rent {
  border-color: #c084fc;
}

.fin-neg-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-neg-title {
  font: 600 12px 'DM Sans', sans-serif;
  color: #475569;
  white-space: nowrap;
}

.fin-price-input-box {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fin-price-input-box:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(224, 90, 71, 0.15);
}

.fin-price-input-box.rent-box:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.fin-input-prefix {
  font: 600 13px 'DM Mono', monospace;
  color: #64748b;
  margin-right: 2px;
}

.fin-input-suffix {
  font: 600 11.5px 'DM Mono', monospace;
  color: #64748b;
  margin-left: 3px;
}

.fin-negotiated-input,
.fin-comp-rent-input {
  font: 700 13.5px 'DM Mono', monospace;
  color: var(--ink);
  border: none;
  outline: none;
  width: 95px;
  background: transparent;
}

.fin-custom-rent-badge {
  font: 700 10.5px 'DM Sans', sans-serif;
  padding: 2px 7px;
  border-radius: 10px;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.fin-default-rent-badge {
  font: 500 10.5px 'DM Sans', sans-serif;
  padding: 2px 6px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

.fin-neg-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.fin-neg-chip {
  font: 500 11px 'DM Mono', monospace;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 3px 8px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
}

.fin-neg-chip:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: #fff9f7;
}

.fin-neg-chip.active {
  background: #e05a47;
  color: #ffffff;
  border-color: #e05a47;
  font-weight: 600;
}

.fin-rent-chip {
  font: 500 11px 'DM Mono', monospace;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 3px 8px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
}

.fin-rent-chip:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.fin-rent-chip.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 600;
}

.fin-neg-reset-btn,
.fin-rent-reset-btn {
  font: 600 11px 'DM Sans', sans-serif;
  color: #64748b;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fin-neg-reset-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.fin-rent-reset-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.fin-scenario-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fefce8;
  border: 1.5px solid #fde047;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #854d0e;
  gap: 12px;
  flex-wrap: wrap;
}

.fin-reset-all-offers-btn {
  background: #ffffff;
  border: 1px solid #eab308;
  color: #854d0e;
  border-radius: 6px;
  padding: 4px 10px;
  font: 600 12px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fin-reset-all-offers-btn:hover {
  background: #fef08a;
  color: #713f12;
}

/* Key Metrics Grid (4 Clean Pillars) */
.fin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: #fbf9f6;
  border: 1px solid #ede7dc;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .fin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fin-metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fin-metric-item small {
  font: 600 11px 'DM Sans', sans-serif;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.fin-metric-item strong {
  font: 700 16px 'DM Mono', monospace;
  color: var(--ink);
}

.fin-metric-item .metric-sub {
  font: 500 11px 'DM Sans', sans-serif;
  color: #94a3b8;
}

.fin-metric-item.highlight-equity strong {
  color: #059669;
}

.fin-metric-item.highlight-burn-pos strong {
  color: #b45309;
}

.fin-metric-item.highlight-burn-neg strong {
  color: #059669;
}

.fin-metric-item.highlight-burn-neg .metric-sub {
  color: #059669;
  font-weight: 600;
}

.fin-metric-item.highlight-delta-pos strong {
  color: #059669;
}

.fin-metric-item.highlight-delta-neg strong {
  color: #dc2626;
}


/* Stacked Payment Bar */
.fin-stacked-bar-wrap {
  margin-bottom: 12px;
}

.fin-stacked-bar-label {
  display: flex;
  justify-content: space-between;
  font: 600 11.5px 'DM Sans', sans-serif;
  color: #475569;
  margin-bottom: 5px;
}

.fin-stacked-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
}

.fin-seg {
  height: 100%;
  position: relative;
  transition: width 0.3s ease;
}

.fin-seg.principal { background: #10b981; }
.fin-seg.interest { background: #f59e0b; }
.fin-seg.common { background: #f97316; }
.fin-seg.tax { background: #64748b; }
.fin-seg.parking { background: #8b5cf6; }

.fin-seg-legend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  font: 500 11.5px 'DM Sans', sans-serif;
  color: #64748b;
}

.fin-seg-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fin-seg-pill strong {
  color: #1e293b;
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}

/* Sleek Rent vs Buy Summary Strip */
.fin-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.fin-summary-pill {
  font: 700 11px 'DM Mono', monospace;
  padding: 3px 8px;
  border-radius: 6px;
}

.fin-summary-pill.pos {
  background: #dcfce7;
  color: #166534;
}

.fin-summary-pill.neg {
  background: #fee2e2;
  color: #991b1b;
}

.fin-summary-meta {
  color: #475569;
  font: 500 11.5px 'DM Sans', sans-serif;
}

.fin-summary-meta strong {
  color: #0f172a;
}

.fin-details-toggle {
  background: none;
  border: none;
  font: 600 11px 'DM Sans', sans-serif;
  color: #2563eb;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.fin-details-toggle:hover {
  background: #eff6ff;
}

.fin-details-drawer {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 6px;
  font-size: 11.5px;
  color: #475569;
  line-height: 1.6;
}

.fin-details-drawer.hidden {
  display: none;
}

/* Qualitative Amenity Chips */
.boosts-detractions-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.chips-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.boost-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
  padding: 3px 8px;
  border-radius: 6px;
  font: 600 11px 'DM Sans', sans-serif;
}

.detraction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fee2e2;
  padding: 3px 8px;
  border-radius: 6px;
  font: 600 11px 'DM Sans', sans-serif;
}


.fin-seg-legend-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11.5px;
}

.fin-seg-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.fin-seg-pill strong {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}

/* Transit & Subway Accessibility Styling */
.transit-summary-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 8px;
  padding: 4px 8px;
  font: 500 11.5px 'DM Sans', sans-serif;
  margin-top: 6px;
  flex-wrap: wrap;
}

.transit-summary-badge strong {
  color: #14532d;
}

.transit-stn-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.transit-stn-sep {
  color: #86efac;
  font-weight: 700;
  margin: 0 1px;
}

.mta-bullets-wrap {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.mta-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font: 700 9.5px 'Helvetica Neue', Arial, sans-serif;
  color: #fff;
  line-height: 1;
}

.mta-bullet.line-A, .mta-bullet.line-C, .mta-bullet.line-E { background: #0039A6; }
.mta-bullet.line-B, .mta-bullet.line-D, .mta-bullet.line-F, .mta-bullet.line-M { background: #FF6319; }
.mta-bullet.line-G { background: #6CBE45; }
.mta-bullet.line-J, .mta-bullet.line-Z { background: #996633; }
.mta-bullet.line-L { background: #A7A9AC; }
.mta-bullet.line-N, .mta-bullet.line-Q, .mta-bullet.line-R, .mta-bullet.line-W { background: #FCCC0A; color: #000; }
.mta-bullet.line-1, .mta-bullet.line-2, .mta-bullet.line-3 { background: #EE352E; }
.mta-bullet.line-4, .mta-bullet.line-5, .mta-bullet.line-6 { background: #00933C; }
.mta-bullet.line-7 { background: #B933AD; }
.mta-bullet.line-S { background: #808183; }
.mta-bullet.line-LIRR { background: #003882; width: auto; padding: 0 4px; border-radius: 4px; font-size: 8.5px; }
.mta-bullet.line-Ferry { background: #0284c7; width: auto; padding: 0 4px; border-radius: 4px; font-size: 8.5px; }

.inspect-transit-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
}

.inspect-transit-section h4 {
  font: 700 11.5px 'DM Sans', sans-serif;
  color: #334155;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.transit-stations-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.transit-station-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}

.commute-destinations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}

.commute-dest-item small {
  font-size: 10px;
  color: #64748b;
  display: block;
}

.commute-dest-item strong {
  font: 700 12px 'DM Mono', monospace;
  color: #0f172a;
}


.map-controls-bar {


  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.map-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.map-toggle-pill:hover {
  background: #fbf9f6;
  border-color: #d1c8be;
}

.map-toggle-pill input {
  accent-color: var(--coral);
  cursor: pointer;
}

.map-filter-group {
  display: inline-flex;
  background: #e8e2d8;
  padding: 3px;
  border-radius: 20px;
  gap: 2px;
}

.map-filter-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 16px;
  font: 500 12px 'DM Sans', sans-serif;
  color: #555d61;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-filter-btn.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Real Geographic Interactive Map View */
.real-map-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  height: calc(100vh - 210px);
  min-height: 560px;
  margin-top: 16px;
}

@media (max-width: 960px) {
  .real-map-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.map-homes-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.map-homes-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fbf9f5;
  border-bottom: 1px solid var(--line);
}

.map-homes-count {
  font: 700 13px 'DM Sans', sans-serif;
  color: var(--ink);
}

.map-hint-text {
  font: 500 11px 'DM Sans', sans-serif;
  color: var(--muted);
}

.map-homes-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-home-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.map-home-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.map-home-card.active {
  border-color: var(--coral);
  background: #fffaf8;
  box-shadow: 0 4px 14px rgba(224, 90, 71, 0.15);
}

.map-home-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.map-home-card-addr {
  font: 600 14px 'DM Sans', sans-serif;
  color: var(--ink);
  margin: 0;
}

.map-home-card-price {
  font: 700 14px 'DM Mono', monospace;
  color: var(--ink);
  white-space: nowrap;
}

.map-home-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.map-home-card-transit {
  font-size: 11px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.real-map-container {
  height: 100%;
  min-height: 520px;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  z-index: 1;
}

/* Custom Property Marker Pin */
.hearth-map-pin {
  display: flex;
  align-items: center;
  background: #1e293b;
  color: #ffffff;
  border-radius: 20px;
  padding: 4px 10px;
  font: 700 12px 'DM Mono', monospace;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.2);
  border: 2px solid #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  position: relative;
}

.hearth-map-pin::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.hearth-map-pin.status-tour {
  background: linear-gradient(135deg, #e05a47, #ea580c);
}
.hearth-map-pin.status-tour::after {
  border-color: #ea580c transparent transparent transparent;
}

.hearth-map-pin.status-toured {
  background: linear-gradient(135deg, #475569, #334155);
}
.hearth-map-pin.status-toured::after {
  border-color: #334155 transparent transparent transparent;
}

.hearth-map-pin.saved, .hearth-map-pin.status-offer {
  background: linear-gradient(135deg, #059669, #047857);
}
.hearth-map-pin.saved::after, .hearth-map-pin.status-offer::after {
  border-color: #047857 transparent transparent transparent;
}

.hearth-map-pin:hover, .hearth-map-pin.selected {
  transform: scale(1.15) translateY(-4px);
  z-index: 1000 !important;
  box-shadow: 0 8px 24px rgba(224, 90, 71, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.hearth-map-pin .pin-unit-tag {
  background: rgba(0, 0, 0, 0.28);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-right: 4px;
}

.hearth-map-pin .pin-star {
  color: #fbbf24;
  margin-right: 4px;
  font-size: 11px;
}

.map-popup-sibling-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 6px 10px;
  margin: 8px 0;
}

.sibling-box-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sibling-units-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sibling-unit-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: white;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 4px 8px;
  font: 600 11px 'DM Sans', sans-serif;
  color: #14532d;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.sibling-unit-pill:hover {
  background: #dcfce7;
  border-color: #22c55e;
}

/* Custom Subway Marker Pin */
.subway-station-icon {
  background: #ffffff;
  border: 1.5px solid #64748b;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Custom Leaflet Popup */
.leaflet-popup-content-wrapper {
  border-radius: 14px !important;
  padding: 0 !important;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18) !important;
  border: 1px solid #e2e8f0;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4 !important;
}

.map-popup-card {
  padding: 14px 16px;
  width: 280px;
}

.map-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.map-popup-title {
  font: 700 15px 'DM Sans', sans-serif;
  color: var(--ink);
  margin: 0;
}

.map-popup-neigh {
  font: 500 11px 'DM Sans', sans-serif;
  color: #64748b;
}

.map-popup-price {
  font: 700 16px 'DM Mono', monospace;
  color: var(--ink);
}

.map-popup-specs {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #475569;
  margin: 6px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.map-popup-transit {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  margin: 8px 0;
  font-size: 11.5px;
}

.map-popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.map-popup-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  font: 600 11.5px 'DM Sans', sans-serif;
  border: 1px solid var(--line);
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.map-popup-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.map-popup-btn.primary {
  background: var(--coral);
  color: #ffffff;
  border-color: var(--coral);
}

.map-popup-btn.primary:hover {
  background: var(--coral-dark);
}

/* Profile Switcher in Sidebar */
.clickable-profile {
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
  user-select: none;
}

.clickable-profile:hover {
  background: #f4efe7;
}

.profile-switch-badge {
  margin-left: auto;
  font: 600 10px 'DM Sans', sans-serif;
  color: var(--muted);
  background: #eee8df;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.clickable-profile:hover .profile-switch-badge {
  background: var(--coral);
  color: #ffffff;
}

/* Auth Dialog (Option B) */
.auth-dialog {
  border: none;
  border-radius: 20px;
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  box-shadow: 0 25px 80px rgba(24, 34, 38, 0.35);
  background: #ffffff;
  overflow: hidden;
}

.auth-dialog::backdrop {
  background: rgba(23, 33, 38, 0.7);
  backdrop-filter: blur(5px);
}

.auth-card {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-mark-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--coral);
  color: #fff;
  font: 700 24px 'Playfair Display', serif;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(231, 107, 83, 0.3);
}

.auth-head h2 {
  font: 700 22px 'Playfair Display', serif;
  margin: 0 0 4px;
  color: var(--ink);
}

.auth-subtitle {
  font: 400 13px 'DM Sans', sans-serif;
  color: var(--muted);
  margin: 0 0 16px;
}

/* Authenticated Account Profile Section in Modal */
.auth-account-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.account-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
}

.account-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  display: grid;
  place-items: center;
  font: 700 16px 'DM Sans', sans-serif;
  flex-shrink: 0;
}

.account-profile-details {
  display: flex;
  flex-direction: column;
}

.account-profile-details strong {
  font-size: 15px;
  color: #1f2933;
}

.account-profile-details small {
  font-size: 12px;
  color: #64748b;
}

.account-section-label {
  font: 600 11.5px 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
  margin: 0 0 8px;
}

.account-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.account-actions-row button {
  flex: 1;
}

/* Unauthenticated Login Flow Wrapper */
.auth-login-flow-section {
  width: 100%;
}

/* Quick 1-Click Login Cards in Modal */
.quick-login-section {
  width: 100%;
  margin-bottom: 4px;
}

.quick-login-title {
  font: 600 11.5px 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
  margin: 0 0 8px;
  text-align: left;
}

.quick-login-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.quick-login-card-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.quick-login-card-btn:hover {
  transform: translateY(-1px);
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.quick-login-card-btn.coral-card:hover {
  border-color: var(--coral);
  background: #fff8f6;
}

.quick-login-card-btn.ink-card:hover {
  border-color: #53636a;
  background: #f4f6f8;
}

.quick-login-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #ffffff;
  display: grid;
  place-items: center;
  font: 700 14px 'DM Sans', sans-serif;
  flex-shrink: 0;
}

.quick-login-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.quick-login-info strong {
  font-size: 14px;
  color: #1f2933;
}

.quick-login-info small {
  font-size: 11.5px;
  color: #64748b;
}

.quick-login-arrow {
  font-size: 16px;
  color: #94a3b8;
  font-weight: 600;
}

.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 14px 0 12px;
  color: #94a3b8;
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 10px;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.auth-label {
  font: 600 11px 'DM Sans', sans-serif;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0 0 6px;
  text-align: center;
}



.auth-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.auth-input-wrap label {
  font: 600 12px 'DM Sans', sans-serif;
  color: #475569;
}

.auth-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font: 500 14px 'DM Sans', sans-serif;
  outline-color: var(--coral);
}

#authCodeInput {
  font: 700 20px 'DM Mono', monospace;
  letter-spacing: 6px;
  text-align: center;
}

.auth-info-note {
  font: 400 13px 'DM Sans', sans-serif;
  color: #475569;
  margin: -4px 0 6px;
  text-align: center;
}

.auth-info-note strong {
  color: var(--ink);
}

.auth-dev-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 8px 12px;
  border-radius: 6px;
  font: 500 12px 'DM Mono', monospace;
  text-align: center;
}

.auth-back-btn {
  width: 100%;
  padding: 9px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  margin-top: -4px;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 8px 12px;
  border-radius: 6px;
  font: 500 12px 'DM Sans', sans-serif;
  text-align: center;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
  border-radius: 8px;
}

/* Device Saved Accounts (Per-Device Only) */
.device-accounts-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.saved-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.saved-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: left;
}

.saved-account-card:hover {
  background: #f1f5f9;
  border-color: var(--coral);
}

.saved-account-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.saved-account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font: 700 14px 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.saved-account-info strong {
  display: block;
  font: 600 13px 'DM Sans', sans-serif;
  color: #1e293b;
}

.saved-account-info small {
  font: 400 11.5px 'DM Mono', monospace;
  color: #64748b;
}

.saved-account-action {
  font: 600 12px 'DM Sans', sans-serif;
  color: var(--coral);
  display: flex;
  align-items: center;
  gap: 4px;
}

.switch-account-btn {
  background: transparent;
  border: none;
  font: 500 12px 'DM Sans', sans-serif;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  text-align: center;
  transition: color 0.2s;
}

.switch-account-btn:hover {
  color: var(--coral);
  text-decoration: underline;
}

.auth-demo-btn:hover {
  color: var(--ink) !important;
  background: #f1f5f9 !important;
}

/* ==========================================
   Mobile Navigation & Responsive Layout
   ========================================== */

.mobile-top-bar {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 860px) {
  .sidebar {
    width: 270px;
    max-width: 82vw;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    padding-top: 18px;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-mobile-close-btn {
    display: block;
  }

  .sidebar-toggle-btn {
    display: none !important;
  }

  .shell.sidebar-collapsed .sidebar {
    width: 270px;
    padding: 18px 16px 20px;
  }

  .shell.sidebar-collapsed .sidebar .brand-text,
  .shell.sidebar-collapsed .sidebar .search-wrap input,
  .shell.sidebar-collapsed .sidebar .nav-label,
  .shell.sidebar-collapsed .sidebar .nav-item b,
  .shell.sidebar-collapsed .sidebar .sidebar-section,
  .shell.sidebar-collapsed .sidebar #userNameLabel,
  .shell.sidebar-collapsed .sidebar .profile-switch-badge,
  .shell.sidebar-collapsed .sidebar .settings {
    display: flex !important;
  }

  .shell.sidebar-collapsed .sidebar-section {
    display: block !important;
  }

  .shell.sidebar-collapsed .sidebar .brand {
    justify-content: flex-start;
  }

  .shell.sidebar-collapsed .sidebar .sidebar-top-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .shell.sidebar-collapsed .sidebar .nav-item {
    justify-content: flex-start;
    padding: 11px 10px;
    gap: 12px;
  }

  .shell.sidebar-collapsed .sidebar .nav-item span {
    font-size: 18px;
  }

  .shell.sidebar-collapsed .sidebar .search-wrap {
    width: 100%;
    padding: 9px 11px;
    margin: 0 0 10px;
  }

  .shell.sidebar-collapsed .sidebar .sidebar-bottom .people {
    justify-content: flex-start;
  }

  .shell.sidebar-collapsed main,
  main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 14px 14px 48px !important;
    box-sizing: border-box;
  }

  .desktop-header {
    display: none !important;
  }

  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 20px;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  }

  .mobile-brand {
    padding: 0;
    font-size: 22px;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-sync-btn {
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 8px;
    height: 38px;
  }

  .mobile-add-btn {
    padding: 8px 16px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    height: 38px;
  }

  .overview {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .fin-assumptions-panel {
    gap: 12px;
    padding: 12px;
  }

  .fin-assumption-group input[type="range"] {
    width: 100%;
  }

  .homes-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================
   Formula Guide & Wealth Explainer Page
   ========================================== */

.explainer-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1100px;
}

.explainer-hero-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
}

.explainer-hero-badge {
  display: inline-block;
  background: rgba(231, 107, 83, 0.2);
  border: 1px solid rgba(231, 107, 83, 0.4);
  color: #fca5a5;
  font: 600 11.5px 'DM Sans', sans-serif;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.explainer-hero-card h3 {
  font: 700 24px 'DM Serif Display', serif;
  margin: 0 0 10px;
  color: #fff;
}

.explainer-hero-card p {
  font: 400 14px/1.7 'DM Sans', sans-serif;
  color: #cbd5e1;
  margin: 0;
}

.explainer-hero-card code {
  background: rgba(255, 255, 255, 0.12);
  color: #fed7aa;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
}

.explainer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 860px) {
  .explainer-grid {
    grid-template-columns: 1fr;
  }
}

.explainer-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.explainer-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.explainer-card-head h4 {
  font: 700 16px 'DM Sans', sans-serif;
  color: var(--ink);
  margin: 0;
}

.explainer-pill {
  font: 700 10px 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
}

.explainer-pill.blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.explainer-pill.green { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.explainer-pill.orange { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.explainer-pill.purple { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }

.explainer-card p {
  font: 400 13px/1.6 'DM Sans', sans-serif;
  color: #475569;
  margin: 0;
}

.formula-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3.5px solid var(--coral);
  border-radius: 6px;
  padding: 10px 14px;
  font: 600 12.5px 'DM Mono', monospace;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-x: auto;
}

.explainer-list {
  margin: 0 0 0 16px;
  padding: 0;
  font: 400 12.5px/1.6 'DM Sans', sans-serif;
  color: #475569;
}

.explainer-list li {
  margin-bottom: 6px;
}

.explainer-deep-dive {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.explainer-deep-dive h3 {
  font: 700 19px 'DM Serif Display', serif;
  color: var(--ink);
  margin: 0 0 6px;
}

.explainer-deep-dive > p {
  font: 400 13.5px/1.6 'DM Sans', sans-serif;
  color: #64748b;
  margin: 0 0 20px;
}

.friction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 860px) {
  .friction-grid {
    grid-template-columns: 1fr;
  }
}

.friction-card {
  border-radius: 10px;
  padding: 18px 20px;
}

.friction-card.buyer {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
}

.friction-card.seller {
  background: #fdf2f8;
  border: 1.5px solid #fbcfe8;
}

.friction-card h4 {
  font: 700 15px 'DM Sans', sans-serif;
  margin: 0 0 6px;
}

.friction-card.buyer h4 { color: #166534; }
.friction-card.seller h4 { color: #9d174d; }

.friction-card > p {
  font: 400 12px 'DM Sans', sans-serif;
  color: #475569;
  margin: 0 0 12px;
}

.friction-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 12px 'DM Sans', sans-serif;
}

.friction-table td {
  padding: 6px 4px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.friction-table td:last-child {
  text-align: right;
}

.simulation-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 860px) {
  .simulation-dual-grid {
    grid-template-columns: 1fr;
  }
}

.sim-card {
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sim-card.buyer-sim {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
}

.sim-card.renter-sim {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
}

.sim-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.sim-icon {
  font-size: 24px;
}

.sim-head h4 {
  font: 700 16px 'DM Sans', sans-serif;
  margin: 0;
  color: var(--ink);
}

.sim-head small {
  font: 500 11.5px 'DM Sans', sans-serif;
  color: #64748b;
}

.sim-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-step {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font: 500 12px 'DM Sans', sans-serif;
  color: #334155;
}

.sim-step code {
  font: 600 11.5px 'DM Mono', monospace;
  background: rgba(0, 0, 0, 0.04);
  padding: 3px 6px;
  border-radius: 4px;
  color: #0f172a;
}

.sim-total {
  margin-top: 6px;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fff;
  border: 1.5px solid #059669;
}

.sim-total span {
  font: 600 11px 'DM Sans', sans-serif;
  text-transform: uppercase;
  color: #047857;
}

.sim-total strong {
  font: 700 13px 'DM Sans', sans-serif;
  color: #064e3b;
}

.sim-delta-banner {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-delta-title {
  font: 700 14px 'DM Sans', sans-serif;
  color: #166534;
}

.sim-delta-banner code {
  font: 700 13px 'DM Mono', monospace;
  color: #14532d;
  background: #dcfce7;
  padding: 6px 12px;
  border-radius: 6px;
  width: fit-content;
}

.sim-delta-banner p {
  font: 400 12.5px/1.5 'DM Sans', sans-serif;
  color: #166534;
  margin: 0;
}

.breakeven-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 860px) {
  .breakeven-timeline {
    grid-template-columns: 1fr;
  }
}

.timeline-node {
  padding: 16px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-node.drag {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
}

.timeline-node.drag strong { color: #dc2626; font-size: 15px; }
.timeline-node.drag span { color: #991b1b; font-weight: 600; font-size: 12.5px; }
.timeline-node.drag small { color: #7f1d1d; font-size: 11.5px; line-height: 1.4; }

.timeline-node.crossover {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
}

.timeline-node.crossover strong { color: #ea580c; font-size: 15px; }
.timeline-node.crossover span { color: #c2410c; font-weight: 600; font-size: 12.5px; }
.timeline-node.crossover small { color: #9a3412; font-size: 11.5px; line-height: 1.4; }

.timeline-node.growth {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
}

.timeline-node.growth strong { color: #16a34a; font-size: 15px; }
.timeline-node.growth span { color: #15803d; font-weight: 600; font-size: 12.5px; }
.timeline-node.growth small { color: #14532d; font-size: 11.5px; line-height: 1.4; }


/* ==========================================
   Screenshot / Image Dropzone & OCR Parser
   ========================================== */

.screenshot-dropzone {
  margin-top: 10px;
  background: #ffffff;
  border: 2px dashed #f97316;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.screenshot-dropzone:hover,
.screenshot-dropzone.dragover {
  background: #fff7ed;
  border-color: #ea580c;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.12);
}

.dropzone-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dropzone-icon {
  font-size: 24px;
}

.dropzone-text {
  text-align: left;
  flex: 1;
}

.dropzone-text strong {
  display: block;
  font-size: 13px;
  color: #1e293b;
}

.dropzone-text small {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.35;
}

.dropzone-btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  white-space: nowrap;
}

.screenshot-previews {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  overflow-x: auto;
}

.screenshot-thumb-wrap {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}

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

.screenshot-thumb-wrap .ocr-status-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 8.5px;
  text-align: center;
  padding: 1px 0;
}

.screenshot-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.screenshot-thumb-remove:hover {
  background: rgba(185, 28, 28, 0.9);
}


/* ==========================================
   Beli-Style Leaderboard & Matchup Modal
   ========================================== */

.beli-leaderboard-card {
  background: #ffffff;
  border: 1px solid #e8e2d7;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 4px 16px rgba(31, 41, 51, 0.04);
  margin-top: 16px;
}

.beli-leaderboard-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #f1ece1;
  margin-bottom: 12px;
}

.beli-stats-badge {
  font: 600 11.5px 'DM Mono', monospace;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 10px;
  border-radius: 20px;
}

.beli-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.beli-leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: #fdfbf7;
  border: 1px solid #eee7db;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.beli-leaderboard-item:hover {
  background: #ffffff;
  border-color: #d7cdbe;
  box-shadow: 0 4px 12px rgba(31, 41, 51, 0.06);
  transform: translateY(-1px);
}

.beli-rank-col {
  display: flex;
  align-items: center;
  gap: 10px;
}

.beli-rank-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 13px 'DM Mono', monospace;
  background: #ede7dc;
  color: #4b5563;
  flex-shrink: 0;
}

.beli-rank-pill.rank-1 { background: #fef08a; color: #854d0e; box-shadow: 0 0 10px rgba(234, 179, 8, 0.35); }
.beli-rank-pill.rank-2 { background: #e2e8f0; color: #334155; }
.beli-rank-pill.rank-3 { background: #ffedd5; color: #9a3412; }

.beli-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.beli-item-info h4 {
  margin: 0;
  font: 600 14px 'Playfair Display', serif;
  color: var(--ink);
}

.beli-item-info p {
  margin: 2px 0 0;
  font: 400 12px 'DM Sans', sans-serif;
  color: #64748b;
}

.beli-item-stats {
  display: flex;
  align-items: center;
  gap: 14px;
}

.beli-score-tag {
  font: 700 14px 'DM Mono', monospace;
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.beli-matchup-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 12px;
  font: 600 12px 'DM Sans', sans-serif;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.beli-matchup-btn:hover {
  background: #f8fafc;
  border-color: var(--coral);
  color: var(--coral);
}

/* Beli Matchup Modal */
.beli-dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(860px, calc(100% - 24px));
  box-shadow: 0 24px 75px rgba(24, 34, 38, 0.28);
  max-height: 94vh;
  overflow: hidden;
}

.beli-dialog-card {
  display: flex;
  flex-direction: column;
  max-height: 94vh;
  background: #faf8f5;
}

.beli-matchup-container {
  padding: 20px;
  overflow-y: auto;
}

.beli-battle-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 720px) {
  .beli-battle-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.beli-battle-card {
  background: #ffffff;
  border: 2px solid #e8e2d7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(31, 41, 51, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  cursor: pointer;
}

.beli-battle-card:hover {
  border-color: var(--coral);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(224, 90, 71, 0.15);
}

.beli-card-media {
  height: 150px;
  position: relative;
  overflow: hidden;
  background: #334155;
}

.beli-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.beli-card-content {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.beli-card-content h3 {
  margin: 0;
  font: 700 16px 'Playfair Display', serif;
  color: var(--ink);
}

.beli-card-meta {
  font: 500 12px 'DM Sans', sans-serif;
  color: #64748b;
}

.beli-card-price {
  font: 700 17px 'DM Sans', sans-serif;
  color: #1e293b;
}

.beli-card-sunk {
  font: 600 12px 'DM Mono', monospace;
  color: #b91c1c;
  background: #fef2f2;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  width: fit-content;
}

.beli-choose-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  font: 700 13px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.beli-battle-card:hover .beli-choose-btn {
  background: var(--coral);
  border-color: var(--coral);
  color: #ffffff;
}

.beli-vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.beli-vs-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 13px 'DM Mono', monospace;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.beli-tie-btn {
  background: #ede7dc;
  border: 1px solid #d7cdbe;
  border-radius: 20px;
  padding: 6px 14px;
  font: 600 11.5px 'DM Sans', sans-serif;
  color: #4b5563;
  cursor: pointer;
  white-space: nowrap;
}

.beli-tie-btn:hover {
  background: #e2d9ca;
}

.beli-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #ede7dc;
}


/* ==========================================
   Mobile Form & Dialog Optimization
   ========================================== */

@media (max-width: 768px) {
  dialog#homeDialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    top: 0 !important;
    left: 0 !important;
    position: fixed !important;
  }

  dialog#homeDialog form {
    padding: 0 !important;
    max-height: 100dvh !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
  }

  dialog#criteriaDialog,
  dialog#syncDialog,
  dialog#inviteDialog,
  dialog#beliDialog {
    width: calc(100vw - 20px) !important;
    max-width: 520px !important;
    max-height: 90dvh !important;
    border-radius: 18px !important;
    margin: auto !important;
  }

  dialog#criteriaDialog form,
  dialog#syncDialog form {
    padding: 18px 16px 20px !important;
    max-height: 90dvh !important;
    overflow-y: auto !important;
  }

  .quick-form-body {
    flex: 1;
    overflow-y: auto;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    padding: 12px 0 6px;
    border-top: 1px solid #e2e8f0;
    margin-top: 12px !important;
    z-index: 10;
  }

  .key-numbers-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .quick-steppers-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .quick-status-rating-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .quick-chips-list {
    flex-wrap: wrap !important;
  }

  .quick-stars-list {
    flex-wrap: wrap !important;
  }
}

/* Expected Offer Price & Delta Styling */
.label-with-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.price-delta-badge {
  font: 700 10.5px 'DM Sans', sans-serif;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.price-delta-badge.discount {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.price-delta-badge.premium {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.card-price-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.card-price-stack .price.has-modeled {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.price-type-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  margin-left: 2px;
}

.expected-offer-pill {
  font: 700 13px 'DM Mono', monospace;
  color: #047857;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 2px 7px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.expected-offer-pill .delta-disc {
  color: #16a34a;
  font-size: 11px;
  font-weight: 700;
}

.expected-offer-pill .delta-prem {
  color: #d97706;
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================
   Zero-Homes Landing Page & Financial Showcase
   ========================================== */

.landing-showcase {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto 40px;
  text-align: left;
}

.landing-auth-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  border: 1.5px solid #fed7aa;
  border-radius: 16px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.06);
}

.landing-auth-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.landing-auth-icon {
  font-size: 26px;
}

.landing-auth-text strong {
  display: block;
  font: 700 14.5px 'DM Sans', sans-serif;
  color: #9a3412;
}

.landing-auth-text p {
  margin: 2px 0 0;
  font: 400 13px 'DM Sans', sans-serif;
  color: #7c2d12;
}

.landing-auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-hero {
  text-align: center;
  padding: 24px 16px 8px;
  max-width: 760px;
  margin: 0 auto;
}

.landing-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff1ee;
  color: var(--coral);
  border: 1px solid #fecdd3;
  padding: 4px 12px;
  border-radius: 999px;
  font: 700 11px 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

.landing-hero h1 {
  font: 700 36px/1.2 'Playfair Display', serif;
  color: var(--ink);
  margin: 0 0 12px;
}

.landing-hero h1 em {
  font-style: italic;
  color: var(--coral);
}

.landing-hero p {
  font: 400 16px/1.6 'DM Sans', sans-serif;
  color: #475569;
  margin: 0 0 24px;
}

.landing-hero-ctas {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Financial Spotlight Card */
.landing-fin-spotlight {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px 26px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.landing-spotlight-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.landing-spotlight-header h2 {
  font: 700 20px 'Playfair Display', serif;
  color: var(--ink);
  margin: 0 0 4px;
}

.landing-spotlight-header p {
  font: 400 13px 'DM Sans', sans-serif;
  color: #64748b;
  margin: 0;
}

.landing-presets-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.landing-preset-btn {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 14px;
  font: 600 12.5px 'DM Sans', sans-serif;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.landing-preset-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: #fff;
}

.landing-preset-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.landing-preset-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.landing-preset-btn:not(.active) .landing-preset-badge {
  background: #e2e8f0;
  color: #475569;
}

/* KPI 3-Cards Grid */
.landing-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.landing-kpi-card {
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.landing-kpi-card.highlight {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border-color: #86efac;
}

.landing-kpi-card.accent {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-color: #bfdbfe;
}

.landing-kpi-tag {
  font: 700 10.5px 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.landing-kpi-card.highlight .landing-kpi-tag {
  color: #166534;
}

.landing-kpi-card.accent .landing-kpi-tag {
  color: #1e40af;
}

.landing-kpi-val {
  font: 700 28px 'DM Mono', monospace;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}

.landing-kpi-val small {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
}

.landing-kpi-card.highlight .landing-kpi-val {
  color: #15803d;
}

.landing-kpi-card.accent .landing-kpi-val {
  color: #1d4ed8;
}

.landing-kpi-sub {
  font: 400 12.5px/1.4 'DM Sans', sans-serif;
  color: #64748b;
}

.landing-kpi-pills {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font: 500 12px 'DM Sans', sans-serif;
  color: #475569;
}

.landing-kpi-pill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-kpi-pill-item strong {
  font-family: 'DM Mono', monospace;
  color: #1e293b;
}

/* Visual Outflow Stacked Bar */
.landing-bar-section {
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px 20px;
  border: 1px solid #e2e8f0;
}

.landing-bar-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font: 600 12.5px 'DM Sans', sans-serif;
  color: #334155;
}

.landing-bar-track {
  height: 22px;
  border-radius: 999px;
  display: flex;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.landing-bar-seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 10px 'DM Sans', sans-serif;
  color: #fff;
  transition: width 0.3s ease;
  white-space: nowrap;
}

.landing-bar-seg.equity { background: #16a34a; }
.landing-bar-seg.interest { background: #ea580c; }
.landing-bar-seg.common { background: #3b82f6; }
.landing-bar-seg.tax { background: #d97706; }

.landing-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font: 500 11.5px 'DM Sans', sans-serif;
  color: #475569;
}

.landing-bar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.equity { background: #16a34a; }
.legend-dot.interest { background: #ea580c; }
.legend-dot.common { background: #3b82f6; }
.legend-dot.tax { background: #d97706; }

/* Interactive Rent Slider */
.landing-rent-adjuster {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 12px 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-rent-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 13px 'DM Sans', sans-serif;
  color: #292524;
}

.landing-rent-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-rent-input {
  width: 110px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid #d6d3d1;
  font: 700 14px 'DM Mono', monospace;
  color: #1c1917;
  text-align: right;
  outline-color: var(--coral);
}

/* Feature Bento Grid */
.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.landing-feature-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.landing-feature-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.landing-feature-icon {
  font-size: 26px;
  margin-bottom: 4px;
}

.landing-feature-card h3 {
  font: 700 15px 'DM Sans', sans-serif;
  color: var(--ink);
  margin: 0;
}

.landing-feature-card p {
  font: 400 13px/1.5 'DM Sans', sans-serif;
  color: #64748b;
  margin: 0;
}

@media (max-width: 680px) {
  .landing-hero h1 { font-size: 28px; }
  .landing-fin-spotlight { padding: 20px 16px; }
  .landing-auth-banner { flex-direction: column; align-items: flex-start; }
  .landing-rent-adjuster { flex-direction: column; align-items: flex-start; }
}

/* ==========================================
   Mobile Add / Edit Home Dialog (Sheet Mode)
   ========================================== */
.tab-label-compact {
  display: none;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  /* Full-Screen Sheet for Add / Edit Home */
  dialog.modern-home-dialog,
  dialog#homeDialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    top: 0 !important;
    left: 0 !important;
    position: fixed !important;
    box-shadow: none !important;
  }

  .modern-home-dialog form,
  dialog#homeDialog form {
    height: 100% !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Safe Area Header */
  .modal-header {
    padding: max(14px, env(safe-area-inset-top)) 16px 12px !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }

  .modal-title {
    font-size: 20px !important;
  }

  .modal-subtitle {
    font-size: 11.5px !important;
    line-height: 1.35 !important;
  }

  .modal-close-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }

  /* Scrollable Body */
  .modal-scroll-body {
    padding: 12px 14px max(24px, calc(env(safe-area-inset-bottom) + 16px)) !important;
    gap: 12px !important;
    -webkit-overflow-scrolling: touch;
  }

  .smart-import-card {
    padding: 12px 12px !important;
    border-radius: 12px !important;
    gap: 10px !important;
  }

  /* Mode Tabs: 3 Equal Columns Segmented Control */
  .import-mode-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 4px !important;
    background: rgba(254, 215, 170, 0.3) !important;
    border-radius: 12px !important;
    border-bottom: none !important;
    margin-bottom: 8px !important;
  }

  .import-tab-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 3px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    gap: 4px !important;
    border: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .tab-label-full {
    display: none !important;
  }

  .tab-label-compact {
    display: inline !important;
  }

  .tab-badge-ai {
    display: none !important;
  }

  /* Voice Card CTA Buttons */
  .voice-cta-row {
    display: grid !important;
    grid-template-columns: 1.15fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .voice-record-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 9px 8px !important;
    font-size: 12px !important;
    box-sizing: border-box !important;
  }

  .voice-upload-label {
    width: 100% !important;
    justify-content: center !important;
    padding: 9px 8px !important;
    font-size: 11.5px !important;
    box-sizing: border-box !important;
  }

  .voice-hint {
    font-size: 11px !important;
    line-height: 1.35 !important;
    margin-top: 6px !important;
  }

  /* Dropzone & Link Input on Mobile */
  .dropzone-content {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 8px !important;
  }

  .dropzone-text {
    text-align: center !important;
  }

  .smart-input-wrap {
    padding: 3px 4px 3px 10px !important;
  }

  .smart-input-wrap input {
    font-size: 12px !important;
  }

  .btn-autofill {
    padding: 6px 10px !important;
    font-size: 11px !important;
  }

  /* Form Cards on Mobile */
  .form-card-section {
    padding: 14px 14px !important;
    border-radius: 12px !important;
    gap: 12px !important;
  }

  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Sticky Action Bar on Mobile */
  .modal-footer {
    padding: 12px 16px max(14px, env(safe-area-inset-bottom)) !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    gap: 8px !important;
  }

  .modal-footer-right {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }

  .btn-modal-cancel {
    flex: 1 !important;
    padding: 11px 12px !important;
    font-size: 13.5px !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .btn-modal-save {
    flex: 2 !important;
    padding: 11px 16px !important;
    font-size: 13.5px !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .btn-delete-home {
    padding: 11px 12px !important;
    font-size: 12.5px !important;
  }
}

/* ==========================================
   Just-Added Card Highlight & Mobile Polish
   ========================================== */

@keyframes justAddedPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(224, 90, 71, 0.65), 0 12px 32px rgba(224, 90, 71, 0.25);
    border-color: var(--coral);
    transform: translateY(-2px);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(224, 90, 71, 0.18), 0 12px 32px rgba(224, 90, 71, 0.2);
    border-color: var(--coral);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(224, 90, 71, 0);
  }
}

.home-card.just-added {
  border-color: var(--coral) !important;
  animation: justAddedPulse 2.4s ease-out;
}

/* Auth Dialog Close Button (prevent overlap with brand mark) */
.auth-dialog-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 5;
}

.auth-dialog-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Mobile Bottom Tab Bar (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 860px) {
  /* Sticky Top Bar */
  .mobile-top-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(246, 243, 238, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin: -14px -14px 12px !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid var(--line);
  }

  .shell.sidebar-collapsed main,
  main {
    padding: 14px 14px calc(86px + env(safe-area-inset-bottom)) !important;
  }

  /* Compact Overview Strip on Mobile (hidden when empty landing page is active) */
  .overview[style*="display: none"] {
    display: none !important;
  }

  .overview {
    display: flex;
    overflow-x: auto;
    gap: 8px !important;
    margin-bottom: 12px !important;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .overview::-webkit-scrollbar {
    display: none;
  }

  .overview .stat,
  .overview .score-card {
    min-height: 0 !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    gap: 8px !important;
    flex: 0 0 auto;
  }

  .overview .stat-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
  }

  .overview .stat strong,
  .overview .score-card strong {
    font-size: 16px !important;
    line-height: 1.1 !important;
  }

  .overview .stat small,
  .overview .score-card span {
    font-size: 11px !important;
    white-space: nowrap;
  }

  .overview .mini-bars {
    display: none !important;
  }

  /* Compact Section Heading on Mobile (hide redundant view-mode-toggle since bottom nav is always visible) */
  .section-heading {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .section-heading h2 {
    font-size: 20px !important;
  }

  .section-heading p {
    font-size: 12px !important;
    margin-top: 2px !important;
  }

  #homesView .view-mode-toggle,
  #financialsView .view-mode-toggle,
  #mapView .view-mode-toggle {
    display: none !important;
  }

  /* Horizontal Single-Row Status Pill Strip on Mobile */
  .status-toolbar-card {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 8px 10px !important;
    margin-bottom: 14px !important;
    gap: 8px !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .status-toolbar-card::-webkit-scrollbar {
    display: none;
  }

  .status-toolbar-title {
    display: none !important;
  }

  .status-toolbar-left,
  .status-pill-group {
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }

  .status-chip,
  .swap-status-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 36px;
    padding: 6px 12px !important;
  }

  /* Map Layout: Show Map ABOVE the Homes List on Mobile */
  .real-map-layout {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 12px !important;
  }

  .real-map-container {
    order: 1 !important;
    height: 52vh !important;
    min-height: 320px !important;
    max-height: 440px !important;
    width: 100% !important;
    border-radius: 14px !important;
  }

  .map-homes-panel {
    order: 2 !important;
    max-height: 320px !important;
  }

  /* Sticky Mobile Bottom Tab Bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #e2e8f0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .mobile-bottom-tab {
    appearance: none;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    min-height: 46px;
    border-radius: 10px;
    color: #64748b;
    font: 600 10.5px 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .mobile-bottom-tab .mobile-tab-icon {
    font-size: 17px;
    line-height: 1.1;
  }

  .mobile-bottom-tab.active {
    color: var(--coral);
    background: #fff1ee;
  }

  .mobile-bottom-add {
    appearance: none;
    border: none;
    background: var(--coral);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    margin: 0 auto;
    width: 56px;
    height: 46px;
    border-radius: 14px;
    font: 700 10px 'DM Sans', sans-serif;
    box-shadow: 0 4px 12px rgba(224, 90, 71, 0.35);
    cursor: pointer;
  }

  .mobile-bottom-add-plus {
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
  }

  /* Toast and Sync Badge positioned above bottom nav on mobile */
  #toast {
    bottom: calc(74px + env(safe-area-inset-bottom)) !important;
  }

  #syncBadge {
    top: 58px !important;
    bottom: auto !important;
    right: 14px !important;
    left: auto !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
  }

  /* Better Touch Targets & 16px Inputs to Prevent iOS Auto-Zoom */
  .input-with-adornment input,
  .smart-input-wrap input,
  .auth-input-wrap input,
  .form-card-section textarea,
  select#sort,
  select#finSort,
  #search {
    font-size: 16px !important;
  }

  .segmented-btn,
  .status-seg-btn,
  .star-seg-btn {
    min-height: 38px !important;
    padding: 8px 4px !important;
    font-size: 12.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal-close-btn,
  .sidebar-mobile-close-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 16px !important;
  }

  .sidebar .filter {
    min-height: 38px !important;
    padding: 8px 10px !important;
  }

  .sidebar .settings {
    min-height: 38px !important;
    padding: 8px 12px !important;
  }

  #mainSearchInput {
    font-size: 16px !important;
  }

  .global-search-bar-wrap {
    margin: 10px 0 16px !important;
  }

  .global-search-kbd {
    display: none !important;
  }
}

/* ==========================================
   Global Instant Search Bar & Typeahead Dropdown
   ========================================== */

.global-search-bar-wrap {
  position: relative;
  margin: 0 0 24px;
  z-index: 80;
}

.global-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid #e2ddd5;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.global-search-box:focus-within {
  border-color: var(--coral);
  box-shadow: 0 4px 16px rgba(242, 105, 76, 0.12), 0 0 0 3px rgba(242, 105, 76, 0.1);
}

.global-search-icon {
  font-size: 17px;
  color: #64748b;
  flex-shrink: 0;
  line-height: 1;
}

.global-search-box:focus-within .global-search-icon {
  color: var(--coral);
}

#mainSearchInput {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: 500 14px/1.35 'DM Sans', sans-serif;
  color: var(--ink);
}

#mainSearchInput::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

#mainSearchInput::-webkit-search-cancel-button,
#search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.global-search-count {
  font: 600 11.5px/1 'DM Mono', monospace;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.global-search-count.no-matches {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.search-clear-btn {
  appearance: none;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}

.search-clear-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.global-search-kbd {
  font: 600 11px/1 'DM Mono', monospace;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 7px;
  flex-shrink: 0;
  user-select: none;
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e2ddd5;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  z-index: 120;
}

.search-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 4px;
  font: 600 10.5px/1.2 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.search-result-item:hover,
.search-result-item.active {
  background: #fff7f4;
}

.search-result-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.search-result-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.search-result-info {
  min-width: 0;
  flex: 1;
}

.search-result-title {
  font: 600 13.5px/1.25 'DM Sans', sans-serif;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-result-sub {
  font: 400 12px/1.3 'DM Sans', sans-serif;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.search-result-snippet {
  font: 400 11px/1.3 'DM Sans', sans-serif;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.search-result-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-result-price {
  font: 700 13px/1 'DM Mono', monospace;
  color: #0f172a;
}

.search-result-edit-btn {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font: 600 11px/1 'DM Sans', sans-serif;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.search-result-edit-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: #fffcfb;
}

.search-highlight-mark {
  background: #fde68a;
  color: #0f172a;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

.search-dropdown-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}








/* ==========================================
   Photo-first Home View Dialog
   ========================================== */
dialog.home-view-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: min(92vh, 900px);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 100px rgba(15, 23, 42, 0.35);
}

dialog.home-view-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.home-view-shell {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 900px);
  position: relative;
}

.home-view-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.home-view-close:hover {
  background: rgba(15, 23, 42, 0.75);
}

.home-view-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 52vh;
  background: #0f172a;
  overflow: hidden;
  flex-shrink: 0;
}

.home-view-hero .photo-carousel-wrap {
  position: absolute;
  inset: 0;
}

.home-view-hero .photo-carousel {
  width: 100%;
  height: 100%;
}

.home-view-hero .photo-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-view-hero .photo-carousel-track::-webkit-scrollbar {
  display: none;
}

.home-view-hero .photo-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
}

.home-view-hero .photo-carousel-slide img,
.home-view-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: static;
  border-radius: 0;
}

.home-view-hero .photo-carousel-dots {
  bottom: 48px;
  z-index: 3;
}

.home-view-hero .photo-carousel-count {
  top: 14px;
  right: 54px;
  z-index: 3;
}

.home-view-hero-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.55), transparent);
  pointer-events: none;
  z-index: 2;
}

.home-view-hero-meta {
  position: absolute;
  left: 14px;
  right: 54px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
}

.home-view-photo-label {
  font: 600 11px 'DM Mono', monospace;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(15, 23, 42, 0.35);
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.home-view-body {
  padding: 16px 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-view-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.home-view-title {
  margin: 0;
  font: 700 22px 'Playfair Display', serif;
  color: #0f172a;
  line-height: 1.25;
}

.home-view-subtitle {
  margin: 4px 0 0;
  font: 500 13px 'DM Sans', sans-serif;
  color: #64748b;
  line-height: 1.4;
}

.home-view-price-stack {
  text-align: right;
  flex-shrink: 0;
}

.home-view-price {
  display: block;
  font: 700 18px 'DM Sans', sans-serif;
  color: #0f172a;
}

.home-view-ppsqft {
  display: block;
  margin-top: 2px;
  font: 500 11.5px 'DM Mono', monospace;
  color: #64748b;
}

.home-view-transit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12px;
  color: #334155;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 10px;
}

.home-view-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-view-tags:empty {
  display: none;
}

.home-view-notes {
  margin: 0;
  font: 400 13px/1.45 'DM Sans', sans-serif;
  color: #475569;
  white-space: pre-wrap;
  max-height: 4.5em;
  overflow: hidden;
}

.home-view-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.home-view-actions .primary,
.home-view-actions .secondary {
  flex: 1;
  padding: 11px 14px;
  border-radius: 10px;
  font: 600 14px 'DM Sans', sans-serif;
  cursor: pointer;
}

.home-view-actions .secondary {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
}

.home-view-actions .secondary.saved {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.home-view-actions .primary {
  border: 0;
  background: #0f172a;
  color: #fff;
}

dialog[open] #toast {
  position: absolute;
  bottom: 18px;
  right: 18px;
  left: 18px;
  width: auto;
  text-align: center;
  z-index: 20;
}

@media (max-width: 640px) {
  dialog.home-view-dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  .home-view-shell {
    max-height: 100dvh;
    height: 100dvh;
  }

  .home-view-hero {
    aspect-ratio: auto;
    height: min(48vh, 420px);
    max-height: none;
    flex: 0 0 auto;
  }

  .home-view-body {
    flex: 1;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
}
