:root {
  color-scheme: light;
  --portal-bg: #f5f2ff;
  --portal-panel: rgba(251, 249, 255, 0.86);
  --portal-panel-strong: #ffffff;
  --portal-ink: #19142a;
  --portal-muted: #625a82;
  --portal-line: rgba(83, 53, 145, 0.14);
  --portal-accent: #6b4dff;
  --portal-accent-dark: #4528d6;
  --portal-green: #166a74;
  --portal-red: #a13363;
  --portal-amber: #a15c07;
  --portal-shadow: 0 24px 60px rgba(76, 55, 166, 0.14);
  font-family:
    "Outfit", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-hub-theme="dark"] {
  color-scheme: dark;
  --portal-bg: #0f1020;
  --portal-panel: rgba(19, 20, 41, 0.84);
  --portal-panel-strong: #171931;
  --portal-ink: #edf0ff;
  --portal-muted: #aab0d8;
  --portal-line: rgba(166, 154, 255, 0.16);
  --portal-accent: #8b72ff;
  --portal-accent-dark: #c1b5ff;
  --portal-green: #b9fbff;
  --portal-red: #ffc5e1;
  --portal-amber: #f4c36d;
  --portal-shadow: 0 26px 60px rgba(4, 6, 20, 0.42);
  background:
    radial-gradient(circle at top left, rgba(139, 114, 255, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(80, 213, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #111325 0%, #0c1020 48%, #090b16 100%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body.portal-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(129, 95, 255, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(79, 212, 255, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf9ff 0%, #efeaff 48%, #e8f0ff 100%);
  color: var(--portal-ink);
}

html[data-hub-theme="dark"] body.portal-page {
  color: var(--portal-ink);
  background:
    radial-gradient(circle at top left, rgba(139, 114, 255, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(80, 213, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #111325 0%, #0c1020 48%, #090b16 100%);
}

button,
input,
select {
  font: inherit;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 224, 236, 0.86);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.portal-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--portal-accent);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0;
}

.portal-brand strong,
.portal-brand small {
  display: block;
}

.portal-brand strong {
  font-size: 1rem;
  line-height: 1.25;
}

.portal-brand small {
  margin-top: 2px;
  color: var(--portal-muted);
  font-size: 0.82rem;
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.context-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.context-switcher span {
  flex: 0 0 auto;
}

.context-switcher select {
  min-height: 34px;
  padding: 6px 28px 6px 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 220px;
  padding: 6px 10px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  color: var(--portal-muted);
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-ok {
  border-color: rgba(17, 122, 75, 0.28);
  color: var(--portal-green);
  background: #eefaf4;
}

.status-actionable {
  border-color: rgba(37, 99, 235, 0.28);
  color: #2563eb;
  background: #eff6ff;
}

.status-locked {
  border-color: rgba(180, 35, 24, 0.26);
  color: var(--portal-red);
  background: #fff1f0;
}

.status-warning {
  border-color: rgba(161, 92, 7, 0.28);
  color: var(--portal-amber);
  background: #fff7e6;
}

.status-muted {
  border-color: var(--portal-line);
  color: var(--portal-muted);
  background: #f9fbfe;
}

.portal-main {
  width: min(1760px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.portal-auth-mode [data-hub-shell] {
  display: none !important;
}

.portal-auth-mode .portal-main {
  display: grid;
  align-items: center;
  min-height: 100vh;
  width: min(1120px, calc(100vw - 48px));
  padding: clamp(28px, 6vh, 72px) 0;
}

.portal-booting .login-layout {
  visibility: hidden;
}

.portal-booting .portal-main {
  position: relative;
}

.portal-booting .portal-main::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(107, 77, 255, 0.18);
  border-top-color: var(--portal-accent);
  border-radius: 999px;
  animation: portalBootSpin 820ms linear infinite;
}

@keyframes portalBootSpin {
  to {
    transform: rotate(360deg);
  }
}

.portal-page #logoutButton {
  display: none !important;
}

.portal-page .hub-shell-menu-status {
  display: none !important;
}

.portal-page .hub-shell-search input:focus {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.portal-page .hub-shell-search:focus-within {
  border-color: rgba(111, 75, 216, 0.42);
  box-shadow: 0 18px 44px rgba(111, 75, 216, 0.13);
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(161, 92, 7, 0.32);
  border-radius: 8px;
  color: var(--portal-amber);
  background: #fff7e6;
}

.impersonation-banner span {
  color: var(--portal-ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.login-layout,
.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
  gap: 22px;
  align-items: stretch;
}

.portal-auth-mode .login-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  gap: 22px;
  width: 100%;
  align-items: center;
}

.setup-layout {
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
}

.portal-panel,
.portal-section {
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-panel);
  box-shadow: var(--portal-shadow);
}

html[data-hub-theme="dark"] .portal-panel,
html[data-hub-theme="dark"] .portal-section {
  color: var(--portal-ink);
  background: var(--portal-panel);
}

.login-summary {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 430px;
  padding: clamp(26px, 4vw, 42px);
}

.portal-auth-mode .login-summary {
  isolation: isolate;
  min-height: 0;
  aspect-ratio: 16 / 9;
  padding: clamp(24px, 3.6vw, 40px);
  color: #f7f8ff;
  background: #080b16;
  box-shadow: 0 28px 90px rgba(4, 6, 20, 0.28);
  transform: translateY(24px);
}

.portal-auth-mode .login-summary::before,
.portal-auth-mode .login-summary::after {
  content: "";
  position: absolute;
  inset: 0;
}

.portal-auth-mode .login-summary::before {
  z-index: 0;
  background-image: url("/assets/images/login_bg.png");
  background-image: -webkit-image-set(url("/assets/images/login_bg.webp") 1x, url("/assets/images/login_bg.png") 1x);
  background-image: image-set(url("/assets/images/login_bg.webp") type("image/webp"), url("/assets/images/login_bg.png") type("image/png"));
  background-position: center right;
  background-size: cover;
}

.portal-auth-mode .login-summary::after {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(6, 9, 18, 0.82) 0%, rgba(8, 12, 24, 0.52) 50%, rgba(8, 12, 24, 0.2) 100%),
    radial-gradient(circle at 72% 52%, rgba(139, 114, 255, 0.12), transparent 32%);
}

.portal-auth-mode .login-summary > * {
  position: relative;
  z-index: 2;
}

.portal-auth-mode .login-summary .section-kicker,
.portal-auth-mode .login-summary h1,
.portal-auth-mode .login-summary .readiness-grid span,
.portal-auth-mode .login-summary .readiness-grid strong {
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.34);
}

.portal-auth-mode .login-summary h1 {
  position: absolute;
  top: 50%;
  left: clamp(24px, 3.6vw, 40px);
  right: clamp(24px, 3.6vw, 40px);
  display: grid;
  gap: 4px;
  margin: 0;
  max-width: 560px;
  transform: translateY(-50%);
  font-size: clamp(2.1rem, 4.25vw, 3.4rem);
}

.portal-auth-mode .login-summary h1 span,
.portal-auth-mode .login-summary h1 em {
  display: block;
}

.portal-auth-mode .login-summary h1 em {
  color: #d9a441;
  font-size: 0.76em;
  font-style: italic;
  font-weight: 500;
  line-height: 1.03;
}

.portal-auth-mode .login-form {
  min-height: 430px;
}

.password-login-fields {
  display: grid;
  gap: 16px;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--portal-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-kicker.hub-module-context-kicker {
  margin: 0 0 8px;
  color: var(--portal-accent);
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: var(--portal-ink);
  max-width: 680px;
  margin-bottom: 24px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  color: var(--portal-ink);
  margin-bottom: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

h3 {
  color: var(--portal-ink);
  margin: 0 0 12px;
  font-size: 0.98rem;
}

.readiness-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.readiness-grid div,
.profile-grid div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #f9fbfe;
}

.readiness-grid span,
.profile-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.readiness-grid strong,
.profile-grid strong {
  display: block;
  min-width: 0;
  color: var(--portal-ink);
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
}

.setup-panel {
  padding: clamp(24px, 4vw, 36px);
}

.setup-content {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}

.totp-box,
.setup-form {
  display: grid;
  gap: 14px;
}

.totp-box {
  padding: 16px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #f9fbfe;
}

.totp-box img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #ffffff;
}

.form-heading {
  min-height: 54px;
}

.form-message,
.section-heading p,
.auth-copy {
  min-height: 20px;
  margin: 6px 0 0;
  color: var(--portal-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

label {
  display: grid;
  gap: 7px;
  color: var(--portal-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--portal-ink);
  background: #ffffff;
  outline: none;
}

html[data-hub-theme="dark"] input,
html[data-hub-theme="dark"] select,
html[data-hub-theme="dark"] textarea {
  color: var(--portal-ink);
  background: rgba(18, 20, 40, 0.96);
  border-color: var(--portal-line);
}

html[data-hub-theme="dark"] .login-form input,
html[data-hub-theme="dark"] .organization-onboarding-form input,
html[data-hub-theme="dark"] .organization-onboarding-form select,
html[data-hub-theme="dark"] .support-form input,
html[data-hub-theme="dark"] .support-form select,
html[data-hub-theme="dark"] .support-form textarea,
html[data-hub-theme="dark"] .invite-form input,
html[data-hub-theme="dark"] .invite-form select {
  color: #f7f8ff;
  border-color: rgba(214, 206, 255, 0.78);
  background: rgba(43, 46, 82, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(214, 206, 255, 0.18);
}

html[data-hub-theme="dark"] .organization-onboarding-form input[readonly] {
  color: #d8ddff;
  border-color: rgba(176, 165, 237, 0.46);
  background: rgba(30, 33, 62, 0.92);
}

html[data-hub-theme="dark"] .organization-onboarding-form select option,
html[data-hub-theme="dark"] .support-form select option,
html[data-hub-theme="dark"] .invite-form select option {
  color: #f7f8ff;
  background: #25294a;
}

html[data-hub-theme="dark"] .organization-onboarding-form input::placeholder,
html[data-hub-theme="dark"] .support-form textarea::placeholder,
html[data-hub-theme="dark"] .invite-form input::placeholder {
  color: rgba(218, 222, 255, 0.62);
}

html[data-hub-theme="dark"] .login-form input:focus,
html[data-hub-theme="dark"] .organization-onboarding-form input:focus,
html[data-hub-theme="dark"] .organization-onboarding-form select:focus,
html[data-hub-theme="dark"] .support-form input:focus,
html[data-hub-theme="dark"] .support-form select:focus,
html[data-hub-theme="dark"] .support-form textarea:focus,
html[data-hub-theme="dark"] .invite-form input:focus,
html[data-hub-theme="dark"] .invite-form select:focus {
  border-color: rgba(238, 233, 255, 0.9);
  box-shadow:
    0 0 0 3px rgba(139, 114, 255, 0.24),
    0 12px 30px rgba(4, 6, 20, 0.22);
}

input:focus,
select:focus {
  border-color: rgba(111, 75, 216, 0.62);
  box-shadow: 0 0 0 3px rgba(111, 75, 216, 0.13);
}

input[readonly] {
  color: #5f5a78;
  background: rgba(248, 246, 255, 0.72);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #ffffff;
  background: var(--portal-accent);
}

.primary-button:hover {
  background: var(--portal-accent-dark);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.secondary-button {
  color: var(--portal-ink);
  border-color: var(--portal-line);
  background: #ffffff;
}

.secondary-button:hover {
  background: #f5f2ff;
}

html[data-hub-theme="dark"] .secondary-button {
  color: #f7f8ff;
  border-color: rgba(214, 206, 255, 0.28);
  background: rgba(38, 41, 75, 0.96);
}

html[data-hub-theme="dark"] .secondary-button:hover {
  border-color: rgba(214, 206, 255, 0.42);
  background: rgba(54, 47, 104, 0.98);
}

.link-button {
  min-height: 36px;
  border: 0;
  padding: 4px;
  color: var(--portal-muted);
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.link-button:hover {
  color: var(--portal-accent);
}

.federated-login {
  display: grid;
  gap: 14px;
}

.auth-switch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 28px;
}

.auth-text-link {
  border: 0;
  padding: 0;
  color: var(--portal-accent);
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.auth-text-link:hover {
  color: var(--portal-accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-hub-theme="dark"] .auth-text-link {
  color: #d8ccff;
}

html[data-hub-theme="dark"] .auth-text-link:hover {
  color: #ffffff;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: var(--portal-line);
}

.google-signin-button {
  display: grid;
  height: 40px;
  min-height: 40px;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

.google-signin-button > div,
.google-signin-button iframe {
  display: block !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  width: 100% !important;
}

html[data-hub-theme="dark"] .google-signin-button iframe {
  color-scheme: dark;
}

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.privacy-modal[hidden] {
  display: none;
}

.privacy-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, 0.48);
}

.privacy-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(820px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.22);
  overflow: hidden;
}

.privacy-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  color: var(--portal-muted);
  background: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}

.privacy-modal__header,
.privacy-modal__footer {
  padding: 22px 24px;
}

.privacy-modal__header {
  padding-right: 62px;
  border-bottom: 1px solid var(--portal-line);
}

.privacy-modal__header h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.privacy-modal__header p,
.privacy-modal__footer span {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.privacy-modal__body {
  max-height: 100%;
  padding: 22px 24px;
  overflow: auto;
}

.privacy-modal__body section + section {
  margin-top: 18px;
}

.privacy-modal__body h3 {
  margin-bottom: 8px;
}

.privacy-modal__body p {
  color: var(--portal-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.privacy-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--portal-line);
  background: #f9fbfe;
}

.mfa-code-group {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.mfa-digit {
  min-height: 54px;
  padding: 8px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
}

.portal-app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.portal-sidebar {
  position: sticky;
  top: var(--hub-shell-sticky-top, 96px);
  display: grid;
  gap: 10px;
  align-self: start;
  max-height: calc(100vh - var(--hub-shell-sticky-top, 96px) - 16px);
  padding: 10px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--portal-shadow);
  overflow: auto;
  transition: top 180ms ease;
}

body.has-hub-shell.hub-shell-chrome-hidden .portal-sidebar {
  top: var(--hub-shell-sticky-top, 16px);
  max-height: calc(100vh - var(--hub-shell-sticky-top, 16px) - 16px);
}

.portal-sidebar--services {
  top: var(--hub-shell-sticky-top, 96px);
  overflow: visible;
  max-height: calc(100vh - var(--hub-shell-sticky-top, 96px) - 16px);
}

body.has-hub-shell.hub-shell-chrome-hidden .portal-sidebar--services {
  top: var(--hub-shell-sticky-top, 16px);
  max-height: calc(100vh - var(--hub-shell-sticky-top, 16px) - 16px);
}

.portal-sidebar--services .sidebar-account,
.portal-sidebar--services .sidebar-status {
  display: none;
}

.sidebar-account {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 4px 2px 10px;
  border-bottom: 1px solid var(--portal-line);
}

.sidebar-account span,
.sidebar-account small {
  overflow-wrap: anywhere;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.sidebar-account strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.portal-nav,
.service-catalog-nav,
.service-catalog-nav-list,
.sidebar-status,
.portal-workspace,
.portal-view {
  display: grid;
  gap: 8px;
}

.service-catalog-nav {
  align-content: start;
  gap: 10px;
}

.portal-sidebar--services .service-catalog-nav {
  display: grid;
}

.service-catalog-nav-heading {
  display: grid;
  gap: 5px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid var(--portal-line);
}

.service-catalog-nav-heading span {
  color: var(--portal-muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.service-catalog-nav-heading strong {
  font-size: 1rem;
}

.service-catalog-nav-back {
  min-height: 30px;
  width: fit-content;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--portal-accent-dark);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.service-catalog-nav-list {
  gap: 6px;
}

.service-catalog-nav-group {
  margin: 8px 2px 2px;
  color: var(--portal-muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.service-catalog-nav-group:first-child {
  margin-top: 0;
}

.service-catalog-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 31px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--portal-muted);
  background: transparent;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.service-catalog-nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-catalog-nav-item:hover,
.service-catalog-nav-item.active {
  border-color: rgba(111, 75, 216, 0.22);
  color: var(--portal-accent-dark);
  background: #f1efff;
}

.service-catalog-nav-item:disabled {
  cursor: default;
  opacity: 0.48;
}

.service-catalog-nav-item:disabled:hover {
  border-color: transparent;
  color: var(--portal-muted);
  background: transparent;
}

.service-catalog-nav-item small {
  display: inline-grid;
  min-width: 34px;
  min-height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.68rem;
  font-weight: 700;
}

.service-catalog-nav-item--module small {
  min-width: 0;
  padding: 0 7px;
  font-size: 0.68rem;
}

.services-catalog-section {
  min-height: 520px;
}

.service-search-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
}

.service-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 3px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  overflow: visible;
}

.service-status-filter-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 0;
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--portal-muted);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  overflow: visible;
}

.service-status-filter-count {
  position: relative;
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0 5px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--portal-accent), var(--portal-accent-dark));
  box-shadow: 0 6px 14px rgba(107, 77, 255, 0.26);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
}

.service-status-filter-count.hub-ui-counter-badge--floating {
  position: absolute;
  top: -7px;
  right: -7px;
}

.service-status-filter-button:hover,
.service-status-filter-button.active {
  color: var(--portal-accent-dark);
  background: #f1efff;
}

.service-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 306px));
  gap: 14px;
  justify-content: start;
  align-items: stretch;
  max-width: 1266px;
}

.service-module-grid--grouped {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.service-subgroup-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.service-subgroup-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 6px;
  border-bottom: 1px solid var(--portal-line);
}

.service-subgroup-heading h3 {
  margin: 0;
  font-size: 1.02rem;
}

.service-subgroup-heading p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.service-subgroup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 306px));
  gap: 14px;
  justify-content: start;
  align-items: stretch;
}

