.account-page {
  background: var(--cbcs-surface);
}

.account-topbar {
  display: flex;
  align-items: center;
  min-height: 4.75rem;
  padding: 1rem clamp(1.5rem, 4vw, 3.5rem);
  background: var(--cbcs-surface);
  border-bottom: 1px solid var(--cbcs-line);
}

.account-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--cbcs-ink);
  text-decoration: none;
}

.account-brand img {
  display: block;
  width: 9rem;
  height: auto;
}

.account-brand span {
  padding-left: 1rem;
  color: var(--cbcs-gray);
  border-left: 1px solid var(--cbcs-line-strong);
  font-family: var(--cbcs-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-topnav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
  font-family: var(--cbcs-display);
  font-size: 0.82rem;
  font-weight: 600;
}

.account-topnav a {
  color: var(--cbcs-gray);
  text-decoration: none;
}

.account-topnav a:hover {
  color: var(--cbcs-red);
}

.app-container {
  display: flex;
  min-height: calc(100vh - 4.75rem - 3px);
  background: var(--cbcs-surface);
}

.main-nav {
  position: static;
  width: 18rem;
  min-width: 18rem;
  min-height: auto;
  /* Upstream sets an explicit height on this element (it is positioned
     absolutely by default, which we undo above). Left as-is, the sidebar sized
     itself to its four links and stopped, so its canvas background cut off
     partway down and the rest of the column fell back to white. That is the
     "nav menu is truncated" Casey Kieler reported on /settings. height:auto
     lets the flex parent stretch it to the full page. Measured, not assumed:
     338px before, 1418px (the container's full height) after. */
  height: auto;
  padding: 2.5rem 1.5rem;
  background: var(--cbcs-canvas);
  border-right: 1px solid var(--cbcs-line);
}

/* The nav's title element. Upstream renders it with its own accent colour
   (#3d53f5), which is the stray blue "Account Settings" above the links: our
   brand never claimed this element, so it kept the vendor default. Matches the
   topbar eyebrow instead. Selected structurally rather than by upstream's
   hashed class name, which changes whenever the vendored image is rebuilt. */
.main-nav > div {
  color: var(--cbcs-gray);
  font-family: var(--cbcs-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-menu-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--cbcs-ink);
  background: var(--cbcs-surface);
  border: 1px solid var(--cbcs-line-strong);
  border-radius: 0.25rem;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}

.account-menu-toggle:focus-visible {
  outline: 2px solid var(--cbcs-red-deep);
  outline-offset: 3px;
}

.container {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: min(100%, 78rem);
  height: auto;
  margin: 0;
  padding: clamp(2.5rem, 6vw, 5rem);
  gap: 2.5rem;
}

.content {
  width: 100%;
  max-width: 72rem;
}

.wrap-content {
  display: flex;
  flex-flow: row wrap;
}

.traits-box,
.session-code-box {
  max-width: calc(50% - 1rem);
}

.traits-box {
  display: flex;
  flex: 1 1 auto;
  padding: 0;
}

.traits-box-divider {
  border-top: 1px solid var(--cbcs-line);
}

.session-code-box {
  display: flex;
  flex: 1 1 auto;
}

.portal-intro {
  max-width: 47rem;
}

.portal-intro + .spacing-32 {
  margin-top: 2rem;
}

.portal-intro h1,
.session-heading {
  font-size: clamp(2.5rem, 5vw, 4.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.portal-intro > p:last-child,
.session-lede {
  max-width: 62ch;
  margin-top: 1.5rem;
  color: var(--cbcs-gray);
  font-size: 1.05rem;
  line-height: 1.75;
}

.portal-actions {
  max-width: 48rem;
  margin-top: clamp(3rem, 7vw, 5rem);
  border-bottom: 1px solid var(--cbcs-line-strong);
}

.portal-action {
  display: block;
  padding: 1.5rem 0;
  color: var(--cbcs-ink);
  border-top: 1px solid var(--cbcs-line-strong);
  text-decoration: none;
}

.portal-action:hover {
  color: var(--cbcs-red-deep);
}

.portal-action strong {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--cbcs-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.portal-action span {
  color: var(--cbcs-gray);
  font-size: 0.9rem;
  line-height: 1.55;
}

.session-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0;
  max-width: 64rem;
  margin-top: 3rem;
  border-top: 1px solid var(--cbcs-line-strong);
  border-left: 1px solid var(--cbcs-line-strong);
}

.session-detail {
  min-width: 0;
  padding: 1.25rem;
  border-right: 1px solid var(--cbcs-line-strong);
  border-bottom: 1px solid var(--cbcs-line-strong);
}

.session-detail dt {
  color: var(--cbcs-gray);
  font-family: var(--cbcs-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.session-detail dd {
  margin: 0.4rem 0 0;
  overflow-wrap: anywhere;
  color: var(--cbcs-ink);
  font-size: 0.9rem;
  line-height: 1.55;
}

body::before {
  display: none;
  visibility: hidden;
}

@media (max-width: 48rem) {
  .account-menu-toggle {
    display: block;
  }

  .main-nav > ul {
    min-height: 0;
  }

  .account-topbar {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .account-topnav {
    width: 100%;
    margin-left: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--cbcs-line);
  }

  .app-container {
    flex-direction: column;
  }

  .main-nav {
    position: static;
    width: 100%;
    min-width: 0;
    padding: 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--cbcs-line);
  }

  .container {
    width: 100%;
    padding: clamp(2rem, 8vw, 3.5rem) clamp(1.5rem, 6vw, 3rem);
  }

  .session-code-box,
  .traits-box {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 30rem) {
  .account-brand img {
    width: 7.75rem;
  }

  .account-brand span {
    font-size: 0.64rem;
  }

  .account-topnav {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
}

.account-next {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--cbcs-surface);
  border: 1px solid var(--cbcs-line-strong);
  border-left: 4px solid var(--cbcs-success);
}

.account-next[hidden] {
  display: none;
}

.account-next p {
  margin: 0 0 1rem;
}

.account-next-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  background: var(--cbcs-red);
  color: var(--cbcs-surface);
  font-family: var(--cbcs-display);
  font-weight: 600;
  text-decoration: none;
}

.account-next-button:hover {
  background: var(--cbcs-red-deep);
  color: var(--cbcs-surface);
}

#password-intro {
  max-width: 62ch;
  margin-top: 1rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.account-next:focus {
  outline: none;
}

.account-inline-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  color: #780707;
  background: var(--cbcs-red-tint);
  border: 1px solid #efbcbc;
}
