/* Cloudbridge application design system
 * Admin pages use a fixed light operations theme. Member pages inherit the
 * existing light/dark palette through the semantic variables below.
 */
:root {
  --accent: var(--orange);
  --ui-primary: var(--orange);
  --ui-primary-hover: var(--orange-dark);
  --ui-success: #16805a;
  --ui-warning: #a66c08;
  --ui-danger: #bd433c;
  --ui-info: #2769b0;
  --ui-bg: var(--paper);
  --ui-surface: var(--surface);
  --ui-surface-muted: var(--surface-muted);
  --ui-line: var(--line);
  --ui-text: var(--ink);
  --ui-muted: var(--muted);
  --ui-radius: 8px;
  --ui-radius-sm: 6px;
  --ui-shadow: 0 2px 8px rgba(22, 34, 50, .035);
  --ui-shadow-raised: 0 10px 28px rgba(22, 34, 50, .09);
  --ui-blue: #2d6ecb;
  --ui-green: #25a36d;
  --ui-red: #dc5d56;
  --ui-gold: #d39a25;
  --ui-violet: #7057ae;
  --ui-teal: #197a7e;
}

/* Admin is intentionally light-only. */
html:has(body.admin-page),
html:has(body.admin-login-page) {
  color-scheme: light;
  --paper: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #f7f9fb;
  --ink: #1b2735;
  --muted: #6d7988;
  --line: #e3e8ee;
  --orange: #e85619;
  --orange-dark: #c94410;
  --success: #16805a;
  --shadow: var(--ui-shadow);
}

body.admin-page,
body.admin-login-page {
  background: #f5f7fa;
  color: #1b2735;
}

body.admin-login-page .admin-login-card {
  border-radius: 10px;
  box-shadow: var(--ui-shadow-raised);
}

body.admin-page .admin-layout {
  grid-template-columns: 238px minmax(0, 1fr);
  align-items: stretch;
  min-height: calc(100vh - 76px);
}

body.admin-page .admin-sidebar {
  background: #f8fafb;
}

body.admin-page .admin-content {
  box-sizing: border-box;
  width: auto;
  max-width: 1600px;
  min-width: 0;
  margin: 0;
  padding: 34px clamp(24px, 2.6vw, 42px) 72px;
  overflow: hidden;
}

body.admin-page .admin-page-heading {
  align-items: center;
  margin: 0 0 20px;
}

