/*
 * Theme Master refinements: Identity, account, workflow, and admin routes.
 * Studio and Live Edit use the separate pa-family-workspace shell and are
 * intentionally outside every selector in this file.
 */

/* Soft ice product palette. These families deliberately stay bright even when
   a visitor has selected the dark marketing theme. Studio is not in this list. */
html[data-pa-theme] body.pa-body:is(
  .pa-family-auth,
  .pa-family-account,
  .pa-family-workflow,
  .pa-family-admin,
  .pa-family-message
) {
  --pa-canvas: #f4fbfd;
  --pa-canvas-raised: #edf8fb;
  --pa-surface: #ffffff;
  --pa-surface-raised: #edf8fb;
  --pa-copy: #122233;
  --pa-copy-muted: #617486;
  --pa-accent: #087f8c;
  --pa-accent-strong: #0798a7;
  --pa-line-master: #d9e9ef;
  --pa-shadow-master: 0 26px 70px rgba(16, 72, 82, 0.12);
  color-scheme: light;
  color: #122233;
  background: #fbfdfe !important;
}

/* Authentication: a 1240px composed frame with a true 55/45 hierarchy. */
.pa-family-auth .pa-auth-page {
  width: min(calc(100% - (2 * var(--pa-gutter, clamp(1rem, 3vw, 3rem)))), 77.5rem) !important;
  max-width: 77.5rem !important;
  margin-inline: auto;
  padding: 0;
}

.pa-family-auth .pa-auth-frame {
  grid-template-columns: minmax(0, 1.22fr) minmax(25rem, 1fr);
  min-height: min(42.5rem, calc(100svh - 8.25rem));
  overflow: hidden;
  border: 1px solid #d9e9ef;
  border-radius: 1.5rem;
  background: #ffffff;
  color: #122233;
  box-shadow: 0 28px 72px rgba(16, 72, 82, 0.14);
}

.pa-family-auth .pa-auth-story {
  background: #edf8fb;
}

.pa-family-auth .pa-auth-form-panel {
  background: #fbfdfe;
}

.pa-family-auth .pa-auth-frame :is(h1, h2, h3, label, strong) {
  color: #102134;
}

.pa-family-auth .pa-auth-frame :is(p, .form-text, .pa-auth-switch, .pa-auth-minor-link) {
  color: #617486;
}

.pa-family-auth .pa-auth-story > div > p,
.pa-family-auth .pa-auth-feature-list article span {
  color: #617486;
}

.pa-family-auth .pa-auth-feature-list article {
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pa-family-auth .pa-auth-feature-list article span {
  margin-top: 0.12rem;
  line-height: 1.4;
}

.pa-family-auth .pa-auth-feature-list article > i {
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 2.15rem;
}

.pa-family-auth .pa-auth-form :is(.pa-field > label, .pa-auth-options label) {
  color: #30495a;
}

@media (min-width: 992px) {
  .pa-family-auth .pa-auth-story {
    display: grid;
    grid-template-rows: auto minmax(12rem, 1fr);
    gap: clamp(1rem, 2.5vh, 1.75rem);
    align-content: stretch;
    padding: clamp(2.25rem, 3.5vw, 3.5rem);
  }

  .pa-family-auth .pa-auth-story h1 {
    max-width: 14ch;
    font-size: clamp(2.65rem, 3.5vw, 3.85rem);
  }

  .pa-family-auth .pa-auth-feature-list {
    gap: 0.55rem;
    margin-bottom: 0;
  }

  .pa-family-auth .pa-auth-story > img {
    position: static;
    inset: auto;
    align-self: end;
    width: 100%;
    height: 100%;
    min-height: 12rem;
    max-height: 12.5rem;
    border: 1px solid #d9e9ef;
    border-radius: 1rem;
    object-fit: cover;
    object-position: center 56%;
    opacity: 1;
    filter: saturate(0.9) contrast(1.01);
    box-shadow: 0 20px 46px rgba(16, 72, 82, 0.12);
    -webkit-mask-image: none;
    mask-image: none;
  }

  .pa-family-auth .pa-auth-form-panel {
    padding: clamp(2rem, 3vw, 2.75rem);
  }
}

.pa-family-auth .pa-auth-trust {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #d9e9ef;
  border-radius: 0.85rem;
  background: #edf8fb;
  color: #617486;
  font-size: 0.79rem;
  line-height: 1.5;
}

.pa-family-auth .pa-auth-trust > i {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: #def4f1;
  color: #087f8c;
}

.pa-family-auth .pa-auth-trust strong {
  display: block;
  margin-bottom: 0.12rem;
  color: #102134;
}

.pa-family-auth .pa-auth-trust-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.35rem;
}

.pa-family-auth .pa-auth-trust-links a {
  color: #087f8c;
  text-decoration-color: rgba(8, 127, 140, 0.34);
  text-underline-offset: 0.18em;
}

.pa-family-auth .pa-auth-trust-links a:hover {
  color: #065f69;
}

html[data-pa-theme="light"] body.pa-family-auth .pa-auth-trust-links a {
  color: #077683;
  text-decoration-color: rgba(7, 118, 131, 0.42);
}

.pa-family-auth .pa-auth-trust + form {
  margin-top: 1.2rem;
}

/* Password, confirmation, 2FA, and external-provider states share one
   deliberately compact surface instead of a narrow two-column Bootstrap grid. */
.pa-family-auth .pa-auth-shell {
  overflow: hidden;
  padding: 0;
}

.pa-family-auth .pa-auth-shell > .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}

