/* ==========================================
   Xcannes Wallet PWA — Fintech dark theme
   Aligned with xcannes.com design system
   ========================================== */

/* ===== Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Montserrat:wght@300;400;500;600;700;800&family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Core backgrounds — dark greenish fintech tones (matches site) */
  --bg-primary: #0a0f0d;
  --bg-secondary: #0e1314;
  --bg-card: #111917;
  --bg-elevated: #0b0f10;
  --bg-subtle: #101827;

  /* Typography — crisp white hierarchy */
  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-tertiary: #9ca3af;

  /* Accent — green fintech (matches site xcannes-green) */
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-dim: rgba(22, 163, 74, 0.15);
  --accent-glow: rgba(22, 163, 74, 0.25);

  /* Secondary accent — blue */
  --accent-blue: #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.15);

  /* Status / trading */
  --success: #16a34a;
  --error: #f97373;
  --warning: #fbbf24;
  --price-up: #16a34a;
  --price-down: #dc2626;

  /* Borders — subtle slate */
  --border: rgba(148, 163, 184, 0.15);
  --border-light: rgba(255, 255, 255, 0.10);

  /* Radius — sharp fintech (6px uniform, matches site) */
  --radius: 0.375rem;
  --radius-lg: 0.375rem;
  --radius-xl: 0.75rem;

  /* Focus */
  --focus-ring: #fbbf24;

  /* Fonts */
  --font-orbitron: 'Orbitron', system-ui, sans-serif;
  --font-montserrat: 'Montserrat', system-ui, sans-serif;
  --font-manrope: 'Manrope', system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font-manrope);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-elevated);
}

/* ===== SCREENS ===== */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  background-image: radial-gradient(ellipse at top, rgba(255,255,255,0.02), transparent 60%);
}

.screen.hidden {
  display: none;
}

.screen-content {
  flex: 1;
  padding: 20px;
  padding-top: calc(env(safe-area-inset-top, 44px) + 12px);
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 12px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen-content.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ===== SCREEN HEADER ===== */

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  min-height: 32px;
}

.screen-header h2 {
  font-family: var(--font-montserrat);
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.btn-back {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-back:active {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(0.95);
}

.btn-back-light {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}

/* ===== SPLASH ===== */

.splash-title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  transform-style: preserve-3d;
}

.splash-title {
  font-family: var(--font-orbitron);
  font-size: clamp(48px, 14vw, 96px);
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(59, 130, 246, 0.5), 0 0 60px rgba(59, 130, 246, 0.3), 0 0 90px rgba(59, 130, 246, 0.2);
  letter-spacing: -0.02em;
  text-align: center;
  line-height: 1.1;
}

.splash-title .splash-char {
  display: inline-block;
}

.splash-subtitle {
  font-family: var(--font-montserrat);
  font-size: clamp(18px, 5vw, 32px);
  font-weight: 200;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.splash-subtitle.hidden {
  display: none;
}

.splash-subtitle.splash-anim-back {
  animation: splashTitleBack 350ms cubic-bezier(0.4, 0, 0.6, 1) forwards;
  transform-origin: center center;
  transform-style: preserve-3d;
}

.splash-subtitle.splash-anim-forward {
  animation: splashTitleForward 450ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: center center;
  transform-style: preserve-3d;
}

@keyframes splashTitleBack {
  0% {
    transform: scale(1) translateZ(0) rotateX(0deg);
    opacity: 1;
    filter: blur(0px) brightness(1);
  }
  100% {
    transform: scale(0.5) translateZ(-400px) rotateX(-5deg);
    opacity: 0.6;
    filter: blur(2px) brightness(0.7);
  }
}

@keyframes splashTitleForward {
  0% {
    transform: scale(0.5) translateZ(-400px) rotateX(-5deg);
    opacity: 0.6;
    filter: blur(2px) brightness(0.7);
  }
  50% {
    transform: scale(1.08) translateZ(20px) rotateX(2deg);
    opacity: 1;
    filter: blur(0px) brightness(1.15);
  }
  100% {
    transform: scale(1) translateZ(0) rotateX(0deg);
    opacity: 1;
    filter: blur(0px) brightness(1);
  }
}

@keyframes splashFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== LOGO ===== */

.logo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-orbitron);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.logo-sm {
  width: 56px;
  height: 56px;
  font-size: 22px;
  margin-bottom: 16px;
}

.logo-xs {
  width: 32px;
  height: 32px;
  font-size: 13px;
  margin-bottom: 0;
}

/* ===== TYPOGRAPHY ===== */

h1 {
  font-family: var(--font-montserrat);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

h2 {
  font-family: var(--font-montserrat);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

h3 {
  font-family: var(--font-montserrat);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.hint-text {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
  opacity: 0.7;
}

.notice {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 28px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.warning {
  color: var(--warning);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius);
}

.error-text {
  color: var(--error);
  font-size: 14px;
  line-height: 1.5;
  padding: 0 20px;
}

/* ===== BIOMETRIC SETUP REQUIRED ===== */

.setup-instructions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 20px;
}

.setup-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.setup-item strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 4px;
}

.setup-item p {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.setup-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
  padding-top: 2px;
}

/* ===== RESET / DANGER LINK ===== */

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 10px;
  margin-top: 24px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-danger-link {
  color: var(--text-tertiary);
  opacity: 0.6;
  transition: color 0.2s, opacity 0.2s;
}

.btn-danger-link:hover,
.btn-danger-link:active {
  color: var(--error);
  opacity: 1;
}

/* ===== PIN DOTS ===== */

.pin-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 28px 0 20px;
  cursor: pointer;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--text-tertiary);
  background: transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.15);
}

