.reader-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  z-index: 1000;
  background: inherit;
  border-bottom: 1px solid rgba(0,0,0,0.13);
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.13);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;

  &.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .header-left,
  .header-right {
    display: flex;
    align-items: center;
    z-index: 1;
  }

  .icon-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    opacity: 0.85;

    &:hover {
      opacity: 1;
    }

    &:last-child {
      margin-right: 0;
    }

    &.active {
      color: #ef4444;
      opacity: 1;
    }

    .pi {
      font-size: 16px;
    }
  }

  .chapter-title {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.2em;
    padding: 0 8px;
  }

  .mobile-only {
    display: none;
  }

  .overflow-menu {
    position: relative;
  }

  .overflow-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
  }

  .overflow-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    min-width: 180px;
    padding: 4px;
  }

  .overflow-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: inherit;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;

    &:hover {
      background: rgba(128, 128, 128, 0.15);
    }
  }
}

@media (max-width: 600px) {
  .reader-header {
    padding: 0 2px;

    .icon-btn {
      padding: 10px;
      margin-right: 2px;
    }

    .desktop-only {
      display: none;
    }

    .mobile-only {
      display: block;
    }
  }
}
