:root {
  /* Refined Utility palette -- health/fitness niche */
  --blue: #2563EB;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --blue-mid: #dbeafe;
  --ink: #111827;
  --ink-mid: #374151;
  --ink-soft: #6b7280;
  --ink-faint: #9ca3af;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── HEADER ─── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--blue-light);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-name span { color: var(--blue); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.875rem;
}

.nav-links a {
  color: var(--ink-soft);
  font-weight: 500;
}

.nav-links a:hover { color: var(--blue); text-decoration: none; }

.nav-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--blue);
  background: var(--blue-light);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--blue-mid);
}

/* ─── CONTAINER ─── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ─── HERO / INTRO ─── */
.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.intro {
  padding: 40px 0 24px;
}

.intro h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 12px;
}

.intro p {
  font-size: 1.05rem;
  color: var(--ink-mid);
  max-width: 540px;
  line-height: 1.7;
}

/* ─── TRUST ROW ─── */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.trust-badge::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* ─── TOOL GRID (homepage) ─── */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 48px;
}

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

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tool-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(37,99,235,0.10);
  transform: translateY(-1px);
  text-decoration: none;
}

.tool-icon {
  width: 44px;
  height: 44px;
  background: var(--blue-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tool-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--ink);
}

.tool-card p {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ─── CALCULATOR CARD ─── */
.calc-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.calc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.calc-header-icon {
  width: 38px;
  height: 38px;
  background: var(--blue-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.calc-header h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.calc-header p {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.calc-body { padding: 24px; }

/* ─── FORM ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

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

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-mid);
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

.select-wrap { position: relative; }

.select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  pointer-events: none;
}

.select-wrap select { padding-right: 36px; cursor: pointer; }

.radio-group {
  display: flex;
  gap: 10px;
}

.radio-btn {
  flex: 1;
  position: relative;
}

.radio-btn input { position: absolute; opacity: 0; width: 0; height: 0; }

.radio-btn label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

.radio-btn input:checked + label {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}

/* ─── BUTTON ─── */
.btn {
  display: block;
  width: 100%;
  height: 50px;
  background: var(--blue);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: var(--blue-dark); }

/* ─── RESULT BOX ─── */
.result-box {
  display: none;
  background: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-mid) 100%);
  border: 1.5px solid var(--blue-mid);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.result-box.visible { display: block; }

.result-headline {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.result-number {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}

.result-unit {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.result-breakdown {
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(37,99,235,0.08);
}

.breakdown-row:last-child { border-bottom: none; }

.breakdown-label { color: var(--ink-mid); }
.breakdown-value { font-weight: 700; color: var(--ink); }

/* macro result grid */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.macro-tile {
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}

.macro-tile-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.macro-tile-value {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.macro-tile-unit {
  font-size: 0.72rem;
  color: var(--ink-faint);
}

/* ─── CONTENT SECTIONS ─── */
.content-section {
  margin-bottom: 36px;
}

.content-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.content-section p { color: var(--ink-mid); font-size: 0.93rem; line-height: 1.75; margin-bottom: 12px; }

.formula-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 12px 0;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--ink-mid);
  line-height: 1.8;
}

/* ─── FAQ ─── */
.faq-list { list-style: none; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.faq-answer {
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.7;
}

/* ─── RELATED TOOLS ─── */
.related-tools h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  color: var(--ink);
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.related-list a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-light);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--blue-mid);
  text-decoration: none;
}

.related-list a:hover { background: var(--blue-mid); text-decoration: none; }

/* ─── SOURCE NOTE ─── */
.source-note {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.source-note a { color: var(--ink-faint); text-decoration: underline; }

/* ─── PAGE TITLE AREA ─── */
.page-intro {
  padding: 36px 0 20px;
}

.page-intro h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 10px;
}

.page-intro p {
  font-size: 0.97rem;
  color: var(--ink-mid);
  max-width: 560px;
  line-height: 1.7;
}

/* ─── AD PLACEHOLDERS ─── */
.ad-unit {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 24px 0;
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

footer nav a { color: var(--ink-soft); }
footer nav a:hover { color: var(--blue); text-decoration: none; }

/* ─── UTILITY ─── */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

@media (max-width: 480px) {
  .calc-body { padding: 18px 16px; }
  .calc-header { padding: 14px 16px; }
  .nav-links { display: none; }
}