body.admin-page .admin-page-heading h1 {
  margin: 4px 0 7px;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

body.admin-page .admin-page-heading p,
body.admin-page .muted {
  color: #6d7988;
}

body.admin-page .eyebrow {
  color: #3a6fab;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

body.admin-page :is(.panel, .metric, .admin-section, .tool-card, .provider-card, .search-kpi, .audit-scope, .worker-install-card, .account-manage-card) {
  border: 1px solid #e3e8ee;
  border-radius: var(--ui-radius);
  background: #fff;
  box-shadow: var(--ui-shadow);
}

body.admin-page .panel,
body.admin-page .admin-section {
  padding: 20px 22px;
}

body.admin-page :is(.panel, .admin-section) h2 {
  margin-top: 0;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

body.admin-page :is(.admin-metrics, .panel-grid, .tool-hero, .tool-kpis, .usage-overview, .detail-kpis, .audit-summary) {
  gap: 12px;
}

body.admin-page :is(.metric, .tool-kpi, .usage-card, .detail-card, .audit-scope) {
  box-sizing: border-box;
  min-width: 0;
  min-height: 104px;
  padding: 16px;
}

body.admin-page :is(.metric, .tool-kpi, .usage-card, .detail-card, .audit-scope) strong {
  letter-spacing: 0;
}

body.admin-page :is(.section-toolbar, .panel-title, .observability-panel-head, .tool-card-head) {
  align-items: flex-start;
  gap: 16px;
}

body.admin-page :is(.admin-form-grid, .admin-settings-form, .account-toolbar, .account-searchbar, .audit-filters, .records-toolbar, .usage-filters, .call-toolbar, .tool-filterbar, .range-toolbar) {
  gap: 10px;
}

body.admin-page :is(.records-toolbar, .usage-filters, .call-toolbar, .tool-filterbar, .range-toolbar, .audit-filters, .account-searchbar) {
  box-sizing: border-box;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #e5e9ed;
  border-radius: var(--ui-radius);
  background: #f8fafb;
}

body.admin-page :is(input, select, textarea),
body.ui-member-page :is(input, select, textarea) {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  color: var(--ui-text);
  background-color: var(--ui-surface);
  box-shadow: none;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body.admin-page textarea,
body.ui-member-page textarea {
  min-height: 96px;
  padding-block: 10px;
}

body.admin-page select,
body.ui-member-page select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ui-muted) 50%), linear-gradient(135deg, var(--ui-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 51%, calc(100% - 13px) 51%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

body.admin-page :is(input, select, textarea):focus,
body.ui-member-page :is(input, select, textarea):focus {
  border-color: color-mix(in srgb, var(--ui-primary) 66%, var(--ui-line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-primary) 12%, transparent);
}

body.admin-page .button,
body.ui-member-page .button {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 7px;
  box-shadow: none;
  letter-spacing: 0;
}

body.admin-page .button:hover,
body.ui-member-page .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--ui-primary) 18%, transparent);
}

body.admin-page .button.small,
body.ui-member-page .button.small {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
}

body.admin-page :is(.admin-table, .call-table-wrap, .usage-table),
body.ui-member-page :is(.admin-table, .wallet-ledger, .wallet-table) {
  max-width: 100%;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  overflow: auto;
  background: var(--ui-surface);
  box-shadow: none;
}

body.admin-page :is(.admin-table-head, .usage-head),
body.admin-page .call-table thead,
body.ui-member-page :is(.admin-table-head, .wallet-table-head) {
  color: var(--ui-muted);
  background: var(--ui-surface-muted);
  font-size: 10px;
  font-weight: 800;
}

body.admin-page :is(.admin-table-row, .usage-row),
body.ui-member-page :is(.admin-table-row, .wallet-table-row) {
  border-color: var(--ui-line);
}

body.admin-page :is(.admin-table-row, .usage-row):hover,
body.admin-page .call-table tbody tr:hover,
body.ui-member-page :is(.admin-table-row, .wallet-table-row):hover {
  background: color-mix(in srgb, var(--ui-surface-muted) 75%, transparent);
}

body.admin-page :is(.usage-secondary-nav, .detail-nav, .records-nav, .tool-subnav),
body.ui-member-page :is(.wallet-subnav, .agent-secondary-nav, .model-tabs) {
  display: flex;
  gap: 4px;
  max-width: 100%;
  padding: 5px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-muted);
  overflow-x: auto;
  scrollbar-width: none;
}

body.admin-page :is(.usage-secondary-nav, .detail-nav, .records-nav, .tool-subnav) a,
body.ui-member-page :is(.wallet-subnav, .agent-secondary-nav) a,
body.ui-member-page .model-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  color: var(--ui-muted);
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

body.admin-page :is(.usage-secondary-nav, .detail-nav, .records-nav, .tool-subnav) :is(a:hover, a.active),
body.ui-member-page :is(.wallet-subnav, .agent-secondary-nav) :is(a:hover, a.active),
body.ui-member-page .model-tabs button.active {
  color: var(--ui-text);
  background: var(--ui-surface);
  box-shadow: 0 1px 4px rgba(22, 34, 50, .08);
}

/* Member center keeps its existing palette and theme switching. */
body.ui-member-page {
  --ui-bg: var(--paper);
  --ui-surface: var(--surface);
  --ui-surface-muted: var(--surface-muted);
  --ui-line: var(--line);
  --ui-text: var(--ink);
  --ui-muted: var(--muted);
  background: var(--ui-bg);
}

body.ui-member-page .center-layout {
  grid-template-columns: 238px minmax(0, 1fr);
  align-items: stretch;
}

body.ui-member-page .side-nav {
  background: color-mix(in srgb, var(--ui-surface) 90%, var(--ui-bg));
}

body.ui-member-page .side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 7px;
}

/* The member sidebar has one canonical icon source: ui-system.js injects
   .ui-nav-icon SVGs. Disable the legacy pseudo-element icon layer entirely;
   keeping both layers produces duplicate icons and order-dependent glyphs. */