.pa-family-auth .pa-auth-shell > .row > [class*="col-"] {
  width: 100%;
  max-width: none;
  padding: 0;
}

.pa-family-auth .pa-auth-panel {
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 0;
  border-bottom: 1px solid #d9e9ef;
  border-radius: 0;
  background: #edf8fb;
  color: #122233;
  box-shadow: none;
}

.pa-family-auth .pa-auth-panel h1 {
  max-width: 16ch;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.02;
  text-wrap: balance;
}

.pa-family-auth .pa-auth-card {
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #122233;
  box-shadow: none;
}

.pa-family-auth .pa-auth-card .pa-auth-form {
  max-width: 31rem;
}

.pa-family-auth .pa-message-shell,
.pa-family-message .pa-message-shell {
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border-color: #d9e9ef;
  background: #ffffff;
  color: #122233;
  box-shadow: 0 24px 60px rgba(16, 72, 82, 0.12);
}

.pa-family-auth .pa-message-shell h1,
.pa-family-message .pa-message-shell h1 {
  max-width: 17ch;
  text-wrap: balance;
}

/* Account settings: the real content element is .pa-account-main. */
.pa-family-account .pa-main {
  width: 100% !important;
  max-width: none !important;
}

.pa-family-account .pa-account-workspace,
.pa-family-account .pa-manage-shell {
  width: min(calc(100% - var(--pa-gutter)), var(--pa-rail-wide));
  max-width: var(--pa-rail-wide);
}

.pa-family-account .pa-account-sidebar {
  min-width: 0;
}

.pa-family-account .pa-account-main {
  min-width: 0;
  width: 100%;
  max-width: var(--pa-rail-reading);
  padding: clamp(1.5rem, 4vw, 3rem);
}

html[data-pa-theme="light"] body.pa-family-account {
  --pa-danger: #b42335;
}

.pa-family-account .pa-account-main > h3 {
  max-width: 22ch;
  margin: 0 0 1rem;
  color: #102134;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.pa-family-account .pa-account-main > h4,
.pa-family-account .pa-account-main h4 {
  margin-top: 1.75rem;
  color: #102134;
}

.pa-family-account .pa-account-main > .row,
.pa-family-account .pa-account-main > div > .row {
  margin-inline: 0;
}

.pa-family-account .pa-account-main .row > [class*="col-"] {
  width: 100%;
  max-width: 38rem;
  padding-inline: 0;
}

.pa-family-account .pa-account-main form {
  max-width: 38rem;
}

.pa-family-account .pa-account-main .alert {
  max-width: 44rem;
  border-color: #d9e9ef;
  border-radius: 0.85rem;
}

.pa-family-account .pa-account-main ol.list {
  display: grid;
  gap: 0.9rem;
  max-width: 46rem;
  padding-left: 1.4rem;
}

.pa-family-account .pa-account-main ol.list > li {
  padding: 0.9rem 1rem;
  border: 1px solid #d9e9ef;
  border-radius: 0.85rem;
  background: #f8fcfd;
}

.pa-family-account .pa-account-main .recovery-code {
  display: inline-block;
  min-width: 10rem;
  margin: 0.25rem 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbe5e8;
  border-radius: 0.55rem;
  background: #edf8fb;
  color: #087f8c;
  font-size: 0.95rem;
}

.pa-family-account .pa-manage-nav-link {
  min-height: 2.8rem;
}

.pa-family-account .pa-manage-nav-link.active {
  box-shadow: inset 3px 0 #087f8c;
}

html[data-pa-theme="light"] body.pa-family-account .pa-manage-nav-link:not(.active) {
  color: #234b5d;
}

html[data-pa-theme="light"] body.pa-family-account .pa-manage-nav-link:not(.active) .pa-manage-nav-icon {
  color: #087783;
}

html[data-pa-theme="light"] body.pa-family-account .pa-manage-nav-link.active {
  border-color: #066d78 !important;
  background: #087784 !important;
  color: #ffffff !important;
  box-shadow: inset 3px 0 #83e8df;
}

html[data-pa-theme="light"] body.pa-family-account .pa-profile-summary .btn-outline-secondary:disabled {
  opacity: 1;
  border-color: #9cb4c0;
  background: #e9eff4;
  color: #4c6070;
}

html[data-pa-theme="light"] body.pa-family-workflow .pa-plan-mini {
  color: #066d78;
}

html[data-pa-theme="light"] body.pa-family-workflow .pa-locked-feature span {
  color: #526a78;
}

.pa-family-account .pa-account-page-head-visual > .pa-account-profile-visual {
  width: clamp(13rem, 24vw, 18rem);
  height: clamp(8.75rem, 15vw, 11rem);
  flex: 0 0 auto;
  border: 1px solid rgba(8, 127, 140, 0.14);
  border-radius: 1rem;
  object-fit: cover;
  object-position: 72% 50%;
  filter: saturate(0.92) contrast(1.02) drop-shadow(0 20px 28px rgba(8, 90, 104, 0.14));
}

.pa-family-account .pa-account-page-head-visual > .pa-account-billing-visual {
  width: clamp(11rem, 20vw, 14rem);
  height: clamp(9rem, 14vw, 11rem);
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center right;
  filter: saturate(0.94) contrast(1.02) drop-shadow(0 20px 28px rgba(8, 90, 104, 0.14));
}

@media (max-width: 767.98px) {
  .pa-family-account .pa-account-page-head-visual > .pa-account-profile-visual {
    width: 100%;
    height: clamp(8.5rem, 40vw, 10rem);
    object-position: 72% 50%;
  }

  .pa-family-account .pa-account-page-head-visual > .pa-account-billing-visual {
    width: 100%;
    height: clamp(8rem, 38vw, 9.5rem);
    object-position: center;
  }
}

html[data-pa-theme] body.pa-family-account .pa-account-workspace {
  background: #ffffff;
  border-color: #d9e9ef;
  box-shadow: 0 24px 60px rgba(16, 72, 82, 0.11);
}

html[data-pa-theme] body.pa-family-account .pa-account-main {
  background: #ffffff;
  color: #122233;
}

html[data-pa-theme] body.pa-family-account .pa-account-card {
  border-color: #d9e9ef;
  background: #f8fcfd;
  color: #122233;
  box-shadow: 0 16px 42px rgba(16, 72, 82, 0.08);
}

html[data-pa-theme] body.pa-family-account .pa-account-card :is(h1, h2, h3, h4, label, strong) {
  color: #102134;
}

html[data-pa-theme="dark"] body.pa-family-account .pa-account-workspace,
html[data-pa-theme="dark"] body.pa-family-account .pa-account-main {
  background: #ffffff;
  color: #122233;
}

html[data-pa-theme="dark"] body.pa-family-account .pa-account-main :is(h1, h2, h3, h4, label, strong) {
  color: #102134;
}

html[data-pa-theme="dark"] body.pa-family-account .pa-account-main :is(p, .form-text, .text-muted) {
  color: #617486 !important;
}

/* Full canvas outside the rail. Route-specific children remain bounded. */
.pa-family-workflow .pa-main {
  width: 100% !important;
  max-width: none !important;
}

.pa-family-admin .pa-main {
  width: min(calc(100% - var(--pa-gutter)), var(--pa-rail-wide)) !important;
  max-width: var(--pa-rail-wide) !important;
  margin-inline: auto;
}

.pa-family-workflow :is(
  .pa-customer-dashboard,
  .pa-projects-shell,
  .pa-shared-report-page,
  .pa-report-card-page
) {
  width: min(calc(100% - var(--pa-gutter)), var(--pa-rail-wide)) !important;
  max-width: var(--pa-rail-wide) !important;
  margin-inline: auto;
}

/* The admin main already owns the navigation-aligned outer rail. Do not
   subtract another gutter from its direct page wrapper. An inline form cap
   (for example Site notice) remains authoritative inside that rail. */
.pa-family-admin .pa-main > :is(.pa-admin-reference, .container, .container-xxl, .container-fluid) {
  width: 100% !important;
  max-width: 100%;
  margin-inline: auto;
  padding-inline: 0;
}

.pa-family-workflow :is(
  .pa-upload-shell,
  .pa-status-shell,
  .pa-source-tool,
  .pa-doctor-page
) {
  width: min(calc(100% - var(--pa-gutter)), var(--pa-rail-wide)) !important;
  max-width: var(--pa-rail-wide) !important;
  margin-inline: auto;
}

.pa-family-workflow :is(.table-responsive, .pa-table-shell, .pa-data-table-shell),
.pa-family-admin :is(.table-responsive, .pa-admin-table-wrap, .pa-admin-table-shell) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(8, 127, 140, 0.45) #edf8fb;
}

