/* site.css — site-specific layout, ported from styles.css onto token system.
   tokens.css owns variables. primitives.css owns .card .btn .field .pane .badge .chip .table .skeleton.
   DO NOT add :root vars here. DO NOT redefine btn/card/field/pane/badge/chip. */

/* ------------------------------------------------------------------
   BODY PADDING — account for fixed header
   ------------------------------------------------------------------ */
body{
  padding-top: var(--nav-h);
  /* sticky footer: footer hugs viewport bottom even on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body:has(.admin-subnav){
  padding-top: calc(var(--nav-h) + 38px);
}

/* ------------------------------------------------------------------
   HEADER
   ------------------------------------------------------------------ */
.site-header{
  position:fixed; inset:0 auto auto 0; right:0; z-index:1000;
  background:var(--white); border-bottom:1px solid var(--line);
  height:var(--nav-h);
}
.header-row{display:flex; align-items:center; justify-content:space-between; height:var(--nav-h); padding:0 var(--pad-x); gap:20px}
.brand{text-decoration:none; color:var(--ink)}
.brand img{display:block; width:150px; height:auto}
.brand-name{font-weight:var(--fw-bold); font-size:18px; color:var(--ink); text-decoration:none}

.mobile-menu-toggle{
  display:none; background:none; border:none; padding:8px; cursor:pointer; z-index:1001;
}
.hamburger{
  display:block; width:24px; height:2px; background:var(--ink); position:relative; transition:background .3s ease;
}
.hamburger:before, .hamburger:after{
  content:''; position:absolute; left:0; width:24px; height:2px; background:var(--ink); transition:transform .3s ease;
}
.hamburger:before{top:-7px}
.hamburger:after{top:7px}
.mobile-menu-toggle[aria-expanded="true"] .hamburger{background:transparent}
.mobile-menu-toggle[aria-expanded="true"] .hamburger:before{transform:rotate(45deg); top:0}
.mobile-menu-toggle[aria-expanded="true"] .hamburger:after{transform:rotate(-45deg); top:0}

.main-nav{display:flex; gap:6px; flex:1; justify-content:flex-end}
.nav-link{
  padding:8px 16px; border-radius:10px; color:var(--ink); text-decoration:none;
  font-weight:var(--fw-bold); font-size:14px; transition:background .15s ease, color .15s ease;
}
.nav-link:hover{background:var(--paper-2); color:var(--accent-hover)}
.nav-link.active{background:var(--accent); color:var(--white)}

/* ------------------------------------------------------------------
   ADMIN SUBNAV
   ------------------------------------------------------------------ */
.admin-subnav{
  position:fixed;
  top:var(--nav-h);
  left:0;
  right:0;
  z-index:999;
  background:var(--white);
  border-bottom:1px solid var(--line);
}
.admin-subnav-scroll{
  display:flex;
  gap:4px;
  padding:4px 20px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.admin-subnav-scroll::-webkit-scrollbar{display:none}
.admin-nav-link{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border-radius:8px;
  text-decoration:none;
  color:var(--ink);
  font-weight:var(--fw-semi);
  font-size:13px;
  white-space:nowrap;
  transition:background .15s ease, color .15s ease;
  flex-shrink:0;
}
.admin-nav-link:hover{
  background:var(--paper-2);
  color:var(--accent-hover);
}
.admin-nav-link.active{
  background:var(--accent); color:var(--white);
}
.admin-nav-link.logout{
  color:#d97706;
}
.admin-nav-link.logout:hover{
  background:#fff4ef;
  color:#d97706;
}

@media (max-width:720px){
  .admin-subnav{
    top:var(--nav-h);
  }
  .admin-subnav-scroll{
    padding:4px 12px;
    gap:2px;
  }
  .admin-nav-link{
    padding:4px 8px;
    font-size:11px;
  }
  body:has(.admin-subnav){
    padding-top:calc(var(--nav-h) + 30px);
  }
  body:has(.admin-subnav) .filters-head{
    top:calc(var(--nav-h) + 30px);
  }
}

/* ------------------------------------------------------------------
   FILTERS BAR
   ------------------------------------------------------------------ */
.filters{
  background:var(--white); border-top:1px solid var(--line); border-bottom:1px solid var(--line);
  position:sticky; top:var(--nav-h); z-index:998;
  margin:0 !important;
  padding:0;
}
body:has(.admin-subnav) .filters{
  top:calc(var(--nav-h) + 38px);
}
body:has(.admin-subnav) .mapbox.map-sticky{
  top:calc(var(--nav-h) + 38px + var(--filters-h, 0px)) !important;
}
.filters.fixed{position:fixed; top:var(--nav-h); left:0; right:0; box-shadow:var(--shadow)}
#filtersSpacer{height:0; margin:0 !important; padding:0 !important; display:none !important;}
.filters-head{display:none; align-items:center; justify-content:space-between; padding:10px var(--pad-x)}
.filters-toggle{
  display:inline-flex; align-items:center; gap:8px;
  background:transparent;
  color:var(--accent);
  border:2px solid var(--accent);
  border-radius:10px; padding:10px 14px; font-weight:var(--fw-bold); cursor:pointer;
  transition:all .2s ease;
}
.filters-toggle:hover{
  background:var(--accent);
  color:var(--white);
}
.filters-panel{
  display:grid; grid-template-columns: repeat(8, minmax(140px,1fr));
  gap:12px; padding:16px var(--pad-x);
  margin:0;
}
.more-filters-panel{
  display:grid; grid-template-columns: repeat(3, minmax(140px,1fr));
  gap:12px; padding:0 var(--pad-x) 16px var(--pad-x);
  margin:0;
  border-top:1px solid var(--line);
  background:var(--white);
}
.filters-panel select,.filters-panel button,.filters-panel .ms-btn,
.more-filters-panel select,.more-filters-panel input,.more-filters-panel .ms-btn{
  width:100%; appearance:none; border:1px solid var(--line); background:var(--white);
  padding:10px 12px; border-radius:10px; font:inherit; color:var(--ink)
}
#fMoreToggle .more-icon{transition:transform .15s var(--ease); display:inline-block;}
#fMoreToggle.expanded .more-icon{transform:rotate(180deg);}

/* ------------------------------------------------------------------
   MULTI-SELECT WIDGET
   ------------------------------------------------------------------ */
.ms{position:relative}
.ms-btn{display:flex; align-items:center; justify-content:space-between; cursor:pointer}
.ms-btn .placeholder{color:var(--ink-muted)}
.ms-btn .value{overflow:hidden; white-space:nowrap; text-overflow:ellipsis; max-width:75%}
.ms-btn .caret{opacity:.65; font-size:14px}
.ms-menu{
  display:none; position:absolute; left:0; right:0; top:calc(100% + 8px); z-index:1200;
  background:var(--white); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow-lift);
  max-height:260px; overflow:auto; padding:8px; -webkit-overflow-scrolling:touch;
}
.ms.open .ms-menu{display:block}
.ms-opt{display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; cursor:pointer; user-select:none}
.ms-opt:hover{background:var(--paper-2)}
.ms-opt input{appearance:auto; width:16px; height:16px; margin:0; accent-color:var(--accent-hover)}

/* ------------------------------------------------------------------
   HOME LAYOUT
   ------------------------------------------------------------------ */
.home-body{display:block; padding:0 0 34px}
.home-layout{
  display:grid;
  grid-template-columns: minmax(0,0.6fr) minmax(0,0.4fr);
  grid-template-areas: "right left";
  gap:12px;
}
.home-left{grid-area:left; min-width:0}
.home-right{grid-area:right; min-width:0; position:relative}

.mapbox{
  height:calc(100vh - var(--nav-h) - 10px);
  min-height:320px;
  border:1px solid var(--line);
  border-radius:var(--radius); overflow:hidden; background:var(--white);
}
.mapbox.map-sticky{position:sticky !important; top:var(--nav-h)}

/* ------------------------------------------------------------------
   ZOOM HINT / LOCATE BUTTON
   ------------------------------------------------------------------ */
.ctrl-zoom-hint{
  position:absolute; left:12px; top:12px;
  background:rgba(12,12,13,.92); color:var(--white); border-radius:10px;
  padding:8px 10px; font-size:13px; font-weight:var(--fw-bold);
  box-shadow:var(--shadow-lift);
  opacity:0; transform:translateY(-6px); pointer-events:none; transition:.2s ease;
}
.ctrl-zoom-hint.show{opacity:1; transform:none}

.locate-me-btn{
  position:absolute; right:12px; top:12px; z-index:100;
  width:40px; height:40px; border-radius:8px;
  background:var(--white); border:none; cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
  display:flex; align-items:center; justify-content:center;
  transition:all .2s ease;
}
.locate-me-btn:hover{
  background:var(--paper-2); box-shadow:0 4px 12px rgba(0,0,0,.2);
}
.locate-me-btn.loading{
  opacity:.6; cursor:not-allowed;
}
.locate-me-btn svg{
  width:20px; height:20px; color:var(--accent-hover);
}

/* ------------------------------------------------------------------
   GRID + LISTING CARDS
   ------------------------------------------------------------------ */
.result-count{margin:6px 4px 14px; color:var(--ink-muted); font-size:14px; display:flex; align-items:center; justify-content:space-between; gap:8px;}
.grid{display:grid; gap:18px}

/* Card photo + content — layout extensions on top of primitives.css .card */
.card .photo{position:relative; background:#eee}
.card .content{display:flex; flex-direction:column; gap:6px; padding:14px 16px 16px}
.addr{font-weight:var(--fw-bold); color:var(--ink); margin:0}

/* Favorite button */
.fav-btn{
  position:absolute; top:12px; right:12px; z-index:10;
  width:36px; height:36px; border-radius:50%;
  background:rgba(255,255,255,.95); backdrop-filter:blur(8px);
  border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:all .2s ease;
  box-shadow:0 2px 8px rgba(0,0,0,.1);
}
.fav-btn:hover{
  background:var(--white); transform:scale(1.1);
  box-shadow:0 4px 12px rgba(0,0,0,.15);
}
.fav-btn svg{
  transition:all .2s ease;
  stroke:var(--ink-muted);
  fill:none;
}
.card.favorited .fav-btn svg{
  fill:#e53e3e;
  stroke:#e53e3e;
}
.card.favorited .fav-btn{
  background:rgba(229,62,62,.1);
}
.card.favorited .fav-btn:hover{
  background:rgba(229,62,62,.15);
}

/* SQUARE CARDS — photo on top, content below; auto-fill the cards column so more
   listings + more data show per row. */
.grid.grid-cards{grid-template-columns:repeat(auto-fit, minmax(230px, 1fr)); gap:10px; align-items:stretch}
.grid.grid-cards .card{display:flex; flex-direction:column; overflow:hidden}
.grid.grid-cards .photo{aspect-ratio:5/4; height:auto; width:100%}
.grid.grid-cards .card img{height:100%; width:100%; object-fit:cover}
.grid.grid-cards .content{padding:12px 13px 14px; gap:0; flex:1; display:flex; flex-direction:column}

/* LISTING CARD — THRED Realty editorial style: location/type eyebrow → address
   title → price → meta row with a hairline divider + bold values. */
.card-listing{ display:flex; flex-direction:column; text-decoration:none; color:var(--ink); border-radius:9px; transition:transform .25s var(--ease,ease), box-shadow .25s var(--ease,ease), border-color .25s var(--ease,ease); }
.card-listing:hover{ transform:translateY(-3px); box-shadow:0 12px 28px rgba(15,23,42,.12); border-color:var(--line); }
.card-eyebrow{ font-size:10.5px; font-weight:var(--fw-semi); letter-spacing:.08em; text-transform:uppercase; color:var(--ink-muted); margin:0 0 6px; }
.card-title{ font-size:16px; font-weight:var(--fw-bold); color:var(--ink); line-height:1.2; letter-spacing:-.01em; margin:0 0 2px; }
.card-loc{ font-size:12px; color:var(--ink-muted); font-weight:var(--fw-med); margin:0 0 10px; }
.card-price{ font-size:17px; font-weight:var(--fw-bold); color:var(--ink); margin:0; }
.card-meta{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; margin-top:auto; padding-top:11px; border-top:1px solid var(--line); font-size:12.5px; color:var(--ink-muted); font-weight:var(--fw-med); min-height:36px; }
.card-meta__i{ white-space:nowrap; }
.card-meta__note{ font-style:italic; color:var(--ink-muted); }
.card-meta strong{ color:var(--ink); font-weight:var(--fw-semi); }
.card-dot{ opacity:.4; }
/* card tags = clean white uppercase pills (TR .listing__tag) */
.card-listing .card-tags .tag-pill{ background:rgba(255,255,255,.95); color:var(--ink); border:none; text-transform:uppercase; letter-spacing:.06em; font-size:9.5px; font-weight:var(--fw-bold); }
@media (max-width:520px){ .grid.grid-cards{grid-template-columns:1fr 1fr} }
@media (max-width:380px){ .grid.grid-cards{grid-template-columns:1fr} }

/* ------------------------------------------------------------------
   MAP PINS + LEAFLET POPUP OVERRIDES
   ------------------------------------------------------------------ */
.pin{width:14px; height:14px; border-radius:50%; background:var(--accent-hover); border:2px solid var(--white); box-shadow:0 0 0 2px rgba(12,12,13,.18)}
.pin.sel{background:var(--ink); width:18px; height:18px; box-shadow:0 0 0 3px rgba(12,12,13,.22)}

/* ------------------------------------------------------------------
   DETAIL PAGE
   ------------------------------------------------------------------ */
.breadcrumbs{margin:18px 0 22px; color:var(--ink-muted); font-size:14px}
.breadcrumbs a{color:var(--accent-hover); text-decoration:none}
.breadcrumbs a:hover{text-decoration:underline}
.listing-top{position:sticky; top:var(--nav-h); z-index:500; background:var(--white)}
.listing-top .container{padding:14px var(--pad-x) 16px; border-bottom:1px solid var(--line)}
.listing-eyebrow{font-size:12px; font-weight:var(--fw-semi); letter-spacing:.1em; text-transform:uppercase; color:var(--ink-muted); margin:0 0 6px}
.addr-title{font-size:clamp(26px,3.4vw,34px); font-weight:var(--fw-bold); letter-spacing:var(--letter-tight); line-height:1.12; margin:0}
.addr-sub{color:var(--ink-muted); font-weight:var(--fw-med); margin-top:5px; font-size:14px}
.statbar{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:12px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--paper-2)}
[data-catalog="commercial"] .statbar{grid-template-columns:repeat(6,minmax(0,1fr))}
.stat{display:flex; flex-direction:column; gap:2px; align-items:flex-start}
.sk{font-size:11px; letter-spacing:.06em; color:var(--ink-muted); text-transform:uppercase}
.sv{font-size:18px; font-weight:var(--fw-bold); color:var(--ink)}

/* ------------------------------------------------------------------
   404 BANNER
   ------------------------------------------------------------------ */
.banner-404{
  position:fixed; top:var(--nav-h); left:0; right:0; z-index:1001;
  background:#fef3c7; border:1px solid #f5d98f; box-shadow:var(--shadow);
  animation:slideDown .3s ease;
}
.banner-content{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px; max-width:1200px; margin:0 auto;
}
.banner-text{
  font-size:14px; font-weight:var(--fw-semi); color:#92400e; flex:1;
}
.banner-close{
  background:none; border:none; font-size:24px; line-height:1;
  color:#92400e; cursor:pointer; padding:0 8px; margin-left:16px;
  opacity:.7; transition:opacity .15s ease;
}
.banner-close:hover{
  opacity:1;
}
@keyframes slideDown{
  from{transform:translateY(-100%)}
  to{transform:translateY(0)}
}

/* ------------------------------------------------------------------
   BUTTON LOADING STATE (not covered by primitives)
   ------------------------------------------------------------------ */
.btn-spinner{
  display:inline-block; width:14px; height:14px;
  border:2px solid rgba(255,255,255,.3);
  border-top-color:var(--white); border-radius:50%;
  animation:spin .8s linear infinite;
  margin-right:8px; vertical-align:middle;
}
.btn.loading{
  opacity:.8; pointer-events:none;
}
@keyframes spin{
  to{transform:rotate(360deg)}
}

/* ------------------------------------------------------------------
   EMPTY STATE
   ------------------------------------------------------------------ */
.empty-state{
  grid-column:1/-1; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:40px 20px; text-align:center; max-width:600px;
  margin:0 auto;
  /* Fill the viewport so the result column isn't a short box you can scroll
     past into emptiness — the empty state centers and holds the height. */
  min-height:calc(100vh - var(--nav-h, 64px) - 130px);
}
.empty-icon{
  width:120px; height:120px; border-radius:50%;
  background:var(--paper-2); display:flex; align-items:center;
  justify-content:center; margin-bottom:24px;
}
.empty-icon svg{
  color:var(--line);
}
.empty-title{
  margin:0 0 12px; font-size:24px; font-weight:var(--fw-bold); color:var(--ink);
}
.empty-desc{
  margin:0 0 32px; font-size:16px; color:var(--ink-muted); line-height:1.5;
}
.empty-suggestions{
  background:var(--paper-2); border:1px solid var(--line);
  border-radius:12px; padding:20px 24px; margin-bottom:24px;
  width:100%; max-width:400px;
}
.suggestion-title{
  font-weight:var(--fw-bold); font-size:14px; color:var(--ink);
  margin-bottom:12px; text-align:left;
}
.suggestion-list{
  list-style:none; padding:0; margin:0; text-align:left;
}
.suggestion-list li{
  padding:8px 0 8px 24px; font-size:14px; color:var(--ink);
  position:relative;
}
.suggestion-list li:before{
  content:'→'; position:absolute; left:0; color:var(--accent-hover);
  font-weight:var(--fw-bold);
}
.empty-actions{
  display:flex; gap:12px; flex-wrap:wrap; justify-content:center;
  margin-bottom:32px;
}

.empty-footer{
  padding-top:24px; border-top:1px solid var(--line);
}
.empty-footer p{
  margin:0 0 8px; font-size:14px; color:var(--ink-muted);
}
.empty-link{
  color:var(--accent-hover); font-weight:var(--fw-bold); font-size:15px;
  text-decoration:none; transition:color .15s ease;
}
.empty-link:hover{
  color:var(--ink); text-decoration:underline;
}

/* ------------------------------------------------------------------
   BACK TO TOP
   ------------------------------------------------------------------ */
.back-to-top{
  position:fixed; bottom:24px; right:24px; z-index:999;
  width:48px; height:48px; border-radius:50%;
  background:var(--accent-hover); color:var(--white); border:none;
  font-size:24px; font-weight:var(--fw-bold); cursor:pointer;
  box-shadow:0 4px 12px rgba(0,119,204,.4);
  opacity:0; visibility:hidden; transform:translateY(20px);
  transition:all .3s ease;
}
.back-to-top.visible{
  opacity:1; visibility:visible; transform:translateY(0);
}
.back-to-top:hover{
  background:var(--ink); transform:translateY(-2px);
  box-shadow:0 6px 16px rgba(12,12,13,.3);
}
@media (max-width:768px){
  .back-to-top{
    bottom:80px;
    width:44px; height:44px; font-size:20px;
  }
}

/* ------------------------------------------------------------------
   MOBILE STICKY CTA
   ------------------------------------------------------------------ */
.mobile-sticky-cta{
  display:none; position:fixed; bottom:0; left:0; right:0; z-index:1000;
  padding:12px 20px; background:var(--white); border-top:1px solid var(--line);
  box-shadow:0 -4px 12px rgba(0,0,0,.08);
}
.mobile-cta-btn{
  width:100%; padding:14px 20px;
  background:transparent;
  color:var(--accent);
  border:2px solid var(--accent);
  border-radius:8px; font-size:16px; font-weight:var(--fw-bold);
  cursor:pointer; transition:all .2s ease;
}
.mobile-cta-btn:hover{
  background:var(--accent);
  color:var(--white);
  transform:translateY(-1px);
}
.mobile-cta-btn:active{
  transform:translateY(0);
}
@media (max-width:768px){
  [data-page="detail"] .mobile-sticky-cta{
    display:block;
  }
}

/* ------------------------------------------------------------------
   FILTER CHIPS
   ------------------------------------------------------------------ */
.filter-chips{
  display:none; flex-wrap:wrap; gap:8px; margin-bottom:16px;
}
.filter-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px 6px 12px; background:var(--accent-hover); color:var(--white);
  border:none; border-radius:20px; font-size:13px; font-weight:var(--fw-semi);
  cursor:pointer; transition:all .15s ease;
}
.filter-chip:hover{
  background:var(--ink); transform:translateY(-1px);
}
.chip-close{
  font-size:18px; line-height:1; font-weight:var(--fw-bold);
  opacity:.9; margin-left:2px;
}
.filter-chip:hover .chip-close{
  opacity:1;
}

