.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 11px clamp(18px, 4vw, 64px);
  color: #fff;
  background: rgba(0, 30, 95, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 8px 24px rgba(0, 30, 95, .12);
  backdrop-filter: blur(14px);
}

.site-header .brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.site-header .brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  color: #001e5f;
  font-size: 1.15rem;
  font-weight: 900;
  background: #ffd82b;
  border-radius: 10px 4px 10px 4px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .16);
}

.site-header .brand strong,
.site-header .brand small {
  display: block;
}

.site-header .brand strong {
  font-size: 1.02rem;
  letter-spacing: .01em;
}

.site-header .brand small {
  margin-top: 1px;
  color: #c9d6e5;
  font-size: .72rem;
}

.header-actions {
  position: static;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
  margin-left: 24px;
}

.site-nav {
  position: static;
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  margin-right: auto;
}

.site-nav a,
.site-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  color: #dce8f5;
  font-family: inherit;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav button:hover,
.site-nav button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.site-nav a[aria-current="page"],
.site-nav button[aria-current="page"] {
  color: #001e5f;
  background: #ffd82b;
  border-color: #ffe95f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.site-help-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px;
  color: #dce8f5;
  font-family: inherit;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.site-help-button:hover,
.site-help-button:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .1);
}

.site-help-button > span:first-child {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #001e5f;
  font-size: .68rem;
  font-weight: 900;
  background: #ffd82b;
  border-radius: 50%;
}

html.help-open {
  overflow: hidden;
}

.help-dialog {
  width: min(940px, calc(100vw - 32px));
  max-width: none;
  max-height: min(88vh, 860px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: #001e5f;
  font-family: InterVariable, Inter, Aptos, "Segoe UI", sans-serif;
  font-feature-settings: "liga" 1, "calt" 1;
  line-height: 1.5;
  border: 1px solid #cbd7e5;
  border-radius: 18px;
  background: #f6f8fb;
  box-shadow: 0 30px 90px rgba(7, 23, 43, .3);
}

.help-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.help-dialog::backdrop {
  background: rgba(8, 22, 39, .68);
  backdrop-filter: blur(4px);
}

.help-dialog *,
.help-dialog *::before,
.help-dialog *::after {
  box-sizing: border-box;
}

.help-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 20px;
  color: #fff;
  background: linear-gradient(135deg, #001e5f, #021bc3);
  border-bottom: 3px solid #ffd82b;
}

.help-eyebrow {
  margin: 0 0 4px;
  color: #ffe95f;
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.help-dialog-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.18;
}

.help-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  place-items: center;
  color: #fff;
  font: inherit;
  font-size: 1.55rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}

.help-close:hover,
.help-close:focus-visible {
  background: rgba(255, 255, 255, .18);
}

.help-dialog-body {
  padding: 24px;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.help-intro {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr);
  gap: 24px;
  padding: 22px;
  color: #fff;
  background: #1b4f87;
  border-radius: 14px;
}

.help-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 9px;
  color: #19344f;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: #ffd82b;
  border-radius: 999px;
}

.help-intro h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.25rem;
}

.help-intro p {
  margin: 0;
  color: #dceafb;
  font-size: .88rem;
}

.help-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 11px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
}

.help-steps li > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #001e5f;
  font-size: .76rem;
  font-weight: 900;
  background: #ffd82b;
  border-radius: 8px;
}

.help-steps strong,
.help-steps small {
  display: block;
}

.help-steps strong {
  color: #fff;
  font-size: .82rem;
}

.help-steps small {
  margin-top: 2px;
  color: #cfe0f3;
  font-size: .72rem;
  line-height: 1.42;
}

.help-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 4px;
}

.help-contents a {
  padding: 6px 10px;
  color: #24538b;
  font-size: .72rem;
  font-weight: 750;
  text-decoration: none;
  border: 1px solid #c7d8ec;
  border-radius: 999px;
  background: #fff;
}

.help-contents a:hover,
.help-contents a:focus-visible {
  border-color: #2d69ae;
  background: #eaf2ff;
}

.help-section {
  padding: 25px 2px 5px;
  scroll-margin-top: 12px;
}

.help-section + .help-section {
  margin-top: 18px;
  border-top: 1px solid #d9e1eb;
}

.help-section-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.help-section-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #021bc3;
  font-size: .72rem;
  font-weight: 900;
  background: #e7f0ff;
  border-radius: 12px;
}

