.account-menu { position: relative; }

.textbook-profile-header-spacer {
  display: none;
}

/* Match landing-page action width while keeping Profile's avatar at the right. */
@media (min-width: 901px) {
  .textbook-site-page--profile .textbook-profile-header-spacer {
    display: inline-flex;
    visibility: hidden;
    pointer-events: none;
  }
}

.textbook-auth-shell__desktop-break {
  display: none;
}

.textbook-auth-shell__mobile-space {
  display: inline;
}

@media (min-width: 768px) {
  .textbook-auth-shell__desktop-break {
    display: initial;
  }

  .textbook-auth-shell__mobile-space {
    display: none;
  }
}

.company-menu {
  position: relative;
}

.company-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.company-menu__trigger:hover {
  background: rgb(249 250 251);
}

.company-menu__panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 50;
  min-width: 14rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

.company-menu__panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.45rem;
  height: 0.45rem;
}

.company-menu__card {
  border: 1px solid rgb(229 231 235);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 0.5rem;
}

.company-menu.is-open .company-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

@media (hover: hover) {
  .company-menu:hover .company-menu__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.account-menu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
}

.account-menu__trigger:hover .account-menu__avatar,
.account-menu__trigger:focus-visible .account-menu__avatar {
  border-color: #9fb8df;
  box-shadow: 0 0 0 3px rgba(47, 95, 167, 0.12), 0 8px 24px rgba(15, 23, 42, 0.08);
}

.account-menu__trigger:focus-visible {
  outline: none;
}

.account-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid #d8deea;
  background: linear-gradient(160deg, #fff7ed 0%, #eef4ff 100%);
  color: #1f4d8f;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.account-menu__avatar-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-menu__panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  width: 17rem;
  border: 1px solid #dde4ef;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  padding: 0.75rem;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.account-menu__panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.45rem;
  height: 0.45rem;
}

.account-menu.is-open .account-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.account-menu__identity {
  padding: 0.65rem 0.75rem 0.85rem;
  border-bottom: 1px solid #e8edf5;
}

.account-menu__eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8c5a2b;
}

