/* =========================================================
   TDEE Calculator — mobile-first stylesheet
   Sections: tokens · base · layout · header/nav · components ·
   calculator wizard · results · pages · utilities · motion · print
   ========================================================= */

/* ---------- Font (self-hosted Plus Jakarta Sans, latin subset, variable 400–800) ---------- */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-strong: #047857;  /* white text on this passes WCAG AA */
  --primary-deep: #065f46;
  --primary-text: #047857;
  --primary-soft: rgba(16, 185, 129, 0.1);
  --accent: #f59e0b;
  --accent-text: #92400e;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --info: #3b82f6;
  --info-text: #1d4ed8;
  --info-soft: rgba(59, 130, 246, 0.12);
  --danger: #ef4444;
  --danger-text: #b91c1c;
  --danger-soft: rgba(239, 68, 68, 0.1);

  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bar: #d1d5db;
  --on-primary: #ffffff;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05), 0 1px 3px rgba(17, 24, 39, 0.06);
  --shadow: 0 2px 4px rgba(17, 24, 39, 0.04), 0 12px 28px -8px rgba(17, 24, 39, 0.12);
  --shadow-glow: 0 12px 28px -10px rgba(4, 120, 87, 0.55);

  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  /* 8px spacing scale */
  --s-half: 4px;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --s6: 48px;
  --s8: 64px;

  --header-h: 68px;
  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-gap: 12px; /* floating bottom nav sits this far above the screen edge */

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Glass (header, bottom nav) */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-bg-strong: rgba(255, 255, 255, 0.9);
  --glass-ring: rgba(255, 255, 255, 0.45);
  --hbtn-border: rgba(15, 23, 42, 0.14);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-edge: rgba(15, 23, 42, 0.07);
  --glass-inset: rgba(15, 23, 42, 0.045);
  --glass-chip: #ffffff;
  --glass-shadow: 0 10px 34px -14px rgba(15, 23, 42, 0.22), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --ambient-1: rgba(16, 185, 129, 0.16);
  --ambient-2: rgba(245, 158, 11, 0.12);
  --ambient-3: rgba(59, 130, 246, 0.07);
  --card-glass: rgba(255, 255, 255, 0.6);
  --card-glass-inner: rgba(255, 255, 255, 0.72);

  color-scheme: light;
}

/* Dark mode: automatic unless the user picked light, or forced by the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --primary-dark: #34d399;
    --primary-text: #34d399;
    --primary-soft: rgba(16, 185, 129, 0.16);
    --accent-text: #fbbf24;
    --info-text: #93c5fd;
    --danger: #f87171;
    --danger-text: #fca5a5;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #1f2937;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --border: #273244;
    --bar: #374151;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 12px 28px -10px rgba(16, 185, 129, 0.35);
    --glass-bg: rgba(17, 24, 39, 0.72);
    --glass-bg-strong: rgba(17, 24, 39, 0.86);
    --glass-ring: rgba(255, 255, 255, 0.07);
    --hbtn-border: rgba(255, 255, 255, 0.16);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-edge: rgba(255, 255, 255, 0.07);
    --glass-inset: rgba(255, 255, 255, 0.08);
    --glass-chip: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 12px 36px -12px rgba(0, 0, 0, 0.7);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --ambient-1: rgba(16, 185, 129, 0.14);
    --ambient-2: rgba(245, 158, 11, 0.06);
    --ambient-3: rgba(59, 130, 246, 0.08);
    --card-glass: rgba(17, 24, 39, 0.55);
    --card-glass-inner: rgba(31, 41, 55, 0.55);
    --orb-opacity: 0.55;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --primary-dark: #34d399;
  --primary-text: #34d399;
  --primary-soft: rgba(16, 185, 129, 0.16);
  --accent-text: #fbbf24;
  --info-text: #93c5fd;
  --danger: #f87171;
  --danger-text: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1f2937;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --border: #273244;
  --bar: #374151;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 12px 28px -10px rgba(16, 185, 129, 0.35);
  --glass-bg: rgba(17, 24, 39, 0.72);
  --glass-bg-strong: rgba(17, 24, 39, 0.86);
  --glass-ring: rgba(255, 255, 255, 0.07);
  --hbtn-border: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-edge: rgba(255, 255, 255, 0.07);
  --glass-inset: rgba(255, 255, 255, 0.08);
  --glass-chip: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 12px 36px -12px rgba(0, 0, 0, 0.7);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --ambient-1: rgba(16, 185, 129, 0.14);
  --ambient-2: rgba(245, 158, 11, 0.06);
  --ambient-3: rgba(59, 130, 246, 0.08);
  --card-glass: rgba(17, 24, 39, 0.55);
  --card-glass-inner: rgba(31, 41, 55, 0.55);
  --orb-opacity: 0.55;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s2));
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
  /* room for the floating bottom nav on mobile */
  padding-bottom: calc(var(--nav-h) + var(--nav-gap) * 2 + var(--safe-bottom));
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

a {
  color: var(--primary-text);
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

.muted {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--s2);
}

.page {
  flex: 1;
  padding-block: var(--s3) var(--s5);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- Header & navigation ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s2);
  z-index: 200;
  padding: var(--s1) var(--s2);
  background: var(--primary-strong);
  color: var(--on-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--s1);
}

/* Soft colour glows behind the page so the glass has something to blur */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42rem 28rem at 8% -6%, var(--ambient-1), transparent 62%),
    radial-gradient(36rem 26rem at 96% 2%, var(--ambient-2), transparent 60%),
    radial-gradient(48rem 34rem at 50% 108%, var(--ambient-3), transparent 62%);
}

/* Floating glass header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 12px 0;
  pointer-events: none; /* only the glass bar itself takes clicks */
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-height: calc(var(--header-h) - 10px);
  padding: 6px 8px 6px 10px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 0 0 6px var(--glass-ring), var(--glass-shadow), var(--glass-highlight);
  pointer-events: auto;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}

/* Thin light sweep along the top edge */
.header-inner::before {
  content: '';
  position: absolute;
  inset: 0 18% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  opacity: 0.8;
  pointer-events: none;
}

.site-header.is-scrolled .header-inner {
  background: var(--glass-bg-strong);
  border-color: var(--glass-edge);
  box-shadow: 0 0 0 6px var(--glass-ring), 0 14px 40px -16px rgba(15, 23, 42, 0.3), var(--glass-highlight);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-right: 4px;
  color: var(--text);
  text-decoration: none;
}

