.wallet-layout-wrap {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

@media (min-width: 1000px) {
  .wallet-layout-wrap {
    max-width: 1180px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    align-items: start;
  }

  .wallet-card { grid-column: 1; }

  .wallet-history-section {
    grid-column: 2;
    min-height: 100%;
  }
}

.wallet-card {
  background: linear-gradient(145deg, #151c28 0%, #101620 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.app-container #tab-wallet .wallet-card-back {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  flex: 0 0 40px;
}

.wallet-card-header {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.wallet-brand-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.vault-brand-text {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.vault-id-text {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.wallet-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
}

.pulse-indicator-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.wallet-balance-center {
  text-align: center;
  padding: 4px 2px 18px;
}

.wallet-balance-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.balance-amount-display {
  min-width: 0;
  font-size: clamp(24px, 8vw, 36px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.balance-amount-display .currency-symbol {
  font-size: 26px;
  color: var(--primary);
  font-weight: 600;
}

.balance-reserved-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
  margin-top: 8px;
}

.wallet-substat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  text-align: center;
}

.wallet-sync-notice {
  margin-bottom: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.wallet-substat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.substat-label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.substat-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.substat-val.withdrawable {
  color: #10b981;
}

.substat-val.deposit-coins {
  color: #f59e0b;
}

.wallet-stats-subrow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 18px;
  text-align: center;
}

.wallet-substat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.substat-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.substat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.wallet-substat-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
}

/* Wallet Action Buttons */
.wallet-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-wallet-deposit {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: var(--fs-base);
  height: var(--btn-h);
  border-radius: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-wallet-deposit:hover {
  filter: brightness(1.08);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-wallet-deposit:active {
  transform: translateY(1px);
}

.btn-wallet-withdraw {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  font-weight: 700;
  font-size: var(--fs-base);
  height: var(--btn-h);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-wallet-withdraw:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 85, 0, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-wallet-withdraw:active {
  transform: translateY(1px);
}

.wallet-history-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  padding: 14px;
}

.wallet-history-more {
  margin-top: 12px;
  white-space: normal;
}

.wallet-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.history-title-group h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.history-count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  padding: 3px 8px;
  border-radius: 12px;
}

/* Empty History Card */
.history-empty-card {
  text-align: center;
  padding: 36px 16px;
}

.empty-icon-bubble {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  color: var(--text-dim);
}

.empty-card-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-card-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.4;
}

.tx-item-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 11px 2px;
  margin: 0;
  display: block;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tx-item-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.tx-item-summary::-webkit-details-marker { display: none; }
.tx-item-details { display: none; gap: 6px; margin-top: 9px; padding: 9px 0 0 48px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: var(--fs-xs); }
.tx-item-card[open] .tx-item-details { display: grid; }

.tx-item-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tx-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tx-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tx-icon-badge.tx-positive {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tx-icon-badge.tx-neutral {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tx-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.tx-date {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.tx-item-right {
  display: grid;
  justify-items: end;
  text-align: right;
  flex-shrink: 0;
  margin-left: 8px;
}

.tx-amount {
  font-size: 14px;
  font-weight: 800;
}

.tx-amount-positive {
  color: #10b981;
}

.tx-amount-negative {
  color: var(--text-main);
}

.badge.tx-status-badge {
  margin-top: 4px;
  display: inline-block;
  font-size: 10px;
  padding: 0;
  line-height: 1.2;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-weight: 700;
}

@media (max-width: 480px) {
  .wallet-card {
    padding: 12px;
  }
  .tx-item-card { padding: 10px 2px; }
  .tx-icon-badge { width: 30px; height: 30px; }
  .tx-item-left { gap: 8px; }
  .tx-item-right { margin-left: 4px; }
  .tx-item-details { padding-left: 38px; }
  .tx-title { font-size: 12px; }
  .tx-date { font-size: 10px; }
  .tx-amount { font-size: 12px; }
  .badge.tx-status-badge { font-size: 9px; padding: 0; }
  .balance-amount-display {
    font-size: clamp(24px, 8vw, 32px);
  }
  .wallet-stats-subrow {
    padding: 8px 6px;
  }
  .substat-val {
    font-size: 11px;
  }
  .wallet-card-header { margin-bottom: 10px; }
  .wallet-balance-center { padding: 4px 2px 12px; }
  .wallet-substat-grid { margin-bottom: 12px; padding: 8px 6px; }
  .wallet-action-buttons { gap: 8px; }
  .btn-wallet-deposit,
  .btn-wallet-withdraw { height: var(--btn-h); font-size: var(--fs-sm); }
}

.btn-compact {
  min-height: var(--btn-h-sm);
  height: auto;
  padding: 9px 14px;
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

