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

:root {
  --avax-red: #e84142;
  --avax-red-dark: #c93738;
  --avax-red-light: #ff5a5b;
  --avax-gray: #9ba1a6;
  --border-color: #e5e7eb;
  --card-bg: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  min-height: 100vh;
  color: #1a1a1a;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid;
}

.toast.success {
  border-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}
.toast.error {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}
.toast.warning {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.toast.info {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.toast-icon {
  font-size: 20px;
  line-height: 1;
}
.toast-content {
  flex: 1;
}
.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 0;
  line-height: 1;
}
.toast-close:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── Layout ── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ── Header ── */
.header {
  background: var(--card-bg);
  border-bottom: 2px solid var(--border-color);
  padding: 20px 0;
  margin-bottom: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

/* Nav links on desktop sit between logo and wallet */
.header-content .nav-link {
  flex-shrink: 0;
}

/* Wallet info pushed to right on desktop */
.header-content .wallet-info {
  margin-left: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.logo-badge {
  background: var(--avax-red);
  color: white;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--avax-red);
  background: var(--red-subtle);
}

.wallet-info {
  background: #f9fafb;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 500;
}

.disconnect-btn {
  background: #fee2e2;
  color: #991b1b;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.disconnect-btn:hover {
  background: #fecaca;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--avax-red);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-primary:hover {
  background: var(--avax-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232, 65, 66, 0.3);
}
.btn-primary:disabled {
  background: var(--avax-gray);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: var(--avax-red);
  border: 2px solid var(--avax-red);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-secondary:hover {
  background: var(--avax-red);
  color: white;
}
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  background: #f3f4f6;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 16px;
}
.btn-icon:hover {
  background: #e5e7eb;
}

/* ── Card ── */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-bottom: -2px;
}
.tab.active {
  color: var(--avax-red);
  border-bottom-color: var(--avax-red);
}
.tab:hover {
  color: var(--text-primary);
}

/* ── Splitter Grid ── */
.splitter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.splitter-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  text-align: center;
}
.splitter-card:hover {
  border-color: var(--avax-red);
  box-shadow: 0 4px 12px rgba(232, 65, 66, 0.1);
  transform: translateY(-2px);
}
.splitter-card.active {
  border-color: var(--avax-red);
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

/* ── Toggle Switch ── */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: var(--avax-red);
}
input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Modal ── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Form ── */
.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--card-bg);
  color: var(--text-primary);
}
.input-field:focus {
  outline: none;
  border-color: var(--avax-red);
}

