.app-header .header-inner:has(.app-navigation) {
  position: relative;
  display: flex;
  width: min(100%, 1480px);
  min-height: 72px;
  margin-inline: auto;
  padding-inline: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.app-header .brand {
  flex-shrink: 0;
}

.app-header .header-inner:has(.app-navigation) .brand > span:last-child {
  position: static;
  display: inline;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}

.app-header .app-navigation {
  position: static;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.app-header .app-navigation > .task-history-button {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.app-header .app-navigation > .task-history-button > span {
  display: inline;
}

.app-header .app-navigation > .task-history-button > img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.app-header .app-navigation > [aria-current="page"] {
  background: var(--soft-primary-soft, #eef2ff);
  color: var(--soft-primary-strong, #5145cd);
}

.app-header .app-navigation > .task-history-button:focus-visible {
  outline: 2px solid var(--focus, #2563eb);
  outline-offset: 2px;
}

.app-header .app-navigation > .mode-badge {
  display: inline-flex;
  width: 126px;
  min-height: 34px;
  margin-left: 6px;
  padding-inline: 10px;
  flex-shrink: 0;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .app-header .header-inner:has(.app-navigation) {
    flex-wrap: wrap;
    padding: 10px 20px 8px;
    gap: 6px;
  }

  .app-header .app-navigation {
    display: grid;
    width: 100%;
    padding: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }

  .app-header .app-navigation > .task-history-button {
    padding-inline: 4px;
    gap: 6px;
  }

  .app-header .app-navigation > .mode-badge {
    position: absolute;
    top: 14px;
    right: 20px;
    margin: 0;
  }
}

@media (max-width: 600px) {
  .app-header .header-inner:has(.app-navigation) {
    padding: 8px 12px 6px;
  }

  .app-header .brand {
    min-height: 40px;
    gap: 8px;
    font-size: 15px;
  }

  .app-header .brand-mark {
    width: 34px;
    height: 34px;
  }

  .app-header .app-navigation > .task-history-button > span {
    display: none;
  }

  .app-header .app-navigation > .mode-badge {
    top: 11px;
    right: 12px;
    width: 122px;
    min-height: 32px;
    font-size: 11px;
  }
}
