.app-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  height: calc(52px + var(--safe-t));
  padding-top: var(--safe-t);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  color: var(--text);
  z-index: var(--z-nav);
  transition: box-shadow 0.2s ease, background-color 0.35s ease;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.app-header--scrolled {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid var(--border-c);
}

@media (min-width: 768px) {
  .app-header {
    height: 56px;
    padding-top: 0;
    padding: 0 var(--spacing-xl);
  }
}

/* Slots */
.header-left { display: flex; align-items: center;   min-width: 0;
  }
.header-right {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
  }

/* Logo */
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo svg { height: 22px; width: auto; display: block; }
@media (min-width: 768px) { .brand-logo svg { height: 26px; } }

/* Brand SVG dark-mode readability: override inline fills via CSS */
.brand-svg g[fill="#4600D2"] { fill: var(--primary); }
.brand-svg g[fill="#1d1d1b"] { fill: var(--text); }

/* Theme toggle button */
.header-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-c);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.header-theme-toggle:hover {
  background: var(--primary-tint);
  color: var(--primary-ink);
  transform: translateY(-1px);
}
.header-theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-tint);
}

/* Avatar */
.user-avatar { display: flex; align-items: center; flex-shrink: 0; }
.user-avatar img {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-c);
  object-fit: cover;
}
@media (min-width: 768px) {
  .user-avatar img { width: 36px; height: 36px; }
}
