/* ============ DealVault design system ============ */
:root {
  --bg: #0e1116;
  --bg-soft: #151a22;
  --panel: #1a212c;
  --panel-2: #202938;
  --line: #2a3444;
  --text: #e8e6e1;
  --text-dim: #9aa3b2;
  --text-faint: #6b7484;
  --gold: #c9a962;
  --gold-bright: #e3c57e;
  --gold-dim: rgba(201,169,98,.14);
  --green: #5dbb8a;
  --red: #e07a6b;
  --blue: #6fa8dc;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --display: 'Funnel Display', 'Segoe UI', system-ui, sans-serif;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Google Sans Flex', 'Google Sans', 'Product Sans', 'Segoe UI', system-ui, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 14px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; width: 100%;
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block; font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px;
}
label.field > span em { text-transform: none; letter-spacing: 0; color: var(--text-faint); font-style: normal; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-dim); cursor: pointer; margin: 8px 0; }
label.check input { width: auto; accent-color: var(--gold); }

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 28px;
  background: rgba(14,17,22,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand, .brand-foot {
  font-family: var(--display); font-size: 24px; letter-spacing: .02em; color: var(--text);
}
.brand span, .brand-foot span { color: var(--gold); }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
  padding: 8px 14px; border-radius: 8px; font-size: 14px;
  color: var(--text-dim); transition: all .15s;
}
.mainnav a:hover { color: var(--text); background: var(--panel); }
.mainnav a.active { color: var(--gold-bright); background: var(--gold-dim); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
#authArea { display: inline-flex; align-items: center; gap: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dim); }
.user-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-dim); border: 1px solid var(--gold);
  color: var(--gold-bright); font-weight: 700; font-size: 13px;
  display: grid; place-items: center; overflow: hidden;
}
.user-dot img { width: 100%; height: 100%; object-fit: cover; }
a.user-chip:hover { color: var(--gold-bright); }

/* ============ Account page ============ */
.account-wrap .form-section { max-width: 860px; }
.avatar-row { display: flex; gap: 20px; align-items: center; }
.avatar-lg {
  width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold-dim); border: 2px solid var(--gold);
  color: var(--gold-bright); font-family: var(--display); font-size: 40px;
  display: grid; place-items: center; overflow: hidden;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.role-cards.four { grid-template-columns: repeat(4, 1fr); }
.danger-zone { border-color: rgba(224,122,107,.45); }
.danger-zone h3 { color: var(--red); }
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.plan-card.current { border-color: var(--gold); background: var(--gold-dim); }
.plan-card .p-name { font-family: var(--display); font-size: 18px; }
.plan-card .p-price { font-family: var(--serif); font-size: 30px; color: var(--gold-bright); }
.plan-card .p-price span { font-size: 14px; color: var(--text-faint); font-family: var(--sans); }
.plan-card ul { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-dim); }
.plan-card ul li::before { content: '✓  '; color: var(--green); }
.lock-box {
  background: var(--bg-soft); border: 1px dashed var(--gold);
  border-radius: 10px; padding: 16px; text-align: center; margin-bottom: 14px;
}
.email-log { font-size: 13px; }
.email-log .e-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.email-log .e-status { font-weight: 700; }
.email-log .e-status.sent { color: var(--green); }
.email-log .e-status.simulated { color: var(--blue); }
.email-log .e-status.failed { color: var(--red); }
.card-on-file {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; display: inline-flex; align-items: center; font-size: 14px;
}
.card-on-file .p-brand { font-weight: 700; color: var(--gold-bright); margin-right: 6px; }

.bell {
  position: relative; background: none; border: 1px solid var(--line);
  border-radius: 50%; width: 38px; height: 38px; color: var(--text-dim);
  display: grid; place-items: center; transition: all .15s;
}
.bell:hover { color: var(--gold); border-color: var(--gold); }
.bell-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--gold); color: #14100a; font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 5px; min-width: 16px;
}
.notif-panel {
  position: fixed; top: 62px; right: 24px; z-index: 60;
  width: 360px; max-height: 480px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; display: block; }
