/* Calculator forms + results on the charcoal theme */

.calc-page { padding: 40px 0 64px; max-width: 860px; }

.calc-head { max-width: 640px; margin-bottom: 32px; }
.calc-head h1 {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.calc-head p { font-size: 17px; line-height: 1.6; color: var(--body); margin: 0; }

.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.calc-form, .calc-results {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.02);
}

/* Segmented toggle (units, goal, sex) */
.seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  gap: 2px;
}
.seg label {
  position: relative;
  cursor: pointer;
}

/* cancel the .field label caption margin that would otherwise leak into
   the toggle options (higher specificity than .field label) */
.field .seg label, .seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--body);
  white-space: nowrap;
}
.seg input:checked + span {
  color: #1c2028;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-4));
}

.field { margin-top: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--body);
  margin-bottom: 6px;
}
.field .with-unit {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.field input[type="number"], .field select {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  padding: 11px 13px;
  outline: none;
  -moz-appearance: textfield;
}
.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field select { cursor: pointer; padding-right: 13px; }
.field .unit {
  padding: 0 13px;
  font-size: 13px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  align-self: stretch;
  display: flex;
  align-items: center;
}
.field .seg { margin-top: 2px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Results */
.calc-results h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 4px;
}
.headline-stat { margin: 14px 0 4px; }
.headline-stat .num {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.headline-stat .unit { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.headline-stat .cap { font-size: 13px; color: var(--muted); margin-top: 6px; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.stat-row .k { font-size: 15px; color: var(--body); }
.stat-row .v { font-size: 16px; font-weight: 700; color: var(--ink); }
.stat-row .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 5px; }

/* Macro bar */
.macro-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 18px;
  background: rgba(255,255,255,0.05);
}
.macro-bar i { display: block; height: 100%; }
.macro-bar .p { background: var(--accent-1); }
.macro-bar .f { background: var(--accent-4); }
.macro-bar .c { background: var(--accent-3); }

.calc-note {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
}
.calc-note a { color: var(--accent-3); }

.calc-disclaimer { font-size: 13px; color: var(--muted); margin-top: 18px; line-height: 1.55; }

/* Calculators index cards reuse .post-list from prose.css */

@media (max-width: 720px) {
  .calc { grid-template-columns: 1fr; }
}
