.public-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

.public-nav .nav-inner {
  position: relative;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--dark, #111827);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 40px;
}

.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--purple, #5b4ef8);
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: #444;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--purple, #5b4ef8);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-ghost {
  background: none;
  border: none;
  font-size: 0.92rem;
  color: #333;
  padding: 8px 14px;
  cursor: pointer;
}

.btn-purple {
  background: var(--purple, #5b4ef8);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-purple:hover {
  background: var(--purple-dark, #4338e0);
}

/* existing dropdown styles */
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 24px;
  padding: 6px 14px 6px 8px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark, #0f1117);
}

.nav-user-btn:hover {
  border-color: var(--purple, #5b4ef8);
  box-shadow: 0 2px 10px rgba(91, 78, 248, 0.1);
}

.nav-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--purple, #5b4ef8);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.nav-user-avatar.has-image {
  background: white;
}

.nav-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-user-btn svg {
  width: 14px;
  height: 14px;
  color: var(--gray-text, #6b7280);
}

.nav-dropdown-pub {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  min-width: 210px;
  padding: 8px 0;
  display: none;
  z-index: 300;
}

.nav-dropdown-pub.open {
  display: block;
}

.nav-dd-header {
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 4px;
}

.nav-dd-header strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-dd-header span {
  font-size: 0.8rem;
  color: var(--gray-text, #6b7280);
}

.nav-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 0.88rem;
  color: var(--dark, #0f1117);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.nav-dd-item:hover {
  background: var(--gray-light, #f3f4f8);
}

.nav-dd-item svg {
  width: 16px;
  height: 16px;
  color: var(--gray-text, #6b7280);
  flex-shrink: 0;
}

.nav-dd-divider {
  height: 1px;
  background: var(--border, #e5e7eb);
  margin: 4px 0;
}

.nav-dd-item.logout {
  color: #ef4444;
}

.nav-dd-item.logout svg {
  color: #ef4444;
}

@media (max-width: 900px) {
  nav {
    padding: 0 16px;
  }

  .nav-inner {
    gap: 12px;
  }

  .logo {
    font-size: 1rem;
  }

  .nav-toggle {
    display: inline-flex !important;
    width: 46px;
    height: 46px;
    padding: 0;
    background: white;
    border: 1px solid var(--border, #e5e7eb);
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    z-index: 250;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-links a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: var(--purple-bg, #eeeefe);
    color: var(--purple, #5b4ef8);
  }

  .nav-right {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-ghost,
  .btn-purple,
  .nav-user-btn {
    width: 100%;
    justify-content: center;
  }

  .nav-dropdown-pub {
    position: static;
    top: auto;
    right: auto;
    min-width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }
}

@media (min-width: 901px) {
  .nav-menu {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex: 1;
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .logo {
    font-size: 0.95rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }
}