@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Noto+Sans+Thai:wght@400;600;700&family=Noto+Sans+Khmer:wght@400;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #07080c; --bg2: #0b0d14; --surface: rgba(255,255,255,.035); --surface2: rgba(255,255,255,.06); --solid: #10131c;
  --border: rgba(255,255,255,.08); --border2: rgba(255,255,255,.14);
  --text: #eef0f7; --muted: #8b91a5; --faint: #5c6276;
  --brand: #7c5cff; --brand2: #38bdf8; --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #38bdf8 100%);
  --ok: #22c55e; --warn: #f5a524; --bad: #f43f5e; --info: #38bdf8;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.7); --glow: 0 0 0 1px rgba(139,92,246,.35), 0 18px 50px -12px rgba(99,102,241,.45);
  --r: 18px;
  --font: 'Be Vietnam Pro', 'Noto Sans Thai', 'Noto Sans Khmer', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f5f6fb; --bg2: #eef0f7; --surface: #ffffff; --surface2: #f3f4f9; --solid: #ffffff;
  --border: #e5e7ef; --border2: #d4d7e3; --text: #0d1020; --muted: #5d6378; --faint: #9aa0b4;
  --shadow: 0 20px 50px -24px rgba(30,35,70,.25); --glow: 0 0 0 1px rgba(99,102,241,.35), 0 18px 40px -16px rgba(99,102,241,.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(800px 500px at 95% 0%, rgba(56,189,248,.12), transparent 60%),
    var(--bg); }
body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 30%, transparent 75%); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(124,92,255,.35); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--border); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 24px -6px rgba(124,92,255,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.logo svg.i { width: 18px; height: 18px; stroke-width: 2.2; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--surface2); }
.nav a.on { color: var(--text); background: var(--surface2); box-shadow: inset 0 0 0 1px var(--border); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--muted); transition: all .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--border2); }
.wallet { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 14px; }
.wallet .coin { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.wallet .btn { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--grad); cursor: pointer; border: 0; text-transform: uppercase; }
.menu { position: absolute; right: 24px; top: 58px; min-width: 230px; padding: 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--solid); box-shadow: var(--shadow); animation: popIn .18s ease-out; z-index: 40; }
.menu[hidden] { display: none; }
.menu .who { padding: 10px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; word-break: break-all; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; border: 0; background: none; cursor: pointer; font-size: 14px; text-align: left; color: var(--text); }
.menu a:hover, .menu button:hover { background: var(--surface2); }
.burger { display: none; }
.mnav { display: none; }

main { max-width: 1240px; margin: 0 auto; padding: 32px 24px 80px; min-height: 70vh; }
.foot { border-top: 1px solid var(--border); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 28px 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.foot a { color: var(--text); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.foot a[hidden] { display: none; }

/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 0; border-radius: 12px; padding: 11px 18px;
  font-weight: 600; font-size: 14px; color: #fff; background: var(--grad); position: relative;
  box-shadow: 0 10px 30px -10px rgba(99,102,241,.8), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .15s, box-shadow .2s, opacity .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(99,102,241,.95), inset 0 1px 0 rgba(255,255,255,.3); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.btn.ghost:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--border2); background: var(--surface2); }