.pin-hidden-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.pin-dots.shake {
  animation: shake 0.5s ease-in-out;
}

.pin-dots.shake .pin-dot.filled {
  background: var(--error);
  border-color: var(--error);
}

/* ===== FEATURE LIST (welcome) ===== */

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  width: 100%;
  max-width: 300px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.feature-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.feature-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */

.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-manrope);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 18px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 13px;
}

.btn-biometric {
  font-size: 15px;
  padding: 16px 32px;
  border-radius: var(--radius);
  max-width: 280px;
}

.biometric-icon {
  font-size: 20px;
}

.btn-icon-round {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.btn-icon-round:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-icon-round:active {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(0.95);
}

.btn-scan {
  padding: 16px 24px;
  font-size: 15px;
  border-radius: var(--radius);
}

.scan-icon {
  font-size: 20px;
}

/* ===== TERMS ===== */

.terms-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.terms-scroll {
  padding: 20px;
  max-height: 45vh;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-tertiary);
}

.terms-scroll h3 {
  color: var(--text-primary);
  margin-bottom: 12px;
  font-family: var(--font-montserrat);
}

.terms-scroll ul {
  padding-left: 16px;
  margin: 12px 0;
}

.terms-scroll li {
  margin-bottom: 10px;
}

.terms-scroll strong {
  color: var(--text-secondary);
}

.terms-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ===== INPUTS ===== */

.input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'SF Mono', 'Menlo', 'Courier New', monospace;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: none;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15);
}

input.error,
textarea.error {
  border-color: var(--error);
  animation: shake 0.3s ease;
}

/* ===== MNEMONIC GRID (backup) ===== */

.mnemonic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 20px;
}

.mnemonic-word {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.mnemonic-word:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.mnemonic-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  min-width: 18px;
  text-align: center;
  font-family: var(--font-manrope);
}

.mnemonic-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Menlo', monospace;
}

/* ===== VERIFY FIELDS (sequential 1–12) ===== */

.verify-intro {
  color: var(--text-tertiary);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.verify-progress {
  margin-bottom: 20px;
}

#verify-progress-text {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.verify-progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.verify-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
  box-shadow: 0 0 8px var(--accent-glow);
}

.verify-sequential {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
  max-height: 420px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.verify-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}

.verify-row.locked {
  opacity: 0.3;
  pointer-events: none;
}

.verify-row.active {
  opacity: 1;
}

.verify-row.done {
  opacity: 0.6;
}

.verify-row .row-num {
  min-width: 26px;
  height: 26px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.verify-row.done .row-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.verify-row.error .row-num {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.verify-row .row-input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'SF Mono', 'Menlo', monospace;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.verify-row.active .row-input {
  border-color: var(--accent);
  background: rgba(22, 163, 74, 0.04);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.1);
}

.verify-row.done .row-input {
  border-color: rgba(22, 163, 74, 0.3);
  color: var(--success);
  background: transparent;
}

.verify-row.error .row-input {
  border-color: var(--error);
}

.verify-row .row-status {
  min-width: 24px;
  text-align: center;
  font-size: 16px;
}

.verify-row .row-error-msg {
  display: none;
  font-size: 12px;
  color: var(--error);
  margin-top: 2px;
  padding-left: 40px;
}

.verify-row.error .row-error-msg {
  display: block;
}

/* ===== TABS (import) ===== */

.tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 9px 8px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-manrope);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.tab-panel {
  display: none;
}

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

