/**
 * Single visual contract for the studio global nav row (Tours / Editor / …).
 * Load after css/tokens.css. Add class "studio-shell-header" on the <header>.
 */

header.studio-shell-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  gap: 16px;
  width: 100%;
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 var(--hdr-side-padding);
  padding-top: max(0px, env(safe-area-inset-top));
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

header.studio-shell-header .hdr-brand-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

header.studio-shell-header a.hdr-brand-name {
  text-decoration: none;
  color: var(--text);
}

header.studio-shell-header a.hdr-brand-name:hover {
  opacity: 0.9;
}

header.studio-shell-header .hdr-global-tabs {
  display: flex;
  align-items: center;
  gap: var(--hdr-pill-gap);
  flex-shrink: 0;
  flex-wrap: wrap;
  min-width: 0;
}

/* Fixed box model: same weight active/inactive to avoid pill width jump */
header.studio-shell-header .hdr-global-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  min-width: 5.25rem;
  padding: var(--hdr-pill-padding);
  border-radius: var(--hdr-pill-radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: var(--hdr-pill-font-size);
  font-weight: 600;
  font-family: var(--font-sans);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}

header.studio-shell-header a.hdr-global-tab {
  color: var(--text-secondary);
}

header.studio-shell-header button.hdr-global-tab {
  font: inherit;
  font-size: var(--hdr-pill-font-size);
  font-weight: 600;
  font-family: var(--font-sans);
}

header.studio-shell-header .hdr-global-tab:hover {
  background: var(--hotspot-hover);
  color: var(--text);
}

header.studio-shell-header .hdr-global-tab.active {
  background: var(--accent);
  color: var(--accent-text);
}

header.studio-shell-header .hdr-global-tab:not(.active) {
  opacity: 0.88;
}

header.studio-shell-header span.hdr-global-tab {
  cursor: default;
  user-select: none;
}

header.studio-shell-header .hdr-merge-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

header.studio-shell-header .hdr-storage-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

header.studio-shell-header .hdr-signout {
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
}

header.studio-shell-header .hdr-signout:hover {
  background: var(--hotspot-hover);
}

/* Editor first-row header also uses .hdr-v2; keep grid placement when nested */
header.hdr-v2.studio-shell-header {
  grid-column: 1 / -1;
}
