:root {
  --app-text: #eef4ff;
  --muted: #9daeca;
  --card: rgba(255, 255, 255, 0.03);
  --accent: #4f8cff;
  --danger: #ff4d67;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  --radius-lg: 20px;
  --radius-sm: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
*,
*::before,
*::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--app-text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(52, 120, 255, 0.18), transparent 52%),
    linear-gradient(180deg, #090f1a 0%, #0d1527 100%);
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(90px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 520px; margin: 0 auto; }
.appShell, .screen, .bootSkeleton, .deviceList, .profileActions, .faqList { display: grid; gap: 20px; }
.hidden { display: none !important; }
.topBar { display: flex; align-items: center; justify-content: space-between; }
.topBar h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.iconBtn { width: 40px; height: 40px; border-radius: 16px; border: 0; color: var(--app-text); background: var(--card); box-shadow: var(--shadow); }
.card {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 33, 54, 0.8), rgba(13, 24, 42, 0.82));
  border: 0;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 20px;
}
.label { margin: 0; color: var(--muted); font-size: 14px; }
.muted { margin: 0; color: var(--muted); font-size: 15px; }
.rowBetween { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.amount { margin: 10px 0 8px; font-size: 52px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.amountDanger { color: var(--danger); }
.tgStar { font-size: 26px; vertical-align: -2px; }
.trustText { margin: 10px 0 0; color: #b7c6e2; font-size: 14px; }
.inviteCard h3 { margin: 8px 0; font-size: 34px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.inviteLight { opacity: 0.95; padding-top: 16px; padding-bottom: 16px; }
.inviteLight h3 { font-size: 30px; }
.textBtn { border: none; background: none; color: var(--muted); font-size: 14px; }
.deviceName { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.deviceMeta { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.deviceActions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deviceActions .wide { grid-column: 1 / -1; }
.addRow { margin-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.addRow input { min-width: 0; border-radius: var(--radius-sm); border: 0; background: rgba(255, 255, 255, 0.07); color: var(--app-text); font-size: 16px; padding: 14px; }
.btnSecondary, .btnDanger, .ghostBtn, .composerBtn, .blockBtn {
  min-height: 54px;
  border-radius: var(--radius-sm);
  border: 0;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  width: 100%;
  text-align: center;
}
.btnSecondary { background: rgba(255, 255, 255, 0.08); }
.btnDanger { background: rgba(255, 77, 103, 0.25); color: #ffd0d8; }
.ghostBtn, .composerBtn, .blockBtn { background: var(--accent); }
.ctaPrimary {
  min-height: 58px;
  border-radius: 16px;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(79, 140, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btnIcon { width: 18px; height: 18px; display: inline-flex; }
.btnIcon svg { width: 18px; height: 18px; fill: currentColor; }
.starsIcon { width: 16px; height: 16px; fill: #6cb4ff; vertical-align: -2px; }
.starsIcon.lg { width: 22px; height: 22px; vertical-align: -4px; }
.balanceStar { width: 28px; height: 28px; vertical-align: -3px; margin-right: 4px; }
.topupChoices {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.topupBtn {
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  padding: 8px 6px;
}
.refActions .topupBtn { min-height: 54px; }
.balanceCard { text-align: center; }
.balanceCard .rowBetween { text-align: left; margin-bottom: 6px; align-items: center; }
.balanceCard .textBtn { font-size: 13px; }
.balanceTitle { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.referralCard .ghostBtn { margin-top: 0; }
.refActions { margin-top: 14px; display: grid; grid-template-columns: 4fr 1fr; gap: 8px; align-items: stretch; }
.refActions .ghostBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 58px;
}
.iconOnlyBtn {
  display: grid;
  place-items: center;
  padding: 0;
  min-width: 64px;
  height: 58px;
  line-height: 1;
}
.iconOnlyBtn .btnIcon { width: 20px; height: 20px; }
.iconOnlyBtn .btnIcon svg { width: 20px; height: 20px; }
.homePrimaryActions { margin-top: 12px; display: grid; grid-template-columns: 4fr 1fr; gap: 8px; align-items: stretch; }
.ctaHistoryBtn { min-height: 58px; border-radius: 16px; padding: 0; display: grid; place-items: center; }
.topupScreen { gap: 14px; }
.topupTitle { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.topupScreen > .rowBetween { align-items: baseline; }
.topupBalanceMeta #topupHeaderBalance { font-weight: 800; color: #dbe7ff; }
.topupPanel {
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 10px;
}
.topupCurrent { margin: 0; font-size: 56px; font-weight: 800; text-align: center; }
.packageList { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.packageCard {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  background: rgba(255,255,255,0.06);
  color: #fff;
  display: grid;
  gap: 2px;
  min-height: 132px;
}
.packageCard strong { font-size: 24px; line-height: 1.1; }
.packageCard small { color: var(--muted); font-size: 13px; }
.pkgRub { color: rgba(189, 205, 233, 0.85) !important; }
.packageCard em { color: #7db5ff; font-style: normal; font-size: 12px; font-weight: 700; }
.pkgLabel { color: #d7e6ff; font-size: 12px; font-weight: 700; }
.packageCard.popular { box-shadow: inset 0 0 0 1px rgba(94,153,255,.45); }
.packageCard.activePick { background: rgba(79, 140, 255, 0.24); box-shadow: inset 0 0 0 1px rgba(120,170,255,.6); }
.customTopupRow { margin-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.customTopupRow input {
  min-width: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 15px;
  padding: 12px 14px;
}
.topupBottomBtn { margin-top: auto; }
.btnSpinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.historyScroll { max-height: 40vh; overflow: auto; display: grid; gap: 8px; }
.txItem { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 14px; }
.txItem.isPayment span:nth-child(2) { color: #7df0b0; font-weight: 700; }
.txItem.isDebit span:nth-child(2) { color: #ffb066; font-weight: 700; }
.txMeta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.faqItem {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-text);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 8px;
  text-align: left;
}
.faqAnswer { grid-column: 1 / -1; color: var(--muted); font-size: 14px; max-height: 180px; overflow: hidden; opacity: 1; transition: max-height .25s ease, opacity .25s ease; }
.faqAnswer.hidden { max-height: 0; opacity: 0; }
.tabBar {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(11, 18, 32, 0.92);
  border-radius: 16px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  z-index: 40;
  backdrop-filter: blur(16px);
}
.tabBtn { border: none; border-radius: 14px; background: transparent; color: var(--muted); padding: 10px 4px; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tabIcon { width: 18px; height: 18px; display: inline-flex; }
.tabIcon svg { width: 18px; height: 18px; fill: currentColor; }
.tabBtn small { font-size: 11px; line-height: 1; }
.tabBtn.active { color: #fff; background: var(--accent); }
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  z-index: 50;
}
.sheet { width: 100%; max-width: 520px; background: #0f1d33; border-radius: var(--radius-lg); border: 0; padding: 8px 16px 16px; box-shadow: var(--shadow); }
.sheetSm { max-width: 360px; }
.sheetLg { max-width: 520px; }
.sheetGrab { width: 34px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); margin: 4px auto 12px; }
.sheetHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheetHead h3 { margin: 0; font-size: 18px; }
.linkBtn { border: none; background: none; color: var(--accent); font-size: 16px; font-weight: 700; }
.configPre { margin: 0 0 10px; padding: 12px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.06); white-space: pre-wrap; word-break: break-word; max-height: 34vh; overflow: auto; font-size: 11px; }
.qrBox { display: grid; place-items: center; margin-bottom: 10px; }
.qrBox img { border-radius: 12px; border: 4px solid #fff; width: 220px; height: 220px; }
.blockBtn.ghost { background: rgba(255, 255, 255, 0.08); }
.blockBtn.danger { background: #ff4d67; }
.confirmBody { margin: 8px 0 0; color: var(--muted); }
.confirmBtns { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); border-radius: 12px; padding: 12px 14px; background: rgba(21, 29, 44, 0.95); z-index: 70; }
.skCard { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.skLine { border-radius: 8px; height: 14px; margin-bottom: 10px; background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.2), rgba(255,255,255,.08)); background-size: 220% 100%; animation: shimmer 1.2s infinite; }
.w25 { width: 25%; } .w30 { width: 30%; } .w35 { width: 35%; } .w45 { width: 45%; } .w50 { width: 50%; } .w70 { width: 70%; } .w100 { width: 100%; }
.h30 { height: 30px; } .h40 { height: 40px; } .h46 { height: 46px; } .h48 { height: 48px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -120% 0; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