.help-section-heading h3 {
  margin: 0;
  color: #001e5f;
  font-size: 1.08rem;
}

.help-section-heading p {
  margin: 2px 0 0;
  color: #627187;
  font-size: .8rem;
}

.help-grid,
.help-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.help-card,
.help-provider-card,
.help-callout,
.help-key-explanation {
  padding: 16px;
  border: 1px solid #d9e2ed;
  border-radius: 12px;
  background: #fff;
}

.help-card h4,
.help-provider-card h4 {
  margin: 0 0 8px;
  color: #173a60;
  font-size: .9rem;
}

.help-card p,
.help-callout p,
.help-key-explanation p {
  margin: 0;
  color: #53647a;
  font-size: .79rem;
}

.help-callout p + p,
.help-key-explanation p + p {
  margin-top: 9px;
}

.help-card ul,
.help-provider-card ol {
  margin: 0;
  padding-left: 19px;
  color: #53647a;
  font-size: .77rem;
}

.help-card li + li,
.help-provider-card li + li {
  margin-top: 6px;
}

.help-feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.help-feature-list div {
  padding: 12px;
  border: 1px solid #d9e2ed;
  border-radius: 10px;
  background: #fff;
}

.help-feature-list strong,
.help-feature-list span {
  display: block;
}

.help-feature-list strong {
  color: #021bc3;
  font-size: .77rem;
}

.help-feature-list span {
  margin-top: 3px;
  color: #607087;
  font-size: .7rem;
  line-height: 1.4;
}

.help-footnote {
  margin: 11px 2px 0;
  color: #65758b;
  font-size: .72rem;
}

.help-api-section {
  margin-right: -10px;
  margin-left: -10px;
  padding-right: 12px;
  padding-left: 12px;
  background: linear-gradient(180deg, rgba(234, 242, 255, .6), rgba(246, 248, 251, 0));
  border-radius: 14px 14px 0 0;
}

.help-key-explanation {
  margin-bottom: 12px;
  border-left: 4px solid #ffd82b;
}

.help-provider-card {
  position: relative;
  padding-top: 48px;
  border-top: 3px solid #0066fd;
}

.help-provider-card.anthropic {
  border-top-color: #8d5b3f;
}

.help-provider-name {
  position: absolute;
  top: 14px;
  left: 16px;
  padding: 3px 8px;
  color: #021bc3;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: #eaf2ff;
  border-radius: 999px;
}

.help-provider-card.anthropic .help-provider-name {
  color: #70452f;
  background: #f6ebe5;
}

.help-provider-links {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.help-provider-links a {
  width: fit-content;
  color: #021bc3;
  font-size: .73rem;
  font-weight: 750;
}

.help-security-note {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding: 13px 15px;
  color: #62420a;
  font-size: .75rem;
  background: #fff4d9;
  border: 1px solid #ead08d;
  border-radius: 10px;
}

.help-faq {
  border: 1px solid #d9e2ed;
  border-radius: 10px;
  background: #fff;
}

.help-faq + .help-faq {
  margin-top: 7px;
}

.help-faq summary {
  padding: 11px 13px;
  color: #173a60;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}

.help-faq p {
  margin: 0;
  padding: 0 13px 13px;
  color: #5f6f85;
  font-size: .75rem;
}

.header-context-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #f8d98e;
  font-size: .73rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid rgba(255, 216, 43, .35);
  border-radius: 999px;
  background: rgba(255, 216, 43, .1);
}

.header-context-pill::before {
  width: 6px;
  height: 6px;
  content: "";
  background: #ffd82b;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 216, 43, .13);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
}

.nav-toggle:hover,
.nav-toggle:focus-visible,
.nav-toggle[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .14);
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  display: block;
  width: 18px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 999px;
  transition: transform .18s ease, opacity .18s ease;
}

.nav-toggle-lines {
  position: relative;
}

.nav-toggle-lines::before {
  position: absolute;
  top: -6px;
  left: 0;
}