.logo__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(145deg, #34d399 0%, #10b981 38%, #047857 100%);
  box-shadow: 0 6px 16px -6px rgba(4, 120, 87, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #fde68a;
  transition: transform 0.3s var(--ease);
}

/* Glossy top half */
.logo__mark::after {
  content: '';
  position: absolute;
  inset: 0 0 50%;
  background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
}

.logo:hover .logo__mark {
  transform: rotate(-6deg) scale(1.05);
}

.logo__mark .icon {
  position: relative;
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.logo__text {
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo__light {
  background: linear-gradient(90deg, var(--primary-text), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.logo__badge {
  padding: 2px 7px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-radius: 6px;
  box-shadow: 0 3px 8px -3px rgba(4, 120, 87, 0.6);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

/* Desktop nav: links in a recessed glass track, the current page raised as a chip */
.header-nav {
  display: none;
}

.header-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--text);
  opacity: 0.78;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, opacity 0.2s;
}

.header-nav a:hover {
  opacity: 1;
  background: var(--glass-inset);
}

.header-nav a[aria-current='page'] {
  color: var(--primary-text);
  opacity: 1;
}

.header-nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  transform: translateX(-50%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Header buttons */
.hbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.hbtn--outline {
  border: 1px solid var(--hbtn-border);
  color: var(--text);
}

.hbtn--outline:hover,
.hbtn--outline[aria-current='page'] {
  border-color: var(--primary);
  color: var(--primary-text);
  background: var(--primary-soft);
}

.hbtn--primary {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(4, 120, 87, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.hbtn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -8px rgba(4, 120, 87, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Small screens: logo + theme button only (the bottom nav has the links) */
.header-contact,
.header-cta {
  display: none;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  background: var(--glass-inset);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, transform 0.3s var(--ease), box-shadow 0.2s;
}

.theme-toggle:hover {
  background: var(--glass-chip);
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.18);
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
  transition: transform 0.4s var(--ease);
}

.theme-toggle:hover .icon {
  transform: rotate(-20deg);
}

.theme-toggle .icon-sun,
.theme-toggle[aria-pressed='true'] .icon-moon {
  display: none;
}

.theme-toggle[aria-pressed='true'] .icon-sun {
  display: block;
}

/* Mobile bottom nav: floating frosted-glass pill, matching the header */
.bottom-nav {
  position: fixed;
  right: 12px;
  bottom: calc(var(--nav-gap) + var(--safe-bottom));
  left: 12px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  height: var(--nav-h);
  padding: 6px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 0 0 5px var(--glass-ring), 0 14px 34px -12px rgba(15, 23, 42, 0.35), var(--glass-highlight);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s, transform 0.15s var(--ease);
}

.bottom-nav a:active {
  transform: scale(0.94);
}

.bottom-nav .icon {
  width: 22px;
  height: 22px;
  transition: transform 0.25s var(--ease);
}

.bottom-nav a[aria-current='page'] {
  color: var(--primary-text);
  background: linear-gradient(160deg, var(--primary-soft), rgba(16, 185, 129, 0.04)), var(--glass-chip);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.22), 0 6px 14px -8px rgba(4, 120, 87, 0.45);
}

.bottom-nav a[aria-current='page'] .icon {
  transform: translateY(-1px) scale(1.06);
}

/* Browsers without blur, or users who asked for less transparency: solid surfaces */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header-inner,
  .bottom-nav,
  .wizard.card {
    background: var(--surface);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .header-inner,
  .bottom-nav {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Dark footer card (same in light and dark mode) */
.site-footer {
  margin-top: var(--s4);
  padding-inline: 10px;
}

.footer-card {
  --f-text: #f3f4f6;
  --f-muted: #9ca3af;
  --f-line: rgba(255, 255, 255, 0.14);
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--s5) 20px 0;
  overflow: hidden;
  background:
    radial-gradient(40rem 22rem at 100% 0%, rgba(16, 185, 129, 0.16), transparent 60%),
    radial-gradient(30rem 18rem at 0% 100%, rgba(245, 158, 11, 0.08), transparent 60%),
    #0d1117;
  border-radius: 28px 28px 0 0;
  color: var(--f-text);
  container-type: inline-size; /* lets the wordmark size itself to the card */
}

.footer-top {
  display: grid;
  gap: var(--s4);
}

.logo--footer {
  color: var(--f-text);
}

.logo--footer .logo__light {
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-about {
  max-width: 380px;
  margin-top: var(--s2);
  color: var(--f-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.footer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
}

.footer-pills li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--f-line);
  border-radius: var(--radius-pill);
  color: var(--f-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.footer-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
}

.footer-col__title {
  margin-bottom: 12px;
  color: var(--f-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-cols ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-cols a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--f-text);
  font-size: 0.9375rem;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
}

.footer-cols a:hover {
  color: #6ee7b7;
  opacity: 1;
}

/* Divider line ending in a pill button */
.footer-rule {
  display: flex;
  align-items: center;
  margin-top: var(--s5);
}

.footer-rule span {
  flex: 1;
  height: 1px;
  background: var(--f-line);
}

.footer-rule__btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  background: #fff;
  border-radius: var(--radius-pill);
  color: #0d1117;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.footer-rule__btn:hover {
  background: #34d399;
  transform: translateY(-1px);
}

.footer-bottom {
  display: grid;
  gap: 12px;
  margin-top: var(--s2);
  color: var(--f-muted);
  font-size: 0.8125rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--s3);
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--f-text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.footer-legal a:hover {
  color: #6ee7b7;
}

/* Huge, cropped brand wordmark */
.footer-wordmark {
  margin: var(--s3) -20px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.04));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 12.4cqw; /* fills the card width edge to edge */
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.78;
  white-space: nowrap;
  text-align: center;
  transform: translateY(0.12em);
  user-select: none;
}

@media (min-width: 640px) {
  .site-footer {
    padding-inline: var(--s3);
  }

  .footer-card {
    padding: var(--s6) var(--s5) 0;
    border-radius: 32px 32px 0 0;
  }

  .footer-wordmark {
    margin-inline: calc(var(--s5) * -1);
  }

  .footer-cols {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-bottom {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .footer-top {
    grid-template-columns: 1.1fr 1.4fr;
    gap: var(--s6);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  min-height: 48px;
  padding: 0 var(--s3);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.btn--primary {
  background: var(--primary-strong);
  color: var(--on-primary);
}

.btn--primary:hover {
  background: var(--primary-deep);
}

.btn--cta {
  background: linear-gradient(135deg, var(--primary-strong) 0%, var(--primary-deep) 100%);
  box-shadow: var(--shadow-glow);
}

.btn--cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -10px rgba(4, 120, 87, 0.6);
}

.btn--primary:active,
.btn--cta:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: none;
}

.btn:disabled {
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface-2);
}

.btn--ghost:active {
  transform: scale(0.98);
}

.btn--small {
  min-height: 44px;
  padding: 0 var(--s2);
  font-size: 0.9375rem;
}

/* ---------- Info button + popover ---------- */
.info-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-inline: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}

/* invisible hit area → 44×44 tap target */
.info-btn::after {
  content: '';
  position: absolute;
  inset: -11px;
}

.info-btn:hover,
.info-btn[aria-expanded='true'] {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.info-btn--light {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.info-btn--light:hover,
.info-btn--light[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.popover {
  position: fixed;
  z-index: 120;
  width: max-content;
  max-width: min(300px, calc(100vw - 32px));
  padding: var(--s2);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.9375rem;
  animation: pop-in 0.16s var(--ease);
}

.popover strong {
  display: block;
  margin-bottom: var(--s-half);
}

/* ---------- Toasts ---------- */
/* Top on phones so toasts never cover the sticky wizard buttons; bottom on larger screens */
.toast-region {
  position: fixed;
  left: 50%;
  top: calc(var(--header-h) + var(--s1));
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s1);
  width: calc(100% - var(--s4));
  max-width: 420px;
  transform: translateX(-50%);
  pointer-events: none;
}

#comp-card .stat-card__value {
  font-size: 1.375rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--s1);
  padding: 12px var(--s2);
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.9375rem;
  animation: toast-in 0.25s var(--ease);
}

.toast .icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}

/* ---------- Form controls ---------- */
.field {
  margin: var(--s3) 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field__label {
  display: block;
  margin-bottom: var(--s1);
  padding: 0;
  font-weight: 700;
  font-size: 0.9375rem;
}

.input-unit {
  position: relative;
}

.input-unit input,
.text-input {
  width: 100%;
  height: 56px;
  padding: 0 56px 0 var(--s2);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.125rem;
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.input-unit--lg input {
  height: 64px;
  font-size: 1.5rem;
  font-weight: 700;
}

.input-unit input::placeholder,
.text-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
  font-weight: 500;
}

.input-unit input:focus,
.text-input:focus {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
  border-color: var(--primary-dark);
}

.input-unit__suffix {
  position: absolute;
  top: 50%;
  right: var(--s2);
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
}

.is-invalid,
.input-unit input.is-invalid {
  border-color: var(--danger);
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: var(--s1);
  color: var(--danger-text);
  font-size: 0.875rem;
  font-weight: 600;
}

.field__error:empty {
  display: none;
}

.field__error .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

/* Range slider */
.range {
  display: block;
  width: 100%;
  height: 44px;
  margin: var(--s1) 0 0;
  background: transparent;
  accent-color: var(--primary-dark);
  cursor: pointer;
}

/* No value entered yet: don't let the filled track imply one */
.range.is-empty {
  accent-color: var(--muted);
  opacity: 0.45;
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: -6px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Segmented control (built on real radio inputs → native arrow-key nav) */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--s-half);
  padding: var(--s-half);
  background: var(--surface-2);
  border-radius: var(--radius-pill);
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--s1);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9375rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.segmented input:checked + label {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.segmented input:focus-visible + label {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

/* Choice cards (real radios, visually hidden) */
.choice-grid {
  display: grid;
  gap: 12px;
}

.choice-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.choice-grid--3 {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s1);
}

.choice-list {
  display: grid;
  gap: 12px;
}

.choice-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.choice-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  height: 100%;
  min-height: 112px;
  padding: var(--s2) var(--s1);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease);
}

.choice-card:hover .choice-card__body {
  border-color: var(--bar);
}

.choice-card:active .choice-card__body {
  transform: scale(0.98);
}

.choice-card input:checked + .choice-card__body {
  border-color: var(--primary-dark);
  background: var(--primary-soft);
}

.choice-card input:focus-visible + .choice-card__body {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

.choice-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--primary-text);
  transition: background 0.15s;
}

.choice-card input:checked + .choice-card__body .choice-card__icon {
  background: var(--surface);
}

.choice-card__title {
  font-weight: 700;
}

.choice-card__desc {
  color: var(--muted);
  font-size: 0.875rem;
}

.choice-card__check {
  position: absolute;
  top: var(--s1);
  right: var(--s1);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: var(--surface);
  transform: scale(0);
  transition: transform 0.2s var(--ease);
}

.choice-card__check .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.choice-card input:checked + .choice-card__body .choice-card__check {
  transform: scale(1);
}

/* horizontal variant (activity list) */
.choice-card--row .choice-card__body {
  flex-direction: row;
  justify-content: flex-start;
  gap: var(--s2);
  min-height: 72px;
  padding: 12px 48px 12px var(--s2);
  text-align: left;
}

.choice-card--row .choice-card__check {
  top: 50%;
  right: var(--s2);
  transform: translateY(-50%) scale(0);
}

.choice-card--row input:checked + .choice-card__body .choice-card__check {
  transform: translateY(-50%) scale(1);
}

.choice-card__text {
  display: flex;
  flex-direction: column;
}

/* compact variant (goal cards: 3 across on 360px) */
.choice-grid--3 .choice-card__body {
  min-height: 104px;
  padding: 12px var(--s-half);
}

.choice-grid--3 .choice-card__title {
  font-size: 0.875rem;
  line-height: 1.25;
}

.choice-grid--3 .choice-card__icon {
  width: 40px;
  height: 40px;
}

.choice-grid--3 .choice-card__check {
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
}

/* Stepper */
.stepper {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: var(--s1);
}

.stepper__btn {
  height: 56px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.stepper__btn:hover {
  background: var(--border);
}

.stepper__btn:active {
  transform: scale(0.94);
}

.stepper .input-unit input {
  padding: 0 48px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.split-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Collapsible */
.collapse {
  margin-top: var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.collapse summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1);
  min-height: 56px;
  padding: 0 var(--s2);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-sm);
}

.collapse summary::-webkit-details-marker {
  display: none;
}

.collapse__chev {
  color: var(--muted);
  transition: transform 0.2s var(--ease);
}

.collapse[open] .collapse__chev {
  transform: rotate(180deg);
}

.collapse__body {
  padding: 0 var(--s2) var(--s2);
  overflow: hidden;
}

.collapse__body .field {
  margin-top: var(--s2);
}

.help {
  color: var(--muted);
  font-size: 0.9375rem;
}

.notice {
  display: flex;
  gap: var(--s1);
  margin-top: 12px;
  padding: 12px var(--s2);
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}

.notice .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--accent-text);
}

