/* Linked by every page. Page-specific controls belong in .topbar-right only —
   anything added to .topbar-left moves the tabs between pages. Do not
   re-declare these rules in a page's own <style>. */
html {
  scrollbar-gutter: stable;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 32px;
  border-bottom: 1px solid #2c3136;
  background: rgba(28, 32, 36, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}
/* Height is pinned, not derived from the tallest control: a button in the
   bar once made one page 10px taller than the rest. */
.topbar .btn,
.topbar select {
  height: 34px;
  padding: 0 14px;
}
.topbar .btn {
  font-size: 12px;
  border-radius: 10px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.brand-logo {
  height: 22px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.brand-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}
.version-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--sky);
  background: rgba(0, 151, 218, 0.14);
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 7ch;
  text-align: center;
}
.version-pill:empty {
  visibility: hidden;
}
.demo-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sky);
  border: 1px solid rgba(0, 151, 218, 0.4);
  background: rgba(0, 151, 218, 0.14);
  padding: 3px 10px;
  border-radius: 999px;
}

/* A hidden tab must stay hidden inside the flex row — the attribute alone
   lost to a display rule here once already. */
.navlinks {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #24282d;
  border: 1px solid #2f3439;
  border-radius: 999px;
}
.navlinks a {
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.navlinks a:hover {
  color: var(--text);
  text-decoration: none;
}
.navlinks a[aria-current="page"] {
  color: var(--text);
  background: #33383e;
}
.navlinks a[hidden] {
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.session b {
  color: var(--text);
  font-weight: 600;
}
.session-anon {
  color: var(--amber);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px 2px 11px;
  color: var(--muted);
  transition: border-color 150ms ease;
}
.lang-toggle:hover,
.lang-toggle:focus-within {
  border-color: var(--text);
}
.lang-toggle svg {
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lang-toggle .gl {
  width: 15px;
  height: 15px;
}
.lang-toggle .cv {
  width: 13px;
  height: 13px;
}
.topbar .lang-toggle select {
  height: auto;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 0;
  cursor: pointer;
}

@media (max-width: 860px) {
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }
}
/* Below this the widest bar (four tabs, a signed-in session, the language)
   no longer fits one row. Every page breaks into the same two rows here,
   not only the page that ran out of room first. */
@media (max-width: 1200px) {
  .topbar {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    row-gap: 9px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .topbar-left {
    flex-basis: 100%;
  }
  .topbar-right {
    margin-left: auto;
  }
}
@media (max-width: 760px) {
  .topbar-left,
  .topbar-right,
  .navlinks {
    flex-wrap: wrap;
    row-gap: 9px;
  }
  .navlinks {
    border-radius: 18px;
  }
}
