/* Dashboard account-history drawer. */

.web-account-head .web-account-history {
  margin-left: 6px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #9aa3b4;
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.web-account-head .web-account-history:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.account-history {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}

.account-history[hidden] {
  display: none;
}

.account-history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.62);
  backdrop-filter: blur(3px);
}

.account-history-panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(520px, 100%);
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--popup-border);
  background: var(--popup-bg);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.4);
  animation: history-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes history-in {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}

.account-history-panel h2 {
  margin: 0;
  padding-right: 26px;
  color: #fff;
  font-size: 24px;
  line-height: 1.1;
}

.account-history-panel .web-muted {
  margin: 0;
  font-size: 11px;
}

.history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
}

.history-tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
}

.history-tabs button {
  padding: 4px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #8b94a6;
  font: inherit;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.history-tabs button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.history-summary div {
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.13);
}

.history-summary span {
  display: block;
  color: #737d90;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.history-summary b {
  display: block;
  margin-top: 2px;
  color: #e8ebf2;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.history-chart-wrap {
  position: relative;
  margin-top: 4px;
}

#history-chart {
  display: block;
  width: 100%;
  height: 220px;
}

#history-chart .grid {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

#history-chart .axis {
  fill: #6f7888;
  font-size: 9px;
  font-family: "Fredoka", system-ui, sans-serif;
}

#history-chart .line {
  fill: none;
  stroke: var(--ui-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#history-chart .area {
  fill: url(#history-gradient);
  opacity: 0.3;
}

#history-chart .dot {
  fill: #8fc2ff;
  stroke: #141821;
  stroke-width: 2;
}

.history-empty {
  position: absolute;
  inset: 20px 0 0;
  display: grid;
  place-items: center;
  color: #737d90;
  font-size: 10px;
}

.history-empty[hidden] {
  display: none;
}

.history-note {
  margin: 0;
  color: #5f6878;
  font-size: 9px;
}

@media (max-width: 720px) {
  .account-history-panel {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--popup-border);
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-history-panel {
    animation: none;
  }
}
