.account-page {
  padding: 140px 20px 56px;
  min-height: 70vh;
}

.account-container { max-width: 1080px; margin: 0 auto; }
.account-heading { margin-bottom: 28px; }
.account-heading h1 { margin: 0 0 6px; color: var(--emphasis-color); }
.account-muted { color: var(--gray-100); }
.account-notice {
  margin-bottom: 20px;
  padding: 13px 18px;
  color: #173b7a;
  background: var(--secondary-color);
  border: 1px solid #cbd7f3;
  border-radius: 12px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr);
  gap: 20px;
  align-items: start;
}

.account-grid > * { min-width: 0; }

.account-card {
  background: #fff;
  border: 1px solid #e3e8f8;
  border-radius: 16px;
  padding: 24px;
}

.account-profile { display: flex; align-items: center; gap: 16px; }
.account-profile-card {
  min-height: 100%;
  box-sizing: border-box;
}
.account-avatar {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--secondary-color); color: var(--primary-color); font-size: 23px; font-weight: 700;
}
.account-profile h2, .account-card h2 { margin: 0 0 5px; color: var(--emphasis-color); }
.account-section-title { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid #edf0f8; color: var(--emphasis-color); font-size: 18px; }
.account-details { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.account-detail span { display: block; color: var(--gray-100); font-size: 13px; margin-bottom: 4px; }
.account-detail strong { overflow-wrap: anywhere; }
.account-detail--wide { grid-column: 1 / -1; }
.account-side { display: grid; gap: 20px; }

.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.account-actions--stacked { flex-direction: column; align-items: stretch; }
.account-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 22px; border-radius: 999px; background: var(--primary-color); color: #fff;
  text-decoration: none; border: 1px solid var(--primary-color); font-weight: 600;
  font-family: var(--font-base-medium); font-size: 14px; line-height: 1; white-space: nowrap;
  box-sizing: border-box; cursor: pointer; appearance: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.account-button:hover { background: #2d57a5; border-color: #2d57a5; color: #fff; }
.account-button:focus-visible { outline: 3px solid rgba(45, 87, 165, .22); outline-offset: 2px; }
.account-button--secondary { background: #fff; color: var(--primary-color); }
.account-button--secondary:hover { background: var(--secondary-color); color: var(--primary-color); border-color: var(--primary-color); }
.account-login { max-width: 600px; margin: 35px auto; text-align: center; padding: 40px 28px; }
.account-login p { max-width: 430px; margin: 10px auto 24px; }

.account-order { display: flex; justify-content: space-between; gap: 16px; padding: 15px 10px; margin-inline: -10px; border-bottom: 1px solid #edf0f8; border-radius: 10px; color: inherit; text-decoration: none; transition: background-color .2s ease; }
.account-order:hover { background: #f6f8ff; color: var(--primary-color); }
.account-order:last-of-type { border-bottom: 0; }
.account-order strong, .account-order span { display: block; }
.account-order small { color: var(--gray-100); }
.account-empty { padding: 18px 0; color: var(--black-500); }
.account-addresses { margin-top: 20px; }
.account-addresses__heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.address-card {
  position: relative; display: flex; flex-direction: column; min-height: 320px; overflow: hidden;
  padding: 22px; border: 1px solid #dfe5f3; border-radius: 16px; background: #fff;
}
.address-card--active {
  border-color: var(--primary-color);
}
.address-card__content { flex: 1; }
.address-card__recipient { display: flex; align-items: center; gap: 12px; padding-right: 92px; }
.address-card__avatar {
  flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; color: var(--primary-color); background: var(--secondary-color);
  font-family: var(--font-base-medium); font-weight: 700;
}
.address-card__eyebrow { display: block; margin-bottom: 2px; color: var(--gray-100); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.address-card h3 { margin: 0; color: var(--emphasis-color); font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.address-card__details { display: grid; gap: 13px; margin: 20px 0 0; }
.address-card__details div { padding-left: 12px; border-left: 2px solid #e3e8f8; }
.address-card__details dt { margin-bottom: 2px; color: var(--gray-100); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.address-card__details dd { margin: 0; color: var(--emphasis-color); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.address-card__instructions dd { color: var(--black-500); }
.address-badge {
  position: absolute; top: 18px; right: 18px; display: inline-flex; align-items: center; min-height: 24px;
  padding: 0 9px; border-radius: 999px; color: #fff; background: var(--primary-color);
  font-family: var(--font-base-medium); font-size: 11px; line-height: 1;
}
.address-card form { margin: 0; }
.address-card__actions { margin-top: 22px; padding-top: 17px; border-top: 1px solid #edf0f8; }
.address-card__actions .account-button { min-height: 40px; padding-inline: 16px; }
.account-button--danger { color: #a61b1b; background: #fff; border-color: #d8a3a3; }
.account-button--danger:hover { color: #8d1414; background: #fff5f5; border-color: #c77c7c; }
.account-dialog {
  position: fixed;
  inset: 0;
  width: calc(100% - 32px);
  max-width: 520px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 28px;
  overflow-y: auto;
  box-sizing: border-box;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 20px 60px #0003;
}
.account-dialog::backdrop { background: #0b163b99; }
.account-dialog h2 { margin-top: 0; padding-right: 42px; }
.modal-close-button {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  color: #566078; background: #f1f4fa; cursor: pointer;
}
.modal-close-button:hover { color: var(--emphasis-color); background: #e5eaf5; }
.modal-close-button:focus-visible { outline: 3px solid rgba(45, 87, 165, .22); outline-offset: 2px; }
.modal-close-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 800px) {
  .account-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .address-grid { grid-template-columns: 1fr; }
  .account-addresses__heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .account-page { padding: 90px 14px 40px; }
  .account-card { padding: 19px; }
  .account-details { grid-template-columns: 1fr; }
  .account-profile { align-items: flex-start; }
  .address-card { min-height: 0; padding: 18px; }
  .address-card__recipient { padding-right: 0; }
  .address-badge { position: static; align-self: flex-start; margin-bottom: 14px; }
  .address-card__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .address-card__actions form, .address-card__actions .account-button { width: 100%; }
}
