:root {
  color-scheme: dark;
  --bg: var(--tg-theme-bg-color, #090d19);
  --surface: var(--tg-theme-secondary-bg-color, #131a2b);
  --surface-2: #192238;
  --text: var(--tg-theme-text-color, #f6f8ff);
  --muted: var(--tg-theme-hint-color, #9ba8c3);
  --accent: var(--tg-theme-button-color, #6d7cff);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --green: #39d98a;
  --danger: #ff6b7a;
  --border: rgba(255,255,255,.08);
  --shadow: 0 18px 50px rgba(0,0,0,.28);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { background-image: radial-gradient(circle at 80% -10%, rgba(109,124,255,.28), transparent 38%), radial-gradient(circle at -10% 30%, rgba(57,217,138,.12), transparent 32%); }
button { font: inherit; }
.hidden { display: none !important; }
.app-shell { width: min(100%, 560px); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 5px 0 0; font-size: 25px; letter-spacing: -.04em; }
.avatar { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(145deg, var(--accent), #9b72ff); box-shadow: 0 10px 28px rgba(109,124,255,.35); }
.card { background: linear-gradient(150deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.loading-card { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.spinner { width: 34px; height: 34px; 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); } }
.welcome { margin: 0 4px 18px; }
.welcome span { font-size: 23px; font-weight: 800; letter-spacing: -.035em; }
.welcome p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.status-card { padding: 20px; }
.status-row { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.status-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.status-value { font-size: 22px; font-weight: 800; margin-top: 5px; }
.status-pill { padding: 8px 11px; border-radius: 999px; background: rgba(255,107,122,.12); color: #ff9aa5; font-size: 12px; font-weight: 800; }
.status-pill.active { background: rgba(57,217,138,.13); color: var(--green); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.metric { background: rgba(255,255,255,.045); border: 1px solid var(--border); border-radius: 18px; padding: 15px; }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.metric strong { font-size: 17px; }
.expiry { margin: 14px 2px 18px; color: var(--muted); font-size: 13px; }
.expiry strong { color: var(--text); }
.button { width: 100%; min-height: 54px; border: 0; border-radius: 17px; padding: 14px 18px; font-weight: 800; cursor: pointer; transition: transform .12s ease, opacity .12s ease; }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .55; cursor: default; }
.button.primary { color: var(--accent-text); background: linear-gradient(135deg, var(--accent), #8d6cff); box-shadow: 0 12px 28px rgba(109,124,255,.26); }
.button.secondary { color: var(--text); background: rgba(255,255,255,.07); }
.hint, .inactive-text, .trial-meta { color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.inactive-text { text-align: left; font-size: 14px; margin: 20px 0; }
.trial-meta { margin-top: 11px; }
.section-title { display: flex; justify-content: space-between; align-items: end; margin: 28px 4px 12px; gap: 16px; }
.section-title h2 { margin: 0; font-size: 19px; }
.section-title span { color: var(--muted); font-size: 10px; text-align: right; max-width: 150px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card { position: relative; min-height: 180px; padding: 17px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.plan-card.featured { background: linear-gradient(155deg, rgba(109,124,255,.28), rgba(109,124,255,.08)); border-color: rgba(139,127,255,.35); }
.badge { position: absolute; top: 12px; right: -30px; width: 120px; transform: rotate(35deg); background: var(--accent); color: white; font-size: 8px; font-weight: 900; letter-spacing: .08em; text-align: center; padding: 5px 0; }
.plan-icon { font-size: 27px; margin-bottom: 22px; }
.plan-name { color: var(--muted); font-size: 13px; }
.plan-price { font-size: 27px; font-weight: 900; margin-top: 3px; letter-spacing: -.04em; }
.plan-caption { color: var(--muted); font-size: 11px; margin-top: 8px; line-height: 1.4; }
.help-card { margin-top: 14px; padding: 18px; display: flex; align-items: center; justify-content: space-between; }
.help-card h3 { margin: 0 0 5px; font-size: 16px; }
.help-card p { margin: 0; color: var(--muted); font-size: 12px; max-width: 270px; line-height: 1.45; }
.help-icon, .status-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: rgba(255,255,255,.07); font-weight: 900; }
.status-icon.danger { color: var(--danger); margin-bottom: 12px; }
#error { padding: 24px; }
#error h2 { margin: 0 0 8px; }
#error p { color: var(--muted); line-height: 1.5; }
.admin-badge { margin: 16px auto 0; width: fit-content; padding: 7px 11px; border-radius: 999px; background: rgba(57,217,138,.12); color: var(--green); font-size: 11px; font-weight: 800; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); background: #effff7; color: #123c29; padding: 12px 18px; border-radius: 14px; font-weight: 800; opacity: 0; pointer-events: none; transition: .25s ease; box-shadow: var(--shadow); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 360px) { .plans { grid-template-columns: 1fr; } .plan-card { min-height: 150px; } }

