/* История операций: кнопка в карточке баланса + модальное окно (bottom-sheet на телефоне) */

.balance-history {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .04);
  color: inherit;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.balance-history svg { display: block; opacity: .92; }

.balance-history:active { transform: scale(.98); }

.rh-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.rh-sheet[hidden] { display: none; }

.rh-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, .76);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.rh-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  max-height: min(82vh, 660px);
  display: flex;
  flex-direction: column;
  background: #17191f;
  color: inherit;
  border-radius: 24px 24px 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .45);
  animation: rh-up .22s ease-out;
}

@keyframes rh-up {
  from { transform: translateY(18px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 560px) {
  .rh-sheet { align-items: center; }

  .rh-dialog {
    border-radius: 24px;
    max-height: min(78vh, 680px);
    padding-bottom: 14px;
    animation: rh-in .18s ease-out;
  }

  @keyframes rh-in {
    from { transform: scale(.97); opacity: .6; }
    to { transform: scale(1); opacity: 1; }
  }
}

.rh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.rh-top b { font-size: 15px; letter-spacing: .01em; }

.rh-close {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, .08);
  color: inherit;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}

.rh-close:active { transform: scale(.94); }

.rh-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 6px;
}

.rh-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.rh-row:last-child { border-bottom: 0; }

.rh-row .rh-title { font-size: 13px; }

.rh-row .rh-time { font-size: 11px; opacity: .55; }

.rh-row .rh-amount { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }

.rh-row .rh-amount.in { color: #6ee7a8; }

.rh-row .rh-amount.out { opacity: .82; }

.rh-row .rh-after { font-size: 11px; opacity: .5; text-align: right; font-variant-numeric: tabular-nums; }

.rh-empty {
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  opacity: .6;
}

body.rh-lock { overflow: hidden; }
