/* ==========================================================================
   Listing Detail Page Styles
   Used by: listing/detail.html
   Requires: public.css loaded first
   ========================================================================== */

/* Page-specific variable overrides */
:root {
  --color-border: #e5e3df;
  --color-border-light: #f0eeea;
  --radius-sm: 4px;
  --radius-md: 8px;
  --mobile-cta-height: 72px;
}

/* ==================== */
/* NEW PHOTO HERO GRID  */
/* ==================== */
/* Prevent horizontal scroll from full-width elements */
body {
  overflow-x: hidden;
}

.photo-hero {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-bottom: 0;
  position: relative;
  max-width: 100vw;
}

/* Detail page badges overlaid on photo hero */
.detail-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  pointer-events: none;
}

.detail-badges .card-badge {
  position: static;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.photo-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(2, 220px);
  gap: 4px;
  cursor: pointer;
}

.photo-grid-item {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e8e6e1 0%, #d4d2cd 100%);
}

.photo-grid-main {
  grid-row: span 2;
}

.photo-grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-grid-item:hover .photo-grid-img {
  transform: scale(1.03);
}

.view-all-photos-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s;
}

.view-all-photos-btn:hover {
  background: #fff;
  transform: scale(1.02);
}

.view-all-photos-btn svg {
  width: 18px;
  height: 18px;
}

/* Photo hero - no photos state */
.photo-hero-empty {
  height: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f4f2 0%, #eae8e4 100%);
  color: var(--color-text-muted);
}

.photo-hero-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* Mobile photo carousel */
.photo-hero-mobile {
  display: none;
  position: relative;
}

.photo-carousel {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.photo-carousel-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #e8e6e1 0%, #d4d2cd 100%);
}

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

.photo-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.photo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: all 0.2s;
}

.photo-dot.active {
  background: white;
  width: 18px;
  border-radius: 3px;
}

.photo-carousel-count {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  z-index: 10;
}

/* ==================== */
/* LIGHTBOX GALLERY     */
/* ==================== */
.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 9999;
  flex-direction: column;
}

.gallery-lightbox.active {
  display: flex;
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  color: #fff;
}

.lightbox-counter {
  font-size: 16px;
  font-weight: 500;
}

.lightbox-actions {
  display: flex;
  gap: 8px;
}

.lightbox-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-btn:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox-close {
  padding: 10px 12px;
}

.lightbox-close svg {
  width: 20px;
  height: 20px;
}

.lightbox-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 80px;
}

.lightbox-image-container {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-thumbnails {
  padding: 16px 24px;
  display: flex;
  gap: 8px;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.lightbox-thumbnails::-webkit-scrollbar {
  display: none;
}

.lightbox-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.2s;
  flex-shrink: 0;
  border: 2px solid transparent;
}

.lightbox-thumb:hover {
  opacity: 0.7;
}

.lightbox-thumb.active {
  opacity: 1;
  border-color: #fff;
}

/* ==================== */
/* TOUR REQUEST MODAL   */
/* ==================== */
.tour-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tour-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.tour-modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.tour-modal-overlay.active .tour-modal {
  transform: translateY(0);
}

.tour-modal-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tour-modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
}

.tour-modal-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

.tour-modal-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  margin: -8px -8px 0 0;
}

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

.tour-modal-close svg {
  width: 20px;
  height: 20px;
  display: block;
}

.tour-modal-property {
  margin: 16px 24px;
  padding: 12px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  align-items: center;
}

.tour-modal-property-photo {
  width: 64px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-border-light);
}

.tour-modal-property-info {
  flex: 1;
  min-width: 0;
}

.tour-modal-property-address {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-modal-property-price {
  font-size: 13px;
  color: var(--color-text-muted);
}

.tour-modal-form {
  padding: 0 24px 24px;
}

.tour-form-group {
  margin-bottom: 16px;
}

.tour-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.tour-form-group input,
.tour-form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
}

.tour-form-group input:focus,
.tour-form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.tour-form-group input::placeholder,
.tour-form-group textarea::placeholder {
  color: var(--color-text-light);
}

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

.tour-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tour-form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

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

.tour-form-submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tour-form-submit:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.tour-form-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.tour-form-submit svg {
  width: 18px;
  height: 18px;
}

.tour-form-submit .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.tour-form-disclaimer {
  margin-top: 12px;
  font-size: 11px;
  color: var(--color-text-light);
  text-align: center;
  line-height: 1.5;
}

.tour-modal-success {
  padding: 48px 24px;
  text-align: center;
  display: none;
}

.tour-modal-success.active {
  display: block;
}

.tour-modal-success svg {
  width: 64px;
  height: 64px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.tour-modal-success h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--color-text);
}

.tour-modal-success p {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 15px;
}

@media (max-width: 480px) {
  .tour-modal {
    max-height: 100vh;
    border-radius: var(--radius-md);
  }

  .tour-form-row {
    grid-template-columns: 1fr;
  }

  .tour-modal-header {
    padding: 20px 20px 0;
  }

  .tour-modal-property {
    margin: 16px 20px;
  }

  .tour-modal-form {
    padding: 0 20px 20px;
  }
}

/* ==================== */
/* DISCUSS MODAL        */
/* ==================== */
.discuss-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.discuss-modal-overlay.active {
  opacity: 1;
}

.discuss-modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.discuss-modal-overlay.active .discuss-modal {
  transform: translateY(0);
}

.discuss-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 0;
}

.discuss-modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--color-accent);
  margin: 0;
}

.discuss-modal-subtitle {
  color: var(--color-muted);
  font-size: 14px;
  margin-top: 4px;
}

.discuss-modal-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--color-muted);
  transition: color 0.2s;
}

.discuss-modal-close:hover {
  color: var(--color-text);
}

.discuss-modal-close svg {
  width: 20px;
  height: 20px;
}

.discuss-modal-property {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-bg);
  margin: 16px 24px;
  padding: 12px;
  border-radius: var(--radius-sm);
}

.discuss-modal-property-photo {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.discuss-modal-property-info {
  flex: 1;
}

.discuss-modal-property-address {
  font-weight: 500;
  color: var(--color-text);
  font-size: 14px;
}

.discuss-modal-property-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-accent);
}

