.dashboard-grid {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  align-items: start;
}

.account-profile {
  display: grid;
  gap: 18px;
}

.account-sidebar {
  display: grid;
  gap: 17px;
}

.account-profile h2 {
  margin: -3px 0 0;
  color: var(--plum);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.profile-details {
  display: grid;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fcf9fc;
}

.profile-detail {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.profile-detail span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.profile-detail strong {
  overflow-wrap: anywhere;
  color: var(--plum);
}

.profile-actions,
.profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.profile-actions .btn {
  flex: 1 1 120px;
}

.profile-edit-form,
.profile-delete-form {
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.profile-edit-form[hidden],
.profile-delete-form[hidden] {
  display: none;
}

.account-links {
  display: grid;
  gap: 4px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.account-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
}

.account-links a:hover {
  background: #f7eef4;
  color: var(--plum);
}

.account-links a.active {
  background: #f2e7f0;
  color: var(--plum);
  font-weight: 800;
}

.account-logout {
  width: 100%;
}

.profile-page-content {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.profile-security h2 {
  margin: 10px 0 4px;
  color: var(--plum);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.account-purchases {
  min-width: 0;
}

.account-purchases-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.account-purchases-head h2 {
  margin: 10px 0 0;
  color: var(--plum);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.purchase-list {
  display: grid;
  gap: 16px;
}

.purchase-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 38px rgba(81, 55, 83, .07);
}

.purchase-card.is-expanded {
  border-color: #d8c6d8;
}

.purchase-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border: 0;
  background: linear-gradient(135deg, #fff 0%, #faf6fa 100%);
  color: inherit;
  text-align: left;
}

.purchase-toggle:hover {
  background: #f8f2f8;
}

.purchase-toggle:focus-visible {
  outline: 3px solid rgba(111, 73, 113, .28);
  outline-offset: -3px;
}

.purchase-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.purchase-title strong {
  color: var(--plum);
  font-size: 1.08rem;
}

.purchase-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.purchase-expand {
  display: inline-flex;
  min-width: 101px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--plum);
  font-size: .84rem;
  font-weight: 800;
}

.purchase-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.purchase-card.is-expanded .purchase-chevron {
  transform: rotate(225deg);
}

.purchase-content {
  padding: 20px 22px 22px;
  border-top: 1px solid var(--line);
}

.purchase-content[hidden] {
  display: none;
}

.purchase-content > p:first-child {
  margin-top: 0;
}

.purchase-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 20px;
}

.purchase-pagination .btn:disabled {
  cursor: not-allowed;
  opacity: .45;
  transform: none;
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .account-profile {
    position: static;
  }
}

@media (max-width: 680px) {
  .account-purchases-head,
  .purchase-toggle {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-summary {
    justify-content: flex-start;
  }

  .purchase-pagination {
    flex-wrap: wrap;
  }
}