/* ---------- Hero ---------- */
.hero {
  margin-bottom: var(--s3);
}

.hero h1 {
  font-size: 1.625rem;
  font-weight: 800;
}

.hero__sub {
  margin-top: var(--s1);
  color: var(--muted);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
}

.badges li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
}

.badges .icon {
  width: 16px;
  height: 16px;
  color: var(--primary-text);
}

/* Welcome-back banner */
.welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--s3);
  padding: 12px var(--s2);
  background: var(--primary-soft);
  border-color: var(--primary-dark);
  animation: fade-up 0.3s var(--ease);
}

.welcome__actions {
  display: flex;
  gap: var(--s1);
}

/* ---------- Wizard ---------- */
.wizard {
  max-width: 640px;
  margin-inline: auto;
}

.progress {
  padding: var(--s2) var(--s2) 0;
}

.progress__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s1);
  font-size: 0.875rem;
  font-weight: 700;
}

.progress__count {
  color: var(--primary-text);
}

.progress__name {
  color: var(--muted);
}

.progress__track {
  height: 8px;
  margin-top: var(--s1);
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress__fill {
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: inherit;
  transition: width 0.35s var(--ease);
}

.progress__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.progress__dots li {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--border);
  transition: width 0.25s var(--ease), background 0.25s;
}

.progress__dots li.is-done {
  background: var(--primary);
}

