.header-topnote {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.header-topnote-inner {
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-topnote-text {
  font-size: 13px;
  line-height: 1.25;
  color: var(--muted);
  text-align: center;
  max-width: 1000px;
}

.header-topnote-text b {
  color: var(--text);
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mobile-nav-wrap {
  display: none;
  padding-bottom: 14px;
}

.header-topnote-mobile {
  margin-top: 10px;
}

.header-topnote-mobile-bold {
  color: var(--text);
}

.header,
.header-inner,
.nav {
  overflow: visible;
}

.nav-dd {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dd-trigger {
  position: relative;
  border-radius: 14px;
  padding: 8px 12px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.nav-dd:hover .nav-dd-trigger,
.nav-dd.open .nav-dd-trigger {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.nav-dd::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.mega {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 400px;
  max-width: min(720px, 92vw);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 18, 35, .98), rgba(10, 14, 28, .97));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
  z-index: 80;
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.985);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.mega::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.mega-narrow {
  width: 220px;
}

.mega-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  margin-bottom: 10px;
}

.mega-title {
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--text);
}

.mega-all {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(0, 0, 0, .06);
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
  font-size: 13px;
}

.mega-all:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .18);
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 4px;
}

.mega-grid-1 {
  grid-template-columns: 1fr;
}

.mega-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 12px;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .06);
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.mega-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .18);
}

.mi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mi-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  padding: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.mi-name {
  color: var(--text);
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dd:hover .mega,
.nav-dd:focus-within .mega,
.nav-dd.open .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

body.theme-white .header-topnote {
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

body.theme-white .nav-dd:hover .nav-dd-trigger,
body.theme-white .nav-dd.open .nav-dd-trigger {
  background: rgba(15, 23, 42, .05);
  color: #0f172a;
  border-color: rgba(15, 23, 42, .10);
}

body.theme-white .mega {
  border: 1px solid rgba(15, 23, 42, .10);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(245, 247, 252, .96));
  box-shadow:
    0 20px 60px rgba(15, 23, 42, .14),
    0 6px 18px rgba(15, 23, 42, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.theme-white .mega::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .80),
    inset 0 0 0 1px rgba(15, 23, 42, .03);
}

body.theme-white .mega-head {
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

body.theme-white .mega-title {
  color: #0f172a;
}

body.theme-white .mega-all {
  color: #475569;
  background: rgba(15, 23, 42, .04);
  border-color: rgba(15, 23, 42, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

body.theme-white .mega-all:hover {
  color: #2563eb;
  background: #ffffff;
  border-color: rgba(37, 99, 235, .18);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .08);
}

body.theme-white .mega-item {
  background: rgba(248, 250, 252, .92);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}

body.theme-white .mega-item:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, .20);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, .08),
    0 4px 12px rgba(37, 99, 235, .06);
}

body.theme-white .mi-logo {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .06);
}

body.theme-white .mi-name {
  color: #0f172a;
}

body.theme-white .mega a {
  color: inherit;
}

#mobileNav .mnav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#mobileNav .mnav-btn {
  width: 100%;
  justify-content: flex-start;
}

#mobileNav .macc-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#mobileNav .macc-main {
  flex: 1 1 auto;
  min-width: 0;
}

#mobileNav .macc-toggle {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding-left: 0;
  padding-right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mobileNav .macc-chev {
  display: inline-block;
  transition: transform .16s ease;
  font-size: 16px;
  line-height: 1;
}

#mobileNav .macc.open .macc-chev {
  transform: rotate(180deg);
}

#mobileNav .macc-panel {
  margin-top: 10px;
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height .22s ease, opacity .22s ease, transform .22s ease;
}

#mobileNav .macc.open .macc-panel {
  max-height: 900px;
  opacity: 1;
  transform: translateY(0);
}

#mobileNav .macc-all,
#mobileNav .macc-sub {
  width: 100%;
  justify-content: flex-start;
}

@media (max-width: 720px) {
  .header-topnote-inner {
    padding: 7px 0;
  }

  .header-topnote-text {
    font-size: 12px;
    max-width: 100%;
    padding: 0 10px;
  }

  .mega {
    width: min(92vw, 520px);
  }

  .mega-grid {
    grid-template-columns: 1fr;
  }
}

