/* First Bay private portal — aligned with adastrac.com glass + mode rail; scoped to .fb-portal-page */

.fb-skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fb-skip:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: #262d35;
  border: 1px solid #4a5560;
  border-radius: 8px;
  z-index: 100;
  color: #eee8de;
  font-size: 14px;
  font-family: inherit;
}

html[data-theme="light"] .fb-skip:focus {
  background: #fff;
  border-color: #c4ccd6;
  color: #1f2227;
}

.fb-portal-page {
  --fb-radius-plate: 10px;
  --fb-accent: #4d6b7a;
  --fb-accent-soft: #93afc2;
}

html[data-theme="fun"] .fb-portal-page {
  --fb-radius-plate: 12px;
}

/* Header radius tokens — same as public index.html */
:root {
  color-scheme: light;
  --radius-rail: 14px;
  --radius-plate: 12px;
  --radius-field: 10px;
  --radius-control: 9px;
}

html[data-theme="dark"],
html[data-theme="light"] {
  --radius-rail: 10px;
  --radius-plate: 0px;
  --radius-field: 2px;
  --radius-control: 0px;
}

html[data-theme="fun"] {
  color-scheme: dark;
  --radius-rail: 18px;
  --radius-plate: 14px;
  --radius-field: 12px;
  --radius-control: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ----- Layout & body (portal pages only) ----- */

html {
  scroll-behavior: smooth;
  scroll-padding-top: clamp(104px, 18vh, 152px);
}

body.fb-portal-page {
  margin: 0;
  min-height: 100svh;
  font-family: Inter, "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 15px;
  position: relative;
  overflow-x: clip;
}

body.fb-portal-page.fb-login-body {
  display: flex;
  flex-direction: column;
}

.fb-login-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

html[data-theme="dark"] body.fb-portal-page {
  color-scheme: dark;
  background: #1b1f24;
  color: #c7ced6;
}

html[data-theme="light"] body.fb-portal-page {
  color-scheme: light;
  background: #e6eaee;
  color: #3f4650;
}

html[data-theme="fun"] body.fb-portal-page {
  color-scheme: dark;
  background: linear-gradient(180deg, #070b14 0%, #0b1020 45%, #070a14 100%);
  color: #d0d8e0;
}

/* Restrained fun: subtle starfield */
html[data-theme="fun"] body.fb-portal-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background:
    radial-gradient(circle at 20% 18%, rgba(100, 160, 255, 0.14), transparent 42%),
    radial-gradient(circle at 78% 12%, rgba(180, 120, 255, 0.1), transparent 44%),
    radial-gradient(circle at 70% 80%, rgba(0, 200, 220, 0.08), transparent 46%);
}

html[data-theme="fun"] body.fb-portal-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.14;
  background-image:
    radial-gradient(1.2px 1.2px at 20% 30%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(200, 230, 255, 0.45), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.35), transparent);
  background-size: 200px 200px, 260px 260px, 180px 180px;
  animation: fb-portal-star-drift 48s linear infinite;
}

@keyframes fb-portal-star-drift {
  to {
    transform: translate3d(-24px, -12px, 0);
  }
}

.fb-portal-main {
  position: relative;
  z-index: 1;
}

a.fb-portal-textlink {
  color: var(--fb-accent-soft);
  text-decoration: none;
}
a.fb-portal-textlink:hover {
  color: #b5cad8;
}

html[data-theme="light"] a.fb-portal-textlink {
  color: #4d6b7a;
}
html[data-theme="light"] a.fb-portal-textlink:hover {
  color: #3a5566;
}

/* ----- Site header (mirrors public index.html; scoped to .fb-portal-page) ----- */

@keyframes fbShootingStar {
  0%,
  74%,
  100% {
    opacity: 0;
    transform: translate3d(-12vw, 0, 0);
  }
  78% {
    opacity: 0.55;
  }
  86% {
    opacity: 0;
    transform: translate3d(22vw, 22px, 0);
  }
}

@keyframes fbLogoSparkle {
  0%,
  82%,
  100% {
    opacity: 0;
    transform: scale(0.7);
  }
  10%,
  14% {
    opacity: 1;
    transform: scale(1);
  }
  42%,
  46% {
    opacity: 0.7;
    transform: scale(0.85);
  }
}

@keyframes fbLockupSparkle {
  0%,
  86%,
  100% {
    opacity: 0;
    transform: scale(0.75);
  }
  8%,
  13% {
    opacity: 0.92;
    transform: scale(1);
  }
  44%,
  49% {
    opacity: 0.62;
    transform: scale(0.9);
  }
}

@keyframes fbOriginBreath {
  0%,
  100% {
    box-shadow: 0 8px 18px rgba(22, 38, 106, 0.24);
  }
  50% {
    box-shadow: 0 8px 22px rgba(58, 102, 255, 0.34);
  }
}

@keyframes fbPhrasePulse {
  0%,
  100% {
    text-shadow: 0 0 9px rgba(121, 214, 255, 0.18);
  }
  50% {
    text-shadow: 0 0 13px rgba(165, 214, 255, 0.34);
  }
}

.fb-portal-page .site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 16px;
  background: transparent;
}

.fb-portal-page .header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.fb-portal-page .header-bars {
  display: grid;
  gap: 10px;
  align-items: center;
}

.fb-portal-page .glass-bar {
  position: relative;
  width: calc(100vw + 160px);
  margin-left: calc(50% - 50vw - 80px);
  border-radius: var(--radius-rail);
  border: 1px solid rgba(229, 225, 216, 0.9);
  background: rgba(250, 247, 242, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 18px 54px rgba(20, 18, 14, 0.05);
}

html[data-theme="light"] .fb-portal-page .glass-bar {
  background: rgba(230, 234, 238, 0.66);
  border-color: rgba(212, 218, 226, 0.92);
}

html[data-theme="light"] .fb-portal-page .brand-lockup-mask {
  background-color: #1f2227;
}

.fb-portal-page .glass-bar.top-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

.fb-portal-page .glass-bar.controls-bar {
  padding: 7px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-portal-page .header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.fb-portal-page .brand-lockup-unit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0 clamp(8px, 3vw, 24px);
}

.fb-portal-page .brand-lockup-mask {
  display: block;
  height: var(--header-lockup-height, 56px);
  width: auto;
  aspect-ratio: 232.2 / 67.32;
  max-width: 100%;
  flex-shrink: 0;
  background-color: #1f2227;
  -webkit-mask-image: url("/assets/brand/ad-astra-connect-lockup-horizontal.svg");
  mask-image: url("/assets/brand/ad-astra-connect-lockup-horizontal.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.fb-portal-page .header-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  position: relative;
}

.fb-portal-page .header-controls.fb-portal-header-controls {
  width: 100%;
  max-width: min(calc(100vw - 32px), 920px);
  padding: 4px clamp(12px, 3vw, 20px);
  box-sizing: border-box;
}

.fb-portal-page .header-controls.fb-portal-header-controls--login {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.fb-portal-page .header-controls.fb-portal-header-controls--auth {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  column-gap: 6px;
  position: relative;
}

.fb-portal-page .fb-portal-theme-cluster {
  justify-self: center;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.fb-portal-page .fb-portal-theme-cluster--solo {
  flex: 1;
  justify-content: center;
}

/* TODO: Add Polaris Origin Easter egg for Fun mode. */

/* ----- Glass instrument panel: icon toggles (nav + account) ----- */

.fb-portal-page .fb-portal-glass-icon {
  box-sizing: border-box;
  width: 40px;
  height: 34px;
  margin: 0;
  padding: 0;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(90, 95, 102, 0.92);
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.22),
    inset 0 -1px 1px rgba(0, 0, 0, 0.06);
  transition:
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.fb-portal-page .fb-portal-glass-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #1f2227;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.32),
    inset 0 -1px 1px rgba(0, 0, 0, 0.05);
}

.fb-portal-page .fb-portal-glass-icon:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.22),
    0 0 0 2px rgba(77, 107, 122, 0.35);
}

.fb-portal-page .fb-portal-glass-icon__hamburger,
.fb-portal-page .fb-portal-glass-icon__hamburger::before,
.fb-portal-page .fb-portal-glass-icon__hamburger::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  position: relative;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.fb-portal-page .fb-portal-glass-icon__hamburger::before,
.fb-portal-page .fb-portal-glass-icon__hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.fb-portal-page .fb-portal-glass-icon__hamburger::before {
  top: -5px;
}

.fb-portal-page .fb-portal-glass-icon__hamburger::after {
  top: 5px;
}

.fb-portal-page .fb-portal-glass-icon__user {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.9;
  box-sizing: border-box;
}

.fb-portal-page .fb-portal-glass-icon__user::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.85;
}

