/* GEO Knowledge Hub staging switcher — prototype-only review chrome. */
:root {
  --mint-400: #54f9a1;
  --tk-neutral-300: #a2a7b7;
  --tk-neutral-400: #8d94a6;
  --tk-neutral-900: #343740;
  --white: #ffffff;
  --rounded-sm: 4px;
  --ease: ease-out;
}

.proto {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--tk-neutral-900);
  color: var(--white);
}

.proto-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 52px;
  height: 52px;
}

.proto-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tk-neutral-400);
  white-space: nowrap;
  flex: none;
}

.proto-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.proto-tabs::-webkit-scrollbar {
  display: none;
}

.proto-tab {
  appearance: none;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: var(--tk-neutral-300);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--rounded-sm, 4px);
  cursor: pointer;
  flex: none;
  transition:
    background 140ms var(--ease, ease-out),
    color 140ms;
}

.proto-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.proto-tab[aria-selected='true'] {
  background: var(--mint-400);
  color: var(--tk-neutral-900);
}

a.proto-tab {
  text-decoration: none;
  color: var(--tk-neutral-300);
  display: inline-flex;
  align-items: center;
}

a.proto-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.proto-tab-short {
  display: none;
}

.proto-url {
  margin-left: auto;
  flex: none;
  max-width: 28ch;
  padding-left: 16px;
  font-family: var(--font-family-numerical, monospace);
  font-size: 11px;
  color: var(--tk-neutral-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Offset sticky chrome only when the staging bar is actually in the DOM.
   Do not key on .kh-page--proto alone — hub HTML must ship without that class
   so QA/prod do not reserve 52px above the header. */
html:has(.proto) {
  scroll-padding-top: 132px;
  --kh-proto-height: 52px;
}

html:has(.proto) .h1b-header {
  position: sticky !important;
  top: var(--kh-proto-height, 52px) !important;
  z-index: 50;
}

@media (max-width: 980px) {
  .proto-url {
    display: none;
  }

  .proto-in {
    gap: 16px;
    padding: 0 20px;
  }
}

@media (max-width: 680px) {
  html:has(.proto) {
    --kh-proto-height: 48px;
    scroll-padding-top: 124px;
  }

  .proto-in {
    gap: 0;
    padding: 0 12px;
    height: 48px;
    min-height: 48px;
  }

  .proto-label {
    display: none;
  }

  .proto-tab {
    font-size: 12px;
    padding: 6px 10px;
    scroll-snap-align: start;
  }

  .proto-tab-full {
    display: none;
  }

  .proto-tab-short {
    display: inline;
  }

  .proto-tabs {
    gap: 2px;
    scroll-snap-type: x proximity;
    padding: 4px 0;
  }
}
