.sub-account-balance-dialog {
  width: min(480px, calc(100vw - 2rem));
  max-height: min(760px, calc(100vh - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel, #fff);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}
.sub-account-balance-dialog::backdrop {
  background: rgba(10, 18, 32, 0.46);
}
.sub-account-balance-form {
  display: grid;
  gap: 0.9rem;
  max-height: inherit;
  padding: 1.1rem;
  overflow-y: auto;
}
.sub-account-balance-head,
.sub-account-balance-actions,
.sub-account-balance-history-head,
.sub-account-balance-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.sub-account-balance-head h2 {
  margin: 0.14rem 0 0;
  font-size: 1.18rem;
  overflow-wrap: anywhere;
}
.sub-account-balance-summary {
  display: grid;
  gap: 0.25rem;
  padding: 0.82rem;
  border: 1px solid rgba(34, 126, 230, 0.2);
  border-radius: 8px;
  background: #eef6ff;
}
.sub-account-balance-summary span,
.sub-account-balance-history-head span,
.sub-account-balance-history-row small {
  color: var(--muted);
  font-size: 0.78rem;
}
.sub-account-balance-summary strong {
  color: #0b64c0;
  font-size: 1.42rem;
  font-variant-numeric: tabular-nums;
}
.sub-account-recharge-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.sub-account-recharge-presets button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.sub-account-recharge-presets button:hover,
.sub-account-recharge-presets button:focus-visible {
  border-color: rgba(255, 90, 20, 0.42);
  color: var(--accent-strong);
  outline: none;
}
.sub-account-balance-actions {
  justify-content: flex-end;
}
.sub-account-balance-history {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border);
}
.sub-account-balance-history-list {
  display: grid;
  gap: 0.42rem;
}
.sub-account-balance-history-row {
  min-width: 0;
  padding: 0.55rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}
.sub-account-balance-history-row > span:first-child {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}
.sub-account-balance-history-row > span:last-child {
  flex: 0 0 auto;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.sub-account-balance-history-row .credit { color: #16794f; }
.sub-account-balance-history-row .debit { color: var(--text); }
@media (max-width: 520px) {
  .sub-account-balance-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }
  .sub-account-balance-form { padding: 0.9rem; }
  .sub-account-balance-actions .btn { flex: 1 1 0; min-width: 0; }
}