.pa-family-workflow table,
.pa-family-admin table {
  font-variant-numeric: tabular-nums;
}

/* Bootstrap's default warning/info utilities are too bright against the
   authenticated paper canvas. Keep status meaning while restoring readable
   text in Admin filters, badges, and diagnostic actions. */
html[data-pa-theme="light"] body.pa-family-admin :is(.badge.bg-warning,.badge.text-bg-warning) {
  color:#2b1b00 !important;
}

html[data-pa-theme="light"] body.pa-family-admin :is(.badge.bg-info,.badge.text-bg-info) {
  color:#052126 !important;
}

html[data-pa-theme="light"] body.pa-family-admin :is(a.text-warning,.btn-outline-warning) {
  color:#725100 !important;
}

html[data-pa-theme="light"] body.pa-family-admin .btn-outline-warning {
  border-color:#9a7000;
}

html[data-pa-theme="light"] body.pa-family-admin :is(a.text-info,.btn-outline-info) {
  color:#066a77 !important;
}

html[data-pa-theme="light"] body.pa-family-admin .btn-outline-info {
  border-color:#087786;
}

html[data-pa-theme="light"] body.pa-family-admin .btn-outline-danger {
  border-color:#b42335;
  color:#b42335 !important;
}

/* Application and admin surfaces retain their information density while
   returning to the calm white/ice material system. */
.pa-family-workflow :is(
  .pa-dashboard-kpi,
  .pa-dashboard-panel,
  .pa-dashboard-support,
  .pa-project-card,
  .pa-projects-create,
  .pa-projects-list,
  .pa-upload-card,
  .pa-status-card,
  .pa-source-workspace,
  .pa-source-result-board,
  .pa-shared-report-page,
  .pa-report-card-page,
  .card
),
.pa-family-admin :is(
  .pa-admin-reference-body,
  .pa-admin-panel,
  .pa-admin-table-shell,
  .card
) {
  border-color: #d9e9ef;
  background: rgba(255, 255, 255, 0.96);
  color: #122233;
  box-shadow: 0 18px 46px rgba(16, 72, 82, 0.09);
}

.pa-family-workflow :is(.pa-dashboard-head, .pa-projects-head, .pa-upload-head, .pa-status-head),
.pa-family-admin :is(.pa-admin-list-hero, .pa-admin-hero, .pa-admin-page-head) {
  border-color: #d9e9ef;
  background: #edf8fb;
  color: #122233;
  box-shadow: 0 20px 50px rgba(16, 72, 82, 0.1);
}

