/* ==========================================================================
   Listing Detail Modal — full redesign (Claude Design handoff May 2026)
   Shared CSS used by results / swiper / favourites / recently-viewed.
   Font: Inter (matches the rest of Settlescan).
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root{
  --d-bg: #131314;
  --d-panel: #1a1a1c;
  --d-panel-2: #161617;
  --d-border: rgba(255,255,255,.07);
  --d-border-strong: rgba(255,255,255,.12);
  --d-ink: #f5f5f5;
  --d-ink-2: #cfcfcf;
  --d-ink-3: #9a9a9a;
  --d-accent: #ffd34a;
  --d-accent-2: #f5b300;
  --d-accent-soft: rgba(255,211,74,.14);
  --d-accent-line: rgba(255,211,74,.28);
  --d-sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---------- Backdrop + shell ---------- */
.detail-backdrop{
  position:fixed; inset:0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(0,0,0,.55), rgba(0,0,0,.78));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display:none; z-index:13000;
}
.detail-backdrop.open{ display:block; }

.detail-modal{
  position:fixed; left:50%; top:50%; transform:translate(-50%,-50%);
  /* Narrower than before now that the layout is a single vertical column —
     the carousel doesn't need full 2-column-spanning width. */
  width:min(720px, 96vw); max-width:96vw; max-height:92vh;
  overflow-x:hidden; overflow-y:auto;
  border:1px solid var(--d-border-strong);
  border-radius:28px;
  box-shadow:
    0 40px 100px rgba(0,0,0,.65),
    0 0 0 1px rgba(255,255,255,.02) inset,
    0 1px 0 rgba(255,255,255,.06) inset;
  display:none;
  z-index:13001;
  font-family: var(--d-sans);
  font-size: 14px;
  color: var(--d-ink);
  background-color: var(--d-bg);
  background-image:
    radial-gradient(80% 50% at 100% 0%, rgba(255,211,74,.07), transparent 55%),
    linear-gradient(180deg, var(--d-panel), var(--d-bg));
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.detail-modal.open{ display:block; }
.detail-modal::-webkit-scrollbar{ width:8px; }
.detail-modal::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.12); border-radius:4px; }
.detail-modal::-webkit-scrollbar-thumb:hover{ background:rgba(255,255,255,.22); }

html.is-mobile-web .detail-modal,
html.is-mobile-web .url-modal{
  top: calc(env(safe-area-inset-top) + 12px);
  bottom: calc(var(--bottom-nav-h, 0px) + 12px);
  transform: translateX(-50%);
  max-height: none;
}

/* ---------- Top utility pills: REMOVED ----------
   The host templates still render `<button class="detail-close">` and
   `<button class="report-btn" id="dReportToggle">` at the top of the
   modal markup, but per the new design those are gone — Close lives in
   the sticky bottom action bar, Report is a small inline link next to
   the disclaimer note. We hide the host-rendered top buttons here. */
.detail-close,
.detail-modal .report-btn{
  display: none !important;
}

/* Report panel — now centered as a popover within the modal when toggled
   from the new bottom Report link. */
.detail-modal .report-panel{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(96vw - 16px));
  background: rgba(20,20,22,.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--d-border-strong);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.65);
  z-index: 13050;
  display: none;
  flex-direction: column;
  gap: 12px;
}

