/* ─── HealthCalcs — Simple, functional design ─────────────── */
:root {
  --bg:        #ffffff;
  --bg-alt:    #f7f8fa;
  --header-bg: #1f3a5f;
  --accent:    #1d4ed8;
  --accent-h:  #1e40af;
  --green:     #15803d;
  --text:      #111827;
  --text-mid:  #4b5563;
  --text-light:#9ca3af;
  --border:    #e5e7eb;
  --border-d:  #d1d5db;
  --red:       #dc2626;
  --red-bg:    #fef2f2;
  --result-bg: #f0f9ff;
  --result-br: #bae6fd;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }
a:hover { color: var(--accent-h); text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  color: #fff;
  padding: 12px 0;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-logo {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-logo:hover { text-decoration: none; color: #fff; }
.site-logo em { font-style: normal; color: #93c5fd; font-weight: 400; }
.site-nav a {
  color: #cbd5e1;
  text-decoration: none;
  margin-left: 18px;
  font-size: 14px;
}
.site-nav a:hover { color: #fff; text-decoration: underline; }

/* ─── Main / Pages ────────────────────────────────────────── */
main { flex: 1; padding: 28px 0 48px; }

.breadcrumb {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

h1 {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--green);
  margin-top: 28px;
  margin-bottom: 12px;
}
h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}
p { margin-bottom: 10px; }
.lead {
  font-size: 16px;
  color: var(--text-mid);
  margin-bottom: 18px;
  max-width: 620px;
}

/* ─── Form ─────────────────────────────────────────────────── */
.calc-form {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 22px;
  margin: 16px 0;
}
.form-row { display: flex; gap: 14px; margin-bottom: 14px; }
.form-row:last-of-type { margin-bottom: 0; }
.form-group { flex: 1; min-width: 0; }
label {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 500;
}
input[type="number"], select {
  width: 100%;
  padding: 9px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border-d);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}
input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}
.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  margin-bottom: 0;
}
.form-hint a { color: var(--accent); text-decoration: none; }
.form-hint a:hover { text-decoration: underline; }

.error-msg {
  color: var(--red);
  background: var(--red-bg);
  border-left: 3px solid var(--red);
  padding: 9px 12px;
  font-size: 14px;
  margin: 12px 0;
  border-radius: 4px;
  display: none;
}
.error-msg.visible { display: block; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 14px;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-primary:active { transform: translateY(1px); }

/* ─── Result ───────────────────────────────────────────────── */
.result {
  display: none;
  background: var(--result-bg);
  border: 1px solid var(--result-br);
  border-radius: 6px;
  padding: 22px;
  margin: 18px 0;
  text-align: center;
}
.result.visible { display: block; }
.result-label {
  font-size: 13px;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}
.result-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.result-number sup {
  font-size: 0.4em;
  font-weight: 500;
  color: var(--text-mid);
  margin-left: 4px;
  vertical-align: super;
}
.result-category {
  font-size: 16px;
  color: var(--text);
  margin-top: 8px;
}
.result-secondary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--result-br);
  font-size: 14px;
  color: var(--text-mid);
}
.result-secondary strong { color: var(--text); font-weight: 600; }

/* Macro grid in result */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.macro-cell {
  background: #fff;
  border: 1px solid var(--result-br);
  border-radius: 4px;
  padding: 14px 8px;
}
.macro-cell-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.macro-cell-label {
  font-size: 12px;
  color: var(--text-mid);
  margin-top: 2px;
}

/* ─── Timer ───────────────────────────────────────────────── */
.timer-display {
  display: none;
  background: var(--header-bg);
  color: #fff;
  padding: 32px 22px 28px;
  border-radius: 6px;
  text-align: center;
  margin: 18px 0;
}
.timer-display.visible { display: block; }
.timer-phase {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  font-weight: 600;
}
.timer-phase.is-rest { color: #fbbf24; opacity: 1; }
.timer-time {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  margin: 10px 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.timer-round-info {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 14px;
}
.timer-controls { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.btn-timer {
  padding: 7px 18px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
}
.btn-timer:hover { background: rgba(255,255,255,0.22); }
.btn-timer.danger { color: #fca5a5; border-color: rgba(252,165,165,0.4); }
.btn-timer.danger:hover { background: rgba(252,165,165,0.12); }

/* ─── Homepage Card Grid ──────────────────────────────────── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0 8px;
}
.calc-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.calc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  text-decoration: none;
  color: var(--text);
}
.calc-card h3 {
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 17px;
}
.calc-card p {
  font-size: 14px;
  color: var(--text-mid);
  margin: 0;
}

/* ─── Other Tools list (tool pages) ───────────────────────── */
.other-tools {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.other-tools li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.other-tools li:last-child { border-bottom: none; }
.other-tools a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.other-tools a:hover { text-decoration: underline; }
.other-tools .desc {
  color: var(--text-mid);
  font-weight: 400;
  font-size: 14px;
  margin-left: 6px;
}

/* ─── SEO content ──────────────────────────────────────────── */
.seo p, .seo ul, .seo ol { margin-bottom: 12px; }
.seo ul, .seo ol { padding-left: 22px; }
.seo li { margin-bottom: 4px; color: var(--text-mid); }
.seo h3 { margin-top: 20px; font-size: 16px; color: var(--text); }

/* ─── FAQ (native details/summary) ─────────────────────────── */
.faq { margin-top: 8px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer;
  padding: 13px 28px 13px 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  list-style: none;
  position: relative;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item summary:hover { color: var(--accent); }
.faq-item > p {
  margin: 0;
  padding: 0 0 14px;
  color: var(--text-mid);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ─── Medical disclaimer ───────────────────────────────────── */
.disclaimer {
  margin-top: 28px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-left: 3px solid var(--border-d);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
}
.disclaimer strong { color: var(--text); }

/* ─── Ad Unit ──────────────────────────────────────────────── */
.ad-unit {
  background: #f3f4f6;
  border: 1px dashed var(--border-d);
  padding: 14px;
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 22px 0;
  border-radius: 4px;
}

/* ─── Footer ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  background: var(--bg-alt);
  font-size: 14px;
  color: var(--text-mid);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.site-footer a {
  color: var(--text-mid);
  text-decoration: none;
  margin-left: 16px;
}
.site-footer a:first-child { margin-left: 0; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* ─── Mobile ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 0 14px; }
  h1 { font-size: 24px; }
  h2 { font-size: 18px; }
  .form-row { flex-direction: column; gap: 12px; }
  .calc-form { padding: 18px; }
  .result-number { font-size: 38px; }
  .timer-time { font-size: 54px; }
  .macro-grid { gap: 8px; }
  .macro-cell { padding: 12px 6px; }
  .macro-cell-value { font-size: 20px; }
  .site-header .container { flex-wrap: wrap; gap: 8px; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
  .site-footer a { margin-left: 0; margin-right: 16px; }
}
