/* Shared header: one visual system for the landing and report pages. */
:root {
  --shared-header-height: 72px;
  --shared-header-mobile-height: 62px;
  --shared-header-width: 1510px;
  --shared-header-gutter: 28px;
  --shared-header-blue: #1769e0;
  --shared-header-line: #dae7f7;
  --shared-header-text: #0b1535;
}

html {
  scrollbar-gutter: stable;
}

body > .app-shell,
.app-shell {
  padding: 0 !important;
}

/* Higher specificity intentionally wins over legacy app-page header rules. */
header.site-header,
header.site-header.app-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: var(--shared-header-height) !important;
  min-height: var(--shared-header-height) !important;
  max-height: var(--shared-header-height) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--shared-header-line) !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: none !important;
  backdrop-filter: blur(16px) !important;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

header.site-header *,
header.site-header.app-header * {
  box-sizing: border-box;
  letter-spacing: 0;
}

header.site-header > .header-inner,
header.site-header.app-header > .header-inner.app-header-inner {
  display: grid !important;
  grid-template-columns: 220px minmax(0, 1fr) 220px !important;
  width: min(var(--shared-header-width), calc(100% - var(--shared-header-gutter))) !important;
  height: var(--shared-header-height) !important;
  min-height: var(--shared-header-height) !important;
  max-height: var(--shared-header-height) !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 24px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

header.site-header .brand,
header.site-header.app-header .brand {
  display: inline-flex !important;
  min-width: max-content !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 !important;
  color: var(--shared-header-text) !important;
  -webkit-text-fill-color: var(--shared-header-text) !important;
  font: 950 1.35rem/1 Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  justify-self: start !important;
}

header.site-header .brand > img,
header.site-header.app-header .brand > img {
  display: block !important;
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 44px !important;
  margin: 0 !important;
  border-radius: 13px !important;
  object-fit: cover !important;
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.18) !important;
}

