:root {
  --bg-dark: #03050b;
  --bg-panel: #121625;
  --bg-panel-soft: rgba(18, 22, 37, 0.88);
  --bg-light: #f8f9ff;
  --body-bg: radial-gradient(circle at 20% 20%, #192040, var(--bg-dark));
  --text-main: #f4f6ff;
  --text-muted: rgba(244, 246, 255, 0.62);
  --text-dark: #0a0f1f;
  --accent: #4cc9f0;
  --accent-2: #4f7cff;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-pill: 999px;
  --space-xs: 10px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --shadow-soft: 0 30px 80px rgba(2, 4, 20, 0.6);
  --shadow-inset: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  --device-surface: var(--bg-panel);
  --surface-card: var(--bg-panel-soft);
  --surface-muted: rgba(255, 255, 255, 0.03);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --surface-pill: rgba(255, 255, 255, 0.06);
  --surface-contrast: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.2);
  --border-contrast: rgba(255, 255, 255, 0.28);
  --pill-border: rgba(255, 255, 255, 0.14);
  --detail-bg: rgba(0, 5, 20, 0.3);
  --detail-border: rgba(255, 255, 255, 0.12);
  --navbar-surface: rgba(9, 12, 24, 0.98);
  --navbar-active: rgba(255, 255, 255, 0.16);
  --navbar-hover: rgba(255, 255, 255, 0.1);
  --nav-height: 78px;
  --overlay-backdrop: rgba(3, 3, 10, 0.95);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.15);
  font-family: 'Inter', 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: inherit;
  color: var(--text-main);
  background: var(--body-bg);
  transition: background 0.4s ease, color 0.3s ease;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.4s ease;
}

body::before {
  background:
    radial-gradient(circle at 20% 15%, rgba(124, 164, 255, 0.22), transparent 45%),
    radial-gradient(circle at 80% 25%, rgba(90, 238, 255, 0.2), transparent 50%),
    radial-gradient(circle at 35% 80%, rgba(160, 120, 255, 0.18), transparent 55%),
    radial-gradient(circle at 70% 75%, rgba(60, 120, 255, 0.16), transparent 55%),
    radial-gradient(circle at 10% 60%, rgba(255, 255, 255, 0.06), transparent 40%);
  filter: blur(12px);
  animation: cosmicDrift 24s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 70% 20%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 80% 70%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1px 1px at 55% 45%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 15% 75%, rgba(255, 255, 255, 0.4), transparent 60%);
  opacity: 0.7;
  animation: starTwinkle 6s ease-in-out infinite;
}

body[data-theme='dark']::before {
  animation-duration: 42s;
}

body[data-theme='dark']::after {
  animation-duration: 14s;
}

.cosmos-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body[data-theme='dark'] .cosmos-layer {
  opacity: 1;
}

body[data-theme='dark'] .viewport {
  background: transparent;
}

body[data-theme='dark'] .device {
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cosmos-layer .stars,
.cosmos-layer .shooting-star {
  position: absolute;
}

.cosmos-layer .stars {
  width: 1px;
  height: 1px;
  background: white;
  box-shadow:
    2vw 5vh 2px white, 10vw 8vh 2px white, 15vw 15vh 1px white,
    22vw 22vh 1px white, 28vw 12vh 2px white, 32vw 32vh 1px white,
    38vw 18vh 2px white, 42vw 35vh 1px white, 48vw 25vh 2px white,
    53vw 42vh 1px white, 58vw 15vh 2px white, 63vw 38vh 1px white,
    68vw 28vh 2px white, 73vw 45vh 1px white, 78vw 32vh 2px white,
    83vw 48vh 1px white, 88vw 20vh 2px white, 93vw 52vh 1px white,
    98vw 35vh 2px white, 5vw 60vh 1px white, 12vw 65vh 2px white,
    18vw 72vh 1px white, 25vw 78vh 2px white, 30vw 85vh 1px white,
    35vw 68vh 2px white, 40vw 82vh 1px white, 45vw 92vh 2px white,
    50vw 75vh 1px white, 55vw 88vh 2px white, 60vw 95vh 1px white,
    65vw 72vh 2px white, 70vw 85vh 1px white, 75vw 78vh 2px white,
    80vw 92vh 1px white, 85vw 82vh 2px white, 90vw 88vh 1px white,
    95vw 75vh 2px white;
  animation: twinkle 14s infinite linear;
}

.cosmos-layer .stars::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 1px;
  background: white;
  box-shadow:
    8vw 12vh 2px white, 16vw 18vh 1px white, 24vw 25vh 2px white,
    33vw 15vh 1px white, 41vw 28vh 2px white, 49vw 35vh 1px white,
    57vw 22vh 2px white, 65vw 42vh 1px white, 73vw 28vh 2px white,
    81vw 48vh 1px white, 89vw 32vh 2px white, 97vw 45vh 1px white,
    3vw 68vh 2px white, 11vw 75vh 1px white, 19vw 82vh 2px white,
    27vw 88vh 1px white, 35vw 72vh 2px white, 43vw 85vh 1px white,
    51vw 92vh 2px white, 59vw 78vh 1px white;
  animation: twinkle 12s infinite linear reverse;
}

.cosmos-layer .shooting-star {
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, white, transparent);
  opacity: 0.8;
  animation: shoot 6s infinite ease-in;
}

.cosmos-layer .shooting-star:nth-child(2) {
  top: 20%;
  left: -120px;
  animation-delay: 0s;
}

.cosmos-layer .shooting-star:nth-child(3) {
  top: 40%;
  left: -140px;
  animation-delay: 2s;
}

