:root {
  --bg-deep: #5f1a7b;
  --bg-mid: #b974e1;
  --bg-light: #d6a6f2;
  --card-bg: #e9c7ff;
  --card-shadow: rgba(0, 0, 0, 0.25);
  --text-dark: #2b1340;
  --text-mid: #492165;
  --btn-bg: #0b0b0b;
  --btn-text: #ffffff;
  --ghost-bg: #e2c8fb;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--bg-mid) 0%, var(--bg-light) 60%) no-repeat fixed;
}

.page { min-height: 100vh; position: relative; }
.page-white { background: #fff; }

/* Dark extension look */
.page-dark { background: #0d0d0d; color: #fff; }
.page-dark::before, .page-dark::after { display: none; }

.wallet-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #222425;
}
.wt-left { display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffd54f, #7c3aed); }
.account-meta .handle { font-weight: 700; color: #e5e7eb; font-size: 14px; }
.account-meta .sub { color: #9ca3af; font-size: 12px; }
.wt-right { display: flex; gap: 8px; }
.icon-btn { background: transparent; border: none; color: #e5e7eb; font-size: 18px; cursor: pointer; }

.wallet-shell { width: 380px; margin: 0 auto; padding-bottom: 70px; }
.wallet-hero { padding: 20px 10px 8px; text-align: center; }
.portfolio-value { font-weight: 800; font-size: 44px; letter-spacing: -0.5px; color: #ffffff; margin: 8px 0 6px; }
.delta-row { display: flex; gap: 8px; justify-content: center; align-items: center; }
.badge { font-weight: 600; font-size: 12px; padding: 4px 8px; border-radius: 8px; border: 1px solid #2a2b2c; }
.badge-red { background: #1b0f0f; color: #f87171; border-color: #3a1f1f; }

.actions-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px; }
.action-pill { background: #151617; color: #e5e7eb; border: 1px solid #2a2b2c; border-radius: 14px; padding: 12px 10px; font-weight: 600; }

.tabs-row { display: flex; align-items: center; gap: 16px; padding: 0 16px; color: #e5e7eb; }
.tab { background: transparent; border: none; color: #9ca3af; font-weight: 700; padding: 8px 0; cursor: pointer; }
.tab.active { color: #ffffff; }
.dots { background: transparent; border: none; color: #9ca3af; font-size: 18px; margin-left: auto; cursor: pointer; }

.token-list { margin-top: 6px; }
.token-item { display: flex; justify-content: space-between; align-items: center; background: #101112; border: 1px solid #1f2021; border-radius: 12px; padding: 12px 14px; margin: 12px 16px; }
.ti-left { display: flex; align-items: center; gap: 10px; }
.token-icon-img { width: 28px; height: 28px; border-radius: 50%; display: block; }
.token-meta .name { font-weight: 700; color: #e5e7eb; }
.token-meta .sub { font-size: 12px; color: #9ca3af; }
.ti-right .fiat { font-weight: 700; color: #ffffff; text-align: right; }
.ti-right .sub { font-size: 12px; color: #9ca3af; text-align: right; }
.ti-right .sub.red { color: #f87171; }

.nav-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: center; padding: 10px 0; border-top: 1px solid #222425; background: #0d0d0d; }
.nav-btn { background: transparent; border: none; color: #9ca3af; font-size: 20px; cursor: pointer; }
.nav-btn.active { color: #ffffff; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
}

.logo {
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0.5px;
  color: #000;
}
.logo-with-icon { display: flex; align-items: center; gap: 10px; }
.logo-img { width: 28px; height: 28px; border-radius: 4px; }

.lang-select { position: fixed; right: 16px; top: 8px; }
.lang-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f3dbff;
  color: #2b1340;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: 0 2px 0 rgba(0,0,0,0.2) inset;
  cursor: pointer;
}
.lang-button.outline {
  background: #fff;
  border: 1px solid #d9dee6;
  box-shadow: none;
}
.chevron { font-size: 14px; }

.content {
  display: grid;
  place-items: center;
  padding: 40px 16px 80px;
}

.card {
  width: clamp(320px, 52vw, 540px);
  background: var(--card-bg);
  border-radius: 22px;
  padding: 54px 36px 28px;
  box-shadow: 0 1px 0 #fff inset, 0 18px 30px var(--card-shadow);
  position: relative;
}
.card-white { background: #fff; box-shadow: 0 0 0 1px #eceff3 inset, 0 10px 28px rgba(0,0,0,0.08); }
.narrow { width: clamp(320px, 48vw, 640px); }
.card-head { display: flex; align-items: center; height: 20px; }
.back { text-decoration: none; color: #222; font-size: 20px; }
.step { color: #6b7280; font-weight: 600; margin: 16px 0 6px; }
.title.strong { font-weight: 800; font-size: clamp(28px, 4.2vw, 40px); color: #111; text-align: left; }
.subtitle { text-align: left; color: #555; margin: 6px 0 18px; }

.fox { display: flex; justify-content: center; margin-top: 12px; }
.fox-svg { width: 160px; height: 160px; }

.title {
  margin: 24px 0 8px;
  font-size: clamp(32px, 4.8vw, 48px);
  line-height: 1.05;
  text-align: center;
  color: var(--text-mid);
}

.actions { margin-top: 24px; display: grid; gap: 14px; }
.btn {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  border-radius: 12px;
  padding: 16px 18px;
}
.btn.primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}
.btn.primary:active { transform: translateY(1px); }
.btn.ghost {
  background: var(--ghost-bg);
  color: var(--text-mid);
}

.bottom-actions { margin-top: 24px; }
.btn.block { width: 100%; }
.btn.continue { background: #7b7b7b; color: #fff; padding: 12px 14px; font-size: 15px; }
.btn.continue:disabled { opacity: 0.8; cursor: not-allowed; }
.btn.continue.enabled { background: #1f2937; }

/* Form styles for second page */
.subtitle.center { text-align: center; color: var(--text-mid); margin-top: 4px; }
.form { margin-top: 20px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.label { font-weight: 600; color: var(--text-mid); }
.input {
  border-radius: 10px;
  border: 1px solid #cdb0ea;
  padding: 12px 14px;
  outline: none;
  font-size: 16px;
}
.input:focus { border-color: #9a6bc5; box-shadow: 0 0 0 3px rgba(154,107,197,0.18); }
.checkbox { display: flex; align-items: center; gap: 10px; color: var(--text-mid); }
.form-hint { color: #6b7280; font-size: 13px; margin-top: 4px; }
.form-error { color: #b91c1c; font-weight: 600; margin-top: 6px; }
.field-actions { margin-top: 6px; }

/* Password strength meter */
.strength-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.strength-bar { width: 100px; height: 8px; border-radius: 999px; background: #e5e7eb; box-shadow: inset 0 1px 0 rgba(0,0,0,0.08); }
.strength-bar.level-weak { background: #fca5a5; }
.strength-bar.level-med { background: #fbbf24; }
.strength-bar.level-strong { background: #34d399; }
.strength-label { font-size: 12px; color: #6b7280; font-weight: 700; }

/* SRP area */
.srp-box { border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0; }
.srp-empty { padding: 18px; background: #eef2f7; color: #6b7280; min-height: 160px; display: none; }
.srp-textarea {
  width: 100%; min-height: 220px; resize: vertical;
  border: none; outline: none; padding: 18px; font-size: 16px; line-height: 1.6;
  background: #eef2f7; color: #39424e;
}
.srp-textarea.masked { -webkit-text-security: disc; text-security: disc; }
.srp-actions { display: flex; justify-content: space-between; padding: 18px; background: #f3f6fb; }
.link-like { background: transparent; border: none; color: #2563eb; font-weight: 600; cursor: pointer; padding: 0; }
.link-like:hover { text-decoration: underline; }

.srp-error { color: #b91c1c; font-weight: 600; margin-top: 8px; }
.srp-warning { color: #b91c1c; background: #fff1f2; border: 1px solid #fca5a5; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-top: 12px; }

/* SRP chips grid */
.srp-chip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; background: #eef2f7; border-top: 1px solid #e2e8f0; }
.srp-chip { display: flex; align-items: center; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 12px; box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset; gap: 10px; }
.srp-chip .index { background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 8px; padding: 2px 8px; font-size: 13px; color: #6b7280; font-weight: 600; }
.srp-chip .word { color: #111827; }
.srp-chip.masked .word { -webkit-text-security: disc; text-security: disc; }
.srp-chip.placeholder { background: #f8fafc; }
.srp-chip.placeholder .word { color: #9ca3af; }
.srp-chip input.word-input {
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  font-size: 15px;
  color: #111827;
}
.srp-chip.masked input.word-input { -webkit-text-security: disc; text-security: disc; }
.srp-chip.invalid { border-color: #fca5a5; background: #fff1f2; }
.srp-actions .right-actions { margin-left: auto; display: flex; gap: 18px; }

/* Decorative background accents similar to screenshot */
.design-img { width: 100%; border-radius: 10px; border: 1px solid #e5e7eb; box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset; margin-bottom: 12px; }
.page::before, .page::after {
  content: "";
  position: fixed;
  z-index: -1;
}
.page::before {
  right: 0; top: 0; width: 55vw; height: 40vh;
  background: var(--bg-deep);
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
}

/* Extension popup mode */
.page.page-ext { background: #fff; }
.page.page-ext::before, .page.page-ext::after { display: none; }
.ext-card { width: 380px !important; }
.page::after {
  left: 0; bottom: 0; width: 75vw; height: 50vh;
  background: #c78bf2;
  clip-path: polygon(0 0, 72% 0, 54% 100%, 0 100%);
}

@media (max-width: 480px) {
  .card { width: 92vw; padding: 40px 20px; }
  .fox-svg { width: 130px; height: 130px; }
}
.wallet-topbar { height: 52px; }
.wt-left .account-meta { display: grid; line-height: 1.1; }
.account-meta .handle { letter-spacing: 0.2px; }
.account-meta .sub { display: inline-flex; align-items: center; gap: 6px; }
.account-meta .sub::after { content: "\1F517"; /* link icon */ font-size: 14px; color: #9ca3af; }

.portfolio-value { font-size: 48px; }
.badge { background: #211313; border-color: #3a1f1f; }
.badge-red { color: #ff6b6b; }

.action-pill { box-shadow: 0 0 0 1px #2a2b2c inset; border-radius: 16px; }
.action-pill:hover { background: #18191b; }

.tabs-row { margin-top: 4px; }
.tab { font-size: 16px; }
.tab.active { font-weight: 800; }
.dots { margin-left: auto; }

.token-item { box-shadow: 0 0 0 1px #1f2021 inset; }
.ti-right .fiat { font-size: 16px; }
.ti-right .sub.red { font-weight: 600; }

.nav-bar { height: 58px; }
.nav-btn { width: 48px; height: 34px; border-radius: 10px; }
.nav-btn.active { background: #1b1c1e; }

/* Simple topbar for Send page */
.simple-topbar {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #222425;
}
.back-btn {
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 20px;
  cursor: pointer;
}
.center-title {
  text-align: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.2px;
  color: #ffffff;
}

/* Send page shell */
.send-shell { width: 380px; margin: 0 auto; padding-bottom: 60px; }

/* Search bar */
.search-box {
  margin: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1b1c1e;
  border: 1px solid #2a2b2c;
  border-radius: 16px;
  padding: 12px 14px;
}
.search-icon { color: #9ca3af; font-size: 20px; }
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e5e7eb;
  font-size: 18px;
}
.search-input::placeholder { color: #9ca3af; }

/* Empty state */
.empty-state {
  text-align: center;
  color: #9ca3af;
  font-size: 18px;
  margin-top: 140px;
}

/* Receive page */
.receive-shell { width: 380px; margin: 0 auto; padding-bottom: 60px; }
.receive-card {
  margin: 16px;
  background: #141516;
  border: 1px solid #232425;
  border-radius: 16px;
  padding: 14px 14px 18px;
}
.token-head { display: flex; align-items: center; gap: 10px; padding: 4px 2px 10px; }
.token-head-name { font-weight: 800; font-size: 16px; color: #e5e7eb; }
.token-head .caret { color: #9ca3af; font-size: 16px; margin-left: 6px; }

.qr-wrap { position: relative; display: grid; place-items: center; background: #ffffff; border-radius: 18px; padding: 16px; margin: 10px 0; }
.qr-canvas { width: 280px; height: 280px; }
.qr-center { position: absolute; width: 42px; height: 42px; border-radius: 999px; background: #ffffff; display: grid; place-items: center; box-shadow: 0 0 0 1px #e5e7eb inset; }
.qr-center-icon { width: 26px; height: 26px; }

.recv-address { text-align: center; color: #cbd5e1; font-size: 13px; margin: 10px 8px 0; }
.address-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.addr-nav { color: #6b7280; font-size: 18px; }
.recv-type { text-align: center; color: #a1a7b3; font-size: 14px; font-weight: 700; letter-spacing: 0.2px; margin: 6px 0 0; }
.recv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 10px; }
.btn-ghost { background: transparent; border: 1px solid #2a2b2c; color: #e5e7eb; border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; }
.btn-primary { background: #6c63ff; color: #fff; border: none; border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; }
.btn-primary:active { transform: translateY(1px); }

.warning-box { display: flex; gap: 10px; align-items: flex-start; background: #151617; border: 1px solid #2a2b2c; color: #cbd5e1; border-radius: 12px; padding: 12px; }
.warn-icon { color: #9ca3af; }
.warn-text strong { color: #fff; }