.discuss-modal-form {
  padding: 0 24px 24px;
}

.discuss-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .discuss-form-row {
    grid-template-columns: 1fr;
  }
}

.discuss-form-group {
  margin-bottom: 16px;
}

.discuss-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.discuss-form-group input,
.discuss-form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.discuss-form-group input:focus,
.discuss-form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(31, 36, 55, 0.1);
}

.discuss-form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.discuss-form-submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.discuss-form-submit:hover {
  background: #34405e;
}

.discuss-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.discuss-form-submit svg {
  width: 20px;
  height: 20px;
}

.discuss-form-disclaimer {
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
  margin-top: 16px;
}

.discuss-modal-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.discuss-modal-success.active {
  display: flex;
}

.discuss-modal-success svg {
  width: 64px;
  height: 64px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.discuss-modal-success h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--color-accent);
  margin: 0 0 8px;
}

.discuss-modal-success p {
  color: var(--color-muted);
  font-size: 15px;
  margin: 0;
}

.discuss-login-prompt {
  text-align: center;
  padding: 40px 24px;
}

.discuss-login-prompt p {
  color: var(--color-muted);
  margin-bottom: 16px;
}

.discuss-login-prompt a {
  display: inline-block;
  padding: 12px 24px;
  background: var(--color-accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.2s;
}

.discuss-login-prompt a:hover {
  background: #34405e;
}

@media (max-width: 480px) {
  .discuss-modal {
    max-height: 100vh;
    border-radius: var(--radius-md);
  }

  .discuss-modal-header {
    padding: 20px 20px 0;
  }

  .discuss-modal-property {
    margin: 16px 20px;
  }

  .discuss-modal-form {
    padding: 0 20px 20px;
  }
}

/* ==================== */
/* LISTING HEADER       */
/* ==================== */
.listing-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  padding: 12px 0;
  position: sticky;
  top: 60px;
  z-index: 50;
  transition: box-shadow 0.3s;
}

