:root {
  --bg: #0b0b0c;
  --card: #151517;
  --card-2: #1c1c1f;
  --line: rgba(255, 255, 255, .07);
  --text: #f3f3f1;
  --muted: #8b8b90;
  --yellow: #ffcc00;
  --yellow-2: #ffe04d;
  --yellow-deep: #f2b100;
  --ink: #141414;
  --red: #ff6b5b;
  --green: #b9e86a;
  --radius: 22px;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Onest", -apple-system, "SF Pro Text", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.35;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(120% 60% at 85% -10%, rgba(255, 204, 0, .16), transparent 60%),
    radial-gradient(90% 50% at -10% 30%, rgba(255, 224, 77, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* матовое зерно поверх всего */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background-image: var(--noise); opacity: .07; mix-blend-mode: overlay;
}

.view { padding: 14px 16px 120px; max-width: 520px; margin: 0 auto; }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.pill-btn {
  height: 40px; min-width: 52px; padding: 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  backdrop-filter: blur(12px); font-size: 13px; color: var(--text);
}
.pill-btn svg { width: 18px; height: 18px; }
.id-chip { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.id-chip b { color: var(--text); font-weight: 600; }

h1 { font-size: 30px; font-weight: 400; letter-spacing: -.02em; margin: 0 0 18px; line-height: 1.1; }
h1 b { font-weight: 700; display: block; }
h2 { font-size: 18px; font-weight: 500; margin: 26px 0 12px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- карточки ---------- */
.card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; overflow: hidden;
}
.card::after { /* матовость */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: .05; mix-blend-mode: overlay;
}
.card + .card { margin-top: 10px; }

/* жёлтый герой */
.hero {
  position: relative; border-radius: 28px; padding: 20px; color: var(--ink); overflow: hidden;
  background:
    radial-gradient(70% 90% at 15% 10%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(80% 80% at 100% 100%, rgba(242, 177, 0, .9), transparent 70%),
    linear-gradient(135deg, var(--yellow-2), var(--yellow) 55%, var(--yellow-deep));
  box-shadow: 0 20px 50px -20px rgba(255, 204, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: .22; mix-blend-mode: soft-light;
}
.hero > * { position: relative; z-index: 1; }
.hero .label { font-size: 13px; opacity: .7; }
.hero .big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; margin: 6px 0 2px; }
.hero .sub { font-size: 14px; opacity: .75; }
.hero-inner {
  margin-top: 16px; background: rgba(20, 20, 20, .88); color: var(--text);
  border-radius: 18px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.hero-inner .k { font-size: 12px; color: var(--muted); }
.hero-inner .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.hero .wave { position: absolute; right: -10px; top: -6px; width: 150px; height: 150px; opacity: .18; z-index: 0; }

/* прогресс как в «метах» */
.progress { margin-top: 14px; }
.progress .row { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 22px; border-radius: 6px; background: #0e0e10; overflow: hidden; }
.bar i {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #fff3b0, var(--yellow) 70%, var(--yellow-deep));
}
.bar.sm { height: 8px; border-radius: 99px; }
.bar.sm i { border-radius: 99px; }

/* ---------- тарифы ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan {
  position: relative; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 14px 12px 12px; min-height: 128px; display: flex; flex-direction: column;
  transition: transform .15s, border-color .15s, background .15s;
}
.plan:active { transform: scale(.97); }
.plan .ic {
  position: absolute; right: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--muted); display: grid; place-items: center; color: var(--muted);
}
.plan .ic svg { width: 14px; height: 14px; stroke-width: 2.4; }
.plan .k { font-size: 11px; color: var(--muted); margin-top: auto; }
.plan .d { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.plan .p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.plan .tag {
  position: absolute; left: 10px; top: 10px; font-size: 10px; font-weight: 600; padding: 3px 8px;
  border-radius: 99px; background: var(--yellow); color: var(--ink);
}
/* выделенный тариф на месяц */
.plan.best { width: 100%; min-height: 0; padding: 40px 16px 14px; margin-bottom: 8px; border-color: rgba(255, 204, 0, .35); }
.plan.best .tag { left: 14px; top: 12px; }
.plan.best .ic { right: 14px; top: 12px; }
.plan.best .d { font-size: 26px; display: block; }
.plan.best .k { margin-top: 2px; display: block; }
.best-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.best-price { text-align: right; line-height: 1.1; }
.best-price s { display: block; font-size: 13px; color: var(--muted); }
.best-price b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.best-note { font-size: 12px; color: var(--muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.plan.best.sel { box-shadow: 0 14px 40px -18px rgba(255, 204, 0, .5); }
.upsell {
  width: 100%; margin-top: 8px; padding: 12px 14px; border-radius: 16px; text-align: left; font-size: 13px; line-height: 1.45;
  background: rgba(255, 204, 0, .07); border: 1px dashed rgba(255, 204, 0, .3); color: #e9dca6;
}
.upsell b { color: var(--yellow); }
.upsell .link { display: block; margin-top: 4px; color: var(--yellow); font-weight: 600; }
.plan.sel { border-color: var(--yellow); background: linear-gradient(180deg, rgba(255, 204, 0, .1), var(--card) 70%); }
.plan.sel .ic { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }
.plan.sel .d { color: var(--yellow); }

/* ---------- кнопки ---------- */
.btn {
  width: 100%; height: 54px; border-radius: 18px; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--yellow); color: var(--ink); transition: transform .12s, opacity .12s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.dark { background: var(--ink); color: var(--text); }
.btn.sm { height: 40px; border-radius: 14px; font-size: 14px; width: auto; padding: 0 16px; }
.btn.red { background: rgba(255, 107, 91, .14); color: var(--red); box-shadow: none; }
.btn + .btn { margin-top: 8px; }
.row-btns { display: flex; gap: 8px; }
.row-btns .btn { margin: 0; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }

/* ---------- списки ---------- */
.list .li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; font-size: 14px; }
.list .li + .li { border-top: 1px solid var(--line); }
.list .li .r { color: var(--muted); text-align: right; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.card-head b { font-weight: 500; }
.card-head a, .link { font-size: 12px; color: var(--muted); text-decoration: none; }

.method {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px; text-align: left;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 18px;
}
.method + .method { margin-top: 8px; }
.method .mi { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 204, 0, .12); color: var(--yellow); font-size: 20px; flex: none; }
.method .mt2 { flex: 1; }
.method .mt2 b { display: block; font-weight: 500; }
.method .mt2 span { font-size: 12px; color: var(--muted); }
.method .mp { font-weight: 600; white-space: nowrap; }
.method[disabled] { opacity: .35; pointer-events: none; }

/* ---------- бейджи статусов ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.b-active { background: rgba(185, 232, 106, .14); color: var(--green); }
.b-wait_invite { background: rgba(255, 204, 0, .14); color: var(--yellow); }
.b-queue { background: rgba(160, 160, 255, .14); color: #b9b9ff; }
.b-to_remove { background: rgba(255, 107, 91, .16); color: var(--red); }
.b-expired, .b-none { background: rgba(255, 255, 255, .07); color: var(--muted); }

/* ---------- шит ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 30; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 92vh; overflow-y: auto;
  background: #121214; border-top: 1px solid var(--line); border-radius: 28px 28px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  max-width: 560px; margin: 0 auto;
}
.sheet.open { transform: none; }
.sheet .grip { width: 40px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .15); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; display: flex; justify-content: space-between; align-items: center; }
.sheet .x { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .06); display: grid; place-items: center; }
.sheet .x svg { width: 16px; height: 16px; }

/* табличка суммы */
.amount-plate {
  margin: 14px 0; border-radius: 22px; padding: 18px; text-align: center; color: var(--ink); position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--yellow-2), var(--yellow) 60%, var(--yellow-deep));
}
.amount-plate::after { content: ""; position: absolute; inset: 0; background-image: var(--noise); opacity: .2; mix-blend-mode: soft-light; }
.amount-plate .k { font-size: 13px; opacity: .7; }
.amount-plate .v { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.amount-plate .n { font-size: 12px; opacity: .75; margin-top: 4px; }
.qr-box { background: #fff; border-radius: 22px; padding: 14px; width: 230px; margin: 0 auto; }
.qr-box img { width: 100%; display: block; border-radius: 8px; }
.steps { counter-reset: s; margin: 14px 0 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 10px; font-size: 14px; padding: 6px 0; color: #d6d6d6; }
.steps li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 204, 0, .14); color: var(--yellow); font-size: 12px; font-weight: 600; display: grid; place-items: center; }

/* ---------- поля ---------- */
.field { width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: #0f0f11; padding: 0 14px; outline: none; }
textarea.field { height: 120px; padding: 12px 14px; resize: vertical; }
.field:focus { border-color: rgba(255, 204, 0, .5); }
.label { font-size: 12px; color: var(--muted); margin: 12px 0 6px; display: block; }

/* ---------- таббар ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(24, 24, 27, .78); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.tabbar button { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 500; }
.tabbar button svg { width: 20px; height: 20px; }
.tabbar button.active { background: var(--yellow); color: var(--ink); }
.tabbar button:not(.active) span { display: none; }
.tabbar button[hidden] { display: none; }

/* ---------- админка ---------- */
.seg { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--text); color: var(--ink); border-color: transparent; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; }
.stat.y { background: linear-gradient(135deg, var(--yellow-2), var(--yellow)); color: var(--ink); border: 0; }
.stat.y .k { color: rgba(0, 0, 0, .55); }

.urow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 0; text-align: left; }
.urow + .urow { border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: var(--card-2); color: var(--yellow); }
.urow .m { flex: 1; min-width: 0; }
.urow .m b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow .m span { font-size: 12px; color: var(--muted); }
.urow .e { text-align: right; font-size: 12px; color: var(--muted); }
.urow .e .badge { margin-bottom: 4px; }

.slots { display: flex; gap: 6px; margin-top: 10px; }
.slots i { flex: 1; height: 26px; border-radius: 8px; background: #0e0e10; border: 1px dashed rgba(255, 255, 255, .1); }
.slots i.on { background: linear-gradient(90deg, #fff3b0, var(--yellow)); border: 0; }
.slots i.warn { background: rgba(255, 107, 91, .5); border: 0; }

.empty { text-align: center; color: var(--muted); padding: 28px 0; font-size: 14px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: rgba(255, 204, 0, .08); border: 1px solid rgba(255, 204, 0, .2); font-size: 13px; color: #f0e2a8; }
.alert.red { background: rgba(255, 107, 91, .08); border-color: rgba(255, 107, 91, .25); color: #ffc0b8; }

.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -150%); z-index: 60;
  background: #232326; border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; font-size: 14px;
  transition: transform .25s; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.toast.show { transform: translate(-50%, 0); }

/* промокод и условия в окне оплаты */
.promo-row { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.promo-row .field { flex: 1; height: 44px; text-transform: uppercase; letter-spacing: .05em; }
.promo-row .btn { height: 44px; }
.promo-on { flex: 1; padding: 11px 14px; border-radius: 14px; background: rgba(185, 232, 106, .1); color: var(--green); font-size: 14px; }
.legal { font-size: 12px; color: var(--muted); text-align: center; margin: 14px 8px 0; line-height: 1.5; }
.legal .link, button.link { color: var(--yellow); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.terms { font-size: 14px; line-height: 1.55; color: #d9d9d9; margin-top: 12px; }
.help-li { width: 100%; text-align: left; }

/* FAQ */
.faq { padding: 4px 16px; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 14px 28px 14px 0; font-size: 14px; font-weight: 500; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 204, 0, .12); color: var(--yellow); font-size: 16px; transition: transform .2s;
}
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { color: var(--yellow); }
.faq-a { font-size: 14px; color: #cfcfcf; line-height: 1.5; padding: 0 0 14px; }

/* семьи: дата оплаты Плюса */
.plus-date { margin-top: 8px; font-size: 12px; color: var(--muted); }
.plus-date.warn { color: var(--yellow); }
.plus-date.bad { color: var(--red); font-weight: 600; }

/* воронка */
.fstep + .fstep { margin-top: 14px; }
.fstep .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.fstep .row .muted { font-size: 11px; }
.dchart { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.dcol { flex: 1; height: 100%; position: relative; display: flex; align-items: flex-end; }
.dcol i { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 3px 3px 0 0; min-height: 0; }
.dcol i.u { background: rgba(255, 255, 255, .12); }
.dcol i.p { background: var(--yellow); }
.dlegend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.dlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.dlegend i.u { background: rgba(255, 255, 255, .25); }
.dlegend i.p { background: var(--yellow); }
select.field { appearance: none; margin-top: 8px; }

.receipt-img { width: 100%; border-radius: 16px; margin-top: 12px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .1); border-top-color: var(--yellow); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade { animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
