/* =============================================================
   CALCULATOR PAGE — shared design system
   The BMR page is the reference implementation. Every other
   calculator page clones this file and swaps the accent vars plus
   the sticker set.

   Layout contract (locked):
     .calc-page      page shell
     .calc-head      breadcrumb + title + lede
     .calc-body      2-col grid: form | result
     .calc-form      inputs
     .calc-result    live output, sticky on desktop
     .calc-content   below the fold: how-to, formula, faq, related
   ============================================================= */

/* ---- per-calculator accent, overridden in the page's own block ----
   BMR inherits the defaults below. A page with its own accent declares it
   here in its own <style>, e.g.

     <body class="calc-page calc-page--bmi">
     ...
     <style>
       .calc-page--bmi { --accent: #5b8def; --accent-ink: #2f5fc4; }
     </style>

   The config's `accent` field in assets/js/calculators/<id>.js is NOT applied
   by calc-page.js - these variables are the only thing that changes colour. */
.calc-page {
  --accent: #16c08a;
  --accent-ink: #0a7d5b;
  --accent-soft: rgba(22, 192, 138, 0.10);
  --accent-ring: rgba(22, 192, 138, 0.28);
}

/* BMI — a distinct blue so the two calculator pages are told apart at a
   glance while staying inside the same design system. */
.calc-page--bmi {
  --accent: #5b8def;
  --accent-ink: #2f5fc4;
  --accent-soft: rgba(91, 141, 239, 0.10);
  --accent-ring: rgba(91, 141, 239, 0.28);
}

/* One accent per calculator, so the page you are on is obvious from the
   colour alone. Each is a different hue from the ones already in use:
   BMR green, BMI blue, body fat orange, pace teal, heart rate crimson,
   water azure. */
.calc-page--body-fat {
  --accent: #e0663d;
  --accent-ink: #b04a26;
  --accent-soft: rgba(224, 102, 61, 0.10);
  --accent-ring: rgba(224, 102, 61, 0.28);
}

.calc-page--pace {
  --accent: #12a37f;
  --accent-ink: #0b7359;
  --accent-soft: rgba(18, 163, 127, 0.10);
  --accent-ring: rgba(18, 163, 127, 0.28);
}

.calc-page--heart-rate-zones {
  --accent: #d63a5c;
  --accent-ink: #a82442;
  --accent-soft: rgba(214, 58, 92, 0.10);
  --accent-ring: rgba(214, 58, 92, 0.28);
}

.calc-page--water-intake {
  --accent: #2f8fd8;
  --accent-ink: #1c6ba8;
  --accent-soft: rgba(47, 143, 216, 0.10);
  --accent-ring: rgba(47, 143, 216, 0.28);
}

/* ---- page shell ---- */
.calc-page {
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: var(--sp-16);
}

/* =============================================================
   CHROME — site header and footer.
   The landing page styles these under different names, so the
   calculator page carries its own. Kept deliberately quiet: the
   form and the number are the loudest things on the page.
   ============================================================= */
.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-ink);
  text-decoration: none;
  flex: none;
}
.brand__mark { width: 28px; height: 28px; display: block; }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  font-size: 14px;
  font-weight: 600;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:first-child { color: var(--brand-ink); border-bottom-color: var(--brand); }

.site-foot {
  margin-top: var(--sp-12);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.site-foot__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding: var(--sp-7) 0;
  font-size: 13px;
  color: var(--muted);
}
.site-foot__row p { margin: 0; }
.site-foot__row a { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.site-foot__row a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .site-head__row { height: 58px; }
  .site-nav { gap: var(--sp-4); font-size: 13px; }
  .site-nav a:nth-child(n+3) { display: none; }
}

/* ---- head ---- */
.calc-head {
  position: relative;
  padding: var(--sp-9) 0 var(--sp-8);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(46% 60% at 12% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, #ffffff, var(--bg));
  overflow: hidden;
}

.calc-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: var(--sp-5);
  transition: color 0.18s ease;
}
.calc-crumb:hover { color: var(--accent-ink); }
.calc-crumb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.calc-head__title {
  font-size: clamp(32px, 5.2vw, 52px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
  color: var(--ink);
  margin: 0 0 var(--sp-4);
  max-width: 17ch;
}
.calc-head__title em {
  font-style: normal;
  color: var(--accent-ink);
  position: relative;
  white-space: nowrap;
}
.calc-head__title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 8px;
  background: var(--accent-soft);
  border-radius: 3px;
  z-index: -1;
}

.calc-head__lede {
  font-size: clamp(15px, 1.5vw, 17px);
  color: var(--muted);
  max-width: 58ch;
  line-height: 1.65;
  margin: 0;
}

/* source stamp — this calculator is backed by a real, citable method */
.calc-source {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--sp-6);
  padding: 10px 16px 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  box-shadow: var(--sh-sm);
}
.calc-source b { color: var(--ink); font-weight: 700; }
.calc-source .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.calc-source a { color: var(--accent-ink); font-weight: 600; }

/* ---- body grid ---- */
.calc-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: var(--sp-12);
  align-items: start;
  padding: var(--sp-10) 0 0;
}

