  :root {
    --bg: #0e0e10;
    --bg-card: #1a1a1f;
    --bg-input: #252529;
    --border: #2e2e35;
    --text: #e4e4e8;
    --text-dim: #8a8a95;
    --accent-algo: #00d4aa;
    --accent-active: var(--accent-algo);
    --danger: #e05555;
    --radius: 12px;
    --font-mono: 'Courier New', Courier, monospace;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }

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

  body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  /* ── Layout ── */
  .app {
    max-width: 460px;
    margin: 0 auto;
    padding: 16px 16px calc(72px + var(--safe-bottom));
    min-height: 100vh;
    min-height: 100dvh;
  }

  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 20px;
  }

  header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  header .net-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--bg-input);
    color: var(--text-dim);
    border: 1px solid var(--border);
  }

  /* ── Chain tabs ── */
  .chain-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
  }

  .chain-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-dim);
    transition: all 0.2s;
  }

  .chain-tab.active {
    background: var(--accent-active);
    color: #fff;
  }

  /* ── Cards ── */
  .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
  }

  .card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 12px;
  }

  /* ── Balance display ── */
  .balance-display {
    text-align: center;
    padding: 20px 0;
  }

  .balance-amount {
    font-size: 36px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.03em;
  }

  .balance-symbol {
    font-size: 16px;
    color: var(--text-dim);
    margin-top: 4px;
  }

  /* ── Address display ── */
  .address-box {
    font-family: var(--font-mono);
    font-size: 12px;
    word-break: break-all;
    background: var(--bg-input);
    padding: 12px;
    border-radius: 8px;
    color: var(--text-dim);
    line-height: 1.5;
    cursor: pointer;
    position: relative;
  }

  .address-box:active { opacity: 0.7; }

  .address-box .copy-hint {
    display: block;
    font-family: var(--font-body);
    font-size: 10px;
    margin-top: 6px;
    color: var(--accent-active);
  }

  /* ── Forms ── */
  .field { margin-bottom: 14px; }

  .field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
  }

  .field input, .field textarea, .field select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
  }

  .field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--accent-active);
  }

  .field textarea {
    resize: vertical;
    min-height: 72px;
    font-family: var(--font-mono);
    font-size: 13px;
  }

  /* ── Buttons ── */
  .btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    color: #fff;
  }

  .btn:active { transform: scale(0.98); }
  .btn:disabled { opacity: 0.4; cursor: not-allowed; }

  .btn-primary { background: var(--accent-active); }
  .btn-danger { background: var(--danger); }
  .btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
  }

  .btn-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
  }

  .btn-row .btn { flex: 1; }

  /* ── Seed phrase grid ── */
  .seed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 12px 0;
  }

  .seed-word {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 8px;
    background: var(--bg-input);
    border-radius: 6px;
    text-align: center;
    border: 1px solid var(--border);
  }

  .seed-word span {
    color: var(--text-dim);
    font-size: 10px;
    margin-right: 4px;
  }

  /* ── Warnings ── */
  .warning {
    background: #2a1f0e;
    border: 1px solid #4a3520;
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #e8a840;
    margin-bottom: 14px;
  }

  /* ── Status / toast ── */
  .toast {
    position: fixed;
    bottom: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    transition: transform 0.3s ease;
    z-index: 100;
    white-space: nowrap;
  }

  .toast.show { transform: translateX(-50%) translateY(0); }

  /* ── Tx result ── */
  .tx-hash {
    font-family: var(--font-mono);
    font-size: 11px;
    word-break: break-all;
    padding: 10px;
    background: var(--bg-input);
    border-radius: 6px;
    margin-top: 10px;
    color: var(--accent-active);
    line-height: 1.5;
  }

  /* ── Settings panel ── */
  .settings-toggle {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
  }

  .settings-panel {
    display: none;
    margin-bottom: 16px;
  }

  .settings-panel.open { display: block; }

  /* ── Section visibility ── */
  .chain-section { display: none; }
  .chain-section.active { display: block; }

  .view { display: none; }
  .view.active { display: block; }

  /* ── Spinner ── */
  .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
  }

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

  /* ── Scrollbar ── */
  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

  /* ── PIN overlay ── */
  .pin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 200;
    align-items: center;
    justify-content: center;
  }

  .pin-overlay.active { display: flex; }

  .pin-card {
    width: 100%;
    max-width: 380px;
    padding: 0 24px;
  }

  .pin-card .card-title {
    font-size: 16px;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 8px;
    color: var(--text);
  }

  .pin-card p {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.5;
  }

  .pin-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 8px;
    display: none;
  }

  .pin-error.visible { display: block; }

  /* ── Token list rows ── */
  .token-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
  }

  .token-row:last-child { border-bottom: none; }
  .token-symbol { font-weight: 600; }
  .token-balance { font-family: var(--font-mono); color: var(--text-dim); }