header.site-header .brand > span,
header.site-header.app-header .brand > span {
  display: inline !important;
  overflow: visible !important;
  margin: 0 !important;
  color: var(--shared-header-text) !important;
  -webkit-text-fill-color: var(--shared-header-text) !important;
  font: inherit !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

header.site-header .brand > span > span,
header.site-header.app-header .brand-accent {
  display: inline !important;
  color: var(--shared-header-blue) !important;
  -webkit-text-fill-color: var(--shared-header-blue) !important;
  font: inherit !important;
  line-height: inherit !important;
}

header.site-header .main-nav,
header.site-header.app-header .main-nav.app-nav {
  display: flex !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(24px, 4vw, 58px) !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #12203a !important;
  font-size: 1rem !important;
  font-weight: 820 !important;
  line-height: 1 !important;
  justify-self: stretch !important;
}

header.site-header .main-nav a,
header.site-header.app-header .main-nav.app-nav a {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

header.site-header .main-nav a:hover,
header.site-header .main-nav a:focus-visible,
header.site-header.app-header .main-nav.app-nav a:hover,
header.site-header.app-header .main-nav.app-nav a:focus-visible {
  color: var(--shared-header-blue) !important;
  -webkit-text-fill-color: var(--shared-header-blue) !important;
}

header.site-header .header-actions,
header.site-header.app-header .header-actions,
header.site-header.app-header .account-actions {
  display: flex !important;
  min-width: max-content !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  justify-self: end !important;
}

header.site-header .top-button,
header.site-header.app-header .top-button,
header.site-header.app-header .account-button.top-button {
  appearance: none !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 20px !important;
  border: 1px solid #c7daf4 !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #16243b !important;
  -webkit-text-fill-color: #16243b !important;
  font: 840 0.98rem/1 Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

header.site-header .account-menu-wrap,
header.site-header.app-header .account-menu-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
}

header.site-header .account-identity-button,
header.site-header.app-header .account-identity-button {
  gap: 9px !important;
  max-width: 220px !important;
  padding: 0 14px 0 9px !important;
  border-radius: 999px !important;
}

header.site-header .account-avatar,
header.site-header.app-header .account-avatar {
  display: inline-flex !important;
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  background: #eef3fb !important;
  color: #a5b3c7 !important;
}

header.site-header .account-avatar svg,
header.site-header.app-header .account-avatar svg {
  width: 18px !important;
  height: 18px !important;
  fill: #c6d1e1 !important;
  stroke: #c6d1e1 !important;
  stroke-width: 1.5 !important;
}

header.site-header .account-button-label,
header.site-header.app-header .account-button-label {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

header.site-header .account-menu-caret,
header.site-header.app-header .account-menu-caret {
  flex: 0 0 auto !important;
  color: #7e899b !important;
  font-size: 0.78rem !important;
  transition: transform 160ms ease !important;
}

header.site-header .account-identity-button[aria-expanded="true"] .account-menu-caret,
header.site-header.app-header .account-identity-button[aria-expanded="true"] .account-menu-caret {
  transform: rotate(180deg) !important;
}

header.site-header .account-identity-button[data-state="guest"] .account-avatar,
header.site-header .account-identity-button[data-state="guest"] .account-menu-caret,
header.site-header.app-header .account-identity-button[data-state="guest"] .account-avatar,
header.site-header.app-header .account-identity-button[data-state="guest"] .account-menu-caret {
  display: none !important;
}

header.site-header .account-dropdown,
header.site-header.app-header .account-dropdown {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  right: 0 !important;
  z-index: 1300 !important;
  display: grid !important;
  width: 264px !important;
  overflow: hidden !important;
  border: 1px solid #dce4ef !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 18px 44px rgba(15, 30, 55, 0.16) !important;
}

header.site-header .account-dropdown[hidden],
header.site-header.app-header .account-dropdown[hidden] {
  display: none !important;
}

header.site-header .account-credit-summary,
header.site-header.app-header .account-credit-summary {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 5px 12px !important;
  padding: 17px 18px !important;
  border-bottom: 1px solid #e8eef6 !important;
  background: #f7faff !important;
  text-align: left !important;
}

header.site-header .account-credit-summary span,
header.site-header.app-header .account-credit-summary span {
  color: #36516f !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
}

header.site-header .account-credit-summary strong,
header.site-header.app-header .account-credit-summary strong {
  color: var(--shared-header-blue) !important;
  -webkit-text-fill-color: var(--shared-header-blue) !important;
  font-size: 0.86rem !important;
  font-weight: 900 !important;
}

header.site-header .account-credit-summary small,
header.site-header.app-header .account-credit-summary small {
  grid-column: 1 / -1 !important;
  color: #75849a !important;
  font-size: 0.72rem !important;
  font-weight: 650 !important;
  line-height: 1.45 !important;
}

header.site-header .account-dropdown-action,
header.site-header.app-header .account-dropdown-action {
  appearance: none !important;
  display: flex !important;
  width: 100% !important;
  min-height: 50px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-bottom: 1px solid #edf1f6 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #18253a !important;
  -webkit-text-fill-color: #18253a !important;
  font: 800 0.88rem/1 Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif !important;
  text-align: left !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

header.site-header .account-dropdown-action:last-child,
header.site-header.app-header .account-dropdown-action:last-child {
  border-bottom: 0 !important;
}

header.site-header .account-dropdown-action:hover,
header.site-header .account-dropdown-action:focus-visible,
header.site-header.app-header .account-dropdown-action:hover,
header.site-header.app-header .account-dropdown-action:focus-visible {
  outline: 0 !important;
  background: #f6f9fd !important;
}

header.site-header .account-dropdown-action.is-logout,
header.site-header.app-header .account-dropdown-action.is-logout {
  color: #d14343 !important;
  -webkit-text-fill-color: #d14343 !important;
}

header.site-header .top-button.primary,
header.site-header.app-header .top-button.primary,
header.site-header.app-header .account-button.top-button.primary {
  border-color: var(--shared-header-blue) !important;
  background: var(--shared-header-blue) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: 0 9px 20px rgba(23, 105, 224, 0.2) !important;
}

header.site-header .top-button.is-hidden,
header.site-header.app-header .top-button.is-hidden,
header.site-header.app-header .account-button.is-hidden,
header.site-header.app-header .mypage-button[data-state="guest"] {
  display: none !important;
}

/* Both pages switch to the compact header at exactly the same width. */
@media (max-width: 1220px) {
  header.site-header > .header-inner,
  header.site-header.app-header > .header-inner.app-header-inner {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  header.site-header .main-nav,
  header.site-header.app-header .main-nav.app-nav {
    display: none !important;
  }
}

@media (max-width: 760px) {
  header.site-header,
  header.site-header.app-header {
    height: var(--shared-header-mobile-height) !important;
    min-height: var(--shared-header-mobile-height) !important;
    max-height: var(--shared-header-mobile-height) !important;
  }

  header.site-header > .header-inner,
  header.site-header.app-header > .header-inner.app-header-inner {
    width: calc(100% - 28px) !important;
    height: var(--shared-header-mobile-height) !important;
    min-height: var(--shared-header-mobile-height) !important;
    max-height: var(--shared-header-mobile-height) !important;
    gap: 12px !important;
  }

  header.site-header .brand,
  header.site-header.app-header .brand,
  header.site-header .brand > span,
  header.site-header.app-header .brand > span {
    font-size: 1.1rem !important;
  }

  header.site-header .brand > img,
  header.site-header.app-header .brand > img {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px !important;
    border-radius: 11px !important;
  }

  header.site-header .top-button:not(.primary),
  header.site-header.app-header .top-button:not(.primary),
  header.site-header.app-header .account-button.top-button:not(.primary) {
    display: none !important;
  }

  header.site-header .account-identity-button,
  header.site-header.app-header .account-identity-button,
  header.site-header.app-header .account-button.account-identity-button {
    display: inline-flex !important;
    max-width: min(230px, 48vw) !important;
  }

  header.site-header .top-button.primary,
  header.site-header.app-header .top-button.primary,
  header.site-header.app-header .account-button.top-button.primary {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 14px !important;
    font-size: 0.9rem !important;
  }
}
