.account-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.account-main {
  flex: 1;
  padding-block: clamp(28px, 5vw, 58px);
}

.account-page h1 { font-size: clamp(34px, 5vw, 54px); }
.account-page h2 { font-size: clamp(20px, 3vw, 27px); }

.account-heading {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-block-end: 22px;
}

.account-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-heading-actions a { text-decoration: none; }

.account-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.account-panel {
  min-width: 0;
  padding: clamp(16px, 2.7vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(255px, 320px);
  align-items: start;
  gap: 18px;
}

.account-auth {
  width: min(100%, 480px);
  margin-inline: auto;
}

.account-auth h1 {
  font-size: clamp(29px, 4vw, 38px);
  letter-spacing: -.045em;
}

.account-auth-intro { margin-block: 12px 22px; }
.account-form { display: grid; gap: 15px; }
.account-form input { min-height: 44px; }
.account-form input[aria-invalid="true"] { border-color: #b64756; }
.account-form .primary { margin-top: 4px; }
.account-auth-switch { margin-top: 18px; }
.account-auth-switch a, .account-pages a { color: var(--purple); font-weight: 720; }
.account-error { color: #972536; font-size: 13px; }

.account-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 16px;
  padding: clamp(16px, 3vw, 24px);
  border-radius: 12px;
  background: var(--paper);
}

.account-empty .primary { margin-top: 7px; }
.account-profile p { overflow-wrap: anywhere; }
.account-profile-name { margin-block: 14px 16px; font-weight: 750; }
.account-profile-details { display: grid; gap: 12px; margin: 0; }
.account-profile-details dt { margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.account-profile-details dd { margin: 0; font-weight: 630; overflow-wrap: anywhere; }
.account-partner-tier {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 7px;
  background: #eef1f5;
  color: #39455b;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.account-partner-tier[data-tier="gold"] { background: #fff2d5; color: #725019; }
.account-partner-tier[data-tier="platinum"] { background: #edf3f8; color: var(--bizes-brand-navy); }
.account-partner-tier:hover { text-decoration: underline; }
.account-profile-message { margin-top: 12px; color: var(--bizes-brand-green-dark); font-size: 14px; }
.account-profile-edit { margin-top: 12px; }
.account-profile-edit summary { padding-block: 7px; color: var(--purple); font-size: 14px; font-weight: 720; cursor: pointer; }
.account-profile-edit form { gap: 8px; margin-top: 8px; }
.account-profile-logout { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.account-profile button { min-height: 44px; }

.account-order-list { margin: 14px 0 0; padding: 0; list-style: none; }
.account-order-list > li { border-top: 1px solid var(--line); }

.account-order-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  min-height: 67px;
  padding: 10px 9px;
  border-radius: 8px;
  text-decoration: none;
}

.account-order-link:hover { background: var(--paper); }
.account-order-identity { display: grid; gap: 4px; overflow-wrap: anywhere; }
.account-order-identity time { color: var(--muted); font-size: 13px; }
.account-order-total { text-align: right; white-space: nowrap; }
.account-order-arrow { color: var(--purple); font-size: 17px; }

.account-status {
  justify-self: start;
  padding: 5px 8px;
  border-radius: 7px;
  background: #edf3f8;
  color: var(--bizes-brand-green-dark);
  font-size: 12px;
  font-weight: 750;
}

.account-status--quote { background: #fff2d5; color: #725019; }
.account-status--paid { background: var(--bizes-success-surface); color: var(--bizes-brand-green-dark); }

.account-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
  color: var(--muted);
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-block: 14px;
}

.account-item h3 { font-size: 16px; overflow-wrap: anywhere; }
.account-item-description { min-width: 0; }
.account-item-description > p { margin-top: 4px; overflow-wrap: anywhere; }
.account-item-price { display: grid; gap: 3px; text-align: right; white-space: nowrap; }
.account-item-facts { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0 0; }
.account-item-facts:empty { display: none; }
.account-item-facts div { display: flex; gap: 5px; }
.account-item-facts dt, .account-item-options { color: var(--muted); }
.account-item-facts dt, .account-item-facts dd, .account-item-options { font-size: 13px; }
.account-item-options { margin-top: 7px; padding-inline-start: 17px; }
.account-item-facts dd, .account-summary-values dd { margin: 0; }

.account-summary-values { display: grid; gap: 9px; margin-block: 14px; }
.account-summary-values > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.account-summary-values dt { font-size: 14px; }
.account-summary-values dd { font-weight: 750; text-align: right; white-space: nowrap; }
.account-summary-total { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 750; }
.account-summary-cashback { border-radius: 8px; padding: 8px; color: var(--bizes-brand-green-dark); background: var(--bizes-success-surface); }
.account-reference { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
.account-reference p { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; font-size: 13px; }

.account-sales-totals,
.account-sales-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-sales-totals { margin-block: 16px 20px; }
.account-sales-totals > div {
  padding: clamp(12px, 2vw, 18px);
  border-radius: 12px;
  background: var(--paper);
}

.account-sales-totals dt,
.account-sales-breakdown dt { color: var(--muted); font-size: 13px; }
.account-sales-totals dd {
  margin: 4px 0 0;
  color: var(--purple);
  font-size: clamp(23px, 4vw, 36px);
  font-weight: 760;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.account-sales-breakdown {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.account-sales-breakdown h3 { font-size: 16px; }
.account-sales-breakdown dl { margin-block: 8px 0; }
.account-sales-breakdown dl > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 10px;
  padding-block: 4px;
}

.account-sales-breakdown dd { margin: 0; font-weight: 730; overflow-wrap: anywhere; }

.account-referral-statistics { grid-column: 1 / -1; }
.account-referral-statistics .account-title-row { justify-content: space-between; }
.account-referral-statistics .secondary { text-decoration: none; }
.account-referral-totals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-block-end: 0;
}
.account-referral-totals .account-referral-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.account-partner-level {
  --medal-face: #e3eaf2;
  --medal-edge: #8d9dad;
  --medal-ribbon: #616f82;
  --medal-star: #39455b;
}

.account-partner-level[data-tier="gold"] {
  --medal-face: #ffedaf;
  --medal-edge: #c88d2a;
  --medal-ribbon: #a66221;
  --medal-star: #725019;
}

.account-partner-level[data-tier="platinum"] {
  --medal-face: #edf3f8;
  --medal-edge: #8fa9bd;
  --medal-ribbon: #476284;
  --medal-star: var(--bizes-brand-navy);
}

.account-level-current {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 14px;
  font-size: 20px;
}

.account-medal {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  position: relative;
  height: 48px;
}

.account-medal::before {
  position: absolute;
  inset: 0 8px 12px;
  background: var(--medal-ribbon);
  clip-path: polygon(0 0, 9px 0, 50% 20px, calc(100% - 9px) 0, 100% 0, 50% 100%);
  content: "";
}

.account-medal span {
  display: grid;
  place-items: center;
  align-self: end;
  z-index: 0;
  width: 35px;
  height: 35px;
  border: 2px solid var(--medal-edge);
  border-radius: 50%;
  background: var(--medal-face);
  color: var(--medal-star);
  font-size: 18px;
  line-height: 1;
}

.account-level-progress { display: grid; gap: 7px; }
.account-level-progress label { font-size: 14px; font-weight: 720; }
.account-level-progress progress { width: 100%; height: 12px; accent-color: var(--purple); }

@media (max-width: 760px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .account-referral-totals { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .account-sales-breakdown { grid-template-columns: minmax(0, 1fr); }
  .account-order-link { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 9px; }
  .account-order-identity { grid-column: 1; }
  .account-order-link .account-status { grid-column: 1; grid-row: 2; }
  .account-order-total { grid-column: 2; grid-row: 1 / span 2; }
  .account-order-arrow { grid-column: 3; grid-row: 1 / span 2; }
}

.account-referral-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}
.account-referral-card h2 { margin-bottom: 5px; }
.account-referral-card a { text-decoration: none; }

/* Subscription tools remain usable on narrow account screens. */
.account-page .fields { align-items: end; }
.account-page .field input, .account-page .field select { min-height: 44px; }
.account-page .fields > button { justify-self: start; }
.account-page .pulse-section-heading form { min-width: 0; }
.account-page .account-item form { margin-top: 12px; display: grid; gap: 8px; }
@media (max-width: 600px) {
  .account-page .fields { grid-template-columns: minmax(0, 1fr); }
  .account-page .account-item { flex-wrap: wrap; }
}