/* ------------------------------------------------------------------
   SHARE BUTTONS
   ------------------------------------------------------------------ */
/* Share row — compact, sits top-right of the breadcrumb (out of the sticky title). */
.breadcrumb-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.breadcrumb-row .breadcrumbs{ margin:18px 0; }
.share-buttons{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.share-btn{
  background:transparent; border:1px solid var(--line); border-radius:8px;
  padding:6px 11px; font:var(--fw-semi) 12.5px/1 var(--font); color:var(--ink-muted);
  cursor:pointer; transition:border-color .15s, color .15s, background .15s;
}
.share-btn:hover{ border-color:var(--accent); color:var(--accent-hover); }
/* ------------------------------------------------------------------
   DETAILS GRID (listing page)
   ------------------------------------------------------------------ */
.section{padding:26px 0}
.details-grid{display:grid; grid-template-columns:1.2fr .8fr; gap:24px}
.details-right{position:sticky; top:calc(var(--stick-below, var(--nav-h)) + 12px); align-self:start}
.desc{white-space:pre-wrap}
.facts{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px}
.fact{display:flex; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--white)}
.fk{color:var(--ink-muted); font-size:13px}
.fv{font-weight:var(--fw-bold)}
.mapwrap{border-radius:var(--radius); overflow:hidden; margin-top:12px; position:relative; isolation:isolate}
.mapwrap iframe{width:100%; aspect-ratio:16/9; border:0}
/* static directions map */
#mapDetail.map-static{cursor:pointer}
#mapDetail{overflow:hidden}
/* keep ALL leaflet controls inside the map + below the fixed header */
#mapDetail .leaflet-control-zoom,
#mapDetail .leaflet-control-attribution{display:none}
#mapDetail .leaflet-top,#mapDetail .leaflet-bottom{z-index:400}
.map-credit{font-size:11px; color:var(--ink-muted); margin:6px 2px 0; text-align:right}
.map-credit a{color:var(--ink-muted); text-decoration:underline}
/* Two small map pills, bottom-right: Directions + More map options. */
.map-pills{ position:absolute; right:10px; bottom:10px; z-index:500; display:flex; gap:6px; }
.map-pill{
  display:inline-flex; align-items:center; background:var(--white); color:var(--ink);
  text-decoration:none; font:var(--fw-semi) 11.5px/1 var(--font); padding:6px 11px;
  border-radius:999px; border:1px solid var(--line); box-shadow:0 2px 8px rgba(0,0,0,.16);
  transition:background .15s, color .15s; white-space:nowrap;
}
.map-pill:hover{ background:var(--ink); color:#fff; }
.map-pill:first-child::before{ content:"➤"; font-size:10px; margin-right:5px; color:var(--accent-hover); transform:rotate(-45deg); }
.map-pill:first-child:hover::before{ color:#fff; }
@media (max-width:420px){ .map-pill{ font-size:11px; padding:5px 9px; } }
.gallery{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:12px}
.gallery img{display:block; width:100%; height:220px; object-fit:cover; border-radius:12px; cursor:pointer; background:#eee}

/* ------------------------------------------------------------------
   LIGHTBOX
   ------------------------------------------------------------------ */
.lb{
  position:fixed; inset:0; display:none; place-items:center;
  background:rgba(0,0,0,.85); z-index:2000;
  touch-action: none;
}
.lb.open{display:grid}
.lb img{max-width:92vw; max-height:90vh; user-select:none; -webkit-user-drag:none; transition:transform .18s ease}
.lb .nav{position:absolute; top:50%; transform:translateY(-50%); font-size:28px; background:rgba(255,255,255,.15); border:0; color:var(--white); padding:10px 14px; cursor:pointer}
.lb .prev{left:14px} .lb .next{right:14px}
.lb .close{position:absolute; top:14px; right:14px; background:var(--white); border:0; padding:6px 10px; border-radius:8px; cursor:pointer}

/* ------------------------------------------------------------------
   LEAD FORM
   ------------------------------------------------------------------ */
.form-note{font-size:14px; color:var(--ink-muted); margin:0 0 16px}
/* even vertical rhythm for every field (incl. the Timeline select) */
#leadForm{display:flex; flex-direction:column; gap:14px}
#leadForm .input-row{display:grid; grid-template-columns:1fr 1fr; gap:12px}
#leadForm .input{padding:11px 13px}
#leadForm textarea{min-height:130px; resize:vertical}
#leadForm #sendBtn{margin-top:2px}
.form-msg{margin-top:10px; font-size:14px; transition:opacity .6s ease, transform .6s ease}
.form-msg.ok{color:var(--ok); background:#e6f7ec; border:1px solid #bfe3cb; padding:10px 12px; border-radius:10px}
.form-msg.err{color:var(--err)}
.form-msg.fade{opacity:0; transform: translateY(-4px)}

/* ------------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------------ */
/* margin-top:auto = pushed to viewport bottom on short pages (body is flex column) */
.site-footer{background:var(--ink); color:#d0d0d0; margin-top:auto}
.footer-top{padding:36px 0}
.footer-grid{display:grid; grid-template-columns:2fr 1fr 1fr; gap:24px; align-items:start; padding:0 var(--pad-x)}
.footer-brand img{width:180px; height:auto; display:block; margin:0 0 10px}
.footer-col h4{color:var(--white); margin:0 0 10px}
.footer-col ul{list-style:none; padding:0; margin:0}
.footer-col a{color:#e8e8e8; text-decoration:none; display:inline-block; padding:6px 0}
.footer-col a:hover{text-decoration:underline}
.footer-col li + li{margin-top:4px}
.footer-bottom{border-top:1px solid #2a2a2a; padding:12px var(--pad-x); font-size:14px}
.footer-bottom-row{display:flex; align-items:center; justify-content:space-between; padding:0}
.footer-admin-link{color:#9a9a9a; text-decoration:none; font-size:13px}
.footer-admin-link:hover{color:var(--white); text-decoration:underline}


/* APARTMENT-SPECIFIC block removed — special-offer-banner, pet-*, amenities-*,
   admin-facts, card-badge, urgency-*, card-apartment, property-*, price-apartment,
   gallery-section-heading, floorplan-* + their keyframes were all dead (no .php/.js
   references). */

/* ------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------ */
@media (max-width:1024px){
  .brand img{width:120px}
  .main-nav{gap:4px}
  .nav-link{padding:6px 12px; font-size:13px}
  .filters{position:sticky; top:var(--nav-h);}
  .filters-head{display:flex; background:var(--white); border-bottom:1px solid var(--line); position:sticky; top:var(--nav-h); z-index:981}
  .filters-panel{display:none; grid-template-columns:repeat(2, minmax(0,1fr)); padding:12px var(--pad-x)}
  .filters.open .filters-panel{display:grid}
  .more-filters-panel{grid-template-columns:repeat(2, minmax(0,1fr)); padding:12px var(--pad-x)}
  .more-filters-panel[style*="display: grid"]{display:grid !important}
  #filtersSpacer{height:0 !important}
  .home-layout{grid-template-columns:1fr; grid-template-areas:"right" "left"}
  .mapbox{height:auto; min-height:0}
  .details-grid{grid-template-columns:1fr}
  .details-right{position:static}
  .footer-grid{grid-template-columns:1.5fr 1fr; gap:18px}
  .footer-brand{grid-column:1 / -1}
}
@media (max-width:720px){
  .header-row{gap:8px; position:relative}
  .brand img{width:120px}
  .brand{order:1}
  .main-nav{order:4}
  .mobile-menu-toggle{display:block; order:999; margin-left:auto}
  .main-nav{
    position:fixed; top:var(--nav-h); left:0; right:0; background:var(--white);
    flex-direction:column; gap:0; padding:0; border-bottom:1px solid var(--line);
    box-shadow:var(--shadow); max-height:0; overflow:hidden;
    transition:max-height .3s ease;
  }
  .main-nav.open{max-height:300px}
  .nav-link{
    display:block; width:100%; padding:14px var(--pad-x); border-radius:0;
    border-bottom:1px solid var(--line); /* hairline separator — functional */
  }
  .nav-link:last-child{border-bottom:none}
  .gallery{grid-template-columns:1fr 1fr}
  .statbar{grid-template-columns:repeat(2,minmax(0,1fr))}
  [data-catalog="commercial"] .statbar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .footer-top{padding:24px 0}
  .footer-grid{grid-template-columns:1fr; gap:16px}
  .footer-brand img{width:160px}
  .filters-panel,
  .more-filters-panel{grid-template-columns:1fr !important}
  .footer-bottom{font-size:13px; text-align:center}
}

/* ------------------------------------------------------------------
   LEAFLET BACKGROUND FIXES
   ------------------------------------------------------------------ */
.leaflet-container { background: var(--white) !important; }
.mapbox { background: var(--white) !important; }

.leaflet-marker-icon,
.leaflet-marker-icon .pin,
.pin-popup,
.pin-popup img { cursor: pointer !important; }
.leaflet-interactive { cursor: pointer !important; }

/* ------------------------------------------------------------------
   PRINT
   ------------------------------------------------------------------ */
@media print {
  .site-header,
  .site-footer,
  .breadcrumbs,
  .filters,
  .mobile-sticky-cta,
  .back-to-top,
  .share-buttons,
  .fav-btn,
  .btn,
  .form-note,
  #leadForm,
  #adminCopyReply,
  .locate-me-btn,
  .ctrl-zoom-hint,
  .admin-subnav,
  .banner-404 {
    display: none !important;
  }

  body { padding-top: 0 !important; background: white !important; color: black !important; font-size: 12pt; line-height: 1.5; }
  .listing-top { position: static !important; border-bottom: 2px solid #000; padding-bottom: 16px; margin-bottom: 16px; }
  .addr-title  { font-size: 20pt; margin-bottom: 8px; }
  .addr-sub    { font-size: 11pt; margin-bottom: 12px; }
  .statbar     { grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px; border: 1px solid #000; background: #f5f5f5 !important; page-break-inside: avoid; }
  .stat        { page-break-inside: avoid; }
  .sk          { font-size: 9pt; }
  .sv          { font-size: 14pt; }
  .section     { padding: 0; }
  .container   { padding: 0 !important; max-width: 100% !important; }
  .details-grid{ display: block; }
  .details-left{ width: 100%; }
  .details-right{ display: none; }
  h2 { font-size: 14pt; margin-top: 16px; margin-bottom: 8px; border-bottom: 1px solid #ccc; page-break-after: avoid; }
  h3 { font-size: 12pt; margin-top: 12px; margin-bottom: 6px; page-break-after: avoid; }
  .desc        { font-size: 10pt; margin-bottom: 12px; white-space: pre-wrap; }
  .facts       { grid-template-columns: 1fr 1fr; gap: 8px; page-break-inside: avoid; }
  .fact        { border: 1px solid #ccc; padding: 6px 8px; font-size: 9pt; }
  .fk          { font-size: 8pt; }
  .fv          { font-size: 9pt; }
  .gallery          { grid-template-columns: repeat(2, 1fr); gap: 8px; page-break-inside: avoid; }
  .gallery img      { max-height: 150px; object-fit: cover; border: 1px solid #ccc; }
  .mapwrap          { display: none; }
  .card, .statbar, .facts { page-break-inside: avoid; }
  a[href]:after         { content: " (" attr(href) ")"; font-size: 8pt; color: #666; }
  a[href^="/"]:after, a[href^="#"]:after { content: ""; }
}

/* ------------------------------------------------------------------
   MAP (Task 7 additions)
   ------------------------------------------------------------------ */
#mapHome { width: 100%; height: 100%; min-height: 420px; }
#mapDetail { width: 100%; height: 340px; border-radius: var(--radius); }
.mapbox { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
/* Map hover popup = a clean vertical mini-card (photo on top, then price/address/
   meta with real spacing). Strip Leaflet's default padding so the card fills the
   bubble edge-to-edge. */
.pin-popup-bubble .leaflet-popup-content-wrapper{ padding:0; overflow:hidden; border-radius:12px; box-shadow:0 6px 24px rgba(15,23,42,.22); }
.pin-popup-bubble .leaflet-popup-content{ margin:0; width:200px !important; }
.pin-popup-bubble .leaflet-popup-content p{ margin:0; }
.pin-popup{ cursor:pointer; width:200px; }
.pin-popup__img{ aspect-ratio:16/10; background:var(--paper-2); overflow:hidden; }
.pin-popup__img img{ width:100%; height:100%; object-fit:cover; display:block; }
.pin-popup__body{ padding:10px 12px 12px; }
.pin-popup .t-price{ font:var(--fw-bold) 16px/1 var(--font); color:var(--ink); margin:0 0 4px; }
.pin-popup .t-addr{ font:var(--fw-semi) 13px/1.3 var(--font); color:var(--ink); }
.pin-popup .t-eyebrow{ font:var(--fw-semi) 10px/1.4 var(--font); letter-spacing:.06em; text-transform:uppercase; color:var(--ink-muted); margin-top:4px; }
.pin-popup .t-meta{ font-size:12px; font-weight:var(--fw-med); color:var(--ink-muted); margin-top:6px; }
.pin-popup .t-meta strong{ color:var(--ink); font-weight:var(--fw-semi); }
.pin-popup .pin-dot{ margin:0 6px; opacity:.4; }

/* mobile map/list toggle */
.mobile-view-toggle { display: none; }
@media (max-width: 900px) {
  .mobile-view-toggle { display: flex; gap: 8px; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: var(--shadow-lift); }
  .home-layout.show-map .home-left  { display: none; }
  .home-layout:not(.show-map) .home-right { display: none; }
  .home-layout.show-map .home-right { display: block; }
}

/* favorites drawer */
.fav-drawer { position: fixed; top: var(--nav-h); right: -360px; width: 340px; max-width: 90vw; height: calc(100vh - var(--nav-h)); background: var(--white); border-left: 1px solid var(--line); box-shadow: var(--shadow-lift); transition: right .25s var(--ease); z-index: 1100; overflow-y: auto; padding: 16px; }
.fav-drawer.open { right: 0; }

/* ------------------------------------------------------------------
   LISTING: "Listed by" attribution + disclaimer (matches THRED Realty)
   ------------------------------------------------------------------ */
.listing-attribution{ border-top:1px solid var(--line); margin-top:2rem; padding-top:14px; }
.listing-attribution__line{ margin:0; font-size:13px; color:var(--ink-muted); }
.listing-attribution__line a{ color:var(--ink-muted); text-decoration:underline; }
.listing-attribution__line a:hover{ color:var(--accent); }
.listing-disclaimer{ border-top:1px solid var(--line); margin-top:1.25rem; padding-top:14px; }
.listing-disclaimer__text{ margin:0; font-size:12px; line-height:1.55; color:var(--ink-muted); }

/* ------------------------------------------------------------------
   LISTING TEMPLATE — data-driven sections (THRED Realty model)
   ------------------------------------------------------------------ */
.listing-headline{ display:flex; align-items:baseline; gap:16px; flex-wrap:wrap; margin:14px 0 4px; }
.listing-price{ font-size:clamp(24px,3.5vw,34px); font-weight:var(--fw-bold); letter-spacing:var(--letter-tight); color:var(--ink); }
.listing-inline-facts{ font-size:15px; color:var(--ink-muted); }
.listing-inline-facts strong{ color:var(--ink); }
.listing-inline-facts .dot{ margin:0 8px; opacity:.5; }

.listing-section{ margin:0 0 2rem; }
.listing-section .section-title{
  font-size:clamp(14px,1.4vw,16px); font-weight:var(--fw-bold); letter-spacing:.04em; text-transform:uppercase;
  color:var(--ink-muted); margin:0 0 10px; padding-bottom:8px; border-bottom:1px solid var(--line);
}
.specs{ display:block; }
.spec{
  display:grid; grid-template-columns:minmax(120px,34%) 1fr; align-items:baseline;
  column-gap:1.5rem; padding:9px 0; border-bottom:1px solid var(--line); margin:0;
}
.specs .spec:last-child{ border-bottom:0; }
.spec__label{ color:var(--ink-muted); font-size:13.5px; font-weight:var(--fw-semi); line-height:1.4; }
.spec__value{ font-size:14px; color:var(--ink); line-height:1.5; word-break:break-word; }

/* Admin-only block (server-rendered) */
.listing-admin-only{ margin:0 0 2rem; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.listing-admin-only .section-title{
  margin:0; padding:10px 14px; background:var(--paper-2); border-bottom:1px solid var(--line);
  font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-muted); font-weight:var(--fw-bold);
}
.listing-admin-only .specs{ padding:6px 14px; }

/* ------------------------------------------------------------------
   LISTING DETAIL — full-bleed hero + 80% body + admin drawer
   ------------------------------------------------------------------ */
/* Featured image spans full viewport width; the rest of the listing is centered ~80%. */
.listing-hero{ width:100%; background:var(--paper-2); }
.listing-hero img{ width:100%; height:clamp(260px,42vw,520px); object-fit:cover; display:block; }

/* ONLY the listing BODY content is centered/constrained (~80%, like THRED Realty).
   NOT the fixed header, NOT the footer, NOT the full-bleed hero — those stay full width.
   Scoped to the .listing-w wrapper class on the listing's own containers. */
.listing-w{ max-width:1200px; margin-left:auto; margin-right:auto; }

/* Admin tools drawer (right slide-out) — admin-only */
.admin-drawer-tab{
  position:fixed; right:0; top:38%; z-index:1400;
  transform:translateY(-50%);
  background:var(--ink); color:var(--white); border:0; cursor:pointer;
  font:var(--fw-bold) 12px/1 var(--font); letter-spacing:.02em;
  padding:12px 10px; border-radius:10px 0 0 10px; box-shadow:var(--shadow-lift);
  writing-mode:vertical-rl;
}
.admin-drawer-tab:hover{ background:var(--accent); }
.admin-drawer-backdrop{ position:fixed; inset:0; background:rgba(12,12,13,.32); z-index:1390; }
.admin-drawer{
  position:fixed; top:0; right:-400px; width:380px; max-width:92vw; height:100vh; z-index:1401;
  background:var(--white); border-left:1px solid var(--line); box-shadow:var(--shadow-lift);
  transition:right .25s var(--ease); overflow-y:auto;
}
.admin-drawer.open{ right:0; }
.admin-drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--white);
}
.admin-drawer-close{ background:none; border:0; font-size:24px; line-height:1; cursor:pointer; color:var(--ink-muted); }
.admin-drawer-close:hover{ color:var(--ink); }
.admin-drawer-body{ padding:16px; }
@media (max-width:600px){ .admin-drawer-tab{ top:auto; bottom:90px; transform:none; } }

/* listing lead form — representation nudge + disclaimer */
.form-disclaimer{ font-size:11px; line-height:1.4; margin:10px 0 0; }
#leadForm select.input{ appearance:auto; }

/* ------------------------------------------------------------------
   TAG PILLS — listing header + cards (Phase C)
   ------------------------------------------------------------------ */
.listing-tags{ display:flex; flex-wrap:wrap; gap:6px; margin:0 0 6px; }
.tag-pill{
  display:inline-block; padding:3px 10px; border-radius:999px;
  font:var(--fw-semi) 11px/1.4 var(--font); letter-spacing:.02em;
  background:var(--accent-soft); color:var(--accent-hover); border:1px solid transparent;
  white-space:nowrap;
}
.tag-pill--status{ background:var(--ink); color:var(--white); border-color:var(--ink); }
.card-tags{ position:absolute; top:8px; left:8px; display:flex; gap:4px; flex-wrap:wrap; z-index:2; max-width:80%; }
.card-tags .tag-pill{ font-size:10px; padding:2px 8px; box-shadow:0 1px 3px rgba(0,0,0,.18); }
.photo{ position:relative; }

.related-section{margin-top:8px}
.related-section .section-title{ text-align:center; margin:0 0 22px; font-size:clamp(20px,2.4vw,26px); font-weight:var(--fw-bold); letter-spacing:var(--letter-tight); }
/* Fixed-width cards that FAN OUT across the row and CENTER when there are fewer —
   never stretch, never split a near-full row onto two lines. auto-fit drops empty
   tracks; the cap (minmax 200–230) keeps every card the same size on every catalog. */
/* One rule for every "card strip" — related, recently-viewed, AND the landing
   Featured/Recently rows — so they fill full width identically (no duplicates). */
.grid.grid-cards.landing-featured-grid,
.grid.grid-cards.fav-grid{
  grid-template-columns:repeat(auto-fit, minmax(230px, 1fr));
  gap:18px;
}
/* Related / recently-viewed / area pages ONLY — cap + center so 1–2 cards don't
   balloon to full width. Does NOT touch the catalog/search grid (base rule above). */
.related-section .grid-cards,
.grid.grid-cards.area-grid{
  grid-template-columns:repeat(auto-fit, minmax(230px, 340px));
  gap:18px;
  justify-content:center;
}

.card-status{position:absolute; top:8px; left:8px; z-index:2; background:rgba(12,12,13,.82); color:#fff; font:var(--fw-semi) 10px/1.4 var(--font); letter-spacing:.03em; padding:3px 9px; border-radius:999px; text-transform:uppercase}
.grid-cards .card-tags{top:auto; bottom:8px}

/* ==================================================================
   DATA-DRIVEN FILTERS — common bar + popovers + All Filters drawer
   ================================================================== */
.filterbar2{ background:var(--white); border-bottom:1px solid var(--line); }
.filterbar2-row{ display:flex; align-items:center; gap:10px; padding:10px var(--pad-x); flex-wrap:wrap; }
.fb-search{ flex:1 1 220px; min-width:180px; max-width:340px; }
.fb-sort{ width:auto; min-width:120px; }
.fb-all{ background:var(--ink); color:var(--white); display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }
.fb-all:hover{ background:var(--accent); }
.fb-count{ background:var(--white); color:var(--ink); font-weight:var(--fw-bold); font-size:11px; min-width:18px; height:18px; border-radius:999px; display:inline-flex; align-items:center; justify-content:center; padding:0 5px; }

.fb-common{ display:flex; align-items:center; gap:8px; flex:1 1 auto; flex-wrap:wrap; }
.fb-chip{ display:inline-flex; align-items:center; gap:2px; background:var(--white); border:1px solid var(--line); border-radius:999px; padding:8px 12px; font:var(--fw-semi) 13px/1 var(--font); color:var(--ink); cursor:pointer; white-space:nowrap; transition:border-color .15s, background .15s; }
.fb-chip:hover{ border-color:var(--accent); }
.fb-chip.on{ border-color:var(--accent); background:var(--accent-soft); color:var(--accent-hover); }
.fb-chip__sum{ font-weight:var(--fw-semi); color:var(--accent-hover); }
.fb-caret{ font-size:10px; opacity:.6; margin-left:2px; }

/* popover that hangs off a common chip — grows to fit (only scrolls if huge) */
.fb-pop{ position:absolute; z-index:1300; background:var(--white); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow-lift); padding:14px; min-width:240px; max-width:320px; }

/* a facet control (shared by popover + drawer) */
.fb-ctl{ display:flex; flex-wrap:wrap; gap:8px; }
.fb-ctl--range{ flex-wrap:nowrap; align-items:center; }
.fb-ctl--range .input{ width:100%; padding:9px 11px; }
.fb-dash{ color:var(--ink-muted); }
.fb-pill{ border:1px solid var(--line); background:var(--white); border-radius:999px; padding:7px 13px; font:var(--fw-bold) 13px/1 var(--font); color:var(--ink); cursor:pointer; }
.fb-pill:hover{ border-color:var(--accent); }
.fb-pill.on{ background:var(--ink); color:var(--white); border-color:var(--ink); }
/* choice + multi = ONE straight vertical list (nowrap stops it flowing into columns).
   Grows to fit the options; only scrolls when the list would exceed the viewport. */
.fb-ctl--choice, .fb-ctl--multi{ flex-direction:column; flex-wrap:nowrap; gap:1px; max-height:min(70vh, 560px); overflow-y:auto; overflow-x:hidden; width:100%; }
.fb-opt{ display:flex; align-items:center; gap:9px; width:100%; padding:7px 6px; cursor:pointer; font-size:14px; border-radius:6px; }
.fb-opt:hover{ background:var(--paper-2); }
.fb-opt input{ flex:none; width:16px; height:16px; accent-color:var(--accent-hover); }
.fb-opt span{ flex:1; min-width:0; overflow-wrap:anywhere; }

/* "More filters" panel — reveals IN PLACE directly under the bar (never flies
   across the header). Fixed at the bar's bottom (top set by JS). */
.fb-backdrop{ position:fixed; inset:0; background:rgba(12,12,13,.35); z-index:1400; }
.fb-drawer{ position:fixed; left:0; right:0; top:120px; max-height:72vh; background:var(--white); z-index:1401; opacity:0; visibility:hidden; transform:translateY(-6px); transition:opacity .18s ease, transform .18s ease, visibility .18s; display:flex; flex-direction:column; box-shadow:0 18px 40px rgba(0,0,0,.16); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.fb-drawer.open{ opacity:1; visibility:visible; transform:none; }
.fb-more{ border-color:var(--accent); color:var(--accent-hover); font-weight:var(--fw-bold); }
.fb-tab-close{ margin-left:auto; background:none; border:0; font-size:24px; line-height:1; color:var(--ink-muted); cursor:pointer; padding:0 6px; align-self:center; }
.fb-tab-close:hover{ color:var(--ink); }
.fb-foot-spacer{ flex:1; }
.fb-drawer__body{ flex:1; overflow:hidden; padding:0; display:flex; flex-direction:column; min-height:0; }
.fb-tabs{ display:flex; gap:4px; padding:10px var(--pad-x) 0; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.fb-tab{ background:none; border:0; border-bottom:2px solid transparent; padding:8px 14px; font:var(--fw-semi) 14px/1 var(--font); color:var(--ink-muted); cursor:pointer; margin-bottom:-1px; }
.fb-tab:hover{ color:var(--ink); }
.fb-tab.on{ color:var(--ink); border-bottom-color:var(--accent); }
.fb-panels{ flex:1; overflow-y:auto; padding:16px var(--pad-x) 22px; min-height:0; }
.fb-panel{ display:none; }
.fb-panel.on{ display:grid; grid-template-columns:repeat(auto-fill, minmax(250px,1fr)); gap:6px 32px; align-content:start; }
.fb-sec{ padding:10px 0; break-inside:avoid; }
.fb-sec__label{ font:var(--fw-bold) 11px/1.4 var(--font); letter-spacing:.06em; text-transform:uppercase; color:var(--ink-muted); margin:0 0 9px; }
.fb-drawer__foot{ display:flex; align-items:center; gap:12px; padding:10px var(--pad-x); border-top:1px solid var(--line); }
@media (max-width:680px){ .fb-common{ order:3; width:100%; } .fb-search{ max-width:none; } .fb-drawer__body{ grid-template-columns:1fr; } }

/* filter refinements — option counts, tag pills, drawer group headers */
.fb-opt__name{ flex:1; min-width:0; overflow-wrap:anywhere; }
.fb-n{ flex:none; margin-left:auto; color:var(--ink-muted); font-size:12px; font-weight:var(--fw-bold); }
.fb-opt.fb-zero{ opacity:.4; }
.fb-pill.fb-zero{ opacity:.45; }
.fb-ctl--pills{ flex-direction:row; flex-wrap:wrap; gap:6px; max-height:none; }
.fb-ctl--pills .fb-pill{ display:inline-flex; align-items:center; gap:4px; }
.fb-ctl--pills .fb-n{ margin-left:0; color:inherit; opacity:.7; }
.fb-group{ font:var(--fw-bold) 12px/1.4 var(--font); color:var(--ink); margin:16px 0 2px; padding-top:6px; }
.fb-group:first-child{ margin-top:4px; }

/* ------------------------------------------------------------------
   PER-CATALOG IDENTITY — each catalog gets its own accent so the three
   feel distinct (Commercial = blue default, Apartments = teal, Residential
   = green). Overriding the accent tokens recolors chips, badges, active
   nav, tag pills, buttons automatically.
   ------------------------------------------------------------------ */
body[data-catalog="apartments"]{ --accent:#0d9488; --accent-hover:#0f766e; --accent-soft:#ccfbf1; }
body[data-catalog="residential"]{ --accent:#15803d; --accent-hover:#166534; --accent-soft:#dcfce7; }

/* ==================================================================
   LANDING PAGE (root "/")
   ================================================================== */
.landing-hero{ position:relative; overflow:hidden; color:#fff; }
.landing-hero__bg{ position:absolute; inset:0; background:linear-gradient(120deg,#0f172a,#1e293b); }
.landing-hero__bg::after{ content:''; position:absolute; inset:0; background:radial-gradient(120% 100% at 80% 0%, rgba(37,99,235,.35), transparent 60%); }
.landing-hero__content{ position:relative; z-index:2; padding:96px var(--pad-x) 88px; }
.landing-hero__eyebrow{ font:var(--fw-semi) 13px/1 var(--font); letter-spacing:.14em; text-transform:uppercase; opacity:.85; margin-bottom:18px; }
.landing-hero__title{ font-size:clamp(36px,6vw,64px); font-weight:var(--fw-bold); letter-spacing:-.03em; line-height:1.02; margin:0 0 16px; color:#fff; }
.landing-hero__title span{ color:rgba(255,255,255,.62); }
.landing-hero__sub{ font-size:clamp(15px,2vw,19px); opacity:.9; max-width:520px; margin:0 0 28px; }
.landing-search{ display:flex; gap:10px; max-width:560px; }
.landing-search .input{ flex:1; padding:14px 16px; font-size:16px; border:0; color:var(--ink); }
.landing-search .btn{ padding:14px 26px; }

.landing-doorways{ padding-top:48px; }
.doorways-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
@media(max-width:820px){ .doorways-grid{ grid-template-columns:1fr; } }
.doorway{ display:block; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; text-decoration:none; color:var(--ink); background:var(--white); transition:transform .25s var(--ease,ease), box-shadow .25s var(--ease,ease); }
.doorway:hover{ transform:translateY(-4px); box-shadow:0 16px 36px rgba(15,23,42,.14); }
.doorway__img{ aspect-ratio:16/9; background:var(--paper-2); overflow:hidden; }
.doorway__img img{ width:100%; height:100%; object-fit:cover; }
.doorway__body{ padding:20px 22px 22px; }
.doorway__title{ font-size:22px; font-weight:var(--fw-bold); margin:0 0 6px; letter-spacing:-.01em; }
.doorway__blurb{ color:var(--ink-muted); font-size:14px; margin:0 0 12px; }
.doorway__cta{ font:var(--fw-bold) 14px/1 var(--font); color:var(--door-accent); }

.landing-sec-head{ text-align:center; margin-bottom:28px; }
.landing-sec-head h2{ font-size:clamp(22px,3vw,30px); font-weight:var(--fw-bold); letter-spacing:-.02em; margin:0 0 4px; }
/* (landing Featured/Recently grid now shares the full-width rule above —
   merged with .related-section .grid-cards, no duplicate.) */

/* Price-bubble map pins (Zillow-style) — the divIcon root (.price-pin) keeps
   Leaflet's positioning transform; the inner bubble centers on the point. */
.price-pin{ background:none!important; border:0!important; }
.price-pin__bubble{
  position:absolute; transform:translate(-50%,-50%);
  background:var(--ink); color:#fff; font:var(--fw-bold) 12px/1 var(--font);
  padding:5px 9px; border-radius:999px; white-space:nowrap;
  border:2px solid #fff; box-shadow:0 2px 7px rgba(0,0,0,.32); cursor:pointer;
  transition:background .15s ease, transform .15s ease;
}
.price-pin__bubble:hover,
.price-pin--active .price-pin__bubble{
  background:var(--accent); transform:translate(-50%,-50%) scale(1.1); z-index:5;
}
.price-pin--active{ z-index:1000!important; }

/* ── detail polish + mobile pass ───────────────────────────────── */
/* gallery photos lift on hover (they open a lightbox) */
.gallery img{ transition:transform .2s var(--ease,ease), box-shadow .2s var(--ease,ease); }
.gallery img:hover{ transform:translateY(-2px); box-shadow:0 8px 20px rgba(15,23,42,.14); }
.details-right .card h3{ font-weight:var(--fw-bold); letter-spacing:-.01em; }

/* mobile: hero breathes less, search stacks */
@media (max-width:640px){
  .landing-hero__content{ padding:60px var(--pad-x) 52px; }
  .landing-search{ flex-direction:column; }
  .landing-search .btn{ width:100%; }
  .landing-doorways{ padding-top:32px; }
}
/* mobile: filter bar wraps cleanly, More-filters pill goes full-width-ish */
@media (max-width:680px){
  .filterbar2-row{ gap:8px; }
  .fb-sort{ flex:1 1 auto; }
  .breadcrumb-row{ align-items:flex-start; }
  .share-buttons{ flex-wrap:wrap; }
}
/* mobile: detail title block + price scale down a touch */
@media (max-width:560px){
  .listing-top .container{ padding:12px var(--pad-x) 14px; }
  .listing-headline{ margin:10px 0 2px; gap:10px; }
}

/* ==================================================================
   FAVORITES HUB (/favorites)
   ================================================================== */
.fav-page{ padding:28px var(--pad-x) 56px; }
.fav-page__head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:22px; }
.fav-page__head h1{ font-size:clamp(24px,3vw,32px); font-weight:var(--fw-bold); letter-spacing:var(--letter-tight); }
.fav-page__actions{ display:flex; gap:10px; }
/* .fav-grid shares the canonical full-width card-strip rule (auto-fit) — see above. */
.fav-card-wrap{ position:relative; display:flex; flex-direction:column; }
.fav-card-wrap .card{ flex:1; }
.fav-remove{ margin-top:6px; align-self:center; background:none; border:0; color:var(--ink-muted); font:var(--fw-semi) 12px/1 var(--font); cursor:pointer; padding:4px 8px; }
.fav-remove:hover{ color:var(--err); }
.fav-empty{ text-align:center; padding:60px 20px; }
.fav-empty h3{ font-size:20px; font-weight:var(--fw-bold); margin:0 0 8px; }

/* send-shortlist modal */
.fav-modal{ position:fixed; inset:0; z-index:1500; align-items:center; justify-content:center; padding:20px; }
.fav-modal:not([hidden]){ display:flex; }
.fav-modal[hidden]{ display:none; }
.fav-modal__backdrop{ position:absolute; inset:0; background:rgba(12,12,13,.45); }
.fav-modal__card{ position:relative; z-index:1; background:var(--white); border-radius:16px; width:100%; max-width:460px; padding:28px 26px; box-shadow:0 24px 60px rgba(0,0,0,.3); }
.fav-modal__card h3{ font-weight:var(--fw-bold); }
.fav-modal__x{ position:absolute; top:12px; right:14px; background:none; border:0; font-size:26px; line-height:1; color:var(--ink-muted); cursor:pointer; }
.fav-modal form{ display:flex; flex-direction:column; gap:13px; }
.fav-modal .input-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.fav-modal textarea.input{ min-height:90px; resize:vertical; }

/* ── Favorites actions + Compare page ──────────────────────────── */
.cmp-page{ padding:28px var(--pad-x) 56px; }
.cmp-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:20px; }
.cmp-head h1{ font-size:clamp(24px,3vw,32px); font-weight:var(--fw-bold); letter-spacing:var(--letter-tight); }
.cmp-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.cmp-table{ border-collapse:collapse; width:100%; min-width:520px; }
.cmp-table th, .cmp-table td{ text-align:left; padding:10px 14px; border-bottom:1px solid var(--line); vertical-align:top; }
.cmp-corner{ width:130px; }
.cmp-h{ width:auto; border-bottom:0 !important; }
.cmp-h a{ text-decoration:none; color:var(--ink); display:block; }
.cmp-h__img{ aspect-ratio:5/4; background:var(--paper-2); border-radius:9px; overflow:hidden; margin-bottom:8px; }
.cmp-h__img img{ width:100%; height:100%; object-fit:cover; }
.cmp-h__price{ font:var(--fw-bold) 16px/1 var(--font); color:var(--ink); }
.cmp-h__addr{ font:var(--fw-semi) 13px/1.3 var(--font); margin-top:3px; }
.cmp-h__loc{ font-size:12px; color:var(--ink-muted); }
.cmp-row-label{ font:var(--fw-semi) 12px/1.4 var(--font); color:var(--ink-muted); text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; }
.cmp-table td{ font-size:14px; color:var(--ink); }
.cmp-best{ background:var(--accent-soft); font-weight:var(--fw-bold); }
.cmp-dash{ color:var(--ink-muted); }

/* Detail-page Save button (sits with the share buttons) */
.fav-toggle{ display:inline-flex; align-items:center; gap:6px; background:transparent; border:1px solid var(--line); border-radius:8px; padding:6px 11px; font:var(--fw-semi) 12.5px/1 var(--font); color:var(--ink-muted); cursor:pointer; transition:border-color .15s, color .15s; }
.fav-toggle svg{ stroke:currentColor; fill:none; transition:fill .15s; }
.fav-toggle:hover{ border-color:#e53e3e; color:#e53e3e; }
.fav-toggle.favorited{ border-color:#e53e3e; color:#e53e3e; }
.fav-toggle.favorited svg{ fill:#e53e3e; stroke:#e53e3e; }

/* Result-row actions (Notify me + Favorites) */
.result-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width:520px){ .result-count{ flex-wrap:wrap; } .result-actions .btn{ font-size:12px; padding:6px 9px; } }

/* ── Mobile pass: favorites/compare/notify modals + actions ────── */
@media (max-width:560px){
  /* Modals become bottom-sheets: full width, scrollable, stacked fields */
  .fav-modal{ padding:0; align-items:flex-end; }
  .fav-modal__card{ max-width:none; border-radius:16px 16px 0 0; padding:20px 18px calc(22px + env(safe-area-inset-bottom)); max-height:90vh; overflow-y:auto; }
  .fav-modal .input-row{ grid-template-columns:1fr; }
  #leadForm .input-row{ grid-template-columns:1fr; }
  /* Favorites page header + actions stack full width */
  .fav-page__head{ flex-direction:column; align-items:stretch; }
  .fav-page__actions{ width:100%; }
  .fav-page__actions .btn{ flex:1 1 auto; text-align:center; }
  /* Compare: tighter label column + cells so more fits before scrolling */
  .cmp-corner{ width:84px; }
  .cmp-table th, .cmp-table td{ padding:8px 10px; }
  .cmp-row-label{ font-size:11px; }
}

/* Header "Favorites" nav link + saved-count badge */
.nav-link--fav{ display:inline-flex; align-items:center; gap:5px; }
.nav-fav-heart{ color:#e53e3e; font-size:13px; line-height:1; }
.nav-fav-count{ background:#e53e3e; color:#fff; font:var(--fw-bold) 11px/1 var(--font); border-radius:999px; padding:2px 6px; min-width:17px; text-align:center; }

/* Admin Listing-tools drawer: Reply + Ad AI tools */
.admin-drawer-body .ai-tool{ margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.ai-tool__label{ display:block; font:var(--fw-bold) 12px/1 var(--font); text-transform:uppercase; letter-spacing:.05em; color:var(--ink-muted); margin-bottom:8px; }
/* .ai-tool__hint moved to primitives.css (shared by public + admin pages). */
.ai-tool__msg{ width:100%; margin-bottom:8px; resize:vertical; font-size:13px; }
.ai-row{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.ai-chip{ flex:1 1 auto; min-width:60px; background:var(--paper-2); border:1px solid var(--line); border-radius:8px; padding:7px 8px; font:var(--fw-semi) 12px/1 var(--font); color:var(--ink); cursor:pointer; transition:border-color .15s, color .15s; }
.ai-chip:hover{ border-color:var(--accent); color:var(--accent-hover); }

/* Favorites page: admin "Make a share post" panel */
.fav-admin-tools{ background:var(--paper-2,#f6f6f6); border:1px solid var(--line); border-radius:12px; padding:16px 18px; margin-bottom:22px; }
.fav-admin-tools__label{ font:var(--fw-bold) 12px/1.3 var(--font); text-transform:uppercase; letter-spacing:.05em; color:var(--ink-muted); margin-bottom:12px; }
.fav-admin-tools__grid{ display:grid; grid-template-columns:minmax(0,1fr) 220px; gap:16px; align-items:start; }
.fav-admin-tools__text{ width:100%; margin:0; min-height:150px; resize:vertical; font-size:13px; }
.fav-admin-tools__side{ display:flex; flex-direction:column; gap:8px; }
.fav-admin-tools__side .btn{ width:100%; justify-content:center; }
.fav-admin-tools__ai-label{ font:var(--fw-semi) 11px/1 var(--font); text-transform:uppercase; letter-spacing:.05em; color:var(--ink-muted); margin-top:8px; }
.fav-admin-tools__ai{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:0; }
.fav-admin-tools__ai .ai-chip{ flex:none; width:100%; }
@media (max-width:720px){ .fav-admin-tools__grid{ grid-template-columns:1fr; } }

/* "Report an issue" — quiet link under the disclaimer */
.listing-report-link{ background:none; border:0; padding:0; margin:8px 0 0; color:var(--ink-muted); font-size:12px; text-decoration:underline; cursor:pointer; }
.listing-report-link:hover{ color:var(--accent-hover); }
