/* The account's pages: a menu on the left (the name, when they joined, the
   pages), the page on the right, each page a few sections; and the passkey
   help page. */
/* Wider than other pages, so the content beside the menu is about as wide as a page without one. */
main:has(> .account-layout) {
  max-inline-size: 73rem;
}
.account-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  align-items: start;
  gap: 3.5rem;
}
/* Stays in view as a long page scrolls: under the header, where it starts. */
.account-nav {
  position: sticky;
  top: calc(3.5rem + env(safe-area-inset-top) + 2rem);
  > ul {
    display: grid;
    margin: 1.25rem 0 0;
    padding: 0;
    gap: 0.125rem;
    list-style: none;
    > li {
      margin: 0;
    }
  }
}
.account-name {
  margin-block: 0;
  font-weight: 600;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}
.account-since {
  margin-block: 0.125rem 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.account-nav-link,
.account-nav-link:visited {
  display: block;
  margin-inline: -0.625rem;
  padding: 0.4375rem 0.625rem;
  color: var(--color-text);
  text-decoration-line: none;
  border-radius: 0.625rem;
  &:hover {
    background: var(--color-hover-faint);
  }
  &[aria-current="page"] {
    font-weight: 500;
    background: var(--color-selected);
  }
}
/* On a phone, the menu above the page, its pages side by side. */
@media (width < 48rem) {
  .account-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .account-nav {
    position: static;
  }
  .account-nav > ul {
    display: flex;
    margin-block-start: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .account-nav-link,
  .account-nav-link:visited {
    margin-inline: 0;
    padding-inline: 0.875rem;
    border: 1px solid var(--color-separator);
    border-radius: 100vmax;
  }
}
.account-content > h1 {
  margin-block-start: 0;
}
.account-section {
  margin-block-start: 2.5rem;
  padding-block-start: 2rem;
  border-block-start: 1px solid var(--color-separator);
  > :is(:heading(2), h2) {
    margin-block-start: 0;
  }
  > .section-note {
    margin-block: 0 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
  }
  > .alert {
    inline-size: auto;
    margin-block-end: 1.25rem;
  }
  > table {
    inline-size: 100%;
  }
}
/* Right under the page's heading, no line above the first section. */
h1 + .account-section {
  margin-block-start: 1.5rem;
  padding-block-start: 0;
  border-block-start: none;
}

.session-browser {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 0.5em;
  > .icon {
    block-size: 1lh;
    inline-size: 1.125em;
    color: var(--color-text-muted);
  }
}
.session-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5em;
  > :first-child {
    white-space: nowrap;
  }
}
.this-browser {
  padding: 0.125rem 0.5rem;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  background: var(--color-hover-active);
  border-radius: 100vmax;
}
.session-passkey {
  grid-column: 2;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.cell-detail {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
@media (width < 48rem) {
  .cell-detail {
    display: inline;
    font-size: inherit;
    &::before {
      content: "\a0· ";
    }
  }
  .session-passkey {
    grid-column: 1 / -1;
  }
}

/* The sign-up page and the passkey help page: their first paragraphs a
   little larger; the help page's choices spaced apart. */
.lead-text {
  max-inline-size: 40rem;
  font-size: 1.0625rem;
  .icon-label {
    font-weight: 500;
  }
}
.passkey-choices {
  display: flex;
  max-inline-size: 40rem;
  padding-inline-start: 1.25rem;
  flex-direction: column;
  gap: 0.5rem;
}
