/* Cashout web. Tokens from the approved Cashout/Strata dark system (2026-11-04).
   House standard: 4 type sizes, 2 weights, one family, 4-point spacing, one accent. */
:root {
  color-scheme: dark;
  --bg: #060510; --surface: #1b1926; --raised: #232130; --sunk: #12101c;
  --text: #f7f7f7; --muted: #a2a3ad; --dim: #a2a3ad;
  --accent: #4a62ee; --accent-hover: #5870f0; --focus: #9aabff;
  --gain: #46d17f; --loss: #ff7a7e; --photo: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* type scale (≈1.25): caption 13, body 16, title 20, display 40 */
  --t-caption: .8125rem; --t-body: 1rem; --t-title: 1.25rem; --t-display: 2.5rem;
  --w-regular: 400; --w-bold: 600;
  /* spacing scale */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s6: 1.5rem; --s8: 2rem; --s12: 3rem; --s16: 4rem;
  --hover: #2c2a3b; --r: 1rem; --r-sm: .5rem; --pill: 999px;
  --col: 37rem; --wide: 60rem;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--w-regular) var(--t-body)/1.5 var(--font); }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { padding: 0; }
img { display: block; }
p, h1, h2, ol, ul { margin: 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--s4); top: var(--s4); z-index: 10; background: var(--accent); padding: var(--s2) var(--s4); border-radius: var(--r-sm); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.caption { font-size: var(--t-caption); color: var(--muted); }
.title { font-size: var(--t-title); font-weight: var(--w-bold); line-height: 1.2; margin: 0; }
.display { font-size: var(--t-display); font-weight: var(--w-bold); line-height: 1.05; letter-spacing: -.02em; margin: 0; }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
  padding: var(--s3) max(var(--s4), env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.mark { font-weight: var(--w-bold); text-decoration: none; margin-right: auto; }
.tabs { display: flex; gap: var(--s1); background: var(--surface); padding: var(--s1); border-radius: var(--pill); }
.tabs a { text-decoration: none; padding: var(--s2) var(--s4); border-radius: var(--pill); color: var(--muted); min-height: 2.75rem; display: grid; place-items: center; }
.tabs a[aria-current="page"] { background: var(--raised); color: var(--text); }
.me { width: 2.75rem; height: 2.75rem; border-radius: var(--pill); border: 0; background: var(--surface) center/cover; cursor: pointer; margin-left: auto; font-weight: var(--w-bold); }
.mark + .tabs { margin-right: auto; }
.menu { position: absolute; right: var(--s4); top: 4rem; background: var(--raised); border-radius: var(--r); padding: var(--s2); min-width: 12rem; }
.menu p { margin: 0; padding: var(--s2) var(--s3); }
.menu button { width: 100%; text-align: left; background: none; border: 0; padding: var(--s3); border-radius: var(--r-sm); cursor: pointer; min-height: 2.75rem; }
.menu button:hover { background: var(--surface); }

main { padding: var(--s4) max(var(--s4), env(safe-area-inset-left)) var(--s16); outline: none; }
.col { max-width: var(--col); margin: 0 auto; }
.wide { max-width: var(--wide); margin: 0 auto; }
.sell { max-width: var(--col); margin: 0 auto; }
.sell .result { margin-top: var(--s3); }
.sell.empty { max-width: var(--col) !important; display: block !important; }
@media (min-width: 64rem) {
  .sell { max-width: 64rem; display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: var(--s4); align-items: start; }
  .sell > [aria-live] { position: sticky; top: 5rem; }
  .sell .result { margin-top: 0; }
}
.foot { text-align: center; padding: 0 var(--s4) var(--s8); }
.loading { color: var(--muted); text-align: center; padding: var(--s16) 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 2.75rem; padding: var(--s2) var(--s6);
  border-radius: var(--pill); border: 0; background: var(--raised); text-decoration: none; cursor: pointer; font-weight: var(--w-bold); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--text); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: var(--s2) 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 2.75rem; }
.link:hover { color: var(--text); }
.icon-btn { width: 2.75rem; height: 2.75rem; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--raised); color: var(--text); }

/* sign in */
.gate { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: var(--s6); max-width: 24rem; margin: 0 auto; }
.gate p { margin: 0; color: var(--muted); }
.gate .note { color: var(--text); background: var(--surface); padding: var(--s3) var(--s4); border-radius: var(--r-sm); }

/* sell card */
.card { background: var(--surface); border-radius: var(--r); padding: var(--s6); }
.card + .card { margin-top: var(--s3); }
.card h1 { margin-bottom: var(--s4); }
.search { position: relative; }
.search input { width: 100%; min-height: 3.25rem; border: 0; border-radius: var(--r-sm); background: var(--sunk); padding: var(--s3) var(--s4); }
.search input::placeholder, textarea::placeholder { color: var(--dim); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + var(--s1)); background: var(--raised); border-radius: var(--r-sm); padding: var(--s1); z-index: 4; list-style: none; margin: 0; max-height: 24rem; overflow: auto; }
.results li { display: flex; gap: var(--s3); align-items: center; padding: var(--s2); border-radius: var(--r-sm); cursor: pointer; min-height: 3.5rem; }
.results li[aria-selected="true"], .results li:hover { background: var(--surface); }
.results .empty { color: var(--muted); cursor: default; }
.thumb { width: 3rem; height: 3rem; flex: none; border-radius: var(--r-sm); background: var(--photo); object-fit: contain; padding: var(--s1); }
.thumb.none { background: var(--raised); display: grid; place-items: center; color: var(--dim); font-size: var(--t-caption); font-weight: var(--w-bold); padding: 0; }
.grow { flex: 1; min-width: 0; }
.name { overflow-wrap: break-word; }
.row-end { text-align: right; flex: none; }

