﻿:root {
  --primary: #2563EB;
  --primary-soft: #DBEAFE;
  --navy: #0F172A;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #EF4444;
  --text: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --radius: 16px;
  --font: "DM Sans", system-ui, sans-serif;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0; font-family: var(--font); color: var(--text);
  background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .7rem; letter-spacing: -.02em; }
p { margin: 0 0 1rem; }
.is-hidden { display: none !important; }
.wrap { width: min(860px, calc(100% - 2rem)); margin: 0 auto; }
.wrap.narrow { width: min(720px, calc(100% - 2rem)); }
.wrap-wide { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }
.skip-link {
  position: absolute; left: 1rem; top: -3rem; background: var(--navy); color: #fff;
  padding: .55rem .9rem; border-radius: 8px; z-index: 100;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(248,250,252,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo { display: inline-flex; align-items: center; gap: .65rem; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--primary);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.15rem;
  box-shadow: 0 6px 16px rgba(37,99,235,.28);
}
.logo-text { font-weight: 700; font-size: 1.15rem; color: var(--navy); }
.logo-text span { color: var(--primary); }
.logo-text.light { color: #fff; }
.logo-text.light span { color: #93C5FD; }
.nav { display: none; gap: 1.3rem; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--primary); }
@media (min-width: 760px) { .nav { display: flex; } }

/* Tool top */
.tool-top {
  padding: 1.6rem 0 2.75rem;
  background:
    radial-gradient(ellipse 80% 55% at 80% 0%, rgba(37,99,235,.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 30%, rgba(37,99,235,.06), transparent 50%),
    var(--bg);
}
.tool-top h1 {
  text-align: center; font-size: clamp(1.8rem, 4.5vw, 2.5rem); font-weight: 700; margin-bottom: .65rem;
}
.intro {
  text-align: center; color: var(--muted); max-width: 58ch; margin: 0 auto 1.5rem; font-size: 1.05rem;
}

.calc-layout {
  display: grid; gap: 1.1rem; align-items: stretch;
}
@media (min-width: 960px) {
  .calc-layout { grid-template-columns: 1.05fr .95fr; gap: 1.25rem; }
}

.calc-card, .live-visual {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow);
}
.calc-card { padding: 1.25rem; }
@media (min-width: 600px) { .calc-card { padding: 1.5rem; } }

.calc-form { display: flex; flex-direction: column; gap: 1rem; }
.field label, .label-like {
  display: block; font-size: .94rem; font-weight: 600; color: var(--navy); margin-bottom: .4rem;
}
.input-shell {
  display: grid; grid-template-columns: 1fr auto; align-items: stretch;
  border: 1.5px solid var(--line); border-radius: 11px; background: #fff; min-height: 50px;
  transition: border-color .15s, box-shadow .15s;
}
.input-shell:focus-within {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.input-shell input {
  border: 0; outline: 0; background: transparent; padding: .8rem .95rem;
  color: var(--navy); width: 100%; min-width: 0; font-size: 1.05rem;
}
.result-shell { grid-template-columns: 1fr; background: #F1F5F9; }
.result-shell input { font-weight: 700; font-size: 1.35rem; }

.unit-wrap { position: relative; display: flex; }
.unit-btn {
  border: 0; border-left: 1px solid var(--line); background: #F8FAFC; color: var(--muted);
  font-weight: 600; padding: 0 .95rem; cursor: pointer; min-width: 68px; border-radius: 0 10px 10px 0;
}
.unit-btn:hover, .unit-btn[aria-expanded="true"] { color: var(--primary); background: #EFF6FF; }
.unit-static {
  display: grid; place-items: center; padding: 0 .85rem; color: var(--muted); font-weight: 600;
  border-left: 1px solid var(--line); background: #F8FAFC; border-radius: 0 10px 10px 0; min-width: 48px;
}
.unit-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: .35rem;
  list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); min-width: 220px; max-height: 260px; overflow: auto;
}
.unit-menu[hidden] { display: none !important; }
.unit-menu li {
  padding: .55rem .7rem; border-radius: 7px; cursor: pointer; color: var(--primary);
  font-size: .92rem; font-weight: 500;
}
.unit-menu li:hover, .unit-menu li.is-active { background: var(--primary); color: #fff; }
.split-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

.result-extras {
  display: flex; flex-direction: column; gap: .8rem; padding: .9rem;
  background: #F8FAFC; border: 1px solid var(--line); border-radius: 12px;
}
.badge {
  display: inline-flex; width: fit-content; padding: .32rem .72rem; border-radius: 999px;
  font-weight: 700; font-size: .84rem;
}
.badge[data-level="under"] { background: #F1F5F9; color: #475569; }
.badge[data-level="healthy"] { background: #DCFCE7; color: #166534; }
.badge[data-level="increased"] { background: #FEF3C7; color: #92400E; }
.badge[data-level="high"] { background: #FEE2E2; color: #991B1B; }
.meter { position: relative; padding-top: .15rem; }
.meter-bar { display: grid; grid-template-columns: repeat(4,1fr); gap: 3px; height: 8px; border-radius: 99px; overflow: hidden; }
.meter-bar i { display: block; }
.s1 { background: #94A3B8; } .s2 { background: var(--success); }
.s3 { background: var(--warning); } .s4 { background: var(--danger); }
.meter-dot {
  position: absolute; top: 0; width: 12px; height: 12px; border-radius: 50%;
  background: var(--navy); border: 2px solid #fff; transform: translateX(-50%);
  transition: left .3s ease;
}
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.facts li {
  display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem;
  border-bottom: 1px solid var(--line); padding-bottom: .4rem;
}
.facts span { color: var(--muted); }
.facts strong { color: var(--navy); text-align: right; }
.calc-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
}
.btn-share {
  display: inline-flex; align-items: center; gap: .45rem; border: 0; background: transparent;
  color: var(--navy); font-weight: 600; cursor: pointer; padding: .3rem .1rem;
}
.btn-share svg { color: #EF4444; }
.action-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.linkish {
  border: 0; background: none; color: var(--primary); font-weight: 600; cursor: pointer; font-size: .92rem; padding: 0;
}
.linkish:hover { text-decoration: underline; }

/* Live visual */
.live-visual { padding: 1.15rem 1.15rem 1rem; display: flex; flex-direction: column; gap: .65rem; }
.live-visual-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.eyebrow {
  margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary);
}
.live-ratio-label { margin: 0; color: var(--muted); font-size: .88rem; font-weight: 500; }
#live-svg { width: 100%; height: auto; border-radius: 14px; }
#waist-ring, #ratio-chip, #fig-group { transition: all .35s cubic-bezier(.22,1,.36,1); }
.live-caption { margin: 0; color: var(--muted); font-size: .86rem; text-align: center; }

/* Sections */
.section { padding: 3.5rem 0; }
.section.alt { background: #fff; border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 1.75rem; }
.section-head h2 { font-size: clamp(1.45rem, 3vw, 1.95rem); }
.lead { color: var(--muted); margin: 0; font-size: 1.05rem; }
.note { color: var(--muted); font-size: .95rem; margin: 1rem 0 0; }

/* How panel - no empty space */
.how-panel {
  display: grid; gap: 1rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
@media (min-width: 900px) {
  .how-panel { grid-template-columns: 1.05fr .95fr; }
}
.how-copy { padding: 1.35rem; display: flex; flex-direction: column; gap: 1rem; }
.formula-rich {
  background: linear-gradient(180deg, #EFF6FF, #F8FAFC);
  border: 1px solid #BFDBFE; border-radius: 14px; padding: 1.15rem 1.2rem;
}
.f-label {
  margin: 0 0 .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--primary);
}
.f-eq { margin: 0 0 .45rem; font-size: 1.55rem; font-weight: 700; color: var(--navy); }
.f-ex { margin: 0 0 .85rem; color: var(--muted); }
.formula-points { margin: 0; padding-left: 1.1rem; color: var(--text); }
.formula-points li { margin-bottom: .35rem; }
.step-pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.step-pill {
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px;
  padding: .45rem .85rem; font-weight: 600; font-size: .88rem; cursor: pointer;
}
.step-pill.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-text { margin: 0; color: var(--muted); min-height: 3.2em; }
.how-stage { background: #F1F5F9; min-height: 280px; display: flex; align-items: center; justify-content: center; padding: 1rem; }
#how-svg { width: 100%; max-height: 300px; }

.chart-grid { display: grid; gap: .75rem; }
@media (min-width: 800px) { .chart-grid { grid-template-columns: repeat(4, 1fr); } }
.band { border-radius: 14px; padding: 1.1rem; }
.band-k { display: block; font-weight: 700; color: var(--navy); margin-bottom: .35rem; }
.band h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.band p { margin: 0; font-size: .9rem; color: var(--text); }
.band.under { background: #F1F5F9; }
.band.ok { background: #DCFCE7; }
.band.warn { background: #FEF3C7; }
.band.risk { background: #FEE2E2; }

.trio { display: grid; gap: .9rem; }
@media (min-width: 800px) { .trio { grid-template-columns: repeat(3, 1fr); } }
.info-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem;
  box-shadow: 0 4px 16px rgba(15,23,42,.04);
}
.info-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; margin-bottom: .7rem;
}
.info-card p { margin: 0; color: var(--muted); font-size: .95rem; }

.prose h3 { margin-top: 1.5rem; font-size: 1.2rem; }
.prose p { color: var(--text); }

.faq details { border-bottom: 1px solid var(--line); padding: .15rem 0 .85rem; }
.faq summary {
  cursor: pointer; font-weight: 700; color: var(--navy); padding: .75rem 0;
  list-style: none; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--primary); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0; color: var(--muted); }

.trust-list { padding-left: 1.15rem; margin: 0 0 1rem; }
.trust-list li { margin-bottom: .4rem; }
.disclaimer { color: var(--muted); font-size: .9rem; margin: 0; }

/* Related calculators */
.related-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 800px) {
  .related-grid { grid-template-columns: 1fr 1fr; }
}
.related-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.related-item.is-live:hover {
  border-color: #BFDBFE;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.1);
}
.related-item.is-soon {
  opacity: 0.78;
  background: #F8FAFC;
}
.related-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.related-item.is-soon .related-icon {
  background: #E2E8F0;
  color: #64748B;
}
.related-copy { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.related-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.02rem;
  line-height: 1.3;
}
.related-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.related-cta {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary);
  white-space: nowrap;
}
.related-cta.soon-pill {
  color: #64748B;
  background: #E2E8F0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
}
@media (max-width: 560px) {
  .related-item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .related-cta {
    grid-column: 2;
    justify-self: start;
  }
}

.site-footer { background: var(--navy); color: #94A3B8; padding: 1.75rem 0; }
.footer-row {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.site-footer p { margin: 0; font-size: .88rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #waist-ring, #ratio-chip, #fig-group, .meter-dot { transition: none !important; }
}

/* Simple legal / about pages */
.page-simple {
  padding: 1.25rem 0 2.75rem;
}
.page-simple h1 {
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  margin: 0 0 0.65rem;
}
.page-lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
}
.legal-content h2 {
  margin-top: 1.35rem;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}
.legal-content h2:first-of-type { margin-top: 0.15rem; }
.legal-content h3 {
  margin: 1rem 0 0.4rem;
  font-size: 1.05rem;
  color: var(--navy);
}
.legal-content ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}
.legal-content li { margin-bottom: 0.4rem; }
.legal-content p { margin: 0 0 0.85rem; }
.contact-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.05rem 1.15rem;
  margin: 0.75rem 0 1rem;
}
.contact-box p { margin: 0 0 0.45rem; }
.contact-box p:last-child { margin-bottom: 0; }
.contact-box a { color: var(--primary); font-weight: 600; }
.contact-box a:hover { text-decoration: underline; }
.muted-note { color: var(--muted); font-size: 0.9rem; }
.text-link { color: var(--primary); font-weight: 700; }
.text-link:hover { text-decoration: underline; }

.footer-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-grid-4 { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
}
.meter-bar-3 { grid-template-columns: repeat(3, 1fr) !important; }

/* WHR page extras */
.crumb {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 0.85rem;
}
.crumb a { color: var(--primary); font-weight: 600; }
.crumb a:hover { text-decoration: underline; }
.sex-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
.sex-fieldset legend {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
  padding: 0;
}
.sex-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.sex-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  min-height: 46px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
}
.sex-option:has(input:checked) {
  border-color: var(--primary);
  background: #EFF6FF;
  color: var(--primary);
}
.sex-option input { accent-color: var(--primary); }
.chart-live-note {
  margin: 1rem auto 0;
  max-width: 70ch;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.whr-chart-visual {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 800px) {
  .whr-chart-visual { grid-template-columns: 1fr 1fr; }
}
.whr-scale {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.scale-title {
  margin: 0 0 0.7rem;
  font-weight: 700;
  color: var(--navy);
}
.scale-track {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 0.35rem;
  border-radius: 12px;
  overflow: hidden;
}
.scale-seg {
  padding: 0.85rem 0.55rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.scale-seg span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.scale-seg strong {
  font-size: 0.86rem;
  color: var(--text);
}
.scale-seg.ok { background: #DCFCE7; }
.scale-seg.warn { background: #FEF3C7; }
.scale-seg.risk { background: #FEE2E2; }
.scale-seg.is-active-band {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}
.whr-bands { margin-top: 0.5rem; }
@media (min-width: 800px) {
  .whr-bands { grid-template-columns: repeat(2, 1fr); }
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 0.94rem;
}
.data-table caption {
  caption-side: top;
  text-align: left;
  padding: 0.9rem 1rem 0.55rem;
  font-weight: 700;
  color: var(--navy);
}
.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data-table thead th {
  background: #F8FAFC;
  color: var(--navy);
  font-size: 0.88rem;
}
.data-table tbody th {
  color: var(--navy);
  font-weight: 600;
  min-width: 12rem;
}
@media (max-width: 640px) {
  .scale-track { grid-template-columns: 1fr; }
  .sex-toggle { grid-template-columns: 1fr 1fr; }
}
.footer-tag { color: #94A3B8; margin: 0.75rem 0 0; max-width: 34ch; font-size: 0.9rem; }
.footer-links h3 {
  color: #fff;
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
}
.footer-links a,
.footer-links .soon {
  display: block;
  color: #94A3B8;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(148,163,184,0.25);
  padding-top: 1rem;
}
.nav a[aria-current="page"] { color: var(--primary); font-weight: 600; }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0.85rem 0 1.35rem;
  padding: 1.15rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.contact-form .field { margin: 0; }
.contact-form label {
  display: block;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
  font-size: 0.94rem;
}
.contact-form .input-shell {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  min-height: 48px;
}
.contact-form .input-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.14);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0.8rem 0.95rem;
  color: var(--navy);
  font: inherit;
}
.contact-form .textarea-shell { min-height: auto; }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-submit {
  border: 0;
  cursor: pointer;
  width: fit-content;
  text-decoration: none;
}
.form-note {
  margin: 0;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.92rem;
}
.btn-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.15rem;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--primary);
  color: #fff;
}
.btn-primary-link:hover { background: #1D4ED8; }
