/* Tablet and phone */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    margin-left: auto; /* keep it on the right: .navbar is space-between with 3 children */
    order: 2; /* after the (collapsed) <nav>, so no gap is left at the edge */
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 14px 8px;
    border-radius: 10px;
    text-align: center;
  }

  .logo img {
    width: 120px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .habit-form {
    flex-direction: column;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 10px 6px;
  }

  .stat-num {
    font-size: 1.4rem;
  }

  .habit {
    gap: 10px;
    padding: 12px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }
}
