/* Card Swap — design tokens, layout, components. Light by default, dark via [data-theme="dark"]. */
:root {
  --bg:#f3f5f9; --surface:#fff; --surface2:#f1f4f9; --line:#e4e8f0; --fg:#172033; --mut:#667085;
  --accent:#0fb5a3; --accent2:#0a9bbd; --grad:linear-gradient(135deg,#17d3b4,#0aa6c9); --gold:#c98600; --ok:#14804a; --bad:#d64545; --warn:#9a6200; --warnbg:#fff3d1;
  --shadow:0 1px 2px rgba(23,32,51,.05),0 4px 14px rgba(23,32,51,.05); --shadow-hover:0 2px 4px rgba(23,32,51,.06),0 10px 28px rgba(23,32,51,.10);
  --r:14px; --side:88px; --top:68px;
}
:root[data-theme="dark"] {
  --bg:#0d1218; --surface:#161d27; --surface2:#1e2733; --line:#273243; --fg:#e3e9f2; --mut:#93a1b5; --accent:#2dd4bf; --accent2:#38bdf8; --gold:#f0b93a;
  --ok:#4ade80; --bad:#ff7b7b; --warn:#fcd34d; --warnbg:#3a2f12; --shadow:0 1px 2px rgba(0,0,0,.3),0 4px 14px rgba(0,0,0,.25); --shadow-hover:0 2px 4px rgba(0,0,0,.35),0 12px 30px rgba(0,0,0,.4);
}
* { box-sizing:border-box }
html { scroll-behavior:smooth }
body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.5 "Segoe UI",Inter,system-ui,-apple-system,sans-serif; -webkit-font-smoothing:antialiased }
a { color:var(--accent2) } [hidden] { display:none !important }
button, input, select { font:inherit; color:inherit }
h1,h2,h3,h4,p { margin:0 }
:focus-visible { outline:2px solid var(--accent2); outline-offset:2px }
input, select { height:40px; padding:0 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); min-width:0 }
input[type=number] { text-align:center }
select { padding-right:30px; cursor:pointer }