.fb-portal-page .fb-portal-glass-icon__user::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 5px;
  border-radius: 8px 8px 0 0;
  border: 1.5px solid currentColor;
  border-bottom: none;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.72;
  box-sizing: border-box;
}

/* ----- Slide-out drawers + scrim ----- */

.fb-portal-page.fb-portal-drawer-open {
  overflow: hidden;
}

.fb-portal-page .fb-portal-drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.fb-portal-page .fb-portal-drawer-layer[data-open] {
  pointer-events: auto;
}

.fb-portal-page .fb-portal-drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.38);
  opacity: 0;
  transition: opacity 0.28s ease;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  font: 0/0 a;
  color: transparent;
}

.fb-portal-page .fb-portal-drawer-scrim:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(126, 154, 173, 0.45);
}

.fb-portal-page .fb-portal-drawer-layer[data-open] .fb-portal-drawer-scrim {
  opacity: 1;
}

.fb-portal-page .fb-portal-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(300px, 88vw);
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-sizing: border-box;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.fb-portal-page .fb-portal-drawer--nav {
  left: 0;
  transform: translate3d(-100%, 0, 0);
}

.fb-portal-page .fb-portal-drawer--account {
  right: 0;
  left: auto;
  transform: translate3d(100%, 0, 0);
}

.fb-portal-page .fb-portal-drawer-layer[data-open="nav"] .fb-portal-drawer--nav,
.fb-portal-page .fb-portal-drawer-layer[data-open="account"] .fb-portal-drawer--account {
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.fb-portal-page .fb-portal-drawer-surface {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(250, 247, 242, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    8px 0 28px rgba(12, 14, 20, 0.12);
}

.fb-portal-page .fb-portal-drawer--account .fb-portal-drawer-surface {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    -8px 0 28px rgba(12, 14, 20, 0.12);
}

.fb-portal-page .fb-portal-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fb-portal-page .fb-portal-drawer-title {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a5f66;
}

.fb-portal-page .fb-portal-drawer-close {
  margin: 0;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-control);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a5f66;
  background: rgba(0, 0, 0, 0.04);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background 0.18s ease, color 0.18s ease;
}

.fb-portal-page .fb-portal-drawer-close:hover {
  background: rgba(0, 0, 0, 0.07);
  color: #1f2227;
}

.fb-portal-page .fb-portal-drawer-close:focus-visible {
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 2px rgba(77, 107, 122, 0.28);
}

.fb-portal-page .fb-portal-drawer-body {
  padding: 10px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fb-portal-page .fb-portal-drawer-link {
  display: block;
  padding: 11px 12px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: #1f2227;
  transition: background 0.18s ease, color 0.18s ease;
}

.fb-portal-page .fb-portal-drawer-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

.fb-portal-page .fb-portal-drawer-link--logout {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 600;
  color: #3a424c;
}

.fb-portal-page .fb-portal-drawer-link--logout:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1f2227;
}

.fb-portal-page .fb-portal-drawer-group {
  padding: 6px 0 8px;
}

.fb-portal-page .fb-portal-drawer-group-label {
  padding: 6px 12px 4px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #7a828c;
}

.fb-portal-page .fb-portal-drawer-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fb-portal-page .fb-portal-drawer-sublist li {
  margin: 0;
}

.fb-portal-page .fb-portal-drawer-sublink {
  display: block;
  padding: 9px 12px 9px 20px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: #2e333a;
  transition: background 0.18s ease;
}

.fb-portal-page .fb-portal-drawer-sublink:hover {
  background: rgba(0, 0, 0, 0.05);
}

.fb-portal-page .fb-portal-drawer-ghost {
  padding: 11px 12px;
  border-radius: var(--radius-control);
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0.48;
  pointer-events: none;
}

.fb-portal-page .fb-portal-drawer-ghost-title {
  font-size: 14px;
  font-weight: 500;
  color: #3f4650;
  letter-spacing: -0.01em;
}

.fb-portal-page .fb-portal-drawer-ghost-meta {
  font-size: 12px;
  font-weight: 500;
  color: #7a828c;
}

@media (prefers-reduced-motion: reduce) {
  .fb-portal-page .fb-portal-drawer,
  .fb-portal-page .fb-portal-drawer-scrim {
    transition-duration: 0.01ms !important;
  }
}

.fb-portal-page .mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  width: 78px;
  padding: 0 10px;
  border: 1px solid rgba(229, 225, 216, 0.85);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.46);
  color: #5a5f66;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    border-radius 0.35s ease,
    opacity 0.28s ease,
    visibility 0s linear 0.28s,
    filter 0.35s ease;
  touch-action: manipulation;
  font-family: inherit;
}

a.mode-option.mode-portal-blade {
  text-decoration: none;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.fb-portal-page .mode-origin {
  display: inline-flex;
  width: 78px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(2px) scale(0.98);
  filter: blur(6px);
}

.fb-portal-page .mode-option:hover {
  color: #1f2227;
}

.fb-portal-page .mode-option.is-active {
  background: rgba(77, 107, 122, 0.16);
  border-color: rgba(77, 107, 122, 0.25);
  color: #1f2227;
}

.fb-portal-page .mode-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 107, 122, 0.2);
}

.fb-portal-page .header-controls.origin-open .origin-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.fb-portal-page .origin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.fb-portal-page .origin-panel h3 {
  font-size: 13px;
  font-weight: 600;
  color: #f4f8ff;
  letter-spacing: -0.01em;
}

.fb-portal-page .origin-close {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(153, 206, 255, 0.42);
  background: rgba(20, 34, 72, 0.72);
  color: #d8ebff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  font-family: inherit;
}

.fb-portal-page .origin-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(133, 219, 255, 0.32);
}

.fb-portal-page .origin-panel p {
  font-size: 14px;
  line-height: 1.65;
  color: inherit;
}