/* Inline Report-listing link, sits under the disclaimer. */
.d-report-row{
  display: flex;
  justify-content: center;
  margin: 4px 0 0;
}
.d-report-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: var(--d-ink-3);
  font-family: var(--d-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.d-report-link:hover{
  color: var(--d-accent);
  background: rgba(255,255,255,.04);
}
.d-report-link svg{
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.detail-modal .report-panel.open{ display: flex; }
.detail-modal .report-label{
  font-size: 13px;
  color: var(--d-ink-2);
  line-height: 1.4;
}
.detail-modal .report-text{
  background: rgba(0,0,0,.3);
  border: 1px solid var(--d-border-strong);
  border-radius: 10px;
  color: var(--d-ink);
  font-family: inherit;
  padding: 10px;
  font-size: 13px;
  resize: vertical;
  min-height: 90px;
}
.detail-modal .report-text:focus{
  outline: 2px solid var(--d-accent);
  outline-offset: 1px;
}
.detail-modal .report-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.detail-modal .report-submit{
  height: 36px;
  padding: 0 14px;
  background: var(--d-accent);
  color: #1a1100;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.detail-modal .report-submit:hover{ background: #ffdc6e; }
.detail-modal .report-status{ font-size: 12px; color: var(--d-accent); }

/* ---------- Body layout ----------
   Single vertical column at every viewport size: media (carousel +
   thumbs) on top, then header / stats / description / location /
   amenities / disclaimer + Report link, then sticky footer bar. */
.detail-body{
  display: flex;
  flex-direction: column;
  gap: 32px;                 /* breathing room between image block + price */
  padding: 24px 24px 28px;   /* top utility pills are gone, no extra clearance needed */
  min-width: 0;
  overflow-x: hidden;
  background: transparent;
}

.detail-media,
.detail-main{
  min-width: 0;
  max-width: 100%;
  width: 100%;
  /* Belt-and-suspenders centering: even though .detail-body's padding is
     symmetric, this ensures any inline CSS quirks don't push the column. */
  margin-left: auto;
  margin-right: auto;
}
.detail-media{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  /* Override inline host-page CSS that wraps .detail-media in a padded
     "card" (rounded border + gradient background + box-shadow + 16px
     padding). With those inherited, the image block ends up narrower
     than the price/address row beneath it, looking offset within the
     modal. Reset everything so the carousel fills the full body width. */
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  position: static !important;
  top: auto !important;
}
.detail-media > *{
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.detail-main{
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Carousel + thumbs + actions fill the modal width naturally now that the
   modal itself is capped at ~720px. */
.detail-media .ss-card-carousel,
.detail-media .d-thumb-strip,
.detail-media .d-actions--top{
  width: 100%;
}

/* ---------- Carousel ---------- */
.detail-media .ss-card-carousel,
.detail-media .ss-card-carousel-view{
  max-width: 100%;
}
.detail-media .ss-card-carousel{
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0a0a0b;
  aspect-ratio: 4 / 3;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.detail-media .ss-card-carousel-view{
  height: 100%;
}
.detail-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;     /* radius lives on the carousel container */
  box-shadow: none;
}
.detail-media .ss-card-carousel-arrow{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(15,15,17,.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--d-ink);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
}
.detail-media .ss-card-carousel-arrow:hover{
  background: rgba(20,20,22,.95);
  transform: scale(1.05);
}

/* Thumbnail strip — JS emits .d-thumb-strip + .d-thumb children.
   justify-content: center keeps the row visually centered under the
   carousel rather than left-clustered when there are only 4–5 thumbs. */
.d-thumb-strip{
  display: flex;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.d-thumb-strip::-webkit-scrollbar{ display: none; }
.d-thumb{
  flex: 0 0 72px;
  height: 54px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, opacity .15s;
  opacity: .65;
}
.d-thumb:hover{ opacity: 1; }
.d-thumb.is-active{
  border-color: var(--d-accent);
  opacity: 1;
}

/* ---------- Action rows ---------- */
.d-actions{
  display: grid;
  gap: 10px;
  min-width: 0;
}
.d-actions--top{
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 52px;
}
/* Bottom action bar — direct child of .detail-modal so position:sticky
   anchors cleanly to the modal's scroll viewport. As the user scrolls the
   listing content, the bar stays glued to the bottom of the modal with a
   gradient + backdrop blur showing content scrolling beneath it.

   z-index 1200 sits above Leaflet's map controls (default ~1000) so the
   mini-map can't bleed through the footer. */
.detail-modal > .d-actions--footer{
  box-sizing: border-box;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  display: grid;
  /* 4-column layout: Open listing (flexible) | Share (flexible) | ♥ (52px) | Close (auto)
     All buttons can shrink (minmax 0) so nothing pokes outside the modal. */
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 52px minmax(0, auto);
  gap: 10px;
  background: linear-gradient(180deg, rgba(19,19,20,0) 0%, rgba(19,19,20,.92) 30%, rgba(19,19,20,.98) 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  border-top: 1px solid var(--d-border);
  z-index: 1200;
  margin: 0;
}
.detail-modal > .d-actions--footer.d-actions--no-fav{
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(72px, auto);
}

/* Buttons inside the footer must be allowed to shrink, with truncated text
   when the column gets too narrow. */
.detail-modal > .d-actions--footer .btn{
  min-width: 0;
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Higher-specificity override that beats any leftover
   `.detail-modal:not(.detail-modal--scrollable) .d-actions--footer
   { display:none }` rules in host-page inline <style> blocks. */
aside.detail-modal > .d-actions--footer{
  display: grid;
}

/* All button styling here is scoped to `.detail-modal` so it doesn't bleed
   onto result-grid cards (which share the `.d-actions .btn` class names
   but should keep their own glow-free styling). */
.detail-modal .d-actions .btn,
.detail-modal .btn{
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--d-border-strong);
  background: rgba(255,255,255,.06);
  color: var(--d-ink);
  transition: background .15s ease, transform .05s ease, border-color .15s ease;
  padding: 0 16px;
  white-space: nowrap;
  min-width: 0;
}
.detail-modal .d-actions .btn:not(.btn-primary):hover{ background: rgba(255,255,255,.1); }
.detail-modal .d-actions .btn:active{ transform: translateY(1px); }
.detail-modal .d-actions .btn.btn-primary{
  background: linear-gradient(180deg, var(--d-accent) 0%, var(--d-accent-2) 100%);
  color: #1a1100;
  border: none;
  box-shadow: 0 10px 24px rgba(255,211,74,.22), inset 0 1px 0 rgba(255,255,255,.4);
  font-weight: 800;
}
.detail-modal .d-actions .btn.btn-primary:hover{
  background: linear-gradient(180deg, #ffdc6e 0%, #ffc01f 100%);
}

/* Heart icon button (favorite) */
.d-actions #dFavBtn,
.d-actions #dFavTopBtn{
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--d-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.d-actions #dFavBtn:hover,
.d-actions #dFavTopBtn:hover{
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.18);
}
.d-actions #dFavBtn::before,
.d-actions #dFavTopBtn::before{
  content: "";
  width: 22px;
  height: 22px;
  display: block;
  background-color: rgba(255,255,255,.86);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21s-7-4.35-7-10a4.5 4.5 0 0 1 8-2.83A4.5 4.5 0 0 1 19 11c0 5.65-7 10-7 10z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21s-7-4.35-7-10a4.5 4.5 0 0 1 8-2.83A4.5 4.5 0 0 1 19 11c0 5.65-7 10-7 10z'/></svg>");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.d-actions #dFavBtn.is-fav::before,
.d-actions #dFavTopBtn.is-fav::before{
  background-color: var(--d-accent);
}
.d-actions #dFavBtn.is-fav,
.d-actions #dFavTopBtn.is-fav{
  border-color: var(--d-accent-line);
  background: var(--d-accent-soft);
}

.d-actions #dCloseBtn{
  padding: 0 18px;
}

/* ---------- Header block (badges → price → address) ---------- */
.d-header-block,
.d-header-card{
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

/* Badges row — JS emits .d-badges-row with .d-badge children */
.d-badges-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
}
.d-badge,
.d-top-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.d-badge--gold,
.d-top-badge--gold{
  background: var(--d-accent-soft);
  color: var(--d-accent);
  border: 1px solid var(--d-accent-line);
}
.d-badge--gold::before,
.d-top-badge--gold::before{
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--d-accent);
}
.d-badge--neutral{
  background: rgba(255,255,255,.06);
  color: var(--d-ink-2);
  border: 1px solid var(--d-border);
}

/* Price line — Inter, big, tight */
.d-price-line{
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
}
.d-title.d-price,
.d-price{
  font-family: var(--d-sans);
  font-weight: 800;
  font-size: 48px;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--d-ink);
  margin: 0;
}
.d-price-suffix{
  font-size: 16px;
  color: var(--d-ink-3);
  font-weight: 500;
}

/* Address — pin icon + text */
.d-sub,
.d-address{
  font-size: 15px;
  color: var(--d-ink-2);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}
.d-address svg{
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  color: var(--d-accent);
}

/* ---------- Stat strip — 4-cell horizontal grid ---------- */
.d-stat-strip,
.d-summary-row{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--d-border);
  border-radius: 16px;
  overflow: hidden;
}
.d-stat,
.d-summary-row .d-summary-pill{
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--d-border);
  text-align: left;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 0;
}
.d-stat:last-child,
.d-summary-row .d-summary-pill:last-child{
  border-right: none;
}
.d-stat-label{
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--d-ink-3);
  text-transform: uppercase;
}
.d-stat-value{
  font-family: var(--d-sans);
  font-size: 20px;
  font-weight: 700;
  color: var(--d-ink);
  letter-spacing: -.01em;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 4px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
/* Wrap the actual number/range in this span so it never breaks mid-value
   (en-dash in "414–553" is a tempting word-break point otherwise). */
.d-stat-value-num{
  white-space: nowrap;
  display: inline-block;
}
.d-stat-unit{
  font-size: 11px;
  color: var(--d-ink-3);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  display: inline-block;
}

/* ---------- Sections (About / Location / What's included) ---------- */
.d-section{
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.d-section-title{
  font-family: var(--d-sans);
  font-weight: 700;
  font-size: 18px;
  color: var(--d-ink);
  letter-spacing: -.005em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.d-section-title::before{
  content: "";
  width: 18px;
  height: 1px;
  background: var(--d-accent);
  display: inline-block;
  flex-shrink: 0;
}

/* ---------- Description ---------- */
.d-desc-card{
  background: rgba(255,255,255,.02);
  border: 1px solid var(--d-border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.d-desc-card--preview{
  background: transparent;
  border: 0;
  padding: 0;
}
.d-desc-title{
  font-family: var(--d-sans);
  font-weight: 700;
  font-size: 18px;
  color: var(--d-ink);
  letter-spacing: -.005em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.d-desc-title::before{
  content: "";
  width: 18px;
  height: 1px;
  background: var(--d-accent);
  display: inline-block;
  flex-shrink: 0;
}
.d-desc{
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--d-ink-2);
  white-space: pre-line;
}
.d-desc--preview{
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.d-desc-card--preview.is-expanded .d-desc--preview{
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.d-desc-toggle{
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--d-accent);
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.d-desc-toggle:hover{ color: #fff1a6; }

/* ---------- Mini-map ---------- */
.d-minimap-card{
  background: rgba(255,255,255,.02);
  border: 1px solid var(--d-border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.d-minimap-head{
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.d-minimap-title{
  font-family: var(--d-sans);
  font-weight: 700;
  font-size: 18px;
  color: var(--d-ink);
  letter-spacing: -.005em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.d-minimap-title::before{
  content: "";
  width: 18px;
  height: 1px;
  background: var(--d-accent);
  display: inline-block;
  flex-shrink: 0;
}
.d-minimap-sub{
  margin: 0;
  font-size: 13px;
  color: var(--d-ink-3);
  line-height: 1.4;
}
.d-minimap-map{
  position: relative;
  width: 100%;
  height: 220px;
  background: #1a1a1c;
}
.d-minimap-map.leaflet-container,
.d-minimap-map .leaflet-container{
  width: 100%;
  height: 100%;
  background: #151515;
  font: inherit;
}
.d-minimap-map.leaflet-container .leaflet-control-zoom,
.d-minimap-map .leaflet-control-zoom{
  border: none;
  box-shadow: 0 12px 24px rgba(0,0,0,.28);
}
.d-minimap-map.leaflet-container .leaflet-control-zoom a,
.d-minimap-map .leaflet-control-zoom a{
  width: 34px;
  height: 34px;
  line-height: 34px;
  border: none;
  background: rgba(18,18,18,.92);
  color: var(--d-accent);
}
.d-minimap-map.leaflet-container .leaflet-control-attribution,
.d-minimap-map .leaflet-control-attribution{
  background: rgba(10,10,10,.72);
  color: #d8d8d8;
}
.d-minimap-map.leaflet-container .leaflet-control-attribution a,
.d-minimap-map .leaflet-control-attribution a{
  color: var(--d-accent);
}
.d-minimap-marker{ background: transparent; border: none; }
.d-minimap-pin{
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: radial-gradient(circle at 30% 30%, #fff7d6, var(--d-accent) 50%, #b87f00);
  border: 3px solid #0e0e0f;
  box-shadow:
    0 8px 18px rgba(0,0,0,.5),
    0 0 0 4px rgba(255,211,74,.18);
}
.d-minimap-pin::after{
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #0e0e0f;
  border: 2px solid rgba(255,247,214,.7);
}

/* ---------- Amenity grid ----------
   Single vertical stack — no awkward row gaps from uneven item heights,
   uses the right-column width consistently at every viewport size. */
.d-section-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.d-group{
  box-sizing: border-box;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--d-border);
  border-radius: 16px;
  padding: 16px 16px 14px;
  margin: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  width: 100%;
}
.d-group-title{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--d-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--d-ink);
  margin: 0;
}
.d-group-title-icon{
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--d-accent-soft);
  color: var(--d-accent);
  border: 1px solid var(--d-accent-line);
  box-shadow: none;
}
.d-group-title-icon svg{
  width: 16px;
  height: 16px;
  display: block;
}

/* Amenity items: list of dotted entries (replaces the old chip pills) */
.d-amen,
.d-chips{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.d-chip{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--d-ink-2);
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  white-space: normal;
}
.d-chip::before{
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--d-accent);
  opacity: .6;
  flex-shrink: 0;
}

/* ---------- Disclaimer note ---------- */
.d-note{
  margin: 0;
  padding: 12px 14px;
  background: var(--d-accent-soft);
  border: 1px solid var(--d-accent-line);
  border-radius: 14px;
  font-size: 13px;
  color: #fff2b3;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.d-note::before{
  content: "";
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  background-color: var(--d-accent);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v.01M12 12v4'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v.01M12 12v4'/></svg>");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* ---------- Misc ---------- */
.badge{
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #444;
  font-size: 12px;
  color: var(--d-ink);
  background: #202020;
  margin-top: 6px;
}
.badge--viewport{
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px){
  .detail-modal{
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    border-radius: 22px;
    max-height: calc(100vh - 16px);
  }
  .detail-body{
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 56px 14px 18px;
  }
  .detail-media{
    position: static;
    top: 0;
  }
  .d-stat-strip,
  .d-summary-row{
    grid-template-columns: repeat(2, 1fr);
  }
  .d-stat:nth-child(2n),
  .d-summary-row .d-summary-pill:nth-child(2n){
    border-right: none;
  }
  .d-stat:nth-child(-n+2),
  .d-summary-row .d-summary-pill:nth-child(-n+2){
    border-bottom: 1px solid var(--d-border);
  }
  .d-section-grid{ grid-template-columns: 1fr; }
  .d-actions--top{
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 48px;
  }
  .detail-modal > .d-actions--footer{
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr) 48px minmax(58px, .7fr);
    gap: 8px;
    padding: 14px;
  }
  .detail-modal > .d-actions--footer.d-actions--no-fav{
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr) minmax(58px, .75fr);
  }
  .detail-modal > .d-actions--footer #dCloseBtn{
    display: inline-flex;
    padding-left: 10px;
    padding-right: 10px;
  }
  .d-actions .btn,
  .d-actions .btn.btn-primary,
  .d-actions #dCloseBtn{
    height: 48px;
    font-size: 13px;
    border-radius: 12px;
  }
  .d-actions #dFavBtn,
  .d-actions #dFavTopBtn{
    width: 48px;
    min-width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .detail-modal .report-panel{
    top: 60px;
  }
  .d-price{ font-size: 30px; }
}

@media (max-width: 380px){
  .d-actions--top,
  .detail-modal > .d-actions--footer{
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 46px;
  }
  .detail-modal > .d-actions--footer{
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) 46px minmax(54px, .7fr);
    gap: 6px;
    padding: 12px;
  }
  .detail-modal > .d-actions--footer.d-actions--no-fav{
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr) minmax(54px, .7fr);
  }
  .d-actions .btn,
  .d-actions .btn.btn-primary,
  .d-actions #dCloseBtn{
    height: 46px;
    font-size: 12px;
    padding: 0 10px;
  }
  .d-actions #dFavBtn,
  .d-actions #dFavTopBtn{
    width: 46px;
    min-width: 46px;
    height: 46px;
  }
}

/* Sort dropdown styling preserved (used on results.html) */
.btn-sort{
  background: #2f2f2f !important;
  color: #fff !important;
  border: 1px solid #3a3a3a !important;
  border-radius: 14px;
  padding: 8px 12px;
  -webkit-appearance: none;
  appearance: none;
}
@media (min-width: 900px){
  body.results-root:not(.is-app) .btn.btn-sort{
    height: 44px;
    min-height: 44px;
    padding: 0 14px;
    min-width: 190px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 14px;
  }
}
