/* One shared header contract for every route. Loaded after page and theme CSS
   so legacy page styles cannot change the active marker or header geometry. */
.topbar.topbar--studio {
  box-sizing: border-box;
  width: 100%; max-width: none; min-width: 0; height: 70px;
  margin: 0; padding-inline: max(var(--page-gutter, 24px), calc((100% - var(--page-max, 1280px)) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.topbar.topbar--studio .brand {
  flex: 0 0 auto; width: max-content; max-width: 100%; min-width: 0; white-space: nowrap;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px; font-weight: 700; line-height: 1;
}
.topbar.topbar--studio .brand-wordmark { flex: 0 0 auto; white-space: nowrap; font-size: inherit; font-weight: inherit; line-height: inherit; }
.topbar.topbar--studio nav {
  display: flex; flex: 0 1 auto; align-items: center; justify-content: flex-end;
  min-width: 0; margin-left: auto; gap: clamp(12px, 1.4vw, 20px);
}
.topbar.topbar--studio nav a,
.topbar.topbar--studio nav a[aria-current="page"] {
  box-sizing: border-box; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; color: #53657d;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: 0;
  text-decoration: none; white-space: nowrap;
}
.topbar.topbar--studio nav a:hover { color: #101f33; background: transparent; }
.topbar.topbar--studio nav a[aria-current="page"] { color: #3424c6; border-bottom-color: #533afd; }
.topbar.topbar--studio .lang-switcher,
.topbar.topbar--studio .cs-select--lang,
.topbar.topbar--studio .theme-toggle { flex: 0 0 auto; margin-left: 0; }

/* Give the brand a stable row before nav content can overflow the viewport. */
@media (max-width: 1024px) {
  .topbar.topbar--studio {
    height: auto; min-height: 70px; padding-block: 10px 8px;
    display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 6px;
  }
  .topbar.topbar--studio nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 0 14px; margin-left: 0; }
  .topbar.topbar--studio nav a,
  .topbar.topbar--studio nav a[aria-current="page"] { min-height: 38px; }
}
@media (max-width: 640px) {
  .topbar.topbar--studio { padding-inline: var(--page-gutter, 16px); gap: 4px; }
  .topbar.topbar--studio nav { gap: 0 12px; }
}
:root[data-theme="dark"] .topbar.topbar--studio nav a { color: #aab4c2; }
:root[data-theme="dark"] .topbar.topbar--studio nav a:hover { color: #f8fafc; }
:root[data-theme="dark"] .topbar.topbar--studio nav a[aria-current="page"] { color: #c4baff; border-bottom-color: #8b7bff; background: transparent; }