.lines { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s1); }
.line { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; }
.line .meta { margin-top: var(--s1); }
.qty { display: flex; align-items: center; background: var(--sunk); border-radius: var(--pill); flex: none; }
.qty button { width: 2.75rem; height: 2.75rem; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: var(--pill); }
.qty button:hover { color: var(--text); }
.qty input { width: 2.5rem; text-align: center; border: 0; background: none; padding: 0; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.actions { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; margin-top: var(--s2); }
.paste textarea { width: 100%; min-height: 8rem; border: 0; border-radius: var(--r-sm); background: var(--sunk); padding: var(--s3) var(--s4); resize: vertical; margin-top: var(--s3); }
.pick { background: var(--sunk); border-radius: var(--r-sm); padding: var(--s3) var(--s4); margin-top: var(--s2); }
.pick p { margin: 0 0 var(--s2); }
.pick button { display: flex; width: 100%; gap: var(--s3); align-items: center; text-align: left; background: none; border: 0; padding: var(--s2); border-radius: var(--r-sm); cursor: pointer; min-height: 2.75rem; }
.pick button:hover { background: var(--surface); }
.quick { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.chip { border: 0; background: var(--surface); border-radius: var(--pill); padding: var(--s2) var(--s4); min-height: 2.75rem; cursor: pointer; color: var(--text); }
.chip:hover { background: var(--hover); }
.seg .chip { color: var(--muted); }
.seg .chip[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.quick .chip { background: var(--raised); }

/* result */
.result { background: var(--raised); border-radius: var(--r); padding: var(--s6); margin-top: var(--s6); }
.result .display { margin: var(--s1) 0 var(--s2); }
.result-line { margin: 0; }
.route-toggle { margin-top: var(--s4); width: 100%; display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 0; border-radius: var(--r-sm); padding: var(--s3) var(--s4); min-height: 2.75rem; cursor: pointer; text-align: left; }
.route-toggle:hover { background: var(--hover); }
.chev { transition: transform .2s ease; color: var(--muted); width: 1.25rem; height: 1.25rem; flex: none; }
.chev path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[aria-expanded="true"] .chev { transform: rotate(180deg); }
.route { margin-top: var(--s3); display: grid; gap: var(--s3); }
.leg { background: var(--surface); border-radius: var(--r-sm); padding: var(--s4); }
.leg-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; }
.leg ul { list-style: none; margin: var(--s2) 0 var(--s3); padding: 0; display: grid; gap: var(--s2); }
.leg li { display: flex; justify-content: space-between; gap: var(--s3); }
.leg .btn { width: 100%; }
.stale-note { margin: var(--s4) 0 0; }
.warn { margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--surface); border-radius: var(--r-sm); }

/* explore */
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); margin: var(--s4) 0 var(--s4); flex-wrap: wrap; }
.seg { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding-bottom: var(--s1); }
.seg::-webkit-scrollbar { display: none; }
.seg .chip { flex: none; }
.seg + .seg { margin-top: var(--s2); }
.table { list-style: none; margin: var(--s4) 0 0; padding: 0; }
.seg + .caption { margin-top: var(--s4); }
.table li a { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s2); border-radius: var(--r-sm); text-decoration: none; min-height: 4rem; }
.table li a:hover { background: var(--surface); }
.rank { width: 1.5rem; flex: none; color: var(--dim); text-align: right; }
.spark { width: 4.5rem; height: 1.75rem; flex: none; }
.spark path { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark.color.up path { stroke: var(--gain); }
.spark.color.down path { stroke: var(--loss); }
.price { font-weight: var(--w-bold); }
.blank { text-align: center; color: var(--muted); padding: var(--s12) var(--s4); }
@media (max-width: 34rem) {
  .line { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; grid-template-areas: "img info info" "img qty x"; column-gap: var(--s3); row-gap: var(--s2); }
  .line > .thumb { grid-area: img; align-self: start; }
  .line > .grow { grid-area: info; }
  .line > .qty { grid-area: qty; justify-self: start; }
  .line > .icon-btn { grid-area: x; }
}
@media (max-width: 34rem) { .spark { display: none; } .rank { display: none; } .card, .result { padding: var(--s4); } }

/* product */
.back { display: inline-flex; align-items: center; gap: var(--s1); color: var(--muted); text-decoration: none; min-height: 2.75rem; }
.back:hover { color: var(--text); }
.hero { display: grid; grid-template-columns: 9rem 1fr; gap: var(--s6); align-items: start; margin: var(--s4) 0 var(--s8); }
.hero .photo { width: 9rem; height: 9rem; border-radius: var(--r); background: var(--photo); object-fit: contain; padding: var(--s2); }
.hero .photo.none { background: var(--surface); }
.hero .display { margin: var(--s3) 0 var(--s1); }
.hero .btn { margin-top: var(--s4); }
@media (max-width: 34rem) { .hero { grid-template-columns: 1fr; } .hero .photo { width: 100%; height: 14rem; } .hero .btn { width: 100%; } }
section + section { margin-top: var(--s8); }
section > h2 { margin-bottom: var(--s3); }
.chart { width: 100%; height: 9rem; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dot { fill: var(--accent); }
.chart-axis { display: flex; justify-content: space-between; margin-top: var(--s2); }
.bids { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.bids li { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); background: var(--surface); border-radius: var(--r-sm); min-height: 3.5rem; }
.bids li.past { background: transparent; color: var(--muted); }
.bids .best-tag { color: var(--gain); }
.bids a { color: var(--muted); }
.contents { margin: 0; padding: 0; list-style: none; columns: 2; gap: var(--s6); }
.contents li { padding: var(--s1) 0; break-inside: avoid; }
details summary { cursor: pointer; color: var(--muted); min-height: 2.75rem; display: flex; align-items: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