/* ---- form ---- */
.calc-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  box-shadow: var(--sh-md);
}

.fgroup { margin-bottom: var(--sp-7); }
.fgroup:last-child { margin-bottom: 0; }

.flabel {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.fhint {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}

/* segmented control (sex, unit system) */
.seg {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  display: block;
  text-align: center;
  padding: 10px 8px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}
.seg label:hover { color: var(--ink); }
.seg input:checked + label {
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: var(--sh-sm);
}
.seg input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* numeric field */
.fnum {
  position: relative;
  display: flex;
  align-items: center;
}
.fnum input {
  width: 100%;
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  padding: 15px 54px 15px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  -moz-appearance: textfield;
}
.fnum input::-webkit-outer-spin-button,
.fnum input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fnum input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.fnum input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.16);
}
.fnum .unit {
  position: absolute;
  right: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

/* unit-specific field is hidden when the other system is selected */
.fnum[hidden] { display: none; }

.fmeta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  min-height: 17px;
}
.fmeta .err { color: var(--danger); font-weight: 600; }

/* ---- result ---- */
.calc-result {
  position: sticky;
  top: 24px;
}

.rcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  box-shadow: var(--sh-md);
  overflow: hidden;
  position: relative;
}

/* live-pulse marker so it is obvious the number tracks the inputs */
.rcard__live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: var(--sp-5);
}
.rcard__live .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .rcard__live .pulse { animation: none; }
}

