:root {
  --brand: #172641;
  --brand-dark: #101b30;
  --brand-bright: #2b3a5c;
  --brand-tint: #f7ded3;
  --peach: #f7ded3;
  --accent: #ff8559;
  --ink: #172641;
  --muted: #6b7280;
  --border: #ece3dd;
  --bg: #ffffff;
  --page: #fbf4f0;
  --danger: #c0392b;
  --warn-bg: #fff8e1;
  --warn-border: #ffe0a3;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, .10);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

/* Mobile-first: base styles target a phone; min-width queries enhance up. */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.page { max-width: var(--maxw); margin: 0 auto; padding: 18px 14px 56px; }
.page > h1 { margin: 0 0 18px; font-size: 1.5rem; }

/* ---------- header (mobile: wraps, full-width search) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--border); }
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.logo img { height: 30px; width: auto; display: block; }

.search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.search input { flex: 1; border: 0; background: transparent; padding: 12px 18px; font-size: 1rem; outline: none; }
.search button { border: 0; background: transparent; padding: 0 16px; height: 46px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; }
.search button:hover { color: var(--brand); }

.header-nav { display: none; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.nav-link { color: var(--ink); padding: 10px 10px; border-radius: var(--radius-sm); font-size: .92rem; }
.nav-link:hover { background: var(--page); text-decoration: none; }

.cat-bar { background: #fff; }
.cat-bar .header-inner { flex-wrap: nowrap; padding: 2px 12px 12px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.cat-bar .header-inner::-webkit-scrollbar { display: none; }
.cat-bar a { border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; color: var(--ink); font-size: .9rem; white-space: nowrap; }
.cat-bar a:hover { color: var(--brand); text-decoration: none; }
.cat-bar a:first-child { border-color: var(--brand); color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover { border-color: #cfcfcf; text-decoration: none; }
.btn-primary, .btn.buy, button.buy, button.accept { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .btn.buy:hover, button.buy:hover, button.accept:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); }
.btn-danger, button.danger { background: #fff; color: var(--danger); border-color: #eccac5; }
.btn-danger:hover, button.danger:hover { background: #fdf3f2; border-color: #e0b2ab; }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
button { font: inherit; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .85rem; font-weight: 600; }
.field input, .field select, .field textarea,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: auto; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(120deg, var(--peach) 0%, #ffe9df 100%); color: var(--brand); border-radius: var(--radius); padding: 28px 22px; margin-bottom: 26px; }
.hero h1 { margin: 0 0 8px; font-size: 1.5rem; letter-spacing: -.02em; }
.hero p { margin: 0 0 18px; opacity: .92; }
.hero .btn { background: var(--brand); color: #fff; border-color: var(--brand); }
.hero .btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.hero .btn + .btn { background: transparent; color: var(--brand); border-color: var(--brand); margin-left: 8px; }
.hero .btn + .btn:hover { background: rgba(23, 38, 65, .07); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 14px; }
.section-head h2 { margin: 0; font-size: 1.2rem; }

/* ---------- item grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.item-card { background: #fff; border-radius: var(--radius); overflow: hidden; color: var(--ink); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.item-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); text-decoration: none; }
.item-media { position: relative; aspect-ratio: 3/4; background: #f0f0ee; overflow: hidden; }
.item-media img, .item-media .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-media .ph { display: flex; align-items: center; justify-content: center; color: #bdbdbd; }
.item-media .ph::after { content: "sweep'd"; font-weight: 700; letter-spacing: .04em; }
.item-info { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.item-price { font-weight: 800; font-size: 1rem; }
.item-title { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--muted); font-size: .78rem; }
.item-cond { color: #9a9a9a; font-size: .76rem; }

/* ---------- browse ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 20px; }
.filters input, .filters select { width: auto; flex: 1 1 160px; min-width: 140px; }
.filters .btn { flex: 1 1 100%; }

/* ---------- item detail (mobile: single column) ---------- */
.detail { display: grid; grid-template-columns: 1fr; gap: 20px; }
.detail-photos { display: flex; flex-direction: column; gap: 10px; }

/* horizontal swipe gallery */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; border-radius: var(--radius); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery-item { flex: 0 0 100%; scroll-snap-align: start; width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius); background: #f0f0ee; }
.gallery-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.gallery-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.gallery-dots span.on { background: var(--brand); }
.gallery-wrap { position: relative; }
.gal-arrow { display: inline-flex; position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: rgba(255, 255, 255, .92); color: var(--ink); cursor: pointer; z-index: 3; align-items: center; justify-content: center; }
.gal-arrow:hover { background: #fff; }
.gal-arrow.prev { left: 8px; }
.gal-arrow.next { right: 8px; }
.detail-photos img, .detail-photos .placeholder.large { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius); background: #f0f0ee; }
.detail-info h1 { margin: 0 0 4px; font-size: 1.35rem; }
.detail-brand { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.detail-meta { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.detail-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.detail-price .price { font-size: 1.8rem; font-weight: 800; }
.card-total { color: var(--muted); font-size: .85rem; }
.detail-desc { line-height: 1.6; color: #3a3a3a; margin: 14px 0; }
.detail-status { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--brand); background: var(--brand-tint); border-radius: 999px; padding: 4px 12px; margin-bottom: 16px; }
.detail-status-active { background: rgba(47, 143, 91, .15); color: #1f7a4d; }
.info-btn { background: none; border: 0; padding: 0 0 0 4px; color: var(--muted); cursor: pointer; vertical-align: middle; }
.info-btn:hover { color: var(--brand); }
.bp-popover { margin-top: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; max-width: 440px; font-size: .85rem; color: #444; }
.bp-popover strong { display: block; margin-bottom: 4px; }
.bp-popover p { margin: 0; }
.bp-popover[hidden] { display: none; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-badges .detail-status { margin-bottom: 0; }
.saved-badge { background: #fff; border: 1px solid var(--accent); color: var(--accent); }
.sold-ribbon { position: absolute; top: 12px; left: 12px; z-index: 4; background: var(--brand); color: #fff; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: .8rem; padding: 6px 12px; border-radius: 6px; }
.sold-tag { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(23, 38, 65, .85); color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; }
.sold-note { color: var(--brand); }

.offer-box, .offers { margin-top: 20px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.offer-box h2, .offers h2 { margin: 16px 0 12px; font-size: 1.05rem; }
.offer-box form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.buy-note { color: var(--muted); font-size: .82rem; margin: 6px 0 0; }
.offer-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }

/* ---------- orders ---------- */
.order { max-width: 760px; }
.order-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.order-list li { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.order-status { color: var(--muted); }
.order-total { width: 100%; border-collapse: collapse; margin: 18px 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.order-total td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.order-total tr:last-child td { border-bottom: 0; font-weight: 700; }
.order-total td:last-child { text-align: right; }
.order-parties { color: var(--muted); font-size: .9rem; }
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.order-events { list-style: none; padding: 0; }
.order-events li { padding: 8px 0; border-bottom: 1px solid var(--border); color: #444; font-size: .9rem; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--page); color: var(--muted); }
.badge-active { background: var(--brand-tint); color: var(--brand); }
.badge-sold, .badge-removed { background: #f0f0f0; color: #888; }
.badge-disputed { background: #fdecea; color: var(--danger); }

/* ---------- admin ---------- */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.admin-nav a { padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: .9rem; }
.admin-nav a:hover { background: var(--page); text-decoration: none; }
.admin-nav a.active { background: var(--brand-tint); color: var(--brand); }
.admin-stats { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0; margin: 0 0 22px; }
.admin-stats li { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; font-weight: 700; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: .88rem; display: block; overflow-x: auto; white-space: nowrap; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--page); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table form { display: inline; }

/* ---------- flashes / empty ---------- */
.flashes { list-style: none; padding: 0; margin: 0 0 18px; }
.flashes li { background: var(--warn-bg); border: 1px solid var(--warn-border); padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.empty { color: var(--muted); padding: 30px 0; }

/* ---------- auth ---------- */
.auth-card { max-width: 420px; margin: 24px auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.auth-card h1 { margin: 0 0 18px; }
.auth-card .form { max-width: none; }
.auth-alt { color: var(--muted); font-size: .9rem; margin-top: 16px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: #fff; margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 28px 16px 8px; display: grid; grid-template-columns: 1fr; gap: 22px; }
.footer-name { font-weight: 800; font-size: 1.1rem; color: var(--brand); }
.footer-brand p { color: var(--muted); font-size: .9rem; margin: 6px 0 0; max-width: 260px; }
.footer-col { display: flex; flex-direction: column; }
.footer-col h4 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.footer-col a { color: var(--ink); font-size: .9rem; padding: 3px 0; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 18px; padding: 14px 16px; text-align: center; color: var(--muted); font-size: .8rem; }

/* ---------- legal pages ---------- */
.legal { max-width: 760px; }
.legal h1 { margin-top: 0; }
.legal h2 { margin-top: 26px; }
.legal p, .legal li { line-height: 1.65; color: #333; }
.legal ul { padding-left: 20px; }
.draft-note { background: var(--brand-tint); border: 1px solid #f0c9b6; color: var(--brand); padding: 10px 14px; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; }

/* ---------- mobile bottom tab bar (phone): floating capsule + raised Sell ---------- */
.mobile-tabs {
  display: flex;
  align-items: flex-start;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 10px 28px rgba(23, 38, 65, .16);
  padding: 8px 6px;
}
.mobile-tabs a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .68rem; font-weight: 600; padding: 6px 2px; border-radius: 16px; }
.mobile-tabs a:hover { text-decoration: none; }
.mobile-tabs a.active { color: var(--brand); background: var(--peach); }
.mobile-tabs a .t-ic-fill { display: none; }
.mobile-tabs a.active .t-ic { display: none; }
.mobile-tabs a.active .t-ic-fill { display: block; }
.mobile-tabs a.sell { background: none; padding: 0; }
.mobile-tabs a.sell.active { background: none; }
.mobile-tabs a.sell .t-disc {
  width: 52px;
  height: 52px;
  margin-top: -22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(255, 133, 89, .5);
}
.mobile-tabs a.sell.active .t-disc { box-shadow: 0 0 0 3px var(--brand-tint), 0 8px 18px rgba(255, 133, 89, .5); }
body { padding-bottom: 92px; }

/* ---------- enhancements up from mobile ---------- */
@media (min-width: 640px) {
  .header-inner { flex-wrap: nowrap; padding: 0 20px; height: 68px; gap: 18px; }
  .logo img { height: 42px; }
  .search { order: 0; flex: 1 1 auto; flex-basis: auto; max-width: 640px; }
  .search input { padding: 11px 18px; }
  .cat-bar .header-inner { padding: 0 20px; height: 44px; overflow: visible; position: relative; }
  .header-nav { display: flex; }
  .cat-bar { border-top: 1px solid var(--border); }
  .cat-bar a { border: 0; border-radius: var(--radius-sm); padding: 6px 10px; color: var(--muted); font-size: .88rem; }
  .cat-bar a:first-child { border: 0; color: var(--muted); }
  .mobile-tabs { display: none; }
  body { padding-bottom: 0; }
  .site-footer { display: block; }
  .footer-inner { grid-template-columns: 2fr repeat(4, 1fr); padding: 32px 20px 10px; }
  .page { padding: 24px 20px 60px; }
  .page > h1 { font-size: 1.7rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
  .filters .btn { flex: 0 0 auto; }
  .hero { padding: 44px 40px; margin-bottom: 32px; }
  .hero h1 { font-size: 2rem; }
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
  .admin-table { display: table; white-space: normal; }
}

@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; }
  .detail-info h1 { font-size: 1.5rem; }
  .detail-price .price { font-size: 2rem; }
}

/* ---------- header mega-menu (desktop) ---------- */
.menu-item { position: static; }
.mega {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 20px;
}
.menu-item.open .mega { display: block; }
.mega-cols { display: flex; gap: 28px; }
.mega-primary { list-style: none; margin: 0; padding: 0; flex: 0 0 260px; }
.mega-primary a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink); }
.mega-primary a:hover { background: var(--page); text-decoration: none; }
.mega-all { color: var(--muted); font-weight: 600; }
.mi { width: 1.3em; text-align: center; font-size: 1.05rem; }
.mega-panels { flex: 1 1 auto; }
.mega-children { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.mega-children[hidden] { display: none; }
.mega-children a { display: block; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink); break-inside: avoid; white-space: normal; }
.mega-children a:hover { background: var(--page); text-decoration: none; }
.mega-children strong { font-weight: 700; }
@media (max-width: 640px) { .mega { display: none !important; } }

/* ---------- admin categories ---------- */
.cat-row.cat-sub td.cat-name { padding-left: 26px; }
.cat-row.cat-leaf td.cat-name { padding-left: 48px; }
.icon-input { width: 64px; text-align: center; }
.pos-input { width: 72px; }
.cat-actions { white-space: nowrap; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-form input, .row-form select { width: auto; }
.card-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 24px; }

/* ---------- header account controls ---------- */
.header-nav { gap: 8px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: var(--radius-sm); color: var(--ink); }
.icon-btn:hover { background: var(--page); text-decoration: none; }
.icon-count { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--brand); font-size: .68rem; font-weight: 700; line-height: 17px; text-align: center; }
.account { position: relative; }
.account-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; cursor: pointer; color: var(--ink); padding: 2px; border-radius: 999px; }
.account-btn:hover { background: var(--page); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 8px; z-index: 70; display: flex; flex-direction: column; }
.account-menu[hidden] { display: none; }
.account-menu a { padding: 10px 12px; border-radius: var(--radius-sm); color: var(--ink); }
.account-menu a:hover { background: var(--page); text-decoration: none; }

/* ---------- favourites / saved (dog-eared bookmark) ---------- */
.item-card { position: relative; }
.item-card .item-link { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.fav-btn { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .92); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); z-index: 2; }
.fav-btn:hover { background: #fff; }
.fav-btn svg { fill: none; stroke: currentColor; }
.fav-btn.is-fav { color: var(--accent); }
.fav-btn.is-fav svg { fill: var(--accent); stroke: var(--accent); }
.fav-btn-inline { position: static; margin-left: auto; align-self: center; width: 40px; height: 40px; }

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.profile-avatar img, .avatar-xl { width: 110px; height: 110px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #d9d9d9; color: #fff; font-size: 2.6rem; font-weight: 700; object-fit: cover; }
.profile-meta h1 { margin: 0 0 4px; }
.profile-meta .muted { color: var(--muted); margin: 0 0 8px; }
.profile-about { max-width: 560px; }

/* ---------- messages ---------- */
.conv-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: 740px; }
.conv { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); }
.conv:hover { text-decoration: none; box-shadow: var(--shadow); }
.conv-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.conv-body { flex: 1 1 auto; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-name { font-weight: 700; }
.conv-time { color: var(--muted); font-size: .8rem; }
.conv-listing { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-preview { color: #555; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-badge { background: var(--accent); color: var(--brand); font-weight: 700; font-size: .72rem; border-radius: 999px; padding: 2px 8px; flex: 0 0 auto; }

.chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.chat-head-info { min-width: 0; }
.chat-with { font-size: .9rem; font-weight: 400; }
.chat { display: flex; flex-direction: column; gap: 10px; max-width: 740px; min-height: 220px; padding: 8px 0 16px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; }
.bubble.theirs { align-self: flex-start; background: #fff; border: 1px solid var(--border); }
.bubble.mine { align-self: flex-end; background: rgba(255, 133, 89, .22); color: var(--brand); }
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-time { font-size: .7rem; opacity: .7; margin-top: 4px; }
.chat-form { display: flex; gap: 8px; max-width: 740px; }
.chat-form input { flex: 1 1 auto; }
.chat-listing { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; color: var(--ink); max-width: 740px; }
.chat-listing:hover { text-decoration: none; box-shadow: var(--shadow); }
.chat-listing-thumb { width: 56px; height: 72px; border-radius: 6px; overflow: hidden; background: #f0f0ee; flex: 0 0 auto; }
.chat-listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chat-listing-info { min-width: 0; }
.chat-listing-title { font-weight: 700; }
.chat-listing-price { font-weight: 700; }
.chat-offer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--brand-tint); border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; max-width: 740px; }
.chat-offer-actions { display: flex; gap: 8px; }
.chat-offer-actions form { margin: 0; }
.chat-pay { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: rgba(255, 133, 89, .18); border: 1px solid rgba(255, 133, 89, .5); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; max-width: 740px; font-weight: 600; color: var(--brand); }
.chat-pay .muted { color: rgba(23, 38, 65, .72); }

/* ---------- notifications ---------- */
.notif-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: 740px; }
.notif { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.notif a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--ink); }
.notif a:hover { text-decoration: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: 0 0 auto; }
.notif.unread .notif-dot { background: var(--accent); }
.notif-title { flex: 1 1 auto; }
.notif.unread .notif-title { font-weight: 700; }
.notif-time { color: var(--muted); font-size: .8rem; }

/* ---------- reviews ---------- */
.rating-line { color: var(--brand); font-weight: 700; }
.review-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; max-width: 740px; }
.review { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.review p { margin: 6px 0 0; }
.review-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* ---------- edit listing ---------- */
.edit-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.edit-photos img { width: 72px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* ---------- impersonation banner ---------- */
.impersonate-banner { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--accent); color: var(--brand); padding: 8px 14px; font-size: .9rem; font-weight: 600; }
.impersonate-banner form { margin: 0; }
.verify-banner { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--brand); color: #fff; padding: 8px 14px; font-size: .9rem; font-weight: 600; }
.verify-banner form { margin: 0; }

/* ---------- listing manage (demoted delete) ---------- */
.listing-manage { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.listing-manage form { margin: 0; display: flex; }
.listing-manage .btn { height: 36px; min-height: 36px; }
.money-field { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.money-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.money-prefix { padding: 0 2px 0 12px; color: var(--muted); font-weight: 600; }
.money-field input { border: 0; flex: 1 1 auto; background: transparent; }
.money-field input:focus { outline: none; box-shadow: none; }
.link-muted { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .85rem; }
.link-muted:hover { color: var(--danger); }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

/* ---------- public profile (Vinted-style header + tabs) ---------- */
.profile-header { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.profile-photo { flex: 0 0 auto; }
.profile-photo img, .profile-photo .avatar-xl { width: 116px; height: 116px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #e2e6ea; color: #fff; font-size: 3rem; font-weight: 700; }
.profile-main { flex: 1 1 320px; min-width: 0; }
.profile-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-name { margin: 0 0 4px; font-size: 1.6rem; letter-spacing: -.01em; }
.profile-rating { display: inline-flex; align-items: center; gap: 8px; }
.profile-rating:hover { text-decoration: none; }
.stars { color: #f5a623; letter-spacing: 2px; font-size: 1.05rem; line-height: 1; }
.profile-action { flex: 0 0 auto; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-bio { margin: 14px 0 0; color: #333; max-width: 640px; }
.profile-cols { display: flex; gap: 44px; margin-top: 18px; flex-wrap: wrap; }
.profile-col h4 { margin: 0 0 10px; font-size: .95rem; }
.about-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.about-list li { display: flex; align-items: center; gap: 10px; color: #333; font-size: .95rem; }
.about-list svg { color: var(--muted); flex: 0 0 auto; }
.about-list a { color: var(--ink); text-decoration: underline; }
.profile-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.profile-tabs a { padding: 12px 4px; margin-right: 20px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.profile-tabs a:hover { text-decoration: none; color: var(--ink); }
.profile-tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- settings hub ---------- */
.settings-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
.settings-title { font-size: 1.5rem; margin: 0 0 14px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 11px 14px; border-radius: var(--radius-sm); color: var(--ink); font-weight: 600; font-size: .95rem; }
.settings-nav a:hover { background: #fff; text-decoration: none; }
.settings-nav a.active { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
.settings-main { min-width: 0; max-width: 720px; }
.settings-h1 { margin: 0 0 6px; font-size: 1.35rem; }
.settings-h2 { margin: 26px 0 8px; font-size: 1.1rem; }
.settings-subhead { color: var(--muted); font-size: .85rem; margin: 22px 0 8px; }
.setting-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.setting-row { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row.top { align-items: flex-start; }
.setting-label { flex: 0 0 auto; font-weight: 600; }
.setting-label .setting-hint { display: block; }
.setting-hint { color: var(--muted); font-size: .82rem; font-weight: 400; margin: 4px 0 0; }
.setting-control { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; justify-content: flex-end; min-width: 0; }
.setting-control input, .setting-control select, .setting-control textarea { max-width: 420px; width: 100%; }
.setting-control textarea { min-height: 88px; resize: vertical; }
.setting-note { color: var(--muted); font-size: .88rem; margin: -6px 0 22px; max-width: 640px; }
.photo-control { justify-content: flex-start; gap: 14px; }
.avatar-lg { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #e2e6ea; color: #fff; font-weight: 700; font-size: 1.4rem; flex: 0 0 auto; }
.verified-badge { color: #1a7f4b; background: #e7f6ec; border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.balance-amount { font-size: 1.25rem; }
.pill { color: var(--muted); background: var(--page); border-radius: 999px; padding: 4px 12px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.info-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-tint); border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; color: var(--brand); font-size: .9rem; }
.info-banner svg { flex: 0 0 auto; margin-top: 1px; }
.security-form { padding: 2px 18px 18px; display: flex; flex-direction: column; gap: 12px; max-width: 440px; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #cfd4dc; border-radius: 999px; transition: background .15s; }
.slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* two-step verification setup / recovery codes */
.qr-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: inline-block; margin: 0 0 20px; }
.qr-box svg { display: block; width: 200px; height: 200px; }
.setup-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; font-size: .95rem; overflow-wrap: anywhere; text-align: right; }
.recovery-list { list-style: none; margin: 0; padding: 16px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.recovery-list code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }
@media (max-width: 520px) { .recovery-list { grid-template-columns: 1fr; } }

@media (min-width: 900px) {
  .settings-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 44px; }
  .setting-label { flex: 0 0 220px; }
  .profile-photo img, .profile-photo .avatar-xl { width: 140px; height: 140px; }
  .profile-name { font-size: 1.8rem; }
}
