:root {
  --green: #2f6b2f;
  --green-dark: #244f24;
  --green-light: #8bc48b;
  --orange: #f2711c;
  --orange-dark: #d85f12;
  --ink: #1c2321;
  --muted: #6b746f;
  --line: #e4e8e5;
  --bg: #f6f8f6;
  --card: #ffffff;
  --surface: #ffffff;
  --dark: #1f2720;
  --promoted: #7cc243;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(20, 40, 20, 0.06);
  --shadow-lg: 0 8px 28px rgba(20, 40, 20, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- top utility bar ---------- */
.util {
  background: var(--surface); border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.util .wrap { display: flex; align-items: center; gap: 18px; height: 34px; }
.util a:hover { color: var(--orange); }
.util .spacer { flex: 1; }
.util .signin { color: var(--orange); font-weight: 600; cursor: pointer; }

/* ---------- main header ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header .wrap { display: flex; align-items: center; gap: 16px; height: 66px; }
.logo { font-size: 26px; font-weight: 300; letter-spacing: 1px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; }
.brand-mark { height: 34px; width: 34px; object-fit: contain; margin-right: 9px; }
.footer .brand .brand-mark { height: 30px; width: 30px; }
.logo b { font-weight: 300; color: var(--ink); }
.logo span { color: var(--orange); font-weight: 400; }
.cat-dd {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.search { flex: 1; display: flex; }
.search input {
  flex: 1; border: 2px solid var(--ink); border-right: none; border-radius: 6px 0 0 6px;
  padding: 10px 14px; font-size: 14px; outline: none; min-width: 60px;
}
.search select { border: 2px solid var(--ink); border-left: 1px solid var(--line); border-right: none; padding: 0 8px; font-size: 13px; background: var(--surface); }
.search button {
  background: var(--dark); color: #fff; border: 2px solid var(--ink);
  border-radius: 0 6px 6px 0; padding: 0 22px; font-weight: 600; font-size: 14px;
}
.search button:hover { background: #000; }
.icon-btn { position: relative; background: none; border: none; font-size: 20px; color: var(--ink); padding: 4px; }
.badge {
  position: absolute; top: -4px; right: -6px; background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 5px;
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(100deg, #15200f 0%, #1c2b12 45%, #3a4a2a 100%);
  color: #fff; border-radius: var(--radius); overflow: hidden; position: relative;
  display: flex; align-items: center; min-height: 290px; margin: 20px 0;
}
.hero-text { padding: 46px; max-width: 560px; z-index: 2; }
.hero-text h1 { font-size: 34px; font-weight: 300; margin: 0 0 14px; line-height: 1.2; }
.hero-text h1 b { font-weight: 600; }
.hero-text h1 span { color: var(--orange); }
.hero-text p { color: #d6ddcf; font-size: 16px; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 14px; }
.hero-art {
  position: absolute; right: -40px; top: 0; bottom: 0; width: 46%;
  background: radial-gradient(circle at 70% 50%, rgba(242,113,28,.35), transparent 60%);
  display: flex; align-items: center; justify-content: center; font-size: 150px; opacity: .9;
}

/* ---------- buttons ---------- */
.btn { border: none; border-radius: 6px; padding: 13px 30px; font-weight: 600; font-size: 15px; }
.btn-light { background: #ffffff; color: #1c2321; }
.btn-light:hover { background: #ececec; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- section ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 14px; }
.section-head h2 { font-size: 22px; font-weight: 600; margin: 0; }
.section-head a { color: var(--orange); font-size: 14px; font-weight: 600; }

/* ---------- category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-tile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; text-align: center;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cat-tile .emoji { font-size: 40px; padding: 22px 0 12px; color: var(--orange); }
.cat-tile .label { background: var(--dark); color: #fff; font-size: 12px; font-weight: 600; padding: 9px 4px; }
.cat-tile .count { font-size: 11px; color: var(--muted); padding: 6px; }

/* ---------- listing cards ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; cursor: pointer;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-img { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg,#dfe7df,#c7d3c7); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 54px; }
.watch-heart {
  position: absolute; top: 9px; right: 9px; z-index: 2; width: 32px; height: 32px;
  border-radius: 50%; border: none; background: rgba(255,255,255,.9); color: var(--muted);
  font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: transform .12s;
}
.watch-heart:hover { transform: scale(1.12); }
.watch-heart.on { color: #e0295a; }
.promoted-tag {
  position: absolute; top: 10px; left: 0; background: var(--promoted); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 4px 10px 4px 8px; border-radius: 0 4px 4px 0;
}
.promoted-tag.Gold { background: #d9a400; }
.promoted-tag.Silver { background: #8a9199; }
.promoted-tag.Bronze { background: #b06a33; }
.card-body { padding: 13px 14px 16px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-weight: 600; font-size: 14.5px; margin: 0 0 4px; }
.card-sub { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.card-price-label { font-size: 11px; color: var(--muted); }
.card-price { color: var(--orange); font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.countdown { display: flex; gap: 8px; margin-top: auto; }
.cd-box { background: var(--bg); border-radius: 5px; padding: 5px 0; text-align: center; flex: 1; }
.cd-box b { display: block; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.cd-box span { font-size: 9px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.card-actions .btn { padding: 9px 0; flex: 1; font-size: 13px; }
.ended { color: #c0392b; font-weight: 700; font-size: 13px; margin-top: auto; }

/* ---------- category page layout ---------- */
.catpage { display: grid; grid-template-columns: 230px 1fr; gap: 24px; margin: 20px 0; }
.filters { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 0; height: fit-content; }
.filters h4 { margin: 0; background: var(--dark); color: #fff; font-size: 13px; padding: 10px 16px; }
.filter-group { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filter-group h5 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.filter-group label { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 0; color: var(--muted); cursor: pointer; }
.filter-group .sub-link { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; cursor: pointer; }
.filter-group .sub-link:hover { color: var(--orange); }
.filter-group .fcount { color: var(--muted); font-size: 12px; margin-left: auto; }
.filter-group label { justify-content: flex-start; }
.price-row { display: flex; align-items: center; gap: 6px; }
.price-row input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 13px; outline: none; }
.price-row input:focus { border-color: var(--orange); }
.pagenote { text-align: center; color: var(--muted); margin: 26px 0; font-size: 13px; }
.descbox { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.descbox h3 { margin: 0 0 8px; font-size: 16px; }
.descbox p { color: var(--muted); font-size: 14px; margin: 0; }
#fsort { padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }

/* ---------- breadcrumb ---------- */
.crumb { font-size: 13px; color: var(--muted); margin: 16px 0 4px; }
.crumb a:hover { color: var(--orange); }
.crumb b { color: var(--ink); }

/* ---------- item detail ---------- */
.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; margin: 10px 0 40px; }
.gallery .main-img { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: #e6ece6; position: relative; }
.gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; }
.thumbs .t { width: 78px; height: 60px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background:#e6ece6; }
.thumbs .t.active { border-color: var(--orange); }
.thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-size: 24px; margin: 0 0 6px; }
.detail .subline { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14px; margin: 14px 0; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 600; }
.bidbox { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-top: 8px; }
.bidbox .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.bidbox .label { color: var(--muted); font-size: 13px; }
.bidbox .high { color: var(--green); font-weight: 700; font-size: 22px; }
.bidbox .hb { color: var(--green); font-weight: 600; }
.live-cd { display: flex; gap: 10px; margin: 16px 0; }
.live-cd .cd-box { background: var(--dark); color: #fff; }
.live-cd .cd-box b { color: #fff; }
.live-cd .cd-box span { color: #aab3ac; }
.bid-input { display: flex; gap: 10px; margin-top: 8px; }
.bid-input .field { flex: 1; display: flex; align-items: center; border: 2px solid var(--ink); border-radius: 6px; padding: 0 12px; }
.bid-input .field span { color: var(--muted); font-weight: 700; }
.bid-input input { border: none; outline: none; padding: 12px 8px; font-size: 16px; width: 100%; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; font-style: italic; }
.hint.err { color: #c0392b; font-style: normal; font-weight: 600; }
.hint.ok { color: var(--green); font-weight: 600; }
.buynow { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.seller-chip { display:flex; align-items:center; gap:8px; font-size:13px; margin-top:14px; color:var(--muted);}
.seller-chip b{ color:var(--ink);}

/* ---------- escrow flow ---------- */
.escrow-intro { text-align: center; max-width: 720px; margin: 30px auto 10px; }
.escrow-intro h1 { font-size: 30px; margin: 0 0 10px; }
.escrow-intro h1 span { color: var(--orange); }
.escrow-intro p { color: var(--muted); font-size: 16px; }
.stepper { display: flex; justify-content: space-between; gap: 6px; margin: 30px auto; max-width: 960px; position: relative; }
.stepper::before { content: ""; position: absolute; top: 34px; left: 7%; right: 7%; height: 3px; background: var(--line); z-index: 0; }
.step { text-align: center; flex: 1; z-index: 1; }
.step .dot {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 12px; background: var(--surface);
  border: 3px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 30px; transition: all .4s; color: var(--muted);
}
.step.done .dot { border-color: var(--green); background: var(--green); color: #fff; }
.step.active .dot { border-color: var(--orange); background: var(--surface); color: var(--orange); box-shadow: 0 0 0 5px rgba(242,113,28,.18); transform: scale(1.08); }
.step .name { font-size: 13px; font-weight: 600; }
.step .st { font-size: 11px; color: var(--muted); }
.escrow-panel {
  max-width: 760px; margin: 10px auto 40px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; border: 1px solid var(--line);
}
.wallet-row { display: flex; gap: 18px; margin: 20px 0; }
.wallet {
  flex: 1; border-radius: var(--radius); padding: 18px; color: #fff;
}
.wallet.locked { background: linear-gradient(135deg,#444,#5c5c5c); }
.wallet.unlocked { background: linear-gradient(135deg,var(--green),var(--green-dark)); }
.wallet .lbl { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.wallet .amt { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.escrow-msg { background: var(--bg); border-left: 4px solid var(--orange); padding: 14px 16px; border-radius: 6px; font-size: 14px; margin: 16px 0; }
.escrow-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- tables (my bids / dashboard) ---------- */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--dark); color: #fff; }
th { text-align: left; padding: 13px 16px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
tr:last-child td { border-bottom: none; }
td .ref { color: var(--muted); font-size: 12px; }
.status { font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 20px; display: inline-block; }
.status.PayNow { background: var(--orange); color: #fff; }
.status.InProgress { background: #eef4ec; color: var(--green); }
.status.Watching { background: var(--dark); color: #fff; }
.status.Closed { background: #eceff0; color: var(--muted); }
.status.Paid { background: var(--green); color: #fff; }

/* ---------- dashboard tiles ---------- */
.dash-tiles { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 20px 0; }
.dash-tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-align: center; cursor: pointer; transition: transform .15s; }
.dash-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.dash-tile .emoji { font-size: 42px; color: var(--orange); padding: 26px 0 10px; }
.dash-tile .label { background: var(--dark); color: #fff; font-weight: 600; padding: 11px; }

/* ---------- sell flow ---------- */
.sell-wrap { max-width: 680px; margin: 10px auto 40px; }
.steps-bar { display: flex; gap: 8px; margin: 20px 0; }
.steps-bar .s { flex: 1; text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 8px; border-bottom: 3px solid var(--line); }
.steps-bar .s.active { color: var(--orange); border-color: var(--orange); font-weight: 700; }
.steps-bar .s.done { color: var(--green); border-color: var(--green); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.field-group { margin-bottom: 16px; }
.field-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field-group input, .field-group select, .field-group textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; font-size: 14px; font-family: inherit; outline: none;
}
.field-group input:focus, .field-group textarea:focus, .field-group select:focus { border-color: var(--orange); }
.img-drop { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }
.img-slot { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--muted); background: var(--bg); }
.img-slot.filled { border-style: solid; border-color: var(--green); color: var(--green); }
.agree-box { background: var(--bg); border-radius: 8px; padding: 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; }

/* ---------- modal / pop ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,30,20,.55); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius); max-width: 440px; width: 100%; padding: 28px; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal h3 { margin: 0 0 10px; font-size: 20px; }
.modal p { color: var(--muted); font-size: 14px; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--dark); color: #fff; padding: 13px 18px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow-lg); animation: slidein .25s; max-width: 320px; }
.toast.ok { background: var(--green); }
.toast.warn { background: var(--orange); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }

/* ---------- cart ---------- */
.cart-row { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.cart-row img { width: 86px; height: 66px; object-fit: cover; border-radius: 6px; }
.cart-row .ci-title { font-weight: 600; }
.cart-row .ci-spacer { flex: 1; }
.cart-summary { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.cart-summary .sl { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.cart-summary .sl.total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.cart-summary .sl .muted { color: var(--muted); }

/* ---------- footer ---------- */
.footer { background: var(--dark); color: #c5ccc7; margin-top: 50px; padding: 36px 0 24px; font-size: 13px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer h5 { color: #fff; font-size: 13px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .5px; }
.footer a { display: block; padding: 4px 0; color: #c5ccc7; }
.footer a:hover { color: var(--orange); }
.footer .brand { font-size: 24px; font-weight: 300; margin-bottom: 10px; }
.footer .brand span { color: var(--orange); }
.footer .bottom { border-top: 1px solid #39423c; margin-top: 26px; padding-top: 16px; display: flex; justify-content: space-between; color: #8b938d; }
.pay-pills { display: flex; gap: 8px; margin-top: 10px; }
.pay-pills span { background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 4px; }

/* ---------- accessibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, .card:focus-visible, .cat-tile:focus-visible, .t:focus-visible,
.img-slot:focus-visible, .logo:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 400; background: var(--dark); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- flash + sold ---------- */
.flash-tag {
  position: absolute; top: 10px; right: 48px; background: #e0295a; color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 4px 8px; border-radius: 4px; z-index: 2;
}
.ended.sold { color: var(--green); }
.sold-banner { background: var(--green); color: #fff; font-weight: 600; text-align: center; padding: 10px; border-radius: 8px; margin-bottom: 14px; }

/* ---------- quick bid + hint ---------- */
.quickbid { background: none; border: 1px dashed var(--line); color: var(--green); font-weight: 600; font-size: 12.5px; padding: 7px 10px; border-radius: 6px; margin-top: 8px; width: 100%; }
.quickbid:hover { border-color: var(--green); background: #f3f8f3; }
.muted-note { color: var(--muted); font-size: 13px; font-style: italic; }

/* ---------- bid history table ---------- */
table.hist td { padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
table.hist tr:last-child td { border-bottom: none; }

/* ---------- skeleton ---------- */
.card-img, .main-img { position: relative; }
.card-img::after, .main-img::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg,#e8ede8 25%,#f2f6f2 37%,#e8ede8 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
.card-img.loaded::after, .card-img.noimg::after, .main-img.loaded::after { display: none; }
.card-img img, .main-img img, .fallback { position: relative; z-index: 1; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.card.skel { pointer-events: none; }
.card.skel .card-img { aspect-ratio: 4/3; }
.card.skel .card-body { height: 120px; }

/* ---------- mobile filters toggle ---------- */
.filters-toggle { display: none; background: var(--dark); color: #fff; border: none; border-radius: 8px; padding: 11px 16px; font-weight: 600; margin: 8px 0; }
.filters-done { display: none; }
@media (max-width: 960px) { .filters-done { display: block; } }

/* ---------- avatars ---------- */
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 600; overflow: hidden; vertical-align: middle; flex-shrink: 0; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar em { font-style: normal; }
.avatar-xs { width: 22px; height: 22px; font-size: 11px; }
.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-lg { width: 72px; height: 72px; font-size: 30px; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 14px; cursor: pointer; }
.toggle-row input { margin-top: 3px; }

/* ---------- personas / role chip ---------- */
.role-chip { background: var(--dark); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; letter-spacing: .3px; }
.persona-grid { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.persona-card { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; width: 100%; }
.persona-card:hover { border-color: var(--orange); box-shadow: var(--shadow); }
.persona-card .pmeta { flex: 1; }
.persona-card .pmeta b { font-size: 14px; }
.persona-card .prole { background: var(--green); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-left: 4px; }
.persona-card .pmeta p { font-size: 12px; color: var(--muted); margin: 4px 0 2px; }
.persona-card .pcred { font-size: 11px; color: var(--muted); }

/* ---------- seller profile + reviews + stars ---------- */
.stars { color: #f1b400; letter-spacing: 1px; }
.seller-head { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.review p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.admin-grid h4 { color: var(--ink); }
@media (max-width: 760px) { .admin-grid { grid-template-columns: 1fr; } }

.prototype-ribbon {
  position: fixed; bottom: 0; left: 0; background: var(--orange); color: #fff;
  font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 0 8px 0 0; z-index: 150; letter-spacing: .5px; cursor: pointer;
}
.prototype-ribbon:hover { background: var(--orange-dark); }

/* ---------- responsive ---------- */
html, body { max-width: 100%; overflow-x: hidden; }
img, table { max-width: 100%; }

/* big screens: keep content from stretching too wide */
@media (min-width: 1500px) { .wrap { max-width: 1320px; } }

/* small laptop */
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3,1fr); } }

/* tablet */
@media (max-width: 960px) {
  .cat-grid { grid-template-columns: repeat(3,1fr); }
  .grid { grid-template-columns: repeat(2,1fr); }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .catpage { grid-template-columns: 1fr !important; }
  .admin-grid { grid-template-columns: 1fr !important; }
  .filters-toggle { display: block; }
  .filters {
    display: none; position: fixed; inset: 0; z-index: 180; overflow-y: auto;
    border-radius: 0; box-shadow: none; padding-bottom: 40px;
  }
  .filters.open { display: block; }
  .filters h4 { position: sticky; top: 0; }
  .hero-art { display: none; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .dash-tiles { grid-template-columns: 1fr; }
}

/* header stacks: search drops to its own full-width row */
@media (max-width: 820px) {
  .header .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px 12px; }
  .cat-dd { display: none; }
  .logo { margin-right: auto; }
  .search { order: 5; flex-basis: 100%; }
}

/* phone */
@media (max-width: 600px) {
  .cat-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .grid { grid-template-columns: 1fr; }
  .util .wrap { gap: 14px; overflow-x: auto; white-space: nowrap; height: 40px; }
  .hero { min-height: 210px; margin: 14px 0; }
  .hero-text { padding: 24px 20px; }
  .hero-text h1 { font-size: 23px; }
  .hero-text p { font-size: 14px; }
  .section-head { flex-wrap: wrap; gap: 8px; }
  .section-head h2 { font-size: 19px; }
  .detail h1 { font-size: 20px; }
  .escrow-intro h1 { font-size: 24px; }
  .wallet-row { flex-direction: column; }
  .wallet .amt { font-size: 22px; }
  .stepper { overflow-x: auto; padding-bottom: 8px; }
  table { min-width: 560px; }
  .modal { padding: 22px; }
  .search input, .field-group input, .field-group select, .field-group textarea { font-size: 16px; } /* prevent iOS zoom */
  .cart-row { flex-wrap: wrap; }
  .cart-row .ci-spacer { display: none; }
  .footer .cols { grid-template-columns: 1fr; gap: 20px; }
  .persona-grid { grid-template-columns: 1fr; }
}

/* very small phones */
@media (max-width: 380px) {
  .cat-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
}

/* ===================== THEME: form fields + dark mode ===================== */
input, select, textarea { background: var(--surface); color: var(--ink); }

:root[data-theme="dark"] {
  --bg: #0f1310;
  --card: #1a201a;
  --surface: #1a201a;
  --ink: #e7ece5;
  --muted: #9aa49b;
  --line: #2c342c;
  --shadow: 0 2px 10px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 34px rgba(0,0,0,.6);
}
:root[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
:root[data-theme="dark"] .card-img::after,
:root[data-theme="dark"] .main-img::after {
  background: linear-gradient(90deg,#20271f 25%,#2a322a 37%,#20271f 63%);
  background-size: 400% 100%;
}
:root[data-theme="dark"] .card-img, :root[data-theme="dark"] .main-img { background: #222a22; }

/* theme toggle button in the utility bar */
.theme-toggle { background: none; border: 1px solid var(--line); border-radius: 14px; padding: 3px 11px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; margin-left: 6px; white-space: nowrap; }
.theme-toggle:hover { border-color: var(--orange); color: var(--orange); }

/* ===================== Bid History modal ===================== */
.modal.wide { max-width: 680px; }
.bidhist-win { color: var(--green); font-size: 15px; margin: 2px 0 14px; font-weight: 500; }
.bidhist-scroll { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.bidhist { width: 100%; border-collapse: collapse; min-width: 460px; }
.bidhist thead th { position: sticky; top: 0; background: var(--green); color: #fff; text-align: left; padding: 10px 12px; font-size: 13px; }
.bidhist th.amt, .bidhist td.amt { text-align: right; }
.bidhist td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.bidhist tbody tr:nth-child(even) { background: rgba(0,0,0,.025); }
.bidhist tr.lead { background: #9bf0f5; color: #064; font-weight: 700; }
:root[data-theme="dark"] .bidhist tbody tr:nth-child(even) { background: rgba(255,255,255,.035); }
:root[data-theme="dark"] .bidhist tr.lead { background: #0d6b73; color: #d7fbff; }

/* ===================== Sellers directory ===================== */
.avatar-xl { width: 88px; height: 88px; font-size: 34px; }
.viewtoggle { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.viewtoggle button { background: var(--surface); border: none; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.viewtoggle button.active { background: var(--green); color: #fff; }

.seller-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.seller-tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 22px 18px; text-align: center; cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; align-items: center; }
.seller-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.seller-tile h3 { margin: 12px 0 2px; font-size: 16px; }
.stile-rating { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.stile-pitch { font-size: 13px; color: var(--muted); margin: 0 0 12px; min-height: 54px; line-height: 1.4; }
.stile-meta { font-size: 12px; color: var(--green); font-weight: 600; margin-top: auto; }

.seller-list { display: flex; flex-direction: column; gap: 10px; }
.seller-row { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; transition: box-shadow .15s; }
.seller-row:hover { box-shadow: var(--shadow-lg); }
.srow-main { flex: 1; }
.srow-main b { font-size: 15px; }
.srow-main p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.srow-meta { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }

@media (max-width: 1100px) { .seller-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .seller-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .seller-grid { grid-template-columns: 1fr; } .srow-meta { font-size: 12px; } }

/* ===================== Dark mode polish: edges for dark images/buttons ===================== */
:root[data-theme="dark"] {
  /* give media a faint frame so dark photos don't melt into the page */
}
:root[data-theme="dark"] .card-img,
:root[data-theme="dark"] .main-img,
:root[data-theme="dark"] .thumbs .t,
:root[data-theme="dark"] .cart-row img {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
/* ring around avatars so dark/B&W portraits keep a clear circular edge */
:root[data-theme="dark"] .avatar { box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
:root[data-theme="dark"] .avatar-lg,
:root[data-theme="dark"] .avatar-xl { box-shadow: 0 0 0 2px rgba(255,255,255,.22); }

/* cards/tiles get a subtle border since shadows read weakly on a dark bg */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .cat-tile,
:root[data-theme="dark"] .dash-tile,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .hero { border: 1px solid var(--line); }

/* ghost buttons: lift them off the background with a clearer surface + border */
:root[data-theme="dark"] .btn-ghost { background: #252d24; border-color: #3b463a; }
:root[data-theme="dark"] .btn-ghost:hover { border-color: var(--ink); background: #2c352b; }

/* inputs/selects: clearer edge in dark */
:root[data-theme="dark"] .field-group input,
:root[data-theme="dark"] .field-group select,
:root[data-theme="dark"] .field-group textarea,
:root[data-theme="dark"] .price-row input,
:root[data-theme="dark"] #fsort,
:root[data-theme="dark"] .viewtoggle { border-color: #3b463a; }

/* watch heart: darker chip so the light heart reads on light product photos too */
:root[data-theme="dark"] .watch-heart { background: rgba(26,32,26,.85); color: #e7ece5; }
:root[data-theme="dark"] .watch-heart.on { color: #ff6b8a; }

/* ---------- delivery estimate (item page) ---------- */
.delivery-est { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 14px; }
.delivery-est .de-label { color: var(--muted); }
.delivery-est select { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 14px; }
.delivery-est .de-val { margin-left: auto; font-weight: 700; color: var(--green); font-size: 16px; }

/* ===================== FlingBid Verification ===================== */
.verified-badge { position: absolute; bottom: 10px; left: 0; background: #1f8f4e; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .3px; padding: 4px 9px 4px 8px; border-radius: 0 4px 4px 0; z-index: 2; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

.verify-panel { border-radius: 10px; padding: 16px; margin: 4px 0 16px; border: 1px solid var(--line); background: var(--card); }
.verify-panel.verified { border-color: #1f8f4e; background: linear-gradient(0deg, var(--card), var(--card)) padding-box, rgba(31,143,78,.06); }
.verify-panel.pending { border-color: #d9a400; }
.vp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.vp-badge { background: #1f8f4e; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.vp-badge.pending { background: #d9a400; }
.vp-badge.none { background: var(--muted); }
.vp-grade { font-size: 13px; font-weight: 600; color: var(--green); }
.vp-video { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; margin-bottom: 10px; }
.vp-video img { width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.vp-play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; padding-left: 4px; }
.vp-video:hover .vp-play { background: var(--green); }
.vp-vlabel { position: absolute; bottom: 8px; left: 10px; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.vp-report { font-size: 13.5px; color: var(--muted); margin: 4px 0; line-height: 1.5; }
.vp-meta { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.vp-meta b { color: var(--ink); }

/* ---------- no-bids empty state + bid focus flash ---------- */
.descbox.nobids { text-align: center; border: 1px dashed var(--green); background: rgba(47,107,47,.04); }
.descbox.nobids .nb-emoji { font-size: 34px; margin-bottom: 2px; }
.descbox.nobids h3 { margin: 4px 0 6px; }
.descbox.nobids .btn { margin-top: 12px; }
.bidbox.flash-focus { box-shadow: 0 0 0 3px rgba(242,113,28,.55); transition: box-shadow .2s; }

/* ===================== Seller KYC ===================== */
.kyc-chip { display: inline-block; background: #1f8f4e; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; vertical-align: middle; }
.kyc-checks { list-style: none; padding: 0; margin: 16px auto; max-width: 360px; }
.kyc-checks li { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--green); font-weight: 600; }
.kyc-checks li .ref { color: var(--muted); font-weight: 400; margin-left: 6px; }
.kyc-match { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.kyc-match .km-photo { width: 48px; height: 48px; border-radius: 8px; background: #dfe7df; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.kyc-match .km-row { font-weight: 700; color: var(--green); }

/* liveness camera frame */
.liveness-frame { position: relative; width: 240px; height: 240px; margin: 10px auto; border-radius: 50%; overflow: hidden; background: #0c0f0c; border: 3px solid var(--line); }
.liveness-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; transition: opacity .3s; }
.liveness-frame.live video { opacity: 1; }
.liveness-frame.sim { background: radial-gradient(circle, #1b231b, #0c0f0c); }
.liveness-frame .oval { position: absolute; inset: 24px; border: 2px dashed rgba(255,255,255,.5); border-radius: 50%; }
.liveness-frame .scanline { position: absolute; left: 0; right: 0; height: 3px; background: var(--green); box-shadow: 0 0 10px var(--green); top: 0; opacity: 0; }
.liveness-frame.live .scanline, .liveness-frame.sim .scanline { opacity: 1; animation: scan 1.6s ease-in-out infinite; }
.liveness-frame.done .scanline { opacity: 0; }
.liveness-frame.done { border-color: var(--green); }
@keyframes scan { 0% { top: 6%; } 50% { top: 92%; } 100% { top: 6%; } }

/* ---------- KYC evidence dossier ---------- */
.kyc-ev-photos { display: flex; align-items: center; justify-content: center; gap: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.kyc-ev-photo { text-align: center; }
.kyc-ev-photo .km-photo { width: 72px; height: 72px; border-radius: 10px; background: #dfe7df; display: flex; align-items: center; justify-content: center; font-size: 38px; margin-bottom: 4px; }
.kyc-ev-arrow { color: var(--green); font-weight: 700; font-size: 14px; }

/* ---------- KYC exception ---------- */
.status.Exc { background: #d9a400; color: #fff; }
.exc-block { background: #fff8e6; border: 1px solid #e8c35a; border-radius: 8px; padding: 12px 14px; margin: 4px 0 12px; font-size: 13.5px; line-height: 1.6; }
:root[data-theme="dark"] .exc-block { background: #332b12; border-color: #7a6320; }
.exc-block .exc-title { font-weight: 700; color: #a77b00; margin-bottom: 4px; }
:root[data-theme="dark"] .exc-block .exc-title { color: #e8c35a; }
.exc-ctl { display: flex; flex-direction: column; gap: 6px; }
.exc-ctl label { display: flex; gap: 8px; align-items: center; font-size: 13.5px; font-weight: 400; }