.tab-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ===== SECRET NUMBERS GRID (import Xaman) ===== */

.secret-numbers-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.sn-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sn-row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-family: var(--font-manrope);
}

.sn-row input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 16px;
  font-family: 'SF Mono', 'Menlo', monospace;
  letter-spacing: 4px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sn-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15);
}

/* ===== HOME SCREEN ===== */

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-title {
  font-family: var(--font-orbitron);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.wallet-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.wallet-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.wallet-label {
  font-family: var(--font-manrope);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.wallet-badge-active {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.2);
}

.wallet-address {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  word-break: break-all;
}

.wallet-balance {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.balance-amount {
  font-family: var(--font-montserrat);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.balance-currency {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.home-actions {
  text-align: center;
  margin-bottom: 24px;
}

.home-actions .button-group {
  max-width: 100%;
}

.home-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 12px;
  line-height: 1.5;
  opacity: 0.7;
}

.activation-notice {
  padding: 14px;
  background: rgba(251, 191, 36, 0.04);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.activation-notice strong {
  color: var(--warning);
}

/* ===== INFO BOX ===== */

.info-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.info-label {
  font-family: var(--font-manrope);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-box code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-all;
  display: block;
}

/* ===== STATUS ===== */

.status {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 12px;
  min-height: 20px;
  transition: color 0.2s;
}

.status.error {
  color: var(--error);
}

.address-preview {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.address-chip {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 10px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-tertiary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== SCANNER ===== */

.scanner-layout {
  display: flex;
  flex-direction: column;
  padding: 0;
  padding-top: env(safe-area-inset-top, 12px);
  background: var(--bg-primary);
}

.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 8px;
}

.scanner-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

.scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-frame {
  width: 220px;
  height: 220px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65), 0 0 30px rgba(22, 163, 74, 0.15);
}

.scanner-bottom-status {
  padding: 14px 20px;
  text-align: center;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.tx-details {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  color: var(--accent);
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  border-top: 1px solid var(--border);
}

.tx-details.hidden {
  display: none;
}

/* ===== ICONS ===== */

.icon-large {
  font-size: 52px;
  margin-bottom: 16px;
}

.success-icon {
  animation: pop 0.3s ease;
}

/* ===== SPINNER ===== */

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 16px;
}

.spinner.hidden {
  display: none;
}

/* ===== UTILITY ===== */

.hidden {
  display: none !important;
}

/* ===== ANIMATIONS ===== */

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes pop {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== SAFE AREAS (iPhone notch / Dynamic Island) ===== */

@supports (padding: env(safe-area-inset-bottom)) {
  .screen-content {
    padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
  }
  .scanner-bottom-status {
    padding-bottom: calc(env(safe-area-inset-bottom) + 14px);
  }
}

/* ===== SCROLLBAR ===== */

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.25);
}

/* ===== REDUCED MOTION ===== */

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

/* ===== IMPORT MNEMONIC GRID ===== */

.import-word-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.word-toggle-btn {
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.word-toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.import-mnemonic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.import-word-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  padding: 6px 8px;
  transition: border-color 0.2s;
}

.import-word-cell:focus-within {
  border-color: var(--accent);
}

.import-word-num {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  min-width: 16px;
  text-align: center;
  font-weight: 600;
  opacity: 0.6;
}

.import-word-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  padding: 2px 0;
}

.import-word-input::placeholder {
  color: rgba(148, 163, 184, 0.3);
  font-size: 0.75rem;
}

@media (max-width: 380px) {
  .import-mnemonic-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== WALLET LIST (Multi-wallet) ===== */

.wallet-list {
  margin-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 16px;
}

.wallet-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.08);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.wallet-list-item:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(148, 163, 184, 0.18);
}

.wallet-list-item.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  cursor: default;
}

.wl-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wl-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.wl-address {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  letter-spacing: 0.02em;
}

.wl-active-badge {
  color: var(--accent);
  font-size: 0.6rem;
  margin-left: 12px;
  flex-shrink: 0;
}

/* Add wallet button */

.btn-add-wallet {
  margin-top: 16px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  font-size: 0.9rem;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-add-wallet:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.add-icon {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-tertiary);
}

/* ==========================================
   WALLET EMBEDDED SCREEN (iframe dashboard)
   ========================================== */

.embedded-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100svh;
  height: 100vh;
  background: #0b0f10;
}

.wallet-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #0b0f10;
}
