/* =====================================================================
   TRUE FORM Client Forms — ONE shared stylesheet for every form.
   Screen (iPad primary, laptop, phone) + A4 print/PDF. LTR + RTL.
   Tokens: see "03 Design System/tokens.json" (extracted from the
   TRUE FORM Beginner Starter Guide PDF).
   ===================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face { font-family: "TF Archivo"; src: url("assets/fonts/archivo-latin-standard-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "TF Archivo"; src: url("assets/fonts/archivo-latin-ext-standard-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20C0, U+2113; }
@font-face { font-family: "TF Inter"; src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "TF Inter"; src: url("assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20C0, U+2113; }
@font-face { font-family: "TF Cairo"; src: url("assets/fonts/cairo-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "TF Cairo"; src: url("assets/fonts/cairo-arabic-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "TF Cairo"; src: url("assets/fonts/cairo-arabic-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "TF Plex Arabic"; src: url("assets/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TF Plex Arabic"; src: url("assets/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "TF Plex Arabic"; src: url("assets/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "TF Plex Arabic"; src: url("assets/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Tokens ---------- */
.tf {
  --ink: #0C1512; --text: #40514B; --muted: #71837D;
  --g900: #06231A; --g850: #0A271E; --g800: #0B3A2A; --g700: #0A5038; --g500: #00A67B; --mint: #07E3B9;
  --line: #DEE8E4; --line-strong: #C7D8D2; --line-check: #B9CFC7;
  --surface: #FFFFFF; --tint: #F3F8F6; --soft: #FAFCFB; --alt: #EDF3F1;
  --grad-header: radial-gradient(120% 90% at 0% 0%, rgba(0,166,123,.16), transparent 55%), radial-gradient(90% 120% at 100% 100%, rgba(0,166,123,.20), transparent 55%), #06231A;
  --grad-bar: linear-gradient(180deg, #00A67B 0%, #0A5038 100%);
  --grad-accent: linear-gradient(90deg, #07E3B9 0%, #00A67B 40%, #0B3A2A 100%);

  --f-display: "TF Archivo", "Archivo", "Arial Black", system-ui, sans-serif;
  --f-body: "TF Inter", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --track-wide: .22em; --track: .18em; --track-sm: .14em;

  /* screen scale */
  --gutter: max(16px, 4vw);
  --maxw: 940px;
  --fs-word: 22px; --fs-brandsub: 10px; --fs-badge: 11px; --fs-eyebrow: 12px;
  --fs-title: clamp(28px, 4.4vw, 42px); --fs-tags: 12px; --fs-sub: 11px;
  --fs-statlabel: 11px; --fs-statval: 20px; --fs-statnote: 12.5px;
  --fs-section: 18px; --fs-pill: 11px; --fs-label: 16px; --fs-help: 14px; --fs-body: 15px;
  --fs-th: 11.5px; --fs-td: 15px; --fs-callout: 14px; --fs-foot: 12px;
  --logo: 48px; --bar-w: 6px; --bar-h: 26px; --check: 22px; --ctl-h: 48px;
  --sec-gap: 40px; --field-gap: 22px;

  font-family: var(--f-body); color: var(--text); font-size: var(--fs-body); line-height: 1.45;
  background: var(--surface);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
.tf *, .tf *::before, .tf *::after { box-sizing: border-box; }
.tf[dir="rtl"] {
  --f-display: "TF Cairo", "Cairo", "TF Plex Arabic", system-ui, sans-serif;
  --f-body: "TF Plex Arabic", "IBM Plex Sans Arabic", "TF Inter", system-ui, sans-serif;
  --track-wide: 0; --track: 0; --track-sm: 0;
}
.tf[dir="rtl"] .tf-upper { text-transform: none; }
.tf-upper { text-transform: uppercase; }
.tf-num { font-family: var(--f-body); direction: ltr; unicode-bidi: isolate; }

/* ---------- Header ---------- */
.tf-header { background: var(--grad-header); color: #fff; position: relative; }
.tf-header__inner { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 26px; }
.tf-brandrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tf-brand { display: flex; align-items: center; gap: 14px; }
.tf-logo { width: var(--logo); height: var(--logo); border-radius: 6px; border: 1px solid rgba(7,227,185,.7); background: #000 center/cover no-repeat; flex: none; }
.tf-wordmark { font-family: "TF Archivo", "Archivo", sans-serif; font-weight: 900; font-size: var(--fs-word); letter-spacing: .22em; line-height: 1; color: #fff; }
.tf-brandsub { font-family: "TF Inter", "Inter", sans-serif; font-weight: 600; font-size: var(--fs-brandsub); letter-spacing: .28em; color: rgba(255,255,255,.6); margin-top: 8px; }
.tf-badge { font-weight: 700; font-size: var(--fs-badge); letter-spacing: var(--track-sm); color: var(--mint); border: 1px solid rgba(7,227,185,.75); background: rgba(7,227,185,.06); border-radius: 999px; padding: 7px 16px; white-space: nowrap; }
.tf-eyebrow { font-weight: 700; font-size: var(--fs-eyebrow); letter-spacing: var(--track-wide); color: var(--mint); margin-top: 26px; }
.tf-title { font-family: var(--f-display); font-weight: 900; font-size: var(--fs-title); line-height: 1.06; color: #fff; margin: 10px 0 0; letter-spacing: 0; }
.tf[dir="rtl"] .tf-title { line-height: 1.35; }
.tf-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin-top: 14px; font-weight: 700; font-size: var(--fs-tags); letter-spacing: var(--track-sm); color: rgba(255,255,255,.78); }
.tf-tags span + span { border-inline-start: 1px solid rgba(255,255,255,.28); margin-inline-start: 14px; padding-inline-start: 14px; }
.tf-tags span:first-child { color: var(--mint); font-weight: 800; }
.tf-subline { font-weight: 700; font-size: var(--fs-sub); letter-spacing: var(--track-sm); color: rgba(255,255,255,.55); margin-top: 10px; }

.tf-stats { background: rgba(255,255,255,.05); border-top: 1px solid rgba(255,255,255,.10); position: relative; }
.tf-stats::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: var(--grad-accent); opacity: .55; }
.tf[dir="rtl"] .tf-stats::after { background: linear-gradient(270deg, #07E3B9 0%, #00A67B 40%, #0B3A2A 100%); }
.tf-stats__inner { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(3, 1fr); }
.tf-stat { padding: 16px 0 20px; }
.tf-stat + .tf-stat { border-inline-start: 1px solid rgba(255,255,255,.10); padding-inline-start: 22px; }
.tf-stat__label { font-weight: 700; font-size: var(--fs-statlabel); letter-spacing: .2em; color: rgba(255,255,255,.65); }
.tf[dir="rtl"] .tf-stat__label { letter-spacing: 0; }
.tf-stat__value { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-statval); color: var(--mint); margin-top: 6px; line-height: 1.15; }
.tf-stat__note { font-weight: 500; font-size: var(--fs-statnote); color: rgba(255,255,255,.72); margin-top: 6px; }

/* ---------- Body ---------- */
.tf-main { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 48px; }

.tf-callout { position: relative; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px 18px 30px; margin-bottom: var(--sec-gap); overflow: hidden; }
.tf[dir="rtl"] .tf-callout { padding: 18px 30px 18px 22px; }
.tf-callout::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--bar-w); background: var(--grad-bar); }
.tf-callout__title { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: var(--fs-callout); letter-spacing: var(--track); color: var(--g700); }
.tf-callout__icon { width: 20px; height: 20px; border-radius: 50%; background: var(--g500); color: #fff; display: inline-grid; place-items: center; font: 800 12px/1 var(--f-body); letter-spacing: 0; flex: none; }
.tf-callout p { margin: 10px 0 0; color: var(--text); }
.tf-callout p.tf-strong { color: var(--g700); font-weight: 700; }
.tf-callout p.tf-small { color: var(--muted); font-size: .9em; }

.tf-section { margin-bottom: var(--sec-gap); }
.tf-sechead { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.tf-sechead__bar { width: var(--bar-w); height: var(--bar-h); border-radius: 3px; background: var(--grad-bar); flex: none; }
.tf-sechead__title { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-section); letter-spacing: var(--track); color: var(--ink); white-space: nowrap; }
.tf-sechead__rule { flex: 1; height: 1px; background: var(--line); min-width: 20px; }
.tf-pill { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-pill); letter-spacing: var(--track-sm); color: var(--g700); background: var(--tint); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 14px; white-space: nowrap; }
.tf-secnote { color: var(--muted); font-weight: 500; font-size: var(--fs-help); margin: -6px 0 16px; }

.tf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--field-gap) 24px; }
.tf-field { grid-column: 1 / -1; min-width: 0; }
.tf-field--half { grid-column: span 1; }
.tf-field[hidden] { display: none; }
.tf-field--sub { margin-top: -6px; padding-inline-start: 16px; border-inline-start: 2px solid var(--line); }

.tf-label { display: block; font-weight: 700; font-size: var(--fs-label); color: var(--ink); line-height: 1.3; }
.tf-req { color: var(--g500); margin-inline-start: 3px; }
.tf-help { display: block; font-weight: 500; font-size: var(--fs-help); color: var(--muted); margin-top: 4px; }
.tf-control { margin-top: 10px; }
.tf-unit { color: var(--muted); font-weight: 600; font-size: var(--fs-help); }

/* inputs (screen) */
.tf-input, .tf-textarea { unicode-bidi: plaintext; width: 100%; font: 500 var(--fs-body)/1.4 var(--f-body); color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 14px; min-height: var(--ctl-h); outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.tf-textarea { padding: 12px 14px; min-height: 104px; resize: vertical; }
.tf-input:focus, .tf-textarea:focus { border-color: var(--g500); box-shadow: 0 0 0 3px rgba(0,166,123,.18); }
.tf-input::placeholder, .tf-textarea::placeholder { color: #A9BEB7; }
.tf-inputwrap { display: flex; align-items: center; gap: 10px; }
.tf-inputwrap .tf-input { flex: 1; }
.tf-input--num { max-width: 160px; }
.tf-contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }

/* choice pills (screen) */
.tf-options { display: flex; flex-wrap: wrap; gap: 10px; }
.tf-opt { position: relative; }
.tf-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tf-opt span { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-weight: 600; font-size: var(--fs-body); color: var(--text); cursor: pointer; user-select: none; transition: background .15s, border-color .15s, color .15s; }
.tf-opt span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-check); background: #fff; flex: none; transition: all .15s; }
.tf-opt input:checked + span { background: var(--tint); border-color: var(--g500); color: var(--g700); }
.tf-opt input:checked + span::before { border-color: var(--g500); background: var(--g500); box-shadow: inset 0 0 0 3px #fff; }
.tf-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,166,123,.25); }

/* 0–10 scale (screen) */
.tf-scale { display: grid; grid-template-columns: repeat(var(--tf-n, 11), minmax(0, 1fr)); gap: 6px; max-width: 620px; }
.tf-scale .tf-opt span { justify-content: center; padding: 0; width: 100%; font-family: var(--f-body); font-variant-numeric: tabular-nums; border-radius: 10px; }
.tf-scale .tf-opt span::before { display: none; }
.tf-scale .tf-opt input:checked + span { background: var(--g500); border-color: var(--g500); color: #fff; }
.tf-scale-ends { display: flex; justify-content: space-between; max-width: 620px; margin-top: 6px; font-size: calc(var(--fs-help) - 1px); color: var(--muted); font-weight: 500; }

/* grouped rows: scale_group / choice_group (screen + print share the card) */
.tf-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.tf-grouprow { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; align-items: center; gap: 16px; padding: 14px 18px; }
.tf-grouprow + .tf-grouprow { border-top: 1px solid var(--line); }
.tf-grouprow__label { font-weight: 700; color: var(--ink); font-size: var(--fs-label); }
.tf-grouphead { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 16px; padding: 10px 18px; background: var(--tint); border-bottom: 1px solid var(--line); font-weight: 700; font-size: var(--fs-th); letter-spacing: var(--track-sm); color: var(--g700); }

/* client confirmation (screen) */
.tf-field--confirm { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.tf-confirm { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; font-weight: 700; color: var(--ink); font-size: var(--fs-label); line-height: 1.35; }
.tf-confirm input { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin: 0; flex: none; border: 1.5px solid var(--line-check); border-radius: 6px; background: #fff; display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.tf-confirm input::after { content: ""; width: 6px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-2px) rotate(45deg); opacity: 0; }
.tf-confirm input:checked { background: var(--g500); border-color: var(--g500); }
.tf-confirm input:checked::after { opacity: 1; }
.tf-confirm input:focus-visible { box-shadow: 0 0 0 3px rgba(0,166,123,.25); }

/* coach review strip */
.tf-review { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.tf-review > div { padding: 14px 18px; }
.tf-review > div + div { border-inline-start: 1px solid var(--line); }
.tf-review__label { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-th); letter-spacing: var(--track); color: var(--g700); }
.tf-review__value { margin-top: 6px; min-height: 22px; border-bottom: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; }

/* ---------- Footer (screen) ---------- */
.tf-footer { background: var(--g900); color: rgba(255,255,255,.55); }
.tf-footer__inner { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 12px var(--gutter); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: var(--fs-foot); }
.tf-footer__word { font-family: "TF Archivo", "Archivo", sans-serif; font-weight: 900; letter-spacing: .22em; color: var(--mint); }
.tf-footer__code { font-weight: 600; letter-spacing: var(--track-sm); color: rgba(255,255,255,.7); }

/* ---------- Print-only answer marks (hidden on screen) ---------- */
.tf-p, .tf-pi { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .tf { --fs-label: 15.5px; --sec-gap: 32px; --field-gap: 20px; }
  .tf-grid { grid-template-columns: 1fr; }
  .tf-field--half { grid-column: 1 / -1; }
  .tf-stats__inner { grid-template-columns: 1fr; }
  .tf-stat + .tf-stat { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid rgba(255,255,255,.10); }
  .tf-stat { padding: 12px 0 14px; }
  .tf-brandrow { flex-wrap: wrap; }
  .tf-grouprow, .tf-grouphead { grid-template-columns: 1fr; gap: 10px; }
  .tf-grouphead > :last-child { display: none; }
  .tf-scale { gap: 4px; }
  .tf-scale .tf-opt span { min-height: 40px; font-size: 14px; border-radius: 8px; }
  .tf-contact { grid-template-columns: 1fr; }
  .tf-review { grid-template-columns: 1fr; }
  .tf-review > div + div { border-inline-start: 0; border-top: 1px solid var(--line); }
  .tf-sechead__title { white-space: normal; }
}

/* =====================================================================
   PRINT — A4, matches the Starter Guide's exact sizes.
   Page footer bar (TRUE FORM · form name · PAGE n / N) is drawn by the
   @page margin boxes injected by tf-forms.js (form name is per form).
   ===================================================================== */
@media print {
  @page { size: A4; margin: 34px 0 30px 0; }
  @page :first { margin-top: 0; }
  html, body { background: #fff !important; margin: 0 !important; }
  .tf {
    --gutter: 53px; --maxw: 688px;
    --fs-word: 20.65px; --fs-brandsub: 8.25px; --fs-badge: 8.25px; --fs-eyebrow: 8.4px;
    --fs-title: 21.33px; --fs-tags: 8.65px; --fs-sub: 8px;
    --fs-statlabel: 7.85px; --fs-statval: 13.5px; --fs-statnote: 8px;
    --fs-section: 13.05px; --fs-pill: 8.53px; --fs-label: 10.4px; --fs-help: 8.6px; --fs-body: 8.93px;
    --fs-th: 8.13px; --fs-td: 9.6px; --fs-callout: 10.4px; --fs-foot: 8.8px;
    --logo: 40px; --bar-w: 6px; --bar-h: 22px; --check: 11px;
    --sec-gap: 14px; --field-gap: 7px;
    line-height: 1.35;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .tf-noprint, .tf-footer { display: none !important; }
  .tf-header__inner { padding: 20px var(--gutter) 15px; }
  .tf-eyebrow { margin-top: 16px; }
  .tf-title { margin-top: 6px; }
  .tf-tags { margin-top: 10px; }
  .tf-tags span + span { margin-inline-start: 11px; padding-inline-start: 11px; }
  .tf-subline { margin-top: 7px; }
  .tf-badge { padding: 5px 12px; }
  .tf-stat { padding: 10px 0 13px; }
  .tf-stat + .tf-stat { padding-inline-start: 16px; }
  .tf-stat__value { margin-top: 4px; }
  .tf-stat__note { margin-top: 3px; }
  .tf-main { padding: 14px var(--gutter) 0; }
  .tf-callout { padding: 11px 16px 11px 24px; margin-bottom: var(--sec-gap); break-inside: avoid; }
  .tf[dir="rtl"] .tf-callout { padding: 11px 24px 11px 16px; }
  .tf-callout__icon { width: 14px; height: 14px; font-size: 8px; }
  .tf-callout p { margin-top: 5px; }
  .tf-sechead { margin-bottom: 6px; gap: 10px; break-after: avoid; }
  .tf-secnote { margin: -2px 0 8px; }
  /* print uses normal block flow (more reliable page breaks than grid) */
  .tf-grid { display: block; }
  .tf-field { display: block; break-inside: avoid; padding-bottom: 6px; margin-bottom: var(--field-gap); border-bottom: 1px solid var(--line); }
  /* short choices (yes/no …): tick boxes sit on the same line as the question */
  .tf-field--inline { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
  .tf-field--inline .tf-q { flex: 1; min-width: 0; }
  .tf-field--inline .tf-control.tf-p { margin-top: 0; flex: none; display: block; }
  .tf-field--inline .tf-pchecks { flex-wrap: nowrap; gap: 4px 14px; }
  .tf-field--lineinline { display: flex; align-items: flex-end; gap: 14px; }
  .tf-field--lineinline .tf-q { flex: 0 1 auto; max-width: 56%; }
  .tf-field--lineinline .tf-control.tf-p { flex: 1 1 40%; margin-top: 0; display: block; min-width: 0; }
  .tf-field--lineinline .tf-pinline { justify-content: flex-start; }
  .tf-field--confirm { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; }
  .tf-pconfirm { display: flex; align-items: flex-start; gap: 9px; font-weight: 700; color: var(--ink); font-size: var(--fs-label); line-height: 1.3; }
  .tf-pconfirm .tf-box { margin-top: 1px; }
  .tf-field--half { display: inline-block; width: calc(50% - 11px); vertical-align: top; }
  .tf-field--pair2 { margin-inline-start: 22px; }
  .tf-field--sub { margin-top: -4px; border-inline-start: 0; padding-inline-start: 14px; }
  .tf-label { line-height: 1.25; }
  .tf-help { margin-top: 2px; }
  .tf-control { margin-top: 5px; }

  /* screen controls off, print marks on */
  .tf-s { display: none !important; }
  .tf-p { display: block; }
  .tf-pi { display: inline; color: var(--g700); font-weight: 700; }
  .tf-pline { border-bottom: 1px solid var(--line-strong); min-height: 17px; padding: 1px 2px 2px; color: var(--ink); font-weight: 600; font-size: var(--fs-td); unicode-bidi: plaintext; text-align: start; }
  .tf-pline + .tf-pline { margin-top: 2px; }
  .tf-pline--short { max-width: 150px; display: inline-block; min-width: 110px; }
  .tf-pinline { display: flex; align-items: flex-end; gap: 8px; }
  .tf-pinline .tf-unit { padding-bottom: 2px; }
  .tf-pcontact { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
  .tf-pcontact small { display: block; color: var(--muted); font-size: 7.5px; font-weight: 600; letter-spacing: var(--track-sm); text-transform: uppercase; margin-top: 2px; }
  .tf[dir="rtl"] .tf-pcontact small { text-transform: none; }
  .tf-pchecks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .tf-pcheck { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: var(--fs-td); color: var(--text); white-space: nowrap; }
  .tf-box { width: var(--check); height: var(--check); border: 1.2px solid var(--line-check); border-radius: 3px; display: inline-grid; place-items: center; flex: none; background: #fff; }
  .tf-box.is-on { background: var(--g500); border-color: var(--g500); }
  .tf-box.is-on::after { content: ""; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: translateY(-1px) rotate(45deg); }
  .tf-pcheck.is-on { color: var(--ink); font-weight: 700; }
  .tf-pscale { direction: inherit; display: inline-grid; grid-template-columns: repeat(11, 18px); gap: 3px; }
  .tf-pscale div { height: 16px; border: 1.2px solid var(--line-check); border-radius: 3px; display: grid; place-items: center; font: 600 7.5px/1 var(--f-body); color: var(--muted); }
  .tf-pscale div.is-on { background: var(--g500); border-color: var(--g500); color: #fff; }
  .tf-pscale-ends { display: flex; justify-content: space-between; width: calc(11 * 18px + 10 * 3px); font-size: 7px; color: var(--muted); margin-top: 2px; font-weight: 500; }
  .tf-pdetail { margin-top: 5px; display: flex; gap: 8px; align-items: flex-end; }
  .tf-pdetail > b { font-size: 8px; font-weight: 700; color: var(--g700); letter-spacing: var(--track-sm); text-transform: uppercase; white-space: nowrap; padding-bottom: 3px; }
  .tf[dir="rtl"] .tf-pdetail > b { text-transform: none; }
  .tf-pdetail > div { flex: 1; }

  .tf-field--group { break-inside: auto; }
  .tf-field--group .tf-q { break-after: avoid; }
  .tf-card { break-inside: auto; }
  .tf-grouprow, .tf-grouphead { break-inside: avoid; }
  .tf-grouphead { padding: 5px 12px; grid-template-columns: 150px 1fr; }
  .tf-grouprow { padding: 5px 12px; grid-template-columns: 150px 1fr; gap: 12px; }
  .tf-grouprow__label { font-size: var(--fs-td); }
  .tf-field--group { border-bottom: 0; }
  .tf-review { break-inside: avoid; }
  .tf-review > div { padding: 8px 14px; }
  .tf-review__value { min-height: 16px; }
}

/* =====================================================================
   v1.2 (2026-10-13) — new field types for the HEALTH batch and later.
   Additive only: nothing above this line changed, so v1.1 forms look
   exactly the same.
   ===================================================================== */
.tf-n { direction: ltr; unicode-bidi: isolate; }
/* a number inside an answer pill is plain text, not a second pill */
.tf-opt span span { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; font: inherit; color: inherit; gap: 0; cursor: inherit; width: auto; }
.tf-opt span span::before { content: none; display: none; }
.tf-opt input:checked + span span { background: none; border: 0; color: inherit; }

/* the client's name on every form that has no name question of its own */
.tf-clientline { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.tf-clientline__label { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-th); letter-spacing: var(--track); color: var(--g700); flex: none; }
.tf-clientline__name { font-weight: 700; color: var(--ink); font-size: var(--fs-label); min-height: 1.3em; flex: 1; unicode-bidi: plaintext; }
.tf-confirm--title { cursor: default; }

/* multiple choice: square tick instead of a dot */
.tf-opt--multi span::before { border-radius: 4px; }
.tf-opt--multi input:checked + span::before { box-shadow: none; background: var(--g500) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* read-only answers from the online intake */
.tf-field--readonly .tf-label { font-weight: 600; color: var(--text); }
.tf-readonly__val { display: inline-flex; align-items: center; min-height: 34px; padding: 0 16px; border-radius: 999px; background: var(--alt); border: 1px solid var(--line); font-weight: 700; color: var(--muted); }
.tf-readonly__val.is-yes { background: #FFF4E5; border-color: #F1C98A; color: #8A5A00; }

/* auto-calculated value */
.tf-calc { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tf-calc__val { min-width: 110px; min-height: var(--ctl-h); display: inline-flex; align-items: center; padding: 0 14px; border-radius: 10px; background: var(--tint); border: 1px dashed var(--line-strong); font-weight: 800; font-size: 17px; color: var(--g700); }
.tf-calc__note { font-size: calc(var(--fs-help) - 1px); color: var(--muted); font-weight: 500; }

/* tables: repeating rows + two-reading measurement grid */
.tf-table { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: #fff; -webkit-overflow-scrolling: touch; }
.tf-trow { display: grid; grid-template-columns: var(--cols, 1fr); align-items: center; gap: 10px; padding: 10px 14px; min-width: 480px; }
.tf-trow + .tf-trow { border-top: 1px solid var(--line); }
.tf-thead { background: var(--tint); padding-block: 9px; font-weight: 700; font-size: var(--fs-th); letter-spacing: var(--track-sm); color: var(--g700); text-transform: uppercase; }
.tf[dir="rtl"] .tf-thead { text-transform: none; }
.tf-ngrid .tf-trow { --cols: minmax(150px, 1.7fr) minmax(90px, 1fr) minmax(90px, 1fr) minmax(70px, .7fr); }
.tf-tlabel { font-weight: 700; color: var(--ink); }
.tf-thelp { display: block; font-weight: 500; font-size: calc(var(--fs-help) - 1.5px); color: var(--muted); margin-top: 2px; line-height: 1.35; }
.tf-gunit { font-weight: 600; text-transform: none; letter-spacing: 0; }
.tf-tavg { font-weight: 800; color: var(--g700); text-align: center; }
.tf-tnum { font-weight: 800; color: var(--g500); text-align: center; }
.tf-input--cell { min-height: 42px; padding: 0 10px; border-radius: 8px; }
.tf-rowadd { margin-top: 10px; font: 700 14px var(--f-body); color: var(--g700); background: var(--tint); border: 1px solid var(--line-strong); border-radius: 999px; padding: 10px 18px; cursor: pointer; }
.tf-rowdel { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--muted); font: 700 18px/1 var(--f-body); cursor: pointer; }
.tf-mini { display: flex; gap: 4px; }
.tf-mini .tf-opt span { min-height: 38px; width: 38px; padding: 0; justify-content: center; border-radius: 8px; }
.tf-mini .tf-opt span::before { display: none; }
.tf-mini .tf-opt input:checked + span { background: var(--g500); border-color: var(--g500); color: #fff; }

/* file upload (PDF or photo — the camera opens on the iPad) */
.tf-upload { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 14px; background: var(--soft); }
.tf-upload__btn { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--g900); color: #fff; font-weight: 700; cursor: pointer; }
.tf-upload__btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tf-upload__list { list-style: none; margin: 10px 0 0; padding: 0; }
.tf-upload__list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.tf-upload__list li:first-child { border-top: 0; }
.tf-upload__name { unicode-bidi: plaintext; overflow-wrap: anywhere; }
.tf-upload__none { color: var(--muted) !important; font-weight: 500 !important; }

/* finger signature */
.tf-sign { margin-top: 12px; display: grid; gap: 10px; }
.tf-sign__pad { position: relative; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; height: 140px; overflow: hidden; }
.tf-sign__pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.tf-sign__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tf-sign__hint { position: absolute; inset-inline-start: 16px; bottom: 14px; color: #A9BEB7; font-weight: 600; pointer-events: none; }
.tf-sign__pad::after { content: ""; position: absolute; inset-inline: 16px; bottom: 40px; border-bottom: 1px solid var(--line); pointer-events: none; }
.tf-sign__clear { position: absolute; inset-inline-end: 10px; top: 10px; z-index: 2; font: 700 13px var(--f-body); color: var(--muted); background: #fff; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.tf-sign__meta { display: grid; grid-template-columns: 1.4fr 220px; gap: 10px; }
.tf-field--confirm .tf-sign__meta .tf-input--num { max-width: none; }

/* a whole section that only applies sometimes */
.tf-section[hidden] { display: none; }
.tf-seccond { color: var(--g700); font-weight: 700; }
@media screen { .tf-cond-off { display: none !important; } }

@media (max-width: 720px) {
  .tf-sign__meta { grid-template-columns: 1fr; }
  .tf-trow { gap: 8px; padding: 9px 10px; }
  .tf-mini .tf-opt span { width: 34px; min-height: 34px; }
}

@media print {
  .tf-table { border-radius: 8px; overflow: visible; }
  .tf-trow { padding: 3px 10px; gap: 8px; min-width: 0; break-inside: avoid; }
  .tf-thead { padding-block: 4px; font-size: 7.5px; }
  .tf-tlabel { font-size: var(--fs-td); }
  .tf-thelp { font-size: 7px; margin-top: 0; }
  .tf-ngrid .tf-trow { --cols: 1.9fr 1fr 1fr .7fr; }
  .tf-table .tf-pline { min-height: 15px; }
  .tf-tavg, .tf-tnum { font-size: var(--fs-td); }
  .tf-pscale--mini { grid-template-columns: repeat(5, 16px); }
  .tf-pscale--mini div { height: 14px; }
  .tf-pupload { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-td); color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 6px; padding: 6px 10px; }
  .tf-pupload.is-on { color: var(--ink); }
  .tf-pcalc { background: var(--tint); }
  .tf-pauto { font-size: 7.5px; color: var(--muted); font-weight: 600; }
  .tf-psign { display: grid; grid-template-columns: 1.3fr 1fr 110px; gap: 16px; margin-top: 10px; }
  .tf-psign small { display: block; color: var(--muted); font-size: 7.5px; font-weight: 600; letter-spacing: var(--track-sm); text-transform: uppercase; margin-top: 2px; }
  .tf[dir="rtl"] .tf-psign small { text-transform: none; }
  .tf-psign__line { height: 30px; border-bottom: 1px solid var(--line-strong); position: relative; }
  .tf-psign__line img { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: contain; object-position: left bottom; }
  .tf[dir="rtl"] .tf-psign__line img { object-position: right bottom; }
  .tf-field--readonly .tf-label { font-weight: 600; }
  .tf-seccond { margin: -2px 0 6px; font-size: var(--fs-help); }
  .tf-table { break-inside: avoid; }
  .tf-clientline { margin-bottom: 10px; padding-bottom: 3px; }
  .tf-clientline__name { font-size: var(--fs-td); }
  .tf-section[hidden] { display: none; }
}

/* ---------- v1.2.1 (13 Oct 2026, Health-batch review) ---------- */
/* Arabic reading aid under an official English question (PAR-Q+) */
.tf-aid { display: block; margin-top: 4px; font-family: "TF Plex Arabic", var(--f-body); font-weight: 500; font-size: calc(var(--fs-help) - 1px); color: var(--muted); line-height: 1.45; text-align: start; }
.tf-aid b { font-weight: 700; color: var(--g700); font-size: .86em; margin-inline-end: 4px; }
/* an answer that adds another form (female → Women's Health) */
.tf-adds:empty { display: none; }
.tf-adds p { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; line-height: 1.35; }
.tf-adds p > span { flex: 1 1 150px; min-width: 0; }
.tf-adds__on { background: var(--tint); border: 1px solid var(--g500); color: var(--g700); }
.tf-adds__on::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--g500); color: #fff; font-size: 13px; flex: none; }
.tf-adds__coach { background: var(--soft); border: 1px dashed var(--line-strong); color: var(--text); }
.tf-adds__print { display: none !important; }
.tf-adds__btn { font: 700 14px var(--f-body); color: #fff; background: var(--g900); border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.tf-adds__btn--quiet { color: var(--g700); background: #fff; border: 1px solid var(--line-strong); padding: 6px 12px; font-size: 13px; }
/* the simple measurement set (Foundation) — the coach can open everything */
.tf-simplebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--sec-gap); padding: 14px 18px; border-radius: 10px; background: var(--tint); border: 1px solid var(--line-strong); }
.tf-simplebar p { margin: 0; font-weight: 700; color: var(--g700); flex: 1 1 260px; }
.tf-simple-off { display: none !important; }

/* phones: tables become stacked cards; every cell keeps its column name */
@media screen and (max-width: 600px) {
  .tf-trow { min-width: 0; }
  .tf-rows--multi .tf-thead, .tf-ngrid .tf-thead { display: none; }
  .tf-rows--multi .tf-trow { display: block; position: relative; padding: 12px 14px; }
  .tf-rows--multi .tf-trow > div + div { margin-top: 8px; }
  .tf-rows--multi .tf-tnum { display: flex; align-items: center; min-height: 30px; text-align: start; direction: inherit; }   /* the row number sits at the top start of its card; the remove button keeps the top end */
  .tf-rows--multi .tf-tnum + div[data-label] { padding-inline-end: 0; }
  .tf-rows--multi .tf-tdel { position: absolute; inset-inline-end: 10px; top: 8px; margin: 0 !important; }
  .tf-rows--multi .tf-trow > div[data-label]::before, .tf-ngrid .tf-trow > div[data-label]::before { content: attr(data-label); display: block; font-weight: 700; font-size: 12px; color: var(--g700); margin-bottom: 4px; }
  .tf-rows--multi .tf-trow > div[data-label]:first-of-type { padding-inline-end: 44px; }
  .tf-ngrid .tf-trow { grid-template-columns: 1fr 1fr .8fr; }
  .tf-ngrid .tf-tlabel { grid-column: 1 / -1; }
  .tf-ngrid .tf-tavg { text-align: start; align-self: end; padding-bottom: 10px; }
  .tf-adds p, .tf-simplebar { font-size: 14px; }
}
@media screen and (max-width: 420px) {   /* long one-word section titles (e.g. CIRCUMFERENCES) must not push the page sideways */
  .tf { --fs-section: 15.5px; }
  .tf-sechead { gap: 10px; }
  .tf-sechead__title { min-width: 0; overflow-wrap: anywhere; letter-spacing: .1em; }
  .tf[dir="rtl"] .tf-sechead__title { letter-spacing: 0; }
  .tf-sechead__rule { min-width: 8px; }
}
@media print {
  .tf-adds__on, .tf-adds__coach { display: none !important; }
  .tf-adds__print { display: block !important; margin: 4px 0 0 !important; padding: 0 !important; font-weight: 600 !important; font-size: var(--fs-help); color: var(--g700); }
  .tf-adds__btn, .tf-simplebar button { display: none !important; }
  .tf-simplebar { padding: 6px 12px; margin-bottom: 10px; }
  .tf-aid { font-size: 8px; margin-top: 1px; }
  .tf-section--review { break-inside: avoid; }
  .tf.tf--compact { --sec-gap: 11px; --field-gap: 6px; }
  /* the coach's strip keeps its title inside the box in print (one row less, so the form stays on its pages) */
  .tf-section--review .tf-sechead { display: none; }
  .tf-section--review .tf-review::before { content: attr(data-title); grid-column: 1 / -1; padding: 6px 14px 0; font-family: var(--f-display); font-weight: 800; font-size: var(--fs-th); letter-spacing: var(--track); color: var(--ink); }
  .tf[dir="rtl"] .tf-section--review .tf-review::before { letter-spacing: 0; }
}

/* ---------- v1.2.2 (2026-10-14) ---------- */
/* section counter: screen and print may count differently on a blank form */
.tf-onprint { display: none; }
@media print { .tf-onscreen { display: none !important; } .tf-onprint { display: inline; } }
/* phone: a 0–10 scale wraps into two rows (0–5 / 6–10), each button at least 40 px wide and 44 px tall; iPad and print unchanged */
@media screen and (max-width: 480px) {
  .tf-scale--wrap { grid-template-columns: repeat(var(--tf-half, 6), minmax(40px, 1fr)); gap: 6px; max-width: 420px; }
  .tf-scale--wrap .tf-opt span { min-height: 44px; font-size: 15px; border-radius: 10px; }
}

/* ---------- v1.2.3 (2026-10-14, nutrition batch) ---------- */
.tf-q--hidden { display: none !important; }
.tf-weekday { margin-inline-start: 12px; font-weight: 700; color: var(--g700); font-size: var(--fs-help); }
/* own words under a question (stored as "<code>.text") */
.tf-own { margin-top: 12px; display: grid; gap: 6px; }
.tf-own__label { font-weight: 600; font-size: var(--fs-help); color: var(--muted); }
/* labelled fixed rows and the worksheet's example row */
.tf-trowlabel { font-weight: 700; color: var(--ink); }
.tf-texample { color: var(--muted); font-style: italic; background: var(--soft); }
.tf[dir="rtl"] .tf-texample { font-style: normal; }
.tf-texample__tag { font-style: normal; font-weight: 700; color: var(--g700); font-size: calc(var(--fs-help) - 2px); text-transform: uppercase; letter-spacing: var(--track-sm); }
.tf[dir="rtl"] .tf-texample__tag { text-transform: none; letter-spacing: 0; }
/* worked-out parts (e.g. day totals) */
.tf-calc--parts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.tf-cpart { display: grid; gap: 4px; }
.tf-cpart__label { font-weight: 700; font-size: var(--fs-help); color: var(--g700); }
.tf-cpart .tf-pinline { display: flex; align-items: center; gap: 6px; }
.tf-cpart .tf-calc__val { min-width: 84px; }
/* lists in three columns (grocery list) */
.tf-grid--c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf-grid--c3 > .tf-field { grid-column: auto; }
.tf-grid--c3 > .tf-field--spanall { grid-column: 1 / -1; }
.tf-grid--c3 .tf-trow { min-width: 0; }
@media (max-width: 720px) { .tf-grid--c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tf-grid--c3 { grid-template-columns: 1fr; } }
/* food frequency — screen: tick the foods you had; how often + portion open under it */
.tf-fgrid--screen .tf-frow { display: block; min-width: 0; padding: 6px 14px; }
.tf-ftick { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--ink); font-size: var(--fs-body); }
.tf-ftick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tf-ftick__box { width: 24px; height: 24px; border: 1.5px solid var(--line-check); border-radius: 6px; flex: none; display: grid; place-items: center; background: #fff; transition: all .15s; }
.tf-ftick input:checked + .tf-ftick__box { background: var(--g500); border-color: var(--g500); }
.tf-ftick input:checked + .tf-ftick__box::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: translateY(-1px) rotate(45deg); }
.tf-ftick input:focus-visible + .tf-ftick__box { box-shadow: 0 0 0 3px rgba(0,166,123,.25); }
.tf-fmore { display: none; flex-wrap: wrap; gap: 10px 26px; margin: 4px 0 10px; padding-inline-start: 36px; }
.tf-frow.is-had .tf-fmore { display: flex; }
.tf-fopts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tf-fopts__label { flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--g700); letter-spacing: var(--track-sm); text-transform: uppercase; }
.tf[dir="rtl"] .tf-fopts__label { text-transform: none; letter-spacing: 0; }
.tf-opt--f span { min-height: 40px; padding: 0 14px; font-size: 14px; }
.tf-opt--f span::before { display: none; }
.tf-opt--f input:checked + span { background: var(--g500); border-color: var(--g500); color: #fff; }
@media (max-width: 480px) { .tf-fmore { padding-inline-start: 0; } }
@media screen and (max-width: 600px) { .tf-rows--multi .tf-trow.tf-thead { display: none; } }   /* phone cards: each cell carries its own column name */
@media print {
  .tf-own { display: none; }
  .tf-pown { margin-top: 4px; } .tf-pown small { display: block; font-size: 7.5px; color: var(--muted); font-weight: 600; }
  .tf-pdate { display: flex; align-items: flex-end; gap: 8px; }
  .tf-texample { font-size: var(--fs-td); }
  .tf-rows--bullets .tf-trow > div:first-child { display: flex; align-items: flex-end; padding-bottom: 2px; }
  .tf-rows--bullets .tf-box { width: 9px; height: 9px; border-radius: 50%; }
  .tf-rows--bullets .tf-pline { line-height: 1.15; }   /* a written item keeps the line height of a blank one */
  .tf-grid--c3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; }
  .tf-grid--c3 .tf-field { border-bottom: 0; padding: 0; }
  .tf-pparts { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: flex-end; }
  .tf-pparts .tf-cpart { display: flex; align-items: flex-end; gap: 6px; }
  .tf-pparts .tf-cpart__label { font-size: var(--fs-td); font-weight: 600; color: var(--text); }
  .tf-pparts .tf-pline--short { min-width: 60px; max-width: 80px; }
  /* food frequency on paper: the worksheet's table */
  .tf-fgrid { break-inside: auto; }
  .tf-fgrid .tf-trow { grid-template-columns: minmax(0, 1fr) 34px repeat(var(--nf), 66px) repeat(var(--np), 46px); gap: 0 4px; padding: 1.6px 10px; break-inside: avoid; }
  .tf-fgrid .tf-thead { padding-block: 2px; }
  .tf-fhead > div:not(:first-child), .tf-fsub > div { text-align: center; }
  .tf-fhead__grp { border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; }
  .tf-fsub { font-size: 7px; letter-spacing: .04em; }
  .tf-fgrid .tf-tlabel { font-weight: 500; font-size: 8.6px; line-height: 1.25; }
  .tf-fcell { display: flex; justify-content: center; }
  .tf-fcell .tf-box { width: 9px; height: 9px; }
  .tf-fgrid .tf-frow:nth-child(even) { background: var(--soft); }
}
/* worked-out answer: which body weight was used, or a warning */
.tf-calcnote__wrap { flex-basis: 100%; }
.tf-calcnote { display: block; font-size: calc(var(--fs-help) - 1px); font-weight: 600; color: var(--g700); }
.tf-calcnote.is-warn { color: #9A3412; }
@media print {
  .tf-calcnote { font-size: 7.5px; margin-top: 2px; }
  .tf-fgrid { break-inside: avoid; }   /* a food group never splits, so every table keeps its column headings */
  .tf-section:has(.tf-fgrid) .tf-sechead { break-after: avoid; }
}

/* ---------- v1.2.4 (2026-10-14, nutrition review) ---------- */
/* the original English wording under an Arabic question */
.tf-orig { display: block; margin-top: 3px; font-family: var(--f-body); font-weight: 500; font-size: calc(var(--fs-help) - 1px); line-height: 1.4; color: var(--muted); unicode-bidi: isolate; }
.tf[dir="rtl"] .tf-orig { text-align: right; }
/* an answer that differs from the website intake (screen only) */
.tf-sitechg { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; color: #9A3412; background: #FFF4EC; border: 1px solid #F6D3BC; border-radius: 999px; padding: 2px 10px; }
.tf-sitechg[hidden] { display: none; }
/* repeatable forms: the list of days / weeks */
.tf-entries { margin-bottom: var(--sec-gap); padding: 14px 18px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--tint); }
.tf-entries__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tf-entries__title { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-th); letter-spacing: var(--track); color: var(--g700); }
.tf[dir="rtl"] .tf-entries__title { letter-spacing: 0; }
.tf-entries__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tf-entry { font: 600 14px/1 var(--f-body); color: var(--g700); background: #fff; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 14px; min-height: 40px; display: inline-flex; align-items: center; cursor: pointer; }
.tf-entry.is-on { background: var(--g500); border-color: var(--g500); color: #fff; }
.tf-entries__dup { margin: 10px 0 0; font-weight: 700; color: #9A3412; }
/* estimated needs (under the calories of the nutrition program) */
.tf-helper { margin-top: 12px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--soft); }
.tf-helper__title { font-weight: 800; font-size: var(--fs-help); color: var(--g700); }
.tf-helper__result { margin: 4px 0 2px; font-weight: 800; font-size: 18px; color: var(--ink); }
.tf-helper__formula { margin: 2px 0; font: 600 13px/1.4 ui-monospace, Menlo, monospace; color: var(--text); text-align: left; }
.tf-helper__line { margin: 2px 0; font-size: calc(var(--fs-help) - 1px); color: var(--text); }
.tf-helper__muted { color: var(--muted); }
.tf-helper.tf-p { display: none; }
@media print {
  .tf-orig { font-size: 7.5px; margin-top: 1px; }
  .tf-sitechg, .tf-entries { display: none !important; }
  .tf-helper.tf-s { display: none !important; }
  .tf-helper.tf-p { display: block; margin-top: 4px; padding: 2px 8px; border-radius: 6px; line-height: 1.3; }
  .tf-helper__title { font-size: 8px; } .tf-helper__result { font-size: 10px; margin: 1px 0; } .tf-helper__formula { font-size: 8px; } .tf-helper__line { font-size: 7.5px; margin: 0; }
  .tf-helper.tf-p .tf-helper__title, .tf-helper.tf-p .tf-helper__result { display: inline; margin: 0 8px 0 0; }
  .tf-helper.tf-p .tf-helper__note, .tf-helper.tf-p .tf-helper__used { display: none; }   /* on paper: the estimate and its sum (the sum shows every value used) */
  .tf-phelp { display: flex; align-items: flex-start; gap: 14px; }
  .tf-phelp__main { flex: 0 0 auto; }
  .tf-phelp > .tf-helper.tf-p { flex: 1 1 auto; margin-top: 0; min-width: 0; }   /* the coach's own number is right above it on paper */
}

/* ---------- v1.2.5 (2026-10-14, after the Health + Nutrition approval) ---------- */
/* a number taken from the Health History that the coach has not measured yet */
.tf-input.is-reported { color: var(--muted); font-style: italic; }
.tf-mconfirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; font-size: calc(var(--fs-help) - 1px); color: #9A3412; }
.tf-mconfirm[hidden] { display: none; }
@media print {
  .tf-mconfirm { display: none !important; }
  .tf-preported { color: var(--muted); font-style: italic; }
  .tf-pnote { font-size: 7.5px; color: var(--muted); margin-inline-start: 6px; }
}

/* ---------- v1.2.6 (2026-10-14, Training batch) ---------- */
/* yes / no per observation (posture checks): one column, or one per side */
.tf-yng { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.tf-yng__row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--yn), 168px); gap: 6px 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }   /* fixed columns: every heading sits over its own Yes / No pair */
.tf-yng--note .tf-yng__row { grid-template-columns: minmax(0, 1fr) repeat(var(--yn), 168px) minmax(0, 1fr); }
.tf-yng__row:first-child { border-top: 0; }
.tf-yng__head { padding-top: 8px; padding-bottom: 8px; background: var(--soft); font-family: var(--f-display); font-weight: 800; font-size: var(--fs-th); letter-spacing: var(--track); color: var(--g700); text-transform: uppercase; }
.tf[dir="rtl"] .tf-yng__head { letter-spacing: 0; }
.tf-yng__head > div:not(:first-child) { text-align: center; }
.tf-yng__label { font-weight: 600; color: var(--ink); }
.tf-options--yn { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: center; }
.tf-options--yn .tf-opt span { padding: 0 14px; }
@media screen and (max-width: 600px) {
  .tf-yng__row, .tf-yng--note .tf-yng__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }   /* the sides stay next to each other while they fit */
  .tf-yng__label, .tf-yng__note { flex: 1 1 100%; min-width: 0; }
  .tf-yng__note .tf-input { width: 100%; box-sizing: border-box; }
  .tf-yng .tf-yng__head { display: none; }
  .tf-options--yn { gap: 6px; }
  .tf-options--yn .tf-opt span { padding: 0 12px; gap: 8px; }
  .tf-yng__head { display: none; }
  .tf-yng__cell[data-label]::before, .tf-yng__note[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: calc(var(--fs-help) - 1px); font-weight: 700; color: var(--muted); }
  .tf-options--yn { justify-content: flex-start; }
}
/* tick boxes: phases × months, or plan × days of the week */
.tf-tick { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.tf-tick + .tf-tick { margin-top: 10px; }
.tf-tick__title { padding: 8px 14px; background: var(--g700); color: #fff; font-family: var(--f-display); font-weight: 800; font-size: var(--fs-th); letter-spacing: var(--track); text-transform: uppercase; }
.tf[dir="rtl"] .tf-tick__title { letter-spacing: 0; }
.tf-tick__row { display: grid; grid-template-columns: minmax(84px, 1.6fr) repeat(var(--tc), minmax(0, 1fr)); align-items: center; border-top: 1px solid var(--line); }
.tf-tick__row:first-child, .tf-tick__title + .tf-tick__row { border-top: 0; }
.tf-tick__head { background: var(--soft); font-weight: 700; font-size: calc(var(--fs-help) - 1px); color: var(--g700); text-align: center; }
.tf-tick__head > div, .tf-tick__groups > div { padding: 6px 2px; }
.tf-tick__label { padding: 6px 10px; font-weight: 600; font-size: var(--fs-help); color: var(--ink); overflow-wrap: anywhere; hyphens: auto; min-width: 0; }
.tf-tick__cell { display: flex; justify-content: center; border-inline-start: 1px solid var(--line); }
.tf-tick__cell label { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; cursor: pointer; }
.tf-tick__cell input { width: 18px; height: 18px; accent-color: var(--g500); margin: 0; }
/* an answer from another form, shown for reference */
.tf-ref { padding: 10px 14px; border-radius: 10px; background: var(--soft); border: 1px dashed var(--line-strong); }
.tf-ref__val { font-weight: 600; color: var(--ink); white-space: pre-wrap; unicode-bidi: plaintext; }   /* an English answer keeps its full stop at the end in an Arabic form */
.tf-ref.is-empty .tf-ref__val { color: var(--muted); font-weight: 500; }
.tf-ref__from { margin-top: 2px; font-size: calc(var(--fs-help) - 1px); color: var(--muted); }
/* the phase guide beside the session rows */
.tf-guide { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.tf-guide__title { padding: 8px 14px; background: var(--g700); color: #fff; font-weight: 800; font-size: var(--fs-help); }
.tf-guide__row { display: grid; grid-template-columns: minmax(120px, 0.9fr) minmax(0, 3fr); gap: 4px 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: var(--fs-help); }
.tf-guide__title + .tf-guide__row { border-top: 0; }
.tf-guide__part { font-weight: 800; color: var(--g700); }
.tf-guide__text { color: var(--text); }
.tf-guide__empty { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: var(--fs-help); }
@media screen and (max-width: 600px) { .tf-guide__row { grid-template-columns: 1fr; } }
/* a worked-out column inside a table row (estimated one-rep max) */
.tf-rowcalc { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; background: var(--soft); font-weight: 800; color: var(--g700); }
.tf-options--multi.is-suggested .tf-opt input:checked + span { border-style: dashed; }
@media print {
  .tf-yng, .tf-tick, .tf-guide { border-radius: 6px; }
  .tf-yng__row { padding: 3px 8px; gap: 2px 10px; grid-template-columns: minmax(0, 1fr) repeat(var(--yn), 74px); }
  .tf-yng--note .tf-yng__row { grid-template-columns: minmax(0, 1fr) repeat(var(--yn), 74px) minmax(0, 1fr); }
  .tf-yng__head { padding: 3px 8px; font-size: 7px; }
  .tf-yng__label { font-size: 8.5px; }
  .tf-yng .tf-pchecks { justify-content: center; flex-wrap: nowrap; gap: 2px 10px; }
  .tf-yng__note .tf-pline { min-height: 12px; }
  .tf-tick__row { grid-template-columns: minmax(70px, 1.5fr) repeat(var(--tc), minmax(0, 1fr)); }
  .tf-tick__head, .tf-tick__groups { font-size: 6.5px; }
  .tf-tick__head > div, .tf-tick__groups > div { padding: 2px 0; }
  .tf-tick__groups { background: var(--g700); color: #fff; font-weight: 800; text-align: center; }
  .tf-tick__groups > div:not(:first-child) { border-inline-start: 1px solid rgba(255,255,255,.3); }
  .tf-tick__label { padding: 2px 6px; font-size: 7.5px; }
  .tf-tick__cell { padding: 2px 0; }
  .tf-tick__cell .tf-box { margin: 0; }
  .tf-ref { padding: 3px 8px; border-radius: 6px; }
  .tf-ref__val { font-size: 8.5px; } .tf-ref__from { font-size: 7px; }
  .tf-guide__title { padding: 3px 8px; font-size: 8px; }
  .tf-guide__row { padding: 2px 8px; font-size: 7.5px; grid-template-columns: minmax(90px, 0.9fr) minmax(0, 3fr); }
  .tf-guide__empty { padding: 3px 8px; font-size: 7.5px; }
  .tf-pnote--block { display: block; margin: 0 0 2px; }
  .tf-field:has(> .tf-control > .tf-yng), .tf-field:has(> .tf-control > .tf-tick) { break-inside: avoid; }   /* a small table stays with its question */
  .tf-field--lineinline .tf-ref { padding: 2px 8px; border-style: solid; border-color: var(--line); }
  .tf-ref__from--p { font-size: 6.5px; margin-top: 1px; }
}

/* ---------- v1.2.7 (2026-10-14, Training batch review) ---------- */
@media print {
  .tf-secnote { break-after: avoid; }   /* a section's note never ends a page alone */
  .tf-sechead { break-after: avoid; }
  .tf-noprint { display: none !important; }
}

/* ---------- v1.2.8 (2026-10-14, Training review: norms, links, re-measurements) ---------- */
.tf-select { -webkit-appearance: none; appearance: none; max-width: 100%; padding-inline-end: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--g700) 50%), linear-gradient(135deg, var(--g700) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 16px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.tf[dir="rtl"] .tf-select { background-position: 16px 50%, 21px 50%; }
.tf-fillfrom { margin-top: 10px; }
.tf-fillfrom[hidden] { display: none; }
.tf-prevnote { margin: 0 0 8px; }
.tf-ngrid .tf-input--cell::placeholder { color: #9AA8A3; opacity: 1; }
@media print {
  .tf-prevnote { display: none; }
}

/* ---------- v1.3.0 (2026-10-14, engine-inputs round F1b) ---------- */
/* checklist: tick an item, its details open under it (type, status, year …); "all": every item shows its details */
.tf-chk { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.tf-chk__row { padding: 4px 14px; border-top: 1px solid var(--line); min-width: 0; }
.tf-chk__row:first-child { border-top: 0; }
.tf-chk__head { display: flex; align-items: center; min-height: 40px; }
.tf-chk__label { font-weight: 700; color: var(--ink); }
.tf-chk__more { display: none; flex-wrap: wrap; gap: 10px 22px; margin: 2px 0 10px; padding-inline-start: 36px; }
.tf-chk__row.is-on .tf-chk__more, .tf-chk--all .tf-chk__more { display: flex; }
.tf-chk--all .tf-chk__more { padding-inline-start: 0; margin-top: 0; }
.tf-chk__det { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.tf-chk__det--line .tf-input--cell { width: 130px; max-width: 100%; }
.tf-chk__det--text { flex: 1 1 320px; } .tf-chk__det--line .tf-input--cell[type="text"] { width: 100%; }
.tf-chk__det .tf-unit { font-size: var(--fs-help); color: var(--muted); font-weight: 600; }
@media (max-width: 480px) { .tf-chk__more { padding-inline-start: 0; } .tf-chk__det--line .tf-input--cell[type="text"] { width: 100%; } }
/* a fixed text (the referral wording) */
.tf-textblock { padding: 12px 16px; border-radius: 10px; background: var(--tint); border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--g500); }
.tf-textblock p { margin: 0; color: var(--ink); font-weight: 500; }
.tf-textblock p + p { margin-top: 8px; }
.tf-textblock p.tf-strong { font-weight: 800; }
.tf-textblock--stop { background: #FFF4F0; border-color: #F3C4B5; border-inline-start-color: #B42318; }
/* a worked-out flag */
.tf-flag { display: inline-flex; align-items: center; gap: 10px; min-height: var(--ctl-h); padding: 8px 16px; border-radius: 10px; font-weight: 800; line-height: 1.3; }
.tf-flag__icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; color: #fff; font-size: 13px; }
.tf-flag--stop { background: #FDECEA; border: 1px solid #F1B5AD; color: #8F1D12; } .tf-flag--stop .tf-flag__icon { background: #B42318; }
.tf-flag--warn { background: #FFF4E5; border: 1px solid #F1C98A; color: #8A5A00; } .tf-flag--warn .tf-flag__icon { background: #C77700; }
.tf-flag--ok { background: var(--tint); border: 1px solid var(--g500); color: var(--g700); } .tf-flag--ok .tf-flag__icon { background: var(--g500); }
.tf-flag--none { background: var(--soft); border: 1px dashed var(--line-strong); color: var(--muted); font-weight: 600; gap: 12px; flex-wrap: wrap; }
.tf-flagwrap + .tf-calcnote__wrap { display: block; margin-top: 6px; }
/* a coach-only form */
.tf-private { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; padding: 10px 16px; border-radius: 10px; background: #FDECEA; border: 1px solid #F1B5AD; color: #8F1D12; font-weight: 800; }
.tf-private__icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #B42318; color: #fff; font-size: 13px; flex: none; }
/* a file in a table row */
.tf-cellfile { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.tf-upload__btn--cell { min-height: 40px; padding: 0 14px; font-size: 13px; }
.tf-cellfile__name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); font-size: 13px; unicode-bidi: plaintext; }
/* a fixed list inside a table cell: a smaller caret, more room for the text */
.tf-input--cell.tf-select { padding-inline-end: 26px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; text-overflow: ellipsis; }
.tf[dir="rtl"] .tf-input--cell.tf-select { background-position: 10px 50%, 15px 50%; }
/* a wide table on an iPad: two lines per row, each cell with its column name */
@media screen and (min-width: 601px) and (max-width: 1024px) {
  .tf-rows--wrap .tf-thead { display: none; }
  .tf-rows--wrap .tf-trow { grid-template-columns: repeat(var(--wrap), minmax(0, 1fr)); position: relative; padding-inline-end: 58px; align-items: end; min-width: 0; }
  .tf-rows--wrap .tf-trow > div[data-label]::before { content: attr(data-label); display: block; font-weight: 700; font-size: 12px; color: var(--g700); margin-bottom: 4px; }
  .tf-rows--wrap .tf-tdel { position: absolute; inset-inline-end: 12px; top: 12px; }
}
/* meal plan: day totals against the targets */
.tf-ctable .tf-trow { --cols: minmax(90px, 1.2fr) repeat(var(--cc), minmax(70px, 1fr)); min-width: 420px; }
.tf-ctable .tf-trow > div:not(:first-child) { text-align: center; }
.tf-ctarget { background: var(--soft); color: var(--g700); font-weight: 800; }
.tf-ctable b { font-weight: 800; color: var(--ink); }
.tf-cdiff { display: block; font-size: calc(var(--fs-help) - 2px); font-weight: 700; color: var(--muted); }
.tf-cdiff.is-off { color: #9A3412; }
@media screen and (max-width: 600px) {
  .tf-ctable .tf-trow { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-ctable .tf-thead { display: none; }
  .tf-ctable .tf-trow > div:first-child { grid-column: 1 / -1; }
  .tf-ctable .tf-trow > div[data-label] { text-align: start; }
  .tf-ctable .tf-trow > div[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: var(--g700); }
}
@media print {
  .tf-chk { border-radius: 6px; }
  .tf-chk__row { padding: 2px 8px; break-inside: avoid; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
  .tf-chk__head { min-height: 0; flex: 0 0 34%; min-width: 0; }
  .tf-chk--all .tf-chk__head { flex-basis: 34%; }
  .tf-chk__head .tf-pcheck { white-space: normal; font-weight: 600; font-size: 8.5px; }
  .tf-chk__label { font-size: 8.5px; font-weight: 700; }
  .tf-chk__more, .tf-chk--all .tf-chk__more { display: flex; flex: 1 1 60%; margin: 0; padding: 0; gap: 2px 14px; min-width: 0; }
  .tf-chk__det { gap: 2px 8px; flex-wrap: nowrap; }
  .tf-chk__det .tf-fopts__label { flex-basis: auto; font-size: 6.8px; white-space: nowrap; }
  .tf-chk__det .tf-pchecks { flex-wrap: wrap; gap: 2px 8px; }
  .tf-chk__det .tf-pcheck { font-size: 8px; }
  .tf-chk__det .tf-pcheck .tf-box, .tf-chk__head .tf-box { width: 9px; height: 9px; }
  .tf-chk__det .tf-pline--short { min-width: 54px; max-width: 120px; min-height: 13px; font-size: 8.5px; }
  .tf-chk__det .tf-unit { font-size: 7px; }
  .tf-textblock { padding: 5px 10px; border-radius: 6px; }
  .tf-textblock p { font-size: 8.5px; } .tf-textblock p + p { margin-top: 3px; }
  .tf-pflag .tf-pcheck { white-space: normal; }
  .tf-pflag .tf-pcheck.is-on { padding: 1px 6px; border-radius: 4px; }
  .tf-pflag--stop { background: #FDECEA; color: #8F1D12 !important; } .tf-pflag--warn { background: #FFF4E5; color: #8A5A00 !important; } .tf-pflag--ok { background: var(--tint); }
  .tf-private { margin-bottom: 10px; padding: 4px 10px; border-radius: 6px; font-size: 8.5px; }
  .tf-private__icon { width: 12px; height: 12px; font-size: 7px; }
  .tf-plegend { margin: 3px 0 0; font-size: 7px; color: var(--muted); line-height: 1.35; }
  .tf-plegend b { color: var(--g700); font-weight: 700; }
  .tf-plegend__sep { display: inline-block; width: 12px; }
  .tf-pcellfile { display: flex; align-items: center; gap: 4px; font-size: 7.5px; }
  .tf-pcellfile .tf-box { width: 9px; height: 9px; }
  .tf-ctable .tf-trow { min-width: 0; }
  .tf-ctable .tf-thead { font-size: 7px; }
  .tf-ctable .tf-trow > div { font-size: 8.5px; }
  .tf-cdiff { font-size: 6.8px; }
}
@media print {
  /* a new table with its legend, and a checklist: the question stays with them on one page */
  .tf-field:has(.tf-plegend), .tf-field:has(> .tf-control > .tf-chk) { break-inside: avoid; }
  .tf-sechead { break-inside: avoid; }   /* a section heading is never sliced at the end of a page */
  .tf-seccond { break-after: avoid; }    /* "only if …" stays with the section's first question */
}