.listing-header.scrolled {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.listing-header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.listing-header-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.listing-header-price-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.listing-price-hero {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}

.listing-price-context {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

.listing-address-hero {
  font-style: normal;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.listing-address-hero .street {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

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

.listing-specs-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.listing-specs-hero .spec strong {
  font-weight: 600;
  color: var(--color-text);
}

.spec-divider {
  color: var(--color-border);
}

.listing-header .status-badge {
  margin: 0;
}

/* ==================== */
/* ACTION BUTTONS       */
/* ==================== */
.listing-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.cta-primary:hover {
  background: var(--color-accent-hover, #141827);
}

.cta-primary svg {
  width: 16px;
  height: 16px;
}

.cta-secondary-group {
  display: flex;
  gap: 4px;
}

.cta-secondary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.cta-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.cta-secondary svg {
  width: 18px;
  height: 18px;
}

.cta-icon-only {
  padding: 8px;
  flex-direction: row;
}

.cta-icon-only svg {
  width: 20px;
  height: 20px;
}

/* Header icon button group */
.header-icon-group {
  display: flex;
  gap: 8px;
}

.cta-secondary.active {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.cta-secondary.active svg.heart-icon {
  fill: var(--color-accent);
}

/* ==================== */
/* MOBILE STICKY CTA    */
/* ==================== */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 12px 16px;
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

.mobile-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-cta-price {
  display: flex;
  flex-direction: column;
}

.mobile-cta-price .price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
}

.mobile-cta-price .address {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.mobile-cta-bar .cta-primary {
  flex-shrink: 0;
  padding: 12px 20px;
  font-size: 14px;
}

/* Main Layout */
.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 40px 120px; /* Extra bottom padding for compare bar */
  width: 100%;
  box-sizing: border-box;
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color 0.2s;
}

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

.back-link svg {
  width: 16px;
  height: 16px;
}

/* Hero Section */
.listing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 32px;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
  width: 100%;
}

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

/* Photo Gallery */
.photo-section {
  position: relative;
  width: 100%;
  min-width: 0;
}

.main-photo-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #e8e6e1 0%, #d4d2cd 100%);
  aspect-ratio: 16/10;
  width: 100%;
}

.main-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.main-photo-container:hover .main-photo {
  transform: scale(1.02);
}

.photo-count {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.photo-count svg {
  width: 16px;
  height: 16px;
}

.photo-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.photo-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.photo-thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.photo-thumbnails::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.photo-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s ease;
  flex-shrink: 0;
  border: 2px solid transparent;
}

.photo-thumb:hover {
  opacity: 0.8;
}

.photo-thumb.active {
  opacity: 1;
  border-color: var(--color-accent);
}

.no-photos {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  background: linear-gradient(135deg, #f5f4f2 0%, #eae8e4 100%);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}

.no-photos svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.no-photos span {
  font-size: 15px;
}

.photo-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8e6e1 0%, #d4d2cd 100%);
  color: var(--color-text-muted);
  gap: 8px;
}

.photo-placeholder svg {
  width: 80px;
  height: 80px;
  opacity: 0.25;
}

.photo-placeholder span {
  font-size: 16px;
  font-weight: 500;
}

.photo-placeholder .photo-note {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.7;
}

.photo-thumb-wrapper {
  position: relative;
  width: 80px;
  height: 60px;
  flex-shrink: 0;
}

.thumb-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #e0ded9 0%, #d0cec9 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.thumb-placeholder span {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-light);
}

.thumb-placeholder:hover {
  background: linear-gradient(135deg, #d5d3ce 0%, #c5c3be 100%);
}

.thumb-placeholder.active {
  border-color: var(--color-accent);
}

.thumb-placeholder.active span {
  color: var(--color-accent);
}

/* Info Card */
.info-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.6s ease 0.1s forwards;
  opacity: 0;
}

/* Status badge positioning override (base styles in public.css) */
.status-badge {
  margin-bottom: 16px;
}

.listing-price {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.price-label {
  font-size: 13px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
}

.listing-address {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.street-address {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.3;
}

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

/* Property Specs */
.property-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.spec-item {
  text-align: center;
  padding: 16px 8px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.spec-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.spec-label {
  font-size: 11px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* Key Facts */
.key-facts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.key-fact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.key-fact-label {
  font-size: 14px;
  color: var(--color-text-muted);
}

.key-fact-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* Details Section */
/* Content wrapper for sections below the header */
.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 0 16px;
  }
}

.details-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.2s forwards;
  opacity: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  width: 100%;
}

.detail-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.detail-card-icon {
  width: 40px;
  height: 40px;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.detail-card-icon svg {
  width: 20px;
  height: 20px;
}

.detail-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.detail-label {
  font-size: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  text-align: right;
}

/* Agent Card */
.agent-card {
  background: linear-gradient(135deg, var(--color-accent) 0%, #141827 100%);
  color: #fff;
}

.agent-card .detail-card-header {
  border-bottom-color: rgba(255,255,255,0.15);
}

.agent-card .detail-card-icon {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.agent-card .detail-card-title {
  color: #fff;
}

.agent-card .detail-label {
  color: rgba(255,255,255,0.6);
}

.agent-card .detail-value {
  color: #fff;
}

.agent-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.agent-card-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.agent-card-btn svg {
  width: 18px;
  height: 18px;
}

.agent-card-btn--primary {
  background: white;
  color: var(--color-accent);
}

.agent-card-btn--primary:hover {
  background: #f0f0f0;
}

.agent-card-btn--secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.agent-card-btn--secondary:hover {
  background: rgba(255,255,255,0.25);
}

/* Listing Agents / Representation Card */
.listing-agents-card {
  background: var(--color-surface);
}

.listing-agents-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.listing-agent-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border-light);
}

.listing-agent-block:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.listing-agent-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.listing-agent-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.listing-agent-office {
  font-size: 13px;
  color: var(--color-text-muted);
}

.listing-agent-contact {
  font-size: 13px;
  color: var(--color-text-muted);
}

.listing-agent-contact a {
  color: var(--color-primary);
  text-decoration: none;
}

.listing-agent-contact a:hover {
  text-decoration: underline;
}

/* Track This Property */
.property-track-card {
  background: linear-gradient(135deg, #f0f7f4 0%, #e4efe9 100%);
  border: 1px solid rgba(31, 36, 55, 0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.property-track-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.property-track-header:hover {
  background: rgba(31, 36, 55, 0.05);
}

.property-track-header.tracked {
  cursor: default;
}

.property-track-header.tracked:hover {
  background: transparent;
}

.property-track-icon {
  width: 38px;
  height: 38px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.property-track-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.property-track-header.tracked .property-track-icon {
  background: var(--color-success);
}

.property-track-label {
  flex: 1;
  min-width: 0;
}

.property-track-title {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.property-track-subtitle {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.property-track-chevron {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.25s ease;
}

.property-track-header.open .property-track-chevron {
  transform: rotate(180deg);
}

.property-track-header.tracked .property-track-chevron {
  display: none;
}

.property-track-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.property-track-body.open {
  max-height: 320px;
}

.property-track-body form {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.property-track-body form input[type="text"],
.property-track-body form input[type="email"] {
  padding: 10px 14px;
  border: 1px solid rgba(31, 36, 55, 0.2);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.property-track-body form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 36, 55, 0.1);
}

.property-track-freq {
  display: flex;
  gap: 8px;
}

.property-track-pill {
  flex: 1;
  cursor: pointer;
}

.property-track-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.property-track-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1.5px solid rgba(31, 36, 55, 0.2);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: #fff;
  transition: all 0.15s;
  white-space: nowrap;
}

.property-track-pill:hover span {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.property-track-pill input:checked + span {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.property-track-btn {
  padding: 12px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 2px;
}

.property-track-btn:hover {
  background: var(--color-primary-hover);
}

.property-track-btn:active {
  transform: scale(0.98);
}

.property-track-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.property-track-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
}

.property-track-success svg {
  color: var(--color-success);
}

.property-track-success span {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
}

@media (max-width: 480px) {
  .property-track-freq {
    flex-direction: column;
  }
}

/* Description */
.description-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.3s forwards;
  opacity: 0;
}

.description-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.description-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-muted);
}

/* Features Section */
.features-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.35s forwards;
  opacity: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.feature-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-light);
}

.feature-card-icon {
  width: 32px;
  height: 32px;
  background: var(--color-accent-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.feature-card-icon svg {
  width: 16px;
  height: 16px;
}

.feature-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--color-bg);
  border-radius: 20px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.feature-tag svg {
  width: 12px;
  height: 12px;
  color: var(--color-accent);
}

.feature-empty {
  color: var(--color-text-light);
  font-size: 13px;
  font-style: italic;
}

/* Quick Stats Bar */
.quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
}

.quick-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.quick-stat-icon {
  color: var(--color-accent);
}

.quick-stat-icon svg {
  width: 18px;
  height: 18px;
}

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

.quick-stat-value {
  font-weight: 600;
  color: var(--color-text);
}

/* Video/Media Section */
.video-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.4s forwards;
  opacity: 0;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.media-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.media-card--tour {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--color-surface);
  border: none;
}

.media-card--tour:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(31, 36, 55, 0.2);
}

.tour-preview {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #141827 0%, #1f2437 50%, #34405e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tour-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.tour-icon-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.tour-icon-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); border-color: rgba(255,255,255,0.3); }
  50% { transform: scale(1.05); border-color: rgba(255,255,255,0.5); }
}

.tour-icon-inner {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.tour-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tour-content {
  padding: 16px 20px;
  background: var(--color-surface);
}

.tour-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--color-text);
  margin-bottom: 4px;
}

.tour-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-accent);
  font-weight: 500;
}

.tour-action svg {
  transition: transform 0.2s;
}

.media-card--tour:hover .tour-action svg {
  transform: translateX(4px);
}

.media-card-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #141827 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.media-card-content {
  flex: 1;
}

.media-card-label {
  font-weight: 600;
  font-size: 17px;
  color: var(--color-text);
  margin-bottom: 4px;
}

