:root {
  --bg: #12141a;
  --bg-elev: #1a1d26;
  --bg-card: #1e222c;
  --border: #2a2f3a;
  --border-strong: #3a4050;
  --text: #e4e6eb;
  --text-dim: #9aa0ac;
  --text-mute: #6b7280;
  --accent: #7aa2f7;
  --accent-dim: #3d5a8a;
  --good: #9ece6a;
  --warn: #e0af68;
  --bad: #f7768e;
  --new-orange: #c97c1a;

  --bg-success: rgba(158, 206, 106, 0.14);
  --bg-danger:  rgba(247, 118, 142, 0.14);
  --bg-info:    rgba(122, 162, 247, 0.14);
  --bg-warn:    rgba(224, 175, 104, 0.14);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--font-sans);
}
html, body { overflow-x: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- top nav --------------------------------------------------------- */
header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 11px 16px;
  background: var(--bg-elev);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
header .brand {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--text);
}
header nav { display: flex; gap: 16px; align-items: center; margin-left: auto; flex-wrap: wrap; }
header nav a {
  font-size: 13px;
  color: var(--text-dim);
}
header nav a:hover { color: var(--text); text-decoration: none; }
header nav a.active { color: var(--text); font-weight: 500; }
header .nav-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-success);
  color: var(--good);
}
header .nav-pill:hover { color: var(--good); text-decoration: none; }

main { padding: 0; max-width: 1400px; margin: 0 auto; }

footer {
  padding: 12px 16px;
  color: var(--text-mute);
  border-top: 0.5px solid var(--border);
  font-size: 12px;
}

/* --- filter bar ------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 16px;
  background: var(--bg-elev);
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 0;
  border-radius: 0;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}
.filters input, .filters select {
  background: var(--bg-card);
  color: var(--text);
  border: 0.5px solid var(--border-strong);
  padding: 4px 8px;
  height: 28px;
  border-radius: var(--radius-md);
  font: 12px var(--font-sans);
  min-width: 80px;
}
.filters input:focus, .filters select:focus { outline: 1px solid var(--accent); }
.filters button {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 14px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--bg);
  border: none;
  cursor: pointer;
  align-self: flex-end;
}
.filters button:hover { background: var(--text-dim); }
.filters .reset, .filters a.badge {
  font-size: 12px;
  color: var(--text-dim);
  height: 28px;
  background: transparent;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
}
.filters a.badge:hover { color: var(--text); text-decoration: none; }

@media (max-width: 600px) {
  .filters { flex-direction: column; align-items: stretch; }
  .filters label { width: 100%; }
  .filters input, .filters select { width: 100%; }
  .filters button { align-self: stretch; }
}

/* --- card grid -------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; padding: 12px; }
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-strong); }
.card.inactive { opacity: 0.55; }
.card.is-drop { border-color: var(--accent); border-width: 1px; }

.thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0d0f14 center/cover no-repeat;
  position: relative;
  display: block;
}
.thumb.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-size: 12px;
}

/* photo-overlay status badges (NEW LISTING, REPRICED) */
.photo-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.photo-badge.new      { background: var(--new-orange); color: #fff; }
.photo-badge.repriced { background: var(--bg-info); color: var(--accent); }

.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

/* price row: serif euro price + €/m² signal pill */
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.price {
  font-size: 22px;
  font-weight: 500;
  font-family: var(--font-serif);
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
  white-space: nowrap;
}
.price .price-was {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--text-mute);
  text-decoration: line-through;
}
.price.deal    { color: var(--good); }
.price.premium { color: var(--bad); }

/* compact signal pill — also reused by .badge.good/.warn/.bad below */
.signal {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-md);
  white-space: nowrap;
}
.signal.good { background: var(--bg-success); color: var(--good); }
.signal.bad  { background: var(--bg-danger);  color: var(--bad); }
.signal.neutral { background: var(--bg-elev); color: var(--text-dim); }

/* favorites: ♥/♡ + member name, inline row */
.fav-chips {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.fav-chips form { display: inline; margin: 0; }
.fav-chip {
  background: none;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-sans);
}
.fav-chip:hover { color: var(--text); }
.fav-chip.on { color: var(--bad); }

.title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.title a { color: inherit; }
.title a:hover { color: var(--accent); text-decoration: none; }