body.ui-member-page .side-nav a::before {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  background: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

body.ui-member-page .side-nav .ui-nav-icon {
  display: inline-grid !important;
  visibility: visible !important;
  width: 20px;
  min-width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  overflow: visible;
  opacity: 1;
}

body.ui-member-page .side-nav .ui-nav-icon svg,
.ui-action-icon svg {
  display: block !important;
  visibility: visible !important;
  width: 19px;
  height: 19px;
  max-width: none;
  max-height: none;
  fill: none;
  stroke: currentColor !important;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
}

body.ui-member-page .side-nav a.active {
  color: #fff;
  background: var(--ui-primary);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ui-primary) 20%, transparent);
}

.member-menu-toggle,
.member-menu-backdrop {
  display: none;
}

body.ui-member-page .center-main:not(.agent-workbench) {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 34px clamp(24px, 3vw, 48px) 72px;
  overflow: hidden;
}

body.ui-member-page .center-main > h1,
body.ui-member-page .page-heading h1,
body.ui-member-page .catalog-head h1,
body.ui-member-page .member-hero h1 {
  margin: 4px 0 7px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: 0;
}

body.ui-member-page :is(.panel, .metric, .member-panel, .member-kpi, .catalog-sidebar, .catalog-ranking, .catalog-card, .wallet-panel, .income-kpi) {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}

body.ui-member-page :is(.panel, .member-panel, .wallet-panel) {
  padding: 20px 22px;
}

body.ui-member-page :is(.panel, .member-panel, .wallet-panel) h2 {
  font-size: 16px;
  letter-spacing: 0;
}

body.ui-member-page .member-kpis {
  gap: 12px;
}

body.ui-member-page .member-kpi {
  min-height: 104px;
  padding: 16px;
}

body.ui-member-page .member-kpi strong {
  margin: 5px 0 4px;
  font-size: 23px;
  letter-spacing: 0;
}

body.ui-member-page .member-main-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 14px;
}

body.ui-member-page .member-action {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: 7px;
  box-shadow: none;
}

body.ui-member-page .member-action > span {
  display: block;
  min-width: 0;
}

body.ui-member-page .member-action strong,
body.ui-member-page .member-action small {
  display: block;
}

body.ui-member-page .member-action small {
  margin-top: 3px;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.45;
}

body.ui-member-page .member-action i {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--ui-info);
  background: color-mix(in srgb, var(--ui-info) 10%, var(--ui-surface));
  font-style: normal;
  place-items: center;
}

body.ui-member-page .member-action i svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.ui-member-page .catalog-layout {
  grid-template-columns: minmax(190px, .22fr) minmax(520px, 1fr) minmax(240px, .3fr);
  gap: 14px;
}

body.ui-member-page :is(.catalog-sidebar, .catalog-ranking) {
  padding: 18px;
}

body.ui-member-page .catalog-card {
  border-radius: var(--ui-radius);
}

body.ui-member-page :is(.catalog-controls, .wallet-toolbar, .ledger-toolbar) {
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-muted);
}

/* Agent Studio keeps its workstation proportions but shares controls. */
body.agent-studio-shell .agent-secondary-nav {
  border-radius: var(--ui-radius);
}

body.agent-studio-shell :is(.agent-settings-panel, .agent-library-panel, .resource-full-panel, .skill-editor-shell, .knowledge-shell) {
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}

body.agent-studio-shell :is(button, .button, input, select, textarea) {
  letter-spacing: 0;
}

/* Shared chart language. Existing SVG/canvas implementations keep their data. */
body :is(.ui-chart-surface, [class*="trend-chart"], [class*="chart-panel"], .tool-trend, .usage-chart, .audit-trend-chart) {
  min-width: 0;
}

body :is(.ui-chart-surface, [class*="trend-chart"], .tool-trend, .usage-chart) svg {
  display: block;
  width: 100%;
  max-width: 100%;
}

body :is(.trend-grid, .chart-grid) {
  stroke: color-mix(in srgb, var(--ui-line) 78%, transparent);
}

body :is(.trend-line, .chart-line-primary) {
  stroke: var(--ui-blue);
}

body :is(.chart-legend, .tool-chart-legend, .usage-legend) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ui-muted);
  font-size: 10px;
}

body :is(.overview-empty, .observability-empty, .catalog-empty, .agent-empty, .wallet-empty, .audit-loading) {
  display: grid;
  min-height: 116px;
  padding: 20px;
  border: 1px dashed var(--ui-line);
  border-radius: var(--ui-radius);
  color: var(--ui-muted);
  background: color-mix(in srgb, var(--ui-surface-muted) 55%, transparent);
  text-align: center;
  place-items: center;
}

