:root {
  --bg-deep: #04040a;
  --bg-primary: #080810;
  --bg-secondary: #10101c;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-solid: #14141f;
  --bg-input: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent: #ff6b2c;
  --accent-hover: #ff8552;
  --accent-glow: rgba(255, 107, 44, 0.45);
  --accent-dim: rgba(255, 107, 44, 0.12);
  --gold: #c9a962;
  --gold-dim: rgba(201, 169, 98, 0.15);
  --text-primary: #f4f4f8;
  --text-secondary: #9898b0;
  --text-muted: #5c5c72;
  --border: rgba(255, 255, 255, 0.08);
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(255, 107, 44, 0.15);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'D2Coding', ui-monospace, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font);
  font-feature-settings: 'ss01' on, 'case' on;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-deep);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  max-width: 480px;
  margin: 0 auto;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 107, 44, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(120, 80, 200, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(201, 169, 98, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#app {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Screens ── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 20px 32px;
  animation: screenIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.active {
  display: flex;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Welcome / Home ── */
.screen-welcome {
  padding: 0;
  position: relative;
  overflow: hidden;
}

.welcome-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.welcome-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: orbFloat 8s ease-in-out infinite;
}

.welcome-bg .orb-1 {
  width: 280px;
  height: 280px;
  background: rgba(255, 107, 44, 0.25);
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
}

.welcome-bg .orb-2 {
  width: 200px;
  height: 200px;
  background: rgba(140, 90, 220, 0.18);
  bottom: 20%;
  right: -60px;
  animation-delay: -3s;
}

.welcome-bg .orb-3 {
  width: 160px;
  height: 160px;
  background: rgba(201, 169, 98, 0.15);
  bottom: 10%;
  left: -40px;
  animation-delay: -5s;
}

.welcome-bg .grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10px, -15px) scale(1.05); }
}

.welcome-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 48px 24px 32px;
}

.brand-block {
  text-align: center;
  padding: 32px 0 28px;
}

.logo-ring {
  position: relative;
  display: inline-flex;
  margin-bottom: 24px;
}

.logo-ring::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--accent), var(--gold), var(--accent));
  opacity: 0.35;
  animation: ringSpin 6s linear infinite;
  filter: blur(8px);
}

.logo-ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 44, 0.3);
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

.logo {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  background: linear-gradient(145deg, #1a1020, #0d0d14);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.logo svg {
  width: 52px;
  height: 52px;
}

.logo.small {
  width: 64px;
  height: 64px;
  margin-bottom: 0;
}

.logo.small svg {
  width: 38px;
  height: 38px;
}

.brand-tag {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 14px;
  text-transform: uppercase;
}

h1 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #fff 20%, rgba(255, 255, 255, 0.78));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 450;
  line-height: 1.75;
  letter-spacing: -0.005em;
}

.subtitle .highlight {
  color: var(--accent);
  font-weight: 600;
}

.feature-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.feature-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
}

.feature-chip span:first-child {
  font-size: 14px;
}

.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero.compact {
  padding: 24px 0 20px;
}

.hero.compact .logo-ring {
  margin-bottom: 16px;
}

.hero.compact .logo-ring::before {
  inset: -8px;
}

.hero.compact .logo-ring::after {
  inset: -3px;
}

/* ── Status bar ── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-bar.online .status-dot {
  background: var(--success);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.status-bar.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

/* ── Buttons ── */
.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 17px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.btn-full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #e85a20 100%);
  color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-glass {
  background: var(--glass);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 107, 44, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 12px;
  margin-top: 4px;
}

.btn-text:hover { color: var(--text-primary); }

.btn-back {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  line-height: 1;
  transition: all 0.2s;
}

.btn-back:hover {
  background: var(--accent-dim);
  border-color: rgba(255, 107, 44, 0.3);
}

.btn-icon {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 17px;
  transition: all 0.2s;
}

.btn-icon:hover {
  border-color: rgba(255, 107, 44, 0.4);
  color: var(--accent);
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 20px;
  line-height: 1.6;
}

/* ── Headers & forms ── */
.screen-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.saved-wallet-card {
  background: linear-gradient(135deg, rgba(255, 107, 44, 0.08) 0%, var(--glass) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 107, 44, 0.2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.saved-wallet-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--gold);
}