.nav-toggle-lines::after {
  position: absolute;
  top: 6px;
  left: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1220px) {
  .site-header {
    position: sticky;
    min-height: 64px;
    padding: 9px 14px;
  }

  .header-actions {
    gap: 9px;
    margin-left: 14px;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 13px);
    right: 0;
    left: auto;
    display: none;
    width: min(280px, calc(100vw - 28px));
    padding: 8px;
    align-items: stretch;
    flex-direction: column;
    gap: 3px;
    border-color: rgba(255, 255, 255, .16);
    border-radius: 13px;
    background: rgba(18, 38, 63, .99);
    box-shadow: 0 18px 45px rgba(8, 23, 42, .28);
    transform: none;
    margin-right: 0;
  }

  .site-nav::before {
    position: absolute;
    top: -6px;
    right: 15px;
    width: 12px;
    height: 12px;
    content: "";
    background: #001e5f;
    border-top: 1px solid rgba(255, 255, 255, .16);
    border-left: 1px solid rgba(255, 255, 255, .16);
    transform: rotate(45deg);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a,
  .site-nav button {
    position: relative;
    z-index: 1;
    justify-content: space-between;
    min-height: 44px;
    padding: 11px 13px;
    font-size: .88rem;
  }

  .nav-toggle {
    display: grid;
    flex: none;
  }

  .catalog-pill {
    max-width: none;
  }
}

@media (max-width: 540px) {
  .site-header .brand small {
    display: none;
  }

  .site-header .brand strong {
    font-size: .92rem;
  }

  .site-header .brand-mark {
    width: 36px;
    height: 36px;
  }

  .header-actions {
    gap: 7px;
    margin-left: 10px;
  }

  .catalog-pill {
    min-width: 105px;
    max-width: 118px;
    padding: 7px 10px;
    gap: 7px;
    font-size: .7rem;
    border-radius: 14px;
  }

  .catalog-pill-copy {
    display: grid;
    gap: 2px;
    line-height: 1.05;
  }

  .catalog-pill-copy strong {
    font-size: .72rem;
  }

  .catalog-pill-copy small {
    color: #b9cbe0;
    font-size: .61rem;
    font-weight: 650;
  }

  .catalog-pill-copy small::before {
    content: none;
  }

  .header-context-pill {
    max-width: 82px;
    overflow: hidden;
    font-size: .66rem;
    text-overflow: ellipsis;
  }

  .site-help-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
  }

  .site-help-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .help-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .help-dialog-header {
    padding: 17px 16px 15px;
  }

  .help-close {
    width: 38px;
    height: 38px;
  }

  .help-dialog-body {
    padding: 14px;
  }

  .help-intro,
  .help-grid,
  .help-provider-grid {
    grid-template-columns: 1fr;
  }

  .help-intro {
    gap: 16px;
    padding: 17px;
  }

  .help-feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-security-note {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 390px) {
  .catalog-pill {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }

  .catalog-pill-copy {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 420px) {
  .site-header .brand > span:last-child {
    display: none;
  }

  .header-actions {
    margin-left: 8px;
  }
}

/* Funding Finder has a catalog indicator and Workspace in addition to Help.
   Reserve their space at both the phone and direct-navigation breakpoints. */
@media (max-width: 800px), (min-width: 1221px) and (max-width: 1440px) {
  .site-header.funding-header .brand > span:last-child { display: none; }
}
@media (min-width: 541px) and (max-width: 700px) {
  .funding-header .catalog-pill { min-width: 105px; max-width: 118px; padding: 7px 10px; gap: 7px; font-size: .7rem; }
  .funding-header .catalog-pill-copy { display: grid; gap: 2px; line-height: 1.05; }
  .funding-header .catalog-pill-copy strong { font-size: .72rem; }
  .funding-header .catalog-pill-copy small { font-size: .61rem; }
  .funding-header .catalog-pill-copy small::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav a,
  .site-nav button,
  .nav-toggle-lines,
  .nav-toggle-lines::before,
  .nav-toggle-lines::after {
    transition: none;
  }
}

@media (forced-colors: active) {
  .site-nav,
  .site-nav a,
  .site-nav button,
  .nav-toggle,
  .header-context-pill,
  .help-dialog,
  .help-close {
    border: 1px solid CanvasText;
  }
}

.site-nav-utility > button { background: transparent; gap: 6px; }
.site-nav-utility .shell-action-list a { color: #173a60; line-height: 1.4; }
.site-nav-utility .shell-action-list a:hover { color: #001e5f; background: #edf3fc; }
@media (max-width: 1220px) {
  .site-nav { max-height: calc(100dvh - 90px); overflow-y: auto; }
  .site-nav-utility > button { width: 100%; }
}
