: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; } }



.buy-button {
  width: 100%;
  margin-top: 18px;
  padding: 13px 10px;
  font-size: 15px;
}

.plan-card {
  display: flex;
  flex-direction: column;
}

.plan-card .buy-button {
  margin-top: auto;
}


/* ==========================================
   Happ help and installation instructions
   ========================================== */

.help-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.help-button:active {
  transform: scale(.99);
}

.help-button .help-icon {
  font-size: 38px;
  font-weight: 300;
  line-height: 1;
}

.help-modal-open {
  overflow: hidden;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.help-modal.hidden {
  display: none;
}

.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(5px);
}

.help-modal-panel {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: 92vh;
  padding: 12px 20px 28px;
  overflow-y: auto;
  color: var(--text, #ffffff);
  background: var(--card, #151821);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .45);
  animation: help-modal-up .22s ease-out;
}

@keyframes help-modal-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.help-modal-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
}

.help-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.help-modal-header h2 {
  margin: 3px 0 0;
  font-size: 25px;
  line-height: 1.2;
}

.help-modal-label {
  color: #7ea8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.help-close-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  color: inherit;
  background: rgba(255, 255, 255, .08);
  border: 0;
  border-radius: 50%;
  font-size: 27px;
  line-height: 36px;
  cursor: pointer;
}

.help-intro {
  margin-top: 12px;
  color: var(--muted, #aeb4c2);
  line-height: 1.5;
}

.help-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.help-store-button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  color: inherit;
  text-align: left;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 16px;
  cursor: pointer;
}

.help-store-button:active {
  transform: scale(.98);
}

.help-store-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  font-size: 23px;
}

.help-store-button span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.help-store-button small {
  color: var(--muted, #aeb4c2);
  font-size: 11px;
}

.help-store-button strong {
  margin-top: 2px;
  font-size: 14px;
}

.help-steps {
  display: grid;
  gap: 11px;
  margin-top: 22px;
}

.help-step {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 17px;
}

.help-step-number {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    #397aff,
    #7655ff
  );
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

.help-step h3 {
  margin: 2px 0 5px;
  font-size: 16px;
}

.help-step p {
  margin: 0;
  color: var(--muted, #aeb4c2);
  font-size: 14px;
  line-height: 1.48;
}

.help-step strong {
  color: var(--text, #ffffff);
}

.help-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  color: var(--muted, #aeb4c2);
  background: rgba(70, 126, 255, .12);
  border: 1px solid rgba(89, 139, 255, .25);
  border-radius: 16px;
}

.help-tip p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.help-copy-button {
  width: 100%;
  margin-top: 18px;
}

.help-done-button {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  color: var(--text, #ffffff);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 15px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

@media (min-width: 621px) {
  .help-modal {
    align-items: center;
    padding: 20px;
  }

  .help-modal-panel {
    border-radius: 28px;
  }
}

@media (max-width: 390px) {
  .help-platforms {
    grid-template-columns: 1fr;
  }

  .help-modal-panel {
    padding-right: 15px;
    padding-left: 15px;
  }
}