/* ── Table ── */
.wallet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.wallet-table th {
  text-align: left;
  padding: 12px;
  background: #f9fafb;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border-color);
}
.wallet-table tr:hover {
  background: #f9fafb;
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success {
  background: #d1fae5;
  color: #065f46;
}
.badge-inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Address ── */
.address-display {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  background: #f3f4f6;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}

/* ── Balance Grid ── */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.balance-card {
  background: #f9fafb;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.balance-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.balance-value {
  font-size: 20px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ── Progress Bar ── */
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
}

/* ── Footer ── */
.footer {
  background: var(--card-bg);
  border-top: 2px solid var(--border-color);
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}
.footer-tagline {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}
.footer-section-title {
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.footer-link:hover {
  color: var(--avax-red);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.powered-by {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.avalanche-logo {
  height: 22px;
}

/* ── Wallet Balance Cards ── */
.wallet-balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.wallet-balance-card {
  background: #fff;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}
.wallet-balance-card:hover {
  border-color: var(--avax-red);
  box-shadow: 0 4px 16px rgba(232, 65, 66, 0.08);
}

.wbc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.wbc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--avax-red) 0%,
    var(--avax-red-light) 100%
  );
  color: white;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wbc-meta {
  flex: 1;
  min-width: 0;
}

.wbc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.wbc-share-badge {
  background: #fff0f0;
  color: var(--avax-red);
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: "JetBrains Mono", monospace;
}

.wbc-tokens {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wbc-token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid transparent;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.wbc-token-row:has(.wbc-has-balance) {
  background: #fff8f8;
  border-color: #fecaca;
}

.wbc-token-symbol {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wbc-token-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.wbc-token-amount.wbc-has-balance {
  color: var(--avax-red);
  font-weight: 700;
}

/* ── Header Right ── */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Desktop only */
.wallet-info--desktop {
  display: flex;
}
.nav-connect-btn {
  display: block;
}

/* Mobile only — hidden on desktop */
.header-mobile-right {
  display: none;
}
.mobile-wallet-pill {
  display: none;
}
.hamburger {
  display: none;
}
.mobile-connect-btn {
  display: none;
}
.mobile-drawer {
  display: none;
}
.logo-badge--desktop {
  display: inline-block;
}

/* ── New Splitter button ── */
.btn-new-splitter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  white-space: nowrap;
}
.btn-new-splitter-icon {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.btn-new-splitter-text {
  font-size: 14px;
}

/* ── Mobile Drawer ── */
.mobile-drawer {
  border-top: 1px solid var(--border-color);
  background: #fff;
  animation: drawerSlide 0.18s ease;
}
@keyframes drawerSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
}
.mobile-drawer-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}
.mobile-drawer-wallet {
  padding: 12px 20px 4px;
}
.mobile-drawer-disconnect {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 12px;
  padding: 13px;
  background: #fee2e2;
  color: #991b1b;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

/* ── Mobile Wallet Pill ── */
.mobile-wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
}
.mobile-wallet-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Hamburger ── */
.hamburger {
  background: none;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.hamburger:hover {
  background: #f3f4f6;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE  ≤ 768px
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── Toast: full-width at top ── */
  .toast-container {
    top: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    padding: 8px 12px;
    gap: 6px;
  }
  .toast {
    min-width: 0;
    border-radius: 10px;
    padding: 12px 14px;
  }

  /* ── Header ── */
  .header {
    padding: 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 200;
  }
  .header-content {
    padding: 11px 14px;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .logo-text {
    font-size: 19px;
  }
  .logo-badge--desktop {
    display: none;
  }

  /* Show mobile, hide desktop */
  .header-mobile-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-wallet-pill {
    display: inline-flex;
  }
  .hamburger {
    display: inline-flex;
  }
  .mobile-connect-btn {
    display: block;
    width: auto;
    padding: 8px 14px;
    font-size: 13px;
  }
  .mobile-drawer {
    display: block;
  }
  .wallet-info--desktop {
    display: none;
  }
  .nav-connect-btn {
    display: none;
  }
  .nav-link {
    display: none;
  }

  /* ── New Splitter: icon-only ── */
  .btn-new-splitter {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    justify-content: center;
    flex-shrink: 0;
  }
  .btn-new-splitter-text {
    display: none;
  }
  .btn-new-splitter-icon {
    font-size: 22px;
    margin: 0;
  }

  /* ── Container ── */
  .container {
    padding: 12px;
  }

  /* ── Card ── */
  .card {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .card-title {
    font-size: 17px;
    margin-bottom: 12px;
  }

  /* ── Splitter grid ── */
  .splitter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
  }
  .splitter-card {
    padding: 14px;
  }

  /* ── Tabs: edge-to-edge horizontal scroll ── */
  .tabs {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab {
    padding: 10px 14px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 0;
  }

  /* ── Wallet table: hide Description ── */
  .wallet-table {
    font-size: 13px;
  }
  .wallet-table th:nth-child(2),
  .wallet-table td:nth-child(2) {
    display: none;
  }
  .wallet-table th,
  .wallet-table td {
    padding: 10px 8px;
  }

  /* ── Balance grid: 2 columns ── */
  .balance-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .balance-card {
    padding: 12px;
  }
  .balance-value {
    font-size: 16px;
  }

  /* ── Wallet balance cards ── */
  .wallet-balance-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* ── Modal: bottom sheet ── */
  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal-content {
    border-radius: 20px 20px 0 0;
    padding: 8px 20px 24px;
    max-height: 92vh;
    width: 100%;
    max-width: 100%;
  }
  .modal-content::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 20px;
  }

  /* ── Inputs: 16px prevents iOS zoom-on-focus ── */
  .input-field {
    font-size: 16px;
    padding: 14px 12px;
  }

  /* ── Buttons inside modals: full width ── */
  .modal-content .btn-primary,
  .modal-content .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  .btn-icon {
    width: auto;
  }

  /* ── Empty state ── */
  .empty-state {
    padding: 40px 16px;
  }
  .empty-state-icon {
    font-size: 48px;
  }

  /* ── Footer ── */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
