:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e2e5ec;
  --text: #1f2430;
  --text-muted: #62677a;
  --primary: #3b5bfd;
  --primary-dark: #2c46d1;
  --under: #4d9de0;
  --normal: #2ecc71;
  --over: #f4b942;
  --obese: #e6543a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.site-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

.site-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.9rem;
}

.tagline {
  color: var(--text-muted);
  margin: 0;
}

/* Ad slots */
.ad-slot {
  background: repeating-linear-gradient(45deg, #eceff5, #eceff5 10px, #e4e7ef 10px, #e4e7ef 20px);
  border: 1px dashed #c3c8d6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa0b1;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-slot--top, .ad-slot--bottom {
  max-width: 728px;
  height: 90px;
  margin: 0 auto 1.5rem;
}

.ad-slot--in-content {
  height: 100px;
  margin: 2rem 0;
}

.ad-slot--sidebar {
  width: 100%;
  min-height: 250px;
  position: sticky;
  top: 1.5rem;
}

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .ad-column { order: 3; }
}

.calculator-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab-btn {
  flex: 1 1 auto;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.unit-toggle {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-panel h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.panel-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -0.5rem;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-group.hidden { display: none; }

.calc-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.calc-form input, .calc-form select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.radio-row {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
}

.calc-form button {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.calc-form button:hover { background: var(--primary-dark); }

.result-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.result-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.result-category {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.cal-breakdown {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bmi-scale {
  margin-top: 1rem;
  position: relative;
  height: fit-content;
}

.bmi-scale-bar {
  display: flex;
  height:fit-content;
  border-radius: 6px;
  overflow: hidden;

}

.seg { flex: 1; }
.seg.under { background: var(--under); }
.seg.normal { background: var(--normal); }
.seg.over { background: var(--over); }
.seg.obese { background: var(--obese); }

.bmi-marker {
  position: absolute;
  top: -6px;
  width: 5px;
  height: fit-content;
  background: var(--text);
  transform: translateX(-1px);
}

.article {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.article h2 {
  font-size: 1.35rem;
}

.article h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.article p {
  color: var(--text);
  margin-top: 0;
}

.site-footer a {
  color: var(--primary);
}

.disclaimer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
