.nav-toggle,
.mobile-nav {
  display: none;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  flex: none;
}

.nav[data-mobile-nav-root] .nav-links {
  margin-left: 2rem;
}

.nav-toggle {
  appearance: none;
  border: 1px solid rgba(15, 37, 53, 0.14);
  background: #fff;
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  padding: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.nav-toggle:hover {
  border-color: rgba(89, 163, 62, 0.35);
  background: rgba(89, 163, 62, 0.08);
}

.nav-toggle-box {
  width: 18px;
  height: 14px;
  display: grid;
  align-content: space-between;
}

.nav-toggle-line {
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-open .nav-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-open .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 640px) {
  .nav[data-mobile-nav-root] {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    align-content: start;
    gap: 0.75rem;
    height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .nav[data-mobile-nav-root] .nav-links {
    display: none;
    margin-left: 0;
  }

  .nav[data-mobile-nav-root] .brand {
    width: auto;
    min-width: 0;
  }

  .nav[data-mobile-nav-root] .brand img {
    height: 36px;
  }

  .nav[data-mobile-nav-root] .brand-name {
    font-size: 1rem;
  }

  .nav[data-mobile-nav-root] .nav-tools > .btn.btn-leaf {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    flex: none;
  }

  .mobile-nav {
    width: 100%;
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 37, 53, 0.12);
    border-radius: 24px;
    padding: 0.9rem;
    box-shadow: 0 24px 60px rgba(15, 37, 53, 0.14);
  }

  .mobile-nav.is-open {
    display: grid;
    gap: 0.35rem;
  }

  .mobile-nav a {
    color: var(--ink);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.8rem 0.95rem;
    border-radius: 16px;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .mobile-nav a:hover,
  .mobile-nav a.active {
    background: rgba(89, 163, 62, 0.08);
    color: var(--leaf-deep);
  }

  .mobile-nav .mobile-nav-cta {
    margin-top: 0.25rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background: var(--leaf);
  }

  .mobile-nav .mobile-nav-cta:hover,
  .mobile-nav .mobile-nav-cta.active {
    color: #fff;
    background: var(--leaf-deep);
  }

  .nav[data-mobile-nav-root].nav-open .nav-toggle {
    border-color: rgba(89, 163, 62, 0.35);
    background: rgba(89, 163, 62, 0.08);
  }
}