.cosmos-layer .shooting-star:nth-child(4) {
  top: 60%;
  left: -160px;
  animation-delay: 4s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes shoot {
  0% {
    transform: translateX(0) translateY(0) rotate(25deg);
    opacity: 0.9;
  }
  100% {
    transform: translateX(120vw) translateY(50vh) rotate(25deg);
    opacity: 0;
  }
}

.app-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 18, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 2000;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.app-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.app-loader__inner {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px 28px;
  border-radius: 18px;
  background: rgba(16, 18, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 50px rgba(2, 4, 12, 0.5);
}

.app-loader__image {
  width: 176px;
  height: 176px;
  object-fit: contain;
  display: block;
}

.app-loader__image.is-inverted {
  filter: invert(1) brightness(1.1);
}

.app-loader__spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.9);
  animation: appLoaderSpin 0.9s linear infinite;
}

.app-loader__text {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.language-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-backdrop);
  z-index: 1800;
  display: grid;
  place-items: center;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.language-card {
  width: min(420px, 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
  text-align: center;
}

.language-eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.language-card h2 {
  margin: 0;
  font-size: 22px;
}

.language-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.language-options {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.language-options button {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  padding: 10px 16px;
  background: var(--surface-pill);
  color: inherit;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.language-options button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(7, 10, 20, 0.35);
}

.flag-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -2px;
}

body[data-theme='light'] .app-loader {
  background: rgba(245, 246, 252, 0.92);
}

body[data-theme='light'] .app-loader__inner {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(14, 18, 40, 0.12);
  box-shadow: 0 18px 40px rgba(12, 18, 32, 0.12);
}

body[data-theme='light'] .app-loader__spinner {
  border-color: rgba(14, 18, 40, 0.18);
  border-top-color: rgba(14, 18, 40, 0.7);
}

@keyframes appLoaderSpin {
  to {
    transform: rotate(360deg);
  }
}

body[data-theme='light'] {
  --body-bg: #fcfcff;
  --text-main: #11182c;
  --text-dark: #050b1e;
  --text-muted: rgba(15, 24, 50, 0.55);
  --bg-panel: #fdfdff;
  --bg-panel-soft: #ffffff;
  --device-surface: #ffffff;
  --surface-card: #ffffff;
  --surface-muted: rgba(14, 18, 40, 0.04);
  --surface-soft: rgba(14, 18, 40, 0.08);
  --surface-pill: #ffffff;
  --surface-contrast: rgba(99, 132, 255, 0.18);
  --border-soft: rgba(14, 18, 40, 0.08);
  --border-strong: rgba(14, 18, 40, 0.2);
  --border-contrast: rgba(14, 18, 40, 0.32);
  --pill-border: rgba(14, 18, 40, 0.12);
  --navbar-surface: rgba(255, 255, 255, 0.92);
  --navbar-active: rgba(236, 241, 255, 0.96);
  --navbar-hover: rgba(14, 18, 40, 0.08);
  --overlay-backdrop: rgba(249, 251, 255, 0.88);
  --input-bg: #ffffff;
  --input-border: rgba(14, 18, 40, 0.12);
  --detail-bg: #ffffff;
  --detail-border: rgba(14, 18, 40, 0.12);
  --shadow-soft: 0 28px 60px rgba(15, 26, 58, 0.12);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 30px rgba(15, 26, 58, 0.1);
}

body[data-theme='dark'] {
  --navbar-active: rgba(255, 255, 255, 0.12);
}

body[data-theme='light']::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 190, 235, 0.35), transparent 50%),
    radial-gradient(circle at 80% 25%, rgba(170, 210, 255, 0.35), transparent 55%),
    radial-gradient(circle at 35% 75%, rgba(255, 223, 175, 0.32), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(196, 255, 230, 0.3), transparent 55%);
  filter: blur(16px);
  opacity: 0.9;
}

body[data-theme='light']::after {
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(2px 2px at 70% 20%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(2px 2px at 40% 80%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(2px 2px at 80% 70%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 55% 45%, rgba(255, 255, 255, 0.6), transparent 60%);
  opacity: 0.6;
}

body > * {
  position: relative;
  z-index: 1;
}

@keyframes cosmicDrift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  100% {
    transform: translate3d(2%, 1%, 0) scale(1.02);
  }
}

@keyframes starTwinkle {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.85;
  }
}

.viewport {
  min-height: 100%;
  height: 100vh;
  padding: 0;
  background: var(--device-surface);
}

.device {
  width: min(100%, 460px);
  min-height: 100%;
  height: 100vh;
  background: var(--device-surface);
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  transition: background 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.device-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  overflow-y: auto;
  min-height: 0;
  padding-top: 16px;
  padding-bottom: calc(28px + var(--nav-height) + env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: calc(28px + var(--nav-height) + env(safe-area-inset-bottom, 0px));
  align-items: stretch;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
}

.device-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.device-body::-webkit-scrollbar-thumb {
  background: transparent;
}

body[data-theme='light'] .device-body::-webkit-scrollbar-thumb {
  background: transparent;
}

.device-body > :not(.floating-toggle) {
  width: 100%;
}

.floating-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 15;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.device .floating-toggle {
  margin: 0;
  align-self: auto;
}

body.theme-toggle-hidden .floating-toggle {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.welcome-bar {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-inset);
}

.welcome-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.welcome-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.welcome-bar .theme-toggle {
  flex: 0 0 auto;
}

.lang-select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--surface-pill);
  color: inherit;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  min-width: 0;
}

.lang-select__value {
  display: grid;
  place-items: center;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-main);
}

.lang-select__caret {
  display: none;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  z-index: 30;
}

.lang-menu.open {
  display: flex;
}

.lang-menu button {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--surface-pill);
  color: inherit;
  font-size: 15px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lang-menu button[aria-selected='true'] {
  background: var(--surface-contrast);
  border-color: var(--border-contrast);
}

