:root {
  --brand: #1b3a6b;
  --brand-600: #132c54;
  --brand-50: #eef2f8;
  --brand-100: #d8e1ef;
  --ink: #171717;
  --ink-2: #3d3d3d;
  --muted: #737373;
  --line: #e7e5e2;
  --line-2: #d4d1cc;
  --soft: #f6f5f3;
  --ok: #1f7a4d;
  --ok-50: #e9f5ef;
  --warn: #9a6100;
  --warn-50: #fdf4e3;
  --err: #c0302b;
  --radius: 6px;
  --wrap: 1280px;
  --hdr-h: 64px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ---------- buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.outline { background: #fff; color: var(--brand); }
.btn.outline:hover { background: var(--brand-50); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--soft); }
.btn.neutral { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn.neutral:hover { background: var(--soft); }
.btn.danger { background: #fff; border-color: var(--line-2); color: var(--err); }
.btn.danger:hover { background: #fdf0ef; }
.btn.block { width: 100%; }
.btn.lg { height: 46px; font-size: 15px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.link { color: var(--brand); font-weight: 600; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: #fff; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.hint { font-size: 12.5px; color: var(--muted); }
.form-error { background: #fdf0ef; color: var(--err); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.input-prefix { position: relative; }
.input-prefix .input { padding-right: 34px; }
.input-prefix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- header */
#hdr { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.hdr { height: var(--hdr-h); display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 26px; letter-spacing: -0.045em; color: var(--brand); flex: none; }
.logo svg { width: 30px; height: 30px; }
.logo .wm { line-height: 1; }
.logo .wm-moj { font-weight: 400; letter-spacing: -0.03em; color: var(--ink); }
.search { flex: 1; display: flex; height: 40px; border-radius: var(--radius); background: var(--soft); max-width: 720px; position: relative; }
.search select { border: 0; background: transparent; padding: 0 30px 0 14px; font-size: 14px; color: var(--ink-2); border-right: 1px solid var(--line-2); border-radius: var(--radius) 0 0 var(--radius); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; outline: none; margin: 8px 0; height: 24px; }
.search .s-in { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; outline: none; height: 100%; color: var(--ink); min-width: 0; }
.hdr-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { position: relative; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg.i { width: 22px; height: 22px; }
.dot-badge { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-sizing: content-box; }
.hdr-user { position: relative; }
.hdr-user > button { display: flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px; border-radius: 30px; color: var(--muted); }
.hdr-user > button:hover { background: var(--soft); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); min-width: 240px; padding: 6px 0; z-index: 50; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; background: none; text-align: left; font-size: 14px; color: var(--ink-2); }
.menu a:hover, .menu button:hover { background: var(--soft); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-head { padding: 10px 16px 12px; display: flex; gap: 12px; align-items: center; }
.menu .menu-head b { display: block; font-size: 15px; color: var(--ink); }

/* category nav + mega menu */
#catnav { border-bottom: 1px solid var(--line); background: #fff; position: relative; z-index: 30; }
.catnav { display: flex; gap: 4px; height: 44px; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.catnav::-webkit-scrollbar { display: none; }
.catnav > .ci { position: static; display: flex; }
.catnav > .ci > a { display: flex; align-items: center; padding: 0 12px; font-size: 14.5px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.catnav > .ci > a:hover, .catnav > .ci > a.on { color: var(--ink); border-bottom-color: var(--ink); }
.catnav > .sep { flex: 1; }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.06); display: none; }
.ci:hover .mega, .ci:focus-within .mega { display: block; }
.mega-in { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding: 24px 20px 28px; }
.mega h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.mega-subs { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 2px 24px; align-content: start; }
.mega-subs a, .mega-all { display: block; padding: 8px 0; font-size: 14.5px; color: var(--ink-2); }
.mega-subs a:hover, .mega-all:hover { color: var(--brand); }
.mega-all { font-weight: 600; color: var(--ink); }
@media (hover: none) { .mega { display: none !important; } }

/* ---------- footer */
#ftr { background: var(--soft); margin-top: 64px; border-top: 1px solid var(--line); }
.ftr { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 40px 20px 28px; }
.ftr h5 { font-size: 13px; margin: 0 0 12px; color: var(--ink); }
.ftr a { display: block; font-size: 14px; color: var(--muted); padding: 4px 0; }
.ftr a:hover { color: var(--ink); }
.ftr-bottom { border-top: 1px solid var(--line); padding: 16px 20px 28px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- item grid / cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 28px 16px; }
.grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.card { position: relative; min-width: 0; }
.card-seller { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-bottom: 8px; height: 22px; overflow: hidden; }
.card-seller:hover span { color: var(--ink); }
.card-seller span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-img { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--soft); border-radius: 4px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card:hover .card-img img { transform: scale(1.025); }
.fav { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 9px; border-radius: 16px; border: 0; background: rgba(255,255,255,.95); color: var(--ink-2); font-size: 13px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.fav svg.i { width: 16px; height: 16px; }
.fav.on { color: var(--brand); }
.fav:hover { color: var(--brand); }
.card-body { display: block; padding-top: 8px; }
.c-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-brand { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-price { font-size: 14px; color: var(--ink); margin-top: 6px; }
.c-incl { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--brand); font-weight: 600; }
.c-incl svg.i { width: 13px; height: 13px; stroke-width: 2.2; }
.status-pill { position: absolute; left: 0; bottom: 0; right: 0; padding: 7px 10px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(23,23,23,.78); }
.status-pill.reserved { background: rgba(154,97,0,.9); }
.status-pill.sold { background: rgba(23,23,23,.82); }
.status-pill.hidden { background: rgba(115,115,115,.9); }

.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; overflow: hidden; }

/* ---------- home */
.hero { position: relative; background: #e4eaf2; overflow: hidden; }
.hero-in { position: relative; height: 440px; display: flex; align-items: center; }
.hero-art { position: absolute; inset: 0 0 0 38%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 28px 28px 28px 0; }
.hero-art > div { border-radius: 6px; overflow: hidden; background: #d6dfeb; }
.hero-art > div:nth-child(1) { transform: translateY(26px); }
.hero-art > div:nth-child(3) { transform: translateY(-22px); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-card { position: relative; z-index: 2; background: #fff; border-radius: 8px; padding: 32px; width: 400px; max-width: 100%; box-shadow: var(--shadow); }
.hero-card h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 22px; }
.hero-card .btn { width: 100%; }
.hero-card .link { display: block; text-align: center; margin-top: 16px; font-size: 14px; }
.section { padding-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; font-weight: 700; }
.section-head a { color: var(--brand); font-weight: 600; font-size: 14px; }
.cat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat-tile { border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 4px; min-height: 92px; justify-content: space-between; transition: border-color .12s, background .12s; }
.cat-tile:hover { border-color: var(--ink); }
.cat-tile b { font-size: 15px; }
.cat-tile span { font-size: 13px; color: var(--muted); }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--brand-50); border-radius: 8px; padding: 20px 24px; margin-top: 24px; }
.welcome h2 { font-size: 19px; margin-bottom: 2px; }
.how-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.how-strip > div { background: var(--soft); border-radius: 8px; padding: 22px; }
.how-strip .num { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--brand); margin-bottom: 12px; border: 1px solid var(--line); }
.how-strip h3 { font-size: 16px; margin-bottom: 6px; }
.how-strip p { color: var(--muted); font-size: 14px; }

/* ---------- catalog */
.cat-head { padding: 24px 0 8px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.cat-head h1 { font-size: 26px; font-weight: 700; }
.subchips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-2); background: #fff; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 0 10px; position: relative; }
.dd { position: relative; }
.dd > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 14px; cursor: pointer; user-select: none; background: #fff; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary:hover { border-color: var(--ink); }
.dd[open] > summary { border-color: var(--ink); }
.dd.active > summary { background: var(--ink); color: #fff; border-color: var(--ink); }
.dd > summary svg.i { width: 16px; height: 16px; }
.dd-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 25; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); min-width: 260px; max-height: 420px; overflow: auto; padding: 8px 0; }
.dd-panel.right { left: auto; right: 0; }
.opt { display: flex; align-items: center; gap: 12px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
.opt:hover { background: var(--soft); }
.opt input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; flex: none; }
.opt .sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2); flex: none; }
.opt .cnt { margin-left: auto; color: var(--muted); font-size: 13px; }
.dd-group { padding: 8px 16px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dd-search { padding: 4px 12px 8px; }
.dd-search .input { height: 36px; }
.size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 12px; min-width: 300px; }
.size-grid label { display: flex; align-items: center; justify-content: center; height: 36px; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 13.5px; cursor: pointer; }
.size-grid input { display: none; }
.size-grid label:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.price-row { display: flex; gap: 8px; padding: 8px 16px 4px; align-items: center; }
.price-row .input { height: 38px; }
.dd-foot { display: flex; justify-content: flex-end; padding: 8px 12px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-bottom: 8px; }
.af { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 12px; border-radius: 16px; background: var(--soft); font-size: 13px; border: 0; color: var(--ink-2); }
.af:hover { background: var(--line); }
.af svg.i { width: 14px; height: 14px; }
.results-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 18px; font-size: 14px; color: var(--muted); }
.more { display: flex; justify-content: center; padding: 32px 0 0; }

.empty { text-align: center; padding: 64px 20px; max-width: 440px; margin: 0 auto; }
.empty .em-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; color: var(--muted); }
.empty .em-ic svg.i { width: 28px; height: 28px; }
.empty h3 { font-size: 19px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 20px; }

/* ---------- item page */
.item-page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; padding-top: 24px; align-items: start; }
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; border-radius: 6px; overflow: hidden; }
.gallery.one { grid-template-columns: 1fr; max-width: 560px; }
.gallery button { border: 0; padding: 0; background: var(--soft); display: block; aspect-ratio: 3/4; overflow: hidden; position: relative; }
.gallery button img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.gallery button:hover img { opacity: .92; }
.gallery .g-side { display: grid; gap: 6px; grid-auto-rows: 1fr; }
.gallery .g-side button { aspect-ratio: auto; }
.gallery .g-main { grid-row: span 1; }
.gallery .g-more { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 22px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.gallery-rest { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.gallery-rest button { border: 0; padding: 0; aspect-ratio: 3/4; background: var(--soft); border-radius: 4px; overflow: hidden; }
.gallery-rest img { width: 100%; height: 100%; object-fit: cover; }
.panel { position: sticky; top: calc(var(--hdr-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.box { border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: #fff; }
.p-price { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.p-price s { font-size: 16px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.p-incl { display: flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 14.5px; margin-top: 4px; }
.p-incl svg.i { width: 16px; height: 16px; }
.p-incl button { margin-left: 2px; }
.details { width: 100%; border-collapse: collapse; margin: 18px 0 4px; font-size: 14px; }
.details td { padding: 6px 0; vertical-align: top; }
.details td:first-child { color: var(--muted); width: 42%; }
.details td:last-child { color: var(--ink); }
.details a { color: var(--brand); }
.p-title { font-size: 17px; font-weight: 600; margin: 16px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.p-desc { white-space: pre-wrap; color: var(--ink-2); font-size: 14.5px; }
.p-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 14px; }
.p-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.prot { display: flex; gap: 12px; align-items: flex-start; background: var(--soft); border-radius: 8px; padding: 14px; font-size: 13.5px; color: var(--ink-2); }
.prot svg.i { color: var(--brand); width: 22px; height: 22px; }
.prot b { display: block; color: var(--ink); margin-bottom: 2px; }
.seller-box { display: flex; align-items: center; gap: 12px; }
.seller-box .sb-name { font-weight: 600; }
.seller-box .sb-name:hover { text-decoration: underline; }
.seller-meta { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.seller-meta div { display: flex; gap: 10px; align-items: center; }
.seller-meta svg.i { width: 17px; height: 17px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: #e0a72e; vertical-align: -2px; }
.stars svg.i { width: 15px; height: 15px; }
.stars .off { color: var(--line-2); }
.rating-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.owner-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.owner-bar .btn { flex: 1; }
.notice { border-radius: 8px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.notice.warn { background: var(--warn-50); color: var(--warn); }
.notice.ok { background: var(--ok-50); color: var(--ok); }
.notice.info { background: var(--soft); color: var(--ink-2); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10,10,10,.94); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 80px); object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lightbox .lb-close { top: 20px; right: 20px; }
.lightbox .lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #bbb; font-size: 14px; }

/* modal */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .12s; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 440px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 20px; }
@keyframes fade { from { opacity: 0; } }
.offer-sugg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.offer-sugg button { border: 1px solid var(--line-2); background: #fff; border-radius: var(--radius); padding: 10px 6px; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.offer-sugg button span { font-size: 12px; color: var(--muted); }
.offer-sugg button.on, .offer-sugg button:hover { border-color: var(--ink); }

/* toast */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 100; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; max-width: calc(100vw - 40px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--err); }

/* ---------- auth */
.auth { max-width: 420px; margin: 48px auto 0; padding: 0 20px; }
.auth h1 { font-size: 26px; margin-bottom: 6px; }
.auth > p { color: var(--muted); margin-bottom: 24px; }
.auth .switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth .terms { font-size: 12.5px; color: var(--muted); margin: -4px 0 16px; }

/* ---------- sell form */
.sell { max-width: 820px; margin: 0 auto; padding-top: 28px; }
.sell h1 { font-size: 26px; margin-bottom: 20px; }
.sell-sec { border: 1px solid var(--line); border-radius: 8px; padding: 24px; margin-bottom: 16px; background: #fff; }
.sell-row { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sell-row:last-child { border-bottom: 0; padding-bottom: 0; }
.sell-row:first-child { padding-top: 0; }
.sell-row > label, .sell-row > .label { padding-top: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.photos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.photo-tile { position: relative; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; background: var(--soft); cursor: grab; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo-tile .pt-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.photo-tile .pt-x svg.i { width: 14px; height: 14px; }
.photo-tile .pt-cover { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px; text-align: center; padding: 4px; font-weight: 600; }
.photo-tile.dragging { opacity: .4; }
.photo-tile.over { outline: 2px solid var(--brand); outline-offset: 2px; }
.photo-add { aspect-ratio: 3/4; border: 1.5px dashed var(--line-2); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 13.5px; cursor: pointer; background: #fff; text-align: center; padding: 8px; }
.photo-add:hover { border-color: var(--brand); background: var(--brand-50); }
.photo-drop { border: 1.5px dashed var(--line-2); border-radius: 8px; padding: 36px 20px; text-align: center; cursor: pointer; transition: all .12s; }
.photo-drop:hover, .photo-drop.drag { border-color: var(--brand); background: var(--brand-50); }
.photo-drop .btn { pointer-events: none; }
.photo-drop p { margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.cond-list { display: flex; flex-direction: column; gap: 8px; }
.cond { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.cond:hover { border-color: var(--ink); }
.cond:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cond input { margin: 3px 0 0; accent-color: var(--ink); width: 17px; height: 17px; }
.cond b { font-weight: 600; font-size: 14.5px; display: block; }
.cond span { font-size: 13px; color: var(--muted); }
.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.color-opt { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 8px; border: 1px solid var(--line-2); border-radius: 18px; cursor: pointer; font-size: 13.5px; }
.color-opt input { display: none; }
.color-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex: none; }
.swatch.multi { background: conic-gradient(#d63b3b, #f2c94c, #2e8b57, #2f6fdb, #7d4cc4, #d63b3b); }
.sell-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 0 0; }
.price-hint { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ---------- profile */
.profile-head { display: grid; grid-template-columns: 160px 1fr auto; gap: 32px; padding: 32px 0 24px; align-items: start; border-bottom: 1px solid var(--line); }
.profile-head h1 { font-size: 26px; margin-bottom: 6px; }
.profile-facts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.profile-facts div { display: flex; gap: 10px; align-items: center; }
.profile-facts svg.i { width: 17px; height: 17px; color: var(--muted); }
.profile-bio { margin-top: 14px; white-space: pre-wrap; color: var(--ink-2); font-size: 14.5px; max-width: 640px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { padding: 14px 14px; font-size: 15px; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on, .tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs .cnt { color: var(--muted); font-weight: 400; margin-left: 4px; }
.review { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.review .r-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.review .r-top b:hover { text-decoration: underline; }
.review p { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; }
.rating-big { display: flex; align-items: center; gap: 16px; padding: 4px 0 18px; }
.rating-big b { font-size: 40px; letter-spacing: -0.03em; }
.rating-big .stars svg.i { width: 22px; height: 22px; }

/* ---------- inbox */
.inbox { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - var(--hdr-h) - 45px); border-left: 1px solid var(--line); border-right: 1px solid var(--line); max-width: var(--wrap); margin: 0 auto; }
.inbox + #ftr, body.inbox-open #ftr { display: none; }
.conv-list { border-right: 1px solid var(--line); overflow-y: auto; }
.conv-list h2 { font-size: 18px; padding: 18px 18px 12px; }
.conv { display: grid; grid-template-columns: 44px 1fr 52px; gap: 12px; padding: 12px 18px; align-items: center; border-bottom: 1px solid var(--line); }
.conv:hover { background: var(--soft); }
.conv.on { background: var(--brand-50); }
.conv .cv-name { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.conv .cv-name small { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; }
.conv .cv-last { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .cv-last { color: var(--ink); font-weight: 600; }
.conv .cv-thumb { width: 52px; height: 52px; border-radius: 4px; object-fit: cover; background: var(--soft); }
.conv .cv-main { min-width: 0; }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.thread-head .back { display: none; }
.thread-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--soft); }
.thread-item img { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; }
.thread-item .ti-main { flex: 1; min-width: 0; font-size: 14px; }
.thread-item .ti-main div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item .ti-actions { display: flex; gap: 8px; }
.msgs { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 72%; padding: 9px 13px; border-radius: 16px; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; align-self: flex-start; background: var(--soft); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.msg-time { font-size: 11.5px; color: var(--muted); align-self: flex-start; margin: 0 4px 8px; }
.msg-time.me { align-self: flex-end; }
.msg-day { align-self: center; font-size: 12px; color: var(--muted); margin: 14px 0 8px; }
.msg-sys { align-self: center; max-width: 520px; text-align: center; font-size: 13px; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.offer-card { align-self: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 240px; background: #fff; margin: 4px 0; }
.offer-card.me { align-self: flex-end; }
.offer-card .oc-label { font-size: 12.5px; color: var(--muted); }
.offer-card .oc-price { font-size: 22px; font-weight: 700; margin: 2px 0 6px; }
.offer-card .oc-price s { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.offer-card .oc-actions { display: flex; gap: 8px; margin-top: 10px; }
.oc-status { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 10px; }
.oc-status.pending { background: var(--warn-50); color: var(--warn); }
.oc-status.accepted { background: var(--ok-50); color: var(--ok); }
.oc-status.declined, .oc-status.superseded { background: var(--soft); color: var(--muted); }
.composer { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; height: 42px; max-height: 140px; min-height: 42px; padding: 10px 14px; border-radius: 21px; }
.composer .btn { border-radius: 21px; height: 42px; }
.thread-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* ---------- orders / checkout */
.page-narrow { max-width: 880px; margin: 0 auto; padding-top: 28px; }
.page-title { font-size: 26px; margin-bottom: 20px; }
.wallet { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.wallet > div { border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
.wallet b { display: block; font-size: 24px; margin-top: 4px; letter-spacing: -0.02em; }
.order-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.order-row img { width: 64px; height: 80px; object-fit: cover; border-radius: 4px; background: var(--soft); }
.order-row .or-title { font-weight: 600; font-size: 15px; }
.order-row .or-meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.order-row .or-right { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge.paid { background: var(--warn-50); color: var(--warn); }
.badge.shipped { background: #e8f0fd; color: #2456a6; }
.badge.completed { background: var(--ok-50); color: var(--ok); }
.badge.cancelled { background: var(--soft); color: var(--muted); }
.badge.action { background: var(--brand); color: #fff; }
.checkout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.checkout h2 { font-size: 17px; margin-bottom: 14px; }
.co-item { display: flex; gap: 14px; align-items: center; }
.co-item img { width: 64px; height: 80px; object-fit: cover; border-radius: 4px; }
.ship-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; margin-bottom: 8px; }
.ship-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ship-opt input { accent-color: var(--ink); margin-top: 3px; width: 17px; height: 17px; }
.ship-opt .so-main { flex: 1; }
.ship-opt b { font-weight: 600; font-size: 14.5px; }
.ship-opt span { display: block; font-size: 13px; color: var(--muted); }
.sum { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.sum td { padding: 6px 0; }
.sum td:last-child { text-align: right; }
.sum tr.total td { border-top: 1px solid var(--line); padding-top: 12px; font-weight: 700; font-size: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); margin: 8px 0 24px; position: relative; }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; color: var(--muted); position: relative; }
.step::before { content: ''; position: absolute; top: 14px; left: -50%; right: 50%; height: 2px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step .s-dot { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; z-index: 1; color: #fff; }
.step .s-dot svg.i { width: 15px; height: 15px; stroke-width: 3; }
.step.done { color: var(--ink); }
.step.done .s-dot { background: var(--ok); border-color: var(--ok); }
.step.done::before { background: var(--ok); }
.step b { font-weight: 600; }
.addr { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.star-input { display: flex; gap: 4px; margin-bottom: 12px; }
.star-input button { border: 0; background: none; padding: 2px; color: var(--line-2); }
.star-input button.on { color: #e0a72e; }
.star-input svg.i { width: 30px; height: 30px; }

/* settings */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding-top: 28px; max-width: 980px; margin: 0 auto; }
.settings-nav a { display: block; padding: 10px 12px; border-radius: var(--radius); font-size: 14.5px; color: var(--ink-2); }
.settings-nav a.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.avatar-edit { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }

/* info pages */
.info { max-width: 760px; margin: 0 auto; padding-top: 36px; }
.info h1 { font-size: 32px; letter-spacing: -0.025em; margin-bottom: 12px; }
.info h2 { font-size: 20px; margin: 36px 0 12px; }
.info p, .info li { color: var(--ink-2); font-size: 15.5px; line-height: 1.65; }
.info ol { padding-left: 20px; }
.info li { margin-bottom: 8px; }
.info .lead { font-size: 18px; color: var(--muted); }

.page-loading { display: flex; justify-content: center; padding: 120px 0; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--soft) 25%, #eeece9 50%, var(--soft) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 4px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsive */
@media (max-width: 1100px) {
  .cat-tiles { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-6 { grid-template-columns: repeat(4, 1fr); }
  .item-page { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
}
@media (max-width: 860px) {
  :root { --hdr-h: 112px; }
  .hdr { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px 12px; }
  .logo { order: 1; }
  .hdr-actions { order: 2; margin-left: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hdr-actions .btn.sell-btn { padding: 0 12px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
  .grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
  .hero-in { height: auto; padding: 24px 0; flex-direction: column; align-items: stretch; }
  .hero-art { position: relative; inset: auto; height: 240px; padding: 0 0 16px; }
  .hero-card { width: 100%; }
  .hero-card h1 { font-size: 26px; }
  .item-page { grid-template-columns: 1fr; }
  .panel { position: static; }
  .gallery { grid-template-columns: 1fr; }
  .gallery .g-side { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .gallery .g-side button { aspect-ratio: 3/4; }
  .sell-row { grid-template-columns: 1fr; gap: 8px; }
  .sell-row > label, .sell-row > .label { padding-top: 0; }
  .photos { grid-template-columns: repeat(3, 1fr); }
  .profile-head { grid-template-columns: 88px 1fr; gap: 18px; }
  .profile-head .ph-actions { grid-column: 1 / -1; }
  .profile-head .avatar { width: 88px !important; height: 88px !important; font-size: 32px !important; }
  .inbox { grid-template-columns: 1fr; height: calc(100vh - var(--hdr-h) - 45px); }
  .inbox.has-thread .conv-list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .thread-head .back { display: inline-flex; }
  .checkout { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; gap: 12px; }
  .settings-nav { display: flex; gap: 4px; overflow-x: auto; }
  .ftr { grid-template-columns: 1fr 1fr; }
  .how-strip { grid-template-columns: 1fr; }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); }
  .welcome { flex-direction: column; align-items: flex-start; }
  .wallet { grid-template-columns: 1fr; }
  .lightbox img { max-width: 100vw; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 14px; }
  .hdr-actions .sell-label { display: none; }
  .search select { display: none; }
  .two { grid-template-columns: 1fr; }
  .dd-panel { position: fixed; left: 12px !important; right: 12px !important; top: auto; bottom: 12px; max-height: 70vh; }
  .size-grid { min-width: 0; }
  .order-row { grid-template-columns: 56px 1fr; }
  .order-row .or-right { grid-column: 2; align-items: flex-start; text-align: left; }
}

/* admin */
.adm-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
table.adm { width: 100%; border-collapse: collapse; font-size: 14px; }
table.adm th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.adm td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.adm tr.banned td { background: #fdf6f5; }
table.adm a:hover { text-decoration: underline; }
@media (max-width: 860px) { .adm-tiles { grid-template-columns: 1fr 1fr; } }