.saved-wallet-address {
  font-size: 15px;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.65;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.saved-wallet-label {
  font-size: 14px;
  margin-top: 6px;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 22px;
  min-width: 0;
}

.unlock-rpc-hint {
  background: rgba(255, 107, 44, 0.1);
  border: 1px solid rgba(255, 107, 44, 0.3);
  color: var(--accent);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.unlock-rpc-hint.hidden { display: none; }

.form-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.form-card label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

input, textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  padding: 15px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

input:focus, textarea:focus {
  border-color: rgba(255, 107, 44, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.12);
}

input.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── Send ── */
.send-balance-box {
  background: linear-gradient(135deg, rgba(255, 107, 44, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
  border: 1px solid rgba(255, 107, 44, 0.2);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.send-balance-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.send-balance {
  font-family: var(--font);
  font-size: clamp(20px, 6vw, 36px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffb088;
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.send-balance-sub {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.4;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.amount-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.amount-row input { flex: 1; min-width: 0; }

.btn-max {
  flex-shrink: 0;
  padding: 0 18px;
  background: var(--accent-dim);
  border: 1px solid rgba(255, 107, 44, 0.4);
  border-radius: var(--radius-xs);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-max:hover {
  background: rgba(255, 107, 44, 0.2);
}

.send-amount-error {
  font-size: 12px;
  color: var(--danger);
  margin: -4px 0 0;
}

.send-amount-error.hidden { display: none; }

/* ── Seed ── */
.warning-box {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.55;
}

.warning-box strong {
  color: var(--warning);
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.seed-word {
  background: var(--glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 13px 14px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  transition: border-color 0.2s;
}

.seed-word:hover {
  border-color: rgba(255, 107, 44, 0.25);
}

.seed-word .num {
  color: var(--gold);
  font-weight: 700;
  min-width: 22px;
  font-size: 12px;
}

/* ── Dashboard ── */
.dashboard-header {
  margin-bottom: 4px;
}

.dash-header {
  background: linear-gradient(145deg, rgba(255, 107, 44, 0.06) 0%, var(--glass) 100%);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 20px;
  margin: -4px -4px 20px;
  border: 1px solid var(--glass-border);
}

.dash-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.coin-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.cake-sync-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 22px;
  margin: 14px 0 4px;
  min-height: 44px;
}

.cake-sync-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.cake-sync-bar.syncing .cake-sync-text { color: var(--warning); }
.cake-sync-bar.synced .cake-sync-text { color: var(--success); }

.cake-sync-bar.synced {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.06);
}

.cake-sync-bar.error .cake-sync-text {
  color: var(--danger);
  text-transform: none;
  font-size: 12px;
  letter-spacing: 0;
}

.cake-sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}

.cake-sync-dot.syncing {
  background: var(--warning);
  animation: cake-sync-pulse 1.4s ease-in-out infinite;
}

.cake-sync-dot.synced {
  background: var(--success);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.cake-sync-dot.error { background: var(--danger); }

@keyframes cake-sync-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.cake-sync-sub {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 6px 0 12px;
  min-height: 16px;
}

.balance-panel {
  background: linear-gradient(160deg, rgba(255, 107, 44, 0.12) 0%, var(--glass) 40%, rgba(201, 169, 98, 0.06) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 107, 44, 0.18);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin-bottom: 20px;
  text-align: center;
  transition: opacity 0.3s ease;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.balance-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.balance-panel.scanning {
  opacity: 0.5;
}

.balance-panel.scanning .balance {
  font-size: 32px;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.balance-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.balance {
  font-family: var(--font);
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.12);
  word-break: break-all;
}

.balance-sub {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.balance-usd {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  letter-spacing: -0.01em;
  margin: 4px 0 10px;
  min-height: 28px;
}

.balance-panel.scanning .balance-usd {
  display: none;
}

.pending-tx-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--warning);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.pending-tx-banner.hidden { display: none !important; }

.balance-panel.scanning .pending-tx-banner:not(.hidden) {
  display: flex;
}

.pending-tx-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pending-tx-banner-text strong {
  font-size: 13px;
  font-weight: 700;
}

.pending-tx-banner-text span {
  font-size: 12px;
  opacity: 0.9;
}

.tx-conf-num {
  min-width: 40px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--warning, #ffc107);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* History must never show confirmation rings */
#history-list .tx-conf-ring {
  display: none !important;
}

.wallet-info-box {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 0 0 18px;
}

.info-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dash-address {
  font-size: 15px;
  word-break: break-all;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.wallet-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.dash-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.dash-actions.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px 8px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.action-btn:hover {
  border-color: rgba(255, 107, 44, 0.4);
  background: rgba(255, 107, 44, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.action-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-dim) 0%, rgba(201, 169, 98, 0.1) 100%);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid rgba(255, 107, 44, 0.2);
  transition: all 0.25s;
}

.action-btn:hover .action-icon {
  box-shadow: 0 0 20px var(--accent-glow);
  transform: scale(1.05);
}

.tx-section.hidden-until-sync {
  opacity: 0.35;
  pointer-events: none;
}

.tx-section h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tx-list.full { flex: 1; }

.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  transition: border-color 0.2s;
}

.tx-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.tx-leading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.tx-meta {
  min-width: 0;
}

.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  border: 2px solid transparent;
}

.tx-icon.in {
  color: var(--success);
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.35);
}

.tx-icon.out {
  color: var(--accent);
  background: rgba(255, 107, 44, 0.12);
  border-color: rgba(255, 107, 44, 0.35);
}

/* Cake-style confirmation progress circle */
.tx-conf-ring {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.tx-conf-svg {
  width: 36px;
  height: 36px;
  transform: rotate(-90deg);
  display: block;
}

.tx-conf-track,
.tx-conf-progress {
  fill: none;
  stroke-width: 3.2;
}

.tx-conf-track {
  stroke: rgba(255, 193, 7, 0.22);
}

.tx-conf-progress {
  stroke: var(--warning, #ffc107);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease;
}

.tx-conf-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--warning, #ffc107);
  line-height: 1;
}

.tx-item .tx-type {
  font-size: 13px;
  font-weight: 600;
}

.tx-item .tx-type.in { color: var(--success); }
.tx-item .tx-type.out { color: var(--accent); }
.tx-item .tx-type.pending { color: var(--warning); }

.tx-item .tx-amount {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  flex-shrink: 0;
}

.tx-item .tx-amount.in {
  color: var(--success);
}

.tx-item .tx-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 20px;
}

/* ── Receive ── */
.receive-card {
  text-align: center;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 22px;
}

.qr-placeholder {
  width: 220px;
  height: 220px;
  background: #fff;
  border-radius: var(--radius-sm);
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.qr-placeholder canvas,
.qr-placeholder img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.address-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.address-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 18px;
  font-size: 15px;
  word-break: break-all;
  line-height: 1.75;
  margin-bottom: 18px;
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

#receive-address {
  font-size: 16px;
  line-height: 1.8;
}

/* ── Settings ── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-item {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.settings-item span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.settings-item code {
  font-size: 14px;
  word-break: break-all;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.65;
}

.recovery-hint {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

#recovery-auth.hidden,
#recovery-seed.hidden,
#btn-create-confirm.hidden,
#btn-restore-pin-continue.hidden {
  display: none !important;
}

.truncate { display: block; }

/* ── Toast & loading ── */
.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card-solid);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: var(--shadow), var(--shadow-glow);
  transition: opacity 0.25s, transform 0.25s;
  max-width: calc(100% - 40px);
  text-align: center;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

.loading {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(4, 4, 10, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
}

.loading.hidden { display: none; }

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.loading p {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-align: center;
  width: 100%;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Legacy scan (unused but kept) ── */
.scan-panel,
.scan-stats,
.sync-bar,
.sync-status,
.wallet-created,
.sync-detail { display: none; }

@media (max-width: 360px) {
  .seed-grid { grid-template-columns: 1fr; }
  .balance { font-size: 38px; }
  .address-box, .dash-address, .saved-wallet-address { font-size: 14px; }
  #receive-address { font-size: 15px; }
  h1 { font-size: 30px; }
  .feature-row { gap: 6px; }
  .feature-chip { font-size: 11px; padding: 7px 12px; }
}

/* ── PIN keypad ── */
.pin-pad-host {
  margin: 8px 0 20px;
}

.pin-pad {
  user-select: none;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
  min-height: 18px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  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.05);
}

.pin-keys {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.pin-key-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-key {
  aspect-ratio: 1.35;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.pin-key:hover {
  background: rgba(255, 107, 44, 0.12);
  border-color: rgba(255, 107, 44, 0.35);
}

.pin-key:active {
  transform: scale(0.94);
  background: rgba(255, 107, 44, 0.2);
}

.pin-key-action {
  font-size: 22px;
  color: var(--text-secondary);
}

.pin-key-clear {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pin-pad.pin-shake {
  animation: pinShake 0.45s ease;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.pin-pad-modal .pin-keys {
  max-width: 260px;
}

.pin-pad-modal .pin-key {
  aspect-ratio: 1.25;
  font-size: 24px;
}

/* ── PIN modal ── */
.pin-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pin-modal.hidden {
  display: none !important;
}

#send-confirm-modal:not(.hidden) {
  display: flex !important;
}

.pin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 10, 0.82);
  backdrop-filter: blur(6px);
}

.pin-modal-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px 24px 20px;
  box-shadow: var(--shadow);
}

.pin-modal-card h3 {
  margin: 0 0 8px;
  font-family: Fraunces, serif;
  font-size: 22px;
  text-align: center;
}

.pin-modal-card p {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.pin-modal-card .pin-pad-host {
  margin-bottom: 12px;
}

.send-confirm-card .send-confirm-label {
  margin: 12px 0 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: left;
}

.send-confirm-amount {
  margin: 0 !important;
  font-family: Fraunces, serif;
  font-size: 28px !important;
  font-weight: 600;
  color: var(--text-primary) !important;
  text-align: left !important;
  word-break: break-all;
}

.send-confirm-address {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  color: var(--text-primary) !important;
  text-align: left !important;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.send-confirm-note {
  margin: 16px 0 0 !important;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  text-align: left !important;
}

.send-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