/* ---------- shell ---------- */
.app { display:flex; min-height:100vh }
.side { width:var(--side); flex:none; background:var(--surface); border-right:1px solid var(--line); display:flex; flex-direction:column; align-items:center; padding:16px 0; position:sticky; top:0; height:100vh }
.logo { width:46px; height:46px; border-radius:14px; background:var(--grad); display:grid; place-items:center; color:#fff; font-size:23px; font-weight:800; margin-bottom:18px; text-decoration:none }
.nav { display:flex; flex-direction:column; gap:2px; width:100%; padding:0 10px }
.nav a { display:flex; flex-direction:column; align-items:center; gap:3px; padding:10px 0; border-radius:12px; color:var(--mut); text-decoration:none; font-size:12px; font-weight:600 }
.nav a .ni { font-size:21px; line-height:1.1 } .nav a:hover { background:var(--surface2); color:var(--fg) }
.nav a.on { background:color-mix(in srgb,var(--accent) 14%,transparent); color:var(--accent) }
.main { flex:1; min-width:0 }
.topbar { display:flex; align-items:center; gap:12px; height:var(--top); padding:0 28px; background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:30 }
.topbar h1 { flex:1; font-size:22px; font-weight:700; letter-spacing:-.2px }
.content { padding:22px 28px 140px; max-width:1520px }

/* ---------- controls ---------- */
.btn { height:40px; padding:0 18px; border:0; border-radius:10px; background:var(--accent2); color:#fff; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; text-decoration:none; transition:filter .15s, transform .05s }
.btn:hover:not(:disabled) { filter:brightness(1.07) } .btn:active:not(:disabled) { transform:translateY(1px) } .btn:disabled { opacity:.45; cursor:not-allowed }
.btn.green { background:linear-gradient(135deg,#22c06b,#169a54) } .btn.ghost { background:var(--surface); color:var(--fg); border:1px solid var(--line) } .btn.ghost:hover:not(:disabled) { background:var(--surface2); filter:none }
.btn.sm { height:34px; padding:0 12px; font-size:13px } .btn.login { background:var(--grad); text-transform:uppercase; letter-spacing:.4px; font-size:13px; height:42px; padding:0 22px; box-shadow:0 4px 14px rgba(10,166,201,.3) }
.btn.add { height:36px; padding:0 20px; background:var(--accent); color:#fff }
.icon-btn { width:40px; height:40px; border-radius:10px; border:1px solid var(--line); background:var(--surface); cursor:pointer; display:grid; place-items:center }
.icon-btn:hover { background:var(--surface2) } .icon-btn.sm { width:34px; height:34px }
.chip { display:flex; align-items:center; gap:10px; background:var(--surface2); border-radius:999px; padding:4px 16px 4px 4px; height:44px }
.chip .av, .chip img { width:36px; height:36px; border-radius:50%; background:var(--line) } .chip small { display:block; color:var(--mut); font-size:12px; line-height:1.1; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.chip b { font-size:15px }
.gem { width:1.55em; height:1.55em; vertical-align:middle; margin:-.2em .2em -.2em 0; object-fit:contain } .cr { white-space:nowrap; font-weight:700; color:var(--gold) }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:18px; margin-bottom:16px; box-shadow:var(--shadow) }
.card h3 { font-size:16px; margin-bottom:10px }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center } .grow { flex:1; min-width:200px } .mut { color:var(--mut) } .small { font-size:13px }
.banner-warn { background:var(--warnbg); color:var(--warn); border-radius:12px; padding:11px 16px; margin-bottom:16px; font-weight:600 } .banner-warn a { color:inherit }
.seg { display:inline-flex; background:var(--surface2); border-radius:10px; padding:3px; gap:2px }
.seg button { height:34px; border:0; border-radius:8px; background:none; color:var(--mut); padding:0 14px; cursor:pointer; font-weight:600; white-space:nowrap }
.seg button:hover { color:var(--fg) } .seg button.on { background:var(--surface); color:var(--fg); box-shadow:var(--shadow) }
.switch { display:inline-flex; gap:8px; align-items:center; color:var(--mut); font-weight:600; cursor:pointer; user-select:none; white-space:nowrap }
.switch input { width:18px; height:18px; accent-color:var(--accent) }
.search { display:flex; align-items:center; gap:8px; flex:1; min-width:200px; max-width:300px; height:40px; padding:0 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--mut) }
.search:focus-within { border-color:var(--accent2) } .search input { border:0; background:none; height:100%; padding:0; flex:1; outline:0; color:var(--fg) }

/* ---------- filter bar ---------- */
.filterbar { position:sticky; top:var(--top); z-index:20; background:var(--bg); padding:2px 0 12px; margin-bottom:6px }
.toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:10px 12px; box-shadow:var(--shadow) }
.toolbar select { max-width:170px } .toolbar .count { margin-left:auto; color:var(--mut); font-size:13px; font-weight:600 }
.subbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:10px; color:var(--mut); font-size:13px } .subbar b { color:var(--fg) }

/* ---------- grids & tiles ---------- */
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px }
.grid.cards { grid-template-columns:repeat(auto-fill,minmax(188px,1fr)); gap:14px }
.tile { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; display:flex; flex-direction:column; box-shadow:var(--shadow); transition:transform .15s, box-shadow .15s, border-color .15s }
.tile:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover) } .tile.sel { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent) }
.art { position:relative; aspect-ratio:460/215; background:var(--surface2); overflow:hidden; display:grid; place-items:center }
.art.ph { background:linear-gradient(135deg,hsl(var(--h) 55% 46%),hsl(calc(var(--h) + 45) 55% 30%)) } .art .ini { color:rgba(255,255,255,.92); font-size:34px; font-weight:800; letter-spacing:1px }
.art img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover }
.grid.cards .art { aspect-ratio:1; background:radial-gradient(circle at 50% 35%,var(--surface2),var(--bg)); font-size:46px } .grid.cards .art img { object-fit:contain; padding:12px }
.tag { position:absolute; top:10px; left:10px; z-index:1; font-size:11px; font-weight:800; letter-spacing:.4px; padding:3px 9px; border-radius:999px; background:rgba(15,23,42,.78); color:#fff }
.tag.foil { background:linear-gradient(90deg,#f5c13f,#ff9d3a); color:#2a1a00 } .tag.key { background:var(--accent2) } .tag.nm { top:38px; background:var(--bad) }
.own { position:absolute; top:10px; right:10px; z-index:1; font-size:12px; font-weight:700; padding:3px 9px; border-radius:999px; background:rgba(15,23,42,.78); color:#fff }
.tb { padding:14px 14px 14px; display:flex; flex-direction:column; gap:8px; flex:1 }
.nm { font-size:15px; font-weight:650; line-height:1.3; min-height:2.6em; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden }
.sub { color:var(--mut); font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:-4px }
.badges { display:flex; gap:6px; flex-wrap:wrap }
.badge { display:inline-flex; align-items:center; gap:5px; background:var(--surface2); color:var(--mut); border-radius:999px; padding:3px 10px; font-size:12.5px; font-weight:600 }
.badge.ok { background:color-mix(in srgb,var(--ok) 13%,transparent); color:var(--ok) } .badge.zero { background:color-mix(in srgb,var(--bad) 12%,transparent); color:var(--bad) }
.foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:auto; padding-top:10px; border-top:1px solid var(--line); min-height:56px }
.price { display:inline-flex; align-items:center; font-size:18px; font-weight:800; color:var(--gold); white-space:nowrap }
.act { display:inline-flex; align-items:center } .soldout { color:var(--bad); font-weight:700; font-size:13px }
.qty { display:inline-flex; align-items:center; background:var(--surface2); border-radius:10px; padding:2px } .qty button { width:32px; height:32px; border:0; border-radius:8px; background:none; font-size:18px; cursor:pointer }
.qty button:hover:not(:disabled) { background:var(--line) } .qty button:disabled { opacity:.35; cursor:not-allowed }
.qty input { width:46px; height:32px; border:0; background:none; padding:0; font-weight:700 } .qty .max { width:auto; padding:0 8px; font-size:11px; font-weight:800; color:var(--accent2) }
.grid.cards .tb .qty { align-self:stretch; justify-content:space-between } .grid.cards .tb .qty input { flex:1 }
.skel { height:300px; border-radius:var(--r); background:linear-gradient(90deg,var(--surface),var(--surface2),var(--surface)); background-size:200% 100%; animation:sk 1.2s linear infinite }
@keyframes sk { to { background-position:-200% 0 } }
.empty { text-align:center; padding:64px 16px; color:var(--mut) } .empty .emoji { font-size:44px; margin-bottom:8px } .empty h3 { color:var(--fg); font-size:19px; margin-bottom:6px } .empty p { max-width:460px; margin:0 auto 16px }
.state { text-align:center; padding:44px 16px; color:var(--mut) } .state h3 { color:var(--fg); margin-bottom:6px }
.more { display:block; margin:6px auto 0 }

/* ---------- sell page ---------- */
.syncbar { display:flex; align-items:center; gap:14px; justify-content:space-between; flex-wrap:wrap; padding:12px 16px }
.syncmsg { flex:1; min-width:220px; font-size:14px; color:var(--mut) } .syncmsg b { color:var(--fg) } .warnTxt { color:var(--warn); font-weight:600 } .failTxt { color:var(--bad); margin-top:4px }
.spin { display:inline-block; width:14px; height:14px; border:2px solid var(--line); border-top-color:var(--accent2); border-radius:50%; animation:rot .8s linear infinite; vertical-align:-2px; margin-right:8px }
@keyframes rot { to { transform:rotate(360deg) } }
.prog { height:4px; border-radius:4px; background:var(--surface2); margin-top:8px; overflow:hidden } .prog i { display:block; height:100%; width:40%; background:var(--grad); border-radius:4px; animation:slide 1.2s ease-in-out infinite }
@keyframes slide { 0% { margin-left:-40% } 100% { margin-left:100% } }
.summary { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px }
.sumtile { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px 16px; box-shadow:var(--shadow) } .sumtile small { display:block; color:var(--mut); font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.5px } .sumtile b { font-size:21px }
.group { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); margin-bottom:12px; overflow:hidden; box-shadow:var(--shadow) }
.group > summary { list-style:none; display:flex; align-items:center; gap:12px; padding:12px 16px; cursor:pointer; flex-wrap:wrap } .group > summary::-webkit-details-marker { display:none }
.group > summary::before { content:'▸'; color:var(--mut); transition:transform .15s } .group[open] > summary::before { transform:rotate(90deg) } .group > summary:hover { background:var(--surface2) }
.gname { font-weight:700; font-size:16px } .gmeta { color:var(--mut); font-size:13px; flex:1; min-width:160px } .gact { display:flex; gap:6px } .group .grid { padding:6px 16px 16px }
.ltable { width:100%; border-collapse:collapse; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden }
.ltable th { font-size:12px; text-transform:uppercase; letter-spacing:.5px; color:var(--mut); background:var(--surface2); padding:9px 12px; text-align:left } .ltable td { padding:7px 12px; border-top:1px solid var(--line); vertical-align:middle }
.lrow.sel { background:color-mix(in srgb,var(--accent) 9%,transparent) } .th img, .th span { width:40px; height:40px; object-fit:contain; display:grid; place-items:center; background:var(--surface2); border-radius:8px }
.tag2 { font-size:11px; font-weight:800; padding:2px 8px; border-radius:999px; background:var(--surface2) } .tag2.foil { background:linear-gradient(90deg,#f5c13f,#ff9d3a); color:#2a1a00 } .tag2.key { background:var(--accent2); color:#fff } .tag2.nm { background:color-mix(in srgb,var(--bad) 15%,transparent); color:var(--bad) }

/* ---------- keys, orders, account, admin ---------- */
.keycard { display:flex; gap:28px; align-items:center; flex-wrap:wrap; padding:26px } .keyart { width:150px; height:150px; border-radius:26px; background:var(--grad); display:grid; place-items:center; box-shadow:var(--shadow-hover); overflow:hidden } .keyart img { width:100%; height:100%; object-fit:contain; padding:12px }
.kmain { flex:1; min-width:260px; display:flex; flex-direction:column; gap:10px } .kmain h2 { font-size:24px } .kprice { font-size:30px; font-weight:800; display:flex; align-items:baseline; gap:10px } .kprice .mut { font-size:14px; font-weight:600 } .kact { margin-top:6px }
.order { padding:14px 0; border-bottom:1px solid var(--line) } .order:last-child { border:0 } .order .top2 { display:flex; justify-content:space-between; gap:8px; align-items:center; margin-bottom:2px }
.status { font-size:12px; font-weight:800; padding:2px 10px; border-radius:999px; text-transform:capitalize }
.s-pending { background:var(--warnbg); color:var(--warn) } .s-completed { background:color-mix(in srgb,var(--ok) 14%,transparent); color:var(--ok) } .s-failed { background:color-mix(in srgb,var(--bad) 14%,transparent); color:var(--bad) }
.fgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px } .field { display:flex; flex-direction:column; gap:5px } .field span { font-weight:600; font-size:13.5px } .field small { color:var(--mut); font-size:12px; margin-top:-2px } .field input { width:100% }
.hero { background:var(--grad); color:#fff; border-radius:18px; padding:24px 28px; margin-bottom:18px; display:flex; gap:24px; align-items:center; flex-wrap:wrap; box-shadow:var(--shadow-hover) }
.hero h2 { font-size:24px; margin-bottom:4px } .hero p { opacity:.95 } .hero .btn.login { background:#fff; color:#07869f; box-shadow:none }
.steps { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px } .steps span { background:rgba(255,255,255,.2); border-radius:999px; padding:4px 14px; font-size:13px; font-weight:700 }
.pager { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin:22px 0 4px }
.pg { min-width:38px; height:38px; padding:0 8px; border:1px solid var(--line); background:var(--surface); border-radius:10px; cursor:pointer; font-weight:600 }
.pg:hover:not(:disabled):not(.on) { background:var(--surface2) } .pg.on { background:var(--accent); border-color:var(--accent); color:#fff } .pg:disabled { opacity:.4; cursor:not-allowed }
.pager .gap { color:var(--mut); padding:0 4px } .pager select { height:38px; margin-left:6px }
/* set details */
.back { display:inline-block; margin-bottom:12px; font-weight:600; text-decoration:none }
.dhead { display:flex; gap:24px; flex-wrap:wrap; padding:20px } .dart { width:min(100%,380px); border-radius:12px; overflow:hidden; flex:none } .dart .art { aspect-ratio:460/215 }
.dmain { flex:1; min-width:260px; display:flex; flex-direction:column; gap:12px; align-items:flex-start } .dmain h2 { font-size:26px }
.dprice { display:flex; align-items:center; gap:14px; font-size:30px; font-weight:800; color:var(--gold); flex-wrap:wrap } .dprice small { font-size:13px; font-weight:600; color:var(--mut) }
.links { display:flex; gap:16px; flex-wrap:wrap; font-size:13.5px; font-weight:600 }
.section { margin:26px 0 12px; font-size:18px } .section .mut { font-weight:500 }
.grid.mini { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px } .grid.mini .art { aspect-ratio:1; background:radial-gradient(circle at 50% 35%,var(--surface2),var(--bg)) } .grid.mini .art img { object-fit:contain; padding:10px }
.grid.bgs { grid-template-columns:repeat(auto-fill,minmax(210px,1fr)) } .grid.bgs .art { aspect-ratio:16/9 } .grid.bgs .art img { object-fit:cover; padding:0 }
.tile[data-id] .art, .tile[data-id] .nm { cursor:pointer }
footer { color:var(--mut); font-size:13px; text-align:center; padding:28px 0 20px }
.bar { position:fixed; left:var(--side); right:0; bottom:0; z-index:40; background:var(--surface); border-top:1px solid var(--line); box-shadow:0 -8px 30px rgba(23,32,51,.10); transform:translateY(110%); transition:transform .2s }
.bar.show { transform:none } .bar .in { display:flex; align-items:center; gap:14px; padding:12px 28px; flex-wrap:wrap } .bar .sum { flex:1; min-width:180px; color:var(--mut) } .bar .sum b { font-size:20px }
#toast { position:fixed; left:50%; bottom:96px; transform:translate(-50%,20px); background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--mut); color:var(--fg); padding:12px 20px; border-radius:12px; opacity:0; pointer-events:none; transition:.25s; max-width:92vw; z-index:60; box-shadow:var(--shadow-hover); font-weight:600 }
#toast.show { opacity:1; transform:translate(-50%,0) } #toast.bad { border-left-color:var(--bad) } #toast.ok { border-left-color:var(--ok) }
code { background:var(--surface2); padding:1px 6px; border-radius:6px; font-size:.92em }

/* ---------- responsive ---------- */
@media (max-width:1100px) { .summary { grid-template-columns:repeat(2,1fr) } }
@media (max-width:760px) {
  :root { --side:0px; --top:58px }
  .app { flex-direction:column } .side { position:fixed; bottom:0; top:auto; left:0; right:0; width:100%; height:60px; flex-direction:row; padding:0; z-index:50; border-right:0; border-top:1px solid var(--line) }
  .logo { display:none } .nav { flex-direction:row; padding:4px 6px; gap:0 } .nav a { flex:1; padding:6px 0; font-size:11px }
  .topbar { padding:0 14px } .topbar h1 { font-size:18px } .chip small { display:none } .content { padding:14px 14px 160px } .bar { left:0; bottom:60px } .bar .in { padding:10px 14px }
  .grid { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px } .grid.cards { grid-template-columns:repeat(2,1fr) }
  .hm { display:none } .gact { width:100% } .keyart { width:100px; height:100px; font-size:48px } .filterbar { top:var(--top) } .toolbar .count { margin-left:0; width:100% }
  .hero { padding:18px } .tb { padding:11px } .nm { font-size:14px } .price { font-size:16px }
  .topbar h1 { white-space:nowrap } .topbar form.row { display:none } .topbar .btn.sm { padding:0 10px }
  .foot { flex-wrap:wrap; gap:8px } .act { width:100% } .act .btn.add { width:100% } .act .qty { width:100%; justify-content:space-between } .act .qty input { flex:1 }
  .bar .in { gap:8px } .bar .sum { flex:1 1 100% } .bar .btn { flex:1 }
  .summary { grid-template-columns:repeat(2,1fr) } .sumtile b { font-size:18px } .toolbar select { max-width:none; flex:1 }
}

/* inventory value bars */
.vrow { display:grid; grid-template-columns:minmax(110px,200px) 1fr 110px 90px; gap:12px; align-items:center; padding:6px 0 }
.vl { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600 } .vb { height:10px; border-radius:6px; background:var(--surface2); overflow:hidden } .vb i { display:block; height:100%; background:var(--grad); border-radius:6px }
.vv { text-align:right; color:var(--gold) } .vn { text-align:right }
@media (max-width:760px) { .vrow { grid-template-columns:1fr 90px } .vb { grid-column:1 / -1; order:3 } .vn { display:none } }

/* ---------- polish: numbers, tables, images, footer ---------- */
.price, .cr, .vv, .num, .sumtile b, .kprice, .dprice, .bar .sum b { font-variant-numeric: tabular-nums }
.tablewrap { overflow-x:auto; border:1px solid var(--line); border-radius:var(--r); background:var(--surface); box-shadow:var(--shadow) }
.tablewrap .ltable { border:0; border-radius:0; min-width:560px }
.ltable { table-layout:auto }
.ltable th { position:sticky; top:0; white-space:nowrap } .ltable th.num, .ltable td.num { text-align:right; white-space:nowrap }
.ltable tbody tr:hover, .ltable tr.lrow:hover { background:color-mix(in srgb,var(--accent) 5%,transparent) }
.ltable td.th, .ltable th:first-child { width:56px }
.itm { display:flex; align-items:center; gap:12px; min-width:0 } .itm > div { min-width:0 } .itm b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:360px }
.th img, .th > span { width:44px; height:44px; object-fit:contain; display:grid; place-items:center; background:var(--surface2); border-radius:8px; font-size:22px }
.art img, .th img { opacity:0; transition:opacity .25s } .art img.ld, .th img.ld { opacity:1 } .art img.broken, .th img.broken { display:none }
.tile .art { background-image:linear-gradient(135deg,var(--surface2),var(--bg)) }
.unit { color:var(--mut); font-size:12px; font-weight:600; margin-left:4px }
/* orders */
.ordercard { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); margin-bottom:16px; box-shadow:var(--shadow); overflow:hidden }
.ohead { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:14px 18px; border-bottom:1px solid var(--line); background:var(--surface2) }
.ohead .ttl { font-weight:700; font-size:16px } .ohead .when { color:var(--mut); font-size:13px; flex:1 } .ohead .tot { font-weight:800; font-size:18px }
.ohead .tot.plus { color:var(--ok) } .ohead .tot.minus { color:var(--fg) }
.ordercard .ltable { border:0; border-radius:0 } .onote { padding:10px 18px; font-size:13px; color:var(--bad); border-top:1px solid var(--line) }
/* footer */
.sitefoot { margin-top:36px; padding:28px 0 8px; border-top:1px solid var(--line); color:var(--mut); font-size:13.5px; text-align:left }
.fgrid4 { display:grid; grid-template-columns:1.4fr 1fr 1.4fr 1.4fr; gap:28px }
.fcol h4 { color:var(--fg); font-size:13px; text-transform:uppercase; letter-spacing:.6px; margin-bottom:10px }
.fcol a { display:block; color:var(--mut); text-decoration:none; padding:3px 0 } .fcol a:hover { color:var(--accent2) }
.fcol ul { margin:0; padding-left:18px } .fcol li { margin-bottom:6px } .fcol p { margin:10px 0 0; max-width:340px }
.fbrand { display:inline-flex !important; align-items:center; gap:10px; color:var(--fg) !important; font-weight:800; font-size:18px; padding:0 !important }
.flogo { width:34px; height:34px; border-radius:10px; background:var(--grad); color:#fff; display:grid; place-items:center; font-size:18px }
.fbottom { display:flex; gap:16px; justify-content:space-between; flex-wrap:wrap; margin-top:24px; padding-top:16px; border-top:1px solid var(--line); font-size:12.5px } .fbottom a { color:var(--mut) }
@media (max-width:980px) { .fgrid4 { grid-template-columns:1fr 1fr } }
@media (max-width:760px) { .fgrid4 { grid-template-columns:1fr; gap:20px } .sitefoot { margin-bottom:76px } .itm b { max-width:180px } .ohead .when { flex-basis:100% } }
/* order tables share one column grid so amounts line up from order to order */
.ordercard .ltable { table-layout:fixed; width:100%; min-width:0 }
.ordercard .ltable th:nth-child(3) { width:90px } .ordercard .ltable th:nth-child(4), .ordercard .ltable th:nth-child(5) { width:140px }
.ordercard .itm b { max-width:100% }
@media (max-width:760px) { .ordercard .ltable th:nth-child(4) { display:none } .ordercard .ltable td:nth-child(4) { display:none } .ordercard .ltable th:nth-child(3) { width:56px } .ordercard .ltable th:nth-child(5) { width:110px } }

/* ---------- fixed footer ---------- */
.sitefoot { position:fixed; left:var(--side); right:0; bottom:0; z-index:45; margin:0; padding:0; background:var(--surface); border-top:1px solid var(--line); box-shadow:0 -6px 24px rgba(23,32,51,.07); font-size:12.5px }
.fbar { display:flex; align-items:center; gap:14px; height:40px; padding:0 28px; color:var(--mut); min-width:0 }
.fb-brand { display:inline-flex; align-items:center; gap:8px; color:var(--fg); font-weight:800; white-space:nowrap } .flogo.sm { width:22px; height:22px; border-radius:7px; font-size:12px }
.fb-txt { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0 }
.fb-btn { background:none; border:1px solid var(--line); border-radius:8px; height:26px; padding:0 10px; color:var(--mut); cursor:pointer; font-weight:600; text-decoration:none; display:inline-flex; align-items:center; white-space:nowrap } .fb-btn:hover { background:var(--surface2); color:var(--fg) }
.finfo { max-height:60vh; overflow:auto; padding:18px 28px 6px; border-bottom:1px solid var(--line) }
.sitefoot .fgrid4 { margin-bottom:10px }
.content { padding-bottom:190px }
.bar { bottom:40px } .bar .in { padding:10px 28px }
#toast { bottom:150px }
.vgrid { display:grid; grid-template-columns:1fr 1fr; gap:16px } .vgrid .card { margin-bottom:16px }
.vtools { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:10px } .vseg { flex-wrap:wrap; margin-bottom:6px } .vseg button small { margin-left:2px; font-weight:500 }
.vtable td { vertical-align:middle } .vlinks { white-space:nowrap } .vlinks a { display:inline-block; margin-right:12px; font-weight:600; font-size:13px; text-decoration:none } .vlinks a:hover { text-decoration:underline }
@media (max-width:980px) { .vgrid { grid-template-columns:1fr } }
@media (max-width:760px) {
  .sitefoot { left:0; bottom:60px } .fbar { height:38px; padding:0 14px; gap:8px } .fb-txt { display:none } .finfo { padding:14px; max-height:55vh }
  .content { padding-bottom:210px } .bar { bottom:98px } #toast { bottom:170px }
  .vtable .vlinks a { display:block; margin:2px 0 }
}
.topbar .btn { white-space:nowrap }
@media (max-width:760px) { .fb-brand { font-size:0; gap:0 } .fb-brand .flogo { font-size:12px } .fb-btn { flex:none } }
@media (max-width:760px) {
  .tablewrap .ltable { min-width:0 } .ltable td, .ltable th { padding:7px 8px } .ltable td.th, .ltable th:first-child { width:48px }
  .th img, .th > span { width:36px; height:36px } .itm { gap:8px } .itm b { max-width:130px } .vlinks a { font-size:12px; margin-right:0 }
  .topbar .chip { padding-right:10px } .topbar { gap:8px }
}

/* ---------- brand images ---------- */
.logo { background:none; box-shadow:none } .logo img { width:46px; height:46px; border-radius:14px; display:block }
.flogo-img { width:34px; height:34px; border-radius:10px; display:block } .flogo-img.sm { width:22px; height:22px; border-radius:6px }
.fbrand { gap:10px } .fb-brand { gap:8px }
.flegal { font-size:13px } .fcol .flegal a { display:inline; padding:0 }
.fb-legal { display:flex; gap:14px; margin-right:6px } .fb-legal a { color:var(--mut); text-decoration:none; font-weight:600; white-space:nowrap } .fb-legal a:hover { color:var(--accent2) }
@media (max-width:1100px) { .fb-txt { display:none } }
@media (max-width:760px) { .fb-legal { display:none } .fb-brand { font-size:13px } }
/* ---------- cookie banner ---------- */
.cbanner { position:fixed; z-index:90; left:calc(var(--side) + 16px); bottom:56px; width:min(720px, calc(100vw - var(--side) - 32px)); background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-hover); padding:16px 18px; display:flex; gap:16px; align-items:flex-end; flex-wrap:wrap }
.cbody { flex:1; min-width:260px } .cbody b { font-size:15px } .cbody p { margin:6px 0 0; font-size:13.5px; color:var(--mut) } .cbody a { color:var(--accent2) }
.cact { display:flex; gap:8px; flex-wrap:wrap } .cpanel { margin-top:12px; display:grid; gap:10px; max-width:520px } .cpanel[hidden] { display:none }
.crow { display:flex; gap:10px; align-items:flex-start; cursor:pointer } .crow input { width:18px; height:18px; margin-top:3px; accent-color:var(--accent) } .crow small { display:block; color:var(--mut); font-size:12.5px }
@media (max-width:760px) { .cbanner { left:8px; right:8px; width:auto; bottom:106px; padding:14px } .cact .btn { flex:1 } }
/* ---------- legal pages ---------- */
.legalbody { min-height:100vh }
.lhead { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 28px; background:var(--surface); border-bottom:1px solid var(--line) }
.lbrand { display:block; line-height:0 } .wm { height:44px; width:auto } .wm-light { display:none } :root[data-theme="dark"] .wm-dark { display:none } :root[data-theme="dark"] .wm-light { display:block }
.legal { max-width:820px; margin:0 auto; padding:32px 20px 40px } .legal h1 { font-size:34px; letter-spacing:-.4px; margin-bottom:4px } .legal .lead { font-size:16.5px; margin:14px 0 8px }
.legal h2 { font-size:19px; margin:30px 0 8px } .legal p { margin:0 0 12px; color:var(--fg) } .legal section p:not(:first-of-type) { margin-top:10px }
.legalnav { display:flex; gap:18px; flex-wrap:wrap; margin-top:36px; padding-top:18px; border-top:1px solid var(--line) } .legalnav a { font-weight:600; text-decoration:none }
.lfoot { text-align:center; color:var(--mut); font-size:13px; padding:8px 16px 28px }
.legal .tablewrap { margin:8px 0 12px } .legal .ltable td, .legal .ltable th { vertical-align:top }
.legalbody .cbanner { left:16px; bottom:16px; width:min(720px, calc(100vw - 32px)) }
@media (max-width:760px) { .legalbody .cbanner { left:8px; right:8px; bottom:8px; width:auto } }
@media (max-width:760px) { .fb-brand { font-size:0; gap:0 } }

/* ---------- site icons (provided artwork) ---------- */
.nav a .ni { display:grid; place-items:center; height:32px } .nav a .ni img { width:30px; height:30px; object-fit:contain; display:block; transition:transform .15s } .nav a:hover .ni img, .nav a.on .ni img { transform:scale(1.1) }
.empty .emoji img { width:84px; height:84px; object-fit:contain }
.ic { width:58%; height:58%; object-fit:contain }
@media (max-width:760px) { .nav a .ni { height:28px } .nav a .ni img { width:26px; height:26px } }

/* credits icon (provided gems artwork) and card badges */
.gem { width:2.1em; height:1.2em; object-fit:contain; vertical-align:middle; margin:-.15em .3em -.15em 0 }
.cico { width:18px; height:18px; vertical-align:-4px; image-rendering:auto }
.badge .cico { margin-right:2px }

/* ---------- header (modern) ---------- */
.topbar { height:68px; gap:16px; padding:0 28px; background:color-mix(in srgb, var(--surface) 84%, transparent); -webkit-backdrop-filter:saturate(1.5) blur(14px); backdrop-filter:saturate(1.5) blur(14px); border-bottom:1px solid var(--line) }
.tb-brand { display:none; align-items:center; gap:10px; color:var(--fg); text-decoration:none; font-weight:800; font-size:17px; letter-spacing:-.2px } .tb-brand img { border-radius:10px; display:block } .tb-brand b { color:var(--accent) }
.tb-title { flex:1; min-width:0 } .tb-title h1 { flex:none; font-size:21px; line-height:1.2; letter-spacing:-.3px } .tb-title p { margin:1px 0 0; color:var(--mut); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.tb-actions { display:flex; align-items:center; gap:10px; flex:none }
.tb-ico { width:40px; height:40px; border-radius:12px; border:1px solid var(--line); background:var(--surface); color:var(--fg); cursor:pointer; display:grid; place-items:center; font-size:18px; line-height:1 } .tb-ico:hover { background:var(--surface2) }
.tb-bal { display:flex; align-items:center; gap:8px; height:40px; padding:0 14px 0 10px; border-radius:12px; text-decoration:none; color:var(--fg); border:1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface2)) }
.tb-bal:hover { filter:brightness(1.03) } .tb-bal .cr { font-size:17px } .tb-bal small { color:var(--mut); font-weight:600; font-size:12px }
.tb-user { position:relative } .tb-ubtn { display:flex; align-items:center; gap:10px; height:40px; padding:0 12px 0 4px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--fg); cursor:pointer }
.tb-ubtn:hover { background:var(--surface2) } .tb-ubtn .av, .tb-ubtn img { width:30px; height:30px; border-radius:50%; background:var(--line); display:block }
.tb-uname { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; font-size:14px } .tb-caret { color:var(--mut); font-size:11px }
.tb-menu { position:absolute; right:0; top:calc(100% + 8px); min-width:230px; background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-hover); padding:6px; z-index:70 } .tb-menu[hidden] { display:none }
.tb-mhead { padding:8px 10px 10px; border-bottom:1px solid var(--line); margin-bottom:4px } .tb-mhead b { display:block; font-size:14px } .tb-mhead small { color:var(--mut); font-size:12px }
.tb-menu a, .tb-menu button { display:block; width:100%; text-align:left; padding:9px 10px; border-radius:9px; border:0; background:none; color:var(--fg); text-decoration:none; cursor:pointer; font-weight:600; font-size:14px }
.tb-menu a:hover, .tb-menu button:hover { background:var(--surface2) } .tb-menu #out { color:var(--bad) }
@media (max-width:1100px) { .tb-uname, .tb-caret { display:none } .tb-ubtn { padding:0 4px } }
@media (max-width:760px) {
  .topbar { height:60px; padding:0 12px; gap:8px } .tb-brand { display:flex } .tb-brand span { display:none }
  .tb-title h1 { font-size:18px } .tb-title p { display:none } .tb-actions { gap:6px } .tb-ico, .tb-bal, .tb-ubtn { height:38px } .tb-ico { width:38px } .tb-bal small { display:none } .tb-bal { padding:0 10px 0 6px }
  .tb-menu { position:fixed; right:8px; left:8px; top:66px }
}

.admtabs { margin-bottom:16px } .admtabs button { padding:0 18px }

/* availability strip on the Buy page */
.stats { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:14px }
.stats .st { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:10px 18px; box-shadow:var(--shadow); min-width:150px }
.stats .st b { display:block; font-size:22px; line-height:1.15; font-variant-numeric:tabular-nums } .stats .st span { color:var(--mut); font-size:12.5px; font-weight:600 }
.stats .st.main { border-color:color-mix(in srgb, var(--accent) 40%, var(--line)); background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)) } .stats .st.main b { color:var(--accent) }
@media (max-width:760px) { .stats { display:grid; grid-template-columns:1fr 1fr; gap:10px } .stats .st { min-width:0; padding:10px 12px } .stats .st b { font-size:19px } }

/* lazy loader sentinel */
.lazysent { text-align:center; color:var(--mut); font-size:13px; font-weight:600; padding:22px 0 8px }

.stats .st { min-width:260px } .stats .st .lbl { display:block; text-transform:uppercase; letter-spacing:.5px; font-size:11.5px; font-weight:800; color:var(--mut); margin-bottom:2px }
.stats .st b em { font-style:normal; font-size:14px; font-weight:600; color:var(--mut); margin-left:2px } .stats .st.main b em { color:var(--fg) }
@media (max-width:760px) { .stats { grid-template-columns:1fr } .stats .st b { font-size:18px } }
