/* A floating navigation surface with room around the logo and controls. */
body.editorial-site:is(.public-body, .auth-body, .workspace-body) > .topbar,
body.editorial-site.counterparty-body .site-header {
  position: sticky;
  top: 12px;
  width: calc(100% - 48px) !important;
  max-width: 1460px !important;
  min-height: 76px;
  margin: 14px auto 24px !important;
  padding: 12px 20px;
  gap: 24px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent) !important;
  border-radius: 24px !important;
  background: linear-gradient(115deg, color-mix(in srgb, var(--surface) 94%, var(--brand-pale)), color-mix(in srgb, var(--surface) 88%, transparent)) !important;
  box-shadow: 0 10px 30px rgb(0 0 0 / 10%), inset 0 1px 0 rgb(255 255 255 / 8%) !important;
  backdrop-filter: blur(18px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
  z-index: 150;
  transition: box-shadow .2s ease, border-color .2s ease;
}

body.editorial-site:is(.public-body, .auth-body, .workspace-body) > .topbar.is-scrolled {
  box-shadow: 0 14px 36px rgb(0 0 0 / 17%), inset 0 1px 0 rgb(255 255 255 / 8%) !important;
}

.editorial-site .topbar > .brand { flex-shrink: 0; }
.editorial-site .topbar .topbar-actions { gap: 12px; }
.editorial-site .topbar .public-nav { gap: 2px; }

.editorial-site .topbar .public-nav > a,
.editorial-site .topbar .public-catalog > summary,
.editorial-site .topbar .public-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 999px !important;
  line-height: 1.3;
  transition: background-color .18s ease, color .18s ease;
}

.editorial-site .topbar .public-nav > a:hover,
.editorial-site .topbar .public-catalog > summary:hover,
.editorial-site .topbar .public-catalog[open] > summary,
.editorial-site .topbar .public-login:hover,
.editorial-site .topbar .public-nav > a[aria-current] {
  background: var(--brand-pale) !important;
  color: var(--brand) !important;
  text-decoration: none;
}

.editorial-site .topbar .public-register,
.editorial-site .topbar .owner-entry {
  min-height: 42px;
  border-radius: 14px;
  padding: 11px 16px;
  white-space: nowrap;
}

.editorial-site .topbar .owner-entry {
  background: var(--brand-pale);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  color: var(--brand);
}

.editorial-site .topbar .owner-entry:hover { background: var(--surface-raised); }

.editorial-site .topbar .theme-toggle {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent) !important;
}

.editorial-site .topbar .public-catalog-panel {
  top: calc(100% + 20px);
  border-radius: 20px;
  box-shadow: var(--shadow-overlay);
}

.editorial-site .topbar :is(.public-mobile-menu, .mobile-menu) > summary {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 0 !important;
  border-radius: 50%;
  background: var(--brand-pale) !important;
}

.editorial-site .topbar :is(.public-mobile-menu > div, .mobile-menu-panel) {
  position: absolute;
  top: calc(100% + 20px);
  right: 0;
  width: min(390px, calc(100vw - 48px));
  max-height: calc(100dvh - 116px);
  border-radius: 20px;
}

@media (max-width: 1200px) {
  body.editorial-site:is(.public-body, .auth-body, .workspace-body) > .topbar {
    padding-inline: 16px;
    gap: 16px;
  }
  .editorial-site .topbar .topbar-actions { gap: 8px; }
  .editorial-site .topbar .public-nav > a,
  .editorial-site .topbar .public-catalog > summary { padding-inline: 9px; }
}

@media (max-width: 760px) {
  body.editorial-site:is(.public-body, .auth-body, .workspace-body) > .topbar,
  body.editorial-site.counterparty-body .site-header {
    top: 8px;
    width: calc(100% - 24px) !important;
    min-height: 64px;
    margin: 10px auto 16px !important;
    padding: 9px 12px;
    gap: 10px;
    border-radius: 22px !important;
  }
  .editorial-site .topbar .topbar-actions { gap: 6px; }
  .editorial-site .topbar .public-login { padding-inline: 9px; font-size: 12px; }
}

@media (max-width: 380px) {
  body.editorial-site:is(.public-body, .auth-body, .workspace-body) > .topbar {
    width: calc(100% - 16px) !important;
    padding-inline: 9px;
    gap: 6px;
  }
  .editorial-site .topbar .public-login { padding-inline: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  body.editorial-site > .topbar,
  .editorial-site .topbar :is(.public-nav > a, .public-catalog > summary, .public-login) {
    transition: none;
  }
}
