:root {
  color-scheme: dark;
  --bg: #050706;
  --surface: rgba(18, 22, 19, 0.92);
  --surface-2: #151a17;
  --line: rgba(255, 255, 255, 0.08);
  --muted: #879089;
  --text: #f4f8f5;
  --green: #17dc71;
  --green-deep: #087b42;
  --green-soft: rgba(23, 220, 113, 0.13);
  --danger: #ff6b73;
  --radius: 24px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -10%, rgba(20, 199, 98, 0.12), transparent 32%),
    linear-gradient(180deg, #070a08 0%, #030504 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(95px);
  opacity: 0.13;
}

.ambient-one {
  top: 2vh;
  left: -130px;
  background: var(--green);
}

.ambient-two {
  right: -160px;
  bottom: 15vh;
  background: #0a8e4c;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 4px 3px 15px;
}

.brand-mark,
.loader-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(40, 255, 139, 0.35);
  border-radius: 14px;
  background: linear-gradient(145deg, #163f29, #082015);
  color: #5dffa7;
  font-weight: 900;
  box-shadow: 0 0 30px rgba(23, 220, 113, 0.15), inset 0 1px rgba(255, 255, 255, 0.08);
}

.brand-name {
  margin-top: 1px;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.eyebrow {
  display: block;
  color: #7f8a82;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #99a29b;
  font-size: 11px;
  font-weight: 700;
}

.live-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.page {
  display: none;
  animation: page-in 0.24s ease both;
}

.page.active {
  display: block;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.profile-card,
.card,
.plan-card,
.referral-hero,
.stat-card,
.quick-card {
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.035);
}

.profile-card {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  padding: 25px 22px 18px;
  border-color: rgba(38, 244, 130, 0.16);
  border-radius: 31px;
  background:
    linear-gradient(145deg, rgba(5, 84, 43, 0.96), rgba(6, 45, 27, 0.97)),
    #06361f;
}

.profile-card::after {
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 210px;
  height: 210px;
  border: 46px solid rgba(79, 255, 156, 0.055);
  border-radius: 50%;
  content: "";
}

.profile-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,.07) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 38%, rgba(43,255,134,.12) 0 3px, transparent 4px),
    radial-gradient(circle at 48% 75%, rgba(255,255,255,.05) 0 2px, transparent 3px);
  background-size: 80px 80px, 110px 110px, 70px 70px;
}

.profile-main,
.profile-meta {
  position: relative;
  z-index: 1;
}

.profile-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 68px;
  height: 68px;
  overflow: hidden;
  border: 2px solid rgba(137, 255, 188, 0.75);
  border-radius: 22px;
  background: linear-gradient(145deg, #102e20, #06130c);
  color: #a1ffca;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-copy {
  min-width: 0;
}

