.cw-header,
.cw-footer {
  --cw-gutter: clamp(16px, calc(9.75px + 1.95vw), 36px);
  --cw-tint: #e7ebff;
  font-family: inherit;
  letter-spacing: normal;
}

.cw-header *, .cw-footer * { box-sizing: border-box; }
.cw-header :is(a, summary, button), .cw-footer :is(a, summary, button) { color: inherit; font-family: inherit; }
.cw-header a, .cw-footer a { text-decoration: none; }
.cw-header button, .cw-footer button { cursor: pointer; }
.cw-header summary, .cw-footer summary { list-style: none; cursor: pointer; }
.cw-header summary::-webkit-details-marker, .cw-footer summary::-webkit-details-marker { display: none; }
.cw-header :is(ul, h2, h3), .cw-footer :is(ul, h2, h3) { padding: 0; margin: 0; }
.cw-header li, .cw-footer li { list-style: none; }

.cw-header {
  --cw-bar-height: clamp(68px, calc(66.4px + .5vw), 73px);
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--page, #fefdfb);
  color: var(--ink, #1a1b20);
  font-size: clamp(16px, calc(15.3px + .22vw), 18px);
  font-weight: 400;
  line-height: 1.4;
}

.cw-nav {
  width: 100%;
  max-width: 1496px;
  min-height: var(--cw-bar-height);
  margin-inline: auto;
  padding-inline: var(--cw-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cw-wordmark { display: inline-flex; align-items: center; flex: none; }
.cw-wordmark img { width: 100%; display: block; height: auto; }
.cw-header-logo { width: clamp(128px, 40vw, 190px); min-height: 44px; }
.cw-nav-list, .cw-nav-actions, .cw-mobile-actions { display: flex; align-items: center; gap: 7px; }
.cw-nav-list { white-space: nowrap; }
.cw-nav-actions { gap: 9px; }
.cw-header .cw-nav-text, .cw-header .cw-dropdown > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  font: inherit;
  line-height: 1.25;
}
.cw-dropdown { position: relative; }
.cw-dropdown > summary::after, .cw-directory summary strong::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.4px 1.4px 0;
  transform: translateY(-1.5px) rotate(45deg);
}
.cw-dropdown[open] > summary::after, .cw-directory[open] summary strong::after {
  transform: translateY(1px) rotate(225deg);
}
.cw-header .cw-nav-text:hover, .cw-header .cw-dropdown:is([open], :hover) > summary { background: var(--cw-tint); }
.cw-header .cw-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 45px;
  padding: 8px 23px;
  border: 1px solid currentColor;
  border-radius: 999px;
  line-height: 1.3;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
.cw-header .cw-primary { color: white; background: var(--accent, #0000ff); border-color: var(--accent, #0000ff); }
.cw-header .cw-pill:hover { color: var(--accent, #0000ff); background: var(--cw-tint); border-color: var(--accent, #0000ff); }
.cw-header .cw-mobile-actions, .cw-header .cw-nav-toggle { display: none; }
.cw-panel {
  position: absolute;
  left: -36px;
  top: calc(100% + 9px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  width: min(680px, 86vw);
  padding: 18px 36px;
  gap: 9px;
  border: 1px solid #ccced3;
  border-radius: 20px;
  background: var(--page, #fefdfb);
  box-shadow: 0 2px 4px #191a200d, 0 12px 28px #191a2012;
  white-space: normal;
}
.cw-dropdown:not([open]) > .cw-panel { display: none; }
.cw-panel a { display: flex; align-items: flex-start; gap: 9px; border-radius: 8px; padding: 9px; font-size: 15.5px; }
.cw-panel a:hover, .cw-panel a:focus-visible { background: var(--cw-tint); }
.cw-panel a svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cw-panel :is(strong, small) { display: block; font-family: inherit; font-size: inherit; line-height: 1.4; }
.cw-panel strong { font-weight: 600; }
.cw-panel small { color: #505159; font-weight: 400; margin-top: 2px; }
.cw-panel .cw-panel-overview { grid-column: 1/-1; display: inline-flex; width: fit-content; align-items: center; color: var(--accent, #0000ff); font-weight: 600; }
.cw-panel-options { width: min(610px, 80vw); }
.cw-panel-resources { grid-template-columns: 1fr; width: 290px; padding: 14px; left: -12px; gap: 2px; }
.cw-header :is(a, button, summary):focus-visible { outline: 2px solid var(--accent, #0000ff); outline-offset: 3px; }

.cw-footer {
  color: #fff;
  background: var(--ink, #1a1b20);
  font-size: clamp(12.85px, 1vw, 13.5px);
  line-height: 1.5;
}
.cw-footer-container { width: min(calc(100% - 2 * var(--cw-gutter)), 1280px); margin-inline: auto; padding-block: clamp(64px, 5vw, 72px); }
.cw-footer-columns { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: clamp(24px, 3.75vw, 54px); }
.cw-footer :is(.cw-footer-columns, .cw-directory-groups) section { margin: 0; padding: 0; }
.cw-footer h2 {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: normal;
  color: #cad3ff;
  margin: 0 0 13px;
}
.cw-footer :is(.cw-footer-columns, .cw-directory-groups) li + li { margin-top: 12px; }
.cw-footer :is(.cw-footer-columns, .cw-directory-groups) a { display: inline-block; color: #fff; line-height: 1.6; }
.cw-footer a:hover, .cw-footer button:hover { color: #d5dcff; text-decoration: underline; text-underline-offset: 3px; }
.cw-directory { margin-top: clamp(52px, 5vw, 72px); border-block: 1px solid #ffffff66; }
.cw-directory summary { padding-block: 16px; }
.cw-directory summary strong, .cw-directory summary span { display: block; }
.cw-directory summary strong { color: #cad3ff; font-weight: 600; }
.cw-directory summary strong::after { margin-left: 12px; }
.cw-directory summary span { margin-top: 3px; }
.cw-directory-groups { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 26px; padding: 18px 0 36px; }
.cw-directory:not([open]) .cw-directory-groups { display: none; }
.cw-footer-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 36px; margin-top: clamp(56px,5vw,72px); }
.cw-footer-logo { width: min(352px, 35vw); }
.cw-footer-logo img { filter: brightness(0) invert(1); }
.cw-footer-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 18px; }
.cw-profiles, .cw-legal { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.cw-profiles a { display: grid; place-items: center; width: 39px; height: 39px; color: white; border-radius: 8px; }
.cw-profiles a:hover { background: var(--cw-tint); color: var(--accent, #0000ff); }
.cw-profiles svg { width: 26px; height: 26px; }
.cw-legal { justify-content: flex-end; gap: 5px 12px; font-size: clamp(13px, 1.08vw, 15.5px); }
.cw-legal button { border: 0; background: none; padding: 0; font: inherit; }
.cw-footer [hidden] { display: none; }
.cw-footer :is(a, button, summary):focus-visible { outline: 2px solid #cad3ff; outline-offset: 4px; }

@media (min-width: 1200px) and (max-width: 1280px) {
  .cw-nav { gap: 10px; }
  .cw-nav-list { gap: 4px; }
  .cw-header .cw-nav-text, .cw-header .cw-dropdown > summary { padding-inline: 8px; }
  .cw-header .cw-pill { padding-inline: 18px; }
}
@media (max-width: 1199px) {
  html:has(.cw-header[data-menu-open]) { overflow: hidden; }
  .cw-nav { gap: 8px; }
  .cw-nav-actions { gap: 8px; }
  .cw-header .cw-pill { min-height: 41px; padding-inline: 18px; }
  .cw-header .cw-nav-actions > .cw-outline { display: none; }
  .cw-header[data-ready] .cw-nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 6px; background: none; margin-right: -8px; padding: 8px; }
  .cw-nav-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; }
  .cw-header[data-ready] .cw-nav-menu { display: none; }
  .cw-header[data-menu-open] .cw-nav-menu {
    display: block;
    position: absolute;
    inset: 100% 0 auto;
    height: calc(100dvh - var(--cw-bar-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 var(--cw-gutter) 28px;
    background: var(--page, #fefdfb);
  }
  .cw-nav-toggle .cw-menu-close, .cw-header[data-menu-open] .cw-menu-lines { display: none; }
  .cw-header[data-menu-open] .cw-menu-close { display: block; }
  .cw-header:not([data-ready]) .cw-nav { flex-wrap: wrap; padding-block: 8px; }
  .cw-header:not([data-ready]) .cw-nav-menu { width: 100%; order: 1; }
  .cw-nav-list { display: block; }
  .cw-header .cw-nav-text, .cw-header .cw-dropdown > summary {
    justify-content: space-between;
    min-height: 49px;
    padding: 14px 4px 7px 0;
    border-radius: 0;
    border-bottom: 1px solid #c9cbd3;
    font-weight: 600;
  }
  .cw-header .cw-nav-text { font-weight: 400; }
  .cw-dropdown > summary::after { width: 10px; height: 10px; margin-right: 5px; }
  .cw-header .cw-dropdown:is([open],:hover) > summary { background: transparent; }
  .cw-panel, .cw-panel-options, .cw-panel-resources {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    padding: 16px 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 8px;
  }
  .cw-panel a { margin-inline: -8px; padding: 8px; gap: 8px; font-size: clamp(14.38px,1.4vw,15.5px); }
  .cw-panel strong { line-height: 1.1; }
  .cw-panel small { margin-top: 4px; }
  .cw-header .cw-mobile-actions { display: grid; gap: 8px; margin-top: 26px; }
  .cw-footer-columns { gap: 28px; }
}
@media (max-width: 767px) {
  .cw-footer-columns { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px 24px; }
  .cw-footer :is(.cw-footer-columns, .cw-directory-groups) li + li { margin-top: 10px; }
  .cw-footer-bottom { flex-direction: column; align-items: flex-start; gap: 20px; }
  .cw-footer-logo { width: min(260px,65vw); }
  .cw-footer-meta { align-items: flex-start; }
  .cw-legal { justify-content: flex-start; }
  .cw-directory-groups { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 480px) {
  .cw-directory-groups { grid-template-columns: 1fr; }
}
@media (max-width: 359px) {
  .cw-nav-actions { gap: 3px; }
  .cw-header .cw-header-logo { width: 105px; min-width: 0; }
  .cw-nav { column-gap: 5px; }
  .cw-header .cw-nav-actions .cw-primary { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cw-header .cw-pill { transition: none; }
}

/* Reserve the mobile header height before hydration; script-free browsers keep the expanded navigation. */
@media (max-width: 1199px) and (scripting: enabled) {
  .cw-header:not([data-ready]) .cw-nav { flex-wrap: nowrap; padding-block: 0; }
  .cw-header:not([data-ready]) .cw-nav-menu { display: none; }
  .cw-header:not([data-ready]) .cw-nav-toggle {
    display: grid; place-items: center; width: 40px; height: 40px;
    border: 0; border-radius: 6px; background: transparent; margin-right: -8px; padding: 8px;
  }
}