.pa-family-workflow :is(h1, h2, h3, h4, h5, h6, label, strong),
.pa-family-admin :is(h1, h2, h3, h4, h5, h6, label, strong) {
  color: #102134;
}

.pa-family-workflow :is(p, .text-muted, .text-secondary, .form-text),
.pa-family-admin :is(p, .text-muted, .text-secondary, .form-text) {
  color: #617486 !important;
}

html[data-pa-theme] body:is(.pa-family-auth, .pa-family-account, .pa-family-workflow, .pa-family-admin)
  :is(.form-control, .form-select, textarea) {
  border-color: #d9e9ef;
  background: #ffffff;
  color: #122233;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-pa-theme] body:is(.pa-family-auth, .pa-family-account, .pa-family-workflow, .pa-family-admin)
  :is(.form-control, .form-select, textarea):focus {
  border-color: #0798a7;
  box-shadow: 0 0 0 0.2rem rgba(7, 152, 167, 0.13);
}

html[data-pa-theme] body:is(.pa-family-auth, .pa-family-account, .pa-family-workflow, .pa-family-admin)
  :is(.form-control, textarea)::placeholder {
  color: #7a8e9d;
  opacity: 1;
}

@media (max-height: 780px) and (min-width: 992px) {
  .pa-family-auth .pa-main {
    padding-block: 1rem;
  }

  .pa-family-auth .pa-auth-frame {
    min-height: 0;
  }

  .pa-family-auth .pa-auth-story,
  .pa-family-auth .pa-auth-form-panel {
    padding-block: 1.6rem;
  }

  .pa-family-auth .pa-auth-story h1 {
    font-size: clamp(2.35rem, 3.7vw, 3.75rem);
  }

  .pa-family-auth .pa-auth-feature-list {
    gap: 0.35rem;
  }

  .pa-family-auth .pa-auth-story > img {
    max-height: 13rem;
  }
}

@media (max-width: 991.98px) {
  .pa-family-auth .pa-auth-frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .pa-family-account .pa-account-main {
    max-width: none;
  }

  .pa-family-account .pa-manage-nav-link.active {
    box-shadow: inset 0 -3px #087f8c;
  }
}

@media (max-width: 767.98px) {
  .pa-family-account .pa-account-workspace,
  .pa-family-account .pa-manage-shell,
  .pa-family-workflow :is(
    .pa-customer-dashboard,
    .pa-projects-shell,
    .pa-upload-shell,
    .pa-status-shell,
    .pa-shared-report-page,
    .pa-report-card-page,
    .pa-source-tool,
    .pa-doctor-page
  ) {
    width: min(calc(100% - var(--pa-gutter)), var(--pa-rail-wide)) !important;
  }

  .pa-family-auth .pa-auth-trust {
    padding: 0.75rem 0.8rem;
  }

  .pa-family-account .pa-account-main {
    padding: 1.35rem 1rem 2rem;
  }
}

@media (max-width: 480px) {
  .pa-family-auth .pa-helpbot {
    right: 0;
  }

  .pa-family-auth .pa-helpbot-launcher {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0;
  }
}

/* Admin command center — persisted Light preference. Legacy site.css forces a
   navy console; this layer restores the site's ice/teal language. Dark mode is
   intentionally handled only by theme-dark.css. */
body.pa-family-admin.pa-theme-light {
  --pa-admin-ink: #122233;
  --pa-admin-text: #263746;
  --pa-admin-muted: #5b6f81;
  --pa-muted: var(--pa-admin-muted);
  --pa-admin-line: #d9e9ef;
  --pa-admin-line-strong: #d9e9ef;
  --pa-admin-surface: #ffffff;
  --pa-admin-accent: #066d78;
  background: #fbfdfe !important;
  color: var(--pa-admin-text);
}

body.pa-family-admin.pa-theme-light .pa-main {
  padding-block: clamp(1.35rem, 2.6vw, 2.75rem);
  color: var(--pa-admin-text);
}

body.pa-family-admin.pa-theme-light .pa-admin-reference { margin-top: 0; }

body.pa-family-admin.pa-theme-light :is(
  .pa-admin-reference-hero, .pa-admin-list-hero, .pa-admin-hero,
  .pa-admin-page-head, .admin-topbar-inner, .pa-asset-library-header
) {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--pa-admin-line);
  background: #edf8fb;
  color: var(--pa-admin-text);
  box-shadow: 0 22px 54px rgba(20, 86, 94, 0.12);
}

body.pa-family-admin.pa-theme-light .pa-admin-reference-hero {
  min-height: clamp(20rem, 31vw, 27rem);
  border-radius: 18px 18px 0 0;
  padding: clamp(2rem, 4vw, 4rem);
}

body.pa-family-admin.pa-theme-light :is(.pa-admin-list-hero,.pa-admin-hero,.pa-admin-page-head) {
  border-radius: 18px 18px 0 0;
  padding: clamp(1.75rem, 3.5vw, 3.25rem);
}

body.pa-family-admin.pa-theme-light :is(
  .pa-admin-reference-hero,.pa-admin-list-hero,.pa-admin-hero,
  .pa-admin-page-head,.admin-topbar-inner,.pa-asset-library-header
) :is(h1,h2,h3,h4,h5,h6,strong,label) { color: var(--pa-admin-ink); }

