/* ================================================================
   USDEH WALLET — Clean Modern Design
   Inspired by Phantom / Backpack / Rabby
   ================================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Surfaces */
  --bg: #0b0c12;
  --bg-1: #11131c;
  --bg-2: #181a25;
  --bg-3: #1f2230;
  --bg-4: #272b3b;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);

  /* Borders */
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.10);
  --line-3: rgba(255, 255, 255, 0.16);

  /* Text */
  --t-0: #ffffff;
  --t-1: #d4d6e0;
  --t-2: #8e92a4;
  --t-3: #5b5f72;
  --t-4: #383b4a;

  /* Accent — soft violet gradient */
  --c-1: #ab9ff2;
  --c-2: #7c5cff;
  --c-grad: linear-gradient(135deg, #ab9ff2 0%, #7c5cff 100%);

  /* Status */
  --green: #10c87b;
  --red: #ff4060;
  --orange: #ff9d3b;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
}

::selection { background: var(--c-2); color: white; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--t-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'zero', 'cv01'; }
h1, h2, h3, h4 { font-family: 'Inter', sans-serif; letter-spacing: -0.02em; font-weight: 600; }

/* ============ AMBIENT BACKGROUND (fixed, won't drift on scroll) ============ */
.bg-stack {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
}
.g1 { width: 600px; height: 600px; background: radial-gradient(circle, var(--c-1) 0%, transparent 60%); opacity: 0.10; top: -200px; left: -200px; }
.g2 { width: 500px; height: 500px; background: radial-gradient(circle, var(--c-2) 0%, transparent 60%); opacity: 0.08; bottom: -150px; right: -150px; }
/* hide other ambient layers from old design */
.grid-bg, .scanlines, .noise { display: none; }

/* ============ APP SHELL ============ */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar { display: none; }

/* ============ TOP BAR (mobile/tablet) ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: rgba(11, 12, 18, 0.8);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  max-width: 480px; margin: 0 auto;
}
@media (min-width: 768px) {
  .topbar-inner { max-width: 720px; padding: 16px 32px; }
}
@media (min-width: 1024px) and (max-width: 1199.98px) {
  .topbar-inner { max-width: 960px; padding: 16px 36px; }
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 16px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 32px; height: 32px;
  background: var(--c-grad);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.3);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 600; font-size: 15px; }
.brand-tag { display: none; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.network-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  color: var(--t-0);
  transition: all 0.15s;
}
.network-pill:hover { background: var(--bg-card-hover); border-color: var(--line-2); }
.network-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.network-pill svg { color: var(--t-2); }

.icon-btn {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--t-1);
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg-card-hover); border-color: var(--line-2); color: var(--t-0); }
.icon-btn svg { width: 16px; height: 16px; }

/* ============ MAIN ============ */
.main {
  flex: 1; max-width: 480px; width: 100%;
  margin: 0 auto;
  padding: 20px 20px 100px;
}
@media (min-width: 768px) { .main { max-width: 720px; padding: 28px 32px 120px; } }
@media (min-width: 1024px) and (max-width: 1199.98px) {
  .main { max-width: 960px; padding: 32px 36px 110px; }
}

/* ============ BOTTOM NAV ============ */
.botnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 60;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: rgba(11, 12, 18, 0.9);
  border-top: 1px solid var(--line);
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
}
.botnav-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 480px;
  margin: 0 auto;
  gap: 4px;
}

.botnav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 11px; font-weight: 500;
  color: var(--t-3);
  cursor: pointer;
  border-radius: var(--r-md);
  transition: all 0.15s;
}
.botnav-btn svg { width: 22px; height: 22px; }
.botnav-btn:hover { color: var(--t-1); }
.botnav-btn.active { color: var(--c-1); }

