html, body { height: 100%; }
body { overflow: hidden; }

.stage { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--bg); }
#device { position: relative; width: 100%; height: 100%; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; isolation: isolate; }
.stage-note { display: none; }
@media (min-width: 600px) and (min-height: 700px) {
  .stage { background: radial-gradient(900px 600px at 75% 15%, #DCE4FF, transparent 60%), radial-gradient(700px 500px at 15% 90%, #EDE6FF, transparent 60%), #EEF0F5; }
  :root[data-theme="dark"] .stage { background: #000; }
  #device { width: 402px; height: min(874px, calc(100vh - 40px)); border-radius: 56px; box-shadow: 0 0 0 10px #0E1016, 0 0 0 11.5px #3A3F4C, 0 50px 100px -20px rgba(13,19,38,.45); }
  #device::before { content: ''; position: absolute; top: 11px; left: 50%; width: 120px; height: 34px; margin-left: -60px; background: #000; border-radius: 20px; z-index: 100; pointer-events: none; }
  .stage-note { display: block; position: fixed; left: 24px; bottom: 20px; font-size: 13px; color: var(--ink-3); max-width: 280px; line-height: 1.5; }
  .stage-note a { color: var(--brand); font-weight: 500; }
  .scr-head, .ob, .w-top { padding-top: 54px !important; }
  .sv-bars { padding-top: 52px; }
  .toast { top: 58px !important; }
}

/* ---------- Screens & transitions ---------- */
.scr { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; width: 100%; position: relative; }
.scr.push { animation: pushIn .42s var(--ease) both; }
.scr.pop { animation: popIn .42s var(--ease) both; }
.scr.tabfade { animation: tabIn .32s var(--ease) both; }
.scr.rise { animation: riseIn .6s var(--ease) both; }
@keyframes pushIn { from { transform: translateX(38%); opacity: 0; } }
@keyframes popIn { from { transform: translateX(-24%); opacity: 0; } }
@keyframes tabIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(30px); } }
.stagger > * { animation: stg .55s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .03s; } .stagger > *:nth-child(2) { animation-delay: .07s; } .stagger > *:nth-child(3) { animation-delay: .11s; }
.stagger > *:nth-child(4) { animation-delay: .15s; } .stagger > *:nth-child(5) { animation-delay: .19s; } .stagger > *:nth-child(6) { animation-delay: .23s; }
.stagger > *:nth-child(7) { animation-delay: .27s; } .stagger > *:nth-child(8) { animation-delay: .31s; } .stagger > *:nth-child(n+9) { animation-delay: .35s; }
@keyframes stg { from { opacity: 0; transform: translateY(14px); } }

.scr-head { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; min-height: 64px; position: relative; z-index: 2; }
.scr-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; flex: 1; }
.scr-head .title { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; text-align: center; }
.scr-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 28px; scrollbar-width: none; overscroll-behavior: contain; }
.scr-body::-webkit-scrollbar { display: none; }
.scr-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 30%); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--surface); box-shadow: var(--sh-1); flex: none; position: relative; transition: transform .15s var(--ease); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.plain { background: none; box-shadow: none; }
.icon-btn .pip { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
.head-spacer { width: 42px; flex: none; }

/* ---------- Tabbar ---------- */
.tabbar { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 -1px 0 var(--line); z-index: 5; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; font-size: 11px; font-weight: 600; color: var(--ink-3); position: relative; transition: color .25s; }
.tab .ico { transition: transform .35s var(--spring); }
.tab.on { color: var(--brand); }
.tab.on .ico { transform: translateY(-1px) scale(1.08); }
.tab .cnt { position: absolute; top: 2px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); animation: popBadge .4s var(--spring); }
@keyframes popBadge { from { transform: scale(0); } }
.tab-ind { position: absolute; top: 0; height: 3px; width: 28px; border-radius: 0 0 3px 3px; background: var(--brand); transition: left .45s var(--spring); }

