/* =========================================================================
   Trove — neighborhood resale. Visual identity:
   violet-indigo ink, marigold accent, Bricolage Grotesque + Plus Jakarta Sans.
   ========================================================================= */

:root{
  --bg:#ececf6;
  --surface:#ffffff;
  --surface-2:#f4f4fc;
  --ink:#1b1733;
  --ink-soft:#3a3556;
  --muted:#76728f;
  --brand:#5b3df5;
  --brand-700:#4a2fe0;
  --brand-soft:#ece8ff;
  --brand-ring:rgba(91,61,245,.18);
  --accent:#ff9f1c;
  --love:#f0436b;
  --online:#23bd72;
  --gold:#f4b740;
  --line:#e4e3f2;
  --line-soft:#eeedf8;
  --danger:#e0395e;
  --radius:18px;
  --radius-sm:12px;
  --pill:999px;
  --shadow:0 10px 34px rgba(27,23,51,.09);
  --shadow-sm:0 4px 14px rgba(27,23,51,.07);
  --display:"Bricolage Grotesque","Plus Jakarta Sans",system-ui,sans-serif;
  --body:"Plus Jakarta Sans",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  --topbar-h:66px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--body);
  background:
    radial-gradient(1200px 480px at 88% -8%, #e7e3ff 0%, rgba(231,227,255,0) 60%),
    radial-gradient(900px 420px at -6% 4%, #e3f3ee 0%, rgba(227,243,238,0) 55%),
    var(--bg);
  background-attachment:fixed;
  color:var(--ink);
  font-size:15px;line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
h1,h2,h3{font-family:var(--display);letter-spacing:-.02em;line-height:1.12;margin:0}
button{font-family:inherit}
.muted{color:var(--muted)}
.tiny{font-size:12px}
.pad{padding:16px}
.center-narrow,.narrow{max-width:620px;margin:0 auto}
.divider{height:1px;background:var(--line);margin:12px 0}

/* ---------- Top bar ---------------------------------------------------- */
.topbar{
  position:sticky;top:0;z-index:60;
  background:rgba(255,255,255,.82);
  backdrop-filter:saturate(1.4) blur(14px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  max-width:1320px;margin:0 auto;height:var(--topbar-h);
  display:flex;align-items:center;gap:18px;padding:0 20px;
}
.brand{display:flex;align-items:center;gap:10px;flex-shrink:0}
.brand-mark{
  width:38px;height:38px;border-radius:12px;flex-shrink:0;
  display:grid;place-items:center;color:#fff;
  background:linear-gradient(145deg,var(--brand),#7a52ff);
  box-shadow:0 6px 16px var(--brand-ring);
}
.brand-mark svg{width:22px;height:22px}
.brand-text{
  font-family:var(--display);font-weight:800;font-size:23px;
  letter-spacing:-.03em;color:var(--ink);
}
.brand-text b{color:var(--brand)}

.search{
  flex:1;max-width:520px;display:flex;align-items:center;gap:9px;
  background:var(--surface-2);border:1.5px solid transparent;
  border-radius:var(--pill);padding:0 16px;height:42px;
  transition:border-color .15s, background .15s;
}
.search:focus-within{border-color:var(--brand);background:#fff;box-shadow:0 0 0 4px var(--brand-ring)}
.search-ico{width:18px;height:18px;color:var(--muted);flex-shrink:0}
.search input{
  border:0;background:transparent;outline:0;width:100%;
  font-size:14.5px;color:var(--ink);
}
.topnav{display:flex;align-items:center;gap:6px;margin-left:auto}
.nav-link{
  position:relative;display:grid;place-items:center;
  width:44px;height:44px;border-radius:14px;color:var(--ink-soft);
  transition:background .15s,color .15s;
}
.nav-link:hover{background:var(--brand-soft);color:var(--brand)}
.nav-link svg{width:23px;height:23px}
.icon-btn{background:none;border:0;cursor:pointer;color:inherit;display:grid;place-items:center;width:100%;height:100%}
.badge{
  position:absolute;top:5px;right:6px;min-width:18px;height:18px;padding:0 5px;
  background:var(--love);color:#fff;border-radius:var(--pill);
  font-size:11px;font-weight:700;display:grid;place-items:center;
  border:2px solid #fff;
}
.btn-sell{width:auto !important;height:42px;padding:0 18px;gap:7px;border-radius:var(--pill)}
.btn-sell svg{width:18px;height:18px}
.avatar-btn{background:none;border:0;cursor:pointer;padding:0;border-radius:50%}
.avatar-wrap{width:auto;height:auto}

/* ---------- Avatars ---------------------------------------------------- */
.avatar{border-radius:50%;object-fit:cover;background:var(--surface-2);flex-shrink:0}
.avatar-sm{width:34px;height:34px}
.avatar-md{width:46px;height:46px}
.avatar-lg{width:128px;height:128px;border:4px solid #fff;box-shadow:var(--shadow-sm)}

/* ---------- Buttons ---------------------------------------------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  font-family:var(--body);font-weight:700;font-size:14.5px;
  padding:10px 18px;border-radius:var(--pill);border:1.5px solid transparent;
  cursor:pointer;transition:transform .08s,background .15s,border-color .15s,box-shadow .15s;
  white-space:nowrap;line-height:1;
}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--brand);color:#fff;box-shadow:0 6px 16px var(--brand-ring)}
.btn-primary:hover{background:var(--brand-700)}
.btn-ghost{background:var(--brand-soft);color:var(--brand)}
.btn-ghost:hover{background:#e0d9ff}
.btn-outline{background:#fff;border-color:var(--line);color:var(--ink)}
.btn-outline:hover{border-color:var(--brand);color:var(--brand)}
.btn-danger{background:#fdeaef;color:var(--danger)}
.btn-danger:hover{background:#fbd9e1}
.btn-block{width:100%}
.btn-lg{padding:13px 22px;font-size:15.5px}
.btn.is-active,.btn.is-on{color:var(--love)}
.link-btn{background:none;border:0;color:var(--brand);font-weight:600;cursor:pointer;font-size:13px;padding:0}

/* ---------- Cards & layout -------------------------------------------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm)}
.card-pad,.card-title{padding:0}
.card-pad{padding:18px}
.card-title{font-size:16px;font-weight:700;margin-bottom:10px}
.container{max-width:1100px;margin:26px auto;padding:0 20px}
.container.narrow{max-width:680px}
.page{min-height:calc(100vh - var(--topbar-h) - 120px)}

.layout{
  max-width:1320px;margin:0 auto;padding:24px 20px 60px;
  display:grid;grid-template-columns:248px minmax(0,1fr) 280px;gap:26px;
  align-items:start;
}

/* ---------- Left sidebar ---------------------------------------------- */
.sidebar{position:sticky;top:calc(var(--topbar-h) + 18px);display:flex;flex-direction:column;gap:3px}
.side-link{
  display:flex;align-items:center;gap:12px;padding:10px 13px;border-radius:13px;
  font-weight:600;color:var(--ink-soft);transition:background .14s,color .14s;
}
.side-link:hover{background:#fff}
.side-link.active{background:var(--brand-soft);color:var(--brand)}
.side-ico{width:26px;text-align:center;font-size:17px;filter:saturate(1.05)}
.side-head{
  font-family:var(--display);font-size:12px;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted);margin:18px 0 6px;padding-left:13px;
}

/* ---------- Toolbar ---------------------------------------------------- */
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}
.toolbar h1{font-size:26px;font-weight:800}
.select{
  appearance:none;font-family:var(--body);font-weight:600;font-size:14px;color:var(--ink);
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2376728f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  border:1.5px solid var(--line);border-radius:var(--pill);padding:9px 38px 9px 16px;cursor:pointer;
}
.select:focus{outline:0;border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-ring)}

/* ---------- Listing grid + cards -------------------------------------- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:18px}
.listing-card{
  position:relative;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm);
  transition:transform .14s,box-shadow .14s,border-color .14s;
}
.listing-card:hover{transform:translateY(-4px);box-shadow:var(--shadow);border-color:#d9d4ff}
.listing-thumb{display:block;aspect-ratio:1/1;background:var(--surface-2);position:relative;overflow:hidden}
.listing-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .3s}
.listing-card:hover .listing-thumb img{transform:scale(1.04)}
.listing-thumb .no-img{position:absolute;inset:0;display:grid;place-items:center;color:#c9c5e6}
.status-chip{
  position:absolute;left:10px;top:10px;background:var(--ink);color:#fff;
  font-size:11px;font-weight:700;padding:4px 9px;border-radius:var(--pill);letter-spacing:.02em;
}
.status-chip.sold{background:var(--ink)}
.fav-btn{
  position:absolute;right:10px;top:10px;width:38px;height:38px;border-radius:50%;
  background:rgba(255,255,255,.92);border:0;cursor:pointer;display:grid;place-items:center;
  color:var(--ink-soft);box-shadow:var(--shadow-sm);transition:transform .12s,color .12s,background .12s;
}
.fav-btn:hover{transform:scale(1.08)}
.fav-btn svg{width:20px;height:20px}
.fav-btn.is-on{color:var(--love)}
.fav-btn.is-on svg path{fill:var(--love)}
.listing-body{padding:13px 14px 15px}
.listing-price{font-family:var(--display);font-weight:800;font-size:18px;color:var(--ink);letter-spacing:-.02em}
.listing-title{display:block;margin:3px 0 7px;font-weight:500;color:var(--ink-soft);font-size:14px;line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.listing-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px;color:var(--muted)}
.listing-meta .dot{width:3px;height:3px;border-radius:50%;background:var(--muted);opacity:.6}

.load-more-wrap{display:flex;justify-content:center;margin:26px 0 4px}

/* ---------- Online-now rail (signature) -------------------------------- */
.right-rail{position:sticky;top:calc(var(--topbar-h) + 18px);display:flex;flex-direction:column;gap:18px}
.online-rail{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}
.online-head{
  display:flex;align-items:center;gap:8px;padding:15px 16px 10px;
  font-family:var(--display);font-weight:700;font-size:14px;
}
.online-head .live-dot{width:9px;height:9px;border-radius:50%;background:var(--online);box-shadow:0 0 0 4px rgba(35,189,114,.18);animation:pulse 2s infinite}
@keyframes pulse{0%,100%{box-shadow:0 0 0 3px rgba(35,189,114,.22)}50%{box-shadow:0 0 0 7px rgba(35,189,114,0)}}
.online-head .count{margin-left:auto;color:var(--muted);font-family:var(--body);font-weight:600;font-size:12px}
.online-list{display:flex;flex-direction:column;padding:4px 6px 10px;max-height:60vh;overflow:auto}
.online-row{
  display:flex;align-items:center;gap:11px;padding:8px 10px;border-radius:13px;cursor:pointer;
  background:none;border:0;width:100%;text-align:left;color:var(--ink);transition:background .12s;
}
.online-row:hover{background:var(--surface-2)}
.av-wrap{position:relative;flex-shrink:0}
.presence{position:absolute;right:-1px;bottom:-1px;width:12px;height:12px;border-radius:50%;border:2.5px solid #fff;background:var(--muted)}
.presence.on{background:var(--online)}
.online-row .nm{font-weight:600;font-size:13.5px;line-height:1.2}
.online-row .sub{font-size:11.5px;color:var(--muted)}
.online-empty{padding:6px 16px 16px;color:var(--muted);font-size:13px}
.rail-promo{padding:16px;background:linear-gradient(150deg,#f3efff,#eafaf3);border:1px solid var(--line);border-radius:var(--radius)}
.rail-promo h3{font-size:15px;margin-bottom:5px}
.rail-promo p{margin:0 0 12px;font-size:13px;color:var(--ink-soft)}

/* ---------- Chat dock (signature) ------------------------------------- */
.chat-dock{
  position:fixed;right:18px;bottom:0;z-index:80;
  display:flex;align-items:flex-end;gap:14px;pointer-events:none;
}
.chat-dock>*{pointer-events:auto}
.dock-corner{position:relative}
.dock-launcher{
  display:flex;align-items:center;gap:9px;margin-bottom:18px;
  background:var(--brand);color:#fff;border:0;cursor:pointer;
  padding:12px 18px;border-radius:var(--pill);font-weight:700;font-size:14px;
  box-shadow:0 12px 30px var(--brand-ring);transition:background .15s,transform .1s;
}
.dock-launcher:hover{background:var(--brand-700)}
.dock-launcher:active{transform:translateY(1px)}
.dock-launcher svg{width:19px;height:19px}
.dock-launcher .online-pill{background:rgba(255,255,255,.22);border-radius:var(--pill);padding:1px 8px;font-size:12px}

.contacts-pop{
  position:absolute;right:0;bottom:74px;width:300px;max-height:62vh;overflow:hidden;
  background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);
  display:flex;flex-direction:column;
}
.contacts-pop .online-head{padding:16px 16px 8px}
.contacts-pop .online-list{max-height:48vh}

.chat-window{
  width:320px;height:430px;background:#fff;border:1px solid var(--line);
  border-radius:18px 18px 0 0;box-shadow:var(--shadow);display:flex;flex-direction:column;
  overflow:hidden;animation:popUp .18s ease;
}
@keyframes popUp{from{transform:translateY(14px);opacity:0}to{transform:none;opacity:1}}
.chat-window.min{height:54px}
.cw-head{
  display:flex;align-items:center;gap:10px;padding:10px 12px;cursor:pointer;
  background:linear-gradient(135deg,var(--brand),#7a52ff);color:#fff;
}
.cw-head .nm{font-weight:700;font-size:14px;line-height:1.1}
.cw-head .st{font-size:11px;opacity:.85}
.cw-actions{margin-left:auto;display:flex;gap:2px}
.cw-actions button{background:rgba(255,255,255,.16);border:0;color:#fff;cursor:pointer;width:28px;height:28px;border-radius:9px;display:grid;place-items:center;font-size:16px;line-height:1}
.cw-actions button:hover{background:rgba(255,255,255,.3)}
.cw-body{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:7px;background:var(--surface-2)}
.chat-window.min .cw-body,.chat-window.min .cw-foot{display:none}
.cw-foot{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line);background:#fff}
.cw-foot input{flex:1;border:1.5px solid var(--line);border-radius:var(--pill);padding:9px 14px;font-family:var(--body);font-size:14px;outline:0}
.cw-foot input:focus{border-color:var(--brand)}
.cw-foot button{background:var(--brand);border:0;color:#fff;width:38px;height:38px;border-radius:50%;cursor:pointer;display:grid;place-items:center;flex-shrink:0}
.cw-foot button svg{width:18px;height:18px}

/* shared chat bubbles (dock + thread page) */
.bubble-row{display:flex}
.bubble-row.mine{justify-content:flex-end}
.bubble{
  max-width:78%;padding:8px 12px;border-radius:16px;font-size:14px;line-height:1.4;
  background:#fff;border:1px solid var(--line);color:var(--ink);position:relative;
}
.bubble-row.mine .bubble{background:var(--brand);color:#fff;border-color:transparent}
.bubble-time{display:block;font-size:10px;opacity:.6;margin-top:3px}

/* ---------- Flash ------------------------------------------------------ */
.flash{max-width:1100px;margin:14px auto 0;padding:12px 18px;border-radius:14px;font-weight:600;font-size:14px}
.flash-success{background:#e6f8ef;color:#0f7a47;border:1px solid #bdecd3}
.flash-error{background:#fdeaef;color:var(--danger);border:1px solid #f7c7d4}
.flash-info{background:var(--brand-soft);color:var(--brand);border:1px solid #d8d0ff}

/* ---------- Empty states ---------------------------------------------- */
.empty,.empty-state{
  text-align:center;padding:48px 24px;color:var(--muted);
  display:flex;flex-direction:column;align-items:center;gap:14px;
}
.empty svg{width:46px;height:46px;color:#cdc8ec}
.empty p,.empty-state p{margin:0;font-size:15px}

/* ---------- Auth pages ------------------------------------------------- */
.auth-wrap{max-width:430px;margin:7vh auto;padding:0 20px}
.auth-head{text-align:center;margin-bottom:22px}
.auth-head .brand-mark{width:54px;height:54px;border-radius:16px;margin:0 auto 14px}
.auth-head .brand-mark svg{width:30px;height:30px}
.auth-head h1{font-size:27px;font-weight:800}
.auth-head p{color:var(--muted);margin:6px 0 0}
.auth-alt{text-align:center;margin-top:18px;color:var(--muted);font-size:14px}
.auth-alt a{color:var(--brand);font-weight:700}

/* ---------- Forms ------------------------------------------------------ */
.field{margin-bottom:15px}
.field>label{display:block;font-weight:600;font-size:13.5px;margin-bottom:6px;color:var(--ink-soft)}
.field input[type=text],.field input[type=email],.field input[type=password],
.field input[type=search],.field input:not([type]),.field textarea,
input[type=text],input[type=email],input[type=password],textarea{
  width:100%;font-family:var(--body);font-size:15px;color:var(--ink);
  background:#fff;border:1.5px solid var(--line);border-radius:var(--radius-sm);
  padding:11px 14px;outline:0;transition:border-color .15s,box-shadow .15s;
}
.field textarea,textarea{resize:vertical;min-height:96px}
.field input:focus,.field textarea:focus,input:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-ring)}
.field-row,.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-card{padding:22px;margin-bottom:20px}
.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:8px}
.hint{font-size:12.5px;color:var(--muted);margin-top:5px}
.checkbox{display:flex;align-items:center;gap:9px;font-size:14px;color:var(--ink-soft);cursor:pointer}
.checkbox input{width:17px;height:17px;accent-color:var(--brand)}
.page-title{font-size:25px;font-weight:800;margin-bottom:18px}
.upload-inline{display:flex;align-items:center;gap:14px}
.cover-preview{width:100%;height:120px;object-fit:cover;border-radius:var(--radius-sm);margin-bottom:8px;border:1px solid var(--line)}

/* dropzone */
.dropzone{
  border:2px dashed #cfc9ef;border-radius:var(--radius);padding:26px;text-align:center;
  color:var(--muted);cursor:pointer;transition:border-color .15s,background .15s;background:var(--surface-2);
}
.dropzone:hover,.dropzone.dragging{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}
.previews,.preview{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.preview-cell{position:relative;width:88px;height:88px;border-radius:12px;overflow:hidden;border:1px solid var(--line)}
.preview-cell img{width:100%;height:100%;object-fit:cover}
.preview-remove{position:absolute;top:3px;right:3px;width:22px;height:22px;border-radius:50%;border:0;background:rgba(27,23,51,.7);color:#fff;cursor:pointer;font-size:15px;line-height:1;display:grid;place-items:center}

/* ---------- Dropdowns -------------------------------------------------- */
.dropdown{
  position:absolute;right:0;top:calc(100% + 10px);width:288px;background:#fff;
  border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:8px;z-index:70;
}
.notif-dropdown{width:340px;max-height:440px;overflow:auto;padding:0}
.dropdown-item{display:flex;align-items:center;gap:11px;padding:10px 11px;border-radius:12px;color:var(--ink)}
.dropdown-item:hover{background:var(--surface-2)}
.dropdown-item.simple{display:block;font-weight:600;color:var(--ink-soft)}
.dropdown-item strong{display:block;font-size:14px}
.dropdown-item .muted{font-size:12px}
.dropdown-sep{height:1px;background:var(--line);margin:6px 4px}
.logout-form{padding:0}
.logout-form button{background:none;border:0;width:100%;text-align:left;padding:10px 11px;border-radius:12px;cursor:pointer;font-weight:600;color:var(--danger);font-size:14px}
.logout-form button:hover{background:#fdeaef}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:13px 15px;border-bottom:1px solid var(--line);position:sticky;top:0;background:#fff}
.notif-head b{font-family:var(--display);font-size:15px}
.notif-item{display:flex;gap:11px;padding:11px 14px;border-bottom:1px solid var(--line-soft);color:var(--ink)}
.notif-item:hover{background:var(--surface-2)}
.notif-item.is-unread{background:var(--brand-soft)}
.notif-text{font-size:13.5px;line-height:1.4}
.notif-text .tiny{display:block;color:var(--muted);margin-top:2px}
.notif-empty,.notif-loading{padding:26px 16px;text-align:center;color:var(--muted);font-size:14px}

/* ---------- Profile ---------------------------------------------------- */
.profile-bar{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm);margin-bottom:22px}
.profile-bio{padding:2px 26px 6px;color:var(--ink-soft);line-height:1.55;margin:0}
.cover{height:220px;background:linear-gradient(135deg,#6f54ff,#a98bff 60%,#ffd29a);position:relative}
.cover img{width:100%;height:100%;object-fit:cover}
.profile-head{display:flex;align-items:flex-end;gap:20px;padding:0 26px 22px;margin-top:-58px}
.profile-id{flex:1;padding-bottom:4px}
.profile-id h1{font-size:27px;font-weight:800;display:flex;align-items:center;gap:8px}
.profile-id .handle{color:var(--muted);font-weight:600;margin-top:2px}
.verified{color:var(--brand)}
.profile-actions{display:flex;gap:10px;padding-bottom:6px}
.stat-row{display:flex;gap:26px;padding:16px 26px;border-top:1px solid var(--line);flex-wrap:wrap}
.stat-row>div{display:flex;flex-direction:column;font-size:13px;color:var(--muted)}
.stat-row b{font-family:var(--display);font-size:19px;color:var(--ink);font-weight:800}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:22px}
.tab{padding:13px 16px;font-weight:700;color:var(--muted);border-bottom:2.5px solid transparent;margin-bottom:-1px}
.tab:hover{color:var(--ink)}
.tab.active{color:var(--brand);border-color:var(--brand)}
.stars,.stars-sm{color:var(--gold);letter-spacing:1px}
.stars-sm{font-size:13px}

/* ---------- Listing detail -------------------------------------------- */
.detail{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.9fr);gap:30px;align-items:start}
.gallery-main{width:100%;aspect-ratio:4/3;background:var(--surface-2);border-radius:var(--radius);overflow:hidden;border:1px solid var(--line)}
.gallery-main img{width:100%;height:100%;object-fit:cover}
.gallery-thumbs{display:flex;gap:9px;margin-top:11px;flex-wrap:wrap}
.gallery-thumbs img{width:70px;height:70px;object-fit:cover;border-radius:11px;cursor:pointer;border:2px solid transparent;opacity:.7;transition:.12s}
.gallery-thumbs img:hover{opacity:1}
.gallery-thumbs img.active{border-color:var(--brand);opacity:1}
.detail-price{font-family:var(--display);font-size:30px;font-weight:800;color:var(--ink);letter-spacing:-.02em}
.detail-title{font-size:21px;font-weight:700;margin:4px 0 12px}
.pill-row{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.chip{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--pill);padding:6px 13px;font-size:13px;font-weight:600;color:var(--ink-soft)}
.desc{color:var(--ink-soft);line-height:1.6;white-space:pre-wrap;margin-top:8px}
.seller-card{display:flex;align-items:center;gap:13px;padding:15px;background:var(--surface-2);border-radius:var(--radius);margin:16px 0}
.seller-card .nm{font-weight:700}
.section-title{font-family:var(--display);font-size:19px;font-weight:800;margin:30px 0 14px}
.rating-input{display:flex;gap:4px;font-size:26px;cursor:pointer;margin-bottom:8px}
.rating-input [data-star]{color:#d9d4ee;transition:color .1s}
.rating-input [data-star].on{color:var(--gold)}
.review-item,.review{display:flex;gap:12px;padding:14px 0;border-bottom:1px solid var(--line-soft)}
.review-head{display:flex;align-items:center;gap:9px;margin-bottom:4px;flex-wrap:wrap}
.review-head a{font-weight:700}
.review-body p{margin:4px 0 0;color:var(--ink-soft);line-height:1.5}

/* ---------- Messages page --------------------------------------------- */
.messenger{
  max-width:1160px;margin:24px auto;padding:0 20px;
  display:grid;grid-template-columns:330px 1fr;gap:0;height:calc(100vh - var(--topbar-h) - 70px);
}
.convo-list{background:#fff;border:1px solid var(--line);border-right:0;border-radius:var(--radius) 0 0 var(--radius);overflow-y:auto}
.convo-list-title{font-family:var(--display);font-size:21px;font-weight:800;padding:18px 18px 10px}
.convo-row{display:flex;gap:12px;padding:12px 16px;border-top:1px solid var(--line-soft);color:var(--ink)}
.convo-row:hover{background:var(--surface-2)}
.convo-row.active{background:var(--brand-soft)}
.convo-meta{min-width:0;flex:1}
.convo-top{display:flex;align-items:center;gap:8px}
.convo-top b{font-size:14.5px}
.convo-top .badge{position:static;border:0;margin-left:auto}
.convo-sub{margin-top:1px}
.convo-snippet{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.thread-pane{background:var(--surface-2);border:1px solid var(--line);border-radius:0 var(--radius) var(--radius) 0;display:flex;flex-direction:column;min-width:0}
.thread-empty{margin:auto;color:var(--muted)}
.thread-head{display:flex;align-items:center;gap:12px;padding:14px 18px;background:#fff;border-bottom:1px solid var(--line);border-radius:0 var(--radius) 0 0}
.thread-back{display:none;background:none;border:0;font-size:26px;cursor:pointer;color:var(--brand);width:auto}
.thread-peer{display:flex;align-items:center;gap:10px;font-weight:700}
.thread-listing{margin-left:auto;background:var(--surface-2);padding:6px 12px;border-radius:var(--pill)}
.thread-body{flex:1;overflow:hidden;display:flex;flex-direction:column}
.message-stream{flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:8px}
.message-composer{display:flex;gap:10px;padding:14px;background:#fff;border-top:1px solid var(--line)}
.message-composer textarea{flex:1;min-height:0;height:46px;border-radius:22px;padding:12px 16px;resize:none}

/* ---------- Footer ----------------------------------------------------- */
.site-footer{border-top:1px solid var(--line);background:rgba(255,255,255,.6);margin-top:40px}
.footer-inner{max-width:1320px;margin:0 auto;padding:20px;display:flex;justify-content:space-between;align-items:center;gap:14px;color:var(--muted);font-size:13.5px;flex-wrap:wrap}
.footer-links{display:flex;gap:18px}
.footer-links a:hover{color:var(--brand)}

/* ---------- Responsive ------------------------------------------------- */
@media(max-width:1080px){
  .layout{grid-template-columns:220px minmax(0,1fr)}
  .right-rail{display:none}
}
@media(max-width:860px){
  .layout{grid-template-columns:1fr}
  .sidebar{display:none}
  .detail{grid-template-columns:1fr}
  .brand-text{display:none}
}
@media(max-width:760px){
  .search{max-width:none}
  .messenger{grid-template-columns:1fr;height:calc(100vh - var(--topbar-h) - 20px);padding:0}
  .convo-list{border-radius:0;border-right:1px solid var(--line)}
  .thread-pane{display:none;border-radius:0}
  body.thread-open .convo-list{display:none}
  body.thread-open .thread-pane{display:flex}
  .thread-back{display:block}
  .field-row,.form-row{grid-template-columns:1fr}
  .chat-dock{right:10px}
  .chat-window{width:calc(100vw - 20px);max-width:330px}
}
@media(prefers-reduced-motion:reduce){*{animation:none !important;transition:none !important}}

/* =========================================================================
   Marketplace browse layout — dense storefront (Trove identity)
   ========================================================================= */
.mkt{
  max-width:1760px;margin:0 auto;padding:18px 20px 64px;
  display:grid;grid-template-columns:284px minmax(0,1fr) 296px;gap:24px;align-items:start;
}

/* left storefront rail */
.mkt-side{position:sticky;top:calc(var(--topbar-h) + 14px);display:flex;flex-direction:column;gap:3px}
.mkt-side-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.mkt-side-head h2{font-family:var(--display);font-size:25px;font-weight:800;letter-spacing:-.03em}
.icon-pill{width:36px;height:36px;border-radius:50%;background:var(--surface-2);display:grid;place-items:center;color:var(--ink-soft)}
.icon-pill:hover{background:var(--brand-soft);color:var(--brand)}
.icon-pill svg{width:19px;height:19px}
.side-search{display:flex;align-items:center;gap:9px;background:var(--surface-2);border:1.5px solid transparent;border-radius:var(--pill);padding:0 15px;height:42px;margin-bottom:12px}
.side-search:focus-within{border-color:var(--brand);background:#fff;box-shadow:0 0 0 4px var(--brand-ring)}
.side-search svg{width:17px;height:17px;color:var(--muted);flex-shrink:0}
.side-search input{border:0;background:transparent;outline:0;width:100%;font-size:14px;font-family:var(--body)}

.side-link{
  display:flex;align-items:center;gap:13px;padding:10px 12px;border-radius:13px;
  font-weight:600;color:var(--ink-soft);transition:background .14s,color .14s;position:relative;
}
.side-link:hover{background:#fff}
.side-link.active{background:var(--brand-soft);color:var(--brand)}
.side-ico-box{
  width:36px;height:36px;border-radius:11px;flex-shrink:0;display:grid;place-items:center;
  background:var(--surface-2);color:var(--brand);
}
.side-link.active .side-ico-box{background:#fff}
.side-ico-box svg{width:20px;height:20px}
.side-badge{margin-left:auto;min-width:20px;height:20px;padding:0 6px;background:var(--love);color:#fff;border-radius:var(--pill);font-size:11px;font-weight:700;display:grid;place-items:center}

.side-cta{margin:14px 0 4px}
.side-section{font-family:var(--display);font-size:12px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);margin:20px 0 7px;padding-left:12px}
.side-loc{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:12px;color:var(--ink);font-weight:600}
.side-loc:hover{background:#fff}
.side-loc small{color:var(--muted);font-weight:500}

.cat-link{display:flex;align-items:center;gap:13px;padding:8px 12px;border-radius:13px;color:var(--ink-soft);font-weight:600;transition:background .12s,color .12s}
.cat-link:hover{background:#fff;color:var(--ink)}
.cat-link.active{background:var(--brand-soft);color:var(--brand)}
.cat-ico{width:34px;height:34px;border-radius:10px;flex-shrink:0;display:grid;place-items:center;background:var(--surface-2);font-size:18px;line-height:1}

/* main column */
.mkt-main{min-width:0}

/* "New for you" promo strip */
.promo-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);padding:18px 20px;margin-bottom:22px}
.promo-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.promo-head h3{font-family:var(--display);font-size:18px;font-weight:800}
.promo-head a{color:var(--brand);font-weight:700;font-size:14px}
.promo-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}
.promo-tile{display:flex;align-items:center;gap:14px;color:var(--ink)}
.promo-thumb{width:60px;height:60px;border-radius:14px;object-fit:cover;background:var(--surface-2);flex-shrink:0;display:grid;place-items:center;color:#c9c5e6;overflow:hidden}
.promo-thumb svg{width:26px;height:26px}
.promo-tile b{display:block;font-size:14.5px;font-weight:700;line-height:1.3}
.promo-tile small{color:var(--muted);font-size:12.5px;display:flex;align-items:center;gap:5px;margin-top:3px}
.promo-tile .dotmark{width:6px;height:6px;border-radius:50%;background:var(--brand)}

/* picks header */
.picks-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:16px;flex-wrap:wrap}
.picks-head h1{font-size:27px;font-weight:800}
.picks-right{display:flex;align-items:center;gap:12px}
.loc-chip{display:inline-flex;align-items:center;gap:6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--pill);padding:7px 14px;font-size:13px;font-weight:600;color:var(--ink-soft)}
.loc-chip b{color:var(--brand)}

/* denser product grid for the storefront */
.grid-dense{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px}
.grid-dense .listing-price{font-size:17px}
.grid-dense .listing-body{padding:11px 12px 13px}

@media(max-width:1280px){
  .mkt{grid-template-columns:260px minmax(0,1fr);gap:22px}
  .mkt-rail{display:none}
}
@media(max-width:840px){
  .mkt{grid-template-columns:1fr;padding:14px 14px 60px}
  .mkt-side{position:static;flex-direction:column}
  .side-cats-wrap{display:flex;flex-wrap:wrap;gap:8px}
}

.mkt-rail{position:sticky;top:calc(var(--topbar-h) + 14px);display:flex;flex-direction:column;gap:18px}