body[data-theme='dark'] .lang-select__trigger,
body[data-theme='dark'] .lang-menu,
body[data-theme='dark'] .lang-menu button {
  background: var(--bg-panel);
}

.welcome-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--text-main);
}

.welcome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.welcome-eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.welcome-balance {
  margin: 4px 0 0;
  font-size: 17px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.welcome-balance__currency {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.welcome-bar h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chrome-left,
.chrome-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-pill {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--surface-pill);
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  border: 1px solid var(--pill-border);
  box-shadow: var(--shadow-inset);
}

.brand-pill strong {
  font-size: 16px;
}

.brand-pill small {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface-soft);
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.icon-btn.ghost {
  background: transparent;
  border-color: var(--border-soft);
}

.wallet-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.pill-action {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-soft);
  border-color: var(--border-soft);
  color: inherit;
  cursor: pointer;
}

.pill-action.wallet .wallet-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2af598, #009efd);
  display: inline-block;
}

.theme-toggle {
  --toggle-pad: 4px;
  width: 56px;
  height: 30px;
  padding: var(--toggle-pad);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  position: relative;
  cursor: pointer;
  background: linear-gradient(180deg, #1a2240, #0c1326);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.08), 0 6px 16px rgba(0, 0, 0, 0.25);
  display: inline-block;
  box-sizing: border-box;
  line-height: 0;
  overflow: hidden;
}

.theme-toggle::before,
.theme-toggle::after {
  content: none;
}

.theme-toggle::before {
  left: 10px;
}

.theme-toggle::after {
  right: 10px;
}

/* handled by .floating-toggle above */

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  width: min(100%, 640px);
  margin-left: auto;
  margin-right: auto;
}

.link-back {
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--pill-border);
  background: var(--surface-pill);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.link-back:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.link-back span {
  font-size: 18px;
}

.link-back svg {
  width: 18px;
  height: 18px;
}

