:root {
  --bg: #0e0f13;
  --bg-2: #14161d;
  --card: #181b23;
  --card-2: #1f2330;
  --line: #2a2f3c;
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --accent: #35e0a8;
  --accent-2: #18b890;
  --accent-ink: #04130d;
  --danger: #ff6b6b;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(53, 224, 168, .12), transparent 60%),
    radial-gradient(700px 500px at -10% 10%, rgba(56, 120, 255, .10), transparent 55%),
    var(--bg);
}

.hidden { display: none !important; }

/* ---- Cat logo mark ---- */
.logo-mark {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 26px;
  background: linear-gradient(160deg, #20242f, #11131a);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(53, 224, 168, .18), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  -webkit-mask: url("cat.svg") center / contain no-repeat;
  mask: url("cat.svg") center / contain no-repeat;
}
.logo-mark.sm { width: 68px; height: 68px; border-radius: 20px; }
.logo-mark.xs { width: 34px; height: 34px; border-radius: 11px; box-shadow: none; }

/* ---- Splash ---- */
.splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.spinner {
  width: 26px; height: 26px;
  border: 3px solid rgba(255, 255, 255, .12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Overlay (consent) ---- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background: rgba(6, 7, 10, .6);
  backdrop-filter: blur(6px);
  z-index: 40;
}
.overlay-card {
  width: 100%;
  background: linear-gradient(180deg, var(--bg-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: rise .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes rise { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay-title { font-size: 22px; font-weight: 800; margin: 16px 0 8px; letter-spacing: -.02em; }
.overlay-text { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: 0 4px 18px; }

.doc-links { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.doc-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px; font-weight: 600;
}
.doc-link .doc-ico { font-size: 18px; }
.doc-link .chev { margin-left: auto; color: var(--muted); font-size: 22px; line-height: 1; }
.doc-link:active { background: #262b39; }

.check {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%;
  margin-bottom: 18px;
  cursor: pointer;
  text-align: left;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: var(--card-2);
  position: relative;
  transition: .15s;
  margin-top: 1px;
}
.check input:checked + .check-box {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.check input:checked + .check-box::after {
  content: "";
  position: absolute;
  left: 8px; top: 4px;
  width: 6px; height: 11px;
  border: solid var(--accent-ink);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.check-label { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* ---- Buttons ---- */
.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(53, 224, 168, .28);
}
.btn-primary:disabled { opacity: .4; box-shadow: none; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--muted); }

/* Buy Telegram Stars (external) */
.btn-stars {
  width: 100%;
  border: 1px solid rgba(255, 206, 84, .45);
  background: linear-gradient(180deg, rgba(255, 206, 84, .12), rgba(255, 206, 84, .05));
  color: #ffd36b;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 14px;
}
.btn-stars:active { transform: translateY(1px); }

/* ---- App ---- */
.app { min-height: 100vh; padding-bottom: 92px; }
.topbar {
  display: flex; align-items: center;
  padding: 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-size: 18px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .18em; margin-top: 3px; }

.view { padding: 0 16px; }
.hero { padding: 8px 4px 18px; }
.hero-title { font-size: 26px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.03em; }
.hero-sub { color: var(--muted); font-size: 14.5px; margin: 0; line-height: 1.45; }

/* ---- Plans ---- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan {
  position: relative;
  text-align: left;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, transform .05s;
}
.plan:active { transform: scale(.985); }
.plan.best { border-color: rgba(53, 224, 168, .55); }
.plan .badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  color: var(--accent-ink);
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  padding: 4px 8px; border-radius: 999px;
}
.plan .p-dur { font-size: 16px; font-weight: 800; }
.plan .p-mo { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.plan .p-price { display: flex; align-items: baseline; gap: 6px; margin-top: 16px; }
.plan .p-stars { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.plan .p-star-ico { font-size: 17px; }
.plan .p-rub { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.fine { color: var(--muted); font-size: 12px; text-align: center; margin: 18px 4px 0; }

/* ---- Profile ---- */
.profile { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.pcard {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.pcard.status-on { border-color: rgba(53, 224, 168, .4); }
.status-row { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.dot.off { background: var(--danger); }
.status-label { font-weight: 700; font-size: 15px; }
.days-wrap { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 4px; }
.days-num { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.days-unit { color: var(--muted); font-size: 15px; }
.expire { color: var(--muted); font-size: 13.5px; }
.pcard h3 { margin: 0 0 6px; font-size: 15px; }
.pcard .muted { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: 0 0 16px; }
.pcard .row-btns { display: flex; gap: 10px; }
.mini-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  border-radius: 12px;
  padding: 13px;
  font-size: 14px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.mini-btn.accent {
  border-color: transparent;
  color: var(--accent-ink);
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
}
.mini-btn:active { transform: translateY(1px); }

/* ---- Tabbar ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(14, 15, 19, .92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.tab {
  flex: 1;
  background: none; border: none;
  color: var(--muted);
  padding: 12px 0 14px;
  font-size: 11px; font-weight: 700;
  font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
}
.tab .tab-ico { font-size: 20px; filter: grayscale(1) opacity(.7); }
.tab.is-active { color: var(--accent); }
.tab.is-active .tab-ico { filter: none; }

/* ---- Payment sheet ---- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6, 7, 10, .6); backdrop-filter: blur(4px); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, var(--bg-2), var(--card));
  border-top-left-radius: 26px; border-top-right-radius: 26px;
  border: 1px solid var(--line);
  padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  animation: rise .3s cubic-bezier(.2, .8, .2, 1);
}
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 4px auto 14px; }
.sheet-title { margin: 0 0 4px; font-size: 19px; font-weight: 800; text-align: center; }
.sheet-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; text-align: center; }
.pay-option {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  margin-bottom: 12px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.pay-option:active:not(.disabled) { background: #262b39; }
.pay-option.disabled { opacity: .55; cursor: not-allowed; }
.pay-ico { font-size: 24px; }
.pay-main { display: flex; flex-direction: column; }
.pay-name { font-size: 15.5px; font-weight: 700; }
.pay-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pay-amount { margin-left: auto; font-size: 17px; font-weight: 800; }
.pay-soon {
  margin-left: auto;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  background: #2a2f3c;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  text-align: center;
  z-index: 60;
  box-shadow: var(--shadow);
  animation: rise .25s ease;
}
.toast.err { border-color: rgba(255, 107, 107, .5); }