.summary {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.meta span + span::before { content: "·"; margin-right: 6px; color: var(--text-mute); }
.meta.source { font-size: 11px; color: var(--text-mute); }

/* transit chips (carried into NEARBY section, kept compact) */
.transit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

/* tag pills — used for status badges in card-body and LLM tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 0.5px solid var(--border);
}
.badge.good { color: var(--good); border-color: transparent; background: var(--bg-success); }
.badge.warn { color: var(--warn); border-color: transparent; background: var(--bg-warn); }
.badge.bad  { color: var(--bad);  border-color: transparent; background: var(--bg-danger); }
.badge.new  {
  color: #fff;
  background: var(--new-orange);
  border-color: transparent;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* divider between card-body and NEARBY block */
.divider { height: 0.5px; background: var(--border); margin: 4px 0 2px; }
.section-label {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* POI rows — horizontal: icon + LABEL on left, value on right */
.pois {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.poi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.poi-member {
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 10px;
  min-width: 3.5rem;
}
.poi-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 0.5px solid transparent;
  white-space: nowrap;
  font-size: 12px;
  gap: 8px;
  overflow: hidden;
}
.poi-chip .poi-label, .poi-chip .poi-val { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.poi-chip .poi-icon { width: 16px; text-align: center; font-size: 12px; }
.poi-chip .poi-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-mute);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  flex: 1;
}
.poi-chip .poi-val { font-size: 12px; font-weight: 500; color: var(--text); }
.poi-chip.hero { background: var(--bg-info); }
.poi-chip.hero .poi-label, .poi-chip.hero .poi-val { color: var(--accent); }

.empty-state { color: var(--text-mute); padding: 2rem; text-align: center; }

/* --- detail page ------------------------------------------------------ */
.detail { max-width: 1000px; margin: 0 auto; padding: 16px; }
.detail .back-link {
  display: inline-block;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 12px;
}
.detail .back-link:hover { color: var(--text); text-decoration: none; }
.detail h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 500;
  font-family: var(--font-serif);
  letter-spacing: -0.3px;
}
.detail .sub { color: var(--text-dim); margin-bottom: 1rem; font-size: 13px; }
.detail .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  margin: 1rem 0;
}
.detail .gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: #0d0f14;
}
.detail .gallery a { cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.lightbox[hidden] { display: none; }
.lightbox .lb-img {
  max-width: 92vw; max-height: 92vh;
  object-fit: contain; border-radius: var(--radius-md);
  user-select: none;
}
.lightbox .lb-btn {
  position: absolute; background: rgba(20,22,28,0.7); color: #fff;
  border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-md);
  font-size: 1.8rem; line-height: 1; padding: 0.2rem 0.7rem;
  cursor: pointer; user-select: none;
}
.lightbox .lb-btn:hover { background: rgba(40,44,54,0.9); }
.lightbox .lb-close { top: 1rem; right: 1rem; }
.lightbox .lb-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lightbox .lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-counter {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  color: #ccc; font-size: 13px;
  background: rgba(20,22,28,0.7); padding: 0.2rem 0.6rem; border-radius: var(--radius-md);
}

.detail section { margin-top: 1.5rem; }
.detail section h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-mute);
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.detail .desc {
  white-space: pre-wrap;
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
}
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.detail dt { color: var(--text-dim); }
.detail dd { margin: 0; color: var(--text); }
.detail .history { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-dim); }
.detail .history li { margin: 2px 0; }

/* --- stats page ------------------------------------------------------- */
.stats-head { display: flex; align-items: baseline; gap: 16px; padding: 14px 16px 8px; }
.stats-head h1 { margin: 0; font-size: 22px; font-weight: 500; font-family: var(--font-serif); letter-spacing: -0.3px; }
.stats-sub { color: var(--text-dim); font-size: 13px; }
.stats-group {
  margin: 16px 16px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-mute);
  font-weight: 600;
}
.charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}
.chart {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 0;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  height: 320px;
}
.chart.wide { grid-column: span 2; }
@media (max-width: 800px) { .chart.wide { grid-column: auto; } }
.chart figcaption {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.chart canvas { flex: 1; min-height: 0; }
.chart-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-size: 12px;
}

/* --- listing detail (v2) --------------------------------------------- */
.ld-back-row { padding: 12px 16px 0; max-width: 1200px; margin: 0 auto; }

/* gallery: hero left, two thumbs stacked right. Falls back gracefully
   when there are <3 images: empty thumbs collapse to zero-height. */
