/* Compact global search. Load after the base, appearance, feed and community styles. */
.site-header { position: relative; overflow: visible; }
.site-header .header-inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  grid-template-areas: "brand search contribute appearance" "navigation navigation navigation navigation";
  align-items: center;
  column-gap: 22px;
  row-gap: 8px;
  height: auto;
  min-height: 0;
  padding-top: 12px;
  padding-bottom: 0;
  overflow: visible;
}
.site-header .header-inner > .brand { grid-area: brand; min-width: 0; font-size: 19px; gap: 9px; }
.site-header .header-inner > .brand .brand-mark { width: 40px; height: 40px; }
.site-header .header-inner > .header-search { grid-area: search; min-width: 0; width: 100%; position: relative; overflow: visible; }
.site-header .header-inner > .header-cta {
  grid-area: contribute;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 10px 13px;
  gap: 9px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}
.site-header .header-inner > .appearance-control { grid-area: appearance; margin: 0; min-width: 0; }
.site-header .appearance-control > summary { min-width: 82px; min-height: 44px; padding: 9px; }
.site-header .appearance-control [data-theme-label] { width: 4.5ch; }
.site-header .header-inner > .mobile-menu { display: none; grid-area: menu; }
.site-header .header-inner > .mobile-word-nav { display: none; }
.site-header .header-inner > .header-nav {
  grid-area: navigation;
  position: static;
  inset: auto;
  z-index: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-size: 12px;
}
.site-header .header-nav > a { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 0; line-height: 1.4; }
.site-header .header-nav > .mobile-contribute { display: none; }
.site-header .header-search .search-box {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 52px;
  gap: 8px;
  padding: 3px 4px 3px 12px;
  margin: 0;
  border-radius: 8px;
  position: relative;
  overflow: visible;
}
.site-header .header-search .search-box > svg { width: 18px; height: 18px; flex-shrink: 0; }
.site-header .header-search .search-box input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 14px;
  line-height: 1.4;
}
.site-header .header-search .search-box button {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 13px;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}
.site-header .header-search .search-suggestions {
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 120;
  width: auto;
  max-width: 100%;
  max-height: min(70vh, 440px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.site-header .header-search .search-suggestion { min-width: 0; min-height: 44px; padding: 12px 14px; }
.site-header .header-search .search-suggestion strong { min-width: 0; overflow-wrap: anywhere; }
.site-header .header-search .search-suggestion span { flex-shrink: 0; max-width: 42%; overflow-wrap: anywhere; text-align: right; }
.site-header .header-search .search-suggestion:focus-visible { outline-offset: -3px; }
.site-header .header-search .search-suggest-empty { overflow-wrap: anywhere; }
.feed-page > .feed-layout { padding-top: 24px; }

@media (max-width: 1100px) {
  .site-header .header-inner { column-gap: 16px; }
  .site-header .header-inner > .brand { font-size: 18px; }
  .site-header .header-inner > .header-cta { padding-inline: 11px; font-size: 11px; }
}
@media (max-width: 900px) {
  .site-header .header-inner {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    grid-template-areas: "brand search appearance" "navigation navigation navigation";
  }
  .site-header .header-inner > .header-cta { display: none; }
  .site-header .header-nav > .mobile-contribute { display: inline-flex; margin-left: auto; }
}
@media (max-width: 600px) {
  .site-header .header-inner {
    width: calc(100% - 24px);
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    grid-template-areas: "brand search appearance menu" "quick quick quick quick";
    column-gap: 4px;
    row-gap: 4px;
    padding-top: 8px;
    padding-bottom: 0;
  }
  .site-header .header-inner > .brand { width: 44px; min-height: 44px; justify-content: center; gap: 0; }
  .site-header .header-inner > .brand > span { display: none; }
  .site-header .header-inner > .brand .brand-mark { width: 30px; height: 30px; }
  .site-header .appearance-control > summary { width: 44px; min-width: 44px; min-height: 44px; padding: 9px; border: 0; gap: 0; }
  .site-header .appearance-control [data-theme-label] { display: none; }
  .site-header .header-inner > .mobile-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
    margin: 0;
    padding: 9px;
    border: 0;
    font-size: 21px;
    line-height: 1;
  }
  .site-header .header-inner > .header-nav {
    display: none;
    position: static;
    inset: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 0;
    margin: 0;
    background: transparent;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    font-size: 14px;
  }
  .site-header .header-inner.menu-open { grid-template-areas: "brand search appearance menu" "quick quick quick quick" "navigation navigation navigation navigation"; }
  .site-header .header-inner.menu-open > .header-nav { display: flex; }
  .site-header .header-inner > .mobile-word-nav {
    grid-area: quick;
    position: static;
    inset: auto;
    z-index: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    gap: 8px;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: transparent;
    font-size: 12px;
  }
  .site-header .mobile-word-nav > a { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 6px; line-height: 1.4; white-space: nowrap; color: var(--muted); }
  .site-header .mobile-word-nav > a[aria-current=page] { color: var(--ink); font-weight: 700; }
  .site-header .mobile-word-nav > a[aria-current=page]::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 1px; height: 3px; border-radius: 999px; background: var(--lilac,#bc8cd6); }
  .site-header .mobile-word-nav > a:focus-visible { outline-offset: -3px; }
  .site-header .header-nav > a { min-height: 44px; padding: 12px 4px; }
  .site-header .header-nav > .mobile-contribute { display: inline-flex; margin-left: 0; }
  .site-header .header-search .search-box input { font-size: 16px; }
  .site-header .header-inner .header-search .search-box button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; justify-content: center; gap: 0; font-size: 0; border-radius: 999px; }
  .site-header .header-search .search-box { min-height: 46px; padding: 0 0 0 10px; gap: 4px; border-radius: 999px; }
  .site-header .header-search .search-box > .cd-icon { display: none; }
  .site-header .header-search .search-suggestions { left: -48px; right: -96px; max-width: none; }
  .site-header .header-search .search-suggestion { padding: 12px; }
  .feed-page > .feed-layout { padding-top: 18px; }
}

/* Search completion stays inside the focused search, with one clear destination per row. */
.search-suggestions[hidden] { display: none; }
.search-suggestions { max-height: min(65vh, 490px); overflow-y: auto; overscroll-behavior: contain; }
.search-suggest-heading { padding: 11px 14px; font: 10px/1.5 var(--mono, monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.search-suggest-list { margin: 0; padding: 0; }
.search-suggestion, .site-header .header-search .search-suggestion { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.search-suggestion > .cd-icon { width: 21px; height: 21px; color: #79398f; flex: 0 0 21px; }
.search-suggestion-copy { flex: 1 1 0; min-width: 0; }
.search-suggestion strong { display: block; line-height: 1.4; overflow-wrap: anywhere; }
.search-suggestion-copy p { font-size: 12px; line-height: 1.6; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: 3px 0 0; }
.search-suggestion-copy small { display: block; font-size: 11px; line-height: 1.4; color: #79398f; margin-top: 2px; }
.search-suggestion mark { color: inherit; background: #e9d9f1; border-radius: 2px; }
.search-suggestion-type, .site-header .header-search .search-suggestion .search-suggestion-type { flex: 0 0 auto; max-width: 30%; text-align: right; font-size: 10px; line-height: 1.5; padding: 4px 6px; background: #f0f3eb; border-radius: 4px; color: #53614f; overflow-wrap: anywhere; }
.search-suggestion[aria-selected=true] { outline: 2px solid #9459ab; outline-offset: -2px; }
.search-suggest-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--line); background: var(--white); }
.search-suggest-footer a { color: #79398f; font-size: 12px; font-weight: 600; min-height: 30px; display: inline-flex; align-items: center; }
.search-suggest-footer > span { font-size: 10px; color: var(--muted); }
.search-suggest-empty { margin: 0; line-height: 1.7; }
html[data-theme=dark] .search-suggestion { color: #edf1f7; }
html[data-theme=dark] .search-suggestion > .cd-icon, html[data-theme=dark] .search-suggestion-copy small, html[data-theme=dark] .search-suggest-footer a { color: #d0ade2; }
html[data-theme=dark] .search-suggestion mark { background: #5c4269; }
html[data-theme=dark] .search-suggestion-type, html[data-theme=dark] .site-header .header-search .search-suggestion .search-suggestion-type { background: #313e4c; color: #d0d9e2; }
html[data-theme=dark] .search-suggest-footer { background: #202c38; }
html[data-theme=dark] .search-suggestion[aria-selected=true] { outline-color: #bc8cd6; }
@media (max-width: 600px) {
 .search-suggestion, .site-header .header-search .search-suggestion { gap: 9px; padding: 12px; }
 .search-suggestion > .cd-icon { width: 18px; height: 18px; flex-basis: 18px; }
 .search-suggest-footer { padding: 10px 12px; }
 .search-suggest-footer > span { display: none; }
 .site-header .header-search .search-suggestions { max-height: min(65vh, 490px); }
}
@media (forced-colors: active) {
 .search-suggestion mark { color: HighlightText; background: Highlight; }
 .search-suggestion[aria-selected=true] { outline-color: Highlight; }
}

.site-header .header-inner > .header-nav { flex-wrap: wrap; row-gap: 0; }
.site-header .header-nav > .saved-nav { gap: 7px; }
