.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: var(--space-5);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: var(--border);
  padding: var(--space-4);
}

.balance-card {
  background: linear-gradient(145deg, #2563eb 0%, #3b82f6 40%, #1d4ed8 100%);
  color: #fff;
}

.balance-card .muted {
  color: rgba(255, 255, 255, 0.8);
}

.btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-outline {
  background: #fff;
  border: var(--border);
  color: var(--text);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.input-group {
  display: grid;
  gap: 8px;
}

.label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input,
.textarea,
.select {
  width: 100%;
  border: var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 13px 14px;
  outline: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.chip {
  background: #fff;
  border: var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
}

.chip-wide {
  grid-column: span 2;
}

.subtle-card {
  background: #f8fbff;
}

.centered-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-bottom: 0;
}

.centered-card {
  text-align: center;
  width: 100%;
  max-width: 280px;
}

.text-center {
  text-align: center;
}

.token-card,
.transaction-card,
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-row {
  align-items: flex-start;
}

.summary-row .meta-sub {
  margin-top: 0;
  flex: 0 0 auto;
}

.summary-row strong {
  max-width: 66%;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tx-details-card {
  gap: 14px;
}

.tx-headline {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}

.tx-amount-negative {
  margin: 0;
  text-align: center;
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #dc2626;
}

.tx-account-block {
  gap: 4px;
}

.tx-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.tx-meta-qr .qr-image {
  width: 122px;
  height: 122px;
}

.tx-meta-qr {
  justify-items: start;
}

.tx-details-card .summary-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.tx-details-card .summary-row strong {
  max-width: 100%;
  text-align: left;
  overflow-wrap: break-word;
  word-break: normal;
}

.tx-details-card #txHash {
  word-break: break-all;
}

.tx-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.qr-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.qr-image {
  width: 156px;
  height: 156px;
  border-radius: 14px;
  border: var(--border);
  background: #fff;
  padding: 8px;
  object-fit: contain;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
}

.token-main,
.tx-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-icon,
.tx-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.token-icon.btc { background: #fff2e8; color: #ea580c; }
.token-icon.trx { background: #fef2f2; color: #b91c1c; }
.token-icon.usdt { background: #ecfdf5; color: #047857; }
.tx-icon.sent { background: #fef2f2; color: var(--danger); }
.tx-icon.received { background: #ecfdf5; color: var(--success); }
.tx-icon.pending { background: #fffbeb; color: var(--warning); }

.meta-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.meta-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.bottom-fixed {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: calc(100% - 32px);
  max-width: calc(var(--page-max) - 32px);
  min-width: calc(var(--page-min) - 32px);
  z-index: 50;
}

.bottom-bar {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: var(--border);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 8px;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.nav-item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.nav-item.active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.modal-backdrop,
.bottom-sheet-backdrop,
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 90;
}

.modal {
  width: calc(100% - 32px);
  max-width: calc(var(--page-max) - 32px);
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 20px;
}

.bottom-sheet {
  width: 100%;
  max-width: var(--page-max);
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 16px;
}

.handle {
  width: 46px;
  height: 4px;
  border-radius: 99px;
  margin: 2px auto 14px;
  background: rgba(17, 24, 39, 0.2);
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 90px;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.loading-overlay {
  align-items: center;
}

.loader-box {
  width: 110px;
  height: 110px;
  border-radius: 22px;
  background: #fff;
  display: grid;
  place-items: center;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--primary);
  border-radius: 999px;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch {
  width: 48px;
  height: 28px;
  border-radius: 99px;
  background: rgba(17, 24, 39, 0.2);
  border: none;
  position: relative;
  cursor: pointer;
}

.switch::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.switch.on {
  background: var(--primary);
}

.switch.on::before {
  transform: translateX(20px);
}
