/* Portal presentation. Kept separate from the shared public landing styles. */
/* Readable type without enlarging every card on wide monitors. */
html.portal-doc { font-size: 112.5%; }

.portal-doc {
  --muted: #626262;
  --border: #dedbd6;
  --tile: #f1efeb;
}
.portal-doc body { line-height: 1.5; }
.portal-doc .app { background: #f7f6f3; }
.portal-doc :where(button, input, a) { -webkit-tap-highlight-color: transparent; }
.portal-doc :where(a, button, input):focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}
.portal-doc button { cursor: pointer; }
.portal-doc button:disabled { cursor: not-allowed; }

/* Shell and navigation */
.portal-doc .sidebar {
  width: 12.5rem;
  padding-bottom: 2rem;
  display: flex;
  flex-direction: column;
}
.portal-doc body:not(.is-authed) .sidebar { display: none; }
.portal-doc .sidebar-logo { padding: 2rem 1.25rem 1rem; }
.portal-doc .sidebar-logo img { width: 100%; max-width: 11rem; }
.portal-doc .sidebar-nav { margin-top: 1rem; }
.portal-doc .nav-item { min-height: 3rem; height: auto; padding: .75rem; }
.portal-doc .nav-item.is-active { box-shadow: none; }
.portal-doc .sidebar-help {
  position: static;
  margin: 2rem 1.5rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid #303030;
}
.portal-doc .help-sm { color: #aaa; }
.portal-doc .topbar {
  min-height: 4.5rem;
  height: auto;
  padding: 1rem 2rem;
  gap: 1rem;
  background: #fff;
  border-bottom-color: var(--border);
}
.portal-doc .topbar-brand { max-width: 45%; height: auto; width: 11rem; }
.portal-doc .topbar-right { min-width: 0; }
.portal-doc .user-badge { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.portal-doc #navUserName { overflow-wrap: anywhere; font-size: .875rem; }
.portal-doc .avatar { flex-shrink: 0; }
.portal-doc .logout-btn-red { min-height: 2.75rem; margin-left: .25rem; font-size: .8125rem; }
.portal-doc .content { width: 100%; max-width: 100rem; margin: 0 auto; padding: 1.25rem 1.5rem; }
.portal-doc .greeting { gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.portal-doc .greeting h1, .portal-doc .section-title { font-size: 2rem; line-height: 1.2; }
.portal-doc .greeting > div > p { font-size: .9375rem; margin-top: .5rem; }
.portal-doc .greeting-meta { gap: .75rem; }
.portal-doc .meta-label { font-size: .75rem; }
.portal-doc .section-title { margin-bottom: 1.5rem; }

/* Cards grow with content; no fixed rows or clipped labels. */
.portal-doc .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: none; gap: 1rem; }
.portal-doc .bento > * { min-width: 0; }
.portal-doc .card { padding: 1.125rem; border-radius: .875rem; }
.portal-doc .card:hover { transform: none; }
.portal-doc .card-points, .portal-doc .card-progress, .portal-doc .card-promo { min-height: 13.5rem; }
.portal-doc .card-points { gap: .5rem; }
.portal-doc .points-value { font-size: 3rem; overflow-wrap: anywhere; }
.portal-doc .points-sub { margin: .25rem 0 1rem; }
.portal-doc .card-progress { display: flex; flex-direction: column; }
.portal-doc .card-progress .btn-ghost { margin-top: auto; align-self: flex-start; }
.portal-doc .card-title { font-size: 1.0625rem; line-height: 1.35; }
.portal-doc .card-head { gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.portal-doc .view-all { font-size: .8125rem; white-space: nowrap; }
.portal-doc .progress-value { overflow-wrap: anywhere; }
.portal-doc .progress-value .muted { display: block; margin: .25rem 0 0; font-size: .875rem; }
.portal-doc .progress-label { font-size: .8125rem; }
.portal-doc .perks { flex-wrap: wrap; gap: .5rem 1rem; margin: .5rem 0 1rem; }
.portal-doc .perks li { font-size: .8125rem; white-space: normal; }
.portal-doc .pill { font-size: .6875rem; letter-spacing: .06em; }
.portal-doc .promo-head { font-size: 1.75rem; margin-bottom: 1.25rem; }
.portal-doc .card-spotlight { min-height: 18rem; }
.portal-doc .card-project { min-height: 15rem; }
.portal-doc .card-project::before { display: none; }
.portal-doc .card-learning { grid-column: span 6; }
.portal-doc .card-project, .portal-doc .card-activity { grid-column: span 3; }
.portal-doc .news li { padding: .875rem 0; }
.portal-doc .news li > div { min-width: 0; }
.portal-doc .news strong, .portal-doc .news span, .portal-doc .mini-link { font-size: .8125rem; }
.portal-doc .lesson-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .875rem; }
.portal-doc .lesson strong { font-size: .9375rem; white-space: normal; padding: .75rem .875rem 0; }
.portal-doc .lesson span { font-size: .8125rem; padding: .25rem .875rem .875rem; }
.portal-doc .activity li { padding: .75rem 0; gap: .5rem; flex-wrap: wrap; }
.portal-doc .activity strong, .portal-doc .act-label, .portal-doc .activity time { font-size: .8125rem; }
.portal-doc .activity time { margin-left: auto; }
.portal-doc .episode-foot { flex-wrap: wrap; gap: .75rem; padding: .875rem; }
.portal-doc .episode-foot span { font-size: .8125rem; }
.portal-doc .banner { grid-column: 1 / -1; min-height: 8rem; border-radius: 1rem; flex-wrap: wrap; gap: 1rem; }
.portal-doc .banner-photo { min-height: 8rem; }
.portal-doc .banner-copy { flex: 1 1 16rem; padding: 1rem; white-space: normal; }
.portal-doc .banner-props { flex-wrap: wrap; padding: 1rem 1.5rem; white-space: normal; }
.portal-doc .banner-copy h2 { font-size: 1.375rem; }

/* Consistent action sizes and secondary sections. */
.portal-doc .btn, .portal-doc .section-pane .reward-item-btn,
.portal-doc .section-pane .btn-complete-challenge {
  min-height: 2.75rem;
  font-size: .875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* The portal theme scales type up and rounds corners further than the shared
   sheet; the marketplace banner follows the reward cards beside it. */
.portal-doc .section-pane .marketplace-cta { border-radius: 1rem; padding: 1.75rem 2rem; }
.portal-doc .section-pane .marketplace-cta-copy h3 { font-size: 1.375rem; }
.portal-doc .section-pane .marketplace-cta-copy p { font-size: .9375rem; line-height: 1.6; }
/* The four category cards are a set of four, not a flowing catalogue: auto-fit
   dropped the fourth onto its own row at common laptop widths, which read as
   an orphan rather than a grid. Fixed counts, halving as the space goes. */
.portal-doc .section-pane .rewards-catalog-grid:has(.reward-cat) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 68rem) {
  .portal-doc .section-pane .rewards-catalog-grid:has(.reward-cat) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 34rem) {
  .portal-doc .section-pane .rewards-catalog-grid:has(.reward-cat) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.portal-doc .section-pane .rewards-catalog-grid,
.portal-doc .section-pane .challenges-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.25rem;
}
.portal-doc .section-pane .reward-item, .portal-doc .section-pane .challenge-card { border-radius: 1rem; padding: 1.5rem; }
.portal-doc .section-pane .reward-item h4, .portal-doc .section-pane .challenge-title { font-family: var(--font-body); font-size: 1.125rem; }
.portal-doc .section-pane .reward-item p, .portal-doc .section-pane .challenge-desc,
.portal-doc .section-sub { font-size: .9375rem; line-height: 1.6; }
.portal-doc .section-pane .section-heading, .portal-doc .section-pane .challenge-header,
.portal-doc .section-pane .reward-item-foot { flex-wrap: wrap; gap: .75rem; }
.portal-doc .section-pane .challenge-points { font-family: var(--font-body); font-size: .75rem; padding: .25rem .5rem; border-radius: .375rem; }
.portal-doc .section-pane .history-item { gap: 1rem; }
.portal-doc .history-details { min-width: 0; overflow-wrap: anywhere; }
.portal-doc .history-points { flex-shrink: 0; }
.portal-doc [data-section="profile"] > .card { max-width: 44rem; }
.portal-doc .profile-list li { gap: 1rem; font-size: .9375rem; }
.portal-doc .profile-list strong { text-align: right; overflow-wrap: anywhere; min-width: 0; }

/* Sign-in and account help */
.portal-doc #authSection { padding: 2rem 0; }
.portal-doc .auth-card { padding: 2rem; border-radius: 1rem; box-shadow: 0 .5rem 2rem #00000008; }
.portal-doc .auth-card > p, .portal-doc .auth-switch { font-size: .9375rem; }
.portal-doc #authSection .form-group label { font-size: .875rem; }
.portal-doc #authSection .form-input { font-size: 1rem; min-height: 3rem; }
.portal-doc #authSection .form-input:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.portal-doc #authSection .btn-primary { min-height: 3rem; font-size: 1rem; }
.portal-doc .password-toggle { width: 2.75rem; height: 2.75rem; right: .125rem; }
.portal-doc .form-actions { gap: .75rem; flex-wrap: wrap; }
.portal-doc .remember-me, .portal-doc .forgot-password { font-size: .875rem; }
.portal-doc .help-modal-backdrop { overflow-y: auto; }
.portal-doc .help-modal-card { max-height: calc(100dvh - 2.5rem); overflow-y: auto; margin: auto; }
.portal-doc .help-modal-close { min-width: 2.75rem; min-height: 2.75rem; flex-shrink: 0; }
.portal-doc .toast-notification { min-width: 0; width: min(24rem, calc(100% - 2rem)); right: 1rem; bottom: 1rem; }
.portal-doc .toast-message span { font-size: .875rem; }

@media (max-width: 85rem) {
  .portal-doc .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-doc .bento > .card { grid-column: span 6; }
  .portal-doc .bento > .card-promo { grid-column: 1 / -1; }
  .portal-doc .content { padding: 1.5rem; }
}

@media (max-width: 60rem) {
  .portal-doc .app { flex-direction: column; }
  .portal-doc .sidebar { width: 100%; padding: .75rem; }
  .portal-doc .sidebar-logo { padding: .5rem .75rem .75rem; }
  .portal-doc .sidebar-logo img { max-width: 10rem; }
  .portal-doc .sidebar-nav { display: flex; overflow-x: auto; margin: 0; gap: .25rem; padding: .25rem; scrollbar-width: thin; scrollbar-color: #555 #171717; }
  .portal-doc .nav-item { flex: 0 0 auto; margin: 0; gap: .5rem; }
  .portal-doc .sidebar-help { margin: .5rem .75rem 0; padding-top: .5rem; }
  .portal-doc .sidebar-help > span { display: flex; align-items: baseline; gap: .5rem; }
  .portal-doc .topbar { padding: .875rem 1.5rem; }
}

@media (max-width: 40rem) {
  html.portal-doc { font-size: 100%; }
  .portal-doc .content { padding: 1.25rem 1rem; }
  .portal-doc .topbar { padding: .75rem 1rem; flex-wrap: wrap; }
  .portal-doc .topbar-brand { max-width: 100%; width: 9rem; }
  .portal-doc .topbar-right { max-width: 100%; }
  .portal-doc .greeting { gap: 1rem; }
  .portal-doc .greeting h1 { font-size: 1.875rem; }
  .portal-doc .bento { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .portal-doc .bento > .card { grid-column: 1 / -1; }
  .portal-doc .card { padding: 1.25rem; }
  .portal-doc .banner-photo { display: none; }
  .portal-doc .banner-copy, .portal-doc .banner-props { padding: 1.25rem; }
  .portal-doc .banner-props { padding-top: 0; }
  .portal-doc #authSection { padding: .5rem 0; }
  .portal-doc .auth-card { padding: 1.5rem; }
  .portal-doc .section-pane .history-ledger { padding: .5rem 1rem; }
  .portal-doc .profile-list li { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .portal-doc .profile-list strong { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-doc *, .portal-doc *::before, .portal-doc *::after { animation: none !important; transition: none !important; }
}

/* Supporting copy should remain readable alongside the display headings. */
.portal-doc .points-sub, .portal-doc .spotlight-sub,
.portal-doc .spotlight-feats li, .portal-doc .news strong,
.portal-doc .news span, .portal-doc .mini-link, .portal-doc .perks li,
.portal-doc .activity strong, .portal-doc .act-label,
.portal-doc .activity time, .portal-doc .empty-row { font-size: .9375rem; }

/* MetalLife uses the same photo, scrim and editorial hierarchy as spotlights. */
.portal-doc .card-metallife {
  display: flex;
  flex-direction: column;
  min-height: 18rem;
  background: #111;
  border-color: transparent;
  color: #fff;
}
.portal-doc .card-metallife::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, #000b 0%, #0007 45%, #0001 100%), linear-gradient(180deg, #0003 0%, #0001 30%, #000b 72%, #000f 100%);
  pointer-events: none;
}
.portal-doc .card-metallife .card-head { position: relative; z-index: 2; align-items: flex-start; }
.portal-doc .card-metallife .card-title {
  margin: 0;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
}
.portal-doc .card-metallife .view-all { color: #fff; padding: .375rem 0; }
.portal-doc .card-metallife .view-all:hover { text-decoration: underline; }
.portal-doc .card-metallife .episode {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
  margin: 3rem 0 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}
.portal-doc .card-metallife .episode > a:first-child { position: absolute; inset: 0; z-index: 0; }
.portal-doc .card-metallife .episode img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: 72% center; }
.portal-doc .card-metallife .episode h3 {
  position: relative;
  z-index: 2;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.875rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.portal-doc .card-metallife .episode-foot {
  position: relative;
  z-index: 2;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: .875rem 0 0;
}
.portal-doc .card-metallife .episode-foot span { color: #e2e2e2; font-size: .875rem; }
.portal-doc .card-metallife .btn-dark { background: var(--red); color: #fff; }
.portal-doc .card-metallife .btn-dark:hover { background: var(--red-dark); }

/* Compact spacing; keep the larger supporting text and comfortable controls. */
.portal-doc .spotlight-head { font-size: 1.875rem; margin-top: .625rem; }
.portal-doc .spotlight-sub { margin-top: .375rem; }
.portal-doc .spotlight-feats { gap: .375rem; margin-top: .75rem; }
.portal-doc .card-spotlight .btn { margin-top: .875rem; }

/* Keep spotlight copy and its action together as one centered block. */
.portal-doc .card-spotlight { justify-content: center; }
.portal-doc .card-spotlight > .spotlight-head { margin-top: .875rem; }
.portal-doc .card-spotlight > .spotlight-sub {
  max-width: 30ch;
  margin-top: .75rem;
  line-height: 1.5;
}
.portal-doc .card-spotlight > .spotlight-feats {
  max-width: 34ch;
  margin-top: 1.125rem;
  gap: .625rem;
}
.portal-doc .card-spotlight .spotlight-feats li { line-height: 1.4; }
.portal-doc .card-spotlight .spotlight-feats .icon { flex-shrink: 0; }
.portal-doc .card-spotlight > .btn { margin-top: 1.5rem; }
.portal-doc .news li { padding: .625rem 0; }
/* A varied editorial grid: summary, feature row, then supporting content.
   Keep native document order so keyboard navigation follows the visual order. */
@media (min-width: 85.001rem) {
  /* Give right-hand cards about 9% more space within the same footprint. */
  .portal-doc .bento { grid-template-columns: repeat(6, minmax(0, 1fr)) repeat(6, minmax(0, 1.2fr)); }
  .portal-doc .card-points, .portal-doc .card-progress, .portal-doc .card-promo { grid-column: span 4; }
  .portal-doc .card-spotlight { grid-column: span 6; }
  .portal-doc .card-list, .portal-doc .card-metallife { grid-column: span 3; }
  .portal-doc .card-learning { grid-column: span 5; }
  .portal-doc .card-project { grid-column: span 4; }
  .portal-doc .card-activity { grid-column: 10 / -1; grid-row: 3 / span 2; }
  .portal-doc .banner { grid-column: 1 / 10; }
  .portal-doc .card-metallife .episode h3 { font-size: 1.625rem; }
  .portal-doc .card-list .news { display: block; }
}
.portal-doc .bento { gap: .875rem; }
.portal-doc .news strong { font-size: .875rem; }
.portal-doc .news span, .portal-doc .mini-link { font-size: .8125rem; }
.portal-doc .news li { padding: .5rem 0; }
.portal-doc .banner { min-height: 6rem; }
.portal-doc .banner-photo { width: 9rem; min-height: 6rem; }
.portal-doc .banner-copy { padding: .75rem; }
.portal-doc .banner-copy h2 { font-size: 1.125rem; }
.portal-doc .banner-props { gap: .75rem; padding: .75rem; }
.portal-doc .banner-props li { gap: .375rem; }
.portal-doc .banner-props .icon { width: 1.25rem; height: 1.25rem; }


@media (min-width: 85.001rem) {
  .portal-doc .progress-value .muted { display: inline; margin-left: .375rem; }
  .portal-doc .card-list .news { line-height: 1.25; }
  .portal-doc .card-list .news li { padding: .4375rem 0; }
  .portal-doc .card-metallife .episode img { object-position: right center; }
}

.portal-doc .metallife-logo { display: block; width: 8rem; max-width: 100%; height: auto; }
