.gt-header {
  --gt-switch-bg: #f5f2e8;
  --gt-switch-ink: #293a2e;
  --gt-switch-muted: #4e5e51;
  --gt-switch-line: #a8ad9d;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "brand links switch";
  align-items: center;
  column-gap: clamp(12px, 2.4vw, 32px);
}

.gt-header > a:first-child { grid-area: brand; }
.gt-header > .gt-page-nav { grid-area: links; justify-content: center; }

.gt-site-switcher {
  grid-area: switch;
  justify-self: end;
  position: relative;
  z-index: 5;
  color: var(--gt-switch-ink);
  font: 14px/1.45 system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.gt-sites-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--gt-switch-line);
  border-radius: 4px;
  background: var(--gt-switch-bg);
  color: var(--gt-switch-ink);
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.gt-sites-trigger::-webkit-details-marker { display: none; }
.gt-sites-trigger:hover,
.gt-site-switcher[open] .gt-sites-trigger { border-color: var(--gt-switch-ink); background: #e9ebdf; }

.gt-sites-trigger:focus-visible,
.gt-sites-panel .gt-sites-item:focus-visible { outline: 2px solid #874a34; outline-offset: 2px; }

.gt-sites-chevron {
  width: 0.48rem;
  height: 0.48rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.13rem) rotate(45deg);
}

.gt-site-switcher[open] .gt-sites-chevron { transform: translateY(0.13rem) rotate(225deg); }

.gt-sites-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  display: block;
  width: min(20rem, calc(100vw - 2.25rem));
  max-height: 62vh;
  max-height: 62dvh;
  margin: 0;
  padding: 0.3rem;
  overflow-y: auto;
  border: 1px solid var(--gt-switch-line);
  border-radius: 6px;
  background: #fcfbf6;
  box-shadow: 0 8px 24px #28382a26;
  color: var(--gt-switch-ink);
  font: inherit;
}

.gt-sites-panel ul { margin: 0; padding: 0; list-style: none; }
.gt-sites-panel li + li { border-top: 1px solid #e2e4d9; }

.gt-sites-panel .gt-sites-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 56px;
  padding: 0.55rem 0.65rem;
  border-radius: 3px;
  color: inherit;
  font: inherit;
  text-decoration: none;
  white-space: normal;
}

.gt-sites-panel a.gt-sites-item:hover,
.gt-sites-item[aria-current="page"] { background: #edf0e6; }

.gt-sites-name,
.gt-sites-description { display: block; }
.gt-sites-name { font-size: 0.94rem; font-weight: 720; }
.gt-sites-description { margin-top: 0.1rem; font-size: 0.8rem; color: var(--gt-switch-muted); }
.gt-sites-status { font-size: 0.75rem; color: var(--gt-switch-muted); white-space: nowrap; }

@media (max-width: 860px) {
  .gt-header {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand switch" "links links";
    gap: 0.5rem 0.65rem;
    padding-block: 0.7rem;
  }

  .gt-header > .gt-page-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: auto;
    justify-content: flex-start;
  }

  .gt-sites-trigger { font-size: 0.81rem; }
}

@media (max-width: 385px) {
  .gt-sites-trigger {
    max-width: 9rem;
    gap: 0.42rem;
    padding-inline: 0.45rem;
    text-align: center;
    white-space: normal;
  }

  .gt-sites-chevron { flex-shrink: 0; }
}