/* ---------- Splash ---------- */
.splash { position: absolute; inset: 0; z-index: 200; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 0%, #2A47E8 0%, #111A66 45%, #070B26 100%); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.splash .mk { animation: mkIn .9s var(--spring) both; filter: drop-shadow(0 20px 40px rgba(0,0,0,.4)); }
.splash .wm { color: #fff; font-weight: 800; font-size: 30px; letter-spacing: -0.04em; margin-top: 18px; text-align: center; animation: fu .7s var(--ease) .35s both; }
@keyframes mkIn { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
@keyframes fu { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Welcome ---------- */
.welcome { flex: 1; display: flex; flex-direction: column; background: radial-gradient(120% 70% at 80% 0%, #2B49EA 0%, #121B66 45%, #070B26 85%); color: #fff; position: relative; overflow: hidden; }
.welcome .orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5; animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-30px, 40px) scale(1.15); } }
.w-top { flex: 1; position: relative; padding: calc(28px + env(safe-area-inset-top)) 24px 0; }
.w-stack { position: absolute; left: 24px; right: 24px; top: 46%; translate: 0 -50%; height: 230px; }
.w-card { position: absolute; left: 0; right: 0; margin: auto; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 22px; background: rgba(255,255,255,.1); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 20px 40px -20px rgba(0,0,0,.5); font-size: 13px; opacity: 0; animation: wc .9s var(--spring) both, bob 6s ease-in-out infinite; }
.w-card b { display: block; font-size: 15px; }
.w-card small { color: rgba(255,255,255,.65); font-size: 12.5px; }
.w-card .ci { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.w-card:nth-child(1) { top: 0; width: 88%; animation-delay: .35s, 1.3s; }
.w-card:nth-child(2) { top: 86px; width: 96%; animation-delay: .5s, 1.6s; left: 12px; }
.w-card:nth-child(3) { top: 172px; width: 84%; animation-delay: .65s, 1.9s; }
@keyframes wc { from { opacity: 0; transform: translateY(30px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { translate: 0 -6px; } }
.w-panel { background: var(--surface); color: var(--ink); border-radius: 32px 32px 0 0; padding: 30px 22px calc(18px + env(safe-area-inset-bottom)); position: relative; animation: riseIn .7s var(--ease) .2s both; }
.w-panel h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.04; }
.w-panel .sub { color: var(--ink-2); margin-top: 10px; font-size: 15.5px; }
.w-actions { display: grid; gap: 10px; margin-top: 26px; }
.legal { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 14px; line-height: 1.5; }
.legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Onboarding ---------- */
.ob { flex: 1; display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 22px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; scrollbar-width: none; }
.ob h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.06; }
.ob .sub { color: var(--ink-2); margin-top: 10px; font-size: 15.5px; }
.ob-top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; min-height: 42px; }
.progress { flex: 1; display: flex; gap: 6px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress i::after { content: ''; position: absolute; inset: 0; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.progress i.on::after { transform: none; }
.code-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 30px; }
.code-inputs input { height: 64px; text-align: center; font-size: 26px; font-weight: 700; padding: 0; border-radius: 16px; }
.code-inputs input.ok { border-color: var(--success); box-shadow: 0 0 0 4px var(--success-soft); transition-delay: calc(var(--i) * 40ms); }
.choice { display: flex; gap: 16px; align-items: center; padding: 20px 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--sh-2); text-align: left; width: 100%; border: 2px solid transparent; transition: border-color .25s, transform .2s var(--ease), box-shadow .25s; }
.choice:active { transform: scale(.98); }
.choice.on { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--sh-2); }
.choice .ci { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.choice b { display: block; font-size: 17px; letter-spacing: -0.02em; }
.choice span { font-size: 14px; color: var(--ink-2); line-height: 1.4; display: block; margin-top: 3px; }
.choice .radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-left: auto; transition: border .25s var(--spring); }
.choice.on .radio { border: 7px solid var(--brand); }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 44px; cursor: pointer; }
.select-wrap .ico { position: absolute; right: 16px; top: 17px; color: var(--ink-3); pointer-events: none; }
.assigned-card { border-radius: 28px; padding: 22px; color: #fff; background: radial-gradient(120% 120% at 100% 0%, #3557FF 0%, #1A2585 45%, #0A1033 100%); position: relative; overflow: hidden; box-shadow: 0 30px 60px -24px rgba(26,37,133,.6); }
.assigned-card::after, .bal-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.16) 45%, transparent 60%); transform: translateX(-100%); animation: sheen 6s ease-in-out infinite 1.2s; pointer-events: none; }
@keyframes sheen { 25%, 100% { transform: translateX(100%); } }
.assigned-card .kvw { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); }
.assigned-card .kvw span:nth-child(odd) { color: rgba(255,255,255,.6); }
.ref-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 8px 0 18px; border-radius: 16px; background: var(--surface); box-shadow: var(--sh-1); width: 100%; font-weight: 600; font-size: 15px; }
.ref-box .cp { height: 40px; padding: 0 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

/* ---------- Home ---------- */
.greet { flex: 1; min-width: 0; }
.greet small { display: block; color: var(--ink-3); font-size: 13px; font-weight: 500; }
.greet b { font-size: 18px; letter-spacing: -0.025em; display: flex; align-items: center; gap: 4px; }
.me-ava { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #E4E8F2, #CDD3E1); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
:root[data-theme="dark"] .me-ava { background: var(--surface-3); }
.stories { display: flex; gap: 10px; overflow-x: auto; margin: 4px -16px 0; padding: 6px 16px 10px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 86px; height: 104px; border-radius: 20px; padding: 9px; color: #fff; font-size: 11.5px; font-weight: 600; line-height: 1.2; display: flex; flex-direction: column; justify-content: space-between; text-align: left; position: relative; box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px var(--brand); transition: transform .2s var(--ease), box-shadow .3s; }
.story.seen { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4px var(--line); }
.story:active { transform: scale(.95); }
.story .ico { width: 26px; height: 26px; opacity: .95; }
.bal-card { margin-top: 10px; border-radius: 28px; padding: 22px 20px 20px; color: #fff; position: relative; overflow: hidden; background: radial-gradient(130% 120% at 100% 0%, #3A5CFF 0%, #1B2790 42%, #0A1033 100%); box-shadow: 0 24px 50px -24px rgba(27,39,144,.65); }
.bal-card .deco { position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.08); }
.bal-card .deco.d2 { right: -80px; top: -80px; width: 280px; height: 280px; }
.bal-card .amt { font-size: 40px; font-weight: 700; letter-spacing: -0.045em; margin-top: 6px; line-height: 1.1; }
.bal-card .amt small { font-size: 20px; color: rgba(255,255,255,.55); font-weight: 600; margin-left: 6px; letter-spacing: -0.02em; }
.bal-card .eye { color: rgba(255,255,255,.7); padding: 4px; }
.qa-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 18px; }
.qa-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink); transition: transform .15s var(--ease); }
.qa-btn:active { transform: scale(.93); }
.qa-btn i { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--sh-2); color: var(--brand); }
.qa-btn.primary i { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 2px 12px; }
.sec-title h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.sec-title button { font-size: 14px; color: var(--brand); font-weight: 600; }
.row { display: flex; align-items: center; gap: 12px; }
.list { display: grid; overflow: hidden; }
.li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; text-align: left; position: relative; transition: background .2s; }
.li:active { background: var(--surface-2); }
.li + .li::before { content: ''; position: absolute; top: 0; left: 74px; right: 0; height: 1px; background: var(--line); }
.li-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main span { font-size: 13px; color: var(--ink-3); }
.li-end { text-align: right; font-size: 15.5px; font-weight: 600; white-space: nowrap; }
.li-end small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.tip { display: flex; gap: 14px; padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--sh-2); color: var(--ink-2); font-size: 13.5px; line-height: 1.45; align-items: flex-start; }
.tip .ti { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.tip b { color: var(--ink); display: block; font-size: 14.5px; margin-bottom: 2px; }
.tip.warn .ti { background: var(--warn-soft); color: var(--warn); }
.tip.ok .ti { background: var(--success-soft); color: var(--success); }
.active-deal { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-top: 14px; width: 100%; text-align: left; border-radius: 22px; background: var(--surface); box-shadow: var(--sh-2); position: relative; overflow: hidden; }
.active-deal::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--warn); }
.active-deal.confirm::before { background: var(--brand); }
.pulse-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); position: relative; flex: none; }
.pulse-ico::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { from { transform: scale(1); opacity: .6; } to { transform: scale(1.5); opacity: 0; } }

