:root {
  --tool-header-height: 76px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  height: var(--tool-header-height);
  border-bottom: 1px solid var(--tool-header-border, var(--line, var(--panel-border, #2c3136)));
  background: rgba(8, 9, 10, 0.92);
  backdrop-filter: blur(12px);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.app-header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(1220px, calc(100% - 16px));
  height: 100%;
  margin: 0 auto;
}

.header-left,
.app-brand,
.app-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text, #f3f4f4);
  text-decoration: none;
}

.header-left {
  min-width: 0;
}

.app-brand {
  flex: 0 0 auto;
  width: 184px;
  height: 52px;
}

.app-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.app-menu-toggle {
  display: none;
  margin-left: auto;
}

.app-nav-link {
  position: relative;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  color: #d8dde1;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0;
}

.app-nav-link:hover,
.app-nav-link:focus {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.app-nav-link.active {
  background: rgba(255, 255, 255, 0.045);
  color: #ffffff;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@media (max-width: 760px) {
  :root {
    --tool-header-height: 54px;
  }

  .app-header-inner {
    position: relative;
    align-items: stretch;
    gap: 8px;
    padding: 8px 0;
  }

  .header-left {
    width: auto;
  }

  .app-brand {
    width: 124px;
    height: 38px;
  }

  .app-menu-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    min-width: 0;
    min-height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #d8dde1;
  }

  .app-menu-toggle:hover,
  .app-menu-toggle:focus {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
  }

  .app-menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.045);
    color: #ffffff;
  }

  .app-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--tool-header-border, var(--line, var(--panel-border, #2c3136)));
    background: rgba(8, 9, 10, 0.98);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38);
  }

  .app-header-inner.nav-open .app-nav {
    display: flex;
  }

  .app-nav-link {
    min-width: 0;
    min-height: 38px;
    justify-content: flex-start;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .nav-icon {
    width: 15px;
    height: 15px;
  }
}