.notif-item:hover { background: var(--panel-2); }
.notif-item .n-title { color: var(--gold-bright); font-weight: 600; }
.notif-item .n-sub { color: var(--text-dim); }
.notif-empty { padding: 24px 16px; color: var(--text-faint); font-size: 13px; text-align: center; }
.linklike { background: none; border: none; color: var(--gold); font-size: 12px; }
.linklike:hover { text-decoration: underline; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border-radius: 8px; padding: 9px 18px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; transition: all .15s;
}
.btn-gold { background: var(--gold); color: #14100a; }
.btn-gold:hover { background: var(--gold-bright); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-outline-gold { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline-gold:hover { background: var(--gold-dim); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ============ Hero ============ */
.hero {
  padding: 72px 28px 56px; text-align: center;
  background:
    radial-gradient(ellipse 60% 80% at 50% -20%, rgba(201,169,98,.12), transparent),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4.4vw, 52px);
  letter-spacing: .01em; max-width: 820px; margin: 0 auto 16px;
}
.hero h1 em { font-family: var(--serif); font-style: italic; color: var(--gold-bright); }
.hero p { color: var(--text-dim); max-width: 620px; margin: 0 auto 28px; font-size: 16px; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.hero-stats div { text-align: center; }
.hero-stats .num { font-family: var(--serif); font-size: 30px; color: var(--gold-bright); }
.hero-stats .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }

/* ============ Browse layout ============ */
.browse-wrap { display: grid; grid-template-columns: 288px 1fr; gap: 24px; padding: 24px 28px 48px; max-width: 1440px; margin: 0 auto; }

.filters {
  position: sticky; top: 82px; align-self: start;
  max-height: calc(100vh - 100px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.filters h3 { font-family: var(--display); font-size: 18px; font-weight: 500; margin-bottom: 4px; }
.filters .f-sub { font-size: 12px; color: var(--text-faint); margin-bottom: 14px; }
.f-group { border-top: 1px solid var(--line); padding: 12px 0; }
.f-group > .f-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); margin-bottom: 8px; display: block;
}
.f-group label.check { margin: 4px 0; font-size: 13.5px; }
.range-row { display: flex; gap: 8px; align-items: center; }
.range-row span { color: var(--text-faint); font-size: 12px; }
.filters .btn { margin-top: 6px; }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.results-head h2 { font-family: var(--display); font-weight: 500; font-size: 22px; }
.results-head .count { color: var(--text-dim); font-size: 13px; }
.sort-row { display: flex; gap: 10px; align-items: center; }
.sort-row select { width: auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

/* ============ Listing card ============ */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s;
  display: flex; flex-direction: column; position: relative;
}
.card:hover { transform: translateY(-3px); border-color: #3a4658; box-shadow: var(--shadow); }
.card-photo { position: relative; aspect-ratio: 3/2; background: linear-gradient(135deg, #232c3b, #161c26); overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-photo .noimg {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--text-faint); font-family: var(--display); font-size: 20px; letter-spacing: .1em;
}
.photo-tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 78%; }
.tag {
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 20px;
  background: rgba(10,12,16,.78); color: var(--gold-bright);
  border: 1px solid rgba(201,169,98,.4); backdrop-filter: blur(4px);
}
.tag.t-lister { color: var(--blue); border-color: rgba(111,168,220,.45); }
.tag.t-clock { color: var(--red); border-color: rgba(224,122,107,.5); }
.tag.t-featured { background: var(--gold); color: #14100a; border-color: var(--gold-bright); font-weight: 800; }
.tag.t-pocket { color: #c9a1e8; border-color: rgba(201,161,232,.5); }
.save-heart {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(10,12,16,.78); border: 1px solid var(--line);
  color: var(--text-dim); display: grid; place-items: center; transition: all .15s;
}
.save-heart:hover { color: var(--gold); border-color: var(--gold); }
.save-heart.saved { color: var(--gold); border-color: var(--gold); background: rgba(201,169,98,.2); }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-price { font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--text); }
.card-worth { font-size: 12px; color: var(--text-faint); }
.card-addr { font-size: 13.5px; color: var(--text-dim); }
.card-specs { font-size: 13px; color: var(--text-dim); display: flex; gap: 12px; flex-wrap: wrap; }
.card-specs b { color: var(--text); font-weight: 600; }
.metric-strip {
  display: flex; gap: 0; border-top: 1px solid var(--line);
  margin-top: auto; padding-top: 10px;
}
.metric-strip div { flex: 1; text-align: center; }
.metric-strip .m-val { font-weight: 700; font-size: 14px; color: var(--green); }
.metric-strip .m-val.neutral { color: var(--text); }
.metric-strip .m-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }

/* ============ Detail page ============ */
.detail-wrap { max-width: 1120px; margin: 0 auto; padding: 24px 28px 64px; }
.backlink { color: var(--text-dim); font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 16px; }
.backlink:hover { color: var(--gold); }
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.gallery.single { grid-template-columns: 1fr; }
.gallery img, .gallery .noimg { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 200px; }
.gallery .g-main { aspect-ratio: 16/9; background: var(--panel-2); }
.gallery .g-side { display: grid; gap: 10px; }
.gallery .g-side > div { background: var(--panel-2); overflow: hidden; aspect-ratio: 16/9.1; }
.gallery .noimg { display: grid; place-items: center; color: var(--text-faint); font-family: var(--display); letter-spacing: .1em; }

.detail-cols { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; flex-wrap: wrap; margin-bottom: 8px; }
.detail-head h1 { font-family: var(--display); font-weight: 500; font-size: 34px; }
.detail-head .d-addr { color: var(--text-dim); margin-top: 2px; }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 18px; }
.d-tags .tag { background: var(--gold-dim); backdrop-filter: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel h3 { font-family: var(--display); font-weight: 500; font-size: 19px; margin-bottom: 14px; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.fin-cell { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fin-cell .f-val { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--text); }
.fin-cell .f-val.good { color: var(--green); }
.fin-cell .f-val.gold { color: var(--gold-bright); }
.fin-cell .f-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-top: 2px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; font-size: 14px; }
.facts div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 6px 0; }
.facts span:first-child { color: var(--text-dim); }
.facts span:last-child { font-weight: 600; }

.comps-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.comps-table th { text-align: left; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.comps-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.comps-table tr:last-child td { border-bottom: none; }

.contact-card { position: sticky; top: 82px; }
.contact-card .lister-type { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin-bottom: 4px; }
.contact-card .lister-name { font-family: var(--serif); font-size: 22px; font-weight: 500; margin-bottom: 12px; }
.contact-card .c-row { display: flex; gap: 10px; align-items: center; color: var(--text-dim); font-size: 14px; margin-bottom: 8px; }
.contact-card .c-row b { color: var(--text); }
.deadline-box {
  background: rgba(224,122,107,.1); border: 1px solid rgba(224,122,107,.4);
  border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 13.5px;
}
.deadline-box b { color: var(--red); font-size: 16px; }
.mortgage-note { background: var(--gold-dim); border: 1px solid rgba(201,169,98,.35); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-top: 12px; }

/* ============ Forms / Post page ============ */
.form-wrap { max-width: 860px; margin: 0 auto; padding: 32px 28px 64px; }
.form-wrap > h1 { font-family: var(--display); font-weight: 500; font-size: 32px; margin-bottom: 6px; }
.form-wrap > .sub { color: var(--text-dim); margin-bottom: 28px; }
.form-section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.form-section h3 { font-family: var(--display); font-weight: 500; font-size: 19px; margin-bottom: 4px; }
.form-section .s-sub { font-size: 13px; color: var(--text-faint); margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 6px; }
.role-card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 14px; text-align: center; cursor: pointer; transition: all .15s;
}
.role-card:hover { border-color: var(--text-dim); }
.role-card.selected { border-color: var(--gold); background: var(--gold-dim); }
.role-card .r-title { font-weight: 700; margin-bottom: 2px; }
.role-card .r-sub { font-size: 12px; color: var(--text-faint); }
.niche-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.err { color: var(--red); font-size: 13px; margin-top: 4px; display: none; }
.form-error-banner { background: rgba(224,122,107,.12); border: 1px solid rgba(224,122,107,.45); color: var(--red); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; display: none; }
.photo-previews { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.photo-previews img { width: 110px; height: 74px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ============ Saved page ============ */
.saved-wrap { max-width: 1240px; margin: 0 auto; padding: 32px 28px 64px; }
.saved-wrap h1 { font-family: var(--display); font-weight: 500; font-size: 32px; margin-bottom: 20px; }
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.subtabs button {
  background: none; border: none; color: var(--text-dim); font-size: 15px;
  padding: 10px 18px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtabs button.active { color: var(--gold-bright); border-bottom-color: var(--gold); }
.saved-card-note { padding: 12px 16px; border-top: 1px solid var(--line); }
.saved-card-note textarea { font-size: 13px; min-height: 60px; }
.saved-card-note .note-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.search-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px;
  display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap;
}
.search-item .s-name { font-family: var(--display); font-size: 18px; }
.search-item .s-crit { font-size: 13px; color: var(--text-dim); margin-top: 4px; max-width: 640px; }
.search-item .s-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.alert-pill { font-size: 12px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); color: var(--text-faint); }
.alert-pill.on { color: var(--green); border-color: rgba(93,187,138,.5); }
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-faint); }
.empty-state .big { font-family: var(--display); font-size: 22px; color: var(--text-dim); margin-bottom: 8px; }

/* ============ My Listings ============ */
.mine-row {
  display: flex; gap: 18px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 14px;
}
.mine-row.is-sold { opacity: .6; }
.mine-thumb { width: 130px; height: 86px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--panel-2); }
.mine-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mine-thumb .noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-faint); font-size: 11px; letter-spacing: .1em; }
.mine-info { flex: 1; min-width: 0; }
.mine-title { font-family: var(--display); font-size: 17px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mine-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.mine-stats { display: flex; gap: 18px; font-size: 13px; color: var(--text-dim); margin-top: 8px; flex-wrap: wrap; }
.mine-stats b { color: var(--gold-bright); }
.mine-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.status-badge {
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
  padding: 2px 8px; border-radius: 12px;
}
.status-badge.live { background: rgba(93,187,138,.15); color: var(--green); border: 1px solid rgba(93,187,138,.4); }
.status-badge.sold { background: rgba(224,122,107,.15); color: var(--red); border: 1px solid rgba(224,122,107,.4); }
.status-badge.pocket { background: rgba(201,161,232,.12); color: #c9a1e8; border: 1px solid rgba(201,161,232,.4); }
@media (max-width: 960px) {
  .mine-row { flex-direction: column; align-items: stretch; }
  .mine-thumb { width: 100%; height: 140px; }
  .mine-actions { justify-content: flex-start; }
}

.pw-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; line-height: 1.4; }

/* ============ Privacy policy ============ */
.privacy-body h3 { margin-top: 22px; }
.privacy-body h3:first-child { margin-top: 0; }
.privacy-body p { color: var(--text-dim); font-size: 14px; margin: 8px 0; line-height: 1.65; }
.privacy-body b { color: var(--text); }

/* ============ Skeleton loaders ============ */
.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, #313d51 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.skel-photo { aspect-ratio: 3/2; border-radius: 0; }
.skel-line { height: 13px; margin-bottom: 10px; }
.skel-line.w30 { width: 30%; } .skel-line.w45 { width: 45%; }
.skel-line.w60 { width: 60%; } .skel-line.w85 { width: 85%; }
.skel-row {
  display: flex; gap: 18px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 14px;
}
.skel-thumb { width: 130px; height: 86px; flex-shrink: 0; border-radius: 8px; }
.skel-stat { height: 76px; border-radius: 10px; }

/* ============ Social: avatars, picker, friends, profile ============ */
/* red notification dot for incoming friend requests */
#friendBadge { background: #e0574a; color: #fff; box-shadow: 0 0 0 3px rgba(224,87,74,.22); }

.mini-avatar { display:inline-flex; align-items:center; justify-content:center; border-radius:50%; overflow:hidden; background:var(--gold-dim); border:1px solid var(--gold); color:var(--gold-bright); font-weight:700; flex-shrink:0; vertical-align:middle; }
.mini-avatar img { width:100%; height:100%; object-fit:cover; }
.member-link { color:var(--text-dim); text-decoration:none; }
.member-link:hover { color:var(--gold-bright); text-decoration:underline; }

.picker-chips { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.picker-chip { background:var(--gold-dim); border:1px solid var(--gold); color:var(--gold-bright); border-radius:16px; padding:3px 10px; font-size:13px; cursor:pointer; }
.picker-results { max-height:240px; overflow-y:auto; border:1px solid var(--line); border-radius:10px; }
.picker-heading { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint); padding:8px 12px; }
.picker-row { display:flex; align-items:center; gap:10px; padding:8px 12px; cursor:pointer; border-top:1px solid var(--line); }
.picker-row:first-child { border-top:none; }
.picker-row:hover { background:var(--panel-2); }
.picker-row.sel { background:var(--gold-dim); }
.picker-row .pr-name { flex:1; }
.picker-check { color:var(--gold-bright); font-weight:700; }

.friend-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); }
.friend-row:last-child { border-bottom:none; }
.friend-id { display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text); min-width:0; }
.friend-id:hover b { color:var(--gold-bright); }
.friend-actions { display:flex; gap:8px; flex-shrink:0; flex-wrap:wrap; justify-content:flex-end; }

