/* Approved charcoal masthead. Scoped to the default navigation, not page content. */
.mt-refined-header.mt-refined-header {
  --header-ink: #111214;
  --header-muted: #b7bbc3;
  display: grid;
  grid-template-areas: "brand nav actions";
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(20px, 2.5vw, 36px);
  row-gap: 0;
  min-height: 76px;
  height: auto;
  padding: 0 max(24px, calc((100vw - 1400px) / 2));
  border: 0;
  border-radius: 0;
  background: var(--header-ink);
  color: #fff;
  box-shadow: none;
}
.mt-refined-header.mt-refined-header .brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 76px;
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 2vw, 32px);
  text-decoration: none;
}
.mt-refined-header.mt-refined-header .mt-wordmark {
  font-family: Arial, Helvetica, system-ui, sans-serif !important;
  font-weight: 400 !important;
  font-size: inherit;
  letter-spacing: -0.035em !important;
  gap: 0.5em !important;
  line-height: 1;
}
.mt-refined-header.mt-refined-header .mt-wordmark-mark {
  width: 1.24em !important;
  height: 1.24em !important;
}
.mt-refined-header.mt-refined-header [data-mt-primary-links] {
  grid-area: nav;
  position: static;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 2vw, 32px);
  width: auto;
  min-width: 0;
  height: 76px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.mt-refined-header.mt-refined-header [data-mt-primary-links] > a {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--header-muted);
  font-family: Arial, Helvetica, system-ui, sans-serif;
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-decoration: none;
  text-transform: none;
  box-shadow: none;
  white-space: nowrap;
}
.mt-refined-header.mt-refined-header [data-mt-primary-links] > a:hover,
.mt-refined-header.mt-refined-header [data-mt-primary-links] > a[aria-current="page"] {
  background: transparent;
  color: #fff;
}
.mt-refined-header [data-mt-primary-links] > a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3158ff;
}
.mt-refined-header.mt-refined-header :is(.topbar-actions, .top-actions, .header-actions) {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 14px;
  min-width: 0;
  margin: 0;
}
body .mt-refined-header.mt-refined-header :is(.header-start, .button-nav:not(.button-secondary)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  height: 44px;
  padding: 0 24px;
  border: 1px solid #fff !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #111214 !important;
  box-shadow: none;
  font: 400 15px/1 Arial, Helvetica, system-ui, sans-serif;
  letter-spacing: -0.01em;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
}
body .mt-refined-header.mt-refined-header :is(.header-start, .button-nav:not(.button-secondary)):hover {
  background: #e7e9ee !important;
  border-color: #e7e9ee !important;
  color: #111214 !important;
}
.mt-refined-header.mt-refined-header :is(.topbar-menu-trigger, .topbar-utility, .button-secondary, .text-btn) {
  min-height: 44px;
  height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--header-muted);
  font: 400 14px/1.3 Arial, Helvetica, system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
}
.mt-refined-header.mt-refined-header :is(.topbar-menu-trigger, .topbar-utility, .button-secondary, .text-btn):hover {
  background: transparent;
  color: #fff;
}
.mt-refined-header.mt-refined-header .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 1px solid #5c6069;
  border-radius: 50% !important;
  background: transparent;
  color: #fff;
  font-size: 13px;
}
.mt-refined-header.mt-refined-header :is(a, button, summary, input):focus-visible {
  outline: 2px solid #8ea7ff;
  outline-offset: 4px;
}
/* Search is a real existing control, not squeezed into the four-link masthead. */
.mt-refined-header.mt-refined-header.topbar-with-search {
  grid-template-areas: "brand nav actions" "search search search";
}
.mt-refined-header.mt-refined-header .topbar-search {
  grid-area: search;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 12px;
}
.mt-refined-header .header-more { position: relative; }
.mt-refined-header.mt-refined-header .header-more > summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.mt-refined-header .header-more > summary::-webkit-details-marker { display: none; }
.mt-refined-header .header-more-links {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 100;
  display: grid;
  gap: 2px;
  width: min(230px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid #383b42;
  background: #17191d;
}
.mt-refined-header .header-more-links a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  color: #fff;
  font: 400 14px/1.4 Arial, Helvetica, sans-serif;
  text-decoration: none;
}
.mt-refined-header .header-more-links a:hover { background: #2a2e35; }
@media (max-width: 1200px) {
  .mt-refined-header.mt-refined-header { column-gap: 24px; }
  .mt-refined-header.mt-refined-header .brand { font-size: 27px; }
  .mt-refined-header.mt-refined-header [data-mt-primary-links] { gap: 24px; }
  .mt-refined-header.mt-refined-header :is(.topbar-actions, .top-actions, .header-actions) { gap: 10px; }
}
@media (max-width: 900px) {
  .mt-refined-header.mt-refined-header,
  .mt-refined-header.mt-refined-header.topbar-with-search {
    grid-template-areas: "brand actions" "nav nav" "search search";
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    padding: 0 24px;
  }
  .mt-refined-header.mt-refined-header .brand { min-height: 64px; font-size: 27px; }
  .mt-refined-header.mt-refined-header [data-mt-primary-links] { height: 48px; gap: 28px; }
  .mt-refined-header.mt-refined-header [data-mt-primary-links] > a { height: 44px; min-height: 44px; font-size: 15px; }
  .mt-refined-header.mt-refined-header .topbar-search { margin-top: 12px; }
}
@media (max-width: 600px) {
  .mt-refined-header.mt-refined-header,
  .mt-refined-header.mt-refined-header.topbar-with-search {
    padding: 0 16px;
    column-gap: 12px;
  }
  .mt-refined-header.mt-refined-header .brand { min-height: 68px; font-size: 24px; }
  .mt-refined-header.mt-refined-header [data-mt-primary-links] { justify-content: space-between; gap: 12px; height: 48px; }
  .mt-refined-header.mt-refined-header [data-mt-primary-links] > a { font-size: 14px; }
  body .mt-refined-header.mt-refined-header :is(.header-start, .button-nav:not(.button-secondary)) { padding: 0 14px; min-height: 38px; height: 38px; font-size: 13px; }
  .mt-refined-header.mt-refined-header :is(.topbar-actions, .top-actions, .header-actions) { gap: 8px; }
  .mt-refined-header.mt-refined-header :is(.topbar-menu-trigger, .topbar-utility, .button-secondary, .text-btn) { font-size: 14px; }
  .mt-refined-header.mt-refined-header .topbar-menu-panel { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; max-width: none; }
}
@media (max-width: 420px) {
  .mt-refined-header.mt-refined-header,
  .mt-refined-header.mt-refined-header.topbar-with-search {
    grid-template-areas: "brand brand" "nav nav" "actions actions" "search search";
    grid-template-columns: 1fr 1fr;
  }
  .mt-refined-header.mt-refined-header .brand { min-height: 56px; }
  .mt-refined-header.mt-refined-header :is(.topbar-actions, .top-actions, .header-actions) { justify-content: flex-end; padding: 0 0 8px; }
}
/* Keep the live feed's established mobile bottom navigation and safe-area space. */
@media (max-width: 820px) {
  header.topbar.mt-refined-header [data-mt-primary-links] {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    width: 100%;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding: 0 16px env(safe-area-inset-bottom, 0px);
    justify-content: space-between;
    border-top: 1px solid #30333a;
    background: #111214;
  }
}

/* Older marketplace shells hide their entire native header on desktop.
 * A refined masthead remains visible without changing the workspace below it. */
.marketplace-app-shell > .v72-route-header:has(> .mt-refined-header) {
  display: block;
}

/* The secondary sign-in link is a utility, not a second primary button. */
body .mt-refined-header.mt-refined-header .topbar-actions .button-secondary {
  border: 0 !important;
  background: transparent !important;
  color: var(--header-muted) !important;
}
body .mt-refined-header.mt-refined-header .topbar-actions .button-secondary:hover,
body .mt-refined-header.mt-refined-header .topbar-actions .button-secondary:focus-visible {
  background: transparent !important;
  color: #fff !important;
}

/* Refined utilities must remain visible; legacy shells hide account menus on
 * narrow screens and replace their labels with avatar-only decoration. */
.mt-refined-header.mt-refined-header .topbar-actions .topbar-menu {
  display: block;
}
.mt-refined-header.mt-refined-header .topbar-menu-trigger {
  display: inline-flex;
  align-items: center;
  width: auto;
  overflow: visible;
}
.mt-refined-header.mt-refined-header .topbar-menu-trigger span:first-child::before {
  content: none;
}
.mt-refined-header.mt-refined-header .topbar-menu-panel {
  min-width: 0;
}

/* Static headers reveal acquisition actions only after account state resolves. */
body .mt-refined-header [data-mt-guest-only="true"][hidden] {
  display: none !important;
}
