/* ============================================================
   DiscandDeck — shared styles
   Late-night video store: ink background, hot orange, marquee yellow.
   ============================================================ */

:root {
  --bg: #0e0d12;
  --surface: #17151d;
  --surface-2: #211e29;
  --line: #2f2b39;
  --text: #f4f0e8;
  --muted: #a39dab;
  --accent: #ff5a36;
  --accent-hover: #ff7454;
  --accent-ink: #1b0904;
  --gold: #ffc93c;
  --good: #5fd38d;
  --bad: #ff6b6b;
  --radius: 10px;
  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--gold); color: #000; padding: 8px 12px; border-radius: 6px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: progress; }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14, 13, 18, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.logo-mark { font-family: var(--display); font-size: 26px; letter-spacing: .02em; color: var(--accent); line-height: 1; }
.logo-mark.small { font-size: 18px; }
.logo-sub { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 14px; }
.nav-link { text-decoration: none; font-weight: 500; color: var(--muted); }
.nav-link:hover { color: var(--text); }
@media (max-width: 420px) { .logo-sub { display: none; } }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 48px 0 36px;
  background:
    radial-gradient(900px 300px at 85% -10%, rgba(255, 90, 54, .22), transparent 60%),
    radial-gradient(700px 260px at 0% 110%, rgba(255, 201, 60, .10), transparent 60%);
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 10px; color: var(--gold); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 {
  margin: 0 0 24px; max-width: 18ch;
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(34px, 6.5vw, 64px); line-height: 1.02; letter-spacing: .005em;
}
.search {
  display: flex; gap: 8px; max-width: 640px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px;
}
.search:focus-within { border-color: var(--accent); }
.search input {
  flex: 1; min-width: 0; background: transparent; border: 0; padding: 0 14px; outline: none; font-size: 16px;
}
.search input::placeholder { color: var(--muted); }
.hero-note { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

/* ── Notice ──────────────────────────────────────────────── */
.notice {
  margin-top: 20px; padding: 14px 16px; border-radius: var(--radius);
  background: rgba(255, 201, 60, .08); border: 1px solid rgba(255, 201, 60, .35); font-size: 14px;
}
.notice code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }

/* ── Category chips ──────────────────────────────────────── */
.cats { border-bottom: 1px solid var(--line); }
.cats-inner {
  display: flex; align-items: center; gap: 8px; padding-top: 14px; padding-bottom: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.cats-inner::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-weight: 500; font-size: 14px;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-group {
  flex: none; margin-left: 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}

/* ── Layout ──────────────────────────────────────────────── */
.layout { display: grid; gap: 32px; padding-top: 24px; padding-bottom: 64px; }
@media (min-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr) 340px; } }
main { min-width: 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.result-count { margin: 0; color: var(--muted); font-size: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.select-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
select {
  min-height: 36px; padding: 0 30px 0 12px; border-radius: 8px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a39dab' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
  border: 1px solid var(--line); appearance: none; color: var(--text); font-size: 14px;
}

.new-banner {
  display: block; width: 100%; margin-bottom: 16px; padding: 12px; border-radius: var(--radius);
  background: rgba(255, 90, 54, .12); border: 1px solid rgba(255, 90, 54, .5);
  color: var(--text); font-weight: 600; cursor: pointer;
}
.new-banner[hidden] { display: none; }

/* ── Listing grid ────────────────────────────────────────── */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
@media (min-width: 720px) { .grid { gap: 18px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }

.listing {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.listing:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumb { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center;
  font-family: var(--display); font-size: 22px; text-transform: uppercase; color: var(--line);
}
.cond {
  position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: rgba(14, 13, 18, .85); color: var(--text);
}
.cond-new_sealed { background: var(--gold); color: #1a1400; }
.listing-body { display: flex; flex-direction: column; gap: 3px; padding: 12px; flex: 1; }
.listing-body p { margin: 0; }
.listing-cat { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.listing-title {
  margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.listing-meta { font-size: 13px; color: var(--muted); }
.listing-price { margin-top: auto !important; padding-top: 6px; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ship { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.listing-seller { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars { color: var(--gold); }
.new-seller { color: var(--good); }

.skeleton .thumb, .skeleton .listing-body span {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
.skeleton { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skeleton .listing-body span { display: block; height: 12px; border-radius: 4px; }
.skeleton .listing-body .short { width: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton * { animation: none !important; } .listing { transition: none; } }

.grid-state {
  padding: 48px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.grid-state p { margin: 0 0 16px; }
.load-more-wrap { display: flex; justify-content: center; margin-top: 28px; }

/* ── Earnings calculator ─────────────────────────────────── */
@media (min-width: 980px) { .calc-wrap { position: sticky; top: 88px; align-self: start; } }
.calc {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  border-top: 4px solid var(--accent);
}
.calc-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.calc h2 { margin: 4px 0 18px; font-family: var(--display); font-weight: 400; font-size: 28px; text-transform: uppercase; line-height: 1.1; }

.field { display: block; margin-bottom: 14px; }
.field > span:first-child { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; }
.field select { width: 100%; min-height: 42px; }
.money {
  display: flex; align-items: center; gap: 4px; padding: 0 12px; min-height: 42px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.money:focus-within { border-color: var(--accent); }
.money > span { color: var(--muted); }
.money input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 16px; font-variant-numeric: tabular-nums; }

.ship-service {
  margin: -4px 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2);
  font-size: 13px; display: grid; gap: 2px;
}
.ship-service strong { color: var(--text); }
.ship-service span { color: var(--muted); }

.seg { border: 0; margin: 0 0 14px; padding: 0; }
.seg legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.seg legend { grid-column: 1 / -1; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 8px;
  border: 1px solid var(--line); background: var(--bg); font-size: 14px; font-weight: 500; cursor: pointer; text-align: center;
}
.seg label:first-of-type span { border-radius: 8px 0 0 8px; }
.seg label:last-of-type span { border-radius: 0 8px 8px 0; border-left: 0; }
.seg input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.toggle[hidden] { display: none; }

.calc-out { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.takehome { display: grid; gap: 2px; margin-bottom: 14px; }
.takehome span { font-size: 13px; font-weight: 600; color: var(--muted); }
.takehome strong { font-family: var(--display); font-weight: 400; font-size: 52px; line-height: 1; color: var(--good); font-variant-numeric: tabular-nums; }
.takehome strong.negative { color: var(--bad); }
.takehome small { font-size: 13px; color: var(--muted); }

.breakdown { margin: 0; font-size: 13px; }
.breakdown > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }
.breakdown .bd-sub dt, .breakdown .bd-sub dd { padding-left: 12px; font-size: 12px; opacity: .8; }
.breakdown .bd-total { border-top: 1px solid var(--line); margin-top: 2px; padding-top: 6px; font-weight: 700; }
.breakdown .bd-total dt { color: var(--text); }
.bd-head { margin: 12px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bd-head:first-child { margin-top: 0; }
.calc-foot { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }

/* Wordmark: "and" set smaller in marquee yellow so DiscandDeck reads as three words */
.logo-mark { color: var(--text); }
.logo-and { color: var(--accent); font-size: .62em; margin: 0 .08em; vertical-align: .18em; }

/* ============================================================
   Create / edit listing
   ============================================================ */
.sell-layout { display: grid; gap: 32px; padding-top: 32px; padding-bottom: 96px; }
@media (min-width: 980px) { .sell-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.sell-layout main { min-width: 0; }
.page-title {
  margin: 0 0 20px; font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(32px, 5vw, 48px); line-height: 1.05;
}
.sell-layout .notice { margin: 0 0 20px; }
.notice a { color: var(--gold); }

.gate {
  padding: 32px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  display: grid; gap: 12px; justify-items: start;
}
.gate h2 { margin: 0; font-size: 22px; }
.gate p { margin: 0; color: var(--muted); }
.gate code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; margin-bottom: 18px;
}
@media (min-width: 720px) { .panel { padding: 24px; } }
.panel h2 { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel-head h2 { margin-bottom: 4px; }
.panel-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.counter { font-style: normal; font-weight: 500; font-size: 12px; color: var(--muted); }

/* generic fields */
.panel .field { margin-bottom: 18px; border: 0; padding: 0; min-width: 0; }
.panel .field > span:first-child, .panel .field > legend {
  display: flex; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 600; color: var(--muted);
}
.panel input[type="text"], .panel input[type="number"], .panel textarea, .panel .field select {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 16px;
}
.panel textarea { resize: vertical; line-height: 1.5; min-height: 140px; }
.panel input:focus, .panel textarea:focus, .panel select:focus { outline: none; border-color: var(--accent); }
.panel .money input { border: 0; padding: 0; min-height: 0; background: transparent; }
.panel [aria-invalid="true"], .panel .money:has([aria-invalid="true"]) { border-color: var(--bad) !important; }
.field-error { display: block; min-height: 0; margin-top: 6px; color: var(--bad); font-size: 13px; }
.field-error:empty { display: none; }
.hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: -4px 0 18px; }

/* condition cards */
.cond-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cond-card { position: relative; cursor: pointer; }
.cond-card input { position: absolute; opacity: 0; inset: 0; }
.cond-card > span {
  display: grid; gap: 2px; height: 100%; padding: 10px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); transition: border-color .15s;
}
.cond-card strong { font-size: 14px; }
.cond-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.cond-card:hover > span { border-color: var(--muted); }
.cond-card input:checked + span { border-color: var(--accent); background: rgba(255, 90, 54, .08); }
.cond-card input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* shipping service */
.ship-options { display: grid; gap: 8px; }
@media (min-width: 560px) { .ship-options { grid-template-columns: 1fr 1fr; } }
.ship-option { position: relative; cursor: pointer; }
.ship-option input { position: absolute; opacity: 0; inset: 0; }
.ship-option > span {
  display: grid; gap: 2px; padding: 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
}
.ship-option small { color: var(--muted); font-size: 12px; }
.ship-option input:checked + span { border-color: var(--accent); background: rgba(255, 90, 54, .08); }
.ship-option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.ship-option.is-disabled { cursor: not-allowed; }
.ship-option.is-disabled > span { opacity: .45; text-decoration: line-through; text-decoration-color: var(--muted); }
.ship-rule {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 13px;
  background: rgba(255, 201, 60, .08); border: 1px solid rgba(255, 201, 60, .3);
}
#collectibles-wrap { margin-top: 12px; }
.panel .seg { margin-bottom: 18px; }

/* photos */
.photo-grid {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.photo-grid:empty { display: none; }
.photo {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.photo.is-cover { border: 2px solid var(--accent); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-busy { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.cover-tag {
  position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700;
}
.photo-tools {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8)); padding: 16px 4px 4px;
}
.photo-tools button {
  width: 28px; height: 28px; border-radius: 6px; border: 0; cursor: pointer;
  background: rgba(14, 13, 18, .85); color: var(--text); font-size: 13px; line-height: 1;
}
.photo-tools button:disabled { opacity: .3; cursor: default; }
.photo-tools .danger:hover { background: var(--bad); color: #000; }
.dropzone {
  display: grid; gap: 4px; place-items: center; text-align: center; cursor: pointer;
  padding: 28px 16px; border: 2px dashed var(--line); border-radius: 12px; background: var(--bg);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: rgba(255, 90, 54, .06); }
.dropzone:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.dropzone strong { font-size: 16px; }
.dropzone span { color: var(--muted); font-size: 13px; }

/* actions bar: sticks to the bottom of the screen while filling the form */
.form-actions {
  position: sticky; bottom: 0; z-index: 10; margin: 0 -16px; padding: 12px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(14, 13, 18, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .form-actions { margin: 0; border: 1px solid var(--line); border-radius: 14px; } }
.form-status { margin: 0; font-size: 14px; color: var(--muted); flex: 1 1 200px; }
.form-status[data-kind="error"] { color: var(--bad); }
.form-status[data-kind="ok"] { color: var(--good); }
.form-buttons { display: flex; gap: 10px; flex: 1 1 auto; justify-content: flex-end; }
@media (max-width: 480px) { .form-buttons .btn { flex: 1; } }

.calc-out.flush { margin-top: 0; padding-top: 0; border-top: 0; }
.promo-note { margin: 12px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: rgba(95, 211, 141, .1); color: var(--good); }
/* phones: show take-home in the sticky action bar (full panel is below the form) */
.mini-net { margin: 0; font-size: 13px; color: var(--muted); flex-basis: 100%; }
.mini-net strong { color: var(--good); font-size: 16px; margin-left: 4px; font-variant-numeric: tabular-nums; }
@media (min-width: 980px) { .mini-net { display: none; } }

/* ============================================================
   Listing detail
   ============================================================ */
.crumbs { display: flex; gap: 8px; align-items: center; padding: 18px 0 0; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.page-state { margin: 32px 0 80px; }

.item-skeleton { display: grid; gap: 24px; padding: 24px 0 80px; }
@media (min-width: 900px) { .item-skeleton { grid-template-columns: minmax(0, 1fr) 400px; } }
.sk { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 12px; }
.sk-photo { aspect-ratio: 1; }
.sk-col { display: grid; gap: 14px; align-content: start; }
.sk-line { height: 18px; } .w60 { width: 60%; } .w90 { width: 90%; } .w40 { width: 40%; }
.sk-box { height: 220px; }

.item {
  display: grid; gap: 24px 40px; padding-top: 16px; padding-bottom: 80px;
  grid-template-areas: "banner" "gallery" "buy" "details";
}
@media (min-width: 900px) {
  .item { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "banner banner" "gallery buy" "details buy"; }
  .buybox { position: sticky; top: 84px; align-self: start; }
}
.status-banner { grid-area: banner; padding: 12px 16px; border-radius: 10px; font-size: 14px;
  background: rgba(255, 201, 60, .08); border: 1px solid rgba(255, 201, 60, .35); }
.status-banner[data-kind="sold"] { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .4); }
.status-banner a { color: var(--gold); }
.gallery { grid-area: gallery; min-width: 0; }
.buybox { grid-area: buy; min-width: 0; }
.item-details { grid-area: details; min-width: 0; }

/* gallery */
.gallery-main {
  position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); touch-action: pan-y;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.gal-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(14, 13, 18, .8); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer;
}
.gal-nav.prev { left: 10px; } .gal-nav.next { right: 10px; }
.gal-nav:hover { border-color: var(--accent); }
.single .gal-nav, .single .gal-count { display: none; }
.gal-count { position: absolute; left: 12px; bottom: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(14, 13, 18, .8); font-size: 12px; }
.gal-count:empty { display: none; }
.gal-zoom { position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(14, 13, 18, .8); color: var(--text); cursor: pointer; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.g-thumb { flex: none; width: 68px; height: 68px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: var(--surface); opacity: .6; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-thumb[aria-selected="true"] { border-color: var(--accent); opacity: 1; }
.g-thumb:hover { opacity: 1; }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .94); }
.lightbox::backdrop { background: rgba(0, 0, 0, .8); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.lb-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(14, 13, 18, .8); color: var(--text); font-size: 18px; cursor: pointer; }

/* buy box */
.buybox .eyebrow { margin-bottom: 6px; }
.item-title { margin: 0 0 12px; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.15; font-weight: 700; }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.tag-cond { background: var(--text); color: var(--bg); border-color: var(--text); }
.tag-cond.cond-new_sealed { background: var(--gold); border-color: var(--gold); color: #1a1400; }
.item-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 16px; }
.item-price strong { font-family: var(--display); font-weight: 400; font-size: 48px; line-height: 1; font-variant-numeric: tabular-nums; }
.item-price span { color: var(--muted); font-size: 14px; }
.buy-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.buy-actions.solo > :first-child { grid-column: 1 / -1; }
.btn-lg { min-height: 52px; font-size: 16px; }
.btn.is-static { cursor: default; grid-column: 1 / -1; }
.buy-note { margin: 10px 0 18px; font-size: 12px; color: var(--muted); }
.buy-breakdown { padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.offer-status { margin-bottom: 12px; padding: 12px 14px; border-radius: 10px; font-size: 14px;
  background: rgba(255, 201, 60, .08); border: 1px solid rgba(255, 201, 60, .35); }
.offer-status[data-kind="accepted"] { background: rgba(95, 211, 141, .1); border-color: rgba(95, 211, 141, .45); }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; cursor: pointer; font-size: inherit; }

.ship-card { padding: 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.ship-card p { margin: 0; }
.ship-card-head { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px !important; }
.ship-card-method { font-weight: 600; }
.ship-card-eta { margin-top: 4px !important; font-size: 14px; }
.ship-card-eta strong { color: var(--good); }
.ship-card-eta:empty { display: none; }
.ship-card-note { margin-top: 6px !important; font-size: 13px; color: var(--muted); }

.seller-card { padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.seller-top { display: flex; gap: 12px; align-items: center; }
.avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 20px; color: var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.seller-name { margin: 0; font-weight: 700; }
.seller-name a { text-decoration: none; } .seller-name a:hover { text-decoration: underline; }
.seller-handle { margin: 0; font-size: 13px; color: var(--muted); }
.verified { display: inline-flex; gap: 6px; align-items: center; margin: 12px 0 0; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--good); background: rgba(95, 211, 141, .1); border: 1px solid rgba(95, 211, 141, .35); }
.seller-rating { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
.seller-rating span:not(.stars-bar):not(.stars-fill) { color: var(--muted); }
.stars-bar { position: relative; display: inline-block; font-size: 15px; line-height: 1; letter-spacing: 2px; color: var(--line); }
.stars-bar::before { content: "★★★★★"; }
.stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--gold); }
.stars-fill::before { content: "★★★★★"; }
.seller-stats { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }

/* details */
.item-details h2 { margin: 28px 0 10px; font-size: 18px; }
.item-details h2:first-child { margin-top: 0; }
.cond-detail { margin: 0; color: var(--muted); }
.cond-detail strong { color: var(--text); }
.item-desc { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }
.muted { color: var(--muted); margin: 0; }
.specs { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.specs > div { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.specs > div:first-child { border-top: 0; }
.specs > div:nth-child(odd) { background: var(--surface); }
.specs dt { color: var(--muted); } .specs dd { margin: 0; }
.reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.review { padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.review-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.review p { margin: 6px 0 0; font-size: 14px; }

/* modal */
.modal { width: min(460px, calc(100vw - 32px)); padding: 24px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); }
.modal::backdrop { background: rgba(0, 0, 0, .65); }
.modal h2 { margin: 0 0 4px; font-size: 22px; }
.modal-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.modal .field { margin-bottom: 14px; }
.modal .field > span:first-child { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.modal textarea { width: 100%; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 16px; resize: vertical; }
.modal textarea:focus { outline: none; border-color: var(--accent); }
.modal .breakdown:not(:empty) { padding: 10px 12px; border-radius: 10px; background: var(--bg); margin-bottom: 12px; }
.modal-fine { margin: 0 0 16px; font-size: 12px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.offers-toggle { align-items: flex-start; margin: -4px 0 18px; }
.offers-toggle input { margin-top: 2px; flex: none; }
.offers-toggle small { display: block; color: var(--muted); font-size: 12px; }
#reviews-wrap { margin-top: 28px; }

/* ============================================================
   Checkout + order confirmation
   ============================================================ */
.checkout, .confirm { padding-top: 24px; padding-bottom: 80px; max-width: 880px; }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--text); }
.co-loading { padding: 40px 0; color: var(--muted); }
.co-grid, .oc-grid { display: grid; gap: 16px; }
@media (min-width: 760px) {
  .co-grid { grid-template-columns: 1fr 1fr; }
  .co-item { grid-column: 1 / -1; }
  .co-pay { grid-column: 2; grid-row: 2 / span 2; }
  .oc-grid { grid-template-columns: 1fr 1fr; }
  .oc-grid .co-item { grid-column: 1 / -1; }
}
.co-grid .panel, .oc-grid .panel { margin: 0; }
.co-item { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
.co-thumb { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.co-thumb img { width: 100%; height: 100%; object-fit: cover; }
.co-thumb .thumb-fallback { font-size: 14px; }
.co-title { margin: 2px 0 4px; font-size: 18px; }
.co-title a { text-decoration: none; } .co-title a:hover { text-decoration: underline; }
.co-meta { margin: 0; color: var(--muted); font-size: 14px; }
.co-offer { margin: 8px 0 0; font-size: 14px; color: var(--good); }
.co-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.co-ship p { margin: 0; }
.co-pay .breakdown { margin-bottom: 16px; }
.co-error { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; font-size: 14px;
  background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .45); }
.co-error[data-kind="info"] { background: var(--surface-2); border-color: var(--line); }
.paypal-buttons { min-height: 110px; }
.paypal-buttons.is-busy { opacity: .4; pointer-events: none; }
.co-busy { margin: 8px 0 0; font-weight: 600; color: var(--gold); }
.gate .btn + .btn { margin-left: 8px; }

.oc-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 24px; }
.oc-check { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; font-weight: 700; background: var(--good); color: #062512; }
.oc-hero[data-status="pending"] .oc-check { background: var(--gold); color: #1a1400; }
.oc-hero[data-status="refunded"] .oc-check, .oc-hero[data-status="disputed"] .oc-check { background: var(--surface-2); color: var(--muted); }
.oc-hero .page-title { margin-bottom: 4px; }
.oc-sub { margin: 0; color: var(--muted); }
.oc-address { font-style: normal; line-height: 1.6; margin-bottom: 12px; }
.oc-steps { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 10px; color: var(--muted); }
.oc-steps strong { color: var(--text); }
.oc-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   Sign in
   ============================================================ */
.auth-wrap { display: grid; place-items: start center; padding: 48px 16px 80px; min-height: calc(100dvh - 65px); }
.auth-card { width: 100%; max-width: 420px; padding: 28px 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.auth-tabs button { min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.auth-title { margin: 0 0 6px; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 32px; line-height: 1.05; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.auth-card .field { display: block; margin-bottom: 16px; }
.auth-card .field > span:first-child { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-card input { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 16px; }
.auth-card input:focus { outline: none; border-color: var(--accent); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 13px; cursor: pointer; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-msg { margin-bottom: 16px; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .45); }
.auth-msg[data-kind="ok"] { background: rgba(95, 211, 141, .1); border-color: rgba(95, 211, 141, .45); }
.auth-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin: 16px 0 0; font-size: 14px; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============================================================
   Dashboard
   ============================================================ */
.dash { padding-top: 24px; padding-bottom: 80px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dash-head .page-title { margin: 0; }
.paypal-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px;
  padding: 14px 16px; border-radius: 12px; background: rgba(255, 201, 60, .08); border: 1px solid rgba(255, 201, 60, .4); }
.paypal-banner span { display: block; color: var(--muted); font-size: 14px; }
.stat-row { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-family: var(--display); font-weight: 400; font-size: 30px; font-variant-numeric: tabular-nums; }
.stat.hot strong { color: var(--accent); }
.dash-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 20px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 12px 14px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.dash-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; line-height: 20px; text-align: center; }
.badge[hidden] { display: none; }
.d-h2 { margin: 26px 0 12px; font-size: 16px; }
.d-h2:first-child { margin-top: 0; }
.d-none { margin: 0 0 8px; color: var(--muted); }
.seg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.d-list, .d-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.d-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 720px) { .d-row { grid-template-columns: 56px 1fr auto; } }
.d-row.is-closed { opacity: .65; }
.d-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.d-thumb img { width: 100%; height: 100%; object-fit: cover; }
.d-thumb span { font-size: 9px; color: var(--muted); text-align: center; padding: 2px; }
.d-main { min-width: 0; }
.d-title { margin: 0; font-weight: 600; text-decoration: none; display: block; overflow-wrap: anywhere; }
a.d-title:hover { text-decoration: underline; }
.d-title a { text-decoration: underline; }
.d-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.d-meta a { color: var(--gold); }
.d-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }
.d-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (min-width: 720px) { .d-actions { grid-column: auto; justify-content: flex-end; } }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: var(--bad); border-color: rgba(255, 107, 107, .4); }
.d-empty { padding: 36px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.d-empty p { margin: 0 0 14px; }
.d-closed { margin-top: 10px; }
.d-closed summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.pill-paid, .pill-pending { color: var(--gold); border-color: rgba(255, 201, 60, .45); }
.pill-shipped, .pill-delivered { color: #8fb8ff; border-color: rgba(143, 184, 255, .45); }
.pill-completed, .pill-accepted { color: var(--good); border-color: rgba(95, 211, 141, .45); }
.pill-refunded, .pill-disputed, .pill-late { color: var(--bad); border-color: rgba(255, 107, 107, .45); }
.pill-closed { color: var(--muted); }

.ship-order { padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ship-order-head { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.ship-order-head .pill { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 720px) { .ship-order-head { grid-template-columns: 56px 1fr auto; } .ship-order-head .pill { grid-column: auto; } }
.ship-order-body { display: grid; gap: 14px; margin: 14px 0; padding: 14px; border-radius: 10px; background: var(--bg); }
@media (min-width: 560px) { .ship-order-body { grid-template-columns: 1.4fr 1fr; } }
.d-label { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.d-address { font-style: normal; line-height: 1.55; margin-bottom: 6px; }
.d-plain { margin: 0; }
.ship-form { display: grid; gap: 10px; align-items: end; }
@media (min-width: 560px) { .ship-form { grid-template-columns: 1fr auto; } }
.ship-form .field { margin: 0; }
.ship-form .field span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ship-form input, .rate-form textarea, .settings-grid input:not([type="checkbox"]):not([type="file"]), .settings-grid textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 16px; }
.ship-form input:focus, .rate-form textarea:focus, .settings-grid input:not([type="checkbox"]):focus, .settings-grid textarea:focus { outline: none; border-color: var(--accent); }

.rate-form { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--bg); display: grid; gap: 8px; max-width: 460px; }
.rate-form textarea { min-height: 0; font-size: 14px; }
.rate-form .btn { justify-self: start; }
.rate-stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rate-stars label { position: relative; cursor: pointer; font-size: 26px; line-height: 1; color: var(--line); }
.rate-stars input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rate-stars label:has(input:checked), .rate-stars label:has(input:checked) ~ label,
.rate-stars label:hover, .rate-stars label:hover ~ label { color: var(--gold); }
.rate-stars label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.settings-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.settings-grid .panel { margin-bottom: 16px; }
.settings-grid .field { display: block; margin-bottom: 14px; }
.settings-grid .field > span:first-child { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.settings-grid textarea { resize: vertical; }
.pp-status { margin: 0 0 6px; font-weight: 600; }
.pp-status.ok { color: var(--good); }
.pp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pp-issues { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: rgba(255, 201, 60, .08); border: 1px solid rgba(255, 201, 60, .4); }
.pp-issues p { margin: 0 0 4px; } .pp-issues ul { margin: 0; padding-left: 18px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px);
  padding: 12px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast[data-kind="error"] { background: var(--bad); color: #1a0000; }

/* ============================================================
   Public profile
   ============================================================ */
.profile { padding-top: 28px; padding-bottom: 80px; }
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-bottom: 24px; }
.profile-head .avatar { width: 80px; height: 80px; font-size: 32px; }
.profile-name { margin: 0; font-size: clamp(24px, 4vw, 34px); }
.profile-handle { margin: 2px 0 8px; color: var(--muted); }
.profile-bio { max-width: 640px; margin: 0 0 24px; white-space: pre-line; overflow-wrap: anywhere; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.profile h2 { margin: 28px 0 14px; font-size: 18px; }

/* ============================================================
   Listing Q&A + order thread
   ============================================================ */
.qa { margin-top: 28px; }
.qa h2 .muted { font-weight: 400; }
.qa-list, .thread { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.qa-item, .msg { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: start; padding: 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); }
.qa-item.is-seller { border-color: rgba(255, 90, 54, .45); background: rgba(255, 90, 54, .05); }
.qa-item.is-hidden { opacity: .55; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.qa-meta { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.qa-meta strong { color: var(--text); }
.qa-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
.qa-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.qa-hide { font-size: 12px; color: var(--muted); }
.qa-empty { color: var(--muted); padding: 4px 0; }
.qa-form textarea { width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 16px; resize: vertical; }
.qa-form textarea:focus { outline: none; border-color: var(--accent); }
.qa-form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.qa-form-row small { font-size: 12px; }
.qa a, .muted a { color: var(--gold); }

/* ── Order page ── */
.order-page { padding-top: 24px; padding-bottom: 80px; max-width: 1040px; }
.op-head { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; margin: 6px 0 18px; }
.op-thumb { width: 72px; }
.op-title { margin: 0 0 4px; font-size: clamp(20px, 3vw, 28px); line-height: 1.2; }
.timeline { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.timeline li { position: relative; display: grid; gap: 2px; padding-top: 18px; font-size: 13px; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--line); }
.timeline .dot { position: absolute; top: 1px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.timeline li.done { color: var(--text); }
.timeline li.done::before, .timeline li.done .dot { background: var(--good); }
.timeline li.problem .dot, .timeline li.problem::before { background: var(--bad); }
.timeline small { color: var(--muted); }
.op-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .op-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.op-grid .panel { margin-bottom: 16px; }
.ship-tabs { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 4px 0 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.ship-tabs button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.ship-tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.parcel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 560px) { .parcel-grid { grid-template-columns: repeat(4, 1fr); } }
.parcel-form .field, .manual-form .field { display: block; margin: 0; }
.manual-form { display: grid; gap: 10px; align-items: end; }
@media (min-width: 560px) { .manual-form { grid-template-columns: 140px 1fr auto; } }
.parcel-form .field > span, .manual-form .field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.parcel-form input, .manual-form input, .manual-form select { width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 16px; }
.rates { display: grid; gap: 8px; margin-top: 14px; }
.rate-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; }
.rate-opt:has(input:checked) { border-color: var(--accent); background: rgba(255, 90, 54, .06); }
.rate-opt small { display: block; color: var(--muted); font-size: 12px; }
.rate-opt input { accent-color: var(--accent); }
.rates .btn { justify-self: start; margin-top: 4px; }
.track-box { margin: 4px 0 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.track-box p { margin: 0 0 4px; }
.track-num a { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.track-status { font-size: 14px; }
.track-status[data-status="DELIVERED"] { color: var(--good); }
.track-status[data-status="FAILURE"], .track-status[data-status="RETURNED"] { color: var(--bad); }
.d-empty.slim { padding: 18px; }
.d-empty.slim .btn { margin: 4px; }
.thread-note { margin: -8px 0 12px; }
.msg.mine { border-color: rgba(143, 184, 255, .35); }
.person { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.person .d-label { margin: 0; }
.person a { color: var(--text); font-weight: 600; }

/* ── Settings additions ── */
.avatar-row { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.avatar-row .avatar { width: 64px; height: 64px; font-size: 26px; }
.addr-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.addr-grid .full { grid-column: 1 / -1; }
.settings-grid select { width: 100%; min-height: 44px; padding: 0 30px 0 12px; }

/* ── Legal pages, footers ── */
.legal { max-width: 760px; padding-top: 32px; padding-bottom: 80px; line-height: 1.65; }
.legal h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(32px, 5vw, 48px); margin: 0 0 4px; }
.legal h2 { margin: 32px 0 8px; font-size: 20px; }
.legal h3 { margin: 18px 0 6px; font-size: 16px; color: var(--muted); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--gold); }
.legal-date { color: var(--muted); margin: 0 0 20px; }
.legal-draft { padding: 12px 14px; border-radius: 10px; background: rgba(255, 201, 60, .12); border: 1px solid rgba(255, 201, 60, .5); }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--text); }
.auth-fine { margin: 16px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.auth-fine a, .hint a { color: var(--gold); }
.ship-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   Admin
   ============================================================ */
.admin { padding-top: 24px; padding-bottom: 80px; }
.ad-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ad-controls .seg-chips { margin: 0; }
.stat small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.ad-charts { display: grid; gap: 16px; margin: 18px 0; }
@media (min-width: 900px) { .ad-charts { grid-template-columns: 1fr 1fr; } }
.ad-charts .panel, .admin .panel { margin: 0 0 16px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: var(--gold); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.chart-empty { position: absolute; inset: 0 0 40px 52px; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 14px; pointer-events: none; }
.chart-data { margin-top: 8px; font-size: 13px; }
.chart-data summary { cursor: pointer; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ad-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ad-table td small { display: block; font-size: 12px; }
.ad-table a { color: var(--text); }
.ad-table code { font-size: 12px; color: var(--muted); }
.ad-table.compact td { padding: 4px 8px; }
.ad-actions { white-space: nowrap; text-align: right; }
.ad-actions .btn { margin-right: 6px; }
.removed-why { color: var(--bad); }
.share { display: inline-block; width: 80px; height: 8px; border-radius: 4px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.share span { display: block; height: 100%; background: var(--accent); }
.ad-search { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ad-search input { flex: 1 1 260px; min-height: 42px; padding: 0 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 16px; }
.ad-search select { min-height: 42px; }

/* Homepage: recently listed */
.recent-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.recent-head h2 { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 28px; }
.quick-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.suspended-note { margin-bottom: 16px; }
.empty-big { font-size: 18px; font-weight: 600; color: var(--text); }
.dash-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