body :is(.status-pill, .admin-status-pill, .agent-status, .wallet-status, [class*="status-chip"]) {
  border-radius: 6px;
}

dialog {
  max-width: calc(100vw - 28px);
}

dialog[open] {
  animation: ui-dialog-in .16s ease-out;
}

dialog::backdrop {
  background: rgba(7, 17, 27, .56);
  backdrop-filter: blur(3px);
}

@keyframes ui-dialog-in {
  from { opacity: 0; transform: translateY(6px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1180px) {
  body.ui-member-page .catalog-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  body.ui-member-page .catalog-ranking {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  body.admin-page .admin-layout,
  body.ui-member-page .center-layout {
    display: block;
    min-height: 0;
  }

  body.admin-page .admin-sidebar,
  body.ui-member-page .side-nav {
    position: sticky;
    top: 68px;
    z-index: 20;
  }

  body.ui-member-page .member-menu-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    color: var(--ui-text);
    background: var(--ui-surface);
    cursor: pointer;
  }

  body.ui-member-page .member-menu-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    transition: transform .2s ease;
  }

  body.ui-member-page .center-layout > .side-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 42;
    display: flex;
    width: min(326px, calc(100vw - 48px));
    height: 100dvh;
    box-sizing: border-box;
    flex-direction: column;
    gap: 4px;
    padding: 20px 14px 86px;
    border-right: 1px solid var(--ui-line);
    border-bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 18px 0 54px rgba(14,26,40,.2);
    transform: translateX(-105%);
    transition: transform .24s cubic-bezier(.2,.8,.2,1);
  }

  body.ui-member-page.member-menu-open .center-layout > .side-nav {
    transform: translateX(0);
  }

  body.ui-member-page .member-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 41;
    display: block;
    border: 0;
    background: rgba(9,18,30,.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.ui-member-page.member-menu-open .member-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.ui-member-page.member-menu-open {
    overflow: hidden;
  }

  body.admin-page .admin-sidebar-label,
  body.ui-member-page .side-nav-label {
    display: block;
    margin: 17px 8px 5px;
  }

  body.admin-page .admin-sidebar a,
  body.ui-member-page .side-nav a {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    white-space: nowrap;
  }

  body.ui-member-page.member-menu-open header.nav .nav-tools {
    position: fixed;
    right: auto;
    bottom: 14px;
    left: 14px;
    z-index: 44;
    display: flex;
    width: min(298px, calc(100vw - 76px));
    box-sizing: border-box;
    justify-content: stretch;
    padding: 8px;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    background: var(--ui-surface);
    box-shadow: 0 8px 24px rgba(14,26,40,.16);
  }

  body.ui-member-page.member-menu-open header.nav .nav-tools .menu-control,
  body.ui-member-page.member-menu-open header.nav .nav-tools .icon-control {
    flex: 1;
  }

  body.ui-member-page.member-menu-open header.nav .nav-tools .control-popover {
    top: auto;
    right: auto;
    bottom: calc(100% + 8px);
    left: 0;
    transform-origin: bottom left;
  }

  body.admin-page .admin-content,
  body.ui-member-page .center-main:not(.agent-workbench) {
    width: 100%;
    padding: 28px 20px 64px;
  }

  body.ui-member-page .member-main-grid,
  body.ui-member-page .catalog-layout {
    grid-template-columns: 1fr;
  }

  body.ui-member-page :is(.catalog-sidebar, .catalog-ranking) {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  body.admin-page .admin-topbar-title {
    display: none;
  }

  body.admin-page .admin-page-heading,
  body.ui-member-page :is(.member-hero, .catalog-head, .page-heading) {
    display: block;
  }

  body.admin-page .admin-content,
  body.ui-member-page .center-main:not(.agent-workbench) {
    padding: 24px 16px 56px;
  }

  body.admin-page :is(.panel, .admin-section),
  body.ui-member-page :is(.panel, .member-panel, .wallet-panel) {
    padding: 17px;
  }

  body.admin-page :is(.admin-metrics, .tool-hero, .tool-kpis, .usage-overview, .detail-kpis, .audit-summary),
  body.ui-member-page .member-kpis {
    grid-template-columns: 1fr 1fr;
  }

  body.admin-page :is(.records-toolbar, .usage-filters, .call-toolbar, .tool-filterbar, .range-toolbar, .audit-filters, .account-searchbar) > * {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 430px) {
  body.admin-page :is(.admin-metrics, .tool-hero, .tool-kpis, .usage-overview, .detail-kpis, .audit-summary),
  body.ui-member-page .member-kpis {
    grid-template-columns: 1fr;
  }
}

/* Keep the administration shell stable while the navigation and workspace
   scroll independently on desktop. Mobile keeps the existing single-page
   flow so the horizontal menu remains usable. */
@media (min-width: 901px) {
  html:has(body.admin-page),
  body.admin-page {
    height: 100%;
    overflow: hidden;
  }

  body.admin-page > header.nav {
    flex: 0 0 76px;
    box-sizing: border-box;
  }

  body.admin-page .admin-layout {
    height: calc(100vh - 76px);
    min-height: 0;
    overflow: hidden;
  }

  body.admin-page .admin-sidebar {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body.admin-page .admin-content {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

/* Canonical user-center scroll contract. Every public center page uses the
   same viewport chain: the left navigation and right content scroll
   independently on desktop, while the compact mobile layout remains intact.
   The employee studio has its own tighter workspace contract. */
@media (min-width: 961px) {
  body.center-shell.ui-member-page:not(.agent-studio-shell) {
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.center-shell.ui-member-page:not(.agent-studio-shell) > header.nav {
    box-sizing: border-box;
    height: 76px !important;
    min-height: 76px !important;
  }

  body.center-shell.ui-member-page:not(.agent-studio-shell) .center-layout {
    height: calc(100dvh - 76px) !important;
    min-height: 0 !important;
    align-items: stretch !important;
    overflow: hidden !important;
  }

  body.center-shell.ui-member-page:not(.agent-studio-shell) .center-layout > .side-nav {
    position: relative !important;
    top: auto !important;
    align-self: stretch !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body.center-shell.ui-member-page:not(.agent-studio-shell) .center-layout > .center-main {
    height: 100% !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

/* Shared header motion for member, documentation, and administration pages. */
body.ui-member-page > header.nav,
body.admin-page > header.nav,
body.docs-page > header.nav {
  transition: min-height .28s cubic-bezier(.2,.8,.2,1), padding .28s cubic-bezier(.2,.8,.2,1), background .28s ease, border-color .28s ease, box-shadow .28s ease, backdrop-filter .28s ease;
}

body.ui-member-page > header.nav.is-scrolled,
body.admin-page > header.nav.is-scrolled,
body.docs-page > header.nav.is-scrolled {
  min-height: 62px;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom-color: var(--ui-line);
  background: color-mix(in srgb, var(--ui-surface) 92%, transparent);
  box-shadow: 0 12px 34px rgba(22, 34, 51, .11);
  backdrop-filter: blur(20px) saturate(1.2);
}

body.ui-member-page > header.nav.is-scrolled .brand img,
body.admin-page > header.nav.is-scrolled .brand img,
body.docs-page > header.nav.is-scrolled .brand img {
  transform: scale(.9);
}

/* The scroll state must not change the header's layout height. Shrinking the
   sticky header at a low scroll threshold makes the document move underneath
   the pointer and can repeatedly cross the threshold, causing visible jitter. */
body.ui-member-page > header.nav,
body.admin-page > header.nav,
body.docs-page > header.nav {
  min-height: 76px;
  padding-top: 14px;
  padding-bottom: 14px;
  transition: background .28s ease, border-color .28s ease, box-shadow .28s ease, backdrop-filter .28s ease;
}
body.ui-member-page > header.nav.is-scrolled,
body.admin-page > header.nav.is-scrolled,
body.docs-page > header.nav.is-scrolled {
  min-height: 76px;
  padding-top: 14px;
  padding-bottom: 14px;
}
@media (max-width: 720px) {
  header.nav.nav-over-hero,
  header.nav.nav-over-hero.is-scrolled,
  body.ui-member-page > header.nav,
  body.admin-page > header.nav,
  body.docs-page > header.nav,
  body.ui-member-page > header.nav.is-scrolled,
  body.admin-page > header.nav.is-scrolled,
  body.docs-page > header.nav.is-scrolled {
    min-height: 68px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}
header.nav.nav-over-hero.is-scrolled {
  min-height: 76px;
  padding-top: 14px;
  padding-bottom: 14px;
}
@media (max-width: 720px) {
  header.nav.nav-over-hero.is-scrolled {
    min-height: 68px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}