.account-menu__name {
  display: block;
  margin-top: 0.35rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.account-menu__email {
  display: block;
  margin-top: 0.16rem;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.account-menu__links {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.65rem;
}

.account-menu__logout-form {
  margin: 0;
}

.account-menu__links a,
.account-menu__links button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 0.85rem;
  padding: 0.7rem 0.85rem;
  background: transparent;
  color: #1e293b;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.account-menu__link-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.account-menu__links a:hover,
.account-menu__links button:hover {
  background: #f4f8fd;
  color: #1f4d8f;
}

.account-menu__links .account-menu__logout:hover {
  background: #fff1f2;
  color: #be123c;
}

.account-page {
  max-width: 71rem;
  margin: 0 auto;
}

.account-hero {
  padding: 1.55rem 0 2rem;
}

.account-hero__eyebrow,
.account-card__eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8c5a2b;
}

.account-hero__title {
  margin: 0;
  color: #0f172a;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.account-hero__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.account-hero__text {
  margin: 0.75rem 0 0;
  max-width: 42rem;
  color: #475569;
  font-size: 1rem;
  line-height: 1.5;
}

.account-card {
  border: 1px solid #dde4ef;
  border-radius: 1.35rem;
  background: #ffffff;
  padding: 1.75rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.account-section + .account-section {
  margin-top: 1.5rem;
}

.account-section--access {
  position: relative;
  padding: 1.1rem 1.25rem;
}

.account-access-card__status {
  position: absolute;
  /* Center the badge on the eyebrow while keeping it close to the card edge. */
  top: 0.75rem;
  right: 0.9rem;
}

.account-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.account-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.account-card__title {
  margin: 0.7rem 0 0;
  color: #0f172a;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
}

.account-section__title {
  margin: 0.65rem 0 0;
  color: #0f172a;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
}

.account-card__text {
  margin: 0.85rem 0 0;
  color: #64748b;
  line-height: 1.6;
}

.account-button,
.account-button--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.account-button--secondary::-webkit-details-marker {
  display: none;
}

.account-button {
  border: 1px solid #1f4d8f;
  background: #1f4d8f;
  color: #ffffff !important;
  box-shadow: 0 14px 30px rgba(31, 77, 143, 0.18);
}

.account-button:hover {
  background: #163e75;
  border-color: #163e75;
}

.account-button--access {
  border-color: #132c4e;
  background: #132c4e;
}

.account-button--access:hover {
  border-color: #132c4e;
  background: #1e3c65;
}

.account-button--access:active {
  border-color: #132c4e;
  background: #102642;
}

.account-button--access:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

@media (hover: none), (pointer: coarse) {
  .account-button--access {
    transition-duration: 0s;
  }

  .account-button--access:is(:hover, :focus, :active) {
    border-color: #132c4e;
    background: #102642;
  }
}

.account-button--reading {
  border-color: #c7d8f5;
  background: #e8f0ff;
  color: #214f9f !important;
  box-shadow: 0 10px 22px rgba(47, 95, 167, 0.08);
}

.account-button--reading:hover {
  background: #dce8ff;
  border-color: #b8cdf2;
  color: #173f84 !important;
  box-shadow: 0 14px 28px rgba(34, 75, 135, 0.12);
}

.account-button--secondary {
  border: 1px solid #cdd7e6;
  background: #ffffff;
  color: #1e293b;
}

.account-button--secondary:hover {
  background: #f8fafc;
  border-color: #b9c7da;
}

.account-meta {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.5rem;
}

.account-meta--details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.account-meta__row dt {
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-meta__row dd {
  margin: 0.3rem 0 0;
  color: #0f172a;
  font-size: 1rem;
}

.account-meta__row {
  min-height: 4rem;
  padding: 0.55rem 0;
  border: 0;
}

.account-meta--details .account-meta__row:nth-child(-n + 2) {
  padding-top: 0;
}

.account-meta--details .account-meta__row:nth-child(odd) {
  padding-right: 2rem;
}

.account-meta--details .account-meta__row:nth-child(even) {
  padding-left: 2rem;
}

.account-meta--last-active {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid #e2e8f0;
}

.account-meta--last-active .account-meta__row {
  min-height: auto;
  padding: 0;
}

.account-meta__label-with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.account-meta__signin-icon {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: #4b6381;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.account-meta__security-note {
  max-width: 36rem;
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

.account-meta__security-note span {
  display: block;
}

.account-meta__edit {
  margin-top: 0.35rem;
}

.account-footnote {
  margin: 0.18rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.account-footnote a {
  color: #2f5fa7;
  text-decoration: none;
}

.account-footnote a:hover {
  text-decoration: underline;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.38rem 0.82rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
}

.account-pill--success {
  background: #ecfdf3;
  border: 1px solid #a7f3d0;
  color: #166534;
}

.account-pill--verified {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.account-status-icon,
.account-meta-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.account-status-icon {
  width: 0.8rem;
  height: 0.8rem;
}

.account-form { margin-top: 1.5rem; display: grid; gap: 1rem; }

.account-form__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-form__group label {
  display: block;
  margin-bottom: 0.45rem;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 600;
}

.account-form__field {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 0.9rem;
  background: #ffffff;
  padding: 0.82rem 0.95rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}

.account-form__field:focus {
  outline: 2px solid rgba(47, 95, 167, 0.18);
  border-color: #2f5fa7;
}

.account-form__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.2rem;
}

.account-access-summary {
  display: grid;
  grid-template-columns: 7.15rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.65rem;
  margin-top: 1.1rem;
  padding: 0;
}

.account-access-summary + .account-access-summary {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.account-access-summary__cover {
  display: block;
  width: 7.15rem;
  height: 9.65rem;
  object-fit: contain;
  object-position: center top;
  /* The display asset is trimmed to the phone/shadow with an 8px buffer. */
  transform: translateY(-0.375rem) scale(1.0925);
  transform-origin: center top;
}

.account-access-summary__image {
  display: contents;
}

.account-access-summary__content {
  min-width: 0;
}

.account-access-summary__aside {
  display: flex;
  min-height: 9.65rem;
  position: relative;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.account-access-item {
  margin-top: 1.35rem;
  border: 1px solid #dfe7f2;
  border-radius: 1.45rem;
  background: linear-gradient(160deg, #ffffff 0%, #f8fbff 64%, #fffaf5 100%);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1.5rem;
}

.account-access-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  grid-column: 1 / -1;
}

.account-access-item__type {
  color: #2f5fa7;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.account-access-item__title {
  margin: 0.3667rem 0 0;
  color: #0f172a;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
}

.account-access-item__metadata {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.9rem;
}

.account-access-item__description {
  margin: 0.9rem 0 0;
  max-width: 100%;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: break-word;
}

.account-access-item__meta {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  min-width: 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: nowrap;
}

.account-access-item__meta-text {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin-top: 0.18rem;
}

.account-access-item__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 0.9rem;
}

.account-access-summary .account-button,
.account-access-item .account-button {
  box-shadow: none;
}

.account-access-summary .account-access-item__actions {
  /* Reserve the actual CTA width so metadata ellipsizes before the buttons. */
  position: static;
  margin: 0;
  white-space: nowrap;
}

.account-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(18rem, 0.92fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.account-details-card,
.account-help-card {
  padding: 1.6rem;
}

.account-details-card {
  /* Match the access card's eyebrow-to-edge inset. */
  padding-top: 1.1rem;
}

.account-details-card > .account-card__header .account-button--secondary {
  min-height: 2rem;
  border-radius: 0.625rem;
  padding: 0.32rem 0.65rem;
  font-size: 0.875rem;
}

.account-details-card > .account-card__header {
  align-items: center;
}

.account-details-card > .account-card__header .account-card__actions {
  /* The card's content inset is wider than the access card's status inset. */
  margin-right: -0.7rem;
}

.account-help-card {
  align-self: start;
}

.account-details-card__footnote {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.account-details-card__footnote a,
.account-help-card__support a {
  color: #2563b8;
  text-decoration: none;
}

.account-details-card__footnote a:hover,
.account-help-card__support a:hover {
  text-decoration: underline;
}

.account-help-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.45rem;
  height: 3.45rem;
  margin-top: 0.85rem;
  border: 1px solid #dbe3ee;
  border-radius: 9999px;
  background: #f8fafc;
  color: #0f172a;
}

.account-help-card__title {
  margin: 0.85rem 0 0;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.account-help-card__text {
  margin: 0.55rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.account-help-card__button {
  gap: 0.55rem;
  margin-top: 1rem;
}

.account-help-card__support {
  display: flex;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.5;
}

.account-help-card__support > svg {
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

.account-help-card__support strong,
.account-help-card__support a {
  display: block;
}

.account-placeholder {
  margin-top: 1.5rem;
  border: 1px solid #e3eaf4;
  border-radius: 1.45rem;
  background: linear-gradient(160deg, #fcfdff 0%, #f7fafc 100%);
  padding: 1.75rem;
  text-align: left;
}

.account-placeholder .account-card__title {
  margin-top: 0.55rem;
  font-size: 1.25rem;
}

.account-placeholder .account-card__text {
  max-width: 34rem;
}

.account-menu__links a.is-current {
  background: #f4f8fd;
  color: #1f4d8f;
  font-weight: 600;
}

@media (max-width: 920px) {
  .account-access-summary {
    grid-template-columns: 7.15rem minmax(0, 1fr);
    row-gap: 1.125rem;
  }

  .account-access-summary__cover {
    grid-row: 1 / span 2;
  }

  .account-access-summary__aside {
    grid-column: 2;
    min-height: 0;
    align-items: flex-start;
  }

  .account-access-summary .account-access-item__actions {
    position: static;
    transform: none;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  .account-form__grid,
  .account-profile-grid {
    grid-template-columns: 1fr;
  }

  .account-card__header,
  .account-access-item__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-card__actions {
    width: auto;
  }

  .account-details-card > .account-card__header {
    flex-direction: row;
    align-items: center;
  }

  .account-details-card > .account-card__header .account-card__actions {
    margin-left: auto;
  }

  .account-access-item {
    grid-template-columns: 1fr;
  }

  .account-access-item__actions {
    justify-content: flex-start;
  }

  .account-help-card {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .account-hero,
  .account-card,
  .account-access-item,
  .account-placeholder {
    padding: 1.35rem;
    border-radius: 1.3rem;
  }

  .account-details-card {
    padding-top: 1.1rem;
  }

  .account-details-card > .account-card__header .account-card__actions {
    margin-right: -0.45rem;
  }

  .account-menu__panel {
    position: fixed;
    top: 4.65rem;
    right: 1rem;
    width: min(15rem, calc(100vw - 2rem));
  }

}

@media (max-width: 640px) {
  .account-hero {
    /* Align Profile with the tightened public textbook hero: main supplies
       the first 2rem, then the title begins after a compact 0.5rem. */
    padding: 0.5rem 0 1.5rem;
  }

  .account-details-card > .account-card__header {
    flex-direction: row;
    align-items: center;
  }

  .account-details-card > .account-card__header .account-card__actions {
    margin-left: auto;
  }

  .account-meta--details {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .account-meta__row,
  .account-meta--details .account-meta__row:nth-child(odd),
  .account-meta--details .account-meta__row:nth-child(even) {
    min-height: auto;
    padding: 0.5rem 0;
    border-left: 0;
  }

  .account-meta--details .account-meta__row:first-child {
    padding-top: 0;
  }

  .account-meta--details .account-meta__row:nth-child(2) {
    padding-top: 0.5rem;
  }
}

@media (max-width: 620px) {
  .account-access-summary {
    grid-template-columns: 5.25rem minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
  }

  .account-access-summary__cover {
    width: 5.25rem;
    height: 7.1rem;
    grid-row: 1 / span 2;
  }

  .account-access-summary__content {
    display: contents;
  }

  .account-access-summary__content > .account-access-item__type {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .account-access-summary__content > .account-access-item__title {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }

  .account-access-summary__metadata {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    margin-top: 0.5rem;
    justify-self: start;
  }

  .account-access-summary--unowned .account-access-item__description {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    margin-top: 0.5rem;
  }

  .account-access-summary__aside {
    grid-column: 1 / -1;
    grid-row: 4;
    width: 100%;
    min-height: 0;
    align-items: flex-start;
  }

  .account-access-summary__aside .account-access-item__actions {
    position: static;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.75rem;
    transform: none;
  }
}

/* Keep the phone's spanning height from expanding the mobile eyebrow row. */
@media (max-width: 620px) and (hover: none),
       (max-width: 620px) and (pointer: coarse) {
  .account-access-summary {
    grid-template-rows: 0.9rem auto auto auto;
  }

  .account-access-summary__content > .account-access-item__title {
    margin-top: -0.25rem;
  }
}

/* Keep narrow mouse/trackpad windows distinct from the compact touch layout. */
@media (max-width: 620px) and (hover: hover) and (pointer: fine) {
  .account-access-summary {
    row-gap: 1.125rem;
  }

  .account-access-summary__cover {
    grid-row: 1;
  }

  .account-access-summary__content {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  .account-access-summary__aside {
    grid-row: 2;
  }

  .account-access-summary__aside .account-access-item__actions {
    margin-top: 0;
    flex-direction: row;
  }
}

@media (max-width: 620px) and (hover: hover) and (pointer: fine) {
  .account-access-summary__image {
    display: block;
    position: relative;
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
  }

  .account-access-summary__cover {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: auto;
    max-width: none;
    transform: translateX(-50%);
  }
}

/* The textbook reader header uses the account menu as a compact popover,
   visually attached to the avatar instead of reading like a full profile card. */
.textbook-site-header .account-menu__panel {
  --account-menu-right-overflow: 0px;
  top: calc(100% + 0.55rem);
  right: auto;
  left: calc(50% - var(--account-menu-right-overflow));
  width: min(12rem, calc(100vw - 2rem));
  border-radius: 0.95rem;
  padding: 0.4rem;
  transform: translate(-50%, -4px);
}

.textbook-site-header .account-menu__panel::after {
  content: "";
  position: absolute;
  top: -0.38rem;
  right: auto;
  left: calc(50% + var(--account-menu-right-overflow));
  width: 0.7rem;
  height: 0.7rem;
  border-top: 1px solid #dde4ef;
  border-left: 1px solid #dde4ef;
  background: rgba(255, 255, 255, 0.98);
  transform: translateX(-50%) rotate(45deg);
}

.textbook-site-header .account-menu.is-open .account-menu__panel {
  transform: translate(-50%, 0);
}

.textbook-site-header .account-menu__identity {
  padding: 0.42rem 0.5rem 0.5rem;
}

.textbook-site-header .account-menu__name {
  margin-top: 0;
  font-size: 0.875rem;
  line-height: 1.35;
}

.textbook-site-header .account-menu__email {
  font-size: 0.8125rem;
}

.textbook-site-header .account-menu__links {
  gap: 0.15rem;
  padding-top: 0.3rem;
}

.textbook-site-header .account-menu__links a {
  border-radius: 0.65rem;
  padding: 0.5rem 0.55rem;
  font-size: 0.9375rem;
}

@media (max-width: 768px) {
  .textbook-site-header .account-menu__panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    width: min(12rem, calc(100vw - 1.25rem));
  }
}
