.account-page .account-school-form input[type="search"] { border-color: #cfd3d2; }
.account-page :is(.account-form, .account-school-form) input:not([type="checkbox"]):focus {
  border-color: #666;
  outline: none;
  box-shadow: none;
}

.account-main.has-profile {
  grid-template-columns: minmax(0, 1fr);
  padding: clamp(28px, 5vw, 64px) 0;
}

.account-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "overview overview" "school history" "membership history";
  gap: 20px;
  align-items: start;
}

.account-profile[hidden] { display: none; }
.account-overview {
  grid-area: overview;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: start;
}
.account-history { grid-area: history; display: grid; gap: 20px; min-width: 0; }
.account-controls {
  min-width: 0;
  padding-inline-start: clamp(18px, 3vw, 36px);
  border-inline-start: 1px solid #e0e3e2;
}

.account-profile .account-panel {
  margin: 0;
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid #d6d9d8;
  background: #fff;
}

.account-identity {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.account-identity > div { min-width: 0; overflow-wrap: anywhere; }
.account-identity p { margin: 0; }
.account-identity h2 { margin: 5px 0; font-size: clamp(24px, 4vw, 34px); line-height: 1.2; }
.account-identity [data-account-email] { color: #626a6c; font-size: 13px; }
.account-identity button {
  flex: none;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #d6d9d8;
  background: #fff;
  color: #3f4749;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.account-profile .account-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e0e3e2;
}

.account-profile .account-actions a {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 8px 6px;
  border-color: #c6d8d7;
  background: #f5f9f8;
  font-size: 13px;
}

.account-profile .account-actions a:hover,
.account-identity button:hover { background: #eaf3f1; }

.account-profile .account-intro h1 {
  margin: 7px 0 10px;
  font-size: clamp(23px, 2.6vw, 30px);
  line-height: 1.2;
  text-wrap: balance;
}
.account-profile .account-intro h1 span { display: inline-block; }
.account-profile .account-intro .eyebrow { margin: 0; }
.account-profile .account-intro > p:not(.eyebrow) { margin: 0; font-size: 14px; line-height: 1.65; }
.account-profile .account-intro ul { gap: 7px; margin-top: 14px; padding-top: 12px; font-size: 13px; }

.account-profile .account-membership { grid-area: membership; margin: 0; }
.account-profile .account-school-form {
  grid-area: school;
  min-width: 0;
  margin: 0;
  padding: clamp(14px, 2vw, 22px);
  background: #fff;
}

.account-profile .account-school-form > header { gap: 10px; }
.account-profile .account-school-form > header > span { overflow-wrap: anywhere; }
.account-profile .school-finder { grid-template-columns: minmax(0, 1fr); }
.account-profile .account-school-form > footer { flex-wrap: wrap; gap: 8px; }
.account-profile .account-school-form > footer button { margin-inline-start: auto; }

.account-profile .local-account-exams {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  border: 1px solid #d6d9d8;
  background: #fff;
}

.account-profile .account-purchases > header,
.account-profile .account-coupons > header { flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.account-profile .account-purchases h3,
.account-profile .account-coupons h3 { font-size: clamp(19px, 3vw, 24px); }
.account-profile .account-purchases > header > span,
.account-profile .account-coupons > header > span { color: #626a6c; text-align: left; white-space: normal; }

.account-purchase-scroll,
.account-profile .account-coupon-list { overflow-y: auto; overflow-anchor: none; }
.account-purchase-scroll { max-height: min(450px, 62vh); }
.account-profile .account-coupon-list { max-height: 232px; }
.account-purchase-scroll:focus-visible,
.account-profile .account-coupon-list:focus-visible {
  outline: 2px solid #176f76;
  outline-offset: 2px;
}

.account-profile .account-purchase-list { gap: 8px; }
.account-profile .account-purchase { padding: 12px 14px; overflow-wrap: anywhere; }
.account-profile .account-purchase > header { gap: 10px; }
.account-profile .account-purchase > header > div { min-width: 0; gap: 3px; }
.account-profile .account-purchase > header > div:first-child { flex: 1; }
.account-profile .account-purchase strong { font-size: 15px; }
.account-profile .account-purchase time { font-size: 11px; }
.account-profile .account-purchase-status { white-space: normal; text-align: right; }
.account-profile .account-purchase-meta {
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr);
  max-width: 45%;
}
.account-profile .account-purchase dl {
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 6px 10px;
  margin-top: 8px;
  padding-top: 8px;
}

.account-purchase-more {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border: 1px solid #c6d8d7;
  background: #f5f9f8;
  color: #164b4f;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.account-purchase-more:disabled { opacity: .65; cursor: wait; }
.account-purchase-error { margin: 8px 0; color: #991e10; font-size: 13px; }

@media (min-width: 801px) {
  .account-profile:has(> .local-account-exams) {
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "overview overview" "school history" "membership history" "mock history";
  }
  .account-profile:has(> .local-account-exams) .account-history {
    align-self: stretch;
    grid-template-rows: auto 1fr;
    align-items: end;
  }
  .account-profile .local-account-exams {
    grid-area: mock;
    align-self: stretch;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(18px, 2.5vw, 28px);
  }
}

@media (max-width: 800px) {
  .account-profile {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "overview" "school" "history" "membership";
  }
  .account-overview { grid-template-columns: minmax(0, 1fr); }
  .account-controls { padding: 14px 0 0; border: 0; border-top: 1px solid #e0e3e2; }
}

@media (max-width: 520px) {
  .account-profile, .account-history, .account-overview { gap: 14px; }
  .account-profile .account-panel { padding: 14px; }
  .account-profile .account-purchase { padding: 10px; }
  .account-profile .account-purchase dl { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  .account-purchase-scroll { max-height: min(340px, 54vh); }
}
