body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 1.5rem 0;
}

.container {
  background: #ffffff;
  padding: 2.2rem 1.8rem 2.4rem;
  border-radius: 24px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.28);
  max-width: 440px;
  width: 90%;
  text-align: center;
  margin: 0 auto;
}

h1 {
  color: #262626;
  margin-top: 0;
  margin-bottom: 1.6rem;
  letter-spacing: 2px;
  font-size: 2rem;
}

.unit-tabs {
  display: flex;
  background: #e8edf5;
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
  margin: 0 auto 1.8rem;
}

.unit-tab {
  border: none;
  background: transparent;
  padding: 0.55rem 2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: #4a5568;
  transition: background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}

.unit-tab.active {
  background: #0f7285;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(15,114,133,0.35);
}

.unit-tab:not(.active):hover {
  background: #d0d8ea;
}

.input-group {
  margin-bottom: 1.3rem;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 0.85rem;
  font-weight: 600;
  color: #2d3748;
  font-size: 0.95rem;
}

.input-group input[type="number"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1.8px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input[type="number"]:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.22);
}

.row {
  display: flex;
  gap: 0.6rem;
}

.row input {
  width: 100%;
}

.primary-btn {
  background: #7c8cff;
  color: #ffffff;
  padding: 0.95rem 2.3rem;
  border: none;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  width: 100%;
  max-width: 280px;
  margin: 0.6rem auto 0.4rem;
  display: block;
}

.primary-btn:hover {
  background: #6a7bff;
  box-shadow: 0 10px 22px rgba(122,140,255,0.45);
}

.primary-btn:active {
  transform: translateY(1px);
}

.result {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 1rem 0 0.4rem;
  min-height: 2.2rem;
  color: #1a202c;
}

#category {
  font-size: 1.1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  margin-bottom: 0.6rem;
}

.normal { background: #d4edda; color: #155724; }
.overweight { background: #f8d7da; color: #721c24; }
.underweight { background: #fff3cd; color: #856404; }
.obese { background: #f5c6cb; color: #721c24; }

.info {
  margin-top: 1.4rem;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #2d3748;
}

.info h2 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
  text-align: center;
  color: #1a202c;
}

.info p { margin: 0.25rem 0; }

.bmi-table {
  margin-top: 1.8rem;
  text-align: left;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
  padding: 1rem 1.2rem 1.2rem;
}

.bmi-table h2 {
  text-align: center;
  margin: 0 0 0.75rem 0;
  color: #1a202c;
}

.bmi-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: 10px;
  overflow: hidden;
}

.bmi-table th,
.bmi-table td {
  border: 1px solid #e2e8f0;
  padding: 0.55rem 0.7rem;
}

.bmi-table th {
  background-color: #0f3460;
  color: #ffffff;
  text-align: left;
}

.bmi-table tr:nth-child(even) td {
  background-color: #f7fafc;
}

.bmi-highlight td {
  background-color: #fff3c4 !important;
  font-weight: 600;
}

footer {
  margin-top: 1.6rem;
  font-size: 0.9rem;
  color: #718096;
  text-align: center;
}

footer p { margin: 0; }

footer a {
  color: #667eea;
  text-decoration: underline;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.site-nav a {
  color: #667eea;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #667eea;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.nav-active {
  background: #667eea;
  color: #ffffff;
}

.related-links {
  margin-top: 1.8rem;
  text-align: left;
  background: #f7f9ff;
  border-radius: 14px;
  padding: 1rem 1.2rem;
}

.related-links h3 {
  margin: 0 0 0.6rem 0;
  font-size: 1rem;
  color: #1a202c;
}

.related-links ul {
  margin: 0;
  padding-left: 1.2rem;
}

.related-links li { margin-bottom: 0.4rem; }

.related-links a {
  color: #667eea;
  text-decoration: none;
  font-size: 0.9rem;
}

.related-links a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  body { padding: 1.2rem 0; }
  .container {
    width: 88%;
    max-width: 380px;
    padding: 1.8rem 1.4rem 2.1rem;
  }
  h1 { font-size: 1.8rem; }
  .primary-btn {
    font-size: 1rem;
    max-width: 260px;
  }
  .unit-tab {
    padding: 0.5rem 1.4rem;
    font-size: 0.9rem;
  }
}
