.compact-site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--thayu-border);
  box-shadow: 0 6px 20px rgba(33, 37, 41, .05);
  position: sticky;
  top: 0;
  z-index: 200;
}

.compact-header-row {
  align-items: center;
  display: flex;
  gap: 18px;
  min-height: 74px;
}

.header-logo-wrap {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  min-width: 180px;
}

.custom-logo-link {
  align-items: center;
  display: inline-flex;
}

.custom-logo {
  height: 48px;
  max-height: 48px;
  width: auto;
}

.compact-primary-nav {
  flex: 1;
}

.compact-header-menu {
  align-items: center;
  display: flex;
  gap: 7px;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
}

.compact-header-menu > li > a,
.profile-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #146c43;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  gap: 6px;
  line-height: 1;
  padding: 10px 12px;
  white-space: nowrap;
}

.compact-header-menu > li > a:hover,
.compact-header-menu > li > a:focus-visible,
.compact-profile-item:focus-within .profile-toggle,
.compact-profile-item:hover .profile-toggle {
  background: #f1f8f4;
  color: #198754;
  outline: none;
}

.guest-signup-link > a {
  background: #198754 !important;
  color: #ffffff !important;
  padding-inline: 16px !important;
}

.guest-signup-link > a:hover,
.guest-signup-link > a:focus-visible {
  background: #146c43 !important;
  color: #ffffff !important;
}

.profile-menu-item {
  position: relative;
}

/* Keep the parent hover area connected to the dropdown. */
.compact-profile-item::after {
  content: "";
  height: 12px;
  left: 0;
  pointer-events: auto;
  position: absolute;
  right: 0;
  top: 100%;
}

.profile-menu-caret {
  font-size: 11px;
  margin-left: 2px;
  transition: transform .2s ease;
}

.compact-profile-item:hover .profile-menu-caret,
.compact-profile-item:focus-within .profile-menu-caret {
  transform: rotate(180deg);
}

.compact-header-menu .compact-profile-dropdown {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid var(--thayu-border);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(33, 37, 41, .14);
  display: none;
  flex-direction: column;
  gap: 3px;
  list-style: none;
  margin: 0;
  min-width: 238px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: max-content;
  z-index: 300;
}

.compact-header-menu .compact-profile-dropdown::before {
  content: "";
  height: 12px;
  left: 0;
  position: absolute;
  right: 0;
  top: -10px;
}

.compact-header-menu .compact-profile-item:hover .compact-profile-dropdown,
.compact-header-menu .compact-profile-item:focus-within .compact-profile-dropdown,
.compact-header-menu .compact-profile-dropdown:hover {
  display: grid;
}

.compact-profile-dropdown li {
  display: block;
  margin: 0;
  width: 100%;
}

.compact-profile-dropdown a {
  align-items: center;
  border-radius: 12px;
  color: #212529;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  gap: 10px;
  justify-content: flex-start;
  min-height: 40px;
  padding: 9px 12px;
  white-space: nowrap;
  width: 100%;
}

.compact-profile-dropdown a:hover,
.compact-profile-dropdown a:focus-visible {
  background: #f1f8f4;
  color: #146c43;
  outline: none;
}

.compact-profile-dropdown .profile-menu-divider {
  border-top: 1px solid var(--thayu-border);
  margin-top: 4px;
  padding-top: 4px;
}

.compact-profile-dropdown .profile-menu-divider a:hover,
.compact-profile-dropdown .profile-menu-divider a:focus-visible {
  background: #fff1f1;
  color: #b42318;
}

.compact-post-button,
.site-header .compact-post-button,
.site-header a.compact-post-button {
  align-items: center;
  background: #198754 !important;
  border: 1px solid #198754 !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 18px rgba(25, 135, 84, .22);
  color: #ffffff !important;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: 42px;
  padding: 0 22px !important;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  white-space: nowrap;
}

.compact-post-button:hover,
.compact-post-button:focus-visible,
.site-header a.compact-post-button:hover,
.site-header a.compact-post-button:focus-visible {
  background: #146c43 !important;
  border-color: #146c43 !important;
  box-shadow: 0 12px 24px rgba(20, 108, 67, .28);
  color: #ffffff !important;
  outline: none;
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
}

@media (max-width: 980px) {
  .compact-header-row {
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 10px;
  }

  .header-logo-wrap {
    min-width: 150px;
  }

  .custom-logo {
    height: 42px;
    max-height: 42px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .compact-primary-nav {
    display: none;
    flex: 1 1 100%;
    order: 10;
  }

  .compact-primary-nav.is-open,
  .compact-primary-nav[aria-expanded="true"] {
    display: block;
  }

  .compact-header-menu {
    align-items: stretch;
    display: grid;
    justify-content: stretch;
  }

  .compact-header-menu > li > a,
  .profile-toggle {
    justify-content: space-between;
    width: 100%;
  }

  .guest-signup-link > a {
    justify-content: center;
  }

  .compact-profile-item::after {
    display: none;
  }

  .compact-header-menu .compact-profile-dropdown {
    box-shadow: none;
    margin-top: 6px;
    min-width: 100%;
    position: static;
    width: 100%;
  }

  .compact-header-menu .compact-profile-item:hover .compact-profile-dropdown,
  .compact-header-menu .compact-profile-item:focus-within .compact-profile-dropdown {
    display: grid;
  }

  .compact-post-button {
    margin-left: auto;
  }
}