.ld-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 12px 16px;
  max-width: 1200px;
  margin: 0 auto;
  height: 520px;
}
.ld-photo-main {
  grid-row: 1 / 3;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: #0d0f14 center/cover no-repeat;
  position: relative;
  display: block;
  overflow: hidden;
}
.ld-photo-thumb {
  background: #0d0f14 center/cover no-repeat;
  position: relative;
  display: block;
  overflow: hidden;
}
.ld-photo-thumb:nth-of-type(2) { border-radius: 0 var(--radius-lg) 0 0; }
.ld-photo-thumb:nth-of-type(3) { border-radius: 0 0 var(--radius-lg) 0; }
.ld-photo-thumb:only-of-type { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; grid-row: 1 / 3; }

.ld-photo-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: rgba(20,22,28,0.85);
  color: var(--text);
  border: 0.5px solid var(--border-strong);
}
.ld-status-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ld-status-pill.good { background: var(--bg-success); color: var(--good); }
.ld-status-pill.bad  { background: var(--bg-danger);  color: var(--bad); }
.ld-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ld-repriced-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-info);
  color: var(--accent);
  letter-spacing: 0.4px;
}

/* main 2-column body */
.ld-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  padding: 12px 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}
.ld-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ld-sidebar { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 64px; }

.ld-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.ld-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ld-section-sub {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-mute);
}

/* hero card */
.ld-repriced-inline {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 6px;
}
.ld-price {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
}
.ld-price.deal    { color: var(--good); }
.ld-price.premium { color: var(--bad); }
.ld-price-sub {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-mute);
  margin-left: 4px;
}
.ld-address {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
}
.ld-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 12px;
}
.ld-stat { display: flex; flex-direction: column; gap: 2px; }
.ld-stat-val {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.ld-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-mute);
}
.ld-signal-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.ld-favs { margin-top: 12px; }

/* property details grid — auto-fit so it reflows on narrow viewports */
.ld-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.ld-detail {
  padding: 10px 12px;
  background: var(--bg-elev);
  border-radius: var(--radius-md);
}
.ld-detail-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-mute);
  margin-bottom: 3px;
}
.ld-detail-val { font-size: 13px; font-weight: 500; color: var(--text); }
.ld-detail-val.good { color: var(--good); }
.ld-detail-val.bad  { color: var(--bad); }

/* nearby list */
.ld-pois { display: flex; flex-direction: column; gap: 6px; }
.ld-poi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  gap: 12px;
}
.ld-poi.hero { background: var(--bg-info); }
.ld-poi.hero .ld-poi-name { color: var(--accent); }
.ld-poi.hero .ld-poi-sub  { color: var(--accent); opacity: 0.8; }
.ld-poi.hero .ld-poi-dist { color: var(--accent); }
.ld-poi-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.ld-poi-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.ld-poi-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ld-poi-sub {
  font-size: 10px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}
.ld-poi-dist {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* tags */
.ld-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ld-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 0.5px solid var(--border);
}
.ld-tag.pos {
  background: var(--bg-success);
  color: var(--good);
  border-color: transparent;
}
.ld-tag.warn {
  background: var(--bg-warn);
  color: var(--warn);
  border-color: transparent;
}

/* classification dl */
.ld-cls-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 10px 0 0;
  font-size: 12px;
}
.ld-cls-dl dt { color: var(--text-dim); }
.ld-cls-dl dd { margin: 0; color: var(--text); }
.ld-cls-notes { color: var(--text-dim); margin: 8px 0 0; font-size: 12px; }