.service-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  min-height: 190px;
  max-width: 306px;
  padding: 16px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(76, 55, 166, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.service-card-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.service-card-actions {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 12px;
}

.service-card-icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(111, 75, 216, 0.2);
  border-radius: 8px;
  color: var(--portal-accent-dark);
  background: linear-gradient(135deg, rgba(111, 75, 216, 0.14), rgba(80, 213, 255, 0.1));
}

.service-card-icon svg {
  width: 23px;
  height: 23px;
}

.service-card-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.service-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.service-card-heading h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.98rem;
  line-height: 1.22;
}

.service-card-meta .status-pill {
  justify-self: end;
  min-height: 19px;
  max-width: 86px;
  padding: 2px 6px;
  overflow: hidden;
  font-size: 0.62rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-card-body {
  display: grid;
  align-content: start;
  min-width: 0;
}

.service-card-body p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.service-card .service-action {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.service-card--focus {
  border-color: rgba(111, 75, 216, 0.52);
  box-shadow: 0 0 0 3px rgba(111, 75, 216, 0.14), 0 18px 38px rgba(76, 55, 166, 0.12);
  transform: translateY(-1px);
}

.service-context-back {
  min-height: 36px;
  padding: 8px 12px;
}

.portal-nav-item {
  display: flex;
  align-items: center;
  min-height: 34px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--portal-muted);
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.portal-nav-item:hover,
.portal-nav-item.active {
  border-color: rgba(111, 75, 216, 0.22);
  color: var(--portal-accent-dark);
  background: #f1efff;
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-heading h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.dashboard-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.portal-section {
  padding: 22px;
}

.today-section {
  border-color: rgba(111, 75, 216, 0.18);
  background: linear-gradient(180deg, #ffffff, #fbfaff);
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading p {
  text-align: right;
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.role-chip {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid rgba(111, 75, 216, 0.22);
  color: var(--portal-accent-dark);
  background: #f1efff;
  font-size: 0.78rem;
  font-weight: 800;
}

.service-list,
.today-list,
.alert-list,
.activity-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.indicator-grid,
.widget-grid,
.module-list {
  display: grid;
  gap: 12px;
}

.indicator-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.widget-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.indicator-card,
.widget-card,
.module-row,
.list-item {
  min-width: 0;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #ffffff;
}

.indicator-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
}

.indicator-card span,
.widget-card span,
.module-row span,
.module-row small,
.list-item span {
  color: var(--portal-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.indicator-card strong {
  font-size: 1.9rem;
  line-height: 1;
}

.portal-client-insight-grid {
  margin-bottom: 0;
}

.portal-client-insight-card {
  text-decoration: none;
}

.indicator-green {
  border-color: rgba(17, 122, 75, 0.24);
}

.indicator-blue {
  border-color: rgba(111, 75, 216, 0.24);
}

.indicator-orange {
  border-color: rgba(161, 92, 7, 0.26);
}

.module-row {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.module-row:hover {
  border-color: rgba(111, 75, 216, 0.34);
  background: #fbfaff;
}

.module-row strong,
.list-item strong {
  overflow-wrap: anywhere;
}

.widget-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.widget-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.widget-card-heading h3 {
  margin: 4px 0 0;
}

.widget-card-heading strong {
  font-size: 2rem;
  line-height: 1;
}

.widget-card p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.widget-link {
  width: fit-content;
  min-width: 86px;
  text-decoration: none;
}

.list-item {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}

.list-item-warning {
  border-color: rgba(161, 92, 7, 0.28);
  background: #fffaf0;
}

.list-item-locked {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff7f6;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #ffffff;
}

.service-category-heading {
  margin: 16px 0 6px;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.service-row-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--portal-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.service-row h3 {
  margin-bottom: 4px;
}

.service-row p {
  margin-bottom: 0;
  color: var(--portal-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.service-action {
  min-width: 96px;
  text-decoration: none;
}

.invite-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.support-form {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 180px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.organization-onboarding-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.organization-onboarding-form .primary-button {
  grid-column: 1 / -1;
  width: fit-content;
}

.onboarding-modal[hidden] {
  display: none;
}

.onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.onboarding-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 18, 42, 0.38);
  backdrop-filter: blur(8px);
}

.onboarding-modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(111, 75, 216, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(250, 248, 255, 0.96), rgba(255, 255, 255, 0.96)),
    #ffffff;
  box-shadow: 0 28px 80px rgba(42, 31, 82, 0.28);
}

.onboarding-modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.onboarding-modal-heading h2 {
  margin: 2px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.onboarding-modal-heading p {
  margin: 0;
  color: var(--portal-muted);
}

.onboarding-checklist {
  display: grid;
  gap: 10px;
}

.onboarding-step-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--portal-ink);
  cursor: pointer;
}

.onboarding-step-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(111, 75, 216, 0.1);
  color: var(--portal-accent);
  font-weight: 800;
}

.onboarding-step-row strong,
.onboarding-step-row small {
  grid-column: 2;
}

.onboarding-step-row small {
  color: var(--portal-muted);
  line-height: 1.35;
}

.onboarding-step-row.is-current {
  border-color: rgba(111, 75, 216, 0.42);
  box-shadow: 0 0 0 3px rgba(111, 75, 216, 0.09);
}

.onboarding-step-row.is-complete > span {
  background: rgba(17, 145, 89, 0.12);
  color: #087443;
}

.onboarding-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.organization-field-wide {
  grid-column: span 2;
}

.support-description {
  min-width: 0;
}

textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--portal-ink);
  background: #ffffff;
  font: inherit;
}

textarea:focus {
  border-color: rgba(111, 75, 216, 0.62);
  box-shadow: 0 0 0 3px rgba(111, 75, 216, 0.13);
  outline: none;
}

.role-picker {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / 4;
  gap: 10px 14px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #f9fbfe;
}

.role-picker label,
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--portal-ink);
  font-size: 0.84rem;
  white-space: nowrap;
}

.role-picker input,
.inline-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.inline-check {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #ffffff;
}

.activation-box {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(17, 122, 75, 0.22);
  border-radius: 8px;
  background: #eefaf4;
}

.activation-box span {
  color: var(--portal-green);
  font-size: 0.84rem;
  font-weight: 800;
}

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

.account-list {
  display: grid;
  gap: 10px;
}

.account-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #ffffff;
}

.account-action {
  width: fit-content;
}

.account-row strong,
.account-row span {
  overflow-wrap: anywhere;
}

.account-row span {
  color: var(--portal-muted);
  font-size: 0.84rem;
}

html[data-hub-theme="dark"] .privacy-modal__dialog,
html[data-hub-theme="dark"] .privacy-modal__close,
html[data-hub-theme="dark"] .portal-sidebar,
html[data-hub-theme="dark"] .readiness-grid div,
html[data-hub-theme="dark"] .profile-grid div,
html[data-hub-theme="dark"] .indicator-card,
html[data-hub-theme="dark"] .widget-card,
html[data-hub-theme="dark"] .module-row,
html[data-hub-theme="dark"] .list-item,
html[data-hub-theme="dark"] .service-card,
html[data-hub-theme="dark"] .service-row,
html[data-hub-theme="dark"] .inline-check,
html[data-hub-theme="dark"] .account-row {
  color: var(--portal-ink);
  background: var(--portal-panel);
}

html[data-hub-theme="dark"] .login-summary,
html[data-hub-theme="dark"] .login-form,
html[data-hub-theme="dark"] .readiness-grid strong,
html[data-hub-theme="dark"] .profile-grid strong,
html[data-hub-theme="dark"] .dashboard-heading,
html[data-hub-theme="dark"] .section-heading,
html[data-hub-theme="dark"] .portal-nav-item,
html[data-hub-theme="dark"] .module-row,
html[data-hub-theme="dark"] .list-item,
html[data-hub-theme="dark"] .service-card,
html[data-hub-theme="dark"] .service-row,
html[data-hub-theme="dark"] .account-row {
  color: var(--portal-ink);
}

html[data-hub-theme="dark"] label,
html[data-hub-theme="dark"] .readiness-grid span,
html[data-hub-theme="dark"] .profile-grid span,
html[data-hub-theme="dark"] .form-message,
html[data-hub-theme="dark"] .section-heading p,
html[data-hub-theme="dark"] .auth-copy,
html[data-hub-theme="dark"] .login-divider,
html[data-hub-theme="dark"] .empty-state,
html[data-hub-theme="dark"] .account-row span {
  color: var(--portal-muted);
}

html[data-hub-theme="dark"] .privacy-modal__footer,
html[data-hub-theme="dark"] .role-picker,
html[data-hub-theme="dark"] .empty-state,
html[data-hub-theme="dark"] .service-status-filter {
  background: var(--portal-panel-strong);
}

html[data-hub-theme="dark"] .portal-nav-item:hover,
html[data-hub-theme="dark"] .portal-nav-item.active,
html[data-hub-theme="dark"] .service-catalog-nav-item:hover,
html[data-hub-theme="dark"] .service-catalog-nav-item.active,
html[data-hub-theme="dark"] .service-status-filter-button:hover,
html[data-hub-theme="dark"] .service-status-filter-button.active,
html[data-hub-theme="dark"] .module-row:hover,
html[data-hub-theme="dark"] .role-chip {
  background: linear-gradient(135deg, rgba(139, 114, 255, 0.18), rgba(27, 31, 58, 0.96));
}

html[data-hub-theme="dark"] .service-card-icon {
  color: #f0ecff;
  background: linear-gradient(135deg, rgba(139, 114, 255, 0.24), rgba(80, 213, 255, 0.1));
}

html[data-hub-theme="dark"] .service-catalog-nav-back {
  color: #f0ecff;
  border-color: rgba(214, 206, 255, 0.24);
  background: rgba(30, 33, 62, 0.92);
}

html[data-hub-theme="dark"] .service-catalog-nav-item small {
  background: rgba(18, 20, 40, 0.72);
}

html[data-hub-theme="dark"] .today-section {
  background: linear-gradient(180deg, var(--portal-panel), rgba(20, 22, 46, 0.92));
}

html[data-hub-theme="dark"] .status-muted {
  color: var(--portal-muted);
  background: var(--portal-panel-strong);
}

html[data-hub-theme="dark"] .status-ok,
html[data-hub-theme="dark"] .activation-box {
  color: var(--portal-green);
  background: rgba(126, 224, 173, 0.12);
}

html[data-hub-theme="dark"] .status-actionable {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
}

html[data-hub-theme="dark"] .status-locked,
html[data-hub-theme="dark"] .list-item-locked {
  color: var(--portal-red);
  background: rgba(255, 155, 145, 0.12);
}

html[data-hub-theme="dark"] .status-warning,
html[data-hub-theme="dark"] .impersonation-banner,
html[data-hub-theme="dark"] .list-item-warning {
  color: var(--portal-amber);
  background: rgba(244, 195, 109, 0.12);
}

.account-row .row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.empty-state {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--portal-line);
  border-radius: 8px;
  color: var(--portal-muted);
  background: #f9fbfe;
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .portal-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .login-layout,
  .setup-layout,
  .account-columns,
  .portal-app-shell {
    grid-template-columns: 1fr;
  }

  .portal-auth-mode .login-layout {
    grid-template-columns: minmax(0, 430px);
    justify-content: center;
  }

  .portal-auth-mode .login-summary {
    display: none;
  }

  .portal-auth-mode .login-form {
    width: 100%;
  }

  .portal-sidebar {
    position: static;
  }

  .portal-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .indicator-grid,
  .module-list,
  .widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-content {
    grid-template-columns: 1fr;
  }

  .login-summary {
    min-height: auto;
  }

  .invite-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-form {
    grid-template-columns: 1fr;
  }

  .organization-onboarding-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-picker {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .portal-main {
    width: min(100vw - 24px, 1180px);
    padding-top: 22px;
  }

  .portal-topbar {
    padding: 12px;
  }

  .portal-brand small {
    display: none;
  }

  .readiness-grid,
  .profile-grid,
  .invite-form,
  .organization-onboarding-form,
  .indicator-grid,
  .module-list,
  .widget-grid,
  .portal-nav {
    grid-template-columns: 1fr;
  }

  .dashboard-heading,
  .section-heading {
    display: grid;
    align-items: start;
  }

  .section-heading p {
    text-align: left;
  }

  .service-row {
    grid-template-columns: 1fr;
  }

  .service-action {
    width: 100%;
  }

  .organization-field-wide,
  .organization-onboarding-form .primary-button {
    grid-column: 1;
    width: 100%;
  }

  .activation-box {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }
}
