/* Unified topbar — keep inner pages consistent with dashboard sections. */
:root {
  --header-h: 68px;
  --header-height: 68px;
  --layout-max: 1580px;
  --layout-gutter: clamp(18px, 3vw, 46px);
}

.topbar {
  position: sticky;
  z-index: 60;
  top: 0;
  height: var(--header-h);
  color: var(--white);
  background: var(--navy-950, #082a49);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.topbar__inner {
  width: min(var(--layout-max), 100%);
  height: 100%;
  margin: auto;
  padding: 0 var(--layout-gutter);
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

.topbar__brand {
  width: 92px;
  display: inline-flex;
  align-items: center;
}

.topbar__brand img {
  width: 100%;
}

.topbar__nav {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 1.8vw, 32px);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.topbar__nav::-webkit-scrollbar {
  display: none;
}

.topbar__nav a {
  position: relative;
  height: var(--header-h);
  padding: 0;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1;
}

.topbar__nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--coral, #f06459);
  transform: scaleX(0);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.topbar__nav a:hover,
.topbar__nav a:focus-visible,
.topbar__nav a.is-current {
  color: var(--white);
  font-weight: 600;
}

.topbar__nav a.is-current {
  text-shadow: 0 0 18px rgba(240, 100, 89, 0.22);
}

.topbar__nav a:hover::after,
.topbar__nav a:focus-visible::after,
.topbar__nav a.is-current::after {
  transform: scaleX(1);
}

/* Home hero overlay header — same nav component as inner pages. */
.topbar--home {
  position: absolute;
  z-index: 20;
  inset: 0 0 auto;
  height: var(--header, 96px);
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
}

.topbar--home .topbar__inner {
  width: 100%;
  max-width: none;
  padding-inline: var(--gutter, clamp(20px, 4vw, 72px));
  grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr);
  gap: 28px;
}

.topbar--home .topbar__brand {
  width: 102px;
}

	.topbar--home .topbar__nav {
  gap: clamp(12px, 1.6vw, 28px);
}

.topbar--home .topbar__nav a {
  height: auto;
  padding: 12px 0;
  font-size: 14px;
}

@media (max-width: 1080px) {
  .topbar--home {
    position: fixed;
    background: rgba(11, 42, 72, 0.96);
  }

  .topbar--home .topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    grid-template-columns: none;
  }

  .topbar--home .topbar__brand {
    width: 90px;
    flex: 0 0 auto;
  }

  .topbar--home .topbar__actions {
    margin-left: auto;
    flex: 0 0 auto;
  }

  .topbar--home .topbar__nav {
    position: fixed;
    inset: var(--header, 78px) 0 0;
    z-index: 40;
    padding: 20px var(--gutter, clamp(20px, 4vw, 72px)) 36px;
    display: grid;
    align-content: start;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(11, 42, 72, 0.99);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-14px);
    transition: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .nav-open .topbar--home .topbar__nav {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .topbar--home .topbar__nav a {
    height: auto;
    min-height: 56px;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
    font-family: "Songti SC", "STSong", serif;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.86);
  }

  .topbar--home .topbar__nav a::after,
  .topbar--home .topbar__nav a::before {
    display: none;
    content: none;
  }

  .topbar--home .topbar__nav a:hover,
  .topbar--home .topbar__nav a:focus-visible,
  .topbar--home .topbar__nav a.is-current {
    color: var(--coral, #f06459);
    padding-left: 0;
    border-left: 0;
    background: transparent;
  }

  .topbar--home .menu-toggle {
    display: block;
  }
}

@media (max-width: 640px) {
  .topbar--home .topbar__brand {
    width: 80px;
  }
}

.topbar__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-menu {
  position: relative;
}

.member-menu__trigger {
  min-height: 40px;
  padding: 2px 4px 2px 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.member-menu__trigger:hover,
.member-menu__trigger:focus-visible {
  opacity: 0.92;
  outline: none;
}

.member-menu__trigger:focus-visible {
  box-shadow: 0 0 0 2px rgba(240, 100, 89, 0.9);
}

.member-menu__avatar {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.member-menu__name {
  max-width: 7em;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-menu__chevron {
  width: 0;
  height: 0;
  margin-top: 2px;
  border-top: 5px solid rgba(255, 255, 255, 0.72);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-top-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.member-menu.is-open .member-menu__trigger {
  background: rgba(255, 255, 255, 0.08);
}

.member-menu.is-open .member-menu__chevron {
  transform: rotate(180deg);
  border-top-color: #fff;
}

.member-menu__panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  min-width: 196px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8e0e8;
  border-top: 3px solid var(--coral, #f06459);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 18px 42px rgba(8, 42, 73, 0.16);
}

.member-menu__panel::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 0;
  left: 0;
  height: 8px;
}

.member-menu__panel[hidden] {
  display: none !important;
}

.member-menu__panel-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, #f6f9fc 0%, #fff 100%);
  border-bottom: 1px solid #e8edf2;
}

.member-menu__panel-avatar {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: cover;
  border: 1px solid #d8e0e8;
  border-radius: 50%;
  background: #eef3f7;
}

.member-menu__panel-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.member-menu__panel-name {
  overflow: hidden;
  color: var(--navy-950, #082a49);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-menu__panel-hint {
  color: #6b8399;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.member-menu__panel-body {
  padding: 6px;
}

.member-menu__item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 14px;
  gap: 10px;
  align-items: center;
  padding: 11px 10px;
  border: 0;
  border-radius: 0;
  color: #314255;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.member-menu__item + .member-menu__item {
  margin-top: 2px;
}

.member-menu__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #58728a;
}

.member-menu__item-icon svg {
  width: 16px;
  height: 16px;
}

.member-menu__item-label {
  min-width: 0;
}

.member-menu__item-arrow {
  opacity: 0;
  color: var(--blue, #1554a2);
  font-size: 12px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.member-menu__item:hover,
.member-menu__item:focus-visible {
  color: var(--blue, #1554a2);
  background: #f3f8ff;
  outline: none;
}

.member-menu__item:hover .member-menu__item-icon,
.member-menu__item:focus-visible .member-menu__item-icon {
  color: var(--blue, #1554a2);
}

.member-menu__item:hover .member-menu__item-arrow,
.member-menu__item:focus-visible .member-menu__item-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.member-menu__item--danger {
  color: #8f3a3a;
}

.member-menu__item--danger .member-menu__item-icon {
  color: #b85c5c;
}

.member-menu__item--danger:hover,
.member-menu__item--danger:focus-visible {
  color: var(--coral-deep, #e9544d);
  background: #fff4f3;
}

.member-menu__item--danger:hover .member-menu__item-icon,
.member-menu__item--danger:focus-visible .member-menu__item-icon {
  color: var(--coral, #f06459);
}

.member-menu__item--danger .member-menu__item-arrow {
  color: var(--coral, #f06459);
}

.topbar .member-link {
  position: relative;
  min-height: 40px;
  max-width: 220px;
  padding: 0;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background 180ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.topbar .member-link::before,
.topbar .member-link::after {
  content: none;
}

.topbar .member-link:hover,
.topbar .member-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.topbar .member-link:active {
  background: rgba(255, 255, 255, 0.12);
}

.topbar .member-link:focus-visible {
  outline: 2px solid rgba(240, 100, 89, 0.9);
  outline-offset: 2px;
}

.topbar .member-link--out {
  align-items: center;
  padding: 0 14px;
  font-weight: 600;
}

.topbar .member-link--in {
  padding: 0;
}

.topbar .member-link__avatar {
  width: 40px;
  min-width: 40px;
  height: auto;
  align-self: stretch;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar .member-link__avatar::after {
  content: none;
}

.topbar .member-link__copy {
  min-width: 0;
  padding: 6px 12px 6px 10px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.topbar .member-link__name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .member-link__hint {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar .member-link__arrow {
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  color: #fff;
  background: transparent;
  border: 0;
  opacity: 1;
  outline: none;
}

.menu-toggle:focus-visible {
  box-shadow: none;
  outline: 2px solid rgba(240, 100, 89, 0.85);
  outline-offset: 2px;
}

.menu-toggle__box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: auto;
}

.menu-toggle__icon {
  position: absolute;
  inset: 0;
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
  transition: opacity 160ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-toggle__icon--open {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.menu-toggle__icon--close {
  opacity: 0;
  transform: rotate(-45deg) scale(0.85);
  pointer-events: none;
}

.nav-open .menu-toggle {
  color: #fff;
  background: transparent;
  border: 0;
  opacity: 1;
}

.nav-open .menu-toggle__icon--open {
  opacity: 0;
  transform: rotate(45deg) scale(0.85);
}

.nav-open .menu-toggle__icon--close {
  opacity: 1;
  transform: none;
}

/* Suppress legacy 1px span bars from older CSS */
.menu-toggle > span:not(.menu-toggle__box) {
  display: none !important;
}

/* Shared content width — align with topbar__inner. */
.layout-inner,
.hero-band__inner,
.dashboard-shell,
.site-footer__inner,
.incentive-shell,
.post-layout,
.post-hero__inner,
.content-hero__inner,
.content-shell,
.page-container {
  width: min(var(--layout-max), 100%);
  max-width: 100%;
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
  box-sizing: border-box;
}

.site-footer {
  padding-inline: 0;
}

@media (max-width: 1180px) {
  .topbar__inner {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    padding: 0 20px;
  }

  .topbar__nav {
    gap: 16px;
  }

  .topbar__nav a {
    font-size: 13px;
  }

  .topbar .member-link__hint {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 64px;
    --header-height: 64px;
  }

  .topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    grid-template-columns: none;
  }

  .topbar__brand {
    flex: 0 0 auto;
  }

  .topbar__actions {
    margin-left: auto;
    flex: 0 0 auto;
  }

  .menu-toggle {
    display: block;
  }

  .topbar__nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 40;
    padding: 12px clamp(18px, 4vw, 32px) 32px;
    display: grid;
    align-content: start;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(8, 42, 73, 0.99);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .nav-open .topbar__nav {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .topbar__nav a {
    height: auto;
    min-height: 52px;
    padding: 14px 0;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.86);
  }

  .topbar__nav a::after,
  .topbar__nav a::before {
    display: none;
    content: none;
  }

  .topbar__nav a:hover,
  .topbar__nav a:focus-visible {
    color: #fff;
    padding-left: 0;
    border-left: 0;
    background: transparent;
  }

  .topbar__nav a.is-current {
    color: var(--coral, #f06459);
    padding-left: 0;
    border-left: 0;
    background: transparent;
  }

  .topbar .member-link {
    min-height: 36px;
    max-width: 160px;
    padding: 0;
  }

  .topbar .member-link--out {
    padding: 0 12px;
  }

  .member-menu__avatar {
    width: 28px;
    height: 28px;
  }

  .member-menu__name {
    max-width: 5.5em;
    font-size: 13px;
  }

  .member-menu__chevron {
    margin-top: 1px;
    border-top-width: 4px;
    border-right-width: 3px;
    border-left-width: 3px;
  }
}