.rbig {
  font-size: clamp(46px, 8vw, 62px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.18s ease;
}
.rbig .unit {
  font-size: 0.34em;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 8px;
}
.rbig.is-stale { opacity: 0.4; }

.rmeta {
  margin-top: var(--sp-4);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.rmeta b { color: var(--ink); font-weight: 700; }

/* the method line — proves the number came from a real source */
.rmethod {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.rmethod b { color: var(--ink); font-weight: 700; }

/* ---- structured result detail ----
   The heart rate zones and the water breakdown are not decoration: for those
   calculators the table IS the answer, and the big number above it is only
   the headline. These styles give that table a place to live. */
.rdetails {
  margin-top: var(--sp-5);
}
.rdetails[hidden] { display: none; }

/* A flat key/value list, used for the water breakdown and the pace summary. */
.dtable {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.dtable > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 9px var(--sp-4);
  background: var(--surface);
}
.dtable dt {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.dtable dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* The five training zones.
   The row tint runs the FULL width of every row. An earlier version made the
   tint narrower for lower zones so the panel read as a bar chart, and it
   looked like a rendering fault: five rectangles of different widths butted
   against each other produce a staircase down the right edge. Intensity is
   carried by saturation instead, which is a smooth gradient and cannot be
   misread as a broken border. */
.zones {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.zones__head {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 1fr;
  gap: var(--sp-3);
  padding: 9px var(--sp-4);
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.zones__head span:nth-child(2) { text-align: center; }
.zones__head span:nth-child(3) { text-align: right; }

.zrow {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 1fr;
  gap: 2px var(--sp-3);
  padding: 10px var(--sp-4);
  background: var(--zone-c, var(--accent-soft));
  border-top: 1px solid var(--border);
}
.zrow__name { font-size: 13px; font-weight: 700; color: var(--ink); }
.zrow__pct { font-size: 12px; color: var(--muted); text-align: center; }
.zrow__bpm { font-size: 15px; font-weight: 800; color: var(--ink); text-align: right; }
.zrow__bpm span { font-size: 11px; font-weight: 600; color: var(--muted); }
/* The purpose sits on its own line under the three columns. It is a
   `grid-column: 1 / -1` child rather than a fourth column, because a fourth
   child in a three-column template would create an implicit column and wrap
   unpredictably at narrow widths. */
.zrow__why {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 3px;
}

/* ---- select fields ----
   Added for body fat and water, where the input that chooses an equation or
   a published value is a choice rather than a number. Styled to match .fnum
   so a row of selects does not look bolted onto the form. */
.fnum select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 34px 10px 12px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fnum select:hover { border-color: var(--accent); }
.fnum select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.fnum select option { color: var(--ink); background: var(--surface); }

/* limitations matter here: BMR is an estimate from a regression */
.rlimits {
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.rlimits summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rlimits summary::-webkit-details-marker { display: none; }
.rlimits summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s ease;
  flex: none;
}
.rlimits[open] summary::before { transform: rotate(90deg); }
.rlimits ul { margin: 12px 0 0; padding-left: 18px; }
.rlimits li { margin-bottom: 7px; }
.rlimits li:last-child { margin-bottom: 0; }

/* validation banner */
.ralert {
  display: none;
  margin-bottom: var(--sp-5);
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(214, 69, 69, 0.08);
  border: 1px solid rgba(214, 69, 69, 0.25);
  color: #a52f2f;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.ralert.is-on { display: block; }

/* permalink row */
.rlink {
  display: flex;
  gap: 8px;
  margin-top: var(--sp-6);
}
.rlink input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.rlink button {
  flex: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: var(--r-sm);
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.rlink button:hover { opacity: 0.86; }
.rlink button:active { transform: scale(0.97); }
.rlink button.is-done { background: var(--accent-ink); }

/* =============================================================
   2D STICKER DECORATION
   Flat SVG stickers that float around the calculator. Never 3D, never
   behind a card, never cropped. The layer is page-fixed and the cards
   sit above it, so a sticker is always visible in the margin rather
   than disappearing underneath content.
   ============================================================= */
.stickers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.calc-head, .calc-form, .rcard, .cblock, .site-head, .site-foot { position: relative; z-index: 1; }

.sticker {
  position: absolute;
  will-change: transform;
  filter: drop-shadow(0 10px 18px rgba(16, 40, 32, 0.10));
}
.sticker svg { display: block; width: 100%; height: 100%; }

/* corner placements. Each keeps clear of the centred content column:
   the top ones sit in the wide margins beside the page title, the
   bottom-left one sits beside the result card. */
.sticker--top-left     { top: 150px;  left: 3%; }
.sticker--top-right    { top: 132px;  right: 3%; }
.sticker--bottom-left  { bottom: 120px; left: 2.5%; }
.sticker--bottom-right { bottom: 150px; right: 3%; }

/* slow float — decorative only, so it is paused under reduced motion */
.sticker[data-float] { animation: stickerFloat var(--dur, 7s) ease-in-out infinite; }
@keyframes stickerFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-14px) rotate(calc(var(--rot, 0deg) + 3deg)); }
}
@media (prefers-reduced-motion: reduce) {
  .sticker[data-float] { animation: none; }
  .sticker { transform: rotate(var(--rot, 0deg)); }
}

/* =============================================================
   BELOW THE FOLD
   ============================================================= */
.calc-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-8);
  margin-top: var(--sp-12);
}

.cblock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  box-shadow: var(--sh-sm);
}
.cblock--wide { grid-column: 1 / -1; }

.cblock__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 var(--sp-5);
}
.cblock__title svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.cblock p { color: var(--muted); line-height: 1.7; font-size: 14.5px; margin: 0 0 var(--sp-4); }
.cblock p:last-child { margin-bottom: 0; }
.cblock b, .cblock strong { color: var(--ink); font-weight: 700; }
.cblock ol, .cblock ul { margin: 0; padding-left: 20px; }
.cblock ol li, .cblock ul li { color: var(--muted); line-height: 1.7; margin-bottom: 10px; font-size: 14.5px; }
.cblock ol li b, .cblock ul li b { color: var(--ink); }

/* the formula, set as a readable equation rather than a raw expression */
.formula {
  padding: var(--sp-5) var(--sp-6);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.8;
  text-align: center;
  overflow-x: auto;
}
.formula .op { color: var(--accent-ink); margin: 0 2px; }
.formula small {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--line);
  padding: var(--sp-4) 0;
}
.faq details:first-of-type { padding-top: 0; }
.faq details:last-child { border-bottom: none; padding-bottom: 0; }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  line-height: 1.5;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm {
  flex: none;
  width: 20px; height: 20px;
  position: relative;
  margin-top: 2px;
}
.faq summary .pm::before,
.faq summary .pm::after {
  content: "";
  position: absolute;
  background: var(--accent-ink);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.faq summary .pm::before { left: 3px; right: 3px; top: 9px; height: 2px; }
.faq summary .pm::after { top: 3px; bottom: 3px; left: 9px; width: 2px; }
.faq details[open] summary .pm::after { transform: scaleY(0); opacity: 0; }
.faq details[open] summary { color: var(--accent-ink); }
.faq .ans { padding-top: 12px; }

/* related calculator cards */
.related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--sp-4);
}
.rcard-link {
  display: block;
  padding: var(--sp-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.rcard-link:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--sh-md);
}
.rcard-link .n {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 5px;
}
.rcard-link .n svg { width: 17px; height: 17px; fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rcard-link .d { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.rcard-link .soon {
  display: inline-block;
  margin-top: 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

/* ---------------------------------------------------- category table
   The CDC cut-offs, printed rather than only described in prose. The
   boundaries are the backend's categorise() thresholds; if those change,
   this table must change with it. */
.ctable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  margin-top: var(--sp-4);
}
.ctable th, .ctable td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.ctable th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ctable td:first-child { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.ctable tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------- in-form note
   Explains a missing field (BMI has no sex input) in the form itself, where
   the user is actually looking when they go looking for it. */
.fnote {
  margin: var(--sp-3) 0 0;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3, 12px);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
}
.fnote b { color: var(--ink-2); }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 980px) {
  .calc-body { grid-template-columns: 1fr; gap: var(--sp-9); }
  .calc-result { position: static; }
  .calc-content { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .calc-form, .rcard, .cblock { padding: var(--sp-6); }
  .calc-head { padding: var(--sp-7) 0 var(--sp-7); }
  .calc-body { padding-top: var(--sp-7); }
  /* stickers shrink and move to corners that cannot collide with fields */
  .sticker { transform: scale(0.72) rotate(var(--rot, 0deg)); }
  .sticker[data-float] { animation: none; }
}
