@layer components {
  .app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-bg);
  }

  .app-header__logo {
    display: flex;
    align-items: center;
    height: 32px;
  }

  .app-header__logo-text {
    font-family: var(--font-title);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--color-accent);
    letter-spacing: 0.05em;
  }

  /* Light themes: separate header from calendar strip below */
  :root[data-theme^="light"] .app-header {
    border-bottom: 1px solid var(--color-border-subtle);
  }

  /* Desktop shell pages (home, etc.) swap the mobile header for the
     dedicated `.desktop-header` partial — see desktop-header.css for
     the inverse rule. Below 1200px and on pages without the shell, the
     mobile header keeps its current UX 1:1. */
  @media (width >= 1200px) {
    .has-desktop-shell .app-header {
      display: none;
    }
  }

  .app-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .app-header__btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 10px;
    background: transparent;
    border: none;
    padding: 0;
  }

  .app-header__btn:active {
    opacity: 0.7;
  }

  .app-header__btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 6px;
  }

  .app-header__btn svg {
    width: 22px;
    height: 22px;
    stroke: var(--color-text);
    stroke-width: 2;
    fill: none;
  }

  .app-header__btn--live {
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    height: auto;
    padding: 8px 14px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.3px;
    border-radius: 20px;
    border: none;
    cursor: pointer;

    /* Default = is-today */
    background: var(--color-surface);
    color: var(--color-text);
  }

  .app-header__btn--live:active {
    opacity: 0.85;
  }

  /* is-other-day → green pill with HOY */
  .app-header__btn--is-other-day {
    background: var(--color-accent);
    color: var(--color-on-accent);
  }

  /* live filter active → red pill */
  .app-header__btn--live-active {
    background: var(--color-live);
    color: var(--color-on-live);
  }

  /* live dot — only visible in is-today */
  .app-header__live-dot {
    display: none;
    width: 8px;
    height: 8px;
    background: var(--color-live);
    border-radius: var(--radius-full);
    animation: pulse-live-dot 1.5s ease-in-out infinite;
  }

  .app-header__btn--is-today .app-header__live-dot {
    display: block;
  }

  .app-header__btn--live-active .app-header__live-dot {
    background: var(--color-on-live);
  }

  /* live count badge */
  .app-header__live-count {
    font-size: 11px;
    font-weight: 700;
    background: var(--color-live);
    color: var(--color-on-live);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
  }

  @keyframes pulse-live-dot {
    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0.4;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .app-header__live-dot {
      animation: none;
    }
  }
}
