.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: none;
}

.brand-title-group {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-family-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.brand-name span {
  color: var(--text-primary);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Connection Status Badge */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-pill.connected {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-pill.connected .status-pill-dot {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.status-pill.unconfigured {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border-color: rgba(245, 158, 11, 0.3);
}

.status-pill.unconfigured .status-pill-dot {
  background-color: var(--color-warning);
}

.status-pill.disconnected {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.status-pill.disconnected .status-pill-dot {
  background-color: var(--color-danger);
}

/* Centered Header Segmented Control (Todo, Videos, Shorts, Live) */
.header-center-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0 16px;
}

.content-type-segmented-control {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px;
  border-radius: var(--radius-full);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  gap: 2px;
}

.content-type-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family-base);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.content-type-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.content-type-btn.active {
  background: rgba(59, 130, 246, 0.22);
  color: #60a5fa;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

@media (max-width: 900px) {
  .header-center-controls {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .brand-sub { display: none; }
  .app-header { padding: 0 10px; }
  .status-text { display: none; }
  .header-brand { gap: 6px; }
}

@media (max-width: 400px) {
  .brand-title-group { display: none; }
}

@media (orientation: landscape) and (max-height: 550px) {
  .app-header {
    height: 48px !important;
    padding: 0 12px !important;
  }
  .brand-icon {
    width: 28px !important;
    height: 28px !important;
  }
  .brand-name {
    font-size: 0.95rem !important;
  }
}