/* description */
.ld-desc-label {
  font-size: 10px;
  letter-spacing: 0.4px;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ld-description {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.ld-description-full { white-space: pre-wrap; }
.ld-original {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.6;
  border-left: 2px solid var(--border-strong);
  padding-left: 12px;
  white-space: pre-wrap;
}

/* map */
.ld-map { height: 320px; border-radius: var(--radius-md); border: 0.5px solid var(--border); }

/* horizontal-scrolling thumbnail strip for the "All photos" card. The JS
   hooks on #gallery's <a data-idx> children, so we keep the element shape
   and just restyle. min-width:0 on the card body keeps the strip clipped to
   the card's content width even with long flex content. */
.ld-card .gallery {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  min-width: 0;
}
.ld-card .gallery a {
  flex: 0 0 auto;
  scroll-snap-align: start;
  cursor: zoom-in;
}
.ld-card .gallery img {
  display: block;
  width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: #0d0f14;
}
.ld-card .gallery::-webkit-scrollbar { height: 6px; }
.ld-card .gallery::-webkit-scrollbar-track { background: transparent; }
.ld-card .gallery::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
@media (max-width: 600px) {
  .ld-card .gallery img { width: 160px; height: 110px; }
}

/* price history */
.ld-price-history { display: flex; flex-direction: column; gap: 0; }
.ld-history-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.ld-history-date  { font-size: 11px; color: var(--text-mute); }
.ld-history-event { font-size: 11px; color: var(--text-dim); }
.ld-history-price { font-size: 12px; font-weight: 500; color: var(--text); }
.ld-divider { height: 0.5px; background: var(--border); }

/* sidebar */
.ld-cta-primary {
  display: block;
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--bg) !important;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.ld-cta-primary:hover { background: var(--text-dim); text-decoration: none; }
.ld-cta-sub {
  font-size: 10px;
  color: var(--text-mute);
  text-align: center;
  margin-top: 6px;
}
.ld-meta { display: flex; flex-direction: column; gap: 6px; }
.ld-meta-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.ld-meta-label { color: var(--text-mute); }
.ld-meta-val { color: var(--text); font-weight: 500; }
.ld-meta-val.good { color: var(--good); }
.ld-meta-val.bad  { color: var(--bad); }

/* responsive: collapse to single column when sidebar can't fit */
@media (max-width: 900px) {
  .ld-body { grid-template-columns: 1fr; }
  .ld-sidebar { position: static; }
  .ld-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 420px;
  }
  .ld-photo-main { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .ld-photo-thumb:nth-of-type(2) { border-radius: 0; }
  .ld-photo-thumb:nth-of-type(3) { border-radius: 0 0 var(--radius-lg) var(--radius-lg); grid-column: 1 / 3; }
}
@media (max-width: 600px) {
  .ld-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: 300px;
    padding: 8px 12px;
  }
  .ld-photo-main { grid-row: auto; border-radius: var(--radius-lg); }
  .ld-photo-thumb { display: none; }
  .ld-body { padding: 8px 12px 20px; }
  .ld-card { padding: 12px; }
  .ld-price { font-size: 28px; }
  .ld-stats-row { gap: 16px; }
  .ld-stat-val { font-size: 18px; }
  .ld-history-row { grid-template-columns: 1fr auto; }
  .ld-history-event { display: none; }
}

/* --- profile recommendations ----------------------------------------- */
.recs-locked {
  background: var(--bg-info);
  color: var(--accent);
  border: 0.5px solid var(--accent-dim);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
}
.recs-locked .muted { margin-left: 6px; }
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.rec-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: inherit;
  transition: border-color 0.15s;
}
.rec-card:hover { border-color: var(--border-strong); text-decoration: none; }
.rec-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: #0d0f14 center/cover no-repeat;
}
.rec-thumb.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-size: 12px;
}
.rec-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.rec-price {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.3px;
}
.rec-title {
  font-size: 12px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
}
.rec-meta span + span::before { content: "·"; margin-right: 6px; color: var(--text-mute); }
.rec-why { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }

/* --- profile / notify forms ------------------------------------------ */
.notify-block { margin-top: 1.5rem; }
.notify-block h3 {
  margin-top: 1rem;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-mute);
  font-weight: 600;
}
.notify-list { list-style: none; padding: 0; }
.notify-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
}
.muted { color: var(--text-mute); font-size: 12px; }
.inline-form { display: inline; margin-left: auto; }
.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
  max-width: 32rem;
}
.stacked-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.stacked-form .row { display: flex; gap: 8px; }
.stacked-form .row label { flex: 1; }
.stacked-form input {
  padding: 4px 8px;
  height: 28px;
  background: var(--bg-card);
  color: var(--text);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font: 12px var(--font-sans);
}
.stacked-form button {
  padding: 4px 14px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  align-self: flex-start;
}
.inline-form button.danger {
  background: transparent;
  color: var(--bad);
  border: 0.5px solid var(--bad);
  border-radius: var(--radius-sm);
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
}

/* Demo-mode banner — visible at the top of every page when [demo].enabled is true,
   so demo viewers can never mistake sample data for real listings. */
.demo-banner {
  background: #fef3c7;
  color: #78350f;
  border-bottom: 1px solid #f59e0b;
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