/* ============ DESKTOP LAYOUT ============ */
@media (min-width: 1200px) {
  .shell {
    display: grid; 
    grid-template-columns: 280px 1fr;
    max-width: 1280px;
    margin: 0 auto;
  }
  .topbar, .botnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column;
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.01);
    position: sticky; top: 0;
    height: 100vh;
    overflow-y: auto;
    gap: 24px;
  }

  .sb-section { display: flex; flex-direction: column; gap: 8px; }
  .sb-label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--t-3); padding: 0 4px;
  }

  .sb-account {
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .sb-account:hover { background: var(--bg-card-hover); border-color: var(--line-2); }
  .sb-account .avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--c-grad); flex-shrink: 0; box-shadow: 0 4px 12px rgba(124, 92, 255, 0.25); }
  .sb-account .info { flex: 1; min-width: 0; }
  .sb-account .info .name { font-size: 11px; color: var(--t-3); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
  .sb-account .info .addr { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--t-0); }

  .sb-network {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.15s;
  }
  .sb-network:hover { background: var(--bg-card-hover); border-color: var(--line-2); }
  .sb-network .ico { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; flex-shrink: 0; }
  .sb-network .name { font-size: 13px; font-weight: 500; flex: 1; color: var(--t-0); }
  .sb-network .arrow { color: var(--t-3); }

  .sb-nav { display: flex; flex-direction: column; gap: 2px; }
  .sb-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--t-2);
    font-size: 14px; font-weight: 500;
    transition: all 0.15s;
    background: transparent;
    border: none;
    border-radius: var(--r-md);
    font-family: inherit;
    text-align: left;
    width: 100%;
  }
  .sb-nav-item:hover { background: var(--bg-card); color: var(--t-0); }
  .sb-nav-item.active { background: rgba(171, 159, 242, 0.10); color: var(--c-1); }
  .sb-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

  .sb-spacer { flex: 1; }
  .sb-lock {
    display: flex; align-items: center; gap: 10px; justify-content: center;
    padding: 11px 14px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    cursor: pointer;
    color: var(--t-2);
    font-size: 13px; font-weight: 500;
    font-family: inherit;
    transition: all 0.15s;
  }
  .sb-lock:hover { background: rgba(255, 64, 96, 0.08); border-color: rgba(255, 64, 96, 0.25); color: var(--red); }

  .main { max-width: 800px; padding: 36px 40px 60px; }

  /* Pre-auth screens (welcome/unlock/seed/...) hide the sidebar via JS.
     Flatten the grid so the form doesn't fall into the empty 280px column. */
  body.shell-flat .shell {
    display: flex;
    flex-direction: column;
    max-width: none;
  }
  body.shell-flat .main { max-width: 480px; padding: 56px 24px 80px; }
}

/* ============ SCREENS ============ */
.screen { display: none; }
.screen.active { display: block; animation: screenIn 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ WELCOME / UNLOCK ============ */
.welcome-hero { text-align: center; padding: 36px 0 24px; }
.welcome-coin {
  width: 88px; height: 88px;
  background: var(--c-grad);
  margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 38px; color: white;
  border-radius: 50%;
  box-shadow: 0 12px 40px rgba(124, 92, 255, 0.4);
  animation: coinFloat 6s ease-in-out infinite;
}
@keyframes coinFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.tagline { display: none; }

.welcome-hero h1 {
  font-size: 28px;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.welcome-hero p { color: var(--t-2); font-size: 15px; max-width: 360px; margin: 0 auto; }

@media (min-width: 768px) {
  .welcome-coin { width: 104px; height: 104px; font-size: 46px; }
  .welcome-hero h1 { font-size: 34px; }
}

.welcome-warn {
  margin: 22px 0 28px;
  padding: 14px 16px;
  background: rgba(255, 157, 59, 0.06);
  border: 1px solid rgba(255, 157, 59, 0.2);
  border-radius: var(--r-md);
  font-size: 13px; color: #ffb56e;
  display: flex; gap: 10px; align-items: flex-start;
}
.welcome-warn svg { flex-shrink: 0; margin-top: 2px; color: var(--orange); }
.welcome-warn b { color: var(--orange); display: block; margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.welcome-actions { display: flex; flex-direction: column; gap: 10px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: inherit;
  transition: all 0.15s;
  width: 100%;
}
.btn-primary {
  background: var(--c-grad);
  color: white;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124, 92, 255, 0.35); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: var(--bg-card);
  color: var(--t-0);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg-card-hover); border-color: var(--line-2); }
.btn-danger { background: rgba(255, 64, 96, 0.08); color: var(--red); border: 1px solid rgba(255, 64, 96, 0.25); }
.btn-danger:hover { background: rgba(255, 64, 96, 0.14); }
.btn-sm { padding: 9px 14px; font-size: 13px; width: auto; }

/* ============ FIELDS ============ */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; color: var(--t-2);
  margin-bottom: 8px; font-weight: 500;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--t-0);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--c-1);
  background: var(--bg-card-hover);
}
.field input.mono, .field textarea.mono { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.field textarea { resize: vertical; min-height: 80px; }
/* <option> elements use OS-native styling — force dark fill so text isn't white-on-white in dropdowns */
.field select option, .field select optgroup {
  background: var(--bg-2);
  color: var(--t-0);
}
.field-hint { font-size: 12px; color: var(--t-3); margin-top: 6px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 6px; }

/* ============ SEED PHRASE ============ */
.seed-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
}
@media (min-width: 480px) { .seed-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .seed-grid { grid-template-columns: repeat(4, 1fr); padding: 20px; } }

.seed-word {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.seed-word .num { color: var(--t-3); font-size: 11px; min-width: 18px; }

.seed-actions { display: flex; gap: 10px; margin-bottom: 16px; }

.danger-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: rgba(255, 64, 96, 0.06);
  border: 1px solid rgba(255, 64, 96, 0.2);
  border-radius: var(--r-md);
  font-size: 13px; color: #ff8a99;
  display: flex; gap: 10px; align-items: flex-start;
}
.danger-banner svg { flex-shrink: 0; margin-top: 2px; color: var(--red); }
.danger-banner b { color: var(--red); display: block; margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ============ DASHBOARD: PORTFOLIO ============ */
.portfolio-hero {
  position: relative;
  padding: 28px 24px 22px;
  background:
    linear-gradient(135deg, rgba(171, 159, 242, 0.08) 0%, transparent 50%),
    linear-gradient(225deg, rgba(124, 92, 255, 0.06) 0%, transparent 60%),
    var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  margin-bottom: 16px;
  overflow: hidden;
}

.ph-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ph-label {
  font-size: 12px; color: var(--t-2);
  font-weight: 500;
}
.ph-net {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px; color: var(--t-1);
  font-family: 'JetBrains Mono', monospace;
}
.ph-net .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.ph-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: clamp(36px, 7vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--t-0);
  display: flex; align-items: baseline; gap: 6px;
}
.ph-value .currency { font-size: 0.42em; color: var(--t-3); font-weight: 400; }
.ph-change {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
}
.ph-change.up { color: var(--green); }
.ph-change.dn { color: var(--red); }
.ph-change svg { width: 12px; height: 12px; }