.btn.danger { background: var(--bad); box-shadow: none; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 14px 22px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.loading { color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; border: 2px solid #fff; border-right-color: transparent; animation: spin .7s linear infinite; }

input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124,92,255,.15); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 14px 0 6px; }
.field { position: relative; }
.field svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.field input { padding-left: 42px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .pre { white-space: pre-line; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
h1, h2, h3 { letter-spacing: -.02em; margin: 0; }
h2 { font-size: 26px; font-weight: 800; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.empty { color: var(--muted); padding: 60px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg.i { width: 40px; height: 40px; stroke-width: 1.4; color: var(--faint); }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.tag b { color: var(--text); }
.tag.ok { color: var(--ok); background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); }
.tag.warn { color: var(--warn); background: rgba(245,165,36,.1); border-color: rgba(245,165,36,.25); }
.tag.bad { color: var(--bad); background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.25); }
.tag.info { color: var(--info); background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.25); }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; }
.seg button, .seg a { border: 0; background: none; cursor: pointer; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; transition: all .15s; }
.seg button:hover, .seg a:hover { color: var(--text); }
.seg .on { color: var(--text); background: var(--surface2); box-shadow: inset 0 0 0 1px var(--border2), 0 4px 14px -6px rgba(0,0,0,.4); }
.seg .count { font-size: 11px; padding: 0 6px; border-radius: 6px; background: var(--surface2); }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 22px; flex-wrap: wrap; }
.toolbar .field { flex: 1; max-width: 380px; min-width: 220px; }
.notice { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(245,165,36,.35); color: var(--warn); background: rgba(245,165,36,.08); font-weight: 500; }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); overflow: hidden; cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.card:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: transparent; }
.card.out { opacity: .55; cursor: default; }
.card.out:hover { transform: none; box-shadow: none; border-color: var(--border); }
.thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--surface2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.card:hover .thumb img { transform: scale(1.06); }
.thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.35)); }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; font-weight: 800; color: #fff; background: var(--grad); }
.badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; z-index: 1; }
.badge { padding: 4px 9px; border-radius: 8px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #fff; background: rgba(10,12,20,.62); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); }
.badge.flash { background: linear-gradient(135deg, #f97316, #ef4444); border-color: transparent; }
.card-b { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-b h3 { font-size: 16px; font-weight: 700; line-height: 1.35; }
.auto { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ok); }
.auto::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.desc { color: var(--muted); font-size: 13px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-f { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; gap: 12px; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.price { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: 12px; font-weight: 500; color: var(--muted); margin-right: 4px; }
.sold { font-size: 12px; color: var(--muted); } .sold b { color: var(--text); }

.skel { border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.skel div { background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
.skel .s-img { aspect-ratio: 16/9; border-radius: 0; }
.skel .s-l { height: 14px; margin: 16px 18px 0; } .skel .s-l.w60 { width: 60%; } .skel .s-b { height: 42px; margin: 18px; border-radius: 12px; }

/* ---------- modal / sheet ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(3,4,8,.62); backdrop-filter: blur(6px); animation: fadeIn .2s ease-out; }
.modal[hidden] { display: none; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; border-radius: 22px; background: var(--solid); border: 1px solid var(--border); box-shadow: var(--shadow); animation: popIn .3s cubic-bezier(.2,.9,.3,1.15); }
.sheet-hero { position: relative; height: 150px; overflow: hidden; }
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; }
.sheet-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--solid)); }
.sheet-b { padding: 22px 24px 24px; }
.sheet-hero + .sheet-b { margin-top: -38px; position: relative; }
.sheet-b h3 { font-size: 22px; font-weight: 800; }
.x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(10,12,20,.55); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.sec-t { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 20px 0 10px; }
.vradio { display: flex; flex-direction: column; gap: 8px; }
.vopt { display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s, transform .1s; }
.vopt:hover:not(:disabled) { border-color: var(--border2); }
.vopt:active:not(:disabled) { transform: scale(.99); }
.vopt:disabled { opacity: .45; cursor: not-allowed; }
.vopt.on { border-color: var(--brand); background: rgba(124,92,255,.08); box-shadow: 0 0 0 4px rgba(124,92,255,.12); }
.vopt .dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--border2); position: relative; transition: border-color .15s; }
.vopt.on .dot { border-color: var(--brand); }
.vopt .dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--grad); transform: scale(0); transition: transform .2s cubic-bezier(.2,.9,.3,1.5); }
.vopt.on .dot::after { transform: scale(1); }
.vopt .vtxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vopt .vtxt b { font-weight: 600; }
.vopt .vtxt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vopt .vprice { font-weight: 800; white-space: nowrap; }
.vopt:disabled .vprice { color: var(--bad); font-weight: 600; font-size: 13px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.qty button { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--muted); transition: background .15s, color .15s; }
.qty button:hover { background: var(--surface2); color: var(--text); }
.qty span { min-width: 44px; text-align: center; font-weight: 700; }
.summary { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.summary .row.between { flex-wrap: nowrap; }
.summary .row.between > b { text-align: right; }
.summary .total { padding-top: 10px; margin-top: 2px; border-top: 1px dashed var(--border2); }
.summary .total b { font-size: 24px; font-weight: 800; }
.note { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--muted); max-height: 180px; overflow: auto; white-space: pre-line; }
.note[hidden] { display: none; }
.note-t { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.sheet-actions { display: flex; gap: 10px; margin: 20px -24px -24px; padding: 14px 24px 18px; position: sticky; bottom: -24px; background: color-mix(in srgb, var(--solid) 88%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
.sheet-actions .btn:last-child { flex: 1; }

.toast { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 12px 16px; border-radius: 14px; background: var(--solid); border: 1px solid var(--border2); box-shadow: var(--shadow); font-weight: 500; animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2); }
.toast[hidden] { display: none; }
.toast svg.i { color: var(--ok); } .toast.bad svg.i { color: var(--bad); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 64vh; display: grid; place-items: center; }
.auth { width: 100%; max-width: 420px; padding: 32px; border-radius: 24px; background: var(--solid); border: 1px solid var(--border); box-shadow: var(--shadow); animation: rise .4s cubic-bezier(.2,.8,.2,1); }
.auth .logo { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 18px; }
.auth h2 { font-size: 26px; }
.auth p.lead { color: var(--muted); margin: 6px 0 8px; }
.auth .alt { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.auth .alt a { color: var(--text); font-weight: 600; }

/* ---------- orders ---------- */
.olayout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.olayout > * { min-width: 0; }
.oleft { padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.olist { display: flex; flex-direction: column; gap: 8px; }
.oitem { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: all .15s; cursor: pointer; }
.oitem:hover { border-color: var(--border2); }
.oitem.on { border-color: var(--brand); background: rgba(124,92,255,.07); box-shadow: 0 0 0 4px rgba(124,92,255,.1); }
.oitem .top-line { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.oitem b { font-size: 14px; line-height: 1.35; }
.od { display: flex; flex-direction: column; gap: 16px; animation: fadeUp .3s ease-out; padding: 22px; }
.od-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.od-head h3 { font-size: 18px; }
.stage { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 16px; border: 1px solid var(--border); transition: background .5s, border-color .5s; }
.stage h3 { margin: 6px 0 2px; font-size: 18px; }
.stage p { margin: 0; }
.stage-icon { position: relative; width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--border); }
.stage-icon svg.i { width: 24px; height: 24px; stroke-width: 2.4; }
.stage-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.stage-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stage.run { background: rgba(56,189,248,.06); border-color: rgba(56,189,248,.3); }
.stage.run .stage-badge { color: var(--info); background: rgba(56,189,248,.12); }
.stage.run .stage-badge::before { animation: pulse 1.2s ease-in-out infinite; }
.stage.run .stage-icon::after { content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--info); border-right-color: transparent; animation: spin .8s linear infinite; }
.stage.ok { background: rgba(34,197,94,.07); border-color: rgba(34,197,94,.35); }
.stage.ok .stage-badge { color: var(--ok); background: rgba(34,197,94,.12); }
.stage.ok .stage-icon { color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a); border-color: transparent; box-shadow: 0 10px 30px -10px rgba(34,197,94,.8); }
.stage.bad { background: rgba(244,63,94,.07); border-color: rgba(244,63,94,.35); }
.stage.bad .stage-badge, .stage.bad .stage-icon { color: var(--bad); }
.stage.bad .stage-badge { background: rgba(244,63,94,.12); }
.stage.pop .stage-icon { animation: pop .55s cubic-bezier(.2,.9,.3,1.5); }
.st-box { border: 1px solid var(--border); border-radius: 16px; padding: 22px 18px 16px; text-align: center; background: var(--surface); }
.stepper { display: flex; align-items: flex-start; }
.st-node { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 96px; flex: none; }
.st-node small { color: var(--muted); font-size: 12px; font-weight: 500; transition: color .3s; line-height: 1.35; }
.st-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border2); background: var(--solid); color: var(--muted); font-size: 13px; font-weight: 700; transition: all .35s; }
.st-dot i { font-style: normal; }
.st-node.done .st-dot { background: linear-gradient(135deg, #22c55e, #16a34a); border-color: transparent; color: #fff; animation: pop .45s cubic-bezier(.2,.9,.3,1.5); }
.st-node.done .st-dot i { display: none; }
.st-node.done .st-dot::before { content: '✓'; font-size: 14px; }
.st-node.done small { color: var(--text); }
.st-node.active .st-dot { border-color: var(--info); color: var(--info); animation: ring 1.4s ease-out infinite; }
.st-node.active small { color: var(--info); font-weight: 700; }
.st-node.bad .st-dot { border-color: var(--bad); color: var(--bad); }
.st-bar { flex: 1; height: 3px; margin-top: 15px; background: var(--border); border-radius: 3px; overflow: hidden; position: relative; }
.st-fill { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #22c55e, #16a34a); transition: width .6s ease; }
.st-bar.filled .st-fill { width: 100%; }
.st-bar.running .st-fill { width: 100%; background: linear-gradient(90deg, transparent, var(--info), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: flow 1.2s linear infinite; transition: none; }
.st-caption { margin-top: 14px; font-weight: 700; }
.st-caption.ok { color: var(--ok); } .st-caption.bad { color: var(--bad); }
.st-sub { margin-top: 2px; min-height: 20px; }
.stepper.mini { max-width: 230px; margin: 2px 0; }
.stepper.mini .st-node { width: auto; }
.stepper.mini .st-dot { width: 16px; height: 16px; font-size: 0; border-width: 2px; animation: none; }
.stepper.mini .st-node.done .st-dot::before { font-size: 9px; }
.stepper.mini .st-node.active .st-dot { animation: ring 1.4s ease-out infinite; }
.stepper.mini .st-bar { margin-top: 7px; height: 2px; }
.od-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.content { white-space: pre-wrap; word-break: break-all; background: var(--bg2); border: 1px solid var(--border); padding: 16px; border-radius: 14px; font: 13px/1.7 var(--mono); }
.reveal { animation: fadeUp .5s ease-out; }
.timeline { display: flex; justify-content: space-between; position: relative; padding: 4px 0; }
.timeline::before { content: ''; position: absolute; left: 16%; right: 16%; top: 11px; height: 2px; background: var(--border); }
.tl { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; font-size: 13px; text-align: center; }
.tl::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--border2); margin-bottom: 8px; z-index: 1; box-shadow: 0 0 0 3px var(--solid); }
.tl.done::before { background: var(--ok); }
.tl.active::before { background: var(--info); animation: ring 1.4s ease-out infinite; }
.tl.bad::before { background: var(--bad); }
.tl small { color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 14px; }
.kv b { font-weight: 600; word-break: break-all; }
.od-meta { border-top: 1px solid var(--border); padding-top: 14px; }

/* ---------- top up ---------- */
.topup { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.amount-in { position: relative; }
.amount-in input { font-size: 26px; font-weight: 800; padding: 16px 56px 16px 18px; letter-spacing: -.02em; }
.amount-in span { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.chip { cursor: pointer; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 14px; transition: all .15s; }
.chip:hover { border-color: var(--border2); }
.chip.on { border-color: var(--brand); background: rgba(124,92,255,.08); }
.qr-card { text-align: center; }
.qr { width: 100%; max-width: 260px; border-radius: 18px; background: #fff; padding: 10px; display: block; margin: 6px auto 16px; box-shadow: var(--shadow); }
.bank { text-align: left; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.bank > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.bank > div:last-child { border-bottom: 0; }
.bank b { font-weight: 700; word-break: break-all; text-align: right; }
.bank .hl b { color: var(--warn); font-family: var(--mono); }
.copy { cursor: pointer; border: 0; background: var(--surface2); color: var(--muted); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 600; margin-left: 8px; }
.copy:hover { color: var(--text); }
.wait { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--info); font-weight: 600; font-size: 14px; }
.wait::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
.success-big { text-align: center; padding: 30px 10px; }
.success-big .ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a); animation: pop .6s cubic-bezier(.2,.9,.3,1.5); box-shadow: 0 14px 40px -12px rgba(34,197,94,.8); }
.success-big .ic svg.i { width: 34px; height: 34px; stroke-width: 2.4; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.kpi div { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.kpi.neg b { color: var(--bad); } .kpi.pos b { color: var(--ok); }
.acct-card { display: flex; align-items: center; gap: 16px; }
.acct-card .avatar { width: 56px; height: 56px; font-size: 20px; cursor: default; }
.big-bal { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 14px; }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.6); } }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(56,189,248,.55); } 100% { box-shadow: 0 0 0 10px rgba(56,189,248,0); } }
@keyframes flow { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .burger { display: grid; }
  .mnav { display: flex; flex-direction: column; gap: 4px; max-width: 1240px; margin: 0 auto; padding: 8px 16px 14px; border-top: 1px solid var(--border); }
  .mnav[hidden] { display: none; }
  .mnav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
  .mnav a.on { color: var(--text); background: var(--surface2); }
  .olayout, .topup, .cols { grid-template-columns: 1fr; }
  .oleft { position: static; max-height: none; }
}
@media (max-width: 600px) {
  .top-in { padding: 10px 14px; gap: 8px; }
  .brand .name { display: none; }
  .wallet { padding-left: 10px; font-size: 13px; }
  main { padding: 20px 14px 60px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .modal { align-items: flex-end; padding: 0; }
  .sheet { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; animation: sheetUp .35s cubic-bezier(.2,.9,.3,1); }
  .sheet-b { padding: 18px 18px 22px; }
  .sheet-actions { margin: 20px -18px -22px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); bottom: -22px; }
  .st-node { width: 64px; } .st-node small { font-size: 11px; }
  .panel, .od { padding: 16px; }
  .kv { grid-template-columns: 110px 1fr; }
  .menu { right: 12px; }
}
.mk-in { width: 170px; padding: 7px 10px; font-size: 13px; }

.flag { width: 22px; height: 15px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.15); display: block; }
.lang-wrap { position: relative; }
.lang-btn .flag { width: 20px; height: 14px; }
.lang-menu { right: 0; top: 46px; min-width: 200px; }
.lang-menu button.on { background: var(--surface2); }
.lang-menu svg.i { color: var(--ok); }

.pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm { display: flex; gap: 12px; align-items: center; text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.pm:hover { border-color: var(--border2); }
.pm.on { border-color: var(--brand); background: rgba(124,92,255,.08); box-shadow: 0 0 0 4px rgba(124,92,255,.12); }
.pm svg.i { width: 22px; height: 22px; color: var(--brand2); }
.pm span { display: flex; flex-direction: column; min-width: 0; }
.pm small { color: var(--muted); font-size: 12px; }
.sheet:has(.pay) { max-width: 680px; }
.pay h3 { font-size: 20px; }
.pay-total { font-size: 26px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.pay-grid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: center; margin-top: 16px; }
.pay-grid .qr { max-width: 220px; margin: 0; }
.pay .wait { margin-top: 10px; font-size: 13px; }
@media (max-width: 600px) {
  .pm-grid { grid-template-columns: 1fr; }
  .pay-grid { grid-template-columns: 1fr; gap: 12px; }
  .pay-grid .qr { max-width: 200px; margin: 0 auto; }
}
.pay > .row.between:first-child { padding-right: 44px; }

.foot-links { display: inline-flex; gap: 18px; flex-wrap: wrap; }
.alerts-btn { color: var(--text); }
.alerts-btn svg.i { color: var(--warn); }
@media (max-width: 760px) { .alerts-btn span { display: none; } .alerts-btn { padding: 0; width: 38px; height: 38px; } }