.theme-toggle span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3f6ff, #c7d3ff);
  position: absolute;
  top: 50%;
  left: var(--toggle-pad);
  transform: translateY(-50%);
  transition: transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease, left 0.3s ease, right 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-theme='dark'] .theme-toggle span {
  background: radial-gradient(circle at 35% 35%, #e6ecff, #b7c5ff);
  border-color: rgba(255, 255, 255, 0.24);
}

body[data-theme='light'] .theme-toggle span {
  left: auto;
  right: var(--toggle-pad);
  transform: translateY(-50%);
  background: radial-gradient(circle at 35% 35%, #eafff4, #79e0c7);
  border-color: rgba(60, 200, 160, 0.45);
}

body[data-theme='light'] .theme-toggle {
  background: linear-gradient(180deg, #eafaf3, #bcebd8);
  border-color: rgba(16, 22, 40, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 6px 16px rgba(12, 18, 32, 0.12);
}

body[data-theme='dark'] .theme-toggle {
  background: linear-gradient(180deg, #1a2240, #0c1326);
  border-color: rgba(255, 255, 255, 0.14);
}

.primary-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-links a {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-pill);
  border: 1px solid var(--pill-border);
  padding: 8px 18px;
  font-weight: 500;
  background: var(--surface-pill);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.primary-links a.active {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.hero {
  display: grid;
  gap: var(--space-xs);
}

.stacked-center {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.card.stacked-center,
.glass.stacked-center,
.withdraw.stacked-center,
.funds-grid.stacked-center,
.insights-grid.stacked-center,
.card.deposit-stack.stacked-center {
  text-align: left;
  width: 100%;
}

.hero.stacked-center {
  text-align: center;
}

.hero.stacked-center p {
  margin-left: auto;
  margin-right: auto;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--text-muted);
  margin: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(24px, 6vw, 40px);
  line-height: 1.1;
}

.hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.app-panel {
  display: none;
  gap: var(--space-md);
}

.app-panel.active {
  display: grid;
}

.glass,
.card,
.panel,
.insight-card,
.deposit-card {
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  padding: clamp(16px, 4vw, var(--space-md));
  box-shadow: var(--shadow-inset);
}

body[data-theme='light'] .glass,
body[data-theme='light'] .card,
body[data-theme='light'] .panel,
body[data-theme='light'] .insight-card,
body[data-theme='light'] .deposit-card {
  background: #ffffff;
  border-color: rgba(14, 18, 40, 0.08);
  box-shadow: var(--shadow-inset);
}

body[data-theme='light'] .balance-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(226, 234, 255, 0.85));
  border: 1px solid rgba(14, 18, 40, 0.06);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 20px 35px rgba(15, 26, 58, 0.08);
}

.balance-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.balance-amount {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: nowrap;
}

.balance-value {
  font-size: clamp(24px, 5.5vw, 38px);
  font-weight: 600;
}

.balance-card .balance-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.btn-primary,
.btn-ghost,
.btn-pill,
.chip-btn,
.btn-portfolio,
.stake-actions__buttons a,
.stake-actions__buttons button {
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn-ghost {
  background: var(--surface-pill);
  border: 1px solid var(--pill-border);
  color: inherit;
}

.btn-pill {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 235, 255, 0.82));
  color: #0b0f1c;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 14px 28px rgba(7, 8, 20, 0.35);
}

body[data-theme='light'] .btn-pill {
  background: linear-gradient(135deg, rgba(93, 116, 255, 0.75), rgba(128, 199, 255, 0.75));
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}

body[data-theme='light'] .btn-primary,
body[data-theme='light'] .btn-primary:hover,
body[data-theme='light'] .btn-primary:active {
  box-shadow: none;
}

.btn-portfolio {
  background: transparent;
  border: 2px solid var(--border-strong);
  color: inherit;
  padding: 10px 24px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: inset 0 0 0 1px var(--border-soft);
}

.btn-primary:hover,
.btn-ghost:hover,
.btn-pill:hover,
.chip-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(10, 14, 28, 0.35);
}

.btn-primary:active,
.btn-ghost:active,
.btn-pill:active,
.chip-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(10, 14, 28, 0.25);
}

.btn-portfolio,
.btn-portfolio:hover,
.btn-portfolio:focus-visible,
.btn-portfolio:active {
  transform: none;
  box-shadow: inset 0 0 0 1px var(--border-soft);
}

.portfolio-indicator {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.portfolio-indicator[data-status='empty'] {
  opacity: 0.5;
}

.stake-actions__buttons a {
  text-decoration: none;
}

.tab-shell {
  display: grid;
  gap: var(--space-md);
}

.segment-control {
  display: flex;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  padding: 6px;
  background: var(--surface-pill);
}

.segment-control button {
  flex: 1;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  background: transparent;
  color: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.segment-control button.active {
  background: var(--surface-soft);
  color: var(--text-main);
}
.plan-group {
  display: none;
  margin-top: var(--space-sm);
  gap: var(--space-sm);
}

.plan-group.active {
  display: grid;
}

.plan-card {
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--plan-gradient-dark, radial-gradient(circle at top, rgba(122, 84, 255, 0.25), rgba(7, 10, 20, 0.9)));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: var(--space-sm);
}

body[data-theme='light'] .plan-card {
  background: var(--plan-gradient-light, linear-gradient(180deg, #fbfdff, #e9f0ff));
  border-color: rgba(8, 12, 30, 0.08);
  box-shadow: 0 20px 45px rgba(9, 15, 35, 0.07);
}

.plan-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.plan-card span {
  font-weight: 600;
}

.plan-card p {
  margin: 0;
}

.plan-divider {
  height: 1px;
  background: var(--border-soft);
  border-radius: 999px;
}
.plan-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: var(--space-xs);
}

.plan-actions a,
.plan-actions button {
  width: 100%;
}

.plan-actions .btn-ghost {
  border-color: var(--border-strong);
}

@media (max-width: 520px) {
  .plan-actions .btn-primary,
  .plan-actions .btn-ghost {
    font-size: 14px;
  }
}

@media (max-width: 520px) {
  .form-actions .btn-primary {
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .btn-primary,
  .btn-ghost,
  .btn-pill,
  .btn-portfolio,
  .chip-btn,
  .stake-actions__buttons a,
  .stake-actions__buttons button {
    font-size: 14px;
  }
}

.plan-detail {
  display: none;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--detail-border);
  background: var(--detail-bg);
  padding: 12px 14px;
}

.plan-detail.active {
  display: block;
}

.plan-detail ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.plan-detail li strong {
  color: var(--text-main);
}


.plan-grid {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stake-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.stake-balance {
  display: grid;
  gap: var(--space-sm);
  justify-items: center;
}

.stake-balance__metrics {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: nowrap;
  justify-content: center;
  width: 100%;
}

.stake-balance__metrics > div {
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 0;
  flex: 1;
  text-align: center;
  display: grid;
  justify-items: center;
}

.stake-balance__metrics .label {
  display: block;
  text-align: center;
  width: 100%;
}
.stake-balance__metrics strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(16px, 5vw, 18px);
}

.stake-actions__buttons {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  justify-items: stretch;
  width: 100%;
}

.stake-actions__buttons a,
.stake-actions__buttons button {
  width: 100%;
}

.stake-actions__buttons .btn-portfolio {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 320px;
}

.my-portfolio header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.portfolio-list {
  margin-top: var(--space-sm);
  display: grid;
  gap: var(--space-sm);
  width: 100%;
  justify-items: center;
}

.funds-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.funds-shell {
  display: grid;
  gap: var(--space-md);
}

.funds-toggle {
  display: grid;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
}

.funds-toggle button {
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 6px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.funds-toggle button.active {
  background: var(--surface-contrast);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.funds-toggle button:hover {
  transform: translateY(-1px);
}

.funds-toggle__title {
  font-weight: 500;
  font-size: 14px;
}

.funds-toggle__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.funds-panel {
  display: none;
  gap: var(--space-md);
}

.funds-panel.active {
  display: grid;
}

.network-shell {
  display: grid;
  gap: var(--space-sm);
}

.network-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.network-tabs button {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  padding: 8px 14px;
  background: var(--surface-pill);
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 2px;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.network-tabs button.active {
  background: var(--surface-contrast);
  border-color: var(--border-contrast);
}

.network-tabs button:hover {
  transform: translateY(-1px);
}

.network-tabs small {
  font-size: 11px;
  color: var(--text-muted);
}

.network-panel {
  display: none;
  gap: var(--space-sm);
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
}

.network-panel.active {
  display: grid;
}

.network-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.network-chip {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  padding: 6px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface-soft);
}

.network-address {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-card);
  padding: 12px 14px;
}

.network-address[hidden] {
  display: none;
}

.network-address code {
  font-size: 14px;
  word-break: break-all;
}

.funds-switch {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-sm);
}

.funds-switch a {
  width: 100%;
  max-width: 320px;
}

.payment-quote {
  margin: var(--space-sm) 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-card);
  font-size: 14px;
  color: var(--text-muted);
}

.network-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-sm);
  margin: var(--space-sm) 0 var(--space-2xs);
}

.network-form .form-field {
  flex: 1 1 160px;
  margin: 0;
}

.network-amount {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-card);
  padding: 12px 14px;
  margin-top: var(--space-sm);
}

.network-amount[hidden] {
  display: none;
}