.ph-addr {
  margin-top: 16px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
}
.ph-addr:hover { background: rgba(0, 0, 0, 0.3); border-color: var(--line-2); }
.ph-addr .lbl { font-size: 11px; color: var(--t-3); font-weight: 500; }
.ph-addr .val { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--t-0); }
.ph-addr svg { color: var(--t-3); transition: color 0.15s; }
.ph-addr:hover svg { color: var(--c-1); }

/* ============ ACTION ROW ============ */
.action-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 24px;
}
@media (min-width: 480px) { .action-row { grid-template-columns: repeat(4, 1fr); } }

.action-btn {
  position: relative;
  padding: 16px 8px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--t-1);
  transition: all 0.15s;
  font-family: inherit;
}
.action-btn:hover {
  border-color: var(--line-2);
  background: var(--bg-card-hover);
  color: var(--t-0);
  transform: translateY(-1px);
}
.action-btn .ico {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(171, 159, 242, 0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-1);
  transition: all 0.15s;
}
.action-btn:hover .ico { background: rgba(171, 159, 242, 0.18); }
.action-btn .ico svg { width: 18px; height: 18px; }

/* ============ SECTION HEADERS ============ */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}
.section-head h3 {
  font-size: 15px; font-weight: 600;
  color: var(--t-0);
  letter-spacing: -0.01em;
}
.section-head .actions { display: flex; gap: 14px; }
.section-head button {
  background: none; border: none; color: var(--t-2); cursor: pointer;
  font-size: 13px; padding: 0; font-weight: 500;
  font-family: inherit;
  transition: color 0.15s;
}
.section-head button:hover { color: var(--c-1); }

/* Currency selector pills (token detail chart) */
.ccy-pills {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.ccy-pill {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--t-2);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  line-height: 1;
}
.ccy-pill:hover { background: var(--bg-card-hover); color: var(--t-0); border-color: var(--line-2); }
.ccy-pill.active {
  background: rgba(171, 159, 242, 0.12);
  border-color: rgba(171, 159, 242, 0.4);
  color: var(--c-1);
}
@media (max-width: 480px) {
  .section-head { flex-wrap: wrap; gap: 8px; }
  .ccy-pill { padding: 5px 8px; font-size: 10px; }
}

/* ============ TOKEN ROWS ============ */
.tokens-list { display: flex; flex-direction: column; gap: 6px; }
.token-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
}
.token-row:hover { background: var(--bg-card-hover); border-color: var(--line-2); }
.token-row.featured {
  background: linear-gradient(135deg, rgba(171, 159, 242, 0.08), rgba(124, 92, 255, 0.04));
  border-color: rgba(171, 159, 242, 0.25);
}
.token-row.featured:hover { border-color: rgba(171, 159, 242, 0.4); }

.token-logo {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}
.token-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.token-logo.fallback {
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  color: var(--t-1);
}
.token-logo.native {
  background: var(--c-grad);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
}