.profile-copy h1 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: clamp(22px, 6vw, 29px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy p {
  margin: 0;
  overflow: hidden;
  color: rgba(227, 255, 239, 0.69);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(3, 20, 11, 0.38);
  backdrop-filter: blur(12px);
}

.profile-meta div {
  min-width: 0;
  padding: 13px 15px;
}

.profile-meta div + div {
  border-left: 1px solid rgba(255,255,255,.08);
}

.profile-meta span,
.profile-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta span {
  margin-bottom: 4px;
  color: rgba(216, 255, 232, 0.58);
  font-size: 11px;
}

.profile-meta strong {
  font-size: 14px;
}

.card {
  margin-top: 14px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.card-heading,
.plan-top,
.setting-row,
.usage-footer,
.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card h2,
.plan-card h2,
.legal-card h2 {
  margin: 5px 0 0;
  font-size: 18px;
}

.usage-number {
  color: #dfffea;
  font-size: 19px;
}

.progress {
  height: 9px;
  margin: 19px 0 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #283029;
}

.progress div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #08a951, #40f78f);
  box-shadow: 0 0 16px rgba(39, 239, 126, 0.48);
  transition: width 0.55s ease;
}

.usage-footer {
  color: var(--muted);
  font-size: 11px;
}

.usage-footer b {
  color: #c6fbd9;
}

.quick-grid {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

.quick-card {
  display: grid;
  grid-template-columns: 43px 1fr auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 75px;
  padding: 13px 16px;
  border-radius: 21px;
  background: rgba(17, 21, 18, 0.94);
  text-align: left;
  cursor: pointer;
}

.quick-card:active,
.primary-button:active,
.light-button:active {
  transform: scale(0.985);
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  background: var(--green-soft);
  color: #5aff9f;
  font-size: 20px;
}

.quick-card b,
.quick-card small,
.setting-row b,
.setting-row small {
  display: block;
}

.quick-card b {
  margin-bottom: 4px;
  font-size: 14px;
}

.quick-card small,
.setting-row small {
  color: var(--muted);
  font-size: 11px;
}

.arrow {
  color: #778079;
  font-size: 28px;
}

.section-heading {
  padding: 15px 4px 10px;
}

.section-heading h1 {
  margin: 7px 0 8px;
  font-size: clamp(28px, 8vw, 39px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.section-heading p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.plan-card {
  position: relative;
  margin-top: 14px;
  overflow: hidden;
  padding: 22px;
  border-radius: 27px;
  background: var(--surface);
}

.plan-card ul {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.plan-card li {
  position: relative;
  padding-left: 23px;
  color: #c8d0ca;
  font-size: 13px;
}

.plan-card li::before {
  position: absolute;
  left: 0;
  color: var(--green);
  content: "✓";
  font-weight: 900;
}

.price {
  color: #eafff1;
  font-size: 19px;
  font-weight: 850;
  text-align: right;
}

.price small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.premium-plan {
  border-color: rgba(43, 236, 128, 0.25);
  background: linear-gradient(145deg, rgba(10, 55, 31, 0.96), rgba(12, 20, 15, 0.98));
}

.turbo-plan {
  border-color: rgba(86, 255, 164, 0.38);
  background: linear-gradient(145deg, rgba(8, 79, 42, 0.98), rgba(8, 24, 14, 0.99));
}

.plan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.plan-actions .primary-button {
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
}

.premium-glow {
  position: absolute;
  top: -90px;
  right: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(36, 238, 126, 0.16);
  filter: blur(52px);
  pointer-events: none;
}

.plan-top,
.plan-card ul,
.plan-card button,
.plan-card p,
.current-badge {
  position: relative;
  z-index: 1;
}

.current-badge {
  display: inline-flex;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #9aa39c;
  font-size: 11px;
  font-weight: 750;
}

.current-badge[hidden] {
  display: none;
}

.primary-button,
.light-button {
  width: 100%;
  border: 0;
  border-radius: 17px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease;
}

.primary-button {
  min-height: 52px;
  background: linear-gradient(135deg, #25e779, #10b85c);
  color: #031208;
  box-shadow: 0 12px 28px rgba(21, 218, 108, 0.2);
}

.primary-button:disabled,
.primary-button.loading {
  cursor: default;
  opacity: 0.55;
}

.fine-print {
  margin: 11px 0 0 !important;
  color: rgba(214, 227, 217, 0.52);
  font-size: 10px;
  text-align: center;
}

.referral-hero {
  position: relative;
  min-height: 230px;
  margin-top: 14px;
  overflow: hidden;
  padding: 28px 22px 22px;
  border-color: rgba(54, 255, 145, 0.2);
  border-radius: 29px;
  background: linear-gradient(145deg, #087c43, #034126);
}

.referral-hero::after {
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 230px;
  height: 230px;
  border: 40px solid rgba(255,255,255,.055);
  border-radius: 50%;
  content: "";
}

.referral-hero h2 {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  font-size: 44px;
  letter-spacing: -0.04em;
}

.referral-hero p {
  position: relative;
  z-index: 1;
  margin: 1px 0 20px;
  color: rgba(230,255,240,.68);
  font-size: 12px;
}

.gift {
  position: absolute;
  top: 25px;
  right: 28px;
  color: rgba(214, 255, 231, 0.68);
  font-size: 57px;
  line-height: 1;
  transform: rotate(15deg);
}

.light-button {
  position: relative;
  z-index: 1;
  min-height: 47px;
  background: #f3fff7;
  color: #06361d;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 12px;
}

.stat-card {
  min-width: 0;
  padding: 17px 8px;
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  color: #dfffea;
  font-size: 23px;
}

.stat-card span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
}

.link-card {
  margin-top: 12px;
}

.copy-row {
  margin-top: 12px;
}

.copy-row code {
  min-width: 0;
  overflow: hidden;
  color: #b7c2ba;
  font-family: inherit;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-row button,
.danger-button,
.text-button {
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
}

.copy-row button {
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--green-soft);
  color: #62ffa8;
  font-size: 10px;
  font-weight: 750;
}

.settings-card {
  padding: 7px 19px;
}

.setting-row {
  min-height: 76px;
}

.setting-row i {
  color: inherit;
  font-style: normal;
}

.danger-button {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 83, 94, 0.11);
  color: #ff868c;
  font-size: 11px;
  font-weight: 800;
}

.legal-card p {
  margin: 11px 0 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.text-button {
  width: 100%;
  padding: 13px 0 2px;
  background: transparent;
  color: #55ef9b;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}

.text-button span {
  float: right;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: max(11px, calc((100vw - 598px) / 2));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(11px, calc((100vw - 598px) / 2));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 68px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  background: rgba(8, 11, 9, 0.89);
  box-shadow: 0 18px 45px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(24px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #6f7871;
  font-size: 9px;
  cursor: pointer;
}

.nav-item svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item.active {
  background: rgba(28, 224, 114, 0.1);
  color: #55f69c;
}

.loader-screen {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 30px;
  background: #050706;
  transition: opacity .25s ease, visibility .25s ease;
}

.loader-screen.hidden {
  visibility: hidden;
  opacity: 0;
}

.loader-screen p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.loader-screen:not(.error) .loader-logo {
  animation: pulse 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
  to { transform: scale(1.07); box-shadow: 0 0 42px rgba(23, 220, 113, 0.3); }
}

.toast {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: 18px;
  max-width: 500px;
  margin: 0 auto;
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 15px;
  background: rgba(29, 36, 31, 0.96);
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  color: #e9f7ed;
  font-size: 12px;
  text-align: center;
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: .2s ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: none;
}

@media (min-width: 540px) {
  .app-shell { padding-right: 22px; padding-left: 22px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 350px) {
  .app-shell { padding-right: 11px; padding-left: 11px; }
  .profile-card { padding-right: 17px; padding-left: 17px; }
  .avatar { width: 59px; height: 59px; border-radius: 19px; }
  .profile-meta div { padding-right: 10px; padding-left: 10px; }
  .plan-card { padding: 18px; }
  .nav-item span { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
