.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  border-bottom: var(--border-width) solid var(--color-border);
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--content-max);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.app-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: calc(-1 * var(--space-2));
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
}

.app-header__mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: var(--border-width) solid var(--color-accent-line);
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.app-header__name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.app-header__actions .btn[aria-current='page'] {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.app-header__divider {
  width: var(--border-width);
  height: 1.25rem;
  background: var(--color-border-strong);
}

@media (max-width: 46rem) {
  .app-header__inner {
    gap: var(--space-2);
  }

  .app-header__actions {
    gap: var(--space-1);
  }

  .app-header__divider {
    display: none;
  }

  /* Keep the action icons, hide their text visually (still announced) on narrow screens.
     Square 44px buttons keep a comfortable touch target. */
  .app-header__actions .btn {
    width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    font-size: 0;
    gap: 0;
  }

  .app-header__actions .connection {
    margin-right: var(--space-1);
  }
}

/* Phones: the status keeps its dot and "szimulált" tag; the state text stays available to
   screen readers and in the tooltip */
@media (max-width: 30rem) {
  .app-header__actions .connection__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .app-header__brand {
    gap: var(--space-2);
    min-width: 0;
  }

  .app-header__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Smallest phones (320px): the decorative mark gives way so the full name stays readable */
@media (max-width: 22rem) {
  .app-header__mark {
    display: none;
  }
}