.token-info { flex: 1; min-width: 0; }
.token-symbol-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.token-symbol { font-weight: 600; font-size: 15px; color: var(--t-0); }
.token-tag {
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.token-tag.featured { background: var(--c-2); color: white; }
.token-tag.native { background: rgba(255,255,255,0.06); color: var(--t-2); }
.token-tag.custom { background: rgba(16, 200, 123, 0.12); color: var(--green); }

.token-name { font-size: 12px; color: var(--t-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.token-price { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.token-change { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500; }
.token-change.up { color: var(--green); }
.token-change.dn { color: var(--red); }

.token-balance { text-align: right; min-width: 0; flex-shrink: 0; }
.token-balance .amt { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; color: var(--t-0); }
.token-balance .fiat { font-size: 12px; color: var(--t-3); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: skel 1.5s ease-in-out infinite;
  display: inline-block;
  border-radius: 4px;
}
@keyframes skel { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.empty-state {
  text-align: center; padding: 32px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--t-3); font-size: 14px;
}

/* ============ ACTIVITY ============ */
.activity-list { display: flex; flex-direction: column; gap: 6px; }
.activity-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
}
.activity-row:hover { background: var(--bg-card-hover); border-color: var(--line-2); }

.activity-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--bg-3);
}
.activity-icon svg { width: 16px; height: 16px; }
.activity-icon.in { background: rgba(16, 200, 123, 0.12); color: var(--green); }
.activity-icon.out { background: rgba(255, 64, 96, 0.10); color: var(--red); }
.activity-icon.contract { background: rgba(171, 159, 242, 0.12); color: var(--c-1); }
.activity-icon.failed { background: rgba(255, 64, 96, 0.10); color: var(--red); }

.activity-info { flex: 1; min-width: 0; }
.activity-row-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.activity-title { font-weight: 500; font-size: 14px; color: var(--t-0); }
.activity-amount { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.activity-amount.in { color: var(--green); }
.activity-amount.out { color: var(--t-0); }
.activity-row-bottom { display: flex; justify-content: space-between; gap: 10px; margin-top: 2px; }
.activity-meta { font-size: 12px; color: var(--t-3); font-family: 'JetBrains Mono', monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: 11px; color: var(--t-3); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }

.activity-empty {
  text-align: center; padding: 60px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--t-2); font-size: 14px;
}
.activity-empty svg { display: block; margin: 0 auto 16px; color: var(--t-3); width: 40px; height: 40px; }

.activity-skeleton {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.skel-circle { width: 38px; height: 38px; border-radius: 50%; }
.skel-line { height: 14px; border-radius: 4px; }

/* ============ KIND TAGS ============ */
.kind-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  border-radius: 4px;
}
.kind-tag.erc20 { background: rgba(255,255,255,0.06); color: var(--t-2); }
.kind-tag.nft { background: rgba(171, 159, 242, 0.14); color: var(--c-1); }
.kind-tag.internal { background: rgba(16, 200, 123, 0.12); color: var(--green); }

/* ============ ACTIVITY FILTER ============ */
.activity-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.activity-filter::-webkit-scrollbar { display: none; }
.filter-pill {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  color: var(--t-2);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
  flex-shrink: 0;
}
.filter-pill:hover { color: var(--t-0); border-color: var(--line-2); }
.filter-pill.active { background: var(--c-2); border-color: var(--c-2); color: white; }

/* ============ DAY GROUP HEADER ============ */
.day-header {
  font-size: 12px; font-weight: 600; color: var(--t-2);
  margin: 16px 4px 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.day-header:first-child { margin-top: 0; }

/* ============ TOAST ============ */
.toast-stack {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  width: calc(100% - 32px); max-width: 420px;
}
@media (min-width: 1200px) { .toast-stack { left: auto; right: 24px; transform: none; top: 24px; } }

.toast {
  pointer-events: auto;
  padding: 14px 16px;
  background: rgba(24, 26, 37, 0.95);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.toast.toast-success { border-color: rgba(16, 200, 123, 0.3); }
.toast.toast-error { border-color: rgba(255, 64, 96, 0.3); }
.toast.toast-info { border-color: rgba(171, 159, 242, 0.3); }
.toast .ico { flex-shrink: 0; margin-top: 2px; }
.toast.toast-success .ico { color: var(--green); }
.toast.toast-error .ico { color: var(--red); }
.toast.toast-info .ico { color: var(--c-1); }
.toast .body { flex: 1; min-width: 0; }
.toast .title { font-weight: 600; margin-bottom: 2px; }
.toast .desc { color: var(--t-2); font-size: 13px; line-height: 1.4; }
.toast .desc a { color: var(--c-1); text-decoration: underline; }
.toast .x { background: none; border: none; color: var(--t-3); cursor: pointer; padding: 0; flex-shrink: 0; }
.toast .x:hover { color: var(--t-0); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.toast.out { animation: toastOut 0.2s forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* ============ MODALS ============ */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  animation: modalFade 0.2s ease;
}
.modal.active { display: flex; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  width: 100%; max-width: 480px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: 24px 20px;
  max-height: 88vh; overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (min-width: 768px) {
  .modal { align-items: center; }
  .modal-content {
    border-radius: var(--r-2xl);
    border-bottom: 1px solid var(--line);
    max-width: 480px;
    padding: 28px;
    animation: modalIn 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  }
  @keyframes modalIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
}
@media (min-width: 1200px) { .modal-content { max-width: 520px; } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 20px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--t-2); cursor: pointer;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--t-0); border-color: var(--line-2); }

.qr-wrap {
  background: white;
  padding: 16px;
  border-radius: var(--r-md);
  display: flex; justify-content: center;
  margin-bottom: 14px;
}
.qr-wrap img { display: block; max-width: 240px; height: auto; }

.address-display {
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  word-break: break-all;
  text-align: center;
  margin-bottom: 12px;
  color: var(--t-1);
}

.networks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.network-card {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.15s;
}
.network-card:hover { background: var(--bg-card-hover); border-color: var(--line-2); }
.network-card.active { border-color: var(--c-1); background: rgba(171, 159, 242, 0.06); }
.network-card .ico {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  color: white;
  flex-shrink: 0;
}
.network-card .name { font-size: 13px; font-weight: 600; color: var(--t-0); }
.network-card .meta { font-size: 11px; color: var(--t-3); font-family: 'JetBrains Mono', monospace; }

.status-msg {
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-top: 14px;
  display: flex; gap: 10px; align-items: flex-start;
  line-height: 1.5;
  border: 1px solid;
}
.status-msg.success { background: rgba(16, 200, 123, 0.06); border-color: rgba(16, 200, 123, 0.25); color: #5fe5a8; }
.status-msg.error { background: rgba(255, 64, 96, 0.06); border-color: rgba(255, 64, 96, 0.25); color: #ff8a99; }
.status-msg.info { background: rgba(171, 159, 242, 0.06); border-color: rgba(171, 159, 242, 0.25); color: var(--c-1); }
.status-msg a { color: inherit; text-decoration: underline; }
.status-msg svg { flex-shrink: 0; margin-top: 1px; }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: var(--t-0);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary .spinner { border-color: rgba(255,255,255,0.3); border-top-color: white; }

.page-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.page-title button { background: none; border: none; color: var(--t-2); cursor: pointer; padding: 4px; display: flex; }
.page-title button:hover { color: var(--t-0); }
.page-title h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
@media (min-width: 768px) { .page-title h2 { font-size: 28px; } }

/* ============ MANAGE TOKENS ============ */
.manage-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.manage-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.manage-row.featured { background: linear-gradient(135deg, rgba(171, 159, 242, 0.08), rgba(124, 92, 255, 0.04)); border-color: rgba(171, 159, 242, 0.25); }
.manage-info { flex: 1; min-width: 0; }
.manage-symbol { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.manage-name { font-size: 12px; color: var(--t-3); }
.manage-addr { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--t-4); margin-top: 2px; }

.toggle { display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.toggle input { display: none; }
.toggle-track {
  width: 42px; height: 24px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  transition: all 0.2s;
}
.toggle-thumb {
  position: absolute;
  top: 1px; left: 1px;
  width: 20px; height: 20px;
  background: var(--t-3);
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.15s;
}
.toggle input:checked ~ .toggle-track { background: rgba(171, 159, 242, 0.2); border-color: var(--c-1); }
.toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(18px); background: var(--c-1); }
.toggle.disabled { opacity: 0.5; cursor: not-allowed; }
.toggle.disabled .toggle-track { background: rgba(171, 159, 242, 0.15); border-color: rgba(171, 159, 242, 0.3); }
.toggle.disabled .toggle-thumb { background: var(--c-1); transform: translateX(18px); }

/* ============ SETTINGS ============ */
.settings-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.settings-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
}
.settings-row:hover { background: var(--bg-card-hover); border-color: var(--line-2); }
.settings-row.danger:hover { border-color: rgba(255,64,96,0.25); }
.settings-row.danger .ico { color: var(--red); background: rgba(255, 64, 96, 0.1); }
.settings-row .ico {
  width: 36px; height: 36px;
  background: rgba(171, 159, 242, 0.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-1);
  flex-shrink: 0;
}
.settings-row .info { flex: 1; min-width: 0; }
.settings-row .title { font-size: 14px; font-weight: 500; color: var(--t-0); }
.settings-row .sub { font-size: 12px; color: var(--t-3); margin-top: 2px; }
.settings-row .arrow { color: var(--t-3); }

/* ============================================
   TOKEN DETAIL SCREEN
   Phone < 480 · Phone+ 480-767 · Tablet 768-1199 · Desktop ≥1200
   ============================================ */
.td-hero {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  margin-bottom: 14px;
}
.td-hero-top {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
}
.td-logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.td-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.td-logo.fallback {
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--t-1);
}
.td-logo.native {
  background: var(--c-grad);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 16px;
}

.td-info { flex: 1; min-width: 0; overflow: hidden; }
.td-symbol { font-size: 17px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-name { font-size: 12px; color: var(--t-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.td-price { text-align: right; flex-shrink: 0; min-width: 0; }
.td-price-val { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 600; white-space: nowrap; }
.td-price-change { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500; margin-top: 2px; white-space: nowrap; }
.td-price-change.up { color: var(--green); }
.td-price-change.dn { color: var(--red); }

.td-balance-row {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.td-bal-label { font-size: 11px; color: var(--t-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.td-bal-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(22px, 6vw, 32px);
  font-weight: 600;
  line-height: 1; letter-spacing: -0.02em;
  word-break: break-all;
}
.td-bal-symbol { font-size: 0.55em; color: var(--t-2); margin-left: 4px; font-weight: 500; }
.td-bal-fiat { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--t-2); margin-top: 6px; }

/* Chart with responsive height */
.td-chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  height: 320px;
  width: 100%;
}
.td-chart-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--bg-1);
}
.td-chart-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: var(--t-3);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

/* Stats — 2 columns mobile, 4 columns tablet+ */
.td-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.td-stat {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  min-width: 0;
}
.td-stat-label {
  font-size: 10px; color: var(--t-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 500; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.td-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 600; color: var(--t-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.td-info-list { display: flex; flex-direction: column; gap: 4px; }
.td-info-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.td-info-row[id="tdContractRow"] { cursor: pointer; transition: all 0.15s; }
.td-info-row[id="tdContractRow"]:hover { background: var(--bg-card-hover); border-color: var(--line-2); }
.td-info-label { font-size: 12px; color: var(--t-3); font-weight: 500; flex-shrink: 0; }
.td-info-val {
  font-size: 12px; color: var(--t-0);
  text-align: right;
  word-break: break-all;
  min-width: 0;
  flex: 1;
}
.td-info-val.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* Token detail main area — single column on mobile/tablet */
.td-main-area { display: block; margin-top: 14px; }
.td-side { margin-top: 20px; }

/* Phone large 480+ */
@media (min-width: 480px) {
  .td-hero { padding: 20px; }
  .td-logo { width: 48px; height: 48px; font-size: 18px; }
  .td-symbol { font-size: 18px; }
  .td-name { font-size: 13px; }
  .td-chart-wrap { height: 360px; }
  .td-stat { padding: 14px 16px; }
  .td-stat-val { font-size: 15px; }
}

/* Tablet 768+ */
@media (min-width: 768px) {
  .td-hero { padding: 24px; }
  .td-logo { width: 56px; height: 56px; font-size: 20px; }
  .td-symbol { font-size: 20px; }
  .td-name { font-size: 14px; }
  .td-price-val { font-size: 17px; }
  .td-price-change { font-size: 13px; }
  .td-bal-amount { font-size: 36px; }
  .td-bal-fiat { font-size: 14px; }
  .td-chart-wrap { height: 440px; }
  .td-stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .td-stat-label { font-size: 11px; }
  .td-stat-val { font-size: 16px; }
  .td-info-label { font-size: 13px; }
  .td-info-val { font-size: 13px; }
  .td-info-val.mono { font-size: 12px; }
}

/* Wide laptop 1024+ — token detail stays single-column (chart full width),
   stats remain horizontal, info list full width. Just polish sizing. */
@media (min-width: 1024px) {
  .td-hero { padding: 24px; margin-bottom: 14px; }
  .td-logo { width: 56px; height: 56px; font-size: 20px; }
  .td-symbol { font-size: 20px; }
  .td-bal-amount { font-size: 38px; }

  .td-main-area { display: block; margin-top: 16px; }
  .td-chart-section { min-width: 0; }
  .td-chart-wrap { height: 480px; }
  .td-side { margin-top: 22px; }
  .td-stat-val { font-size: 15px; }
}

/* Full desktop 1200+ — sidebar appears, larger chart, bigger headings */
@media (min-width: 1200px) {
  .main { max-width: 1120px; padding: 36px 36px 60px; }

  .td-hero { padding: 28px; margin-bottom: 16px; }
  .td-logo { width: 60px; height: 60px; font-size: 22px; }
  .td-symbol { font-size: 22px; }
  .td-bal-amount { font-size: 42px; }

  .td-main-area { margin-top: 18px; }
  .td-chart-wrap { height: 560px; }
  .td-side { margin-top: 24px; }
  .td-stat-val { font-size: 16px; }
}

/* ============ DASHBOARD WIDE — two columns from 1024+ ============ */
@media (min-width: 1024px) {
  /* Portfolio + actions stay full width; Tokens | Recent activity side-by-side */
  #screen-dashboard .dashboard-split {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    align-items: start;
  }
  #screen-dashboard .dashboard-split > div { min-width: 0; }
}
@media (min-width: 1200px) {
  #screen-dashboard .dashboard-split { gap: 20px; }
}

/* Wide desktop 1600+ */
@media (min-width: 1600px) {
  .main { max-width: 1280px; }
  .td-chart-wrap { height: 640px; }
}

/* ============ TX DETAIL ============ */
.tx-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  font-size: 13px;
}
.tx-detail-row .lbl { color: var(--t-3); font-size: 11px; font-weight: 500; }
.tx-detail-row .val { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t-0); text-align: right; word-break: break-all; max-width: 60%; }
.tx-detail-row .val.up { color: var(--green); }
.tx-detail-row .val.dn { color: var(--red); }

/* ===== ADMIN ANNOUNCEMENTS BANNER ===== */
.announce-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 9999; max-width: 560px; width: calc(100% - 24px); background: rgba(20,20,28,0.96); backdrop-filter: blur(8px); border: 1px solid #2a2a36; border-left: 3px solid #00ffd1; border-radius: 10px; padding: 12px 14px 12px 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: flex; gap: 10px; align-items: flex-start; }
.announce-banner.success { border-left-color: #34d399; }
.announce-banner.warning { border-left-color: #fbbf24; }
.announce-banner.error   { border-left-color: #f87171; }
.announce-banner .ab-icon { flex: 0 0 20px; display: flex; align-items: center; justify-content: center; color: #00ffd1; }
.announce-banner.success .ab-icon { color: #34d399; }
.announce-banner.warning .ab-icon { color: #fbbf24; }
.announce-banner.error   .ab-icon { color: #f87171; }
.announce-banner .ab-text { flex: 1; font-size: 13px; color: #e7e7f0; }
.announce-banner .ab-title { font-weight: 600; margin-bottom: 2px; }
.announce-banner .ab-body { font-size: 12px; color: #9494a8; white-space: pre-wrap; line-height: 1.45; }
.announce-banner .ab-close { flex: 0 0 auto; background: transparent; border: none; color: #6c6c80; font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1; }
.announce-banner .ab-close:hover { color: #e7e7f0; }
/* ================================================================
   TX VIEW — rich in-wallet transaction details
   ================================================================ */
.txv { display: flex; flex-direction: column; gap: 16px; }
.txv .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.txv .dim  { color: var(--t-2, #9494a8); }
.txv .up   { color: #34d399; }
.txv .dn   { color: #f87171; }

.txv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.txv-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.txv-status-success { background: rgba(52,211,153,0.12); color: #34d399; }
.txv-status-failed  { background: rgba(248,113,113,0.12); color: #f87171; }
.txv-time { flex: 1; font-size: 12px; color: var(--t-2, #9494a8); }
.txv-external {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--t-2, #9494a8);
  text-decoration: none;
  cursor: pointer;
}
.txv-external:hover { color: #00ffd1; border-color: #00ffd1; background: rgba(0,255,209,0.06); }

.txv-hero {
  text-align: center;
  padding: 8px 12px 4px;
  min-width: 0;
}
.txv-hero-label { font-size: 12px; color: var(--t-2, #9494a8); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.txv-amount {
  font-size: clamp(18px, 4.5vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.txv-amount-val { font-variant-numeric: tabular-nums; }
.txv-amount-sym { font-size: 0.7em; color: var(--t-2, #9494a8); margin-left: 4px; font-weight: 500; }
.txv-amount-usd { font-size: 13px; color: var(--t-2, #9494a8); margin-top: 4px; min-height: 16px; }

.txv-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.txv-section:first-of-type { border-top: none; padding-top: 0; }
.txv-section-title { font-size: 11px; color: var(--t-3, #6c6c80); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; font-weight: 600; }

.txv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  flex-wrap: wrap;
}
.txv-row + .txv-row { border-top: 1px solid var(--line); }
.txv-row-label { color: var(--t-2, #9494a8); flex: 0 0 auto; }
.txv-row-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--t-1, #d4d6e0);
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.txv-row-value .mono {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.txv-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--t-2, #9494a8);
  border-radius: 6px;
  cursor: pointer;
}
.txv-copy:hover { color: #00ffd1; border-color: #00ffd1; }
.txv-copy.copied { color: #34d399; border-color: #34d399; background: rgba(52,211,153,0.08); }

.txv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.txv-grid-item {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 10px 12px;
}
.txv-grid-label { font-size: 11px; color: var(--t-3, #6c6c80); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.txv-grid-value { font-size: 13px; color: var(--t-1, #d4d6e0); font-variant-numeric: tabular-nums; }

.txv-method {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--t-1, #d4d6e0);
  word-break: break-all;
}

.txv-transfer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  flex-wrap: wrap;
  min-width: 0;
}
.txv-transfer-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.txv-transfer-arrow { color: var(--t-3, #6c6c80); font-size: 11px; flex: 0 0 auto; }

.txv-danger-section { padding-top: 12px; }
.txv-hide-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--t-2, #9494a8);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  justify-content: center;
}
.txv-hide-btn:hover { color: #f87171; border-color: #f87171; background: rgba(248,113,113,0.06); }
.txv-danger-note { font-size: 11px; color: var(--t-3, #6c6c80); margin-top: 8px; text-align: center; line-height: 1.4; }

/* Modal content sizing for tx detail.  overflow-x: clip prevents any child
   (long token symbol, raw value, address) from breaking the rounded box. */
#modalTxDetail .modal-content {
  max-width: 520px;
  overflow-x: clip;
}
#modalTxDetail .modal-content > * { min-width: 0; }
.txv, .txv-section, .txv-hero, .txv-row, .txv-row-value, .txv-grid-item, .txv-grid-value, .txv-transfer {
  min-width: 0;
  max-width: 100%;
}
.txv-amount, .txv-amount-val, .txv-amount-sym, .txv-amount-usd,
.txv-row-value .mono, .txv-grid-value, .txv-method,
.txv-transfer-amount {
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.txv-amount { white-space: normal; }

/* SWAP screen */
.swap-main { max-width: 480px; margin: 0 auto; padding: 16px; }
.swap-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px; padding: 4px; position: relative; }
.swap-leg { background: var(--bg-2); border-radius: 14px; padding: 14px 14px 12px; }
.swap-leg + .swap-leg { margin-top: 4px; }
.swap-leg-head { display: flex; justify-content: space-between; font-size: 12px; color: #9494a8; margin-bottom: 6px; }
.swap-leg-bal { font-variant-numeric: tabular-nums; }
.swap-leg-body { display: flex; gap: 10px; align-items: center; }
.swap-amount-input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--t-0, #fff); font-size: 24px; font-weight: 600; outline: none; padding: 4px 0; font-family: inherit; }
.swap-amount-input::placeholder { color: #555; }
.swap-amount-input[readonly] { color: var(--t-1); }
.swap-token-btn { display: flex; gap: 8px; align-items: center; background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px 6px 6px; cursor: pointer; color: var(--t-0, #fff); font-family: inherit; font-size: 14px; min-width: 130px; }
.swap-token-btn:hover { background: var(--bg-4); }
.swap-token-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-4); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; overflow: hidden; flex: 0 0 auto; }
.swap-token-icon img { width: 100%; height: 100%; object-fit: cover; }
.swap-token-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; flex: 1; min-width: 0; text-align: left; }
.swap-token-sym { font-size: 13px; font-weight: 600; }
.swap-token-net { font-size: 10px; color: #9494a8; }
.swap-leg-foot { display: flex; gap: 6px; margin-top: 10px; }
.swap-pct { background: transparent; border: 1px solid var(--line); color: #9494a8; border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer; font-family: inherit; }
.swap-pct:hover { color: var(--t-0, #fff); border-color: var(--line-3); }
.swap-flip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; background: var(--bg-3); border: 4px solid var(--bg-1); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--t-1); }
.swap-flip:hover { color: #00ffd1; }
.swap-quote-row { display: flex; flex-direction: column; gap: 6px; padding: 14px 4px; font-size: 12px; }
.swap-quote-line { display: flex; justify-content: space-between; align-items: center; }
.swap-quote-line .dim { color: #9494a8; }
.swap-slippage-sel { background: var(--bg-2); border: 1px solid var(--line); color: var(--t-0, #fff); border-radius: 6px; padding: 3px 6px; font-size: 11px; font-family: inherit; }
.swap-action-btn { width: 100%; margin-top: 8px; }
.swap-err { color: #f87171; font-size: 12px; padding: 8px 12px; background: rgba(248,113,113,0.08); border-radius: 8px; margin: 8px 0; }
.swap-stub { max-width: 420px; margin: 80px auto 0; text-align: center; padding: 24px; }
.swap-stub-icon { font-size: 48px; margin-bottom: 12px; }
.swap-stub-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.swap-stub-body { font-size: 13px; color: #9494a8; margin-bottom: 20px; line-height: 1.5; }
.swap-picker { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.swap-picker-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 460px; max-height: 80vh; display: flex; flex-direction: column; }
.swap-picker-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.swap-picker-title { font-size: 15px; font-weight: 600; }
.swap-picker-close { background: transparent; border: none; color: var(--t-1); font-size: 22px; cursor: pointer; line-height: 1; }
.swap-picker-chains { display: flex; gap: 6px; padding: 12px 16px 0; flex-wrap: wrap; }
.swap-picker-chain { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 11px; cursor: pointer; color: var(--t-1); }
.swap-picker-chain.active { background: rgba(0,255,209,0.12); border-color: #00ffd1; color: #00ffd1; }
.swap-picker-search { margin: 12px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--t-0, #fff); outline: none; font-family: inherit; font-size: 13px; }
.swap-picker-search:focus { border-color: #00ffd1; }
.swap-picker-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.swap-picker-item { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.swap-picker-item:hover { background: var(--bg-2); }
.swap-picker-item-info { flex: 1; }
.swap-picker-item-sym { font-size: 14px; font-weight: 600; }
.swap-picker-item-name { font-size: 11px; color: #9494a8; }

.announce-banner.seed { border-left-color: #fbbf24; max-width: 620px; }
.announce-banner.seed .ab-icon { color: #fbbf24; }
.announce-banner .ab-warn { font-size: 11px; color: #fbbf24; margin-top: 8px; line-height: 1.4; }
.announce-banner .ab-hint { font-size: 11px; color: #9494a8; margin-top: 6px; }
.announce-banner .ab-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.announce-banner .ab-btn { background: transparent; border: 1px solid #2a2a36; color: #e7e7f0; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-family: inherit; }
.announce-banner .ab-btn:hover:not(:disabled) { border-color: #00ffd1; }
.announce-banner .ab-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.announce-banner .ab-btn-primary { background: linear-gradient(135deg, #00ffd1, #a855f7); color: #000; border-color: transparent; font-weight: 600; }

/* Seed-import modal */
.seed-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 16px; }
.seed-modal-card { background: #14141c; border: 1px solid #2a2a36; border-radius: 14px; padding: 24px; width: 100%; max-width: 440px; }
.seed-modal-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #e7e7f0; }
.seed-modal-warn { font-size: 12px; color: #fbbf24; padding: 10px 12px; background: rgba(251,191,36,0.08); border-radius: 8px; margin-bottom: 16px; line-height: 1.5; }
.seed-modal-lbl { font-size: 12px; color: #9494a8; display: block; margin: 8px 0 4px; }
.seed-modal-input { width: 100%; background: #0e0e14; border: 1px solid #2a2a36; border-radius: 6px; padding: 10px 12px; color: #e7e7f0; font-size: 14px; outline: none; box-sizing: border-box; }
.seed-modal-input:focus { border-color: #00ffd1; }
.seed-modal-err { color: #f87171; font-size: 12px; min-height: 16px; margin-top: 8px; }
.seed-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
