/* ====== Base ====== */
:root{
  --bg:#0b0c10;
  --panel:#111218;
  --muted:#9aa3b2;
  --text:#e7ecf3;
  --brand:#3ac7bd;    /* teal accent */
  --brand-2:#8b5cf6;  /* violet accent */
  --danger:#ef4444;
  --ring:rgba(58,199,189,.25);
  --shadow:0 10px 30px rgba(0,0,0,.25);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  color:var(--text);
  background:radial-gradient(1200px 600px at 10% -10%, #121320 0%, #0b0c10 50%);
  line-height:1.55;
}

/* ====== Header ====== */
.site-header{
  position:sticky; top:0; z-index:50;
  backdrop-filter:saturate(140%) blur(8px);
  background:rgba(15,16,24,.55);
  border-bottom:1px solid rgba(255,255,255,.06);
  box-shadow:0 6px 24px rgba(0,0,0,.2);
}
.site-header .logo{
  display:flex; align-items:flex-start; gap:10px;
  padding:18px 24px;
}
.site-header h1{
  margin:0; font-weight:800; letter-spacing:.3px;
  background:linear-gradient(90deg,var(--brand),var(--brand-2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  font-size: clamp(20px, 3vw, 28px);
}
.tagline{
  margin:2px 0 0 0; font-size:12px; color:var(--muted)
}
.main-nav ul{
  list-style:none; margin:0; padding:0 24px 18px; display:flex; gap:14px; flex-wrap:wrap
}
.main-nav a{
  color:var(--text); text-decoration:none; opacity:.85;
  padding:8px 12px; border-radius:10px; transition:.2s ease;
  border:1px solid transparent;
}
.main-nav a:hover{opacity:1; border-color:rgba(255,255,255,.08); background:rgba(255,255,255,.03)}

.main-nav ul { justify-content: flex-end; }


/* ====== Layout ====== */
main{max-width:1200px; margin:28px auto; padding:0 20px}

/* ====== Filters ====== */
.filters{
  display:grid; gap:10px;
  grid-template-columns: repeat(8, minmax(0,1fr));
  background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding:14px;
  box-shadow: var(--shadow);
}
.filters input[type="text"],
.filters input[type="number"],
.filters select{
  width:100%;
  background:#0f1117;
  color:var(--text);
  border:1px solid rgba(255,255,255,.08);
  outline:none;
  padding:10px 12px; border-radius:12px;
  transition:border .2s, box-shadow .2s, transform .05s;
}
.filters input:focus, .filters select:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px var(--ring);
}
#searchInput{grid-column: span 2}
#cityFilter, #typeFilter, #bedsFilter, #bathsFilter{grid-column: span 1}
#minPrice, #maxPrice{grid-column: span 1}
#sortFilter{grid-column: span 1}

#applyFilters{
  grid-column: span 1;
  background:linear-gradient(90deg,var(--brand),var(--brand-2));
  color:#0b0c10; font-weight:700; border:none; cursor:pointer;
  border-radius:12px; padding:10px 12px; transition: transform .06s ease;
}
#applyFilters:active{ transform: translateY(1px) }

/* ====== Grid ====== */
.listing-grid{
  margin-top:22px;
  display:grid; gap:16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.listing-card{
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border:1px solid rgba(255,255,255,.06);
  border-radius:16px;
  overflow:hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.listing-card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.listing-card img{
  width:100%; height:180px; object-fit:cover; display:block;
  background:#0f1117;
}
.listing-info{ padding:12px 14px }
.listing-info h3{
  margin:.2rem 0 .3rem; font-size:16px; font-weight:700;
}
.price{
  margin:.15rem 0 .4rem; font-weight:800; letter-spacing:.2px;
  color:#eafbf9;
}
.meta{ color:var(--muted); font-size:13px }

.quick-view-btn{
  margin-top:10px; width:100%;
  padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.08);
  background:transparent; color:var(--text); cursor:pointer; transition:.15s;
}
.quick-view-btn:hover{
  border-color:var(--brand); box-shadow:0 0 0 4px var(--ring);
}

/* ====== No results ====== */
.no-results{
  grid-column:1/-1; text-align:center; color:var(--muted);
  padding:28px; border:1px dashed rgba(255,255,255,.12); border-radius:16px
}

/* ====== Modal ====== */
.modal{
  display:none; position:fixed; inset:0; z-index:100;
  background:rgba(0,0,0,.55);
  padding:24px; overflow:auto;
}
.modal-content{
  margin:auto; max-width:900px; background:var(--panel);
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px; box-shadow: var(--shadow);
  padding:18px 20px; position:relative;
}
.close-btn{
  position:absolute; top:10px; right:12px; cursor:pointer;
  width:34px; height:34px; display:grid; place-items:center;
  border-radius:10px; background:#0f1117; color:var(--text);
  border:1px solid rgba(255,255,255,.1)
}
.chat-modal{ padding:0; overflow:hidden }
#chatFrame{ width:100%; height:min(80vh, 720px); display:block; border:0 }

/* ====== Minimal variant ====== */
body.minimal{ background:#0b0c10 }
.minimal-header{ text-align:center; padding:22px 16px; border-bottom:1px solid rgba(255,255,255,.08)}
.minimal-header h1{ margin:0; font-size:22px; font-weight:800; background:linear-gradient(90deg,var(--brand),var(--brand-2)); -webkit-background-clip:text; background-clip:text; color:transparent }
.minimal-main{ max-width:980px; margin:20px auto; padding:0 16px }
.minimal-search{ display:flex; gap:10px; margin-bottom:10px }
.minimal-search input{ flex:1; padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.08); background:#0f1117; color:var(--text) }
.minimal-search button{ padding:10px 14px; border-radius:12px; border:none; background:linear-gradient(90deg,var(--brand),var(--brand-2)); color:#0b0c10; font-weight:700; cursor:pointer }
.minimal-filters{ display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:10px; margin:12px 0 16px }
.minimal-filters select, .minimal-filters input{ padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.08); background:#0f1117; color:var(--text) }
.minimal-footer{ text-align:center; color:var(--muted); padding:24px 0; border-top:1px solid rgba(255,255,255,.08) }

/* ====== Responsiveness ====== */
@media (max-width: 980px){
  .filters{ grid-template-columns: repeat(4, minmax(0,1fr)) }
  #searchInput{ grid-column: span 4 }
  #applyFilters{ grid-column: span 2 }
}
@media (max-width: 640px){
  .filters{ grid-template-columns: repeat(2, minmax(0,1fr)) }
  #applyFilters{ grid-column: span 2 }
  .listing-card img{ height:160px }
}


/* ====== Global tweaks ====== */
:root {
  --bg: #0b0e13;
  --panel: #121723;
  --panel-2: #0f1420;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --brand: #10b981;
  --brand-2: #099268;
  --stroke: #1e283a;
  --bubble: #141a27;
  --bubble-user: #182233;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
}
body { background: var(--bg); color: var(--text); font-family: 'Poppins',system-ui,-apple-system,Segoe UI,Roboto,Arial; }
.site-header { max-width:1200px; margin:24px auto 8px; padding:0 20px; }
.logo h1{ margin:0; font-weight:600; letter-spacing:.2px;}
.tagline{ margin-top:4px; color:var(--muted); font-size:13px; }

/* ====== Mode Toggle ====== */
.mode-toggle{
  max-width:1200px; margin:8px auto 20px; padding:6px; background:var(--panel);
  border:1px solid var(--stroke); border-radius:14px; display:flex; gap:6px;
}
.mode-btn{
  flex:1; padding:12px 16px; background:transparent; color:var(--muted); border:none;
  border-radius:10px; cursor:pointer; font-weight:600; letter-spacing:.2px;
}
.mode-btn.active{ background:linear-gradient(180deg,#162033,#0f1729); color:#fff; border:1px solid var(--stroke); }

/* ====== Filters ====== */
.filters{
  max-width:1200px; margin:0 auto; padding:16px; background:var(--panel);
  border:1px solid var(--stroke); border-radius:14px; display:grid;
  grid-template-columns: repeat(8, minmax(0,1fr)); gap:10px;
}
.filters input, .filters select{
  background:var(--panel-2); border:1px solid var(--stroke); border-radius:10px; color:var(--text);
  padding:10px 12px; outline:none;
}
#searchInput{ grid-column: span 3; }
#statusFilter, #cityFilter, #typeFilter, #minPrice, #maxPrice, #bedsFilter, #bathsFilter { grid-column: span 1; }
#applyFilters{ grid-column: span 1; border-radius:10px; background:var(--brand); color:#081218; border:none; font-weight:700; }

/* ====== AI Section ====== */
.ai-section{ max-width:1200px; margin:0 auto 12px; padding:16px; background:var(--panel); border:1px solid var(--stroke); border-radius:14px; }
.ai-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.ai-title{ display:flex; align-items:center; gap:10px; }
.ai-dot{ width:10px; height:10px; border-radius:50%; background:var(--brand); box-shadow:0 0 0 6px rgba(16,185,129,.15); }
.ai-sub{ color:var(--muted); font-size:13px; margin-left:6px; }
.ai-actions .ghost{ margin-left:8px; }
.ghost{ background:transparent; border:1px solid var(--stroke); color:var(--text); padding:8px 10px; border-radius:10px; cursor:pointer; }
.ghost.sm{ padding:6px 8px; }

.chat-wrap{ display:grid; grid-template-columns: 1fr; gap:12px; position:relative; }
.history-panel{
  position:absolute; right:0; top:0; width:320px; height:100%; background:var(--panel-2);
  border-left:1px solid var(--stroke); box-shadow: var(--shadow); border-radius:12px; overflow:auto; padding-bottom:8px;
}
.history-panel header{ position:sticky; top:0; background:var(--panel-2); padding:10px; border-bottom:1px solid var(--stroke); display:flex; justify-content:space-between; align-items:center; }
.session-list{ list-style:none; margin:0; padding:8px; display:flex; flex-direction:column; gap:8px; }
.session-item{ position:relative; display:flex; gap:6px; align-items:stretch; }
.session-item .session-btn{ flex:1; text-align:left; background:var(--bubble); border:1px solid var(--stroke); color:var(--text); padding:10px; border-radius:10px; cursor:pointer; min-height:60px; display:flex; flex-direction:column; justify-content:center; }
.session-item.current .session-btn{ outline:2px solid var(--brand); }
.session-item .muted{ color:var(--muted); font-size:12px; }
.session-item .preview{ color:var(--muted); font-size:12px; margin-top:4px; line-height:1.2; max-height:3em; overflow:hidden; }
.delete-session{ 
  background:transparent; 
  border:1px solid var(--stroke); 
  color:var(--danger); 
  padding:4px; 
  border-radius:4px; 
  cursor:pointer; 
  font-size:12px; 
  opacity:0.7; 
  transition:all 0.2s; 
  width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  align-self:center;
}
.delete-session:hover{ 
  opacity:1; 
  background:rgba(239,68,68,0.1); 
  border-color:var(--danger);
  transform:scale(1.05);
}

.chat-surface{ border:1px solid var(--stroke); border-radius:12px; background:var(--panel-2); }
.chat-messages{ max-height:320px; min-height:180px; overflow:auto; padding:12px; display:flex; flex-direction:column; gap:10px; }
.message{ display:flex; gap:10px; }
.message .avatar{ width:32px; height:32px; border-radius:50%; background:#0d1220; display:flex; align-items:center; justify-content:center; border:1px solid var(--stroke); }
.message .bubble{ background:var(--bubble); border:1px solid var(--stroke); padding:10px 12px; border-radius:12px; max-width:720px; line-height:1.5; }
.message.user .bubble{ background:var(--bubble-user); }
.dots span{ animation: blink 1.2s infinite; display:inline-block; padding:0 2px; }
.dots span:nth-child(2){ animation-delay:.2s } .dots span:nth-child(3){ animation-delay:.4s }
@keyframes blink{ 0%,100%{ opacity:.2 } 50%{ opacity:1 } }

/* Enhanced markdown styling in chat bubbles */
.message .bubble h1, .message .bubble h2, .message .bubble h3 { 
  margin: 12px 0 8px 0; 
  color: var(--text); 
  font-weight: 600; 
  line-height: 1.3;
}
.message .bubble h1 { font-size: 18px; }
.message .bubble h2 { font-size: 16px; }
.message .bubble h3 { font-size: 14px; }
.message .bubble p { 
  margin: 8px 0; 
  line-height: 1.5; 
}
.message .bubble strong { 
  color: var(--brand); 
  font-weight: 600; 
}
.message .bubble em { 
  color: #cbd5e0; 
  font-style: italic; 
}
.message .bubble code { 
  background: rgba(58, 199, 189, 0.1); 
  color: var(--brand); 
  border: 1px solid rgba(58, 199, 189, 0.2); 
  border-radius: 4px; 
  padding: 2px 6px; 
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace; 
  font-size: 13px; 
}
.message .bubble ul, .message .bubble ol { 
  margin: 8px 0; 
  padding-left: 20px; 
}
.message .bubble li { 
  margin: 4px 0; 
  line-height: 1.4; 
}
.message .bubble blockquote { 
  border-left: 3px solid var(--brand); 
  margin: 12px 0; 
  padding: 8px 0 8px 16px; 
  color: var(--muted); 
  background: rgba(58, 199, 189, 0.05); 
  border-radius: 0 6px 6px 0; 
}
.message .bubble a { 
  color: var(--brand); 
  text-decoration: underline; 
  transition: color 0.2s; 
}
.message .bubble a:hover { 
  color: #4fd1c7; 
}
.message .bubble hr { 
  border: none; 
  border-top: 1px solid var(--stroke); 
  margin: 16px 0; 
  opacity: 0.6; 
}

.chat-inputbar{ display:flex; gap:8px; padding:10px; border-top:1px solid var(--stroke); }
.chat-input{ flex:1; background:#0c1220; color:var(--text); border:1px solid var(--stroke); border-radius:10px; padding:10px 12px; }
.send-btn{ background:var(--brand); color:#062619; border:none; border-radius:10px; padding:10px 16px; font-weight:700; cursor:pointer; }

/* Inline results in chat */
.inline-results{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.mini-card{ display:flex; gap:8px; background:#0d1423; border:1px solid var(--stroke); border-radius:10px; padding:8px; width: 320px; }
.mini-card img{ width:84px; height:64px; object-fit:cover; border-radius:8px; }
.mini-title{ font-size:13px; font-weight:600; }
.mini-price{ font-size:13px; color:#e5f5ee; }
.mini-meta{ font-size:12px; color:var(--muted); }
.inline-empty{ color:var(--muted); font-size:13px; }
.viewall-btn{ background:transparent; border:1px dashed var(--stroke); color:var(--text); padding:8px 10px; border-radius:10px; cursor:pointer; }

/* ====== Results bar & grid ====== */
.results-bar{ max-width:1200px; margin:8px auto 0; padding:0 20px; color:var(--muted); font-size:14px; }
.listing-grid{
  max-width:1200px; margin:10px auto 28px; padding:0 20px;
  display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:16px;
}
.listing-card{ background:var(--panel); border:1px solid var(--stroke); border-radius:16px; overflow:hidden; box-shadow:var(--shadow); }
.image-wrap{ position:relative; }
.image-wrap img{ width:100%; height:200px; object-fit:cover; display:block; }
.badge{ position:absolute; top:10px; left:10px; background:#0f1729; color:#fff; border:1px solid rgba(255,255,255,.15); padding:4px 8px; border-radius:999px; font-size:12px; }
.listing-info{ padding:12px; }
.listing-info h3{ margin:0 0 6px 0; font-size:16px; line-height:1.3; }
.price{ font-weight:700; margin:0 0 6px 0; }
.meta{ color:var(--muted); font-size:13px; margin:0 0 10px 0; }
.quick-view-btn{ width:100%; padding:10px; background:#0f1729; border:1px solid var(--stroke); color:#cfe8df; border-radius:10px; cursor:pointer; }

/* ====== Modal ====== */
.modal{ display:none; position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:40; align-items:center; justify-content:center; }
.modal .modal-content{ background:var(--panel); border:1px solid var(--stroke); border-radius:16px; padding:16px; width:min(900px, 92vw); max-height:86vh; overflow:auto; }
.close-btn{ position:absolute; right:18px; top:10px; cursor:pointer; font-size:24px; color:var(--muted); }

/* ====== Small screens ====== */
@media (max-width: 900px){
  .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  #searchInput{ grid-column: span 2; }
}

/* ===== Global palette (kept) ===== */
:root{
  --bg:#0b0e13; --panel:#121723; --panel-2:#0f1420; --text:#e6e9ef; --muted:#9aa3b2;
  --brand:#10b981; --brand-2:#0bb07a; --stroke:#1e283a; --bubble:#141a27; --bubble-user:#182233;
  --shadow:0 8px 30px rgba(0,0,0,.35);
}
body { background:var(--bg); color:var(--text); font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,Arial; }
.site-header { max-width:1200px; margin:24px auto 8px; padding:0 20px; }
.logo h1{ margin:0; font-weight:600; letter-spacing:.2px;}
.tagline{ margin-top:4px; color:var(--muted); font-size:13px; }

/* ===== BIG PILL TOGGLE ===== */
.seg-toggle{
  max-width:680px; margin:8px auto 18px; padding:6px; position:relative;
  background:var(--panel); border:2px solid var(--brand); border-radius:999px;
  display:grid; grid-template-columns:1fr 1fr; gap:0; box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);
}
.seg-indicator{
  position:absolute; top:4px; left:4px; width:calc(50% - 4px); height:calc(100% - 8px);
  background:var(--brand); border-radius:999px; transition:transform .25s ease;
}
.seg-indicator.right{ transform:translateX(100%); }
.seg-option{
  z-index:1; background:transparent; border:none; color:#0a1a15; font-weight:800; letter-spacing:.2px;
  padding:12px 10px; border-radius:999px; cursor:pointer; font-size:16px;
}
.seg-option:not(.active){ color:#bfeee2; }
.seg-option:focus-visible{ outline:2px dashed rgba(255,255,255,.35); outline-offset:3px; }

/* ===== Filters panel (hidden in AI mode) ===== */
.filters{
  max-width:1200px; margin:0 auto; padding:16px; background:var(--panel);
  border:1px solid var(--stroke); border-radius:14px; display:grid;
  grid-template-columns: repeat(8, minmax(0,1fr)); gap:10px;
}
.filters input, .filters select{
  background:var(--panel-2); border:1px solid var(--stroke); border-radius:10px; color:var(--text);
  padding:10px 12px; outline:none;
}
#searchInput{ grid-column: span 3; }
#statusFilter, #cityFilter, #typeFilter, #minPrice, #maxPrice, #bedsFilter, #bathsFilter { grid-column: span 1; }
#applyFilters{ grid-column: span 1; border-radius:10px; background:var(--brand); color:#081218; border:none; font-weight:700; }

/* ===== AI section / chat ===== */
.ai-section{ max-width:1200px; margin:0 auto 12px; padding:16px; background:var(--panel); border:1px solid var(--stroke); border-radius:14px; }
.ai-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.ai-title{ display:flex; align-items:center; gap:10px; }
.ai-dot{ width:10px; height:10px; border-radius:50%; background:#3bf2c3; box-shadow:0 0 0 6px rgba(59,242,195,.15); }
.ai-sub{ color:var(--muted); font-size:13px; margin-left:6px; }
.ghost{ background:transparent; border:1px solid var(--stroke); color:var(--text); padding:8px 10px; border-radius:10px; cursor:pointer; }
.ghost.sm{ padding:6px 8px; }

.chat-wrap{ display:grid; grid-template-columns:1fr; gap:12px; position:relative; }
.history-panel{
  position:absolute; right:0; top:0; width:320px; height:100%; background:var(--panel-2);
  border-left:1px solid var(--stroke); box-shadow: var(--shadow); border-radius:12px; overflow:auto; padding-bottom:8px;
}
.history-panel header{ position:sticky; top:0; background:var(--panel-2); padding:10px; border-bottom:1px solid var(--stroke); display:flex; justify-content:space-between; align-items:center; }

.chat-surface{ border:1px solid var(--stroke); border-radius:12px; background:var(--panel-2); }
.chat-messages{ max-height:320px; min-height:180px; overflow:auto; padding:12px; display:flex; flex-direction:column; gap:10px; }
.message{ display:flex; gap:10px; }
.message .avatar{ width:32px; height:32px; border-radius:50%; background:#0d1220; display:flex; align-items:center; justify-content:center; border:1px solid var(--stroke); }
.message .bubble{ background:#141a27; border:1px solid var(--stroke); padding:10px 12px; border-radius:12px; max-width:720px; }
.message.user .bubble{ background:#182233; }
.dots span{ animation: blink 1.2s infinite; display:inline-block; padding:0 2px; }
.dots span:nth-child(2){ animation-delay:.2s } .dots span:nth-child(3){ animation-delay:.4s }
@keyframes blink{ 0%,100%{ opacity:.2 } 50%{ opacity:1 } }

.chat-inputbar{ display:flex; gap:8px; padding:10px; border-top:1px solid var(--stroke); }
.chat-input{ flex:1; background:#0c1220; color:var(--text); border:1px solid var(--stroke); border-radius:10px; padding:10px 12px; }
.send-btn{ background:var(--brand); color:#062619; border:none; border-radius:10px; padding:10px 16px; font-weight:700; cursor:pointer; }

/* Inline results preview */
.inline-results{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.mini-card{ display:flex; gap:8px; background:#0d1423; border:1px solid var(--stroke); border-radius:10px; padding:8px; width: 320px; }
.mini-card img{ width:84px; height:64px; object-fit:cover; border-radius:8px; }
.mini-title{ font-size:13px; font-weight:600; }
.mini-price{ font-size:13px; color:#e5f5ee; }
.mini-meta{ font-size:12px; color:var(--muted); }
.inline-empty{ color:var(--muted); font-size:13px; }
.viewall-btn{ background:transparent; border:1px dashed var(--stroke); color:var(--text); padding:8px 10px; border-radius:10px; cursor:pointer; }

/* ===== Results & grid ===== */
.results-bar{ max-width:1200px; margin:8px auto 0; padding:0 20px; color:var(--muted); font-size:14px; }
.listing-grid{
  max-width:1200px; margin:10px auto 28px; padding:0 20px;
  display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:16px;
}
.listing-card{ background:var(--panel); border:1px solid var(--stroke); border-radius:16px; overflow:hidden; box-shadow:var(--shadow); }
.image-wrap{ position:relative; }
.image-wrap img{ width:100%; height:200px; object-fit:cover; display:block; }
.badge{ position:absolute; top:10px; left:10px; background:#0f1729; color:#fff; border:1px solid rgba(255,255,255,.15); padding:4px 8px; border-radius:999px; font-size:12px; }
.listing-info{ padding:12px; }
.listing-info h3{ margin:0 0 6px 0; font-size:16px; line-height:1.3; }
.price{ font-weight:700; margin:0 0 6px 0; }
.meta{ color:var(--muted); font-size:13px; margin:0 0 10px 0; }
.quick-view-btn{ width:100%; padding:10px; background:#0f1729; border:1px solid var(--stroke); color:#cfe8df; border-radius:10px; cursor:pointer; }

/* Modal */
.modal{ display:none; position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:40; align-items:center; justify-content:center; }
.modal .modal-content{ background:var(--panel); border:1px solid var(--stroke); border-radius:16px; padding:16px; width:min(900px, 92vw); max-height:86vh; overflow:auto; }
.close-btn{ position:absolute; right:18px; top:10px; cursor:pointer; font-size:24px; color:var(--muted); }

/* Responsive */
@media (max-width: 900px){
  .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  #searchInput{ grid-column: span 2; }
}

/* Ensure hidden sections collapse visually & interactively */
[hidden] { display: none !important; }



