:root {
  --reference-header-blue: #246ff2;
  --reference-header-ink: #28364c;
  --reference-header-muted: #7c8798;
  --reference-header-line: #e7ebf1;
  --reference-header-width: 1320px;
}

.site-header,
body:has(.directory-page) .site-header,
body:has(.school-directory) .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: auto;
  min-height: 96px;
  background: #fff;
  border-bottom: 1px solid var(--reference-header-line);
  box-shadow: 0 3px 12px rgba(39, 65, 104, 0.08);
  backdrop-filter: none;
}

.site-utility-bar {
  height: 32px;
  color: #788396;
  background: linear-gradient(180deg, #fafbfd 0%, #f5f7fa 100%);
  border-bottom: 1px solid #edf0f4;
  font-size: 12px;
}

.site-utility-inner,
.header-inner,
body:has(.directory-page) .header-inner,
body:has(.school-directory) .header-inner {
  width: calc(100% - 64px);
  max-width: var(--reference-header-width);
  margin-inline: auto;
}

.site-utility-inner {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-welcome {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-utility-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-utility-nav a,
.site-utility-nav button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: #778296;
  background: transparent;
  border: 0;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.site-utility-nav a::before,
.site-utility-nav button::before {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  color: #8490a2;
  line-height: 1;
}

.site-utility-nav .utility-help::before {
  content: "?";
  border: 1px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
  padding: 0 0 1px;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-indent: -0.35px;
}

.site-utility-nav .utility-follow::before {
  content: "☆";
  font-size: 16px;
}

.site-utility-nav a:hover,
.site-utility-nav a:focus-visible,
.site-utility-nav button:hover,
.site-utility-nav button:focus-visible {
  color: var(--reference-header-blue);
}

.header-inner,
body:has(.directory-page) .header-inner,
body:has(.school-directory) .header-inner {
  height: 64px;
  min-height: 64px;
  display: grid;
  grid-template-columns: 190px 142px minmax(0, 1fr) 196px;
  gap: 18px;
  align-items: center;
}

.site-brand,
body:has(.directory-page) .site-brand,
body:has(.school-directory) .site-brand {
  grid-column: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  color: #1f2d45;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.18;
  white-space: nowrap;
}

.site-brand .brand-mark {
  display: none;
}

.school-directory-brand-icon,
body:has(.school-directory) .school-directory-brand-icon {
  width: 42px;
  height: 32px;
  display: block;
  object-fit: cover;
  border-radius: 4px;
}

.site-brand small,
body:has(.school-directory) .site-brand small {
  display: block;
  margin-top: 2px;
  color: #8a94a4;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.content-project-switcher {
  position: relative;
  grid-column: 2;
  width: 142px;
}

.content-project-switcher summary {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: var(--reference-header-blue);
  background: #fff;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.content-project-switcher summary::-webkit-details-marker {
  display: none;
}

.content-project-switcher summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #33445d;
  border-bottom: 2px solid #33445d;
  transform: rotate(45deg) translateY(-2px);
}

.content-project-switcher[open] summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.content-project-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  width: 220px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e4e9f0;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(39, 65, 104, 0.16);
}

.content-project-menu a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #26354b;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.content-project-menu a:hover,
.content-project-menu a:focus-visible {
  background: #f3f7ff;
}

.content-project-menu a.active {
  color: var(--reference-header-blue);
  background: #f5f8fd;
}

body:has(.school-directory) .site-brand small::after {
  content: none;
}

.site-nav,
body:has(.directory-page) .site-nav,
body:has(.school-directory) .site-nav {
  position: static;
  grid-column: 3;
  min-width: 0;
  height: 64px;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: clamp(18px, 1.8vw, 34px);
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.site-nav > a:not(.button),
body:has(.directory-page) .site-nav > a:not(.button),
body:has(.school-directory) .site-nav > a:not(.button) {
  position: relative;
  min-width: 0;
  height: 64px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: #344055 !important;
  font-size: 14px;
  font-weight: 500 !important;
  line-height: 1;
  white-space: nowrap;
}

.site-nav > a:not(.button):hover,
.site-nav > a:not(.button):focus-visible {
  color: var(--reference-header-blue) !important;
  text-decoration: none;
}

.site-nav > a.nav-active:not(.button) {
  color: var(--reference-header-blue) !important;
  font-weight: 600 !important;
}

.site-nav > a.nav-active:not(.button)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  display: block !important;
  background: var(--reference-header-blue);
  border-radius: 3px 3px 0 0;
}

.school-directory-header-search,
body:has(.directory-page) .school-directory-header-search,
body:has(.school-directory) .school-directory-header-search {
  position: relative;
  grid-column: 4;
  width: 196px;
  height: 36px;
  display: flex !important;
  align-items: center;
  justify-self: end;
}

.school-directory-header-search input {
  width: 100%;
  height: 36px;
  padding: 0 42px 0 16px;
  color: #34445d;
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 18px;
  outline: none;
  font-size: 13px;
}

.school-directory-header-search input::placeholder {
  color: #b8c0cc;
}

.school-directory-header-search input:focus {
  border-color: #94bbf5;
  box-shadow: 0 0 0 3px rgba(36, 111, 242, 0.1);
}

.school-directory-header-search button {
  position: absolute;
  top: 4px;
  right: 7px;
  width: 28px;
  height: 28px;
  padding: 0;
  background-color: transparent;
  border: 0;
  cursor: pointer;
}

.nav-toggle {
  display: none;
}

.site-qrcode-dialog {
  width: min(290px, calc(100vw - 32px));
  padding: 0;
  overflow: visible;
  color: var(--reference-header-ink);
  background: #fff;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 20px 56px rgba(25, 43, 72, 0.22);
}

.site-qrcode-dialog::backdrop {
  background: rgba(20, 32, 52, 0.38);
}

.site-qrcode-panel {
  position: relative;
  min-height: 210px;
  display: grid;
  place-content: center;
  gap: 24px;
  padding: 36px 24px 30px;
  text-align: center;
}

.site-qrcode-panel h2 {
  margin: 0;
  font-size: 20px;
}

.site-qrcode-empty {
  margin: 0;
  color: var(--reference-header-muted);
  font-size: 14px;
}

.site-qrcode-image {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fff;
}

.site-qrcode-description {
  max-width: 220px;
  margin: -10px auto 0;
  color: var(--reference-header-muted);
  font-size: 13px;
  line-height: 1.65;
}

.site-qrcode-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #778296;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.site-qrcode-close:hover,
.site-qrcode-close:focus-visible {
  color: var(--reference-header-blue);
  background: #eef5ff;
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .site-utility-inner,
  .header-inner,
  body:has(.directory-page) .header-inner,
  body:has(.school-directory) .header-inner {
    width: calc(100% - 40px);
  }

  .header-inner,
  body:has(.directory-page) .header-inner,
  body:has(.school-directory) .header-inner {
    grid-template-columns: 170px 124px minmax(0, 1fr) 160px;
    gap: 12px;
  }

  .site-nav,
  body:has(.directory-page) .site-nav,
  body:has(.school-directory) .site-nav {
    gap: 18px;
  }

  .site-nav > a:not(.button),
  body:has(.directory-page) .site-nav > a:not(.button),
  body:has(.school-directory) .site-nav > a:not(.button) {
    font-size: 13px;
  }

  .school-directory-header-search,
  body:has(.directory-page) .school-directory-header-search,
  body:has(.school-directory) .school-directory-header-search {
    width: 160px;
  }
}

@media (max-width: 1024px) {
  .site-header,
  body:has(.directory-page) .site-header,
  body:has(.school-directory) .site-header {
    min-height: 92px;
  }

  .site-utility-bar,
  .site-utility-inner {
    height: 32px;
  }

  .site-utility-inner,
  .header-inner,
  body:has(.directory-page) .header-inner,
  body:has(.school-directory) .header-inner {
    width: calc(100% - 40px);
  }

  .header-inner,
  body:has(.directory-page) .header-inner,
  body:has(.school-directory) .header-inner {
    height: 60px;
    min-height: 60px;
    grid-template-columns: minmax(0, 1fr) 132px 42px;
    gap: 12px;
  }

  .site-nav,
  body:has(.directory-page) .site-nav,
  body:has(.school-directory) .site-nav {
    position: fixed;
    top: 92px;
    right: 0;
    left: 0;
    z-index: 99;
    max-height: calc(100dvh - 92px);
    height: auto;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: #fff;
    border-top: 1px solid #edf0f4;
    border-bottom: 1px solid #dfe5ed;
    box-shadow: 0 16px 34px rgba(31, 45, 69, 0.16);
  }

  .content-project-switcher {
    grid-column: 2;
    width: 132px;
    justify-self: stretch;
    margin: 0;
  }

  .content-project-switcher summary {
    height: 36px;
  }

  .site-nav.open,
  body:has(.directory-page) .site-nav.open,
  body:has(.school-directory) .site-nav.open {
    display: grid;
  }

  .site-nav > a:not(.button),
  body:has(.directory-page) .site-nav > a:not(.button),
  body:has(.school-directory) .site-nav > a:not(.button) {
    width: 100%;
    height: 46px;
    min-height: 46px;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
  }

  .site-nav > a.nav-active:not(.button) {
    color: var(--reference-header-blue) !important;
    background: #eef5ff;
  }

  .site-nav > a.nav-active:not(.button)::after {
    display: none !important;
  }

  .nav-toggle,
  body:has(.school-directory) .nav-toggle {
    grid-column: 3;
    width: 42px;
    min-width: 42px;
    height: 42px;
    display: grid;
  }

  .school-directory-header-search,
  body:has(.directory-page) .school-directory-header-search,
  body:has(.school-directory) .school-directory-header-search {
    display: none !important;
  }

}

@media (max-width: 640px) {
  .site-header,
  body:has(.directory-page) .site-header,
  body:has(.school-directory) .site-header {
    min-height: 88px;
  }

  .site-utility-bar,
  .site-utility-inner {
    height: 28px;
  }

  .site-utility-inner,
  .header-inner,
  body:has(.directory-page) .header-inner,
  body:has(.school-directory) .header-inner {
    width: calc(100% - 28px);
  }

  .site-welcome {
    display: none;
  }

  .site-utility-inner {
    justify-content: flex-end;
  }

  .site-utility-nav {
    gap: 18px;
    font-size: 11px;
  }

  .site-nav,
  body:has(.directory-page) .site-nav,
  body:has(.school-directory) .site-nav {
    top: 88px;
    max-height: calc(100dvh - 88px);
    grid-template-columns: 1fr;
    padding-inline: 14px;
  }

  .site-brand,
  body:has(.directory-page) .site-brand,
  body:has(.school-directory) .site-brand {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    font-size: 14px;
  }

  .header-inner,
  body:has(.directory-page) .header-inner,
  body:has(.school-directory) .header-inner {
    grid-template-columns: minmax(0, 1fr) 108px 42px;
    gap: 8px;
  }

  .content-project-switcher {
    width: 108px;
  }

  .content-project-switcher summary {
    padding-inline: 10px;
    font-size: 12px;
  }

  .content-project-menu {
    right: 0;
    left: auto;
    width: 190px;
  }

  .school-directory-brand-icon,
  body:has(.school-directory) .school-directory-brand-icon {
    width: 38px;
    height: 29px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .site-nav * {
    scroll-behavior: auto;
    transition: none !important;
  }
}
