/* Uniform residential-complex cards: desktop rows stay visually aligned. */
@media (min-width: 901px) {
  .complex-grid {
    align-items: stretch;
  }

  .complex-card {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 850px;
  }

  .complex-card .card-actions {
    grid-template-columns: 120px minmax(0, 1fr);
    grid-template-rows: 240px 64px;
    align-items: stretch;
    min-height: 314px;
    max-height: 314px;
    margin-top: 0;
  }

  .complex-card .show-on-map,
  .complex-card .open-from-map {
    grid-column: 1;
    grid-row: 1;
  }

  .complex-card .building-summary {
    grid-column: 2;
    grid-row: 1;
  }

  .complex-card .card-actions-v30:empty {
    display: none;
  }

  .complex-card > .readiness-badge,
  .complex-card > .readiness-indicator,
  .complex-card > .readiness-placeholder {
    flex: 0 0 36px;
    min-height: 36px;
    margin: auto 0 10px;
    box-sizing: border-box;
  }

  .complex-card > .readiness-placeholder {
    visibility: hidden;
    pointer-events: none;
  }

  .complex-card .open-from-map {
    width: 100%;
    height: 100%;
    min-height: 240px;
  }

  .complex-card .building-summary {
    box-sizing: border-box;
    min-height: 240px;
    max-height: 240px;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b9cceb transparent;
  }

  .complex-card .building-summary::-webkit-scrollbar {
    width: 6px;
  }

  .complex-card .building-summary::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #b9cceb;
  }

  .complex-card .open-complex {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 64px;
    min-height: 64px;
    margin-top: 0;
  }
}

@media (max-width: 900px) {
  .complex-card {
    height: auto;
    min-height: 0;
  }

  .complex-card .card-actions,
  .complex-card .building-summary,
  .complex-card .open-from-map {
    min-height: 0;
    max-height: none;
  }

  .complex-card .card-actions {
    grid-template-rows: auto;
  }

  .complex-card .show-on-map,
  .complex-card .open-from-map,
  .complex-card .building-summary,
  .complex-card .open-complex {
    grid-column: auto;
    grid-row: auto;
  }

  .complex-card > .readiness-placeholder {
    display: none;
  }
}

/* mobile-complex-cards-v1: compact catalog without changing desktop */
@media (max-width:720px){
  .complex-card{padding:14px;border-radius:14px;min-height:0}
  .complex-card .complex-cover{height:132px;min-height:132px;object-fit:cover}
  .complex-card h3{font-size:20px;margin:4px 0}
  .complex-card .complex-address{margin:4px 0 8px}
  .complex-card .metrics{gap:8px;margin:12px 0}
  .complex-card .metric{padding-top:6px}
  .complex-card .metric strong{font-size:14px}
  .complex-card>.readiness-badge,
  .complex-card>.readiness-indicator{margin:4px 0 10px;min-height:34px}
  .complex-card .card-actions{display:grid!important;grid-template-columns:1fr 1fr!important;grid-template-rows:auto!important;gap:8px;margin-top:0}
  .complex-card .show-on-map,
  .complex-card .open-from-map,
  .complex-card .mobile-buildings-toggle{grid-column:auto!important;grid-row:auto!important;width:100%;min-height:48px;height:auto;margin:0;padding:10px 8px}
  .complex-card .mobile-buildings-toggle{display:block;color:#0b55ad;background:#fff;border:1px solid #bdd4f3;box-shadow:none}
  .complex-card .mobile-buildings-toggle[hidden]{display:none!important}
  .complex-card .building-summary{grid-column:1/-1!important;grid-row:auto!important;min-height:0!important;max-height:180px!important;margin:0;padding:12px;overflow:auto}
  .complex-card .building-summary.mobile-collapsed{display:none!important}
  .complex-card .card-actions-v30:empty{display:none!important}
  .complex-card .open-complex{grid-column:1/-1!important;grid-row:auto!important;width:100%;height:auto;min-height:50px;margin:0}
}
