.wallet-panel {
  margin: 0 0 .7rem;
  padding: .55rem .65rem;
  border: 1px solid #c8ac80;
  border-radius: .3rem;
  background: #fff5dc;
  color: #173f40;
}
.wallet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: .3rem .65rem;
}
.wallet-balance { display: grid; flex: 0 0 auto; gap: .1rem; }
.wallet-label {
  font: 800 .67rem/1.1 system-ui, sans-serif;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.wallet-total { font-size: clamp(1.65rem, 2.35vw, 2.15rem); line-height: 1; }
.wallet-total, .wallet-delta { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wallet-delta[data-sign="gain"] { color: #1b634f; }
.wallet-delta[data-sign="loss"] { color: #9f3e30; }
.wallet-latest, .wallet-history {
  font: 650 .78rem/1.25 system-ui, sans-serif;
}
.wallet-latest { display: flex; align-items: baseline; gap: .35rem; }
.wallet-latest:empty { display: none; }
.wallet-delta { font-weight: 850; }
.wallet-reason { overflow-wrap: anywhere; }
.wallet-history { margin: .4rem 0 0; }
.wallet-history > summary { color: #3f5c57; cursor: pointer; }
.wallet-history-list {
  display: grid;
  gap: .2rem;
  margin: .35rem 0 0;
  padding: .35rem 0 0;
  border-top: 1px solid #d9c7a6;
  list-style: none;
}
.wallet-history-item { display: grid; grid-template-columns: 4.5rem 1fr; gap: .35rem; }

.wallet-notifications {
  position: fixed;
  z-index: 30;
  inset-block-start: 4.85rem;
  inset-inline-end: max(.75rem, env(safe-area-inset-right));
  width: min(21rem, 79vw);
  display: grid;
  gap: .42rem;
  pointer-events: none;
}
.wallet-toast {
  padding: .62rem .75rem;
  border: 1px solid #c7a56e;
  border-radius: .32rem;
  background: #fff7e5;
  color: #173f40;
  box-shadow: 0 .22rem .7rem #17343755;
  font: 650 .88rem/1.3 system-ui, sans-serif;
  animation: wallet-toast-in .18s ease-out both;
}
.wallet-toast-cash {
  display: grid;
  grid-template-columns: minmax(4rem, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: .55rem;
}
.wallet-toast-cash .wallet-delta { font-size: 1.07rem; }
.wallet-toast-leaving { animation: wallet-toast-out .18s ease-in both; }
@keyframes wallet-toast-in { from { opacity: 0; transform: translateY(-.3rem); } }
@keyframes wallet-toast-out { to { opacity: 0; transform: translateY(-.2rem); } }

@media (max-width: 600px) {
  .wallet-panel { margin-bottom: .45rem; padding: .4rem .5rem; }
  .wallet-balance { display: flex; align-items: baseline; gap: .35rem; }
  .wallet-total { font-size: 1.4rem; }
  .wallet-label { font-size: .6rem; }
  .wallet-latest, .wallet-history { font-size: .7rem; }
  .wallet-notifications { inset-block-start: 3.9rem; }
  .wallet-toast:nth-child(n+3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wallet-toast { animation: none; }
  .wallet-toast-leaving { opacity: 0; }
}