body.pa-family-admin.pa-theme-light :is(
  .pa-admin-reference-hero,.pa-admin-list-hero,.pa-admin-hero,
  .pa-admin-page-head,.admin-topbar-inner,.pa-asset-library-header
) :is(p,.text-muted,.text-secondary) { color: var(--pa-admin-muted) !important; }

body.pa-family-admin.pa-theme-light :is(.pa-admin-reference-hero,.pa-admin-list-hero) .pa-eyebrow {
  color: var(--pa-admin-accent) !important;
}

body.pa-family-admin.pa-theme-light .pa-admin-reference-hero img {
  width: min(100%, 34rem);
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(8,127,140,.24);
  border-radius: 14px;
  background: #0a1b28;
  object-fit: cover;
  opacity: 1;
  filter: none;
  box-shadow: 0 24px 54px rgba(18,63,72,.2), 0 0 0 8px rgba(255,255,255,.58);
}

/* Legacy page headings follow the decorative grid and may follow inline CSS. */
body.pa-family-admin.pa-theme-light .pa-main > :nth-child(1 of :not(.pa-main-grid):not(script):not(style)):is(.d-flex, h1) {
  border: 1px solid var(--pa-admin-line);
  border-radius: 16px;
  background: #edf8fb;
  box-shadow: 0 16px 38px rgba(20,86,94,.09);
  padding: clamp(1.2rem, 2.5vw, 2rem);
}

body.pa-family-admin.pa-theme-light .pa-main > h1:nth-child(1 of :not(.pa-main-grid):not(script):not(style)) { margin-bottom: 1.25rem !important; }

body.pa-family-admin.pa-theme-light :is(
  .pa-admin-reference-body,.pa-admin-panel,.pa-admin-table-shell,
  .admin-console-card,.audit-console-card,.card,.accordion-item,
  .list-group-item,.dropdown-menu
) {
  border-color: var(--pa-admin-line);
  background: var(--pa-admin-surface);
  color: var(--pa-admin-text);
  box-shadow: 0 14px 38px rgba(20,78,87,.075);
}