.progress__dots li.is-current {
  width: 24px;
  background: var(--primary-dark);
}

.steps {
  overflow-x: clip;  /* clip slide animation without breaking sticky actions */
}

.step {
  padding: var(--s2) var(--s2) var(--s3);
}

.step__title {
  font-size: 1.375rem;
  font-weight: 800;
  outline: none;
}

.step__hint {
  margin-top: var(--s-half);
  color: var(--muted);
}

.step > .segmented {
  margin-top: var(--s2);
}

.step.slide-next {
  animation: slide-next 0.32s var(--ease) both;
}

.step.slide-prev {
  animation: slide-prev 0.32s var(--ease) both;
}

.pace {
  margin-top: var(--s3);
  padding: var(--s2);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.pace__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1);
}

.pace__head .field__label {
  margin: 0;
}

.pace__value {
  font-weight: 700;
}

.pace__adjust {
  margin-top: var(--s1);
  text-align: center;
}

.pace__adjust span {
  display: inline-block;
  padding: 6px 14px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  color: var(--primary-text);
  font-weight: 800;
  font-size: 1.125rem;
}

.wizard__actions {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--nav-gap) + 8px + var(--safe-bottom));
  z-index: 5;
  display: flex;
  gap: 12px;
  padding: 12px var(--s2);
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -10px 20px -16px rgba(0, 0, 0, 0.35);
}

.wizard__actions .btn {
  flex: 1;
}

#btn-back {
  flex: 0 0 34%;
}

/* ---------- Hero + calculator refresh ---------- */
.hero__kicker {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 14px 6px 10px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px -6px rgba(15, 23, 42, 0.18), var(--glass-highlight);
  color: var(--primary-text);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__dot {
  position: relative;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.hero__dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.35;
  animation: pulse-dot 2s var(--ease) infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.5); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hero h1 {
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.hero__accent {
  background: linear-gradient(100deg, var(--primary-strong) 0%, var(--primary) 55%, #f59e0b 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin-top: 12px;
  font-size: 1.0625rem;
}

.badges li {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-color: var(--glass-border);
  box-shadow: 0 2px 8px -4px rgba(15, 23, 42, 0.12);
}

.hero__points {
  display: none;
  margin: var(--s3) 0 0;
  padding: 0;
  list-style: none;
}

.hero__points li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--text);
  font-weight: 600;
}

.hero__points .icon {
  width: 22px;
  height: 22px;
  color: var(--primary-text);
}

/* Calculator: frosted-glass card floating over soft colour orbs */
.wizard-wrap {
  position: relative;
  isolation: isolate;
}

.wizard-wrap:has(> .wizard[hidden]) {
  display: none;
}

.wizard-wrap::before,
.wizard-wrap::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(34px);
  opacity: var(--orb-opacity, 1);
  pointer-events: none;
  animation: orb-float 14s ease-in-out infinite alternate;
}

/* green orb top-left, amber orb bottom-right */
.wizard-wrap::before {
  top: -40px;
  left: -50px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.8), rgba(16, 185, 129, 0.35) 50%, transparent 72%);
}

.wizard-wrap::after {
  right: -60px;
  bottom: -50px;
  width: 340px;
  height: 340px;
  background:
    radial-gradient(circle at 55% 55%, rgba(251, 191, 36, 0.7), rgba(245, 158, 11, 0.25) 48%, transparent 70%),
    radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.45), transparent 50%);
  animation-delay: -7s;
}

@keyframes orb-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(24px, -18px) scale(1.08); }
}

.wizard.card {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  box-shadow: 0 0 0 8px var(--glass-ring), 0 30px 60px -28px rgba(15, 23, 42, 0.35), var(--glass-highlight);
}

/* inner surfaces turn semi-transparent so the glass reads through */
.wizard .choice-card__body,
.wizard .stepper,
.wizard .input-unit input,
.wizard .segmented,
.wizard .pace,
.wizard .collapse {
  background: var(--card-glass-inner);
}

.wizard .choice-card input:checked + .choice-card__body {
  background: linear-gradient(160deg, var(--primary-soft), transparent 70%), var(--card-glass-inner);
}

.wizard .stepper .input-unit input {
  background: transparent;
}

.wizard .progress__track {
  background: var(--glass-inset);
}

.wizard .choice-card__icon,
.wizard .stepper__btn {
  background: var(--glass-inset);
}

.wizard__actions {
  border-top-color: var(--glass-edge);
}

/* Progress: one thick glowing bar; the dots only repeated it */
.progress__dots {
  display: none;
}

.progress__count {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
}

.progress__name {
  align-self: center;
}