.profile-head { display:flex; gap:20px; align-items:center; margin-bottom:20px; }
.profile-avatar { width:96px; height:96px; border-radius:50%; flex-shrink:0; background:var(--gold-dim); border:2px solid var(--gold); color:var(--gold-bright); font-family:var(--display); font-size:40px; display:grid; place-items:center; overflow:hidden; }
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-actions { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }

/* ============ Messaging ============ */
.nav-badge {
  display: inline-block; background: var(--gold); color: #14100a;
  font-size: 10px; font-weight: 800; border-radius: 10px;
  padding: 1px 6px; min-width: 16px; text-align: center; vertical-align: 2px;
}
.chat-wrap {
  display: grid; grid-template-columns: 320px 1fr; gap: 0;
  max-width: 1240px; margin: 0 auto; padding: 24px 28px 48px;
  height: calc(100vh - 130px); min-height: 480px;
}
.chat-list {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius) 0 0 var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-list-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.chat-list-head h2 { font-family: var(--display); font-size: 20px; font-weight: 500; }
.chat-newforms { padding: 0 12px; }
.chat-newforms > div { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.chat-convs { flex: 1; overflow-y: auto; }
.chat-conv { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .12s; }
.chat-conv:hover { background: var(--panel-2); }
.chat-conv.active { background: var(--gold-dim); border-left: 3px solid var(--gold); padding-left: 13px; }
.cc-title { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.cc-preview { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-disclaimer { padding: 10px 14px; font-size: 11px; color: var(--text-faint); border-top: 1px solid var(--line); }
.chat-thread {
  background: var(--bg-soft); border: 1px solid var(--line); border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.thread-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.thread-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 72%; align-self: flex-start; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg-sender { font-size: 11px; color: var(--gold-bright); margin-bottom: 2px; }
.msg-body {
  display: inline-block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px; padding: 9px 14px; font-size: 14px;
  white-space: pre-wrap; word-break: break-word; text-align: left;
}
.msg.mine .msg-body { background: var(--gold-dim); border-color: rgba(201,169,98,.4); border-radius: 12px 12px 4px 12px; }
.msg-time { font-size: 10.5px; color: var(--text-faint); margin-top: 3px; }
.thread-compose { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--panel); }
.thread-compose textarea { resize: none; }
.peek-row td { background: var(--bg-soft); }
@media (max-width: 960px) {
  .chat-wrap { grid-template-columns: 1fr; height: auto; padding: 16px; }
  .chat-list { border-radius: var(--radius) var(--radius) 0 0; max-height: 300px; }
  .chat-thread { border-radius: 0 0 var(--radius) var(--radius); border-left: 1px solid var(--line); border-top: none; min-height: 420px; }
}

/* ============ Admin panel ============ */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat-num { font-family: var(--serif); font-size: 26px; }
.stat-num.gold { color: var(--gold-bright); }
.stat-num.green { color: var(--green); }
.stat-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-top: 2px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left; color: var(--text-faint); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; padding: 12px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel);
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--panel-2); }
.admin-table .dim { color: var(--text-faint); font-size: 12.5px; }
.admin-wrap .subtabs { flex-wrap: wrap; }

