/* Calculator pages — loaded after main.css on calculator pages only. Keeps the old pages' look:
   white fields with an orange border on the dark background, centred results, orange headings in tables. */

.calc-page { padding-block: clamp(2rem, 6vw, 3.5rem) var(--section-pad); }
.calc-page__title { text-align: center; font-size: clamp(2rem, 6vw, 3.6rem); margin-bottom: 0.9em; }

/* ---------- Form fields ---------- */
.calc-form { margin-bottom: 1.5rem; }
.calc-field { margin-bottom: 0.6rem; }
.calc-field label { display: block; margin-bottom: 0.2rem; font-weight: 500; }
.calc-field input[type="number"],
.calc-field input[type="text"],
.calc-field select {
  display: block; width: 100%; min-height: 44px; padding: 0.5rem 0.75rem;
  font: inherit; color: var(--black); background: var(--white);
  border: 1px solid var(--orange); border-radius: 3px;
}
.calc-field input:hover, .calc-field select:hover { background: #fef0ea; }
.calc-field input:user-invalid { border-color: #e0424a; box-shadow: 0 0 0 1px #e0424a; }

/* ---------- Results ---------- */
.calc-actions { text-align: center; margin: 0; }
.calc-noscript { text-align: center; color: var(--muted); }
.calc-disclaimer { margin: 1.25rem 0 0; padding: 0.75rem 1rem; border-left: 4px solid var(--orange); background: var(--panel); font-size: 0.95rem; }

/* RPE: three narrow number boxes in a row, then the two results as large orange figures (they are the point) */
.rpe-form { max-width: 30rem; margin-inline: auto; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 0.75rem; }
.rpe-form > :not(.calc-field) { grid-column: 1 / -1; }
.rpe-form .calc-field { display: flex; flex-direction: column; justify-content: flex-end; } /* boxes line up if a label wraps */
.rpe-form .calc-field input { text-align: center; }
.rpe-result { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1.25rem 0; text-align: center; }
.rpe-stat { display: flex; flex-direction: column; gap: 0.4rem; padding: 1rem 0.5rem 1.1rem; background: var(--panel); border-top: 4px solid var(--orange); border-radius: var(--radius); }
.rpe-stat__label { font-size: 0.9rem; font-weight: 500; line-height: 1.3; }
.rpe-stat__value { margin-top: auto; font-size: clamp(1.7rem, 7vw, 2.6rem); font-weight: 800; line-height: 1.1; color: var(--orange); white-space: nowrap; }

/* ---------- Blood pressure ---------- */
.calc-message { text-align: center; min-height: 1.6em; margin: 0 0 0.5rem; }
.bp-form__fields { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.bp-form .calc-field label { font-weight: 800; }
/* Category colours from the old chart. Labels use near-black text: white on these fails WCAG AA. */
.bp-low { background: #8a74bf; }
.bp-norm { background: #71a234; }
.bp-pre-high { background: #dc780a; }
.bp-high { background: #e0424a; }
.bp-legend { display: flex; margin: 2rem 0 0; color: var(--bg); text-align: center; font-size: 0.9rem; font-weight: 500; }
.bp-legend span { flex: 1; border: 1px solid var(--white); }
/* Same geometry as the old chart (24px rows, 24px top padding): the marker maths in calc/bp.js depends on it */
.bp-chart { position: relative; padding-top: 24px; margin-bottom: 2.5rem; }
.bp-chart__row { display: flex; height: 24px; }
.bp-chart__row > * { flex: 1 1 14.28%; }
.bp-chart__y { margin-top: -14px; padding-right: 14px; text-align: right; font-size: 12px; line-height: 24px; }
.bp-chart__x { text-align: left; font-size: 12px; line-height: 24px; transform: translateX(-8px); }
.bp-chart__cell { border-right: 1px solid var(--white); border-bottom: 1px solid var(--white); }
.bp-chart__marker { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: none; }
.bp-chart__marker[hidden] { display: none; }
.bp-advice ul { padding-left: 1.2em; }

/* ---------- Maintenance calories (layout of the old WP Calorie Calculator plugin) ---------- */
.mc { max-width: 100%; }
.mc fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.mc__title { text-align: center; font-size: 1.25rem; text-transform: uppercase; padding-bottom: 0.6rem; border-bottom: 1px solid #555; margin-bottom: 1rem; }
.mc .mc-group__title { display: block; font-weight: 800; font-size: 1.05rem; padding: 0; margin-bottom: 0.4rem; }
.mc-switch { display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.mc-switch__option { background: none; border: 0; color: var(--white); font-weight: 500; padding: 0.4rem 0.2rem; cursor: pointer; }
.mc-switch__toggle {
  appearance: none; position: relative; width: 52px; height: 28px; margin: 0; border-radius: 999px;
  background: var(--orange); cursor: pointer; flex: none;
}
.mc-switch__toggle::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--white); transition: transform 0.15s;
}
.mc-switch__toggle:checked::before { transform: translateX(24px); }
.mc-grid { display: grid; gap: 0 1.25rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .mc-grid { grid-template-columns: 1fr; } }
.mc .calc-field label:not(.mc-group__title) { font-weight: 800; }
.mc .calc-field input, .mc .calc-field select { border-radius: 6px; }
.mc-height { display: flex; gap: 0.6rem; }
.mc-height input { flex: 1; min-width: 0; }
.mc-height input[hidden] { display: none; }
.calc-field input.is-wrong { border-color: #e0424a; box-shadow: 0 0 0 2px #e0424a; }
.mc-row { display: grid; gap: 1.25rem 2rem; grid-template-columns: minmax(200px, 1fr) 3fr; margin-top: 1.75rem; align-items: start; }
@media (max-width: 700px) { .mc-row { grid-template-columns: 1fr; } }
.mc-activity__options {
  display: grid; gap: 0.6rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  padding: 0.9rem 1rem; border: 1px solid #2a2a2a; border-radius: 6px; background: #1b1512;
}
.mc-radio { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; }
.mc-radio input { accent-color: var(--orange); width: 18px; height: 18px; margin: 0.2rem 0 0; flex: none; }
.mc-radio__title { display: block; font-weight: 500; }
.mc-radio__hint { display: block; font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.mc-result {
  margin-top: 2rem; padding: 1.5rem 1.25rem; border-radius: 15px; background: #fde8df; color: #1c1f23; text-align: center;
}
.mc-result__icon { box-sizing: content-box; padding: 8px; border-radius: 8px; background: var(--orange); color: #fde8df; margin: 0 auto 0.75rem; }
.mc-result__title { color: #a8441a; text-transform: uppercase; font-size: 1.15rem; margin-bottom: 0.75rem; }
.mc-result__label { font-weight: 800; margin-bottom: 0.6rem; }
.mc-result__value { margin: 0 auto; max-width: 240px; padding: 0.75rem; border-radius: 10px; background: var(--white); font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* ---------- Fat loss (deficit) ---------- */
.fl-instructions { margin: 1.5rem 0 0; }
.fl-instructions ul { padding-left: 1.2em; }
.fl-form { margin: 1.5rem 0 2rem; }
.fl-slider { margin-bottom: 0.75rem; }
.fl-slider__label { display: block; font-weight: 800; margin-bottom: 0.15rem; }
.fl-slider__controls { display: flex; align-items: center; gap: 0.9rem; }
.fl-slider__range {
  flex: 1; min-width: 0; height: 10px; margin: 0; border-radius: 5px; background: #d7dcdf;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.fl-slider__range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #cd4202; border: 0; }
.fl-slider__range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #cd4202; border: 0; }
.fl-slider__range:hover::-webkit-slider-thumb, .fl-slider__range:active::-webkit-slider-thumb { background: #ec5024; }
.fl-slider__range:focus-visible { outline: 3px solid var(--white); outline-offset: 6px; }
.fl-slider__range::-moz-range-track { background: #d7dcdf; height: 10px; border-radius: 5px; }
/* Orange value boxes as before; text colour from --on-orange (main.css) */
.fl-slider__box {
  flex: none; width: 80px; min-height: 36px; padding: 0.3rem 0.5rem; text-align: center;
  font: inherit; font-weight: 500; color: var(--on-orange); background: var(--orange); border: 1px solid var(--orange); border-radius: 3px;
}
.fl-chart { position: relative; height: 450px; background: var(--black); }
@media (max-width: 600px) { .fl-chart { height: 360px; } }
.fl-summary { margin: 1.5rem 0 3rem; min-height: 3em; }
.fl-table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--white); text-align: center; font-size: 0.95rem; }
.fl-table th { padding: 2rem 0.5rem 0.75rem; }
.fl-table td { padding: 0.9rem 0.5rem; border-bottom: 1px solid var(--white); }

/* ---------- Overhead squat assessment ---------- */
.sq-options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.75rem; margin-bottom: 1.5rem; }
.sq-options__name { flex: 1 1 260px; margin: 0; }
.sq-toggle, .sq-check { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; }
.sq-toggle { min-height: 44px; align-items: center; font-weight: 500; }
.sq-toggle input, .sq-check input { accent-color: var(--orange); width: 20px; height: 20px; margin: 0.15rem 0 0; flex: none; }
.sq-toggle input { margin: 0; }
.sq-intro { color: var(--muted); margin-bottom: 0.75rem; }
.sq-views { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; margin-bottom: 1.75rem; }
.sq-view { margin: 0; padding: 0 1.25rem 1rem; border: 0; border-top: 6px solid var(--orange); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.sq-view__title { float: left; width: 100%; padding: 1rem 0 0.5rem; font-size: 1.3rem; font-weight: 800; }
.sq-view__title + * { clear: both; }
.sq-check { padding: 0.6rem 0; border-top: 1px solid #2c2c2c; }
.sq-check__point { display: block; font-size: 0.78rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--orange); }
.sq-check__name { display: block; font-weight: 500; }
.sq-results { margin-top: 2.5rem; padding: clamp(1.25rem, 4vw, 2rem); border-radius: var(--radius); background: var(--panel); border-top: 6px solid var(--orange); }
.sq-results__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.sq-results__title { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); }
.sq-results__meta { color: var(--muted); }
.sq-results__meta strong { color: var(--white); }
.sq-col__title { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; }
.sq-table { width: 100%; border-collapse: collapse; }
.sq-table th, .sq-table td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem 0.55rem 0; border-bottom: 1px solid #333; width: 33%; }
.sq-table th { color: var(--orange); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.sq-cols { display: grid; gap: 0 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.sq-muscles { list-style: none; margin: 0; padding: 0; }
.sq-muscle { padding: 0.45rem 0; border-bottom: 1px solid #333; }
.sq-muscle__line { display: flex; justify-content: space-between; gap: 1rem; }
.sq-muscle__count {
  flex: none; min-width: 1.9em; height: 1.9em; display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--orange); color: var(--on-orange); font-weight: 800; font-size: 0.85rem;
}
.sq-img { display: block; width: 300px; max-width: 100%; height: auto; margin: 0.6rem 0 0.3rem; background: var(--white); border-radius: 4px; }
.sq-empty { color: var(--muted); }

@media print {
  body:has(.sq-page) { background: #fff; color: #000; }
  body:has(.sq-page) :is(.site-header, .site-footer, .float-book, .consent, .skip-link, .calc-page__title),
  .sq-form, .sq-print { display: none !important; }
  .sq-page { padding: 0; }
  .sq-page .container { max-width: none; padding: 0; }
  .sq-results { margin: 0; padding: 0; background: none; border: 0; color: #000; }
  .sq-results__title, .sq-col__title, .sq-results__meta, .sq-results__meta strong { color: #000; }
  .sq-table th { color: #000; }
  .sq-table th, .sq-table td, .sq-muscle { border-color: #999; }
  .sq-muscle__count { background: none; border: 1px solid #000; color: #000; }
  .sq-muscle, .sq-table tr { break-inside: avoid; }
  .sq-img { border: 1px solid #ccc; }
}
