:root {
  --bg: #070b14;
  --bg2: #0d1424;
  --card: rgba(18, 26, 44, 0.92);
  --line: rgba(120, 140, 200, 0.18);
  --text: #eef2ff;
  --muted: #93a0c0;
  --primary: #22c55e;
  --primary-d: #16a34a;
  --accent: #a78bfa;
  --tg: #2AABEE;
  --danger: #f87171;
  --r: 18px;
  --nav-h: 64px;
  --top-h: 56px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: radial-gradient(ellipse 80% 50% at 50% -10%, #1a2744 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 20px);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 16px rgba(34,197,94,.35); }
.top-right { display: flex; align-items: center; gap: 8px; }
.chip {
  background: rgba(34,197,94,.15); color: #4ade80;
  font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 999px;
}
.icon-btn { font-size: 18px; padding: 6px; opacity: .9; }

.main { max-width: 720px; margin: 0 auto; padding: 14px 14px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 28px); min-height: calc(100dvh - var(--top-h) - var(--nav-h)); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(10, 14, 24, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 600; color: var(--muted); padding: 8px 4px;
}
.nav-item svg { width: 22px; height: 22px; display: block; opacity: .85; }
.nav-item.active svg { opacity: 1; color: var(--primary); fill: currentColor; }
.nav-item .ni { display: none; }
.nav-item.active { color: var(--primary); }

.banner-wrap {
  border-radius: var(--r); overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.banner-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.banner-slide { flex: 0 0 100%; scroll-snap-align: start; }
.banner-slide img { width: 100%; height: 150px; object-fit: cover; display: block; }
@media (min-width: 480px) { .banner-slide img { height: 180px; } }

.hero-card {
  text-align: center; padding: 22px 16px; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(34,197,94,.12), rgba(167,139,250,.1));
  border: 1px solid var(--line); border-radius: var(--r);
}
.hero-card h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.hero-card p { color: var(--muted); margin-top: 6px; font-size: 13px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip-btn {
  padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--bg2); border: 1px solid var(--line); color: var(--muted);
}
.chip-btn.on { background: var(--primary); color: #04140a; border-color: transparent; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  transition: transform .12s, border-color .12s;
}
.card:active { transform: scale(.98); }
.card:hover { border-color: rgba(34,197,94,.4); }
.card-art {
  aspect-ratio: 1; background: #0a1020;
  display: grid; place-items: center; overflow: hidden;
}
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-art.sm { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; aspect-ratio: auto; }
.fb { font-size: 28px; font-weight: 800; color: var(--accent); }
.card-body { padding: 10px 10px 12px; }
.card-body h3 { font-size: 12.5px; font-weight: 700; line-height: 1.3; min-height: 2.5em; }
.card-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.price { color: #4ade80; font-weight: 800; }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 16px;
  box-shadow: 0 10px 32px rgba(0,0,0,.3);
}
.panel.center { text-align: center; }
.panel h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 12px; }
.row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.row.total { border: none; padding-top: 14px; font-size: 16px; }
.row.total b { color: #4ade80; }
.muted { color: var(--muted); }
.muted.sm, .sm { font-size: 13px; margin: 10px 0; }

.app-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.app-head h2 { font-size: 1.1rem; font-weight: 800; }
.pkg-list { display: flex; flex-direction: column; gap: 8px; }
.pkg {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; text-align: left;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
}
.pkg:hover { border-color: rgba(34,197,94,.45); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; padding: 12px 16px; border-radius: 12px;
}
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-primary { background: linear-gradient(135deg, #22c55e, #16a34a); color: #04140a; box-shadow: 0 4px 18px rgba(34,197,94,.35); }
.btn-primary:disabled { opacity: .55; }
.btn-tg { background: var(--tg); color: #fff; }
.btn-ghost { color: var(--muted); }
.btn-mini {
  margin-top: 6px; font-size: 11px; font-weight: 700;
  color: var(--primary); background: rgba(34,197,94,.1);
  padding: 4px 10px; border-radius: 8px;
}
.back { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }

.inp {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font-size: 15px; margin-top: 4px;
}
.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 14px; }
.seg { display: flex; gap: 8px; margin-top: 8px; }
.seg-btn {
  flex: 1; padding: 10px; border-radius: 12px; font-weight: 700; font-size: 13px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--muted);
}
.seg-btn.on { border-color: var(--primary); color: #4ade80; background: rgba(34,197,94,.12); }
.pay-num {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; margin-top: 8px; border-radius: 12px;
  background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25);
}
.pay-num b { font-size: 16px; letter-spacing: .02em; }

.keybox {
  margin: 12px 0; padding: 14px; text-align: left;
  background: #05080f; border-radius: 12px; border: 1px solid var(--line);
  font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; color: #bbf7d0;
}
.key-row, .file-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px; margin-bottom: 8px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
}
.file-row { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.key-row code { font-size: 12px; word-break: break-all; }
.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: rgba(167,139,250,.2); color: #c4b5fd;
  padding: 2px 7px; border-radius: 6px;
}
.big { font-size: 2.2rem; margin-bottom: 6px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.login-ico { font-size: 2rem; margin-bottom: 8px; }
.status { margin: 12px 0; font-size: 13px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px);
  transform: translateX(-50%) translateY(12px);
  background: #1e293b; color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: .22s; z-index: 80; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #166534; }
.toast.err { background: #7f1d1d; }
.modal[hidden] { display: none; }

.acc-hero {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.acc-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(34,197,94,.45); background: #0a1020;
  box-shadow: 0 0 20px rgba(34,197,94,.25);
}
.acc-meta h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 4px; }
.acc-id { font-size: 11px; color: var(--muted); word-break: break-all; }
.acc-tg { font-size: 13px; color: #7dd3fc; margin-top: 4px; }