.fb-portal-page .origin-phrase {
  font-style: italic;
  font-weight: 700;
  color: #c9e9ff;
  letter-spacing: 0.01em;
  text-shadow: 0 0 10px rgba(121, 214, 255, 0.2);
  animation: fbPhrasePulse 4.8s ease-in-out infinite;
}

.fb-portal-page .origin-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(92vw, 400px);
  padding: 13px 14px;
  border-radius: calc(var(--radius-plate) + 10px);
  border: 1px solid rgba(122, 186, 255, 0.38);
  background:
    linear-gradient(140deg, rgba(86, 119, 255, 0.17), rgba(35, 214, 255, 0.11)),
    rgba(14, 20, 50, 0.9);
  color: #e8f0ff;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0s linear 0.22s;
  box-shadow: 0 16px 34px rgba(10, 14, 42, 0.44);
  max-width: calc(100vw - 32px);
  max-height: min(62vh, 460px);
  overflow: auto;
  box-sizing: border-box;
}

/* Authenticated pages: partner line below lockup, homepage spacing preserved */
.fb-portal-page .fb-portal-brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.fb-portal-page .fb-portal-brand-stack .header-brand {
  margin: 0 auto;
}

.fb-portal-page .fb-portal-client-line {
  margin: 0;
  padding: 0 clamp(8px, 3vw, 24px);
  font-size: clamp(11px, 2.6vw, 13px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: center;
  color: #1f2227;
  max-width: min(36ch, 100%);
}

.fb-portal-page .fb-portal-client-line-multiply {
  font-weight: 500;
  opacity: 0.72;
  margin-right: 0.35em;
}

html[data-theme="dark"] .fb-portal-page .fb-portal-client-line {
  color: #eee8de;
}

html[data-theme="dark"] .fb-portal-page .fb-portal-client-line-multiply {
  color: #93afc2;
  opacity: 0.95;
}

html[data-theme="fun"] .fb-portal-page .fb-portal-client-line {
  color: #e8eef8;
}

html[data-theme="fun"] .fb-portal-page .fb-portal-client-line-multiply {
  color: #9dc0d2;
  opacity: 0.9;
}

html[data-theme="light"] .fb-portal-page .fb-portal-client-line-multiply {
  color: #4d6b7a;
  opacity: 0.85;
}

/* Authenticated bar: Ad Astra lockup × First Bay wordmark (single row) */
.fb-portal-page .fb-portal-brand-stack--dual {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2.2vw, 14px);
  max-width: 100%;
}