.network-amount code {
  font-size: 14px;
  word-break: break-all;
}

.tab-panel {
  display: none;
  animation: fade 0.3s ease;
}

.tab-panel.active {
  display: grid;
  gap: var(--space-md);
}

.deposit-stack header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.deposit-list {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.deposit-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.portfolio-board {
  display: grid;
  gap: var(--space-sm);
}

.portfolio-shell {
  display: grid;
  gap: var(--space-md);
}

.portfolio-panel {
  display: none;
}

.portfolio-panel.active {
  display: block;
}

.portfolio-board header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.portfolio-board header .btn-ghost {
  padding-inline: 16px;
}

.portfolio-entries {
  display: grid;
  gap: var(--space-sm);
}

.portfolio-entry.deposit-card {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
  border: 1px solid var(--border-soft);
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
}

.portfolio-entry__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.rate-pill {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  border: 1px solid var(--pill-border);
  background: var(--surface-pill);
  font-weight: 600;
  font-size: 14px;
}

.portfolio-entry__stats {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.portfolio-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.portfolio-actions .btn-ghost {
  padding: 10px 18px;
  font-size: 12px;
}

.auto-renew {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auto-renew > div {
  min-width: 0;
  flex: 1;
}

.auto-renew strong {
  display: block;
  font-size: 14px;
}

.auto-renew .subtle {
  margin: 4px 0 0;
  font-size: 12px;
}

.switch {
  position: relative;
  width: 56px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--surface-pill);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  box-sizing: border-box;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch {
  --switch-pad: 4px;
}

.slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  left: var(--switch-pad);
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(10, 12, 22, 0.2);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.switch input:checked + .slider::before {
  left: auto;
  right: var(--switch-pad);
  transform: translateY(-50%);
}

.unfreeze-panel {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.unfreeze-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.unfreeze-panel__note {
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.unfreeze-breakdown {
  display: grid;
  gap: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-muted);
  padding: 12px 14px;
}

.unfreeze-breakdown span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.unfreeze-breakdown strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.unfreeze-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-card);
  padding: 12px 14px;
}

.unfreeze-total span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.unfreeze-total strong {
  font-size: 18px;
}

.unfreeze-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.unfreeze-panel__hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.unfreeze-panel__actions {
  justify-content: space-between;
  width: 100%;
}

.unfreeze-panel__actions .btn-ghost,
.unfreeze-panel__actions .btn-primary {
  flex: 1;
}

.modal-close {
  border: 0;
  background: transparent;
  color: inherit;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
  opacity: 1;
  transform: scale(1.04);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.success-panel {
  display: grid;
  gap: 14px;
}

.success-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.success-panel__timer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-muted);
  padding: 12px 14px;
}

.success-panel__timer span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.success-panel__timer strong {
  font-size: 18px;
}

@media (max-width: 520px) {
  .unfreeze-panel__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .unfreeze-panel__actions .btn-ghost,
  .unfreeze-panel__actions .btn-primary {
    width: 100%;
  }
}

.portfolio-stat {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.portfolio-stat:last-child {
  border-bottom: 0;
}

.stat-text span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-text {
  flex: 1;
}

.stat-text strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.portfolio-entry__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.portfolio-entry.empty {
  border-style: dashed;
  border-color: var(--border-soft);
  background: var(--surface-muted);
  text-align: center;
}

.archive-board .portfolio-entry {
  opacity: 0.85;
}

.archive-board .portfolio-entry__head {
  opacity: 0.9;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  color: inherit;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.pill-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.timer-pill {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  border: 1px solid var(--pill-border);
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-pill);
}

.timer-pill--free {
  border-color: rgba(72, 210, 255, 0.6);
  color: #4cc9f0;
}



.btn-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
}

.deposit-card .asset {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
}

.asset-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

.asset-icon svg {
  width: 20px;
  height: 20px;
}

.asset-icon.ton {
  background: #00a8ff;
}

.asset-icon.usdt {
  background: #26a17b;
}

.asset-icon.usde {
  background: #fff;
  color: #0b0f1c;
}

.portfolio-id {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

.deposit-info {
  min-width: 140px;
  color: var(--text-muted);
}

.deposit-info .total {
  display: block;
  font-weight: 600;
  font-size: 20px;
  color: var(--text-main);
}

.chip-btn {
  background: #08a9ff;
  color: #fff;
  padding-inline: 20px;
}

.portfolio-entry .chip-btn {
  margin-left: auto;
}

.insights-grid {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.insight-card h3 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-size: 14px;
}

.faq-shell {
  display: grid;
  gap: var(--space-sm);
}

.faq-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  padding: 18px 20px;
  cursor: pointer;
}

.faq-text {
  flex: 1;
  position: relative;
}

.faq-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.faq-card p {
  margin: 0;
  color: var(--text-muted);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.faq-card--support .faq-text {
  display: grid;
  gap: 10px;
}

.faq-card--support .btn-support {
  margin-top: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.18);
}

.faq-card--support .btn-support:hover {
  box-shadow: 0 14px 26px rgba(16, 24, 40, 0.24);
}

body[data-theme='light'] .faq-card {
  background: #fff;
  border-color: rgba(15, 22, 48, 0.08);
  box-shadow: 0 12px 24px rgba(15, 22, 48, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-theme='light'] .reward-item {
  background: #fff;
  border-color: rgba(15, 22, 48, 0.08);
}

.faq-card:not(.open) .faq-text::after {
  display: none;
}

.faq-toggle {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  font-size: 26px;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

.faq-card.open .faq-toggle {
  transform: rotate(90deg);
  color: rgba(255, 255, 255, 0.65);
}

.faq-card.open p {
  line-clamp: unset;
  -webkit-line-clamp: unset;
  display: block;
}

.faq-card.open .faq-text::after {
  opacity: 0;
}

.metric {
  font-size: 26px;
  font-weight: 600;
  margin: 8px 0;
}

.subtle {
  color: var(--text-muted);
  margin: 0;
}

.tariff-grid,
.portfolio-grid,
.rewards-grid {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tariff-card strong {
  font-size: 34px;
  display: block;
  margin: 12px 0 4px;
}

.tariff-picker {
  display: grid;
  gap: 10px;
  margin: var(--space-sm) 0;
}

.tariff-option {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-muted);
  padding: 14px 16px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  cursor: pointer;
  color: var(--text-main);
}

.tariff-option strong {
  display: block;
  font-size: 18px;
}

.tariff-option span {
  color: var(--text-muted);
  font-size: 14px;
}

.tariff-option small {
  font-weight: 600;
}

.limit-note--flex {
  color: #20f19c;
}

.tariff-option strong,
.tariff-option span,
.tariff-option small {
  color: inherit;
}

.tariff-option.active {
  border-color: rgba(76, 201, 240, 0.8);
  background: var(--surface-contrast);
  box-shadow: 0 10px 30px rgba(76, 124, 255, 0.15);
}

.deposit-shell,
.withdraw-shell {
  display: grid;
  gap: var(--space-md);
  width: 100%;
}

@media (min-width: 900px) {
  .deposit-shell,
  .withdraw-shell {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: flex-start;
  }
}

.deposit-main,
.withdraw-main {
  display: grid;
  gap: var(--space-sm);
}

.deposit-header,
.withdraw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.deposit-perks,
.withdraw-perks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.deposit-metric,
.withdraw-metric {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  background: var(--surface-pill);
  width: 100%;
}

.deposit-metric span,
.withdraw-metric span {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.deposit-metric strong,
.withdraw-metric strong {
  font-size: clamp(22px, 4.6vw, 34px);
}

.deposit-metric small,
.withdraw-metric small {
  color: var(--text-muted);
}

.network-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.network-option {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 12px 10px;
  background: var(--surface-pill);
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 4px;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.network-option span {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.network-option small {
  font-size: 11px;
  color: var(--text-muted);
}

.network-option.active {
  background: var(--surface-contrast);
  border-color: var(--border-contrast);
  box-shadow: 0 10px 26px rgba(76, 124, 255, 0.12);
}

.network-option:hover {
  transform: translateY(-1px);
}

.history-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 18px 30px rgba(76, 124, 255, 0.25);
}

.history-link svg {
  width: 16px;
  height: 16px;
}

.history-callout__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.history-callout__inner h3 {
  margin: 4px 0;
}

.history-callout__inner p {
  margin: 0;
}

.history-callout__inner--history {
  margin-bottom: var(--space-sm);
}

.payment-panel {
  display: grid;
  gap: var(--space-sm);
}

.payment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.timer-chip {
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  background: var(--surface-pill);
  border: 1px solid var(--border-soft);
  font-weight: 600;
}

.payment-account {
  display: grid;
  gap: 10px;
}

.account-label {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.account-value {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-soft);
}

.account-value code {
  font-size: 15px;
  word-break: break-all;
}

.copy-btn {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  padding: 8px 16px;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.copy-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.copy-btn svg {
  width: 16px;
  height: 16px;
}

.payment-details {
  display: grid;
  gap: var(--space-sm);
}

@media (min-width: 560px) {
  .payment-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.payment-notes {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.history-shell {
  display: grid;
  gap: var(--space-sm);
}

.history-panel {
  display: grid;
  gap: var(--space-sm);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.history-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 26px;
}

.history-cta svg {
  width: 16px;
  height: 16px;
}

.history-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-filters button {
  border-radius: var(--radius-pill);
  border: 1px solid var(--pill-border);
  background: var(--surface-pill);
  color: inherit;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.history-filters button.active {
  background: var(--surface-soft);
  border-color: var(--border-strong);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.history-list {
  display: grid;
  gap: var(--space-sm);
}

.history-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface-muted);
  display: grid;
  gap: 12px;
}

.history-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.history-card__body {
  display: grid;
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .history-card__body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.history-status {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  border: 1px solid var(--pill-border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-status--success {
  color: #18d1a5;
  border-color: rgba(24, 209, 165, 0.5);
}

.history-status--pending {
  color: #f5a524;
  border-color: rgba(245, 165, 36, 0.5);
}

.history-date {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
}

.history-amount {
  font-size: 24px;
  font-weight: 600;
  margin: 4px 0 0;
}

.deposit-aside,
.withdraw-aside {
  display: grid;
  gap: var(--space-sm);
}

.form-grid {
  display: grid;
  gap: var(--space-sm);
}

.form-field {
  display: grid;
  gap: 6px;
}

.input-pair {
  display: grid;
  gap: var(--space-sm);
}

@media (min-width: 720px) {
  .input-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.input-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  flex-wrap: wrap;
}

.form-footnote {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 360px;
}

.deposit-stat-grid {
  display: grid;
  gap: var(--space-sm);
}

@media (min-width: 560px) {
  .deposit-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.network-list,
.step-list {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-xs);
}

.network-list li,
.step-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--surface-pill);
}

.network-list span,
.step-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.step-index {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.step-list li {
  gap: var(--space-sm);
}

.step-list li > div {
  flex: 1;
}

.status-badge {
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  border: 1px solid var(--border-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-badge--success {
  color: #14d19d;
  border-color: rgba(20, 209, 157, 0.5);
}

.status-badge--warning {
  color: #f29e38;
  border-color: rgba(242, 158, 56, 0.5);
}

.deposit-cta {
  display: grid;
  gap: var(--space-xs);
}

.support-card {
  display: grid;
  gap: var(--space-sm);
}

.deposit-highlights .insight-card,
.withdraw-metrics .insight-card {
  min-height: 180px;
}

.portfolio-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.rewards-card ul {
  padding-left: 18px;
  margin: 8px 0 0;
}

.rewards-list {
  display: grid;
  gap: var(--space-sm);
  width: 100%;
}

.reward-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  padding: 14px 18px 44px;
  box-shadow: 0 12px 28px rgba(15, 22, 48, 0.08);
  position: relative;
}

.reward-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: inherit;
}

.reward-text {
  flex: 1;
}

.reward-text h3 {
  margin: 0 0 4px;
}

.reward-text p {
  margin: 0;
  color: var(--text-muted);
}

.reward-bonus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-weight: 600;
  color: #2af598;
}

.reward-action {
  border: 1px solid var(--pill-border);
  background: var(--surface-pill);
  color: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: absolute;
  right: 16px;
  bottom: 12px;
}

.reward-action:disabled {
  cursor: default;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.reward-status {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.funds-history {
  margin-top: var(--space-lg);
}

.funds-history-list {
  display: grid;
  gap: 12px;
  width: 100%;
}

.funds-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 12px 14px;
}

.funds-history-row strong {
  display: block;
  margin-bottom: 4px;
}

.funds-history-amount {
  font-weight: 600;
  color: #2af598;
  white-space: nowrap;
}

.telegram-gate {
  display: grid;
  gap: var(--space-sm);
}

.referral {
  text-align: left;
  padding: var(--space-md);
  gap: var(--space-sm);
  display: grid;
}

.referral-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.copy-panel {
  display: grid;
  gap: 10px;
  width: 100%;
}

.copy-panel input {
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  padding: 12px 18px;
  background: transparent;
  color: inherit;
  font-size: 16px;
}

.referral-metrics {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.referral-metrics article {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 16px;
  display: grid;
  gap: 4px;
  background: var(--surface-muted);
}

.referral-metrics article strong {
  font-size: 24px;
}

.referral-payouts {
  display: grid;
  gap: 10px;
  width: 100%;
}

.referral-payout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 14px;
  background: var(--surface-muted);
}

.payout-rate {
  min-width: 56px;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.payout-body {
  display: grid;
  gap: 4px;
}

.payout-body strong {
  font-size: 16px;
}

.referral-stats {
  display: grid;
  gap: var(--space-sm);
  width: 100%;
  margin-top: var(--space-sm);
}

.referral-list {
  display: grid;
  gap: var(--space-sm);
  width: 100%;
}

.referral-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  background: var(--surface-muted);
}

.referral-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.referral-item__name {
  font-weight: 600;
  font-size: 16px;
}

.referral-item__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.referral-item__meta .label {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.referral-item__meta strong,
.referral-item__date {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

.controls {
  display: grid;
  gap: 12px;
  width: 100%;
  justify-items: stretch;
  margin-top: var(--space-sm);
  padding-top: 8px;
  padding-bottom: 8px;
}

.controls .btn-ghost,
.controls .btn-primary {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.referral-stats article {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 16px;
  display: grid;
  gap: 10px;
  background: var(--surface-muted);
}

.referral-stats header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.referral-stats ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.referral-stats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.ton-connect-shell {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
}

#ton-connect-button {
  width: 100%;
  display: flex;
  justify-content: center;
}

[data-ton-address] {
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.ton-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ton-address-label {
  font-weight: 600;
  color: var(--text-main);
}

.ton-address-short {
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.text-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: inherit;
}

.text-icon--mini {
  width: 18px;
  height: 18px;
  border-radius: 6px;
}

.text-icon svg {
  width: 14px;
  height: 14px;
}

.text-icon--mini svg {
  width: 12px;
  height: 12px;
}

body[data-theme='light'] .text-icon {
  background: rgba(14, 18, 40, 0.06);
  border-color: rgba(14, 18, 40, 0.14);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(460px, calc(100% - 24px));
  min-height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  background: var(--navbar-surface);
  border-radius: 999px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 40px rgba(2, 4, 12, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  z-index: 50;
  color: var(--text-main);
  overflow: visible;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.nav-hidden .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
}

@media (max-width: 520px) {
  .device {
    border: 0;
    box-shadow: none;
  }

  .bottom-nav {
    width: calc(100% - 20px);
    bottom: 10px;
  }
}
body[data-theme='light'] .bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(14, 18, 40, 0.2);
  box-shadow: 0 16px 36px rgba(10, 16, 32, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
body[data-theme='dark'] .bottom-nav {
  background: rgba(10, 12, 20, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 40px rgba(2, 4, 12, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.bottom-nav button,
.bottom-nav a {
  border: 0;
  border-radius: 0;
  padding: 6px 6px;
  background: transparent;
  color: inherit;
  text-align: center;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  min-height: 56px;
}

.nav-icon {
  width: 28px;
  height: 28px;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.bottom-nav a {
  text-decoration: none;
}

.bottom-nav a.active {
  background: transparent;
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: none;
  position: relative;
  z-index: 2;
}

.bottom-nav a.active::before {
  content: '';
  position: absolute;
  inset: -4px -5px;
  border-radius: 999px;
  background: rgba(210, 215, 228, 0.75);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  z-index: -1;
}

body[data-theme='dark'] .bottom-nav a.active {
  background: transparent;
}

body[data-theme='light'] .bottom-nav a.active {
  background: transparent;
}

body[data-theme='dark'] .bottom-nav a.active::before {
  background: rgba(255, 255, 255, 0.18);
}

body[data-theme='light'] .bottom-nav a.active::before {
  background: rgba(230, 235, 248, 0.9);
}

.bottom-nav a:hover {
  background: transparent;
  transform: none;
  color: var(--text-main);
}
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-backdrop);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  color: var(--text-main);
  z-index: 1000;
  overflow: hidden;
}

.overlay--full {
  padding: 0;
}

.overlay.hidden {
  display: none;
}

.overlay .panel {
  width: min(92vw, 520px);
  max-height: calc(100vh - 2 * var(--space-lg));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: calc(var(--radius-lg) + 4px);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: var(--space-md);
  position: relative;
}

.withdraw-error {
  display: grid;
  gap: 12px;
}

.withdraw-error .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.withdraw-error__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.withdraw-error__actions {
  display: flex;
  justify-content: flex-end;
}

.overlay.overlay--full .panel {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  overflow: hidden;
}

.overlay.overlay--full .invest-panel {
  height: 100%;
  overflow: auto;
  padding: var(--space-lg);
  -webkit-overflow-scrolling: touch;
}

.app-notice {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1100;
  pointer-events: none;
}

.app-notice__card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 240px;
  max-width: min(360px, 92vw);
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  color: var(--text-main);
  opacity: 0;
  transform: translateY(-6px);
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: auto;
}

.app-notice.is-visible .app-notice__card {
  opacity: 1;
  transform: translateY(0);
}

.app-notice__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-contrast);
  margin-top: 6px;
  flex: 0 0 auto;
}

.app-notice__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
}

.app-notice__close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  padding: 2px;
  cursor: pointer;
  flex: 0 0 auto;
}

.app-notice__close svg {
  width: 18px;
  height: 18px;
}

.invest-panel {
  display: grid;
  gap: 14px;
  position: relative;
}

.invest-confirm-panel {
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.invest-earn {
  border-radius: var(--radius-md);
  border: 0;
  background: linear-gradient(135deg, rgba(64, 216, 160, 0.14), rgba(64, 160, 255, 0.14));
  padding: 16px 18px;
  display: grid;
  gap: 6px;
}

.invest-earn span {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.invest-earn strong {
  font-size: 20px;
}

.invest-earn .subtle {
  margin: 0;
}

.invest-earn.hidden {
  display: none;
}

.invest-earn--daily {
  background: linear-gradient(135deg, rgba(96, 160, 255, 0.14), rgba(96, 120, 255, 0.12));
}

.invest-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

.invest-panel > * {
  position: relative;
  z-index: 1;
}

.invest-panel h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.invest-panel .subtle {
  margin: 0 0 4px;
  font-size: 14px;
}

.invest-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: calc(var(--radius-md) - 4px);
  border: 0;
  background: var(--surface-muted);
  padding: 12px 16px;
}

.invest-summary span {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.invest-summary strong {
  font-size: 15px;
}

.invest-panel .form-actions {
  justify-content: space-between;
  width: 100%;
}

@media (max-width: 520px) {
  .overlay {
    padding: var(--space-md);
  }

  .invest-summary {
    grid-template-columns: 1fr;
  }

  .invest-panel .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

label {
  font-size: 14px;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: inherit;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ton-pay-form {
  gap: var(--space-md);
}

.ton-pay-form .form-actions {
  justify-content: center;
  align-items: center;
}

.ton-pay-form .form-footnote {
  max-width: 420px;
  text-align: center;
}

.ton-pay-form .btn-primary {
  min-width: 220px;
}

.ton-pay-form .form-field input {
  border-radius: var(--radius-pill);
  background: var(--surface-pill);
  border-color: var(--pill-border);
  padding: 12px 16px;
}

.select-pill {
  position: relative;
}

.select-pill select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--radius-pill);
  background: var(--surface-pill);
  border: 1px solid var(--pill-border);
  padding: 12px 44px 12px 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.select-pill::after {
  content: '▾';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.admin-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-card {
  border-radius: var(--radius-lg);
  background: var(--bg-panel-soft);
  padding: var(--space-md);
  display: grid;
  gap: var(--space-sm);
}

.preview {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  padding: var(--space-sm);
}

@media (max-width: 768px) {
  .viewport {
    padding: 0;
  }

  .device {
    width: 100%;
    min-height: 100vh;
    padding: 24px 16px 0;
    border-radius: 0;
    box-shadow: none;
  }

  .floating-toggle {
    top: 16px;
    right: 16px;
  }

  .device-body {
    padding-right: 0;
    padding-bottom: 140px;
  }

  .wallet-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .balance-card {
    padding: 20px;
  }

  .deposit-card {
    flex-direction: column;
    align-items: flex-start;
  }

}

@media (max-width: 600px) {
  .glass,
  .card,
  .panel,
  .insight-card,
  .deposit-card {
    border-radius: 20px;
  }

  .balance-card .balance-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .deposit-card {
    padding: 16px;
  }

  .asset-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
  }

  .hero h1 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .stake-balance__metrics > div {
    padding: 10px 12px;
  }

  .stake-balance__metrics {
    gap: 10px;
  }

  .segment-control button {
    font-size: 15px;
  }

  .stake-actions__buttons a,
  .stake-actions__buttons button {
    padding: 10px 18px;
  }
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.btn-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-freeze {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-freeze svg {
  width: 18px;
  height: 18px;
}
.token-icon,
.asset-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.token-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 12px;
  background: #26a17b;
  aspect-ratio: 1 / 1;
}

.token-icon.token-icon--mini {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 10px;
  aspect-ratio: 1 / 1;
}

.token-icon i,
.asset-icon i {
  font-size: 20px;
  line-height: 1;
  display: block;
}
.referral h2 {
  margin-bottom: 8px;
}

.copy-panel .btn-primary {
  width: 100%;
}