/* Seller blocks */
.my-seller { padding: 16px; }
.my-seller .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.seller-name { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 16px; letter-spacing: -0.015em; min-width: 0; }
.seller-name .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vf { width: 17px; height: 17px; flex: none; }
.seller-meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 1px; }

/* ---------- P2P ---------- */
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--surface-3); border-radius: 16px; }
.seg button { position: relative; z-index: 1; height: 42px; border-radius: 12px; font-weight: 600; font-size: 15px; color: var(--ink-2); transition: color .3s; }
.seg button.on { color: var(--ink); }
.seg .knob { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px; background: var(--surface); box-shadow: var(--sh-2); transition: transform .45s var(--spring); }
.seg.right .knob { transform: translateX(100%); }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 6px; padding: 2px 16px 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--sh-1); font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; flex: none; transition: background .25s, color .25s, transform .15s var(--ease); }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--ink); color: var(--surface); }
:root[data-theme="dark"] .chip.on { background: #fff; color: #0D1326; }
.chip .ico { width: 16px; height: 16px; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--sh-1); margin-top: 12px; color: var(--ink-3); transition: box-shadow .2s; }
.search:focus-within { box-shadow: 0 0 0 2px var(--brand), 0 0 0 6px var(--brand-soft); }
.search input { flex: 1; background: none; border: 0; outline: none; font-size: 16px; min-width: 0; color: var(--ink); }
.search .cur { font-size: 14px; font-weight: 600; }
.offer { padding: 16px; margin-top: 12px; transition: transform .2s var(--ease); }
.offer.mine { box-shadow: 0 0 0 2px var(--brand), var(--sh-2); }
.offer-top { display: flex; gap: 12px; align-items: center; }
.mine-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 8px; border-radius: 6px; margin-bottom: 10px; }
.offer-mid { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 16px; gap: 10px; }
.price { font-size: 26px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.price small { font-size: 15px; color: var(--ink-3); font-weight: 600; margin-left: 3px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin-top: 10px; }
.kv span { white-space: nowrap; }
.kv span:nth-child(odd) { color: var(--ink-3); }
.kv span:nth-child(even) { color: var(--ink); font-weight: 500; }
.offer-mid > div:first-child { min-width: 0; }
.methods { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.method { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.method::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--m, var(--brand)); }
.method + .method { margin-left: 8px; }
.offer-btns { display: flex; gap: 8px; flex: none; }
.empty { text-align: center; padding: 56px 24px; color: var(--ink-3); }
.empty .ei { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); box-shadow: var(--sh-2); display: grid; place-items: center; margin: 0 auto 16px; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* Skeleton */
.sk { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.sk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); transform: translateX(-100%); animation: skl 1.2s infinite; }
:root[data-theme="dark"] .sk::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes skl { to { transform: translateX(100%); } }