.media-card-action {
  font-size: 14px;
  color: var(--color-accent);
  font-weight: 500;
}

/* Video card - YouTube link style */
.media-card--video {
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.video-preview {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a1a 0%, #282828 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-btn {
  width: 72px;
  height: 72px;
  background: #ff0000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4);
}

.media-card--video:hover .video-play-btn {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(255, 0, 0, 0.5);
}

.video-play-btn svg {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

.video-yt-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.video-yt-badge svg {
  width: 20px;
  height: 14px;
}

.video-content {
  padding: 16px 20px;
  background: var(--color-surface);
}

.video-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
  margin-bottom: 4px;
}

.video-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #ff0000;
  font-weight: 500;
}

.video-action svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.media-card--video:hover .video-action svg {
  transform: translateX(4px);
}

/* Legacy video player styles (for embeddable videos) */
.video-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.video-player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-caption {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* Documents Section */
.documents-section {
  margin-top: 32px;
  padding: 24px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.documents-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.documents-header-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #141827 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.documents-header-text h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.documents-header-text p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 2px 0 0;
}

.subsection-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text);
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.document-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.document-card:hover {
  border-color: var(--color-accent);
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.document-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.document-icon--pdf {
  background: #fee2e2;
  color: #dc2626;
}

.document-icon--image {
  background: #dbeafe;
  color: #2563eb;
}

.document-icon--floorplan {
  background: #d1fae5;
  color: #059669;
}

.document-icon--other {
  background: #f3f4f6;
  color: #6b7280;
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 2px;
}

.document-type {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.document-download {
  color: var(--color-accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.document-card:hover .document-download {
  opacity: 1;
}

/* Floor Plans Display */
.floor-plans-section {
  margin-bottom: 24px;
}

.floor-plans-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

.floor-plans-title svg {
  color: var(--color-accent);
}

.floor-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
  gap: 16px;
}

.floor-plan-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.floor-plan-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.floor-plan-image-container {
  position: relative;
  background: #f8f9fa;
  padding: 12px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floor-plan-image {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.floor-plan-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.floor-plan-card:hover .floor-plan-zoom {
  opacity: 1;
}

.floor-plan-info {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
}

.floor-plan-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.floor-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #d1fae5;
  color: #059669;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 12px;
}

/* Floor Plan Lightbox */
.floor-plan-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.floor-plan-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.floor-plan-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.floor-plan-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.floor-plan-lightbox.active .floor-plan-lightbox-content {
  transform: scale(1);
}

.floor-plan-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.floor-plan-lightbox-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--color-text);
}

.floor-plan-lightbox-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  border-radius: 50%;
  transition: all 0.2s;
}

.floor-plan-lightbox-close:hover {
  background: var(--color-background);
  color: var(--color-text);
}

.floor-plan-lightbox-body {
  padding: 20px;
  background: #f8f9fa;
  max-height: calc(90vh - 80px);
  overflow: auto;
}

.floor-plan-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(85vh - 100px);
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Legacy virtual tour link (keep for compatibility) */
.virtual-tour-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.virtual-tour-link:hover {
  background: var(--color-accent-dark);
}

.virtual-tour-link svg {
  width: 20px;
  height: 20px;
}

/* Schools Card Styling */
.schools-card .detail-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.schools-card .detail-row:last-child {
  border-bottom: none;
}

.school-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-accent-light);
  border-radius: 4px;
  margin-right: 8px;
}

.school-icon svg {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
}

/* Loading state override (base styles in public.css) */
.loading-state {
  min-height: 60vh;
}

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

/* Responsive */
@media (max-width: 1000px) {
  .listing-hero {
    grid-template-columns: 1fr;
  }

  .info-card {
    order: -1;
  }

  .main-photo-container {
    aspect-ratio: 16/9;
  }

  .property-specs {
    grid-template-columns: repeat(3, 1fr);
  }

  .photo-grid {
    grid-template-rows: repeat(2, 180px);
  }

  .listing-header-content {
    flex-direction: column;
    gap: 20px;
  }

  .listing-header-actions {
    width: 100%;
    flex-direction: row;
    gap: 8px;
  }

  .cta-primary {
    flex: 1;
  }

  .cta-secondary-group {
    flex: 1;
  }
}

@media (max-width: 768px) {
  .page-wrapper {
    padding: 16px 16px 100px;
  }

  .back-link {
    margin-bottom: 16px;
  }

  /* Hide desktop photo grid, show mobile carousel */
  .photo-grid {
    display: none;
  }

  .photo-hero-mobile {
    display: block;
  }

  .photo-hero {
    margin-left: -16px;
    width: calc(100% + 32px);
  }

  /* Mobile listing header */
  .listing-header {
    position: relative;
    top: 0;
    padding: 16px 0;
  }

  .listing-header-content {
    padding: 0 16px;
  }

  .listing-header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .listing-header-price-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .listing-price-hero {
    font-size: 26px;
  }

  .listing-address-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .listing-address-hero .street {
    font-size: 16px;
  }

  .listing-specs-hero {
    margin-top: 4px;
  }

  .listing-specs-hero .spec {
    font-size: 13px;
  }

  /* Hide desktop CTAs on mobile, show mobile bar */
  .listing-header-actions {
    display: none;
  }

  .mobile-cta-bar {
    display: block;
  }

  /* Lightbox mobile adjustments */
  .lightbox-content {
    padding: 0 16px;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-thumbnails {
    display: none;
  }
}

@media (max-width: 600px) {
  .listing-price {
    font-size: 32px;
  }

  .street-address {
    font-size: 20px;
  }

  .property-specs {
    grid-template-columns: repeat(2, 1fr);
  }

  .spec-value {
    font-size: 22px;
  }

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

/* Mortgage Calculator */
.calculator-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.5s forwards;
  opacity: 0;
}

.calculator-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Live Rate Button */
.use-live-rate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #166534;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: all 0.2s;
  opacity: 0.6;
}

.use-live-rate-btn.loaded {
  opacity: 1;
}

.use-live-rate-btn:hover {
  background: #dcfce7;
  border-color: #86efac;
}

.use-live-rate-btn.applied {
  background: #166534;
  color: white;
  border-color: #166534;
}