body.pa-family-admin.pa-theme-light .pa-admin-reference-body {
  border-radius: 0 0 18px 18px;
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

body.pa-family-admin.pa-theme-light :is(.pa-admin-panel,.card,.accordion-item,.admin-help-panel) {
  border-radius: 12px;
}

body.pa-family-admin.pa-theme-light :is(.pa-admin-kpi-card,.admin-kpi-card) {
  border-color: var(--pa-admin-line);
  background: #ffffff;
  color: var(--pa-admin-text);
  box-shadow: 0 10px 28px rgba(20,78,87,.075) !important;
}

body.pa-family-admin.pa-theme-light :is(.pa-admin-kpi-card,.admin-kpi-card):hover {
  border-color: var(--pa-admin-line-strong);
  box-shadow: 0 16px 34px rgba(8,127,140,.13) !important;
  transform: translateY(-2px);
}

body.pa-family-admin.pa-theme-light :is(.pa-admin-kpi-icon,.admin-kpi-icon) {
  border-color: #bfe0e2;
  background: #e9f7f7;
  color: var(--pa-admin-accent);
}

body.pa-family-admin.pa-theme-light .text-success {
  color: #146c43 !important;
}

body.pa-family-admin.pa-theme-light .pa-admin-kpi-card.is-health strong,
body.pa-family-admin.pa-theme-light .pa-admin-kpi-card.is-health > i {
  color: #146c43;
}

body.pa-family-admin.pa-theme-light .pa-asset-library-count span {
  color: var(--pa-admin-muted);
}

body.pa-family-admin.pa-theme-light :is(
  h1,h2,h3,h4,h5,h6,label,.form-label,.pa-panel-header,
  .pa-panel-header span:first-child,.pa-admin-panel-header,.pa-admin-user-cell,
  .pa-admin-queue-list strong,.pa-admin-event-list span,.pa-admin-resource-list strong
) { color: var(--pa-admin-ink); }

body.pa-family-admin.pa-theme-light :is(p,li,.text-secondary,.text-muted,.form-text) {
  color: var(--pa-admin-muted) !important;
}

body.pa-family-admin.pa-theme-light .admin-help-panel {
  border-color: #bfe0e2;
  background: #e9f7f7;
  color: var(--pa-admin-text);
  box-shadow: 0 12px 28px rgba(8,127,140,.08);
}

body.pa-family-admin.pa-theme-light .admin-help-panel summary { color: #066f7a; }

body.pa-family-admin.pa-theme-light :is(.form-control,.form-select,textarea,.pa-admin-search-field) {
  border-color: var(--pa-admin-line);
  background: #fff;
  color: var(--pa-admin-ink);
}

body.pa-family-admin.pa-theme-light :is(.form-control,.form-select,textarea):focus {
  border-color: var(--pa-admin-accent);
  box-shadow: 0 0 0 .2rem rgba(8,127,140,.14);
}

body.pa-family-admin.pa-theme-light .table {
  --bs-table-color: var(--pa-admin-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--pa-admin-line);
  --bs-table-striped-color: var(--pa-admin-text);
  --bs-table-striped-bg: rgba(230,247,248,.48);
  --bs-table-hover-color: var(--pa-admin-ink);
  --bs-table-hover-bg: rgba(215,241,242,.62);
}

body.pa-family-admin.pa-theme-light :is(.table-light,.pa-admin-user-table thead) {
  --bs-table-color: var(--pa-admin-ink);
  --bs-table-bg: #eaf7f8;
  --bs-table-border-color: var(--pa-admin-line);
  background: #eaf7f8;
}

body.pa-family-admin.pa-theme-light :is(.table-responsive,.pa-admin-table-wrap,.pa-admin-table-shell) {
  border: 1px solid var(--pa-admin-line);
  border-radius: 12px;
  background: #fff;
  scrollbar-color: rgba(8,127,140,.55) #eaf7f8;
}

body.pa-family-admin.pa-theme-light :is(
  .pa-admin-filter-bar,.pa-admin-table-footer,.card-header,.accordion-button
) {
  border-color: var(--pa-admin-line);
  background: #f2fafa;
  color: var(--pa-admin-ink);
}

body.pa-family-admin.pa-theme-light :is(.btn-outline-secondary,.btn-outline-dark) {
  border-color: #a9ced2;
  color: #315866;
  background: rgba(255,255,255,.72);
}

body.pa-family-admin.pa-theme-light :is(.btn-outline-secondary,.btn-outline-dark):hover {
  border-color: var(--pa-admin-accent);
  background: #e6f5f5;
  color: #066f7a;
}

body.pa-family-admin.pa-theme-light :is(.pa-admin-text-link,a:not(.btn):not(.dropdown-item)) {
  color: #066f7a;
}

body.pa-family-admin.pa-theme-light :is(.dropdown-item:hover,.dropdown-item:focus) {
  background: #e9f7f7;
  color: var(--pa-admin-ink);
}

body.pa-family-admin.pa-theme-light :is(.alert-info,.alert-primary) {
  border-color: #b8dfe2;
  background: #eaf8f8;
  color: #174754;
}

body.pa-family-admin.pa-theme-light :is(.pa-empty-state,.admin-empty-state,.text-center.py-5) {
  border-color: var(--pa-admin-line);
  background: #f1fafa;
  color: var(--pa-admin-text);
}

@media (max-width: 991.98px) {
  body.pa-family-admin.pa-theme-light .pa-admin-reference-hero {
    grid-template-columns: minmax(0,1fr);
    gap: 1.75rem;
  }

  body.pa-family-admin.pa-theme-light .pa-admin-reference-hero img {
    width: 100%;
    max-height: 22rem;
    justify-self: stretch;
  }

  body.pa-family-admin.pa-theme-light .pa-admin-kpi-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 767.98px) {
  .pa-family-admin .pa-main > .row,
  .pa-family-admin .pa-product-analytics-page > .row.g-4 {
    /* Keep Bootstrap row margins within the narrower mobile admin rail. */
    --bs-gutter-x: min(1.5rem, var(--pa-gutter));
  }

  body.pa-family-admin.pa-theme-light .pa-main { padding-block: 1rem 2rem; }

  body.pa-family-admin.pa-theme-light .pa-admin-reference,
  body.pa-family-admin.pa-theme-light .pa-main > :not(script):not(style):not(.pa-main-grid):not(.row) {
    width: 100% !important;
    margin-inline: 0;
  }

  body.pa-family-admin.pa-theme-light .pa-main > .row {
    width: auto !important;
    max-width: none;
    margin-right: calc(-0.5 * var(--bs-gutter-x, 1.5rem));
    margin-left: calc(-0.5 * var(--bs-gutter-x, 1.5rem));
  }

  body.pa-family-admin.pa-theme-light .pa-admin-reference-hero,
  body.pa-family-admin.pa-theme-light :is(.pa-admin-list-hero,.pa-admin-hero,.pa-admin-page-head),
  body.pa-family-admin.pa-theme-light .pa-main > :nth-child(1 of :not(.pa-main-grid):not(script):not(style)):is(.d-flex, h1) {
    border-radius: 12px;
    padding: 1.15rem;
  }

  body.pa-family-admin.pa-theme-light .pa-admin-reference-body {
    border: 1px solid var(--pa-admin-line);
    border-radius: 12px;
    margin-top: .75rem;
    padding: .9rem;
  }

  body.pa-family-admin.pa-theme-light .pa-admin-kpi-grid {
    grid-template-columns: minmax(0,1fr);
    gap: .75rem;
  }

  body.pa-family-admin.pa-theme-light .pa-admin-dashboard-grid {
    grid-template-columns: minmax(0,1fr);
  }

  body.pa-family-admin.pa-theme-light .pa-admin-event-list a {
    grid-template-columns: auto minmax(0,1fr);
  }

  body.pa-family-admin.pa-theme-light .pa-admin-event-list a > :nth-child(n + 3) { grid-column: 2; }

  body.pa-family-admin.pa-theme-light :is(.pa-admin-filter-bar,.pa-admin-table-footer) {
    grid-template-columns: minmax(0,1fr);
    align-items: stretch;
  }
}

/* The narrow admin reports become vertical records instead of miniature
   desktop tables. These classes are opt-in so dense admin tables elsewhere
   retain their existing responsive behavior. */
@media (max-width: 575.98px) {
  body.pa-family-admin .pa-product-analytics-page .pa-analytics-period-picker {
    display: flex;
    width: 100%;
  }

  body.pa-family-admin .pa-product-analytics-page .pa-analytics-period-picker .btn {
    min-width: 0;
    flex: 1 1 0;
    white-space: normal;
  }

  body.pa-family-admin .pa-product-analytics-page .pa-analytics-kpi-grid > [class*="col-"] {
    width: 100%;
  }

  body.pa-family-admin .pa-product-analytics-page .pa-analytics-kpi-grid .text-secondary {
    overflow-wrap: normal;
    word-break: normal;
  }

  body.pa-family-admin .pa-admin-email-throttle-head {
    min-width: 0;
    width: 100%;
  }

  body.pa-family-admin .pa-admin-email-throttle-head h1 {
    max-width: 100%;
    margin: 0;
    overflow-wrap: normal;
    font-size: clamp(1.75rem, 9vw, 2.1rem);
    line-height: 1.08;
    word-break: normal;
  }

  body.pa-family-admin .pa-admin-email-throttle-head .btn {
    width: 100%;
    text-align: center;
  }

  body.pa-family-admin .pa-admin-stacked-table-wrap {
    width: 100%;
    margin-inline: 0 !important;
    overflow-x: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  body.pa-family-admin .pa-admin-stack-table,
  body.pa-family-admin .pa-admin-stack-table tbody,
  body.pa-family-admin .pa-admin-stack-table tr,
  body.pa-family-admin .pa-admin-stack-table td {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  body.pa-family-admin .pa-admin-stack-table {
    margin: 0;
  }

  body.pa-family-admin .pa-admin-stack-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    border: 0;
    padding: 0;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  body.pa-family-admin .pa-admin-stack-table tbody {
    display: grid;
    gap: .75rem;
  }

  body.pa-family-admin .pa-admin-stack-table tbody > tr {
    overflow: hidden;
    border: 1px solid var(--pa-admin-line, #d9e9ef);
    border-radius: 10px;
    background: var(--pa-admin-surface, #ffffff);
  }

  body.pa-family-admin .pa-admin-stack-table td {
    min-width: 0;
    border: 0;
    border-bottom: 1px solid var(--pa-admin-line, #d9e9ef);
    padding: .7rem .8rem;
    color: var(--pa-admin-text, #263746);
    text-align: left !important;
    overflow-wrap: anywhere;
    white-space: normal !important;
  }

  body.pa-family-admin .pa-admin-stack-table td:last-child {
    border-bottom: 0;
  }

  body.pa-family-admin .pa-admin-stack-table td::before {
    display: block;
    margin-bottom: .2rem;
    color: var(--pa-admin-accent, #087f8c);
    content: attr(data-label);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.25;
    text-transform: uppercase;
  }

  body.pa-family-admin .pa-admin-stack-table :is(code, .badge) {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
  }

  /* Delete User is a key/value definition table rather than a multi-column
     report. Preserve that relationship as one labeled record per row. */
  body.pa-family-admin .pa-admin-delete-user-table-wrap {
    width: 100%;
    overflow-x: visible !important;
    border: 0 !important;
  }

  body.pa-family-admin .pa-admin-delete-user-table,
  body.pa-family-admin .pa-admin-delete-user-table tbody,
  body.pa-family-admin .pa-admin-delete-user-table tr,
  body.pa-family-admin .pa-admin-delete-user-table th,
  body.pa-family-admin .pa-admin-delete-user-table td {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  body.pa-family-admin .pa-admin-delete-user-table {
    border: 0;
  }

  body.pa-family-admin .pa-admin-delete-user-table tbody {
    display: grid;
    gap: .7rem;
  }

  body.pa-family-admin .pa-admin-delete-user-table tr {
    overflow: hidden;
    border: 1px solid var(--pa-admin-line, #d9e9ef);
    border-radius: 9px;
    background: var(--pa-admin-surface, #ffffff);
  }

  body.pa-family-admin .pa-admin-delete-user-table th {
    border: 0;
    padding: .65rem .75rem .2rem;
    background: transparent !important;
    color: var(--pa-admin-accent, #087f8c);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
  }

  body.pa-family-admin .pa-admin-delete-user-table td {
    min-width: 0;
    border: 0;
    padding: .2rem .75rem .7rem;
    color: var(--pa-admin-text, #263746);
    overflow-wrap: anywhere;
    white-space: normal !important;
  }

  body.pa-family-admin .pa-admin-delete-user-table td :is(strong, code, span, .badge) {
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal !important;
    word-break: break-word;
  }
}

/* Admin asset titles use a tight display line-height. Extend the existing
   opaque metadata paint by two pixels so every rendered glyph remains inside
   its verified surface, including wrapped titles and paths. */
body.pa-family-admin.pa-theme-light .pa-asset-meta > :is(h3, code, span) {
  position: relative;
  z-index: 2;
  padding-block: 0.125rem;
  background: #ffffff !important;
  background-image: none !important;
}

/* Light asset-library authority: metadata is a separate opaque white layer,
   so the preview image never participates in text-background resolution. */
body.pa-family-admin.pa-theme-light .pa-asset-library-tools,
body.pa-family-admin.pa-theme-light .pa-asset-card,
body.pa-family-admin.pa-theme-light .pa-asset-meta,
body.pa-family-admin.pa-theme-light .pa-asset-meta > :is(h3, code, span) {
  background: #ffffff !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.pa-family-admin.pa-theme-light .pa-asset-meta {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

body.pa-family-admin.pa-theme-light .pa-asset-meta h3 {
  color: #122233 !important;
}

body.pa-family-admin.pa-theme-light .pa-asset-meta code {
  color: #425b70 !important;
}

body.pa-family-admin.pa-theme-light .pa-asset-meta span {
  color: #5b6f81 !important;
}

/*
 * The Users route has unusually dense KPI and table content. At the 320px
 * audit width, intrinsic card content must never widen the page and get
 * clipped by the admin canvas.
 */
@media (max-width: 575.98px) {
  body.pa-family-admin
    .pa-admin-users-page,
  body.pa-family-admin
    .pa-admin-users-page
    :is(
      .pa-admin-list-hero,
      .pa-admin-reference-body,
      .pa-admin-kpi-grid,
      .pa-admin-kpi-card,
      .pa-admin-users-table-card,
      .pa-admin-filter-bar,
      .table-responsive
    ) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body.pa-family-admin
    .pa-admin-users-page
    :is(.pa-admin-list-hero, .pa-admin-reference-body) {
    padding-inline: 0.85rem;
  }

  body.pa-family-admin
    .pa-admin-users-page
    .pa-admin-list-hero
    :is(h1, p) {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  body.pa-family-admin
    .pa-admin-users-page
    .pa-admin-kpi-card {
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.9rem;
  }

  body.pa-family-admin
    .pa-admin-users-page
    .pa-admin-kpi-card
    > span:last-child,
  body.pa-family-admin
    .pa-admin-users-page
    .pa-admin-kpi-card
    :is(small, strong, em) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  body.pa-family-admin
    .pa-admin-users-page
    .pa-admin-users-table-card {
    overflow: hidden;
  }

  body.pa-family-admin
    .pa-admin-users-page
    .pa-admin-filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.85rem;
  }

  body.pa-family-admin
    .pa-admin-users-page
    .pa-admin-filter-bar
    :is(.pa-admin-search-field, select, .btn) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.pa-family-admin
    .pa-admin-users-page
    .pa-admin-filter-bar
    .btn {
    display: inline-flex;
    grid-column: auto;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #102a30 !important;
  }

  body.pa-family-admin
    .pa-admin-users-page
    .table-responsive {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
  }
}

/*
 * Canonical admin geometry
 * ------------------------
 * Admin is intentionally dense, but it still belongs to the same visual
 * system as the rest of 3D Print Pass. Genuine panels, media, and controls use
 * the site-wide 8px corner. Connected hero/body compositions keep square
 * seams, while semantic status chips, counts, and avatars may remain pills or
 * circles.
 */
body.pa-family-admin.pa-admin-page {
  --pa-admin-radius: 8px;
  --bs-border-radius: 8px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 8px;
  --bs-border-radius-xl: 8px;
  --bs-border-radius-xxl: 8px;
}

body.pa-family-admin.pa-admin-page :is(
  .pa-admin-reference-hero,
  .pa-admin-list-hero
) {
  border-radius: var(--pa-admin-radius) var(--pa-admin-radius) 0 0;
}

body.pa-family-admin.pa-admin-page .pa-admin-reference-body {
  border-radius: 0 0 var(--pa-admin-radius) var(--pa-admin-radius);
}

body.pa-family-admin.pa-admin-page :is(
  .pa-admin-hero,
  .pa-admin-page-head,
  .admin-topbar-inner,
  .pa-asset-library-header,
  .pa-main > :nth-child(1 of :not(.pa-main-grid):not(script):not(style)):is(.d-flex, h1),
  .pa-admin-panel,
  .pa-admin-kpi-card,
  .admin-kpi-card,
  .admin-console-card,
  .audit-console-card,
  .admin-help-panel,
  .pa-admin-table-shell,
  .pa-admin-table-wrap,
  .table-responsive,
  .pa-admin-search-field,
  .admin-signal-item,
  .pa-asset-preview,
  .pa-empty-state,
  .admin-empty-state,
  .card,
  .accordion-item,
  .alert,
  .dropdown-menu,
  .list-group
) {
  border-radius: var(--pa-admin-radius);
}

body.pa-family-admin.pa-admin-page :is(
  .pa-admin-reference-hero img,
  .pa-admin-kpi-icon,
  .admin-kpi-icon,
  .pa-admin-queue-icon,
  .pa-admin-stack-table tbody > tr,
  .pa-admin-delete-user-table tr,
  pre,
  .btn:not(.rounded-pill),
  .form-control,
  .form-select
) {
  border-radius: var(--pa-admin-radius);
}

body.pa-family-admin.pa-admin-page :is(.pa-admin-chip, .pa-status-pill) {
  border-radius: 999px;
}

body.pa-family-admin.pa-admin-page .pa-admin-table-footer-actions > span {
  border-radius: var(--pa-admin-radius);
}

/* Preserve joined-control seams after normalizing the individual controls. */
body.pa-family-admin.pa-admin-page :is(.btn-group, .input-group) > :not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

body.pa-family-admin.pa-admin-page :is(.btn-group, .input-group) > :not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

@media (max-width: 767.98px) {
  body.pa-family-admin.pa-admin-page :is(
    .pa-admin-reference-hero,
    .pa-admin-list-hero,
    .pa-admin-reference-body
  ) {
    border-radius: var(--pa-admin-radius);
  }
}

body.pa-family-admin.pa-admin-page .pa-admin-support-credit-verify {
  width: min(100%, 760px);
  max-width: 760px;
}

body.pa-family-admin.pa-admin-page:has(#audit-user-id) .table-responsive tbody td.small > .d-flex.flex-column > a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

body.pa-family-admin.pa-admin-page .pa-admin-support-credit-head > div {
  min-width: 0;
}

@media (max-width: 575.98px) {
  body.pa-family-admin.pa-admin-page .pa-admin-support-credit-head {
    align-items: stretch !important;
  }

  body.pa-family-admin.pa-admin-page .pa-admin-support-credit-head .badge {
    align-self: flex-start;
  }

  body.pa-family-admin.pa-admin-page .pa-admin-support-credit-actions > .btn {
    width: 100%;
    margin: .55rem 0 0 !important;
    white-space: normal;
  }
}