.progress__track {
  height: 10px;
  margin-top: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.progress__fill {
  position: relative;
  background: linear-gradient(90deg, #34d399, var(--primary), var(--primary-strong));
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
}

.step__title {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.field__label {
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

/* Choice cards: lift on hover, glowing ring + gradient icon when picked */
.choice-card__body {
  border-width: 1.5px;
  border-radius: 20px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.choice-card:hover .choice-card__body {
  border-color: rgba(16, 185, 129, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -14px rgba(15, 23, 42, 0.35);
}

.choice-card input:checked + .choice-card__body {
  border-color: var(--primary);
  background: linear-gradient(160deg, var(--primary-soft), transparent 70%), var(--surface);
  box-shadow: 0 0 0 4px var(--primary-soft), 0 12px 24px -16px rgba(4, 120, 87, 0.6);
}

.choice-card__icon {
  width: 52px;
  height: 52px;
  background: var(--surface-2);
  transition: background 0.25s, color 0.25s, transform 0.3s var(--ease);
}

.choice-card:hover .choice-card__icon {
  transform: scale(1.06);
}

.choice-card input:checked + .choice-card__body .choice-card__icon {
  background: linear-gradient(145deg, #34d399, var(--primary-strong));
  color: #fff;
  box-shadow: 0 8px 16px -8px rgba(4, 120, 87, 0.8);
}

.choice-card__check {
  background: var(--primary);
  box-shadow: 0 4px 10px -4px rgba(4, 120, 87, 0.7);
}

/* Inputs: rounder, soft focus ring */
.input-unit input,
.text-input {
  border-width: 1.5px;
  border-radius: 16px;
}

.input-unit input:focus,
.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

/* Age stepper as one pill control: [ − ][ 30 yrs ][ + ] */
.stepper {
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stepper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.stepper__btn {
  display: grid;
  place-items: center;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.375rem;
}

.stepper__btn:hover {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.stepper .input-unit input {
  height: 48px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.stepper .input-unit input:focus {
  box-shadow: none;
}

/* Footer of the card */
.wizard__actions {
  border-radius: 0 0 28px 28px;
}

.wizard__actions .btn {
  min-height: 52px;
  border-radius: 16px;
  font-weight: 700;
}

#btn-next:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, var(--primary-strong) 100%);
  box-shadow: 0 12px 24px -12px rgba(4, 120, 87, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

#btn-next:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -12px rgba(4, 120, 87, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Arrow after "Next" / "Show my results" (the label is set by script.js) */
#btn-next::after {
  content: '';
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.2s var(--ease);
}

#btn-next:not(:disabled):hover::after {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .hero__dot::after,
  .wizard-wrap::before,
  .wizard-wrap::after {
    animation: none;
  }
}

/* Phones/tablets: the calculator orbs must never widen the page (mobile browsers would zoom out).
   Desktop keeps them unclipped so they fade softly past the container edge. */
@media (max-width: 1023px) {
  .page {
    overflow-x: clip;
  }
}

/* Phones: compact hero so step 1 fits on the first screen; glass sticky actions above the nav */
@media (max-width: 639px) {
  .hero {
    margin-bottom: var(--s2);
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .hero__kicker {
    margin-bottom: 10px;
    font-size: 0.6875rem;
  }

  .hero__sub {
    margin-top: 8px;
    font-size: 1rem;
  }

  /* Badges: one swipeable row instead of two lines */
  .badges {
    flex-wrap: nowrap;
    margin-inline: calc(var(--s2) * -1);
    padding: 2px var(--s2) 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
    mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
  }

  .badges::-webkit-scrollbar {
    display: none;
  }

  .badges li {
    flex-shrink: 0;
  }

  .wizard.card {
    border-radius: 24px;
  }

  .wizard__actions {
    margin: 0 6px;
    padding: 8px;
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 0 0 4px var(--glass-ring), 0 12px 28px -14px rgba(15, 23, 42, 0.35);
  }

  .wizard__actions .btn {
    min-height: 48px;
  }

  .choice-card__body {
    min-height: 100px;
  }
}

/* ---------- Results ---------- */
.results {
  display: grid;
  gap: var(--s2);
  animation: fade-up 0.35s var(--ease);
}

.results__head {
  display: grid;
  gap: 12px;
}

.results__head h2 {
  font-size: 1.5rem;
  font-weight: 800;
  outline: none;
}

.summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--s1) var(--s1) var(--s1) var(--s2);
}

.summary-bar p {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9375rem;
}

.result-hero {
  position: relative;
  overflow: hidden;
  padding: var(--s3);
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(135deg, var(--primary-strong) 0%, var(--primary-deep) 100%);
  box-shadow: var(--shadow-glow);
}

.result-hero__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  font-weight: 700;
}

.pill {
  padding: 2px 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
}

.result-hero__value {
  display: flex;
  align-items: baseline;
  gap: var(--s1);
  margin-top: var(--s1);
  font-size: clamp(2.75rem, 13vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.result-hero__unit {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
}

.result-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-half) var(--s3);
  margin-top: 12px;
  font-size: 0.9375rem;
}

.result-hero__note {
  display: flex;
  gap: var(--s1);
  margin-top: var(--s2);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.result-hero__note .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #fde68a;
}

.stat-grid {
  display: grid;
  gap: var(--s2);
}

.stat-card {
  padding: 20px;
}

.stat-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-card__head h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}

.stat-card__head .info-btn {
  margin-left: auto;
}

.stat-card__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.stat-card__icon .icon {
  width: 20px;
  height: 20px;
}

.stat-card__value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-card__value small {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
}

.stat-card__sub {
  margin-top: var(--s-half);
  color: var(--muted);
  font-size: 0.875rem;
}

.chip {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0;
}

.chip--under { background: var(--info-soft); color: var(--info-text); }
.chip--normal { background: var(--primary-soft); color: var(--primary-text); }
.chip--over { background: var(--accent-soft); color: var(--accent-text); }
.chip--obese { background: var(--danger-soft); color: var(--danger-text); }

/* BMI scale covers BMI 15–40: 18.5 → 14%, 25 → 40%, 30 → 60% */
.bmi-scale {
  margin-top: var(--s2);
}

.bmi-scale__track {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg,
    var(--info) 0%, var(--info) 14%,
    var(--primary) 21%, var(--primary) 37%,
    var(--accent) 42%, var(--accent) 47%,
    var(--danger) 53%, var(--danger) 100%);
}

.bmi-scale__marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 20px;
  height: 20px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--text);
  box-shadow: var(--shadow-sm);
  transform: translate(-50%, -50%);
  transition: left 0.7s var(--ease);
}

.bmi-scale__labels {
  position: relative;
  height: 20px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.bmi-scale__labels span {
  position: absolute;
  transform: translateX(-50%);
}

/* Scale spans BMI 15–35: 18.5 → 17.5%, 23 → 40%, 25 → 50% */
.bmi-scale__labels span:nth-child(1) { left: 17.5%; }
.bmi-scale__labels span:nth-child(2) { left: 40%; }
.bmi-scale__labels span:nth-child(3) { left: 50%; }

.comp-bar {
  height: 10px;
  margin-top: var(--s2);
  border-radius: var(--radius-pill);
  background: var(--accent);
  overflow: hidden;
}

.comp-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary-dark);
  transition: width 0.7s var(--ease);
}

.results__panels {
  display: grid;
  gap: var(--s2);
}

.panel {
  padding: 20px;
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--s2);
  font-size: 1.125rem;
  font-weight: 800;
}

.mini-label {
  margin: var(--s2) 0 var(--s1);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel__title + .mini-label {
  margin-top: 0;
}

.macros {
  display: grid;
  gap: var(--s3);
  margin-top: var(--s3);
}

.donut {
  position: relative;
  width: 200px;
  max-width: 100%;
  margin: 0 auto;
}

.donut svg {
  display: block;
  width: 100%;
  transform: rotate(-90deg);
}

.donut circle {
  fill: none;
  stroke-width: 16;
}

.donut__bg {
  stroke: var(--surface-2);
}

.donut__seg {
  transition: stroke-dasharray 0.5s var(--ease), stroke-dashoffset 0.5s var(--ease);
}

.donut__seg--protein { stroke: var(--primary-dark); }
.donut__seg--fat { stroke: var(--accent); }
.donut__seg--carbs { stroke: var(--info); }

.donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut__center strong {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.donut__center span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.legend {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.legend li:last-child {
  border-bottom: 0;
}

.legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend__dot--protein { background: var(--primary-dark); }
.legend__dot--fat { background: var(--accent); }
.legend__dot--carbs { background: var(--info); }

.legend__name {
  font-weight: 700;
}

.legend__pct {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.legend__grams {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.legend__grams strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
}

.legend__grams span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.bars {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bars__row {
  display: flex;
  justify-content: space-between;
  gap: var(--s1);
  font-size: 0.9375rem;
}

.bars__name {
  font-weight: 600;
}

.bars__kcal {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bars__track {
  height: 10px;
  margin-top: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.bars__fill {
  height: 100%;
  width: 0;
  background: var(--bar);
  border-radius: inherit;
  transition: width 0.7s var(--ease);
}

.bars li.is-current .bars__name,
.bars li.is-current .bars__kcal {
  color: var(--primary-text);
  font-weight: 800;
}

.bars li.is-current .bars__fill {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.you-tag {
  margin-left: 6px;
  padding: 1px 8px;
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s1);
}

.result-actions .btn {
  flex-direction: column;
  gap: var(--s-half);
  min-height: 64px;
  padding: var(--s1);
  font-size: 0.875rem;
}

.disclaimer {
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

/* Shimmer placeholders while results "load" */
.is-loading .skel {
  color: transparent !important;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 45%, var(--surface-2) 65%);
  background-size: 300% 100%;
  border-radius: 8px;
  animation: shimmer 1s linear infinite;
}

.is-loading .result-hero .skel {
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 25%, rgba(255, 255, 255, 0.3) 45%, rgba(255, 255, 255, 0.12) 65%);
}

.is-loading .chip {
  opacity: 0;
}

/* ---------- Content pages ---------- */
.page-hero {
  margin-bottom: var(--s3);
}

.page-hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
}

.page-hero p {
  margin-top: var(--s1);
  color: var(--muted);
}

.info-grid {
  display: grid;
  gap: var(--s2);
}

.info-card {
  padding: 20px;
}

.info-card h2 {
  margin-top: 12px;
  font-size: 1.125rem;
  font-weight: 800;
}

.info-card p {
  margin-top: var(--s1);
  color: var(--muted);
}

.info-card .stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.formula {
  display: block;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cta-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s2);
  margin-top: var(--s3);
  padding: var(--s3);
}

.cta-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

/* ---------- Homepage guide (below the calculator) ---------- */
.guide {
  max-width: 880px;
  margin: var(--s8) auto 0;
}

.guide__intro {
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
  color: var(--primary-text);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide__intro h2 {
  margin-top: 12px;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.guide__lead {
  max-width: 600px;
  margin: var(--s1) auto 0;
  color: var(--muted);
  font-size: 1.0625rem;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s1);
  margin-top: var(--s3);
}

.toc a {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.toc a:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-text);
}

.guide__section {
  margin-top: var(--s6);
  scroll-margin-top: calc(var(--header-h) + var(--s2));
}

.guide__h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--s3);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
}

.guide__num {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-radius: 12px;
  box-shadow: var(--shadow-glow);
  color: var(--on-primary);
  font-size: 0.875rem;
  font-weight: 800;
}

.guide__p {
  color: var(--muted);
}

.guide__p a,
.guide__more a {
  color: var(--primary-text);
  font-weight: 700;
}

.guide__more {
  margin-top: var(--s2);
  text-align: center;
}

.guide__more a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.guide__more .icon {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.guide h3 {
  font-size: 1.0625rem;
  font-weight: 800;
}

/* Steps timeline */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 19px;
  width: 2px;
  background: linear-gradient(var(--primary), var(--border));
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--s2);
}

.timeline__item + .timeline__item {
  margin-top: var(--s2);
}

.timeline__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 50%;
  color: var(--primary-text);
  font-weight: 800;
}

.timeline__body {
  padding: var(--s2) 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}

.timeline__item:hover .timeline__body {
  border-color: var(--primary);
  transform: translateX(4px);
}

.timeline__item:hover .timeline__dot {
  background: var(--primary);
  color: var(--on-primary);
}

.timeline__body p {
  margin-top: 6px;
  color: var(--muted);
}

.timeline__body strong {
  color: var(--text);
}

.activity-table {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.activity-table li {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.activity-table .icon {
  width: 20px;
  height: 20px;
  color: var(--primary-text);
}

.activity-table em {
  padding: 2px 8px;
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
  color: var(--primary-text);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.callout {
  display: flex;
  gap: 10px;
  margin-top: 12px !important;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  font-size: 0.9375rem;
}

.callout .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--accent-text);
}

/* Phones: slimmer timeline so the cards get the width */
@media (max-width: 639px) {
  .timeline::before {
    left: 13px;
  }

  .timeline__item {
    grid-template-columns: 28px 1fr;
    gap: 10px;
  }

  .timeline__dot {
    width: 28px;
    height: 28px;
    margin-top: 14px;
    font-size: 0.8125rem;
  }

  .timeline__body {
    padding: 14px;
  }

  .timeline__item:hover .timeline__body {
    transform: none;
  }

  .activity-table li {
    gap: 10px;
    padding: 10px;
    font-size: 0.875rem;
  }
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: 12px;
}

.mini-actions span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
}

.mini-actions .icon {
  width: 16px;
  height: 16px;
  color: var(--primary-text);
}

/* Results explained */
.guide__grid .info-card {
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.guide__grid .info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.guide__grid h3 {
  margin-top: 12px;
}

.info-card--featured {
  background: linear-gradient(135deg, var(--primary-soft), transparent 70%), var(--surface);
  border-color: var(--primary);
}

.bmi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.macro-facts {
  display: grid;
  gap: var(--s1);
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.macro-facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
}

.macro-facts em {
  margin-left: auto;
  white-space: nowrap;
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

/* Goal cards */
.goal-cards {
  display: grid;
  gap: var(--s2);
}

.goal-card {
  --tone: var(--primary-text);
  --tone-soft: var(--primary-soft);
  padding: 20px;
  background: linear-gradient(160deg, var(--tone-soft), transparent 65%), var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--tone);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.goal-card--lose { --tone: var(--info-text); --tone-soft: var(--info-soft); }
.goal-card--build { --tone: var(--accent-text); --tone-soft: var(--accent-soft); }

.goal-card > .icon {
  width: 28px;
  height: 28px;
  color: var(--tone);
}

.goal-card h3 {
  margin-top: var(--s1);
}

.goal-card__kcal {
  margin: 6px 0 var(--s1);
  color: var(--tone);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.goal-card__kcal small {
  font-size: 0.8125rem;
  font-weight: 700;
}

.goal-card p:last-child {
  color: var(--muted);
}

/* Filipino foods */
.guide__h3 {
  margin: var(--s4) 0 var(--s2);
  font-size: 1.125rem;
}

.food-table {
  margin-top: var(--s2);
  overflow: hidden;
}

.food-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.food-table thead th {
  padding: 12px var(--s2);
  background: var(--primary-strong);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.food-table thead th:last-child,
.food-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.food-table tbody th,
.food-table td {
  padding: 10px var(--s2);
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.food-table tbody th {
  font-weight: 700;
}

.food-table td {
  color: var(--muted);
}

.food-table td:last-child {
  color: var(--primary-text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.food-table__group th {
  padding-top: 14px !important;
  background: var(--surface-2);
  color: var(--primary-text);
  font-size: 0.75rem;
  font-weight: 800 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.food-table tbody tr:not(.food-table__group):hover {
  background: var(--primary-soft);
}

.food-table__note {
  padding: 12px var(--s2);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8125rem;
}

.meal-day {
  display: grid;
  gap: 12px;
}

.meal {
  display: flex;
  flex-direction: column;
  padding: var(--s2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.meal__name {
  font-weight: 800;
}

.meal__name span {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.meal ul {
  flex: 1;
  margin: var(--s1) 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.meal__kcal {
  align-self: flex-start;
  padding: 4px 10px;
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
  color: var(--primary-text);
  font-size: 0.875rem;
  font-weight: 800;
}

.meal-total {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 14px var(--s2);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}

.meal-total .icon {
  flex-shrink: 0;
  color: var(--accent-text);
}

.ph-tips {
  display: grid;
  gap: 12px;
  margin-top: var(--s3);
}

.ph-tip {
  padding: var(--s2) 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
}

.ph-tip p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9375rem;
}

@media (max-width: 479px) {
  .food-table table {
    font-size: 0.875rem;
  }

  .food-table tbody th,
  .food-table td,
  .food-table thead th {
    padding-inline: 12px;
  }
}

@media (min-width: 640px) {
  .meal-day {
    grid-template-columns: repeat(2, 1fr);
  }

  .ph-tips {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .meal-day {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Accuracy */
.checksteps {
  display: grid;
  gap: 12px;
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.checksteps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--s2);
  background: var(--surface);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
}

.checksteps li > span {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--primary-soft);
  border-radius: 50%;
  color: var(--primary-text);
  font-weight: 800;
}

/* Tips */
.tips {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tips li {
  display: flex;
  gap: 12px;
  padding: 14px var(--s2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.tips .icon {
  color: var(--primary-text);
}

/* Closing CTA */
.guide-cta {
  margin-top: var(--s6);
  padding: var(--s4) var(--s3);
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.16), transparent 45%),
    linear-gradient(135deg, var(--primary-strong), var(--primary-deep));
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
  color: #fff;
  text-align: center;
}

.guide-cta h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

.guide-cta p {
  max-width: 620px;
  margin: 12px auto var(--s3);
  opacity: 0.9;
}

.guide-cta__btn {
  background: #fff;
  color: var(--primary-deep);
}

.guide-cta__btn:hover {
  background: #f0fdf4;
}

/* ---------- 404 ---------- */
.notfound {
  max-width: 560px;
  margin: var(--s6) auto;
  text-align: center;
}

.notfound__code {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.notfound h1 {
  margin-top: var(--s2);
  font-size: 1.75rem;
  font-weight: 800;
}

.notfound .muted {
  margin-top: var(--s1);
}

.notfound__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: var(--s3);
}

/* ---------- Legal pages (terms, privacy) ---------- */
.legal-hero {
  max-width: 720px;
  margin: 0 auto var(--s4);
  text-align: center;
}

.legal-hero h1 {
  margin-top: 12px;
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.2;
}

.legal-hero__lead {
  margin-top: var(--s1);
  color: var(--muted);
  font-size: 1.0625rem;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s1);
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
}

.legal-meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
}

.legal-meta .icon {
  width: 16px;
  height: 16px;
  color: var(--primary-text);
}

.legal {
  display: grid;
  gap: var(--s3);
  align-items: start;
}

.legal-toc {
  padding: 20px;
}

.legal-toc__title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  columns: 2;
  column-gap: var(--s2);
}

.legal-toc li {
  counter-increment: toc;
  break-inside: avoid;
}

.legal-toc a {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex-shrink: 0;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}

.legal-toc a:hover {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.legal-body {
  min-width: 0;
  padding: var(--s3) 20px;
}

.legal-body section {
  scroll-margin-top: calc(var(--header-h) + var(--s2));
}

.legal-body section + section {
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}

.legal-body h2 {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
}

.legal-body h3 {
  margin-top: var(--s3);
  font-size: 1rem;
  font-weight: 800;
}

.legal-body p,
.legal-body li,
.legal-body dd {
  color: var(--muted);
  line-height: 1.7;
}

.legal-body p {
  margin-top: 12px;
}

.legal-body a:not(.btn) {
  color: var(--primary-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.definitions {
  display: grid;
  gap: var(--s1);
  margin: var(--s2) 0 0;
}

.definitions > div {
  padding: 12px var(--s2);
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
}

.definitions dt {
  color: var(--text);
  font-weight: 800;
}

.definitions dd {
  margin: 2px 0 0;
}

.legal-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: roman;
}

.legal-list li {
  position: relative;
  padding-left: 40px;
  counter-increment: roman;
}

.legal-list li::before {
  content: '(' counter(roman, lower-roman) ')';
  position: absolute;
  left: 0;
  color: var(--primary-text);
  font-weight: 700;
}

.legal-note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
}

.legal-note span {
  color: var(--text);
  font-weight: 600;
}

.legal-note .icon {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--accent-text);
}

.legal-contact .btn {
  margin-top: var(--s2);
}

.glance {
  display: grid;
  gap: 10px;
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
}

.glance li {
  display: flex;
  gap: 12px;
  padding: 14px var(--s2);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}

.glance .icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--primary-text);
}

.glance strong {
  color: var(--text);
}

@media (min-width: 640px) {
  .glance {
    grid-template-columns: repeat(2, 1fr);
  }
}

.legal-intro p:first-child {
  margin-top: 0;
  color: var(--text);
  font-size: 1.0625rem;
}

.legal-body .legal-h4 {
  margin-top: var(--s2);
  color: var(--primary-text);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal-bullets {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.legal-bullets li {
  position: relative;
  padding-left: 22px;
}

.legal-bullets li::before {
  content: '';
  position: absolute;
  top: 0.68em;
  left: 4px;
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
}

.legal-bullets strong {
  color: var(--text);
}

.legal-bullets--compact {
  gap: 4px;
}

.cookie-grid {
  display: grid;
  gap: 12px;
  margin-top: var(--s2);
}

.cookie-card {
  padding: var(--s2);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.legal-body .cookie-card h3 {
  margin: 0;
}

.legal-body .cookie-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s1);
}

.cookie-card__tags span {
  padding: 2px 10px;
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
  color: var(--primary-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.8;
}

.retention {
  display: grid;
  margin-top: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.retention__row {
  padding: 14px var(--s2);
}

.retention__row + .retention__row {
  border-top: 1px solid var(--border);
}

.legal-body .retention__cat {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.legal-body .retention__row p + p {
  margin-top: 6px;
}

.legal-body .retention__cat + p {
  margin-top: 6px;
}

@media (max-width: 479px) {
  .legal-toc ol {
    columns: 1;
  }
}

/* FAQ */
.search {
  position: relative;
  margin-bottom: var(--s1);
}

.search .icon {
  position: absolute;
  top: 50%;
  left: var(--s2);
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search .text-input {
  padding: 0 var(--s2) 0 52px;
  font-size: 1rem;
  font-weight: 500;
}

.search__count {
  min-height: 1.5em;
  margin: 0 0 var(--s2);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-height: 56px;
  padding: 12px var(--s2);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] .collapse__chev {
  transform: rotate(180deg);
}

.faq-item__body {
  overflow: hidden;
}

.faq-item__body p {
  padding: 0 var(--s2) var(--s2);
  color: var(--muted);
}

.empty-state {
  padding: var(--s4) var(--s2);
  color: var(--muted);
  text-align: center;
}

/* Contact */
.contact-card {
  max-width: 640px;
  padding: var(--s3) var(--s2);
}

.float {
  position: relative;
  margin-top: var(--s2);
}

.float:first-child {
  margin-top: 0;
}

.float .text-input {
  height: 60px;
  padding: 22px var(--s2) 6px;
  font-size: 1rem;
  font-weight: 500;
}

.float textarea.text-input {
  height: auto;
  min-height: 160px;
  padding-top: 28px;
  resize: vertical;
  line-height: 1.5;
}

.float label {
  position: absolute;
  top: 18px;
  left: calc(var(--s2) + 2px);
  color: var(--muted);
  font-weight: 500;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.15s var(--ease), color 0.15s;
}

.float .text-input:focus + label,
.float .text-input:not(:placeholder-shown) + label {
  transform: translateY(-11px) scale(0.78);
  font-weight: 700;
}

.float .text-input:focus + label {
  color: var(--primary-text);
}

.float .text-input::placeholder {
  color: transparent;
}

.counter {
  margin-top: var(--s-half);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
}

.counter.is-near { color: var(--accent-text); }
.counter.is-max { color: var(--danger-text); }

.contact-card .btn {
  width: 100%;
  margin-top: var(--s3);
}

.success {
  padding: var(--s3) 0;
  text-align: center;
  animation: fade-up 0.35s var(--ease);
}

.success__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--s2);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.success__icon .icon {
  width: 36px;
  height: 36px;
  stroke-width: 2.5;
}

.success h2 {
  font-size: 1.375rem;
  font-weight: 800;
  outline: none;
}

.success p {
  margin-top: var(--s1);
  color: var(--muted);
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Motion ---------- */
@keyframes slide-next {
  from { opacity: 0; transform: translateX(32px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-prev {
  from { opacity: 0; transform: translateX(-32px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Tablet (≥640px) ---------- */
@media (min-width: 640px) {
  :root {
    --header-h: 80px;
  }

  body {
    padding-bottom: 0;
  }

  .container {
    padding-inline: var(--s3);
  }

  .page {
    padding-block: var(--s5) var(--s8);
  }

  .header-nav {
    display: flex;
    gap: 2px;
    margin-left: var(--s2);
  }

  .header-contact {
    display: inline-flex;
  }

  .site-header {
    padding: 14px var(--s3) 0;
  }

  .header-inner {
    min-height: calc(var(--header-h) - 14px);
    padding: 8px 10px 8px 14px;
    border-radius: 24px;
  }

  .logo__text {
    font-size: 1.25rem;
  }

  .bottom-nav {
    display: none;
  }

  .toast-region {
    top: auto;
    bottom: var(--s3);
  }

  .hero {
    text-align: center;
    margin-bottom: var(--s4);
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero__kicker {
    margin-inline: auto;
  }

  .hero__sub {
    font-size: 1.125rem;
  }

  .badges {
    justify-content: center;
  }

  .progress {
    padding: var(--s3) var(--s4) 0;
  }

  .step {
    padding: var(--s3) var(--s4) var(--s4);
  }

  .wizard__actions {
    position: static;
    padding: var(--s2) var(--s4);
    background: transparent;
    box-shadow: none;
  }

  .choice-grid--3 .choice-card__title {
    font-size: 0.9375rem;
  }

  .results {
    gap: var(--s3);
  }

  .results__head {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--s3);
  }

  .result-hero {
    padding: var(--s4);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Without body fat there are only 3 cards: let the last one fill the row */
  .stat-grid:has(> #comp-card[hidden]) > :nth-child(3) {
    grid-column: 1 / -1;
  }

  .panel {
    padding: var(--s3);
  }

  .macros {
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: var(--s4);
  }

  .result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
  }

  .result-actions .btn {
    flex-direction: row;
    min-height: 48px;
    padding: 0 var(--s3);
    font-size: 1rem;
  }

  .page-hero {
    margin-bottom: var(--s4);
  }

  .page-hero h1 {
    font-size: 2.25rem;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-card {
    margin-inline: auto;
    padding: var(--s4);
  }

  .narrow {
    max-width: 760px;
    margin-inline: auto;
  }

  .guide__intro h2 {
    font-size: 2.25rem;
  }

  .guide__h2 {
    font-size: 1.625rem;
  }

  .info-card--wide {
    grid-column: 1 / -1;
  }

  .macro-facts,
  .goal-cards,
  .checksteps {
    grid-template-columns: repeat(3, 1fr);
  }

  .checksteps li {
    flex-direction: column;
    align-items: flex-start;
  }

  .tips {
    grid-template-columns: repeat(2, 1fr);
  }

  .tips li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .guide-cta {
    padding: var(--s6) var(--s5);
  }

  .legal-hero h1 {
    font-size: 2.5rem;
  }

  .legal-body {
    padding: var(--s5);
  }
}

/* ---------- Tablet header (640–959px): keep logo, nav and toggle on one line ---------- */
@media (min-width: 640px) and (max-width: 899px) {
  .logo__light {
    display: none;
  }

  .header-nav {
    margin-left: var(--s1);
  }

  .header-nav a {
    padding: 0 10px;
    font-size: 0.875rem;
  }
}

@media (min-width: 1024px) {
  .header-cta {
    display: inline-flex;
  }

  .header-nav {
    margin-left: var(--s3);
  }
}

/* ---------- Desktop (≥1024px) ---------- */
@media (min-width: 1024px) {
  .calc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
    align-items: center;
    gap: var(--s6);
  }

  .calc-hero > .hero {
    margin: 0;
    text-align: left;
  }

  .calc-hero .hero__kicker {
    margin-inline: 0;
  }

  .calc-hero .badges {
    justify-content: flex-start;
  }

  .hero__points {
    display: block;
  }

  .calc-hero .wizard {
    max-width: none;
    margin: 0;
  }

  .hero h1 {
    font-size: 3.25rem;
  }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat-grid:has(> #comp-card[hidden]) {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-grid:has(> #comp-card[hidden]) > :nth-child(3) {
    grid-column: auto;
  }

  .results__panels {
    grid-template-columns: 3fr 2fr;
    gap: var(--s3);
    align-items: start;
  }

  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .info-card--featured,
  .guide__grid .info-card--wide {
    grid-column: span 2;
  }

  .legal {
    grid-template-columns: 270px 1fr;
  }

  .legal-toc {
    position: sticky;
    top: calc(var(--header-h) + var(--s2));
    max-height: calc(100vh - var(--header-h) - var(--s4));
    overflow-y: auto;
  }

  .legal-toc ol {
    columns: 1;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .bottom-nav,
  .site-footer,
  .hero,
  .wizard,
  .welcome,
  .result-actions,
  .btn,
  .info-btn,
  .toast-region,
  .popover,
  .segmented,
  .mini-label,
  .guide,
  .legal-toc,
  .legal-contact .btn {
    display: none !important;
  }

  body {
    padding: 0;
    background: #fff;
    color: #000;
  }

  .card,
  .result-hero {
    box-shadow: none;
    break-inside: avoid;
  }

  .result-hero {
    color: #000;
    background: none;
    border: 2px solid #000;
  }
}