.live-rate-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.live-rate-source {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

.live-rate-source a {
  color: #6b7280;
  text-decoration: none;
}

.live-rate-source a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.calc-input-group input,
.calc-input-group select {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.calc-input-group input:focus,
.calc-input-group select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.calc-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #141827 100%);
  border-radius: var(--radius-lg);
  color: #fff;
}

.calc-result-label {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.calc-result-amount {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 16px;
}

.calc-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  opacity: 0.9;
}

.calc-breakdown-item {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

/* Share Buttons */
.share-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
}

.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-row:first-child .compare-btn-text {
  width: 100%;
  justify-content: center;
}

/* Analyze CTA - placed below price */
.analyze-cta-wrapper {
  margin-top: 16px;
  margin-bottom: 8px;
}

.analyze-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-accent) 0%, #141827 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(31, 36, 55, 0.3);
}

.analyze-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 36, 55, 0.4);
}

.analyze-cta svg {
  width: 20px;
  height: 20px;
}

.analyze-cta-subtitle {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 2px;
}

.share-label {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.share-buttons {
  display: flex;
  gap: 8px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.share-btn svg {
  width: 18px;
  height: 18px;
}

.share-btn.copied {
  border-color: #22c55e;
  color: #22c55e;
  background: #f0fdf4;
}

/* Open Houses Section (RESO V3) */
.open-houses-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.5s forwards;
  opacity: 0;
}

.open-houses-banner {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  color: white;
}

.open-houses-banner-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.open-houses-banner-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.open-houses-banner-icon svg {
  width: 24px;
  height: 24px;
}

.open-houses-banner h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.open-houses-banner p {
  margin: 0 0 16px;
  opacity: 0.9;
  font-size: 15px;
}

.open-houses-banner-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.open-houses-banner-cta button,
.open-houses-banner-cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  border: none;
}

.open-houses-banner-cta .btn-primary {
  background: white;
  color: #5b21b6;
}

.open-houses-banner-cta .btn-primary:hover {
  background: #f3e8ff;
}

.open-houses-banner-cta .btn-secondary {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.open-houses-banner-cta .btn-secondary:hover {
  background: rgba(255,255,255,0.3);
}

.open-houses-banner-cta svg {
  width: 18px;
  height: 18px;
}

.open-houses-section .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.open-houses-section .section-title svg {
  color: var(--color-accent);
}

.open-houses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.open-house-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.open-house-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.open-house-date-badge {
  background: #7c3aed;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  text-align: center;
  min-width: 60px;
}

.open-house-date-badge .day {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.open-house-date-badge .month {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.open-house-weekday {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.open-house-time {
  font-size: 18px;
  color: #7c3aed;
  font-weight: 600;
}

.open-house-remarks {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-light);
}

.open-house-actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

.open-house-actions button,
.open-house-actions a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.open-house-actions button:hover,
.open-house-actions a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.open-house-actions svg {
  width: 16px;
  height: 16px;
}

.calendar-dropdown {
  position: relative;
}

.calendar-dropdown-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
  z-index: 100;
  overflow: hidden;
}

.calendar-dropdown-menu.show {
  display: block;
}

.calendar-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  border: none;
  justify-content: flex-start;
}

.calendar-dropdown-menu a:hover {
  background: var(--color-bg);
}

.calendar-dropdown-menu a svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
}

/* Price History Section (RESO V3) */
.price-history-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.52s forwards;
  opacity: 0;
}

.price-history-section .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-history-section .section-title svg {
  color: var(--color-accent);
}

.price-history-timeline {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.history-event {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  position: relative;
}

.history-event:not(.history-event-last)::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.history-event-last {
  padding-bottom: 0;
}

.history-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.history-marker.marker-sold {
  background: #22c55e;
}

.history-content {
  flex: 1;
}

.history-type {
  font-weight: 600;
  color: var(--color-text);
  font-size: 15px;
}

.history-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 4px 0;
}

.history-price.price-down {
  color: #dc2626;
}

.history-price.price-up {
  color: #16a34a;
}

.history-change {
  font-size: 14px;
  font-weight: 500;
}

.history-date {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Map Section */
.map-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.55s forwards;
  opacity: 0;
}