/* Seller profile */
.prof-hero { text-align: center; padding: 4px 0 22px; }
.prof-hero .avatar { width: 88px; height: 88px; font-size: 34px; margin: 0 auto; box-shadow: 0 16px 30px -12px rgba(13,19,38,.35); }
.prof-hero .avatar .dot { width: 16px; height: 16px; border-width: 3.5px; border-color: var(--bg); transform: translate(-2px, -2px); }
.prof-hero h2 { font-size: 26px; letter-spacing: -0.035em; margin-top: 16px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 16px 8px; text-align: center; position: relative; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--line); }
.stat b { display: block; font-size: 19px; letter-spacing: -0.03em; }
.stat span { font-size: 12px; color: var(--ink-3); font-weight: 500; }

/* ---------- Chat ---------- */
.chat-head { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 1px 0 var(--line); }
.chat-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg); background-image: radial-gradient(circle at 1px 1px, rgba(13,19,38,.05) 1px, transparent 0); background-size: 22px 22px; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 4px; scrollbar-width: none; }
.chat-body::-webkit-scrollbar { display: none; }
.chat-banner { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); background: var(--surface); box-shadow: var(--sh-1); border-radius: 16px; padding: 12px 14px; margin: 0 8px 8px; line-height: 1.45; }
.chat-banner .ico { color: var(--brand); width: 18px; height: 18px; margin-top: 1px; }
.day { align-self: center; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); margin: 8px 0; }
.msg { max-width: 78%; padding: 9px 14px; border-radius: 20px; font-size: 15px; line-height: 1.38; position: relative; word-wrap: break-word; box-shadow: var(--sh-1); }
.msg.new { animation: msgIn .4s var(--spring) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.msg time { font-size: 11px; color: var(--ink-3); margin-left: 10px; float: right; margin-top: 6px; line-height: 1; }
.msg.in { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 6px; transform-origin: bottom left; }
.msg.out { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; transform-origin: bottom right; }
.msg.out time { color: rgba(255,255,255,.7); }
.msg img { display: block; max-width: 210px; border-radius: 14px; margin: 3px -8px 6px; }
.msg + .msg.in, .msg + .msg.out { margin-top: 2px; }
.sys-card { align-self: stretch; margin: 8px 4px; padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--sh-2); animation: msgIn .5s var(--spring) both; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; border-radius: 20px; border-bottom-left-radius: 6px; background: var(--surface); box-shadow: var(--sh-1); animation: msgIn .3s var(--spring) both; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.quick-row { display: flex; gap: 8px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
.composer { display: flex; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.composer input[type=text] { flex: 1; height: 46px; border-radius: 23px; padding: 0 18px; background: var(--surface); border: 0; box-shadow: var(--sh-1); outline: none; min-width: 0; font-size: 15.5px; }
.send { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--sh-brand); transition: transform .2s var(--spring); }
.send:active { transform: scale(.88); }
.deal-pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; box-shadow: var(--sh-brand); flex: none; }

/* ---------- Sheets ---------- */
.overlay { position: absolute; inset: 0; z-index: 50; background: rgba(10,16,51,.42); display: flex; align-items: flex-end; animation: ovIn .3s both; }
.overlay.closing { animation: ovOut .3s both; }
@keyframes ovIn { from { opacity: 0; } } @keyframes ovOut { to { opacity: 0; } }
.sheet { width: 100%; max-height: 92%; overflow-y: auto; background: var(--bg); border-radius: 32px 32px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheetUp .5s var(--spring) both; scrollbar-width: none; touch-action: pan-y; }
.overlay.closing .sheet { animation: sheetDown .3s var(--ease) both; }
.sheet::-webkit-scrollbar { display: none; }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--ink-3); opacity: .35; margin: 0 auto 16px; cursor: grab; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h3 { font-size: 22px; letter-spacing: -0.03em; }
.big-amount { padding: 16px 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--sh-2); border: 2px solid transparent; transition: border-color .2s, box-shadow .2s; }
.big-amount:focus-within { border-color: var(--brand); }
.big-amount.err { border-color: var(--danger); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.big-amount .lbl { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.big-amount .inrow { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.big-amount input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 34px; font-weight: 700; letter-spacing: -0.04em; }
.big-amount .cur { font-weight: 700; font-size: 18px; color: var(--ink-3); }
.swap-mid { display: grid; place-items: center; margin: -10px 0; position: relative; z-index: 1; }
.swap-mid i { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); box-shadow: var(--sh-2), 0 0 0 4px var(--bg); display: grid; place-items: center; color: var(--brand); }
.receive { padding: 16px 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--sh-1); }
.receive b { font-size: 26px; letter-spacing: -0.035em; display: block; margin-top: 2px; }
.pm-list { display: grid; gap: 8px; }
.pm { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--sh-1); border: 2px solid transparent; text-align: left; width: 100%; font-weight: 500; transition: border-color .2s; }
.pm.on { border-color: var(--brand); }
.pm .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-left: auto; flex: none; transition: border .25s var(--spring); }
.pm.on .radio { border: 7px solid var(--brand); }
.pm-sw { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex: none; }
.summary { display: grid; gap: 10px; font-size: 14px; padding: 16px 4px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; }
.summary span:first-child { color: var(--ink-3); }