.fb-portal-page .fb-portal-brand-stack--dual .header-brand {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.fb-portal-page .fb-portal-brand-stack--dual .brand-lockup-unit {
  padding: 0 clamp(2px, 1.2vw, 12px) 0 0;
}

.fb-portal-page .fb-portal-brand-cross {
  flex: 0 0 auto;
  font-weight: 500;
  opacity: 0.72;
  font-size: clamp(13px, 3.2vw, 17px);
  line-height: 1;
  color: #4d6b7a;
  user-select: none;
}

html[data-theme="dark"] .fb-portal-page .fb-portal-brand-cross {
  color: #93afc2;
  opacity: 0.95;
}

html[data-theme="fun"] .fb-portal-page .fb-portal-brand-cross {
  color: #9dc0d2;
  opacity: 0.9;
}

html[data-theme="light"] .fb-portal-page .fb-portal-brand-cross {
  color: #4d6b7a;
  opacity: 0.85;
}

.fb-portal-page .fb-portal-partner-mark {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  line-height: 0;
}

.fb-portal-page .fb-portal-partner-wordmark {
  display: block;
  height: clamp(20px, 4.8vw, 32px);
  width: auto;
  max-width: min(44vw, 200px);
  object-fit: contain;
}

html[data-theme="dark"] .fb-portal-page .fb-portal-partner-wordmark,
html[data-theme="fun"] .fb-portal-page .fb-portal-partner-wordmark {
  filter: brightness(0) invert(1);
}

html[data-theme="light"] .fb-portal-page .fb-portal-partner-wordmark {
  filter: none;
}

@media (max-width: 400px) {
  .fb-portal-page .fb-portal-brand-stack--dual {
    gap: clamp(4px, 1.5vw, 8px);
    --header-lockup-height: clamp(40px, 10vw, 52px);
  }

  .fb-portal-page .fb-portal-partner-wordmark {
    max-width: min(36vw, 148px);
    height: clamp(17px, 4.2vw, 26px);
  }
}

@media (max-width: 340px) {
  .fb-portal-page .fb-portal-brand-stack--dual {
    gap: 4px;
    --header-lockup-height: clamp(36px, 9.5vw, 48px);
  }

  .fb-portal-page .fb-portal-partner-wordmark {
    max-width: min(34vw, 132px);
    height: clamp(15px, 4vw, 24px);
  }
}

/* Logout: same blade geometry, slightly quieter (not alarming) */
.fb-portal-page .mode-option--logout {
  opacity: 0.92;
  border-color: rgba(229, 225, 216, 0.55);
}

html[data-theme="dark"] .fb-portal-page .site-header {
  background: transparent;
}

html[data-theme="dark"] .fb-portal-page .glass-bar {
  border-color: rgba(47, 53, 60, 0.9);
  background: rgba(27, 31, 36, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 22px 66px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .fb-portal-page .brand-lockup-mask {
  background-color: #eee8de;
}

html[data-theme="dark"] .fb-portal-page .mode-rail {
  gap: 5px;
}

html[data-theme="dark"] .fb-portal-page .mode-option {
  color: #d8d2c8;
  border-color: #414b54;
  background: rgba(36, 42, 49, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .fb-portal-page .mode-option:hover {
  color: #eee8de;
}

html[data-theme="dark"] .fb-portal-page .mode-option.is-active {
  border-color: rgba(126, 154, 173, 0.38);
  background: rgba(126, 154, 173, 0.2);
  color: #f2eee8;
}

html[data-theme="dark"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option {
  color: rgba(238, 232, 222, 0.82);
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    inset 0 -1px 1px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option:hover {
  color: #f2eee8;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option.is-active {
  color: #fbfaf7;
  border-color: rgba(172, 196, 212, 0.28);
  background: rgba(126, 154, 173, 0.14);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.12),
    inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.12),
    inset 0 -1px 1px rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(126, 154, 173, 0.45);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-glass-icon {
  color: rgba(238, 232, 222, 0.78);
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.09),
    inset 0 -1px 1px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-glass-icon:hover {
  color: #f2eee8;
  background: rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.14),
    inset 0 -1px 1px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-glass-icon:focus-visible {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 0 0 2px rgba(126, 154, 173, 0.45);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-scrim {
  background: rgba(2, 4, 8, 0.52);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-surface {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(20, 24, 30, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    10px 0 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer--account .fb-portal-drawer-surface {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    -10px 0 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-head {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-title {
  color: rgba(220, 214, 204, 0.72);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-close {
  color: rgba(220, 214, 204, 0.75);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-close:hover {
  color: #eee8de;
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-link {
  color: #e4ddd4;
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-sublink {
  color: rgba(220, 214, 204, 0.88);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-sublink:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-group-label {
  color: rgba(180, 188, 198, 0.55);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-link--logout {
  border-top-color: rgba(255, 255, 255, 0.08);
  color: rgba(232, 226, 216, 0.88);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-link--logout:hover {
  color: #f2eee8;
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-ghost-title {
  color: rgba(210, 206, 198, 0.55);
}

html[data-theme="dark"] .fb-portal-page .fb-portal-drawer-ghost-meta {
  color: rgba(160, 168, 178, 0.45);
}

html[data-theme="fun"] .fb-portal-page .site-header::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(135deg, transparent 58%, rgba(160, 220, 255, 0.22) 62%, rgba(255, 210, 240, 0.08) 66%, transparent 70%);
  opacity: 0;
  transform: translate3d(-12vw, 0, 0);
  animation: fbShootingStar 18s ease-in-out infinite;
}

html[data-theme="fun"] .fb-portal-page .site-header {
  background: transparent;
}

html[data-theme="fun"] .fb-portal-page .glass-bar {
  border-color: rgba(120, 152, 255, 0.32);
  background: rgba(18, 20, 46, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 66px rgba(10, 12, 32, 0.34);
}

html[data-theme="fun"] .fb-portal-page .brand-lockup-mask {
  background-color: #f6f7ff;
}

html[data-theme="fun"] .fb-portal-page .brand-lockup-unit {
  filter: drop-shadow(0 0 14px rgba(137, 175, 255, 0.32));
}

html[data-theme="fun"] .fb-portal-page .brand-lockup-unit::before,
html[data-theme="fun"] .fb-portal-page .brand-lockup-unit::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0;
  z-index: 1;
}

html[data-theme="fun"] .fb-portal-page .brand-lockup-unit::before {
  width: 4px;
  height: 4px;
  top: 16%;
  left: 14%;
  background: #b6e6ff;
  box-shadow:
    12px 14px 0 0 rgba(255, 197, 245, 0.9),
    20px 2px 0 0 rgba(133, 219, 255, 0.9),
    26px 26px 0 0 rgba(255, 229, 170, 0.84),
    6px 30px 0 0 rgba(157, 217, 255, 0.68);
  animation: fbLogoSparkle 4.2s ease-in-out infinite;
}

html[data-theme="fun"] .fb-portal-page .brand-lockup-unit::after {
  width: 3px;
  height: 3px;
  top: 8%;
  right: 14%;
  background: rgba(185, 232, 255, 0.95);
  box-shadow:
    -22px 16px 0 0 rgba(255, 196, 240, 0.78),
    -8px 30px 0 0 rgba(133, 219, 255, 0.82),
    -34px 24px 0 0 rgba(190, 234, 255, 0.52);
  animation: fbLockupSparkle 5.8s ease-in-out 0.35s infinite;
}

html[data-theme="fun"] .fb-portal-page .origin-panel {
  border-color: rgba(121, 214, 255, 0.34);
  background:
    linear-gradient(160deg, rgba(0, 210, 255, 0.16), rgba(84, 126, 255, 0.18), rgba(255, 78, 170, 0.1)),
    rgba(6, 10, 26, 0.9);
  box-shadow: 0 18px 44px rgba(6, 10, 30, 0.56);
}

html[data-theme="fun"] .fb-portal-page .mode-origin {
  color: #eff4ff;
  border-color: rgba(143, 201, 255, 0.48);
  background: linear-gradient(120deg, rgba(84, 126, 255, 0.45), rgba(193, 88, 255, 0.34));
  box-shadow: 0 8px 18px rgba(22, 38, 106, 0.28);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    opacity 0.42s ease,
    filter 0.42s ease,
    transform 0.42s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  animation: fbOriginBreath 3.8s ease-in-out infinite;
}

html[data-theme="fun"] .fb-portal-page .mode-origin:hover {
  border-color: rgba(171, 222, 255, 0.7);
  background: linear-gradient(120deg, rgba(98, 139, 255, 0.5), rgba(202, 96, 255, 0.38));
}

html[data-theme="fun"] .fb-portal-page .mode-rail {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

html[data-theme="fun"] .fb-portal-page .mode-option {
  color: rgba(236, 242, 255, 0.9);
  border-color: rgba(143, 201, 255, 0.28);
  background: rgba(24, 30, 72, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(135, 170, 255, 0.08);
}

html[data-theme="fun"] .fb-portal-page .mode-option.is-active {
  border-color: rgba(121, 214, 255, 0.55);
  background: linear-gradient(120deg, rgba(0, 192, 255, 0.42), rgba(84, 126, 255, 0.52), rgba(193, 88, 255, 0.4));
  color: #fbfbff;
  box-shadow: 0 10px 22px rgba(40, 98, 255, 0.22);
}

html[data-theme="fun"] .fb-portal-page .mode-option:focus-visible {
  box-shadow: 0 0 0 3px rgba(102, 194, 255, 0.34);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option {
  color: rgba(240, 244, 255, 0.88);
  border-color: rgba(143, 201, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    inset 0 -1px 1px rgba(0, 0, 0, 0.25),
    0 0 14px rgba(90, 140, 255, 0.05);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option:hover {
  border-color: rgba(171, 222, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option.is-active {
  color: #fbfbff;
  border-color: rgba(121, 214, 255, 0.36);
  background: rgba(84, 126, 255, 0.12);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.12),
    inset 0 -1px 1px rgba(0, 0, 0, 0.2),
    0 0 18px rgba(80, 150, 255, 0.12);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.12),
    inset 0 -1px 1px rgba(0, 0, 0, 0.2),
    0 0 0 2px rgba(102, 194, 255, 0.38);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-glass-icon {
  color: rgba(240, 244, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.12),
    inset 0 -1px 1px rgba(0, 0, 0, 0.28),
    0 0 12px rgba(100, 160, 255, 0.06);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-glass-icon:hover {
  color: #fbfbff;
  background: rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.16),
    inset 0 -1px 1px rgba(0, 0, 0, 0.22),
    0 0 16px rgba(120, 180, 255, 0.1);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-glass-icon:focus-visible {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.12),
    0 0 0 2px rgba(102, 194, 255, 0.38);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-scrim {
  background: rgba(4, 6, 18, 0.48);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-surface {
  border-color: rgba(130, 170, 255, 0.18);
  background: rgba(14, 16, 38, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    10px 0 40px rgba(10, 14, 40, 0.55);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer--account .fb-portal-drawer-surface {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    -10px 0 40px rgba(10, 14, 40, 0.55);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-head {
  border-bottom-color: rgba(130, 170, 255, 0.12);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-title {
  color: rgba(210, 224, 255, 0.65);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-close {
  color: rgba(220, 230, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-close:hover {
  color: #fbfbff;
  background: rgba(255, 255, 255, 0.09);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-link {
  color: rgba(236, 242, 255, 0.92);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-sublink {
  color: rgba(224, 232, 255, 0.88);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-sublink:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-group-label {
  color: rgba(160, 190, 230, 0.55);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-link--logout {
  border-top-color: rgba(130, 170, 255, 0.15);
  color: rgba(240, 244, 255, 0.88);
}

html[data-theme="fun"] .fb-portal-page .fb-portal-drawer-link--logout:hover {
  color: #fbfbff;
}

html[data-theme="dark"] .fb-portal-page .mode-option.mode-option--logout {
  border-color: rgba(65, 75, 84, 0.62);
  color: rgba(216, 210, 200, 0.88);
  background: rgba(36, 42, 49, 0.52);
}

html[data-theme="dark"] .fb-portal-page .mode-option.mode-option--logout:hover {
  color: #eee8de;
  border-color: rgba(126, 154, 173, 0.32);
  background: rgba(36, 42, 49, 0.68);
}

html[data-theme="light"] .fb-portal-page .mode-option.mode-option--logout {
  border-color: rgba(200, 208, 218, 0.72);
  color: rgba(90, 95, 102, 0.88);
  background: rgba(255, 255, 255, 0.38);
}

html[data-theme="light"] .fb-portal-page .mode-option.mode-option--logout:hover {
  color: #1f2227;
  border-color: rgba(77, 107, 122, 0.32);
}

html[data-theme="light"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option {
  color: #4a5058;
  border-color: rgba(0, 0, 0, 0.07);
  background: rgba(0, 0, 0, 0.025);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.75),
    inset 0 -1px 1px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option:hover {
  color: #1f2227;
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option.is-active {
  color: #1f2227;
  border-color: rgba(77, 107, 122, 0.22);
  background: rgba(77, 107, 122, 0.08);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.85),
    inset 0 -1px 1px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .fb-portal-page .fb-portal-header-controls .mode-rail--theme-only > .mode-option:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.85),
    inset 0 -1px 1px rgba(0, 0, 0, 0.04),
    0 0 0 2px rgba(77, 107, 122, 0.28);
}

html[data-theme="light"] .fb-portal-page .fb-portal-glass-icon {
  color: #4a5058;
  background: rgba(0, 0, 0, 0.03);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.75),
    inset 0 -1px 1px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .fb-portal-page .fb-portal-glass-icon:hover {
  color: #1f2227;
  background: rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .fb-portal-page .fb-portal-glass-icon:focus-visible {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 0 0 2px rgba(77, 107, 122, 0.28);
}

html[data-theme="light"] .fb-portal-page .fb-portal-drawer-scrim {
  background: rgba(16, 18, 22, 0.32);
}

html[data-theme="light"] .fb-portal-page .fb-portal-drawer-surface {
  border-color: rgba(0, 0, 0, 0.07);
  background: rgba(252, 252, 254, 0.94);
}

html[data-theme="light"] .fb-portal-page .fb-portal-drawer-head {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="fun"] .fb-portal-page .mode-option.mode-option--logout {
  border-color: rgba(143, 201, 255, 0.22);
  color: rgba(236, 242, 255, 0.82);
  background: rgba(24, 30, 72, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(135, 170, 255, 0.06);
}

html[data-theme="fun"] .fb-portal-page .mode-option.mode-option--logout:hover {
  color: #fbfbff;
  border-color: rgba(171, 222, 255, 0.42);
}

@media (max-width: 520px) {
  .fb-portal-page .site-header .glass-bar {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    border-radius: 0;
  }

  .fb-portal-page .glass-bar.top-bar {
    min-height: 76px;
    padding: 14px 16px;
  }

  .fb-portal-page .origin-panel {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 104px);
    left: max(16px, env(safe-area-inset-left, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    transform: none;
    max-height: min(70dvh, 560px);
    overflow-y: auto;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: pretty;
    box-sizing: border-box;
  }
}

@media (max-width: 360px) {
  .fb-portal-page .origin-panel {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) {
  .fb-portal-page .origin-panel p {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .fb-portal-page .header-controls {
    width: auto;
    margin-left: 0;
  }

  .fb-portal-page .mode-rail.mode-rail--portal > .mode-option,
  .fb-portal-page .mode-rail.mode-rail--portal > a.mode-option {
    width: auto !important;
    flex: 0 0 auto !important;
    min-width: 48px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .fb-portal-page .mode-rail.mode-rail--portal > .mode-origin {
    width: auto !important;
    flex: 0 0 auto !important;
    min-width: 48px;
  }
}

@media (max-width: 420px) {
  .fb-portal-page .mode-rail.mode-rail--portal > .mode-option,
  .fb-portal-page .mode-rail.mode-rail--portal > a.mode-option,
  .fb-portal-page .mode-rail.mode-rail--portal > .mode-origin {
    min-height: 28px;
    font-size: 8px;
    letter-spacing: 0.06em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fb-portal-page .mode-option {
    transition: none;
  }

  .fb-portal-page .mode-origin,
  .fb-portal-page .origin-panel {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="fun"] .fb-portal-page .site-header::before {
    animation: none;
    opacity: 0.28;
  }

  html[data-theme="fun"] .fb-portal-page .brand-lockup-unit::before,
  html[data-theme="fun"] .fb-portal-page .brand-lockup-unit::after {
    animation: none;
    opacity: 0.32;
  }

  html[data-theme="fun"] .fb-portal-page .mode-origin {
    animation: none;
    filter: none;
    transform: none;
  }

  .fb-portal-page .origin-phrase {
    animation: none;
  }

  .fb-portal-page .header-controls.origin-open .origin-panel {
    transform: none;
  }
}

@media (max-width: 700px) {
  html .fb-portal-page .header-controls.origin-open #originPanel.origin-panel {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 118px) !important;
    left: max(24px, env(safe-area-inset-left, 0px)) !important;
    right: max(24px, env(safe-area-inset-right, 0px)) !important;
    width: calc(100dvw - 48px) !important;
    max-width: calc(100dvw - 48px) !important;
    min-width: 0 !important;
    margin: 0 !important;
    transform: none !important;
    translate: none !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto;
    max-height: min(62dvh, 560px);
    z-index: 80 !important;
    border-radius: 16px;
  }

  html .fb-portal-page .header-controls.origin-open #originPanel.origin-panel,
  html .fb-portal-page .header-controls.origin-open #originPanel.origin-panel * {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: normal;
  }
}

/* Header rail width + masked SVG lockup height (matches homepage) */

.fb-portal-page .site-header {
  --header-system-width: min(calc(100vw - 48px), 360px);
  --header-lockup-height: clamp(56px, 5.5vw, 72px);
}

.fb-portal-page .header-brand {
  width: var(--header-system-width) !important;
  max-width: var(--header-system-width) !important;
  min-width: 0 !important;
}

.fb-portal-page .brand-lockup-unit {
  width: 100% !important;
  padding: 0 clamp(6px, 2.5vw, 22px) !important;
}

.fb-portal-page .brand-lockup-mask {
  height: var(--header-lockup-height) !important;
  width: auto !important;
  aspect-ratio: 232.2 / 67.32 !important;
  max-width: 100% !important;
  flex-shrink: 0 !important;
  display: block !important;
  -webkit-mask-image: url("/assets/brand/ad-astra-connect-lockup-horizontal.svg") !important;
  mask-image: url("/assets/brand/ad-astra-connect-lockup-horizontal.svg") !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-position: center !important;
  mask-position: center !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
}

.fb-portal-page .mode-rail.mode-rail--portal {
  width: auto !important;
  max-width: min(100%, 720px) !important;
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  row-gap: 8px;
}

.fb-portal-page .mode-rail.mode-rail--portal > .mode-option,
.fb-portal-page .mode-rail.mode-rail--portal > a.mode-option {
  width: auto !important;
  flex: 0 0 auto !important;
  min-width: 52px;
  padding-left: 10px;
  padding-right: 10px;
}

.fb-portal-page .mode-rail.mode-rail--portal > .mode-origin {
  width: auto !important;
  flex: 0 0 auto !important;
  min-width: 52px;
}

.fb-portal-page .mode-rail.mode-rail--theme-only {
  flex-wrap: nowrap !important;
  gap: 6px !important;
  row-gap: 6px !important;
  max-width: none !important;
}

.fb-portal-page .mode-rail.mode-rail--theme-only > .mode-option {
  min-width: 48px;
  padding-left: 8px;
  padding-right: 8px;
}

.fb-portal-page .fb-portal-header-controls .mode-rail.mode-rail--theme-only > .mode-option {
  min-height: 30px;
  max-height: 30px;
  min-width: 44px;
  width: auto !important;
  padding-left: 6px;
  padding-right: 6px;
  font-size: 8px;
  letter-spacing: 0.055em;
  line-height: 1.1;
}

@media (max-width: 400px) {
  .fb-portal-page .header-controls.fb-portal-header-controls--auth {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    column-gap: 4px;
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }

  .fb-portal-page .fb-portal-glass-icon {
    width: 36px;
    height: 32px;
    max-height: 32px;
  }

  .fb-portal-page .fb-portal-header-controls .mode-rail.mode-rail--theme-only > .mode-option {
    min-width: 41px;
    max-height: 30px;
    padding-left: 5px;
    padding-right: 5px;
    font-size: 7.5px;
    letter-spacing: 0.05em;
  }

  .fb-portal-page .mode-rail.mode-rail--theme-only {
    gap: 4px !important;
  }
}

@media (min-width: 521px) {
  .fb-portal-page .site-header {
    --header-system-width: min(42vw, 440px);
    --header-lockup-height: clamp(58px, 5.2vw, 74px);
  }
}

@media (max-width: 520px) {
  .fb-portal-page .site-header {
    --header-system-width: min(calc(100vw - 48px), 340px);
    --header-lockup-height: clamp(48px, 11vw, 64px);
  }

  .fb-portal-page .glass-bar.top-bar,
  .fb-portal-page .glass-bar.controls-bar {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    border-radius: 0 !important;
  }

  .fb-portal-page .glass-bar.top-bar {
    min-height: 76px !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
  }
}

@media (max-width: 380px) {
  .fb-portal-page .site-header {
    --header-system-width: min(calc(100vw - 36px), 328px);
  }

  .fb-portal-page .mode-rail.mode-rail--portal {
    gap: 6px !important;
  }
}

/* ----- Dashboard ----- */

.fb-dash-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(28px, 5vh, 44px) clamp(16px, 3vw, 40px) clamp(48px, 8vh, 80px);
}

.fb-dash-welcome h1 {
  font-size: clamp(1.45rem, 3.5vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

html[data-theme="dark"] .fb-dash-welcome h1 {
  color: #eee8de;
}
html[data-theme="light"] .fb-dash-welcome h1 {
  color: #1f2227;
}
html[data-theme="fun"] .fb-dash-welcome h1 {
  color: #eef3fc;
}

.fb-dash-welcome .fb-dash-lead {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--fb-accent-soft);
  font-weight: 500;
}

html[data-theme="light"] .fb-dash-welcome .fb-dash-lead {
  color: #4d6b7a;
}

.fb-dash-welcome .fb-dash-prompt {
  font-size: 15px;
  margin-bottom: clamp(18px, 3vh, 26px);
  max-width: 50ch;
}

html[data-theme="dark"] .fb-dash-welcome .fb-dash-prompt {
  color: #c7ced6;
}
html[data-theme="light"] .fb-dash-welcome .fb-dash-prompt {
  color: #5a5f66;
}
html[data-theme="fun"] .fb-dash-welcome .fb-dash-prompt {
  color: #b8c4d4;
}

.fb-dash-section {
  margin-bottom: clamp(28px, 5vh, 40px);
}

.fb-dash-section:last-of-type {
  margin-bottom: 0;
}

.fb-dash-section-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

html[data-theme="dark"] .fb-dash-section-heading {
  color: #93afc2;
}

html[data-theme="light"] .fb-dash-section-heading {
  color: #4d6b7a;
}

html[data-theme="fun"] .fb-dash-section-heading {
  color: #9dc0d2;
}

.fb-dash-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.fb-dash-grid--active {
  max-width: min(100%, 520px);
}

@media (min-width: 600px) {
  .fb-dash-grid--active {
    max-width: min(100%, 540px);
  }
}

a.fb-dash-card.fb-dash-card--priority {
  border-color: rgba(126, 154, 173, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(126, 154, 173, 0.22);
}

html[data-theme="light"] a.fb-dash-card.fb-dash-card--priority {
  border-color: rgba(77, 107, 122, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 0 0 1px rgba(77, 107, 122, 0.15);
}

html[data-theme="fun"] a.fb-dash-card.fb-dash-card--priority {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(130, 190, 255, 0.3),
    0 10px 28px rgba(30, 80, 140, 0.15);
}

.fb-dash-badge--action {
  background: rgba(180, 140, 70, 0.22) !important;
  color: #ead8b8 !important;
}

html[data-theme="light"] .fb-dash-badge--action {
  background: rgba(160, 120, 50, 0.15) !important;
  color: #5a4a28 !important;
}

html[data-theme="fun"] .fb-dash-badge--action {
  background: rgba(255, 200, 120, 0.2) !important;
  color: #ffe8c8 !important;
}

.fb-dash-badge--complete {
  background: rgba(90, 140, 100, 0.22) !important;
  color: #c8e4d0 !important;
}

html[data-theme="light"] .fb-dash-badge--complete {
  background: rgba(70, 120, 85, 0.14) !important;
  color: #2d4a38 !important;
}

html[data-theme="fun"] .fb-dash-badge--complete {
  background: rgba(120, 200, 160, 0.18) !important;
  color: #d4f4e4 !important;
}

.fb-dash-card--done {
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: var(--fb-radius-plate);
  border: 1px solid rgba(90, 100, 112, 0.55);
  background: rgba(27, 31, 36, 0.42);
  box-shadow: none;
  pointer-events: none;
  opacity: 0.94;
}

html[data-theme="light"] .fb-dash-card--done {
  border-color: rgba(200, 208, 218, 0.85);
  background: rgba(248, 249, 250, 0.75);
}

html[data-theme="fun"] .fb-dash-card--done {
  border-color: rgba(100, 130, 180, 0.28);
  background: rgba(14, 18, 40, 0.45);
}

.fb-dash-card--done .fb-dash-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.2;
}

html[data-theme="dark"] .fb-dash-card--done .fb-dash-card-title,
html[data-theme="dark"] .fb-dash-card--done .fb-dash-desc {
  color: #c8c4bc;
}

html[data-theme="light"] .fb-dash-card--done .fb-dash-card-title,
html[data-theme="light"] .fb-dash-card--done .fb-dash-desc {
  color: #5a5f66;
}

html[data-theme="fun"] .fb-dash-card--done .fb-dash-card-title,
html[data-theme="fun"] .fb-dash-card--done .fb-dash-desc {
  color: #aeb8d0;
}

.fb-dash-card--done .fb-dash-desc {
  font-size: 12px;
  line-height: 1.45;
  flex: 1;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.fb-dash-card--done.fb-dash-card--readiness-summary {
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  opacity: 1;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.fb-dash-card--done.fb-dash-card--readiness-summary:hover {
  border-color: rgba(126, 154, 173, 0.45);
  background: rgba(126, 154, 173, 0.12);
}

html[data-theme="light"] .fb-dash-card--done.fb-dash-card--readiness-summary:hover {
  border-color: rgba(77, 107, 122, 0.42);
  background: rgba(77, 107, 122, 0.09);
}

html[data-theme="fun"] .fb-dash-card--done.fb-dash-card--readiness-summary:hover {
  border-color: rgba(130, 190, 255, 0.38);
  background: rgba(84, 126, 255, 0.12);
}

@media (min-width: 720px) {
  .fb-dash-grid--future {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }
}

.fb-dash-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  margin-bottom: 8px;
  align-self: flex-start;
}

/* Active = real links, full contrast — compact near-square tiles */
a.fb-dash-card {
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: var(--fb-radius-plate);
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(65, 74, 84, 0.95);
  background: linear-gradient(145deg, rgba(126, 154, 173, 0.14), transparent 52%), rgba(27, 31, 36, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
  overflow: hidden;
}

html[data-theme="light"] a.fb-dash-card {
  border-color: rgba(200, 208, 218, 0.95);
  background: linear-gradient(145deg, rgba(77, 107, 122, 0.1), transparent 55%), rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

a.fb-dash-card:hover {
  border-color: rgba(126, 154, 173, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 28px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

html[data-theme="fun"] a.fb-dash-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(130, 190, 255, 0.25),
    0 12px 36px rgba(30, 80, 140, 0.2);
}

a.fb-dash-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(126, 154, 173, 0.35);
}

.fb-dash-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.2;
}

html[data-theme="dark"] a.fb-dash-card .fb-dash-card-title,
html[data-theme="dark"] a.fb-dash-card .fb-dash-desc {
  color: #eee8de;
}

html[data-theme="light"] a.fb-dash-card .fb-dash-card-title {
  color: #1f2227;
}
html[data-theme="light"] a.fb-dash-card .fb-dash-desc {
  color: #5a5f66;
}

html[data-theme="fun"] a.fb-dash-card .fb-dash-card-title {
  color: #f2f6ff;
}
html[data-theme="fun"] a.fb-dash-card .fb-dash-desc {
  color: #c5d0e3;
}

.fb-dash-card .fb-dash-desc {
  font-size: 12px;
  line-height: 1.45;
  flex: 1;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

a.fb-dash-card .fb-dash-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--fb-accent-soft);
  letter-spacing: 0.04em;
  margin-top: auto;
}

html[data-theme="light"] a.fb-dash-card .fb-dash-cta {
  color: #4d6b7a;
}

a.fb-dash-card:hover .fb-dash-cta {
  text-decoration: underline;
}

html[data-theme="dark"] a.fb-dash-card .fb-dash-badge {
  background: rgba(126, 154, 173, 0.25);
  color: #d0e0ed;
}
html[data-theme="light"] a.fb-dash-card .fb-dash-badge {
  background: rgba(77, 107, 122, 0.15);
  color: #3d5566;
}
html[data-theme="fun"] a.fb-dash-card .fb-dash-badge {
  background: rgba(80, 140, 220, 0.22);
  color: #dce8ff;
}

.fb-dash-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #7d8690;
  margin-bottom: 8px;
}

html[data-theme="light"] .fb-dash-label {
  color: #6a737e;
}

html[data-theme="fun"] .fb-dash-label {
  color: #8a9aad;
}

/* Future / inactive: readable but clearly not actionable */
.fb-dash-card--future {
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: var(--fb-radius-plate);
  border: 1px dashed rgba(100, 108, 120, 0.5);
  background:
    linear-gradient(135deg, rgba(126, 154, 173, 0.06), transparent 55%),
    rgba(27, 31, 36, 0.22);
  opacity: 0.88;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}

html[data-theme="light"] .fb-dash-card--future {
  border-color: rgba(160, 170, 182, 0.6);
  background:
    linear-gradient(135deg, rgba(77, 107, 122, 0.06), transparent 55%),
    rgba(255, 255, 255, 0.38);
}

html[data-theme="fun"] .fb-dash-card--future {
  border-color: rgba(120, 160, 220, 0.35);
  background:
    linear-gradient(140deg, rgba(84, 126, 255, 0.08), transparent 60%),
    rgba(12, 16, 36, 0.35);
  opacity: 0.92;
}

.fb-dash-card--future .fb-dash-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.2;
  color: #8a939e;
}

html[data-theme="light"] .fb-dash-card--future .fb-dash-card-title {
  color: #5c656e;
}

html[data-theme="fun"] .fb-dash-card--future .fb-dash-card-title {
  color: #a8b8d0;
}

.fb-dash-future-detail {
  font-size: 11px;
  line-height: 1.45;
  margin: 0;
  color: #6d7680;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

html[data-theme="light"] .fb-dash-future-detail {
  color: #7a828c;
}

html[data-theme="fun"] .fb-dash-future-detail {
  color: #8a9ab8;
}

/* ----- Welcome interstitial (post-login) ----- */

.fb-welcome-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(32px, 6vh, 56px) clamp(16px, 3vw, 40px) clamp(48px, 8vh, 80px);
}

.fb-welcome-greeting {
  font-size: clamp(1.65rem, 4.6vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0 0 clamp(24px, 4vh, 36px);
}

html[data-theme="dark"] .fb-welcome-greeting {
  color: #eee8de;
}

html[data-theme="light"] .fb-welcome-greeting {
  color: #1f2227;
}

html[data-theme="fun"] .fb-welcome-greeting {
  color: #f6f7ff;
}

.fb-welcome-panel {
  border-radius: var(--fb-radius-plate);
  border: 1px solid rgba(65, 74, 84, 0.85);
  padding: clamp(20px, 3vw, 28px);
  background: rgba(27, 31, 36, 0.45);
  margin-bottom: 28px;
}

html[data-theme="light"] .fb-welcome-panel {
  border-color: rgba(200, 208, 218, 0.95);
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="fun"] .fb-welcome-panel {
  border-color: rgba(90, 120, 180, 0.35);
  background: rgba(8, 12, 24, 0.45);
}

.fb-welcome-continue-wrap {
  margin-top: clamp(18px, 3vh, 24px);
  padding-top: clamp(14px, 2.5vh, 20px);
  border-top: 1px solid rgba(65, 74, 84, 0.55);
  display: flex;
  justify-content: center;
}

html[data-theme="light"] .fb-welcome-continue-wrap {
  border-top-color: rgba(190, 198, 208, 0.85);
}

html[data-theme="fun"] .fb-welcome-continue-wrap {
  border-top-color: rgba(90, 120, 180, 0.35);
}

.fb-welcome-continue-link {
  width: auto !important;
  max-width: 100%;
  min-width: min(100%, 200px);
  text-align: center;
  text-decoration: none;
}

.fb-welcome-sequence {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fb-welcome-step {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.38s ease, transform 0.38s ease;
  color: #9fa8b2;
}

.fb-welcome-step--visible {
  opacity: 1;
  transform: translateY(0);
}

html[data-theme="light"] .fb-welcome-step {
  color: #5a5f66;
}

.fb-welcome-step--accent {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #c7ced6;
}

html[data-theme="light"] .fb-welcome-step--accent {
  color: #1f2227;
}

html[data-theme="fun"] .fb-welcome-step--accent {
  color: #dce8ff;
}

.fb-dash-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid rgba(65, 74, 84, 0.55);
  font-size: 12px;
  color: #7d8690;
}

html[data-theme="light"] .fb-dash-footer {
  border-top-color: rgba(190, 198, 208, 0.85);
  color: #6a737e;
}

/* ----- Login plate (shared theme) ----- */

.fb-login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 6vh, 56px) clamp(16px, 3vw, 40px);
}

.fb-login-main-inner {
  width: 100%;
  display: flex;
  justify-content: center;
}

.fb-login-stack {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 4vh, 36px);
}

.fb-login-greeting-block {
  text-align: center;
  padding: 0 clamp(8px, 3vw, 16px);
}

.fb-login-greeting-primary {
  font-size: clamp(1.85rem, 5.4vw, 2.85rem);
  font-weight: 400;
  letter-spacing: -0.038em;
  line-height: 1.08;
  margin: 0 0 14px;
}

html[data-theme="dark"] .fb-login-greeting-primary {
  color: #eee8de;
}

html[data-theme="light"] .fb-login-greeting-primary {
  color: #1f2227;
}

html[data-theme="fun"] .fb-login-greeting-primary {
  color: #f6f7ff;
}

.fb-login-greeting-secondary {
  font-size: clamp(15px, 2.2vw, 17px);
  font-weight: 500;
  margin: 0;
  line-height: 1.55;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

html[data-theme="dark"] .fb-login-greeting-secondary {
  color: #93afc2;
}

html[data-theme="light"] .fb-login-greeting-secondary {
  color: #4d6b7a;
}

html[data-theme="fun"] .fb-login-greeting-secondary {
  color: #a9dcff;
}

.fb-login-plate {
  width: 100%;
  max-width: 420px;
  padding: clamp(24px, 4vw, 32px);
  border-radius: var(--fb-radius-plate);
  border: 1px solid rgba(47, 53, 60, 0.95);
  background: linear-gradient(145deg, rgba(126, 154, 173, 0.08), transparent 55%), rgba(27, 31, 36, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 50px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"] .fb-login-plate {
  border-color: rgba(200, 208, 218, 0.95);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 40px rgba(20, 24, 30, 0.06);
}

html[data-theme="fun"] .fb-login-plate {
  border-color: rgba(100, 140, 200, 0.3);
  background: rgba(10, 14, 28, 0.75);
}

.fb-login-plate h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

html[data-theme="dark"] .fb-login-plate h1 {
  color: #eee8de;
}
html[data-theme="light"] .fb-login-plate h1 {
  color: #1f2227;
}
html[data-theme="fun"] .fb-login-plate h1 {
  color: #eef3fc;
}

.fb-login-plate .fb-login-sub {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

html[data-theme="dark"] .fb-login-plate .fb-login-sub {
  color: #c7ced6;
}
html[data-theme="light"] .fb-login-plate .fb-login-sub {
  color: #4d6b7a;
}

.fb-login-plate .fb-login-support {
  font-size: 14px;
  margin-bottom: 24px;
  max-width: 40ch;
}

html[data-theme="dark"] .fb-login-plate .fb-login-support {
  color: #9fa8b2;
}
html[data-theme="light"] .fb-login-plate .fb-login-support {
  color: #5a5f66;
}

.fb-login-plate label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

html[data-theme="dark"] .fb-login-plate label {
  color: #9fa8b2;
}
html[data-theme="light"] .fb-login-plate label {
  color: #5a5f66;
}

.fb-field {
  margin-bottom: 16px;
}

.fb-login-plate input[type="text"],
.fb-login-plate input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  border-radius: 9px;
  border: 1px solid #4a5560;
  background: #262d35;
  color: #f1eee8;
}

html[data-theme="light"] .fb-login-plate input[type="text"],
html[data-theme="light"] .fb-login-plate input[type="password"] {
  background: #fff;
  border-color: #c4ccd6;
  color: #1f2227;
}

.fb-login-plate input:focus {
  outline: none;
  border-color: rgba(126, 154, 173, 0.85);
  box-shadow: 0 0 0 3px rgba(126, 154, 173, 0.2);
}

.fb-login-plate .fb-login-err {
  font-size: 13px;
  color: #d6a79f;
  min-height: 1.35em;
  margin-bottom: 14px;
}

.fb-login-plate button[type="submit"] {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #f7f6f3;
  background: #5f7f92;
  border: none;
  border-radius: 9px;
  cursor: pointer;
}

.fb-login-plate button[type="submit"]:hover {
  background: #547285;
}

.fb-login-foot {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: #8b939c;
}

html[data-theme="light"] .fb-login-foot {
  color: #6a737e;
}

/* ----- COI document: theme overrides (content class hooks on #main) ----- */

html[data-theme="light"] .fb-portal-page .wrap {
  color: #3f4650;
}

html[data-theme="light"] .fb-portal-page .hero .eyebrow,
html[data-theme="light"] .fb-portal-page .hero .subtitle {
  color: #4d6b7a;
}

html[data-theme="light"] .fb-portal-page .hero h1,
html[data-theme="light"] .fb-portal-page h2 {
  color: #1f2227;
}

html[data-theme="light"] .fb-portal-page .hero .lede,
html[data-theme="light"] .fb-portal-page p,
html[data-theme="light"] .fb-portal-page li {
  color: #5a5f66;
}

html[data-theme="light"] .fb-portal-page h3 {
  color: #2f343c;
}

html[data-theme="light"] .fb-portal-page .panel,
html[data-theme="light"] .fb-portal-page .phase,
html[data-theme="light"] .fb-portal-page .card {
  border-color: rgba(200, 208, 218, 0.95);
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] .fb-portal-page .cta {
  border-color: rgba(180, 190, 204, 0.9);
  background: rgba(77, 107, 122, 0.06);
}

html[data-theme="light"] .fb-portal-page .site-ft {
  border-top-color: rgba(190, 198, 208, 0.85);
  color: #6a737e;
}

html[data-theme="light"] .fb-portal-page a {
  color: #4d6b7a;
}

html[data-theme="fun"] .fb-portal-page .wrap {
  color: #c8d4e6;
}

html[data-theme="fun"] .fb-portal-page .hero h1,
html[data-theme="fun"] .fb-portal-page h2 {
  color: #eef3fc;
}

html[data-theme="fun"] .fb-portal-page .panel,
html[data-theme="fun"] .fb-portal-page .phase,
html[data-theme="fun"] .fb-portal-page .card {
  border-color: rgba(90, 120, 180, 0.35);
  background: rgba(8, 12, 24, 0.45);
}

html[data-theme="fun"] .fb-portal-page .cta {
  border-color: rgba(120, 170, 240, 0.3);
  background: rgba(40, 80, 140, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="fun"] body.fb-portal-page::after {
    animation: none;
  }

  html[data-theme="fun"] .fb-portal-page .brand-lockup-unit {
    filter: none;
  }

  .fb-welcome-step {
    transition: none;
    transform: none;
  }
}
