/* xprhub.com/market (2026-11-08, store redesign 2026-11-09): browse, item, store and seller pages, plus the base the Tasks and
   My orders pages share (panel, btn, note, fields, filters...). The hub's purple look, the same tokens as swaps.css. Chain and
   seller text wraps instead of pushing the page sideways. Store layouts use their own classes (shop-, pcard, pdp, store-, hub-). */
:root {
  --bg: #0d0a17; --panel: #17112a; --panel2: #1e1636; --well: #0f0b1c; --line: #2e2350;
  --white: #f6f4ff; --muted: #a9a0c9; --purple: #7543e3; --purple-hi: #9b7bff; --live: #4ade80; --bad: #ff8f8f; --warn: #fbbf24;
  --stars: #fbbf24;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: radial-gradient(1200px 600px at 85% -10%, rgba(117, 67, 227, .28), transparent 60%), var(--bg); color: var(--white); font: 16px/1.55 var(--font); min-height: 100vh; overflow-x: hidden; display: flex; flex-direction: column; }
main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
a { color: var(--purple-hi); }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; margin: 0 0 10px; }
h2 { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 17px; max-width: 44em; margin: 0 0 18px; }
.muted, .hint { color: var(--muted); font-size: 14px; }
.wrap { overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.note { margin: 10px 0; padding: 10px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.note.bad { color: var(--bad); border-color: var(--bad); }
.note.good { color: var(--live); border-color: var(--live); }
:focus-visible { outline: 3px solid var(--purple-hi); outline-offset: 2px; }

/* filters (the Tasks job board keeps this grid) */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; margin: 0 0 18px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.filters .check { flex-direction: row; align-items: center; gap: 8px; color: var(--white); font-size: 14px; }
input, select, textarea, button { font: inherit; }
input[type="search"], input[type="text"], input[type="number"], input[type="datetime-local"], select, textarea { background: var(--well); color: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--purple-hi); outline: none; box-shadow: 0 0 0 3px rgba(155, 123, 255, .25); }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--purple); width: 16px; height: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--purple); color: #fff; border: 1px solid var(--purple); border-radius: 12px; padding: 12px 20px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: #8455f0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--purple-hi); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--purple-hi); background: rgba(155, 123, 255, .08); }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--bad); }

