:root {
  --bg: #07060c;
  --bg-2: #0e0c18;
  --card: rgba(255, 255, 255, .045);
  --card-2: rgba(255, 255, 255, .07);
  --stroke: rgba(255, 255, 255, .08);
  --stroke-2: rgba(255, 255, 255, .14);
  --text: #f4f3ff;
  --muted: #9b98b8;
  --faint: #6c6988;
  --violet: #7b5cff;
  --violet-2: #5b3df5;
  --blue: #3fa9ff;
  --teal: #37e3c3;
  --pink: #ff4d8d;
  --red: #ff4d5e;
  --green: #2fd17c;
  --yellow: #ffc83d;
  --grad: linear-gradient(135deg, #7b5cff 0%, #4f7bff 55%, #3fa9ff 100%);
  --grad-hot: linear-gradient(135deg, #ff4d8d 0%, #ff5e5e 100%);
  --grad-green: linear-gradient(135deg, #2fd17c 0%, #1fb8a0 100%);
  --radius: 22px;
  --radius-s: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.glow { position: fixed; pointer-events: none; z-index: 0; border-radius: 50%; filter: blur(70px); opacity: .55; }
.glow-a { width: 340px; height: 340px; top: -160px; right: -120px; background: #4b2bd6; }
.glow-b { width: 300px; height: 300px; top: 420px; left: -200px; background: #1b4fb8; opacity: .35; }

.app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 14px 16px calc(28px + var(--safe-b)); }

/* ---------- boot / error ---------- */
.boot { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.boot-logo { width: 96px; animation: pulse 2s ease-in-out infinite; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.fatal { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 0 20px; }
.fatal h2 { margin: 0; font-size: 20px; }
.fatal p { margin: 0; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; animation: rise .4s ease both; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -.2px; }
.brand img { width: 34px; height: auto; }
.balance-chip {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--stroke); font-weight: 650; font-size: 14px;
}
.balance-chip .plus { width: 22px; height: 22px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; }
.balance-chip .plus svg { width: 13px; height: 13px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--stroke-2); color: #d9d6f2; font-size: 13.5px; margin-bottom: 14px;
  animation: rise .4s .05s ease both;
}
.pill svg { width: 13px; height: 13px; color: #fff; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 22px 20px 20px; min-height: 236px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(123,92,255,.28), transparent 60%), linear-gradient(180deg, #13102a 0%, #0b0a17 100%);
  border: 1px solid rgba(123, 92, 255, .35);
  box-shadow: 0 20px 60px -20px rgba(91, 61, 245, .55), inset 0 1px 0 rgba(255,255,255,.06);
  animation: rise .45s .08s ease both;
}
.hero-art {
  position: absolute; right: -24px; top: -6px; width: 58%; max-width: 250px; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
  opacity: .95;
}
.hero-content { position: relative; z-index: 1; max-width: 64%; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; padding: 5px 11px; border-radius: 999px; background: rgba(47, 209, 124, .12); color: #6cf0a8; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.status.trial { background: rgba(63,169,255,.13); color: #7cc6ff; }
.status.off { background: rgba(255, 77, 94, .13); color: #ff8a95; }
.status.new { background: rgba(123,92,255,.18); color: #b8a6ff; }
.big { font-size: 46px; line-height: 1; font-weight: 800; letter-spacing: -1.5px; margin: 16px 0 6px; background: linear-gradient(180deg, #fff 30%, #b9b3ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big small { font-size: 20px; letter-spacing: -.3px; font-weight: 700; margin-left: 4px; }
.sub-date { color: var(--muted); font-size: 14px; }
.feat { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 7px; font-size: 14px; color: #dcd9f5; }
.feat li { display: flex; align-items: center; gap: 8px; }
.feat svg { width: 16px; height: 16px; color: var(--teal); flex: none; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 10px; margin-top: 20px; }
.hero-actions .btn { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px;
  border-radius: var(--radius-s); font-weight: 700; font-size: 15.5px; letter-spacing: -.1px;
  transition: transform .12s ease, opacity .2s ease, filter .2s ease; user-select: none; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-primary { background: var(--grad); box-shadow: 0 10px 26px -10px rgba(79, 123, 255, .8); }
.btn-hot { background: var(--grad-hot); box-shadow: 0 10px 26px -10px rgba(255, 77, 141, .7); }
.btn-green { background: var(--grad-green); box-shadow: 0 10px 26px -10px rgba(47, 209, 124, .6); }
.btn-ghost { background: var(--card-2); border: 1px solid var(--stroke); }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }

/* ---------- quick grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; animation: rise .45s .12s ease both; }
.tile {
  position: relative; text-align: left; padding: 14px; border-radius: 20px; background: var(--card);
  border: 1px solid var(--stroke); min-height: 104px; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .12s ease, background .2s ease;
}
.tile:active { transform: scale(.97); background: var(--card-2); }
.tile .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.tile .ic svg { width: 20px; height: 20px; }
.tile b { display: block; font-size: 15px; margin-top: 10px; }
.tile span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.ic-violet { background: rgba(123,92,255,.18); color: #b3a2ff; }
.ic-blue { background: rgba(63,169,255,.16); color: #86cbff; }
.ic-teal { background: rgba(55,227,195,.14); color: #6ff0d6; }
.ic-pink { background: rgba(255,77,141,.15); color: #ff8fb7; }
.ic-yellow { background: rgba(255,200,61,.14); color: #ffd978; }
.ic-green { background: rgba(47,209,124,.14); color: #71eaa7; }

/* ---------- sections ---------- */
.section { margin-top: 26px; animation: rise .45s .16s ease both; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 12px; }
.section-head h3 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.section-head span { color: var(--muted); font-size: 13px; }

.plans-banner {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; min-height: 96px;
  background: linear-gradient(120deg, #17123a 0%, #0d0b1c 70%); border: 1px solid var(--stroke);
}
.plans-banner img { position: absolute; right: -18px; top: -14px; width: 150px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
.plans-banner .t { position: relative; font-weight: 750; font-size: 16px; max-width: 64%; }
.plans-banner .d { position: relative; color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 64%; }

.plan {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--stroke); margin-bottom: 8px; text-align: left;
  transition: transform .12s ease, border-color .2s ease;
}
.plan:active { transform: scale(.98); }
.plan.hot { border-color: rgba(255, 77, 141, .45); background: linear-gradient(120deg, rgba(255,77,141,.10), rgba(255,255,255,.03)); }
.plan .p-main { flex: 1; min-width: 0; }
.plan .p-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.plan .p-note { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.plan .p-price { font-weight: 800; font-size: 18px; white-space: nowrap; }
.tag { font-size: 11.5px; font-weight: 750; padding: 3px 8px; border-radius: 999px; background: rgba(47,209,124,.15); color: #74ecab; white-space: nowrap; }
.plan.hot .tag { background: rgba(255,77,141,.18); color: #ff9cc0; }
.chev { width: 18px; height: 18px; color: var(--faint); flex: none; }

.ref-card {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 20px 18px 18px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(55,227,195,.22), transparent 60%), linear-gradient(135deg, #1a1440 0%, #0f1a3a 100%);
  border: 1px solid rgba(55, 227, 195, .28);
}
.ref-card h4 { margin: 0; font-size: 22px; letter-spacing: -.5px; }
.ref-card p { margin: 6px 0 0; color: #c9c6e6; font-size: 14px; }
.ref-stats { display: flex; gap: 10px; margin: 16px 0; }
.ref-stats div { flex: 1; background: rgba(0,0,0,.25); border-radius: 14px; padding: 10px 12px; }
.ref-stats b { display: block; font-size: 19px; }
.ref-stats span { font-size: 12px; color: var(--muted); }
.ref-perks { display: grid; gap: 8px; margin: 0 0 16px; font-size: 13.5px; color: #dcd9f5; }
.ref-perks div { display: flex; gap: 9px; align-items: flex-start; }
.ref-perks svg { width: 17px; height: 17px; color: var(--teal); flex: none; margin-top: 1px; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; }

.list { border-radius: var(--radius); background: var(--card); border: 1px solid var(--stroke); overflow: hidden; }
.list-item { width: 100%; display: flex; align-items: center; gap: 13px; padding: 14px 16px; text-align: left; }
.list-item + .list-item { border-top: 1px solid var(--stroke); }
.list-item:active { background: var(--card-2); }
.list-item .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.list-item .ic svg { width: 18px; height: 18px; }
.list-item .t { flex: 1; font-weight: 600; }
.list-item .t small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }

.foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 26px; }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(3, 2, 8, .62); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto;
  max-height: 88vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #15122a 0%, #0c0a17 60%); border: 1px solid var(--stroke-2); border-bottom: 0;
  border-radius: 28px 28px 0 0; transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
}
.sheet.open { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.18); margin: 10px auto 0; flex: none; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px 18px calc(22px + var(--safe-b)); }
.sheet-body.swap { animation: rise .25s ease both; }
.sh-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sh-head .back { width: 36px; height: 36px; border-radius: 12px; background: var(--card-2); display: grid; place-items: center; flex: none; }
.sh-head .back svg { width: 18px; height: 18px; }
.sh-head h2 { margin: 0; font-size: 20px; letter-spacing: -.3px; flex: 1; }
.sh-text { color: #cfcce8; font-size: 14.5px; margin: 0 0 16px; }
.sh-text b { color: #fff; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 10px; }

.pay-sum { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--stroke); margin-bottom: 16px; }
.pay-sum .l { font-weight: 700; font-size: 16px; }
.pay-sum .l small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.pay-sum .r { font-size: 24px; font-weight: 800; }

.method { width: 100%; display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--stroke); text-align: left; transition: transform .12s ease; }
.method:active { transform: scale(.98); }
.method .ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.method .ic svg { width: 21px; height: 21px; }
.method .t { flex: 1; font-weight: 650; }
.method .t small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.method.best { border-color: rgba(47, 209, 124, .45); }
.method.loading { opacity: .6; pointer-events: none; }
.method.loading .chev { animation: spin .7s linear infinite; }

.link-box { border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid var(--stroke); padding: 12px 12px 12px 14px; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.link-box .lb-main { flex: 1; min-width: 0; }
.link-box .lb-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.link-box code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: #d7d4f5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.3); margin-bottom: 16px; }
.seg button { padding: 9px 0; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card-2); color: #fff; box-shadow: inset 0 0 0 1px var(--stroke-2); }

.steps { display: grid; gap: 10px; margin-bottom: 16px; }
.step { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--stroke); }
.step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: rgba(123,92,255,.2); color: #c3b6ff; flex: none; }
.step .n.done { background: rgba(47,209,124,.2); color: #74ecab; }
.step .n svg { width: 16px; height: 16px; }
.step .t { flex: 1; font-weight: 600; font-size: 14.5px; }
.step .t small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.step .btn { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }

.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.amounts button { padding: 14px 0; border-radius: 14px; background: var(--card); border: 1px solid var(--stroke); font-weight: 700; font-size: 16px; }
.amounts button.on { border-color: var(--violet); background: rgba(123,92,255,.16); }
.field { width: 100%; height: 52px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid var(--stroke-2); padding: 0 16px; font-size: 16px; outline: none; margin-bottom: 14px; }
.field:focus { border-color: var(--violet); }

.result { text-align: center; padding: 10px 0 4px; }
.result .badge { width: 84px; height: 84px; border-radius: 50%; margin: 6px auto 16px; display: grid; place-items: center; background: radial-gradient(circle, rgba(47,209,124,.3), rgba(47,209,124,.06) 70%); color: #74ecab; animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.result .badge.err { background: radial-gradient(circle, rgba(255,77,94,.3), rgba(255,77,94,.06) 70%); color: #ff8a95; }
.result .badge.wait { background: radial-gradient(circle, rgba(63,169,255,.28), rgba(63,169,255,.05) 70%); color: #86cbff; }
.result .badge svg { width: 40px; height: 40px; }
.result .badge .spinner { width: 34px; height: 34px; border-width: 3.5px; border-top-color: #86cbff; }
.result h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.4px; }
.result p { margin: 0 auto 20px; color: #cfcce8; max-width: 340px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

.dev-count { text-align: center; margin: 4px 0 18px; }
.dev-count b { display: block; font-size: 54px; line-height: 1; font-weight: 800; letter-spacing: -2px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dev-count span { color: var(--muted); font-size: 13.5px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(47,209,124,.08); color: #aee9c8; font-size: 13.5px; margin-top: 14px; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note.warn { background: rgba(255,200,61,.08); color: #f3d98f; }

.usage { margin: 0 0 16px; }
.usage-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.usage-top b { font-size: 16px; }
.usage-top span { color: var(--muted); font-size: 13px; }
.usage-bar { height: 8px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; }
.usage-bar i { display: block; height: 100%; border-radius: 8px; background: var(--grad); transition: width .5s ease; }
.usage-bar i.full { background: var(--grad-hot); }
.dev-list { display: grid; gap: 8px; margin-bottom: 16px; }
.dev { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--stroke); }
.dev .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.dev .ic svg { width: 19px; height: 19px; }
.dev .t { flex: 1; min-width: 0; }
.dev .t b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev .t small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev { align-items: flex-start; }
.app-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.app-chip { font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: rgba(123,92,255,.16); color: #c3b6ff; }
.unbind { flex: none; align-self: center; font-size: 13px; font-weight: 650; padding: 8px 12px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--stroke); color: #d9d6f2; transition: background .2s ease; }
.unbind.confirm { background: rgba(255, 77, 94, .18); border-color: rgba(255, 77, 94, .45); color: #ff9aa4; }
.unbind.loading { opacity: .6; pointer-events: none; }
.usage-note { color: var(--muted); font-size: 12.5px; margin-top: 7px; }
.dev-empty { padding: 16px; border-radius: 16px; border: 1px dashed var(--stroke-2); color: var(--muted); font-size: 13.5px; text-align: center; margin-bottom: 16px; }
.skeleton { height: 64px; border-radius: 16px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.08), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.month-row { display: flex; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--stroke); }
.month-row:last-child { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 40; transform: translate(-50%, 20px);
  padding: 11px 18px; border-radius: 999px; background: #232040; border: 1px solid var(--stroke-2); font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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