/* traderust.com - styled on the RustProfit satellite design system
   (app/static/css/_tokens.css + _shared.css, the same tokens rust.wiki uses):
   Play font, the shared site blue #5471b9, navy cards, dimmed background art.
   Values are copied (not imported) so the exchange ships as a standalone app;
   keep them in sync with _tokens.css if the wiki's palette changes. */
:root {
  --bg-base: #0e0f15; --bg-modal: rgb(29, 31, 44); --bg-header: rgb(30, 33, 45); --bg-card: #1e2133;
  --bg-surface: rgb(36, 38, 48); --bg-panel: rgb(45, 47, 64); --bg-input: rgb(20, 22, 33);
  --accent: #5471b9; --accent-hover: #6080cc; --accent-soft: rgba(84, 113, 185, 0.18); --accent-border: rgba(84, 113, 185, 0.45);
  --green: #3dba6f; --green-soft: rgba(61, 186, 111, 0.14); --danger: #e05252; --danger-soft: rgba(224, 82, 82, 0.14);
  --warning: #c49038; --warning-soft: rgba(196, 144, 56, 0.15);
  --text: #e8eaf0; --text-2: #cccccc; --dim: rgb(146, 147, 166); --muted: #626678;
  --border: rgba(255, 255, 255, 0.06); --border-strong: rgb(64, 67, 92); --shadow: rgba(0, 0, 0, 0.25);
  --r-s: 6px; --r-m: 8px; --r-l: 12px;
  /* aliases used by page scripts (order-book depth bars, dividers) */
  --buy: var(--green); --sell: var(--danger); --line: var(--border);
}
* { box-sizing: border-box; }
html { background: var(--bg-modal); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text);
  font: 14px/1.5 'Play', sans-serif; background-color: var(--bg-modal);
  background-image: linear-gradient(rgba(29, 31, 44, .97), rgba(29, 31, 44, .97)), url('/static/assets/background.webp');
  background-size: cover; background-position: center; background-attachment: fixed;
}
a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: #8ca8e8; }
.muted { color: var(--dim) !important; }
.buy { color: var(--green) !important; } .sell { color: var(--danger) !important; } .warn { color: var(--warning) !important; }
.num { font-variant-numeric: tabular-nums; }
h1 { font-size: 23px; font-weight: 700; margin: 0 0 4px; } h2 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: .2px; }
code { color: #b0b8ff; }

/* header - same shape as the satellite .site-header */
.tr-head { display: flex; align-items: center; gap: 28px; padding: 13px 24px; background: var(--bg-header); box-shadow: 0 2px 2px -2px var(--shadow); position: sticky; top: 0; z-index: 30; flex-wrap: wrap; }
.tr-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); white-space: nowrap; letter-spacing: .3px; }
.tr-brand:hover { color: var(--text); }
.tr-brand img { width: 28px; height: 28px; border-radius: var(--r-s); }
.tr-brand span span { color: var(--accent); }
.tr-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.tr-nav a { font-size: 12px; font-weight: 700; color: var(--text-2); padding: 4px 0; border-bottom: 2px solid transparent; text-transform: uppercase; letter-spacing: .6px; }
.tr-nav a:hover { color: var(--text); }
.tr-nav a.on { color: var(--text); border-bottom-color: var(--accent); }
.tr-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tr-bal { background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--r-m); padding: 5px 12px; font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.tr-bal:hover { border-color: var(--accent-border); color: var(--text); }
.tr-bal::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.tr-user { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.tr-user img { width: 28px; height: 28px; border-radius: 50%; }
/* account menu: avatar top right, Inventory / Orders / Wallet / Log out */
.tr-menu { position: relative; }
.tr-menu > summary { list-style: none; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: var(--r-m); border: 1px solid transparent; user-select: none; }
.tr-menu > summary::-webkit-details-marker { display: none; }
.tr-menu > summary:hover, .tr-menu[open] > summary { background: var(--bg-input); border-color: var(--border-strong); color: var(--text); }
.tr-menu > summary.on { color: var(--text); }
.tr-ava { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.tr-menu > summary.on img, .tr-menu > summary.on .tr-ava { box-shadow: 0 0 0 2px var(--accent); }
.tr-menu > summary svg { transition: transform .15s; }
.tr-menu[open] > summary svg { transform: rotate(180deg); }
.tr-uname { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; max-width: calc(100vw - 32px); background: var(--bg-modal); border: 1px solid var(--border-strong); border-radius: var(--r-m); box-shadow: 0 8px 24px var(--shadow); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.tr-menu-list a { padding: 8px 12px; border-radius: var(--r-s); color: var(--text-2); font-size: 13px; font-weight: 600; }
.tr-menu-list a:hover { background: var(--bg-input); color: var(--text); }
.tr-menu-list a.on { color: var(--text); background: var(--accent-soft); }
/* deposits & withdrawals list */
.xfer .xf-ico { width: 40px; height: 40px; border-radius: var(--r-s); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 18px; background: var(--bg-input); position: relative; }
.xfer .xf-ico.in { color: var(--green); }
.xfer .xf-ico.out { color: var(--danger); }
.xfer .xf-ico.sk img { width: 40px; height: 40px; }
.xfer .xf-ico.sk::after { position: absolute; right: -4px; bottom: -4px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--bg-modal); border: 1px solid var(--border-strong); }
.xfer .xf-ico.sk.in::after { content: '↓'; }
.xfer .xf-ico.sk.out::after { content: '↑'; }
.xfer .nm small code { font-size: 11.5px; color: var(--text-2); }
.xfer .nm small.d-block { white-space: normal; }
.tr-menu-list hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--border); opacity: 1; }
.devbar { background: rgba(196, 144, 56, .12); color: #e3c58f; border-bottom: 1px solid rgba(196, 144, 56, .3); font-size: 12.5px; padding: 6px 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.devbar a { color: #f1d6a3; text-decoration: underline; }

main { flex: 1; width: 100%; padding: 22px 24px 60px; max-width: 1480px; margin: 0 auto; }
.tr-foot { background: var(--bg-header); box-shadow: 0 -2px 2px -2px var(--shadow); color: var(--muted); font-size: 12.5px; padding: 18px 24px; display: flex; gap: 18px; flex-wrap: wrap; }
.tr-foot a { color: var(--dim); } .tr-foot a:hover { color: var(--text); }

/* surfaces */
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-l); box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 6px 18px rgba(0, 0, 0, .18); }
.panel-h { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-b { padding: 14px 16px; }
.hero-note { color: var(--dim); margin: 0 0 16px; max-width: 980px; }

/* controls */
.btn-tr { background: var(--accent); border: 0; color: #fff; font: 700 14px 'Play', sans-serif; border-radius: var(--r-m); padding: 9px 18px; cursor: pointer; transition: background .12s; display: inline-block; }
.btn-tr:hover { background: var(--accent-hover); color: #fff; }
.btn-tr:disabled { background: var(--bg-panel); color: var(--muted); cursor: not-allowed; }
.btn-ghost { background: var(--bg-surface); border: 1px solid var(--border-strong); color: var(--text-2); border-radius: var(--r-s); padding: 5px 11px; cursor: pointer; font: 13px 'Play', sans-serif; }
.btn-ghost:hover { border-color: var(--accent-border); color: var(--text); }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.btn-buy, .btn-sell { border: 0; border-radius: var(--r-m); padding: 8px 12px; font: 700 13.5px 'Play', sans-serif; cursor: pointer; }
.btn-buy { background: var(--green); color: #06180d; } .btn-buy:hover { background: #4fcf82; }
.btn-sell { background: var(--danger); color: #fff; } .btn-sell:hover { background: #ec6767; }
.btn-buy:disabled, .btn-sell:disabled { background: var(--bg-panel); color: var(--muted); cursor: not-allowed; }
input.tr-in, select.tr-in { background: var(--bg-input); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--r-m); padding: 7px 10px; width: 100%; font: 13.5px 'Play', sans-serif; }
input.tr-in:focus, select.tr-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-soft); }
input.tr-in::placeholder { color: var(--muted); }
label.tr-l { color: var(--dim); font-size: 12px; display: block; margin-bottom: 4px; }
.seg { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--r-m); padding: 2px; }
.seg button { background: none; border: 0; color: var(--dim); padding: 4px 11px; border-radius: var(--r-s); font: 12.5px 'Play', sans-serif; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.seg button:not(.on):hover { color: var(--text); }
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; background: var(--bg-surface); border: 1px solid var(--border-strong); color: var(--dim); white-space: nowrap; }
.pill.ok { color: var(--green); border-color: rgba(61, 186, 111, .4); background: var(--green-soft); }
.pill.bad { color: var(--danger); border-color: rgba(224, 82, 82, .4); background: var(--danger-soft); }
.pill.wait { color: var(--warning); border-color: rgba(196, 144, 56, .4); background: var(--warning-soft); }

/* list rows */
.skin { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.skin:last-child { border-bottom: 0; }
.skin img { width: 40px; height: 40px; object-fit: contain; background: var(--bg-input); border-radius: var(--r-s); flex: none; }
.skin .nm { flex: 1; min-width: 0; }
.skin .nm b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.skin .nm small { color: var(--dim); }
.skin .px { text-align: right; white-space: nowrap; font-weight: 700; }
.skin .px small { display: block; color: var(--dim); font-size: 11.5px; font-weight: 400; }
.list { max-height: 560px; overflow-y: auto; }
.empty { color: var(--dim); padding: 26px 16px; text-align: center; }
.note { font-size: 12.5px; color: var(--dim); }
.note.warn { color: var(--warning); }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px; }
.x:hover { color: var(--danger); }
.qty { width: 62px !important; text-align: center; padding: 4px 6px !important; }

/* tables */
table.tr-t { width: 100%; border-collapse: collapse; }
table.tr-t th { text-align: left; color: var(--dim); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
table.tr-t td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tr-t tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.r { text-align: right; }
table.tr-t th.r { text-align: right; }      /* beat the th rule above - right-aligned number columns get right-aligned headers */
.book td, .book th { padding: 4px 12px; font-size: 13px; }
.book td { position: relative; }
.book .bar { position: absolute; right: 0; top: 2px; bottom: 2px; opacity: .13; pointer-events: none; border-radius: 3px 0 0 3px; }
.spread { text-align: center; color: var(--dim); padding: 7px; font-size: 12.5px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-input); }

/* kpis + toasts */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi .panel { padding: 13px 16px; }
.kpi b { display: block; font-size: 21px; margin: 2px 0; }
.kpi small { color: var(--dim); }
.toast-tr { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast-tr div { background: var(--bg-panel); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: var(--r-m); max-width: 400px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.toast-tr div.err { border-left-color: var(--danger); } .toast-tr div.ok { border-left-color: var(--green); }

/* ── shared page pieces ── */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--dim); margin: 2px 0 0; max-width: 760px; }
.page-head .act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; }
.tabs button { background: none; border: 0; color: var(--dim); font: 700 13px 'Play', sans-serif; padding: 11px 12px 9px; border-bottom: 2px solid transparent; cursor: pointer; text-transform: uppercase; letter-spacing: .5px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs button .cnt { background: var(--bg-input); color: var(--dim); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--bg-input); border: 1px solid var(--border-strong); color: var(--text-2); border-radius: 999px; padding: 4px 12px; font: 12.5px 'Play', sans-serif; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--accent-border); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: #c9d6f5; }
.stepper { display: inline-flex; align-items: center; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--r-m); overflow: hidden; }
.stepper button { background: none; border: 0; color: var(--text-2); width: 28px; height: 28px; font: 700 16px 'Play', sans-serif; cursor: pointer; }
.stepper button:hover { background: var(--bg-surface); color: var(--text); }
.stepper input { width: 40px; background: none; border: 0; color: var(--text); text-align: center; font: 700 13px 'Play', sans-serif; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }
.hero-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hero-stat .panel { padding: 16px 18px; }
.hero-stat small { color: var(--dim); text-transform: uppercase; letter-spacing: .5px; font-size: 11.5px; font-weight: 700; }
.hero-stat b { display: block; font-size: 26px; margin-top: 2px; }
.hero-stat .sub { color: var(--dim); font-size: 12.5px; }
.bulkbar { position: sticky; bottom: 14px; z-index: 25; margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--bg-panel); border: 1px solid var(--accent-border); border-radius: var(--r-l); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.bulkbar[hidden] { display: none; }
.offer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.offer:last-child { border-bottom: 0; }
.offer .ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; }
.offer .ico.in, .ico-sm.in { background: var(--green-soft); color: var(--green); } .offer .ico.out, .ico-sm.out { background: var(--danger-soft); color: var(--danger); }
.ico-sm { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 15px; }
.offer .thumbs { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.offer .thumbs img { width: 30px; height: 30px; object-fit: contain; background: var(--bg-input); border-radius: 5px; }
.offer .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.steps-line { display: flex; gap: 6px; align-items: center; color: var(--dim); font-size: 12.5px; flex-wrap: wrap; }
.steps-line b { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: #c9d6f5; font-size: 11px; }
.steps-line .sep { color: var(--muted); margin: 0 4px; }

/* ── trade screen ── */
/* The trade window is a FIXED-size box (owner 2026-10-27: "i don't want the
   page to jump around when i click on items") - picking skins never changes
   its height; the zones scroll inside it instead. */
.twin { display: grid; grid-template-columns: minmax(0, 1fr) 250px minmax(0, 1fr); gap: 0; margin-bottom: 18px; overflow: hidden; height: 330px; }
@media (max-width: 1000px) { .twin { grid-template-columns: minmax(0, 1fr); height: auto; } .twin .zone { height: 250px; } }
.zone { padding: 14px 16px 16px; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.zone > div:last-child { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.zone + .mid { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
@media (max-width: 1000px) { .zone + .mid { border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); } }
.zone .zh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.zone .zh h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .7px; color: var(--dim); }
.zone .zh .tot { margin-left: auto; font-size: 22px; font-weight: 700; }
.zone .zh .clr { background: none; border: 0; color: var(--muted); font: 12px 'Play', sans-serif; cursor: pointer; padding: 0; }
.zone .zh .clr:hover { color: var(--danger); }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); grid-auto-rows: 200px; gap: 8px; align-content: start; flex: 1; min-height: 0; overflow-y: auto; padding: 2px 4px 2px 2px; }
.zone-empty { flex: 1; border: 2px dashed var(--border-strong); border-radius: var(--r-l); display: grid; place-items: center; text-align: center; color: var(--dim); padding: 22px; font-size: 13px; }
.zone-empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 3px; }
.zone.give .zone-empty { border-color: rgba(224, 82, 82, .28); } .zone.get .zone-empty { border-color: rgba(61, 186, 111, .28); }
.stile { position: relative; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--r-m); padding: 8px 8px 9px; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 200px; overflow: hidden; }
.stile .stepper { margin-top: auto; }
.zone.give .stile { border-top: 2px solid var(--danger); } .zone.get .stile { border-top: 2px solid var(--green); }
.stile img { width: 50px; height: 50px; object-fit: contain; flex: none; }
.stile .sn { font-size: 11.5px; color: var(--text-2); width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stile .sp { font-weight: 700; font-size: 14px; }
.stile .sp small { display: block; font-weight: 400; color: var(--dim); font-size: 10.5px; }
.stile .rm { position: absolute; top: 3px; right: 5px; background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; line-height: 1; }
.stile .rm:hover { color: var(--danger); }
.stile .sb { position: absolute; top: 5px; left: 5px; font-size: 9.5px; padding: 0 5px; border-radius: 4px; background: var(--accent-soft); color: #8ca8e8; border: 1px solid var(--accent-border); line-height: 14px; }
.stile .mode { background: none; border: 0; color: var(--accent-hover); font: 11px 'Play', sans-serif; cursor: pointer; padding: 0; text-decoration: underline dotted; }
.stile .lim { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--dim); }
.stile .lim input { width: 66px; background: var(--bg-card); border: 1px solid var(--accent-border); color: var(--text); border-radius: 5px; font: 700 12px 'Play', sans-serif; padding: 2px 5px; text-align: right; }
.stile.warn { border-color: var(--warning); }
.stile .wmsg { font-size: 10.5px; color: var(--warning); text-align: center; }
.mid { padding: 16px; display: flex; flex-direction: column; justify-content: center; gap: 9px; background: rgba(0, 0, 0, .1); text-align: center; overflow: hidden; }
.mid #res-sub { min-height: 34px; }
.mid #go-note { height: 34px; overflow: hidden; }
.mid .swapicon { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-border); display: grid; place-items: center; color: #8ca8e8; font-size: 20px; }
.mid .lbl { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.mid .big { font-size: 27px; font-weight: 700; line-height: 1.1; }
.mid .go { width: 100%; padding: 13px; font-size: 16px; }
.twin.changed { animation: trchanged 1.6s ease-out; }
@keyframes trchanged { 0%, 30% { box-shadow: 0 0 0 2px var(--warning), 0 0 28px rgba(196, 144, 56, .35); } 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); } }
.mid .fine { font-size: 11.5px; color: var(--dim); }
.mid select.tr-in { padding: 4px 8px; font-size: 12px; }
.dual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .dual { grid-template-columns: minmax(0, 1fr); } }
.dual .panel-h h2 { display: flex; align-items: center; gap: 8px; }
.dual .panel-h h2::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--danger); }
.dual section:last-child .panel-h h2::before { background: var(--green); }
.filters-tr { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); background: rgba(0, 0, 0, .08); }
.filters-tr .tr-in { width: auto; flex: 1 1 120px; min-width: 0; }
.filters-tr .pr { flex: 0 1 88px; }
.grid-tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 9px; padding: 12px 14px; max-height: 640px; overflow-y: auto; align-content: start; }
.grid-tr::-webkit-scrollbar, .zone-grid::-webkit-scrollbar { width: 8px; } .grid-tr::-webkit-scrollbar-thumb, .zone-grid::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.tile { position: relative; background: linear-gradient(180deg, var(--bg-surface), #1a1d2b); border: 1px solid var(--border); border-radius: var(--r-m); padding: 22px 8px 8px; cursor: pointer; text-align: center; user-select: none; transition: border-color .12s, transform .12s, box-shadow .12s; }
.tile:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, .3); }
.tile.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 16px rgba(84, 113, 185, .25); }
.tile.dim { opacity: .5; }
.tile.dim .add-hint { display: none; }
.tile img { width: 76px; height: 76px; object-fit: contain; display: block; margin: 0 auto 8px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.tile .tp { font-weight: 700; font-size: 14.5px; }
.tile .tn { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.tile .qb { position: absolute; top: 6px; right: 7px; font-size: 11px; color: var(--dim); font-weight: 700; }
.tile .sb { position: absolute; top: 6px; left: 6px; font-size: 10px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: #8ca8e8; border: 1px solid var(--accent-border); line-height: 15px; }
.tile .picked { position: absolute; bottom: 6px; right: 6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 19px; padding: 0 6px; line-height: 19px; }
.tile .add-hint { position: absolute; inset: 0; border-radius: var(--r-m); display: grid; place-items: center; background: rgba(84, 113, 185, .78); color: #fff; font-weight: 700; font-size: 13px; opacity: 0; transition: opacity .12s; }
.tile:hover .add-hint { opacity: 1; }
.tile.check::after { content: '✓'; position: absolute; top: 5px; left: 6px; width: 18px; height: 18px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 12px; line-height: 18px; }
.more { text-align: center; padding: 6px 0 14px; }

@media (max-width: 600px) {
  main { padding: 14px 16px 50px; }
  .tr-head, .devbar, .tr-foot { padding-left: 16px; padding-right: 16px; }
  .tr-head { gap: 12px; }
  .tr-uname { display: none; }
  .hero-stat.compact { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-stat.compact .panel { padding: 12px 14px; }
  .hero-stat.compact b { font-size: 20px; }
}

/* ── skin page: stats strip + charts ── */
.statstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.statstrip > div { padding: 12px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.statstrip > div:last-child { border-right: 0; }
.statstrip small { color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.statstrip b { font-size: 19px; }
.statstrip span { font-size: 12.5px; }
@media (max-width: 760px) { .statstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .statstrip > div:nth-child(2) { border-right: 0; } .statstrip > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); } }
.chart-wrap { position: relative; height: 360px; padding: 12px 10px 4px 6px; }
@media (max-width: 600px) { .chart-wrap { height: 260px; } }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); }
.chart-legend { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 14px 12px; }
.chart-legend .lg { background: var(--bg-input); border: 1px solid var(--border-strong); color: var(--text-2); border-radius: 999px; padding: 2px 10px 2px 8px; font: 12px 'Play', sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .lg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-legend .lg.off { opacity: .4; text-decoration: line-through; }

/* ── confirmation pop-up ── */
.trm-back { position: fixed; inset: 0; z-index: 80; background: rgba(8, 9, 14, .66); display: grid; place-items: center; padding: 16px; animation: trmfade .12s ease-out; }
@keyframes trmfade { from { opacity: 0; } to { opacity: 1; } }
.trm { width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--r-l); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.trm-h { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.trm-h h2 { font-size: 17px; margin: 0; flex: 1; }
.trm-b { padding: 14px 18px; overflow-y: auto; }
.trm-b.flash { animation: trmflash 1.2s ease-out; }
@keyframes trmflash { 0%, 25% { background: rgba(196, 144, 56, .14); } 100% { background: transparent; } }
.trm-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.trm-f .btn-tr, .trm-f .btn-sell { min-width: 130px; }
.trm-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.trm-row:last-child { border-bottom: 0; }
.trm-row img { width: 34px; height: 34px; object-fit: contain; }
.trm-row .nm { flex: 1; min-width: 0; }
.trm-row .nm small { display: block; color: var(--dim); }
.trm-sec { font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; margin: 10px 0 2px; }
.trm-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.trm-total b { font-size: 22px; }

/* ── API docs ─────────────────────────────────────────────────────────────── */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.docs-nav { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; padding: 4px 0 20px; font-size: 13px; }
.docs-nav .dn-h { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .8px; margin: 16px 0 6px 10px; }
.docs-nav .dn-h:first-child { margin-top: 0; }
.docs-nav a { display: flex; align-items: center; gap: 7px; padding: 4px 10px; color: var(--text-2); border-radius: var(--r-s); border-left: 2px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docs-nav a:hover { background: var(--bg-surface); color: var(--text); }
.docs-nav a.on { border-left-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.docs-nav .m { font-size: 9.5px; min-width: 40px; padding: 1px 0; }
.docs-main { min-width: 0; max-width: 940px; }
.dsec { margin-bottom: 40px; scroll-margin-top: 80px; }
.dsec > h2 { font-size: 19px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.dsec h3 { font-size: 15px; margin: 14px 0 6px; }
.dsec p, .dsec li { color: var(--text-2); line-height: 1.65; }
.dsec .lead { font-size: 16px; color: var(--text); max-width: 720px; }
.eyebrow { color: var(--accent-hover); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 18px 0; }
.kv > div { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-m); padding: 10px 14px; min-width: 0; }
.kv small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.kv code, .kv span, .kv a { overflow-wrap: anywhere; }
pre.code { position: relative; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--r-m); padding: 12px 14px; margin: 8px 0;
  color: #cfd5f5; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; tab-size: 2; }
pre.code.json { max-height: 340px; }
pre.code .cp { position: sticky; float: right; left: 100%; top: 0; margin: -4px -6px 0 8px; background: var(--bg-surface); border: 1px solid var(--border-strong);
  color: var(--dim); font: 11px 'Play', sans-serif; border-radius: var(--r-s); padding: 2px 8px; cursor: pointer; }
pre.code .cp:hover { color: var(--text); border-color: var(--accent-border); }
.dt { margin: 8px 0; } .dt td, .dt th { vertical-align: top; }
.dt td:has(> code.nowrap) { width: 52%; }
.dt td code.nowrap { overflow-wrap: anywhere; }
.ep { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-l); padding: 16px 18px; margin: 14px 0; scroll-margin-top: 80px; }
.ep-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ep-h .p { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.ep h3 { margin: 8px 0 4px; }
.ep .ex { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 8px; }
.ep .ex > div { min-width: 0; }
.ex-h { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; }
.ex-h .muted { text-transform: none; letter-spacing: 0; }
.m { display: inline-block; text-align: center; font: 700 11px ui-monospace, Menlo, monospace; padding: 2px 7px; border-radius: 4px; letter-spacing: .3px; }
.m-get { background: var(--green-soft); color: var(--green); }
.m-post { background: var(--accent-soft); color: #8ca8e8; }
.m-delete { background: var(--danger-soft); color: var(--danger); }
.auth { margin-left: auto; font-size: 11.5px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--dim); }
.auth.a-trade { border-color: rgba(196, 144, 56, .5); color: var(--warning); }
.auth.a-read { border-color: var(--accent-border); color: #8ca8e8; }
.sc { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: #8ca8e8; }
.sc.sc-t { background: var(--warning-soft); color: var(--warning); }
h2.grp { margin-top: 8px; }
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .dt, #k-list table { display: block; overflow-x: auto; }
  .dt td code.nowrap { white-space: normal; overflow-wrap: anywhere; }
  .ep { padding: 14px 12px; }
  .docs-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; }
  .docs-nav .dn-h { width: 100%; margin: 8px 0 2px; }
  .docs-nav a { border: 1px solid var(--border); border-radius: 99px; padding: 3px 10px; }
}

/* ── public stats page ────────────────────────────────────────────────────── */
.st-h { font-size: 12.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--dim); margin: 0 0 10px; font-weight: 700; }
#recent a.skin:hover { background: var(--bg-surface); }

/* stats page rhythm (owner: "some padding is needed on the stats page") */
.stats { padding-bottom: 8px; }
.stats .st-h { margin-bottom: 14px; }
.stats .st-sec { margin-top: 36px; }
.stats div.st-sec { margin-bottom: 14px; }
.stats .kpi { gap: 16px; }
.stats .kpi .panel { padding: 18px 20px; }
.stats .kpi b { margin: 6px 0 4px; }
.stats .st-chart { margin-top: 20px; }
.stats .st-chart .chart-wrap { height: 300px; padding: 20px 22px 16px 16px; }
.stats .panel-h { padding: 14px 20px; }
.stats table.tr-t td, .stats table.tr-t th { padding-left: 20px; padding-right: 20px; }
.stats #recent .skin { padding-left: 20px; padding-right: 20px; }
@media (max-width: 600px) {
  .stats .st-sec { margin-top: 28px; }
  .stats .kpi { gap: 10px; }
  .stats .kpi .panel { padding: 14px 14px; }
  .stats .st-chart .chart-wrap { height: 240px; padding: 14px 12px 10px 8px; }
  .stats .panel-h { padding: 12px 14px; }
  .stats table.tr-t td, .stats table.tr-t th { padding-left: 12px; padding-right: 12px; }
  .stats #recent .skin { padding-left: 14px; padding-right: 14px; }
}

/* ── markets table: click-to-sort headers + per-column filters ────────────── */
.mk th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color .12s; }
.mk th.sortable:hover, .mk th.sortable:focus-visible { color: var(--text); outline: none; }
.mk th.sortable.on { color: var(--accent-hover); }
.mk th .ar { font-style: normal; font-size: 10px; margin-left: 5px; opacity: .35; display: inline-block; width: 9px; }
.mk th.sortable:hover .ar, .mk th.sortable.on .ar { opacity: 1; }
.mk tr.flt th { padding: 6px 8px 8px; background: rgba(0, 0, 0, .14); text-transform: none; letter-spacing: 0; font-weight: 400; }
.mk tr.flt th.act { background: var(--accent-soft); }
.mk .fr { display: flex; gap: 4px; justify-content: flex-end; }
.mk .fr .tr-in { width: 64px; min-width: 0; padding: 4px 6px; font-size: 12px; text-align: right; border-radius: var(--r-s); }
.mk .fr .tr-in::placeholder { color: var(--muted); }
.mk .fr .tr-in.bad { border-color: var(--danger); }

/* ── Steam trade offer pop-up (TR.trade in app.js) ────────────────────────── */
.tro-back { z-index: 75; }                                    /* TR.confirm (80) can stack on top */
.tro .trm-h { gap: 10px; }
.tro .trm-h .x { background: none; border: 0; color: var(--dim); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.tro-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.tro-ico.wait { background: var(--accent-soft); color: #8ca8e8; }
.tro-ico.ok { background: var(--green-soft); color: var(--green); }
.tro-ico.bad { background: var(--danger-soft); color: var(--danger); }
.tro-time { color: var(--warning); font-size: 12.5px; white-space: nowrap; }
.tro-steps { display: flex; gap: 6px; margin: 2px 0 14px; }
.tro-step { flex: 1; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: var(--r-m); background: var(--bg-input); color: var(--dim); font-size: 12.5px; min-width: 0; }
.tro-step i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--bg-panel); flex: 0 0 auto; }
.tro-step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tro-step.now { color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-border); }
.tro-step.now i { background: var(--accent); color: #fff; }
.tro-step.done { color: var(--text-2); }
.tro-step.done i { background: var(--green); color: #fff; }
.tro-step.bad { color: var(--danger); }
.tro-step.bad i { background: var(--danger); color: #fff; }
.tro-wait { display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 6px 0 10px; }
.tro-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-border); border-top-color: var(--accent-hover); animation: trospin .8s linear infinite; flex: 0 0 auto; }
.tro-spin.still { animation: tropulse 1.6s ease-in-out infinite; border-color: var(--warning); }
@keyframes trospin { to { transform: rotate(360deg); } }
@keyframes tropulse { 50% { opacity: .35; } }
.tro-check { background: var(--warning-soft); border: 1px solid rgba(196, 144, 56, .35); border-radius: var(--r-m); padding: 10px 12px; margin-bottom: 6px; }
.tro-from { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tro-from img { width: 36px; height: 36px; border-radius: 6px; }
.tro-from small { display: block; color: var(--dim); }
.tro .trm-f { flex-wrap: wrap; }
.tro .trm-f .btn-tr, .tro .trm-f .btn-ghost { min-width: 0; display: inline-flex; align-items: center; }
.tro-pill { position: fixed; left: 18px; bottom: 18px; z-index: 70; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 999px;
  background: var(--bg-panel); border: 1px solid var(--accent-border); color: var(--text); font: 600 13px 'Play', sans-serif; cursor: pointer; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.tro-pill:hover { border-color: var(--accent-hover); }
.tro-pill b { color: var(--warning); }
@media (max-width: 600px) { .tro-steps { flex-direction: column; } .tro-pill { left: 10px; right: 10px; bottom: 10px; justify-content: center; } }

/* trade page "For sale by users": infinite-scroll end marker */
.r-end { grid-column: 1 / -1; min-height: 1px; text-align: center; color: var(--dim); font-size: 12.5px; padding: 4px 0 2px; }
.r-end:empty { padding: 0; }

/* trade page: both inventory panels are a FIXED height (owner: "make the
   sections a fixed height so they don't jump up and down") - loading, empty,
   filtering and infinite-scroll pages never change their size; the grid
   scrolls inside. */
.dual > .panel { height: 760px; display: flex; flex-direction: column; min-height: 0; }
.dual > .panel > .grid-tr { flex: 1 1 auto; min-height: 0; max-height: none; }
.dual > .panel > .grid-tr > .empty { align-self: center; }
@media (max-width: 1000px) { .dual > .panel { height: 600px; } }
@media (max-width: 600px) { .dual > .panel { height: 520px; } }

/* virtual tile grid (TR.vgrid): only on-screen rows exist in the DOM */
.grid-tr.vg { display: block; position: relative; contain: layout paint; }
.vg-space { position: relative; }
.vg-space > .tile { position: absolute; margin: 0; overflow: hidden; }
.vg-space > .empty { padding: 30px 10px; }
.vg-foot { text-align: center; color: var(--dim); font-size: 12.5px; padding: 8px 0 2px; min-height: 1px; }
.vg-foot:empty { padding: 0; }

/* ── instant sell page ─────────────────────────────────────────────────────── */
.isell { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.isell .is-inv { height: 760px; display: flex; flex-direction: column; min-height: 0; }
.isell .is-inv > .grid-tr { flex: 1 1 auto; min-height: 0; max-height: none; }
.isell .is-sum { position: sticky; top: 78px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.isell .is-sum .clr { background: none; border: 0; color: var(--muted); font: 12px 'Play', sans-serif; cursor: pointer; }
.isell .is-sum .clr:hover { color: var(--danger); }
.isell .is-lines { padding: 6px 16px; overflow-y: auto; min-height: 90px; max-height: 300px; border-bottom: 1px solid var(--border); }
.isell .is-lines .empty { padding: 26px 0; }
.isell .is-lines .trm-row { gap: 8px; }
.isell .is-lines .stepper { flex: 0 0 auto; }
.isell .is-lines .is-amt { min-width: 74px; text-align: right; }
.isell .is-lines .x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 2px; }
.isell .is-lines .x:hover { color: var(--danger); }
.isell .is-row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; }
.isell .is-row.big { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 15px; }
.isell .is-row.big b { font-size: 26px; }
.isell .is-go { padding: 13px; font-size: 16px; }
.isell .is-done { text-align: center; border-top: 1px solid var(--border); }
.isell .is-ok { width: 44px; height: 44px; margin: 4px auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 22px; font-weight: 700; }
@media (max-width: 1000px) {
  .isell { grid-template-columns: minmax(0, 1fr); }
  .isell .is-inv { height: 560px; }
  .isell .is-sum { position: static; max-height: none; }
}

/* ── terms / privacy / support ─────────────────────────────────────────────── */
.legal .dsec { margin-bottom: 30px; }
.legal .dsec > h2 { font-size: 17px; }
.legal .dsec p, .legal .dsec li { color: var(--text-2); }
.legal .dsec ul, .legal .dsec ol { padding-left: 20px; }
.legal .dsec li { margin-bottom: 4px; }
.legal .meta { color: var(--dim); font-size: 13px; margin-bottom: 18px; }
.lg-ph { background: var(--warning-soft); color: var(--warning); border-radius: 4px; padding: 0 5px; }
.legal .tl { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-l); padding: 14px 18px; margin-bottom: 26px; }
.legal .tl b { display: block; margin-bottom: 6px; }
.legal .tl ul { margin: 0; }
.faq details { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-m); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 12px 16px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '+'; color: var(--accent-hover); font-weight: 700; width: 12px; }
.faq details[open] summary::before { content: '−'; }
.faq details > div { padding: 0 16px 14px 38px; color: var(--text-2); line-height: 1.6; }
.sup-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.sup-card { position: sticky; top: 78px; }
@media (max-width: 900px) { .sup-grid { grid-template-columns: minmax(0, 1fr); } .sup-card { position: static; } }

/* wallet: permanent deposit address */
.dep-box { display: flex; gap: 16px; align-items: flex-start; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--r-m); padding: 14px; }
.dep-qr { flex: 0 0 132px; background: #fff; border-radius: 6px; padding: 4px; line-height: 0; }
.dep-qr:empty { display: none; }
.dep-qr svg { width: 124px; height: 124px; }
.dep-info { flex: 1; min-width: 0; }
.dep-addr { display: flex; gap: 8px; align-items: center; }
.dep-addr code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; background: var(--bg-card); border-radius: 6px; padding: 6px 8px; }
.dep-rules { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.dep-rules li { margin-bottom: 3px; }
.dep-sim { background: var(--warning-soft); border-radius: var(--r-m); }
@media (max-width: 600px) { .dep-box { flex-direction: column; align-items: center; } .dep-info { width: 100%; } }