/* old card grid (kept for anything that still renders .card) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.badges { margin: 0; display: flex; gap: 6px; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(155, 123, 255, .18); color: var(--purple-hi); }
.badge.out { background: rgba(255, 143, 143, .15); color: var(--bad); }
.empty { color: var(--muted); padding: 24px 0; }
.more { margin: 22px 0 0; text-align: center; }

/* shared page parts */
.crumbs { margin: 0 0 14px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--white); text-decoration: underline; }
.crumbs .sep { opacity: .5; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 14px; }
.panel h2 { font-size: 16px; color: var(--purple-hi); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.fields label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.code-row { display: flex; gap: 8px; }
.fee-lines p { margin: 4px 0; color: var(--muted); font-size: 13px; }
.desc p { margin: 0 0 12px; overflow-wrap: anywhere; }
.records { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 16px; margin: 0; padding: 0; list-style: none; }
.reviews { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.review { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.review p { margin: 4px 0; }
.review .stars { font-weight: 700; color: var(--stars); }
.review .reply { margin: 8px 0 0 12px; padding-left: 10px; border-left: 2px solid var(--line); color: var(--muted); }
.rules summary { cursor: pointer; font-weight: 700; }
.rules ul { color: var(--muted); }
.stars { color: var(--stars); letter-spacing: 1px; }
.report .btn { padding: 0; border: 0; background: none; color: var(--muted); font-weight: 500; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.report .btn[type="submit"] { padding: 9px 14px; border: 1px solid var(--line); text-decoration: none; color: var(--purple-hi); }
.report form { margin-top: 8px; }

/* ================= market home: search, categories, filter rail, product grid ================= */
.shop-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.shop-head h1 { margin: 0; }
.shop-links { display: flex; gap: 8px; flex-wrap: wrap; }
.searchbar { display: flex; gap: 8px; margin: 0 0 14px; }
.searchbar input[type="search"] { flex: 1; font-size: 17px; padding: 14px 16px 14px 46px; border-radius: 14px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a9a0c9' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px 50%; }
.searchbar .btn { border-radius: 14px; padding: 0 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px; margin: 0 -2px 18px; }
.chip-btn { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--white); border-radius: 999px; padding: 8px 15px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip-btn:hover { border-color: var(--purple-hi); }
.chip-btn[aria-pressed="true"] { background: var(--white); color: var(--bg); border-color: var(--white); }
.shop { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.rail { position: sticky; top: 16px; }
.rail summary { display: none; }
.rail-body { display: grid; gap: 18px; }
.rail-group { display: grid; gap: 8px; }
.rail-title { margin: 0; font-size: 14px; font-weight: 700; }
.rail label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.rail .check { flex-direction: row; align-items: center; gap: 9px; color: var(--white); font-size: 14px; cursor: pointer; }
.price-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; color: var(--muted); }
.protect { padding: 14px; border-radius: 14px; background: rgba(74, 222, 128, .06); border: 1px solid rgba(74, 222, 128, .25); font-size: 13px; color: var(--muted); }
.protect strong { display: block; color: var(--white); font-size: 14px; margin-bottom: 4px; }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; min-height: 40px; }
.results-bar .hint { margin: 0; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.sort select { width: auto; padding: 7px 10px; }

/* the product card: no box, the photo and the price carry it */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 18px; margin: 0; padding: 0; list-style: none; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pcard-photo { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.pcard:hover .pcard-photo img { transform: scale(1.03); }
.pcard-photo .nophoto { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.pcard-flag { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 8px; background: rgba(13, 10, 23, .82); color: var(--white); backdrop-filter: blur(4px); }
.pcard-flag.sale { background: var(--warn); color: #1a1205; }
.pcard-flag.out { background: rgba(13, 10, 23, .88); color: var(--bad); }
.pcard.soldout .pcard-photo img { filter: grayscale(.7) brightness(.7); }
.pcard-title { margin: 4px 0 0; font-size: 15px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pcard-title a { color: var(--white); text-decoration: none; }
.pcard-title a::after { content: ""; position: absolute; inset: 0; } /* the whole card is the link; the seller link sits above it */
.pcard-title a:focus-visible { outline: none; }
.pcard:focus-within .pcard-photo { outline: 3px solid var(--purple-hi); outline-offset: 2px; }
.pcard-price { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 20px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pcard-price s { font-size: 14px; font-weight: 500; color: var(--muted); }
.pcard-coin { margin: -4px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pcard-meta { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.pcard-meta a { position: relative; z-index: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-meta a:hover { color: var(--white); }
.pcard-meta .stars { flex: none; }

/* how buying works: a real sequence */
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 44px 0 18px; padding: 0; list-style: none; border-top: 1px solid var(--line); counter-reset: how; }
.how li { counter-increment: how; padding: 18px 20px 0 0; font-size: 14px; color: var(--muted); }
.how li::before { content: counter(how); display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-bottom: 10px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); color: var(--white); font-weight: 800; font-size: 14px; }
.how strong { display: block; color: var(--white); font-size: 15px; margin-bottom: 4px; }

/* ================= item page ================= */
/* phone: photos, buy box, description, seller; wide: photos, description and seller on the left, the buy box sticky on the right */
.pdp { display: grid; gap: 30px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "buy" "about" "seller"; align-items: start; }
.pdp > .gallery { grid-area: gallery; } .pdp > .buybox { grid-area: buy; } .pdp > .about { grid-area: about; } .pdp > .seller-card { grid-area: seller; }
@media (min-width: 880px) { .pdp { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "gallery buy" "about buy" "seller buy"; grid-template-rows: auto auto 1fr; gap: 30px 36px; } }
.gallery .big { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--panel2); border: 1px solid var(--line); border-radius: 16px; display: block; }
.gallery .nobig { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; background: var(--panel2); border: 1px solid var(--line); border-radius: 16px; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumbs button { border: 2px solid var(--line); background: none; padding: 0; border-radius: 10px; overflow: hidden; width: 76px; height: 57px; cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--purple-hi); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.buybox { display: grid; gap: 14px; }
@media (min-width: 880px) { .buybox { position: sticky; top: 16px; } }
.buybox h1 { font-size: clamp(24px, 3.2vw, 30px); margin: 0; overflow-wrap: anywhere; }
.byline { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.byline a { color: var(--white); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(155, 123, 255, .16); color: var(--purple-hi); }
.tag.instant { background: rgba(74, 222, 128, .14); color: var(--live); }
.pricebox { padding: 16px 0 2px; border-top: 1px solid var(--line); }
.price-xl { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; font-size: 38px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price-xl s { font-size: 18px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-xl .save { font-size: 13px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: var(--warn); color: #1a1205; letter-spacing: 0; }
.price-sub { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ship-line { margin: 6px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(74, 222, 128, .18); }
.buy-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 14px; }
.buy-card fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.buy-card legend { padding: 0; margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--well); cursor: pointer; min-width: 96px; }
.opt-chip input { position: absolute; opacity: 0; pointer-events: none; }
.opt-chip .o-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.opt-chip .o-price { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt-chip .o-price s { margin-left: 4px; }
.opt-chip:hover { border-color: var(--purple-hi); }
.opt-chip:has(input:checked) { border-color: var(--purple-hi); background: rgba(117, 67, 227, .2); box-shadow: inset 0 0 0 1px var(--purple-hi); }
.opt-chip:has(input:focus-visible) { outline: 3px solid var(--purple-hi); outline-offset: 2px; }
.opt-chip.sold { opacity: .45; cursor: not-allowed; }
.opt-chip.sold .o-name { text-decoration: line-through; }
.stock-line { margin: 8px 0 0; font-size: 13px; color: var(--live); }
.stock-line.low { color: var(--warn); }
.buy-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
.buy-row label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.codebox summary { cursor: pointer; font-size: 14px; color: var(--purple-hi); }
.codebox .code-row { margin-top: 8px; }
.buy-card .btn.buy { width: 100%; font-size: 17px; padding: 15px 20px; }
.buy-card .note { margin: 0; }
.trust { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.trust li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.trust li::before { content: ""; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: rgba(74, 222, 128, .14) 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='%234ade80' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center; }
.trust strong { color: var(--white); font-weight: 600; }
.section-title { font-size: 20px; margin: 0 0 12px; }
.seller-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 14px; align-content: start; }
.seller-card .btn { justify-self: start; }
.seller-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.seller-top h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.seller-top p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), #3b1f86); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; overflow: hidden; text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.facts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px 14px; font-size: 13px; color: var(--muted); }
.facts strong { display: block; color: var(--white); font-size: 15px; font-variant-numeric: tabular-nums; }
.ship-form { background: var(--panel); border: 1px solid var(--purple-hi); border-radius: 16px; padding: 18px; }
.ship-form h2 { font-size: 18px; color: var(--white); }

/* ================= store page ================= */
.store-banner { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 26px; margin: 0 0 18px; border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(117, 67, 227, .32), rgba(23, 17, 42, .9) 55%), var(--panel); }
.store-banner .avatar { width: 92px; height: 92px; font-size: 36px; border: 3px solid rgba(246, 244, 255, .14); }
.store-banner h1 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 4px; overflow-wrap: anywhere; }
.store-rating { margin: 0; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.store-banner .bio { margin: 10px 0 0; color: var(--white); opacity: .88; max-width: 60ch; overflow-wrap: anywhere; }
.store-side { display: grid; gap: 10px; justify-items: end; align-self: start; }
.store-stats { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 22px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.store-stats li { flex: 1 1 140px; padding: 12px 16px; border-left: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.store-stats li:first-child { border-left: 0; }
.store-stats strong { display: block; font-size: 18px; color: var(--white); font-variant-numeric: tabular-nums; }
.anchor-nav { display: flex; gap: 22px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.anchor-nav a { padding: 10px 0; color: var(--muted); text-decoration: none; font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.anchor-nav a:hover, .anchor-nav a[aria-current="true"] { color: var(--white); border-bottom-color: var(--purple-hi); }
.store-section { margin: 0 0 34px; scroll-margin-top: 16px; }

/* ================= seller hub ================= */
.hub-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 6px; }
.hub-head h1 { margin: 0; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-store { margin: 0 0 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(74, 222, 128, .14); color: var(--live); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.away, .pill.paused { background: rgba(251, 191, 36, .14); color: var(--warn); }
.pill.none, .pill.closed { background: rgba(169, 160, 201, .14); color: var(--muted); }
.pill.need { background: rgba(155, 123, 255, .18); color: var(--purple-hi); }
.hub-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 20px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap; }
.hub-tab:hover { color: var(--white); }
.hub-tab[aria-selected="true"] { color: var(--white); border-bottom-color: var(--purple-hi); }
.hub-tab .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--panel2); color: var(--white); font-size: 12px; text-align: center; }
.hub-tab .count:empty { display: none; }
.tab-panel { margin: 0 0 14px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 22px; padding: 0; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.stat-row > li { padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.stat-row > li:first-child { border-left: 0; }
.stat-label { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.stat-value { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-list { margin: 0; padding: 0; list-style: none; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-list .muted { font-weight: 500; }
.stat-row .btn { margin-top: 10px; }
.subhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.subhead h2 { margin: 0; font-size: 18px; }

/* listings as rows */
.ltable { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }
.lrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px 120px; gap: 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.lrow.order { grid-template-columns: 64px minmax(0, 1fr) 170px 110px; }
.lrow:first-child { border-top: 0; }
.lrow-head { padding-top: 10px; padding-bottom: 10px; font-size: 12px; color: var(--muted); font-weight: 700; background: var(--panel2); }
.lthumb { width: 64px; height: 48px; border-radius: 9px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.lthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ltitle { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.ltitle a { color: var(--white); text-decoration: none; }
.ltitle a:hover { text-decoration: underline; }
.lmeta { margin: 3px 0 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.lprice { font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lstock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.lactions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }

/* the listing form: numbered steps (a real sequence) beside a live preview */
.lform { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; align-items: start; }
.lform-main { min-width: 0; }
.lform-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.lform-head h2 { margin: 0; font-size: 22px; color: var(--white); }
.lform-main { counter-reset: step; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin: 0 0 14px; }
.step:not([hidden]) { counter-increment: step; }
.step-title .n::before { content: counter(step); }
.step h4 { margin: 18px 0 2px; font-size: 15px; }
.step > .muted { margin: 2px 0 0; }
.step-title { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font-size: 17px; }
.step-title .n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 14px; font-weight: 800; }
.step label.stack { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 0; }
.coin-grid .check { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--well); font-size: 14px; cursor: pointer; }
.coin-grid .check:has(input:checked) { border-color: var(--purple-hi); background: rgba(117, 67, 227, .16); }
.coin-grid .check:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.opt-panel { background: var(--well); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 12px 0 0; }
.opt-panel legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.photo-grid li { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .first::after { content: "Cover"; position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: rgba(13, 10, 23, .85); color: var(--white); }
.photo-grid button { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(13, 10, 23, .85); color: var(--white); cursor: pointer; font-size: 16px; line-height: 1; }
.photo-add { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 14px; cursor: pointer; text-align: center; }
.photo-add:hover { border-color: var(--purple-hi); color: var(--white); }
.photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-add:focus-within { outline: 3px solid var(--purple-hi); outline-offset: 2px; }
.lform-foot { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.lform-side { position: sticky; top: 16px; display: grid; gap: 10px; }
.lform-side .pcard { pointer-events: none; }
.lform-side .hint { margin: 0; }

/* orders in the hub */
.order-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 0 0 12px; }
.order-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.order-top h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.order-card .btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.order-card .code-row { margin-top: 8px; }

/* phones and narrow screens */
@media (max-width: 860px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
  .chips::-webkit-scrollbar { display: none; }
  .shop { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rail { position: static; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
  .rail summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; }
  .rail summary::-webkit-details-marker { display: none; }
  .rail summary::after { content: "Show"; font-size: 13px; color: var(--purple-hi); font-weight: 600; }
  .rail[open] summary::after { content: "Hide"; }
  .rail-body { padding: 0 14px 14px; }
  .lform { grid-template-columns: minmax(0, 1fr); }
  .lform-side { display: none; } /* the preview is a wide-screen aid; on a phone the form comes first */
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row > li:nth-child(3) { border-left: 0; }
  .stat-row > li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .lrow, .lrow.order { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .lrow-head { display: none; }
  .lrow .lstock { display: none; }
  .lrow:not(.order) .lprice { display: none; }
  .lrow.order .lprice { display: none; }
  .store-banner { grid-template-columns: auto minmax(0, 1fr); }
  .store-side { grid-column: 1 / -1; justify-items: start; }
}
@media (max-width: 520px) {
  .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .pcard-price { font-size: 17px; }
  .searchbar .btn { padding: 0 16px; }
  .how { grid-template-columns: minmax(0, 1fr); }
  .how li { padding-right: 0; }
  .price-xl { font-size: 32px; }
  .store-banner { padding: 18px; gap: 14px; }
  .store-banner .avatar { width: 64px; height: 64px; font-size: 26px; }
  .stat-value { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .pcard-photo img { transition: none; } .pcard:hover .pcard-photo img { transform: none; } }
