/* Nebula Suite 1.7.2 shared product header. */
.suite-header {
  position: sticky;
  top: 0;
  z-index: 70;
  display: grid;
  min-height: 82px;
  grid-template-columns: minmax(210px, auto) minmax(220px, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  padding: 14px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--nebula-line, var(--line));
  color: var(--nebula-text, var(--text));
  background: color-mix(in srgb, var(--nebula-bg, var(--bg)) 92%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.suite-header-leading,
.suite-header-actions,
.suite-header-center,
.suite-header-nav,
.suite-header-brand {
  display: flex;
  align-items: center;
}

.suite-header-leading,
.suite-header-center { min-width: 0; }
.suite-header-leading { gap: 10px; }
.suite-header-center { justify-content: center; }
.suite-header-actions { justify-content: flex-end; gap: 9px; }

.suite-header-brand {
  min-width: 0;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.suite-header-brand img {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
}

.suite-header-brand > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.suite-header-brand strong,
.suite-header-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suite-header-brand strong {
  color: inherit;
  font-size: 16px;
  font-weight: 820;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.suite-header-brand small {
  color: var(--nebula-muted, var(--muted));
  font-size: 11px;
  font-weight: 620;
  line-height: 1.25;
}

.suite-header-nav {
  justify-content: center;
  gap: clamp(18px, 2.4vw, 34px);
}

.suite-header-mobile-actions { display: none; }

.suite-header-nav a {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  color: var(--nebula-muted, var(--muted));
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.suite-header-nav a:hover,
.suite-header-nav a.is-active {
  color: var(--nebula-text, var(--text));
}

.suite-header-nav a.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--nebula-accent, var(--accent));
  content: "";
}

.suite-header-actions > a:not(.suite-header-brand),
.suite-header-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--nebula-line, var(--line));
  border-radius: 10px;
  color: var(--nebula-text, var(--text));
  background: var(--nebula-panel, var(--panel, var(--surface)));
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.suite-header-actions > a:hover,
.suite-header-action:hover {
  border-color: color-mix(in srgb, var(--nebula-accent, var(--accent)) 44%, var(--nebula-line, var(--line)));
  background: var(--nebula-panel-2, var(--panel-strong, var(--surface-strong)));
}

.suite-header-actions > .primary-button,
.suite-header-actions > .suite-header-primary {
  border-color: var(--nebula-accent, var(--accent));
  color: var(--nebula-accent-ink, var(--accent-ink));
  background: var(--nebula-accent, var(--accent));
}

.suite-header .suite-launcher-button {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.suite-header-theme.nebula-theme-toggle {
  display: inline-flex;
  width: auto;
  min-width: 112px;
  height: 48px;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--nebula-line, var(--line));
  border-radius: 10px;
  color: var(--nebula-text, var(--text));
  background: var(--nebula-panel, var(--panel, var(--surface)));
  font: inherit;
  cursor: pointer;
}

.suite-header-theme.nebula-theme-toggle:hover,
.suite-header-theme.nebula-theme-toggle[aria-expanded='true'] {
  border-color: color-mix(in srgb, var(--nebula-accent, var(--accent)) 44%, var(--nebula-line, var(--line)));
  background: var(--nebula-panel-2, var(--panel-strong, var(--surface-strong)));
}

.suite-header-theme.nebula-theme-toggle > span {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, #090a0d 0 50%, #fff 50% 100%);
}

.suite-header-theme .nebula-theme-label {
  font-size: 12px;
  font-weight: 760;
}

.nebula-theme-menu {
  position: fixed;
  z-index: 220;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--nebula-line, var(--line));
  border-radius: 12px;
  color: var(--nebula-text, var(--text));
  background: var(--nebula-panel, var(--panel, var(--surface)));
  box-shadow: 0 20px 60px rgba(8, 10, 14, .3);
}

.nebula-theme-menu button {
  display: grid;
  width: 100%;
  min-height: 48px;
  align-items: center;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nebula-theme-menu button:hover,
.nebula-theme-menu button[aria-checked='true'] {
  background: color-mix(in srgb, var(--nebula-accent, var(--accent)) 11%, var(--nebula-panel-2, var(--panel-strong, var(--surface-strong))));
}

.nebula-theme-menu button > span { display: grid; gap: 2px; }
.nebula-theme-menu button[aria-checked='true'] strong { color: var(--nebula-accent, var(--accent)); }
.nebula-theme-menu small { color: var(--nebula-muted, var(--muted)); font-size: 11px; }

.suite-header-menu-button {
  display: none;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--nebula-line, var(--line));
  border-radius: 10px;
  color: var(--nebula-text, var(--text));
  background: var(--nebula-panel, var(--panel, var(--surface)));
  cursor: pointer;
}

.suite-header-menu-button > span {
  width: 18px;
  height: 14px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

@media (max-width: 1040px) {
  .suite-header {
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 14px;
  }

  .suite-header-leading { grid-column: 1; grid-row: 1; }
  .suite-header-actions { grid-column: 2; grid-row: 1; }

  .suite-header-center:has(.suite-header-nav) {
    position: fixed;
    z-index: 72;
    top: 76px;
    right: 14px;
    left: 14px;
    display: none;
    padding: 12px;
    border: 1px solid var(--nebula-line, var(--line));
    border-radius: 12px;
    background: var(--nebula-panel, var(--panel, var(--surface)));
    box-shadow: 0 20px 60px rgba(8, 10, 14, .26);
  }

  .suite-header-center:has(.suite-header-nav[data-open]) { display: block; }
  .suite-header-center:not(:has(.suite-header-nav)) {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .suite-header-nav { align-items: stretch; flex-direction: column; gap: 2px; }
  .suite-header-nav a { min-height: 46px; padding: 0 12px; border-radius: 8px; }
  .suite-header-nav a:hover,
  .suite-header-nav a.is-active { background: var(--nebula-panel-2, var(--panel-strong, var(--surface-strong))); }
  .suite-header-nav a.is-active::after { content: none; }
  .suite-header-mobile-actions {
    display: grid;
    gap: 2px;
    margin-top: 7px;
    padding-top: 9px;
    border-top: 1px solid var(--nebula-line, var(--line));
  }
  .suite-header-mobile-actions a {
    color: var(--nebula-text, var(--text));
  }
  .suite-header-mobile-actions .suite-header-primary {
    color: var(--nebula-accent-ink, var(--accent-ink));
    background: var(--nebula-accent, var(--accent));
  }
  .suite-header-menu-button { display: grid; margin-left: auto; }
}

@media (max-width: 720px) {
  .suite-header {
    position: sticky;
    min-height: 72px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 11px 14px;
  }

  .suite-header-brand img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .suite-header-brand strong { font-size: 15px; }
  .suite-header-brand small { display: none; }
  .suite-header-actions { gap: 7px; }
  .suite-header-actions > a:not(.suite-header-keep-mobile),
  .suite-header-actions > .suite-header-hide-mobile { display: none; }
  .suite-header .suite-launcher-button { width: 48px; height: 48px; }
  .suite-header-theme.nebula-theme-toggle {
    width: auto;
    min-width: 104px;
    padding: 0 11px;
  }
  .suite-header-theme .nebula-theme-label { display: block; }
  .suite-header-center:has(.suite-header-nav) { top: 70px; }
}

@media (max-width: 420px) {
  .suite-header-brand > span { display: none; }
}