/* ---------- Deal ---------- */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 18px; }
.stepper div { display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.stepper i { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; position: relative; }
.stepper i::after { content: ''; position: absolute; inset: 0; background: var(--brand); transform: scaleX(0); transform-origin: left; animation: fill .8s var(--ease) forwards; animation-delay: var(--d); }
.stepper .done i::after { --to: 1; }
.stepper .now i::after { animation-name: fillHalf; }
.stepper div:not(.done):not(.now) i::after { display: none; }
@keyframes fill { to { transform: scaleX(1); } }
@keyframes fillHalf { to { transform: scaleX(.5); } }
.stepper .done, .stepper .now { color: var(--ink); }
.timer { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--sh-2); }
.timer-ring { width: 54px; height: 54px; flex: none; position: relative; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .tr-bg { stroke: var(--surface-3); }
.timer-ring .tr-fg { stroke: var(--warn); transition: stroke-dashoffset 1s linear; }
.timer b { font-size: 24px; letter-spacing: -0.03em; }
.req { padding: 2px 16px; }
.req-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; }
.req-row + .req-row { border-top: 1px solid var(--line); }
.req-row > span { font-size: 14px; color: var(--ink-3); }
.req-row b { font-size: 15.5px; font-weight: 600; text-align: right; }
.copy { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.copy .cpi { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; transition: transform .2s var(--spring); }
.copy:active .cpi { transform: scale(.85); }
.copy .cpi .ico { width: 15px; height: 15px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border-radius: 22px; border: 2px dashed color-mix(in srgb, var(--brand) 40%, transparent); background: var(--brand-soft); text-align: center; cursor: pointer; color: var(--ink-2); font-size: 13.5px; transition: transform .2s var(--ease); }
.drop:active { transform: scale(.98); }
.drop .di { width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 6px; box-shadow: var(--sh-brand); }
.shot { border-radius: 22px; background: var(--surface); box-shadow: var(--sh-2); display: flex; gap: 14px; align-items: center; padding: 10px 12px 10px 10px; animation: msgIn .45s var(--spring) both; }
.shot img { width: 60px; height: 60px; object-fit: cover; border-radius: 14px; }
.wait { text-align: center; padding: 18px 0 6px; }
.orbit { width: 120px; height: 120px; margin: 0 auto 22px; position: relative; display: grid; place-items: center; }
.orbit .core { width: 76px; height: 76px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: var(--sh-brand); position: relative; z-index: 1; }
.orbit .core .ico { width: 34px; height: 34px; }
.orbit .rg { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--brand); opacity: 0; animation: orb 2.4s var(--ease) infinite; }
.orbit .rg:nth-child(2) { animation-delay: .8s; } .orbit .rg:nth-child(3) { animation-delay: 1.6s; }
@keyframes orb { from { transform: scale(.6); opacity: .5; } to { transform: scale(1.25); opacity: 0; } }
.success-mark { width: 110px; height: 110px; margin: 0 auto 22px; }
.success-mark circle { fill: var(--success); transform-origin: center; animation: scaleIn .6s var(--spring) both; }
.success-mark path { stroke: #fff; stroke-width: 7; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s var(--ease) .35s forwards; }
@keyframes scaleIn { from { transform: scale(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.big-sum { font-size: 40px; font-weight: 800; letter-spacing: -0.045em; color: var(--success); margin-top: 6px; }
.stars { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.stars button { transition: transform .3s var(--spring); }
.stars button:active { transform: scale(1.3); }
.stars button .ico { width: 34px; height: 34px; color: var(--surface-3); fill: var(--surface-3); }
.stars button.on .ico { color: #FFB020; fill: #FFB020; }
#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 60; }

/* ---------- Settings ---------- */
.profile-card { padding: 20px; display: flex; align-items: center; gap: 16px; }
.set-group { margin-top: 24px; }
.set-group > small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 0 6px 10px; }
.set-item { display: flex; align-items: center; gap: 14px; padding: 13px 16px; width: 100%; text-align: left; position: relative; transition: background .2s; }
.set-item:active { background: var(--surface-2); }
.set-item + .set-item::before { content: ''; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.set-item .si { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.set-item .si .ico { width: 18px; height: 18px; stroke-width: 2.1; }
.set-item .lbl { flex: 1; font-size: 15.5px; font-weight: 500; }
.set-item .val { font-size: 14px; color: var(--ink-3); }
.set-item > .ico:last-child { color: var(--ink-3); width: 18px; height: 18px; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--surface-3); position: relative; transition: background .3s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .4s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.switch.on { background: #34C759; }
.switch.on::after { transform: translateX(20px); }

/* ---------- Stories viewer ---------- */
.sv { position: absolute; inset: 0; z-index: 90; color: #fff; display: flex; flex-direction: column; animation: svIn .4s var(--ease) both; }
.sv.closing { animation: svOut .3s var(--ease) both; }
@keyframes svIn { from { opacity: 0; transform: scale(.92); border-radius: 40px; } }
@keyframes svOut { to { opacity: 0; transform: scale(.92); } }
.sv-bars { display: flex; gap: 4px; padding: calc(14px + env(safe-area-inset-top)) 12px 0; }
.sv-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.sv-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sv-bars i.done b { width: 100%; }
.sv-bars i.now b { animation: svp 5s linear forwards; }
@keyframes svp { to { width: 100%; } }
.sv-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; font-size: 14px; }
.sv-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 24px 40px; }
.sv-body .big-ico { width: 88px; height: 88px; border-radius: 28px; background: rgba(255,255,255,.16); display: grid; place-items: center; margin-bottom: auto; margin-top: 80px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); animation: mkIn .7s var(--spring) both; }
.sv-body .big-ico .ico { width: 44px; height: 44px; stroke-width: 1.6; }
.sv-body h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; animation: fu .6s var(--ease) .1s both; }
.sv-body p { font-size: 17px; opacity: .85; margin-top: 14px; line-height: 1.5; animation: fu .6s var(--ease) .2s both; }
.sv-tap { position: absolute; top: 80px; bottom: 120px; width: 40%; z-index: 1; }

/* ---------- Toast ---------- */
.toast { position: absolute; left: 50%; top: calc(14px + env(safe-area-inset-top)); z-index: 120; display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border-radius: 18px; background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 500; box-shadow: var(--sh-3); animation: toastIn .5s var(--spring) both; width: max-content; max-width: calc(100% - 32px); translate: -50% 0; }
:root[data-theme="dark"] .toast { background: #fff; color: #0D1326; }
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast .ico { color: #4ADE80; width: 20px; height: 20px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.95); } }