.map-container {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.map-embed {
  height: 300px;
  width: 100%;
}

.map-placeholder {
  height: 300px;
  background: linear-gradient(135deg, #e8e6e1 0%, #d4d2cd 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  gap: 12px;
}

.map-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.map-placeholder span {
  font-size: 14px;
}

.map-loading {
  height: 300px;
  background: linear-gradient(135deg, #e8e6e1 0%, #d4d2cd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.map-loading::after {
  content: 'Loading map...';
  font-size: 14px;
}

.map-address {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-address-icon {
  width: 40px;
  height: 40px;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.map-address-icon svg {
  width: 20px;
  height: 20px;
}

.map-address-text {
  flex: 1;
}

.map-address-street {
  font-weight: 600;
  color: var(--color-text);
}

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

.map-directions-btn {
  padding: 10px 20px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.map-directions-btn:hover {
  background: var(--color-accent-dark);
}

/* Similar Homes */
.similar-section {
  margin-top: 48px;
  animation: fadeUp 0.6s ease 0.6s forwards;
  opacity: 0;
}

.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* Similar card wrapper for positioning buttons */
.similar-card-wrapper {
  position: relative;
}

.similar-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

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

.similar-photo {
  height: 160px;
  background: linear-gradient(135deg, #e8e6e1 0%, #d4d2cd 100%);
  position: relative;
}

/* Position action buttons on similar cards */
.similar-card-wrapper .action-btn {
  position: absolute;
  top: 12px;
  z-index: 5;
}

.similar-card-wrapper .action-btn--compare {
  right: 12px;
}

.similar-card-wrapper .action-btn--save {
  right: 54px;
}

.similar-card-wrapper .action-btn--analyze {
  right: 96px;
}

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

.similar-photo .photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.similar-photo .photo-count svg {
  width: 12px;
  height: 12px;
}

.similar-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.similar-info {
  padding: 16px;
}

.similar-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.similar-address {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.similar-specs {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.similar-spec {
  display: flex;
  align-items: center;
  gap: 4px;
}

.similar-spec strong {
  color: var(--color-text);
}

.similar-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: var(--color-text-muted);
}

/* Print button */
.print-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.print-btn svg {
  width: 16px;
  height: 16px;
}

/* Print Styles */
@media print {
  /* Reset and base styles */
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  body {
    background: #fff !important;
    font-size: 11pt;
    line-height: 1.4;
    color: #1a1a1a !important;
    margin: 0;
    padding: 0;
  }

  /* Page setup */
  @page {
    margin: 0.4in 0.5in 0.6in 0.5in;
    size: letter;
  }

  @page :first {
    margin-top: 0.3in;
  }

  /* Hide interactive/non-essential elements */
  .back-link,
  .share-section,
  .calculator-section,
  .similar-section,
  .map-section,
  .video-section,
  .print-btn,
  .photo-thumbnails,
  .photo-count,
  .loading-state,
  nav,
  .nav-wrapper,
  footer {
    display: none !important;
  }

  /* Show print-only elements */
  .print-only {
    display: block !important;
  }

  .print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 16px;
    margin-bottom: 20px;
    border-bottom: 2px solid #34405e;
  }

  .print-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .print-header-logo {
    font-family: var(--font-display), Georgia, serif;
    font-size: 22pt;
    font-weight: 600;
    color: #34405e;
    letter-spacing: -0.02em;
  }

  .print-header-tagline {
    font-size: 9pt;
    color: #666;
    margin-top: 2px;
  }

  .print-header-info {
    text-align: right;
    font-size: 9pt;
    color: #444;
    line-height: 1.5;
  }

  .print-header-date {
    font-weight: 600;
    color: #34405e;
  }

  /* Print footer */
  .print-footer {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 0.5in;
    border-top: 1px solid #ddd;
    background: #fff;
    font-size: 8pt;
    color: #666;
  }

  .print-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .print-footer-disclaimer {
    max-width: 65%;
    font-style: italic;
  }

  .print-footer-contact {
    text-align: right;
  }

  .print-footer-contact strong {
    color: #34405e;
  }

  /* Page wrapper adjustments */
  .page-wrapper {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Hero section - side by side layout */
  .listing-hero {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-bottom: 24px;
    opacity: 1 !important;
    animation: none !important;
  }

  /* Main photo styling */
  .photo-section {
    width: 100%;
  }

  .main-photo-container {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
    aspect-ratio: 16/10;
    background: #f5f5f5;
  }

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

  .photo-placeholder,
  .no-photos {
    background: #f0f0f0 !important;
    border: 1px solid #ddd;
    border-radius: 6px;
  }

  /* Info card styling */
  .info-card {
    box-shadow: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    background: #fff !important;
    opacity: 1 !important;
    animation: none !important;
  }

  .status-badge {
    font-size: 9pt;
    padding: 4px 10px;
  }

  .listing-price {
    font-size: 28pt;
    color: #1a1a1a !important;
  }

  .price-label {
    font-size: 9pt;
    margin-bottom: 16px;
  }

  .street-address {
    font-size: 16pt;
    color: #1a1a1a !important;
  }

  .city-state {
    font-size: 11pt;
  }

  /* Property specs */
  .property-specs {
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  .spec-item {
    padding: 10px 6px;
    background: #f8f8f8 !important;
    border: 1px solid #eee;
    border-radius: 4px;
  }

  .spec-value {
    font-size: 18pt;
    color: #1a1a1a !important;
  }

  .spec-label {
    font-size: 8pt;
  }

  /* Key facts */
  .key-facts {
    gap: 8px;
  }

  .key-fact {
    padding: 6px 0;
    border-bottom: 1px dotted #ddd;
  }

  .key-fact:last-child {
    border-bottom: none;
  }

  .key-fact-label,
  .key-fact-value {
    font-size: 10pt;
    color: #333 !important;
  }

  /* Quick stats */
  .quick-stats {
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    flex-wrap: wrap;
  }

  .quick-stat {
    padding: 6px 10px;
    background: #f5f5f5 !important;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 9pt;
  }

  .quick-stat-icon {
    color: #34405e !important;
  }

  .quick-stat-value {
    color: #1a1a1a !important;
  }

  /* Section titles */
  .section-title {
    font-size: 14pt;
    margin-top: 20px;
    margin-bottom: 12px;
    color: #34405e !important;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
  }

  /* Details section */
  .details-section {
    margin-top: 24px;
    opacity: 1 !important;
    animation: none !important;
  }

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

  .detail-card {
    box-shadow: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .detail-card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .detail-card-icon {
    width: 28px;
    height: 28px;
    background: #e4eaf2 !important;
    color: #34405e !important;
  }

  .detail-card-icon svg {
    width: 14px;
    height: 14px;
  }

  .detail-card-title {
    font-size: 11pt;
    color: #1a1a1a !important;
  }

  .detail-row {
    padding: 4px 0;
  }

  .detail-label,
  .detail-value {
    font-size: 9pt;
    color: #333 !important;
  }

  .detail-value {
    font-weight: 600;
  }

  /* Agent card special treatment */
  .agent-card {
    background: #f8f8f8 !important;
    border: 2px solid #34405e !important;
  }

  .agent-card .detail-card-header {
    border-bottom-color: #ddd !important;
  }

  .agent-card .detail-card-icon {
    background: #34405e !important;
    color: #fff !important;
  }

  .agent-card .detail-card-title,
  .agent-card .detail-label,
  .agent-card .detail-value {
    color: #1a1a1a !important;
  }

  /* Description */
  .description-section {
    margin-top: 24px;
    opacity: 1 !important;
    animation: none !important;
  }

  .description-card {
    box-shadow: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
    background: #fff !important;
  }

  .description-text {
    font-size: 10pt;
    line-height: 1.6;
    color: #333 !important;
  }

  /* Features section */
  .features-section {
    margin-top: 24px;
    opacity: 1 !important;
    animation: none !important;
  }

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

  .feature-card {
    box-shadow: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px;
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .feature-card-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .feature-card-icon {
    width: 24px;
    height: 24px;
    background: #e4eaf2 !important;
    color: #34405e !important;
  }

  .feature-card-icon svg {
    width: 12px;
    height: 12px;
  }

  .feature-card-title {
    font-size: 10pt;
    color: #1a1a1a !important;
  }

  .feature-list {
    gap: 6px;
  }

  .feature-tag {
    padding: 4px 8px;
    background: #f5f5f5 !important;
    border: 1px solid #eee;
    font-size: 8pt;
    color: #333 !important;
    border-radius: 3px;
  }

  .feature-tag svg {
    display: none;
  }

  /* Schools card */
  .schools-card .detail-row {
    padding: 6px 0;
  }

  .school-icon {
    background: #e4eaf2 !important;
  }

  .school-icon svg {
    color: #34405e !important;
  }

  /* Ensure content doesn't overlap footer */
  .page-wrapper {
    padding-bottom: 60px !important;
  }

  /* Force page breaks appropriately */
  .features-section,
  .description-section {
    page-break-before: auto;
  }

  h2.section-title {
    page-break-after: avoid;
  }

  /* Ensure animations don't affect print */
  * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
  }
}

/* Print-only elements - hidden on screen */
.print-only {
  display: none;
}

/* Responsive adjustments for new sections */
@media (max-width: 768px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .calc-result-amount {
    font-size: 36px;
  }

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

  .share-section {
    flex-wrap: wrap;
  }
}

/* Document Request Modal - Checklist */
.document-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  max-height: 200px;
  overflow-y: auto;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.document-checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.15s ease;
}

.document-checkbox-item:hover {
  border-color: var(--color-primary, #1f2437);
  background: #f0fdf4;
}

.document-checkbox-item:has(input:checked) {
  border-color: var(--color-primary, #1f2437);
  background: #f0fdf4;
}

.document-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary, #1f2437);
  cursor: pointer;
}

.document-checkbox-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  border-radius: 6px;
  color: #6b7280;
}

.document-checkbox-item:has(input:checked) .document-checkbox-icon {
  background: var(--color-primary, #1f2437);
  color: #fff;
}

.document-checkbox-name {
  flex: 1;
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

/* ============================================
   Flood Zone Section
   ============================================ */

.flood-zone-container {
  margin-top: 16px;
  border-top: 1px solid var(--color-border, #e5e7eb);
  padding-top: 16px;
}

.flood-zone-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  color: #6b7280;
  font-size: 14px;
}

.flood-zone-loading .loading-spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.flood-zone-card,
.flood-zone-info-card {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid;
}

.flood-zone-card.flood-low,
.flood-zone-info-card.flood-low {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

.flood-zone-card.flood-moderate,
.flood-zone-info-card.flood-moderate {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border-color: #fde047;
}

.flood-zone-card.flood-high,
.flood-zone-info-card.flood-high {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fca5a5;
}

.flood-zone-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.flood-zone-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flood-zone-icon svg {
  width: 24px;
  height: 24px;
}

.flood-low .flood-zone-icon {
  background: #dcfce7;
  color: #16a34a;
}

.flood-moderate .flood-zone-icon {
  background: #fef9c3;
  color: #ca8a04;
}

.flood-high .flood-zone-icon {
  background: #fee2e2;
  color: #dc2626;
}

.flood-zone-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flood-zone-badge {
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
}

.flood-zone-risk {
  font-size: 13px;
  color: #6b7280;
}

.flood-low .flood-zone-risk { color: #16a34a; }
.flood-moderate .flood-zone-risk { color: #ca8a04; }
.flood-high .flood-zone-risk { color: #dc2626; }

.flood-zone-description {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.flood-zone-insurance {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 6px;
  font-size: 13px;
  color: #991b1b;
  margin-bottom: 12px;
}

.flood-zone-insurance svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.flood-zone-panel-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 6px;
  font-size: 12px;
  color: #6b7280;
}

.flood-zone-panel-info .panel-number {
  font-weight: 500;
}

.flood-zone-panel-info .panel-date {
  color: #5b6478; /* was #9ca3af: too faint to read on the pale panel (contrast 2.4, needs 4.5) */
}

.flood-zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.flood-zone-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-primary, #1f2437);
  text-decoration: none;
  font-weight: 500;
}

.flood-zone-link:hover {
  text-decoration: underline;
}

.flood-zone-link svg {
  flex-shrink: 0;
}

.flood-zone-link.flood-download {
  color: #3b82f6;
}

/* Flood Map Preview */
.flood-zone-map-preview {
  margin: 12px 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  max-width: 280px;
}

.flood-zone-map-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.flood-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  background: #f9fafb;
  font-size: 10px;
  color: #6b7280;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Flood Map Preview Card (Floor Plan Style) */
.flood-map-preview {
  margin: 16px 0;
}

.flood-map-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  max-width: 280px;
}

.flood-map-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.flood-map-image-container {
  position: relative;
  background: #f0f4f8;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.flood-map-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flood-map-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  pointer-events: none;
}

.flood-map-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.flood-map-card:hover .flood-map-zoom {
  opacity: 1;
}

.flood-map-info {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
}

.flood-map-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.flood-map-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #dbeafe;
  color: #2563eb;
  font-size: 11px;
  font-weight: 500;
  border-radius: 12px;
}

/* Flood Map Lightbox Footer */
.flood-map-lightbox-content {
  max-width: 1200px;
}

.flood-map-lightbox-image {
  max-height: 70vh;
}

.flood-map-lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f9fafb;
  border-top: 1px solid var(--color-border);
}

.flood-map-download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.flood-map-download-link:hover {
  background: var(--color-primary-hover);
}

.flood-map-attribution {
  font-size: 11px;
  color: #9ca3af;
}

/* Flood Map Lightbox Marker */
.flood-map-lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flood-map-lightbox-wrapper {
  position: relative;
  display: inline-block;
}

.flood-map-lightbox-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  pointer-events: none;
  z-index: 1;
}

/* Flood Zone Subsection in Property Resources */
.flood-zone-subsection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.flood-zone-documents-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 12px;
}

.flood-zone-documents-content .flood-zone-info-card {
  flex: 1;
  min-width: 0;
}

.flood-zone-documents-content .flood-map-card {
  flex-shrink: 0;
  width: 220px;
}

/* Flood Map Card Styles */
.floor-plan-card.flood-map-card .floor-plan-image-container {
  padding: 0;
  overflow: hidden;
}

.floor-plan-card.flood-map-card .floor-plan-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floor-plan-card.flood-map-card .flood-map-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  pointer-events: none;
}

.flood-zone-map-badge {
  background: #dbeafe;
  color: #2563eb;
}

/* Responsive: Stack on mobile */
@media (max-width: 640px) {
  .flood-zone-documents-content {
    flex-direction: column;
  }

  .flood-zone-documents-content .flood-map-card {
    width: 100%;
    max-width: 280px;
  }
}

/* ==================== */
/* LOCATION SCORES      */
/* ==================== */
.location-scores {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
}

.location-scores-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.location-scores-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Score Badge */
.score-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 8px;
  flex: 1;
  min-width: 140px;
  max-width: 200px;
}

.score-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.score-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.score-desc {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 600;
}

/* Score color classes */
.score-excellent .score-circle { background: #16a34a; }
.score-good .score-circle { background: #22c55e; }
.score-moderate .score-circle { background: #eab308; }
.score-fair .score-circle { background: #f97316; }
.score-poor .score-circle { background: #dc2626; }

/* Walk Score attribution */
.walkscore-attribution {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 10px;
}
.walkscore-attribution a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.walkscore-attribution a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Nearby Transit Stops */
.transit-stops {
  border-top: 1px solid var(--color-border);
  margin-top: 12px;
  padding-top: 12px;
}
.transit-stops-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.transit-stop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.transit-stop-item + .transit-stop-item {
  border-top: 1px solid #f0f0f0;
}
.transit-stop-icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.transit-stop-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.transit-stop-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  color: var(--color-text);
}
.transit-stop-routes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.transit-route-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  white-space: nowrap;
}
.transit-stop-distance {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .transit-stop-name {
    max-width: 140px;
  }
}

/* AQI Badge */
.aqi-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 8px;
  flex: 1;
  min-width: 140px;
  max-width: 200px;
}

.aqi-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aqi-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aqi-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.aqi-value {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 600;
}

/* AQI color classes */
.aqi-good .aqi-icon {
  background: #dcfce7;
  color: #16a34a;
}
.aqi-moderate .aqi-icon {
  background: #fef9c3;
  color: #ca8a04;
}
.aqi-sensitive .aqi-icon {
  background: #fed7aa;
  color: #ea580c;
}
.aqi-unhealthy .aqi-icon {
  background: #fecaca;
  color: #dc2626;
}

/* Climate Badges */
.climate-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 8px;
  flex: 1;
  min-width: 140px;
  max-width: 200px;
}
.climate-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.climate-heating .climate-icon {
  background: #fff7ed;
  color: #ea580c;
}
.climate-snow .climate-icon {
  background: #eff6ff;
  color: #2563eb;
}
.climate-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.climate-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}
.climate-value {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 600;
}
@media (max-width: 640px) {
  .climate-badge {
    max-width: 100%;
  }
}

/* ==================== */
/* SAFETY SECTION       */
/* ==================== */
.safety-section {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.safety-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.safety-header svg {
  color: #16a34a;
}

.safety-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 15px;
}

.safety-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
}

.safety-badge.excellent {
  background: #dcfce7;
  color: #16a34a;
}

.safety-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}

.safety-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.safety-stat .stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.safety-stat .stat-comparison {
  font-size: 12px;
  font-weight: 500;
}

.safety-stat .stat-comparison.good {
  color: #16a34a;
}

.safety-note {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  font-style: italic;
}

/* Location Scores Mobile */
@media (max-width: 640px) {
  .location-scores {
    padding: 12px 16px;
  }

  .location-scores-row {
    flex-direction: column;
    gap: 8px;
  }

  .score-badge,
  .aqi-badge {
    max-width: 100%;
  }

  .safety-section {
    padding: 12px 16px;
  }

  .safety-stats {
    flex-direction: column;
    gap: 12px;
  }
}

/* Public Record (11/19/2026): assessor + registry facts beside the listing */
.public-record-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; margin: 4px 0 0; }
.public-record-list div { border-top: 1px solid var(--rule-light, #e3e6ec); padding-top: 8px; }
.public-record-list dt { font-size: 12.5px; color: var(--muted, #555e72); margin: 0 0 2px; }
.public-record-list dd { margin: 0; font-size: 15px; color: var(--ink, #1f2437); }
.public-record-note { font-size: 12.5px; color: var(--muted, #555e72); margin: 12px 0 0; }

/* Recent Sales Nearby (11/19/2026) */
.nearby-sales { list-style: none; margin: 4px 0 0; padding: 0; }
.nearby-sales li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--rule-light, #e3e6ec); }
.nearby-sales li:first-child { border-top: 0; }
.nearby-sales li span { display: block; font-size: 12.5px; color: var(--muted, #555e72); margin-top: 2px; }
.nearby-sales a { color: var(--ink, #1f2437); }
.nearby-price { text-align: right; white-space: nowrap; }

/* MaineHousing first-time-buyer rates beside today's average, and the town-bill note (11/19/2026) */
.mh-rates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.mh-rates[hidden] { display: none; }
.mh-rate-btn { padding: 4px 10px; border: 1px solid #1f2437; border-radius: 20px; background: #fff; color: #1f2437; font-size: 12px; font-weight: 600; cursor: pointer; }
.mh-rate-btn:hover { background: #1f2437; color: #fff; }
.mh-rate-note { flex-basis: 100%; font-size: 11px; color: #5b6070; }
.mh-rate-note a { color: inherit; }
.calc-tax-note { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: rgba(255, 255, 255, 0.78); } /* it sits on the dark result panel */
.calc-tax-note[hidden] { display: none; }
.nearby-sales .nearby-office { display: block; font-size: 0.85rem; color: var(--color-text-muted, #5b6478); }