/* ============ Modal / toast ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8,10,14,.7); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; width: 100%; max-width: 440px; box-shadow: var(--shadow);
}
.modal h3 { font-family: var(--display); font-weight: 500; font-size: 22px; margin-bottom: 4px; }
.modal-sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--gold); color: var(--text);
  padding: 12px 22px; border-radius: 10px; z-index: 200; font-size: 14px;
  box-shadow: var(--shadow);
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--line); padding: 32px 28px; margin-top: 24px;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  color: var(--text-faint); font-size: 13px;
}
.site-footer p { max-width: 520px; margin-top: 6px; }
.brand-foot { font-size: 19px; }
.foot-note { align-self: end; }

/* ============ Responsive ============ */
/* ============ Mobile (desktop stays untouched above 960px) ============ */
.bottom-nav { display: none; }
.mobile-filter-toggle { display: none; }

@media (max-width: 960px) {
  /* layout reflows */
  .browse-wrap { grid-template-columns: 1fr; padding: 16px 14px 40px; gap: 16px; }
  .detail-cols { grid-template-columns: 1fr; }
  .contact-card { position: static; }
  .form-row, .form-row-3, .role-cards, .niche-grid, .facts, .plan-cards { grid-template-columns: 1fr; }
  .role-cards.four { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery .g-side { grid-template-columns: 1fr 1fr; }

  /* top bar: logo + bell + account only — navigation moves to the bottom bar */
  .topbar { padding: 10px 14px; gap: 12px; }
  .mainnav { display: none; }
  .topbar-right { margin-left: auto; }

  /* app-style bottom tab bar */
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: rgba(14,17,22,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--text-faint); font-size: 10.5px; letter-spacing: .02em;
    padding: 4px 0; border-radius: 10px; transition: color .15s;
  }
  .bottom-nav a.active { color: var(--gold-bright); }
  .bottom-nav a.bn-post { color: var(--gold); margin-top: -4px; }
  .bottom-nav .bn-badge { position: absolute; top: 0; right: 18%; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .site-footer { margin-bottom: 8px; }

  /* results first: filters collapse behind a toggle */
  .mobile-filter-toggle { display: block; margin-bottom: 14px; }
  .filters { display: none; position: static; max-height: none; }
  .filters.open { display: block; }

  /* trimmer hero */
  .hero { padding: 36px 18px 28px; }
  .hero p { font-size: 14px; margin-bottom: 16px; }
  .hero-stats { gap: 14px 28px; margin-top: 20px; }
  .hero-stats .num { font-size: 24px; }

  /* comfortable touch targets; 16px inputs stop iOS auto-zoom */
  input, select, textarea { font-size: 16px; padding: 11px 13px; }
  .btn { padding: 11px 18px; }
  .modal { max-height: 88vh; overflow-y: auto; }
  .chat-wrap { padding-bottom: 8px; }
  .thread-msgs { min-height: 260px; }
}
