/* =====================================================================
   FREE TOOLS
   Layout only — every colour, radius and type face comes from
   tokens-10.css so the tools read in the same language as the app.
   ===================================================================== */

/* The `hidden` ATTRIBUTE is only a UA-stylesheet display:none, so ANY
   author display rule outranks it. Both unit toggles on these pages were
   defeated exactly that way — .plate-opt{display:inline-flex} left the kg
   plates on screen next to the lb ones, and .fieldrow{display:grid} would
   have done the same to the imperial height row. Keep this rule above
   every layout rule below it. */
[hidden] { display: none !important; }

.tool-head {
  padding: var(--s-xxl) 0 var(--s-sm);
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--s-xl);
}
/* ⚠️ THE DISPLAY REGISTER, STATED. Nothing in tokens-10.css styles a
   bare <h1>, so these five pages' titles were rendering in the SYSTEM
   face at the browser's default size and in body grey — the only
   headings on the site outside the Barlow register, on the four pages
   organic search lands on. Same face, weight and colour as `.doc h1`. */
.tool-head h1 {
  margin: var(--s-xs) 0 var(--s-sm);
  /* 24ch, not 18: "One-rep max calculator" is 22 characters and broke
     mid-phrase at desktop widths where it plainly fits. */
  max-width: 24ch;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.2px;
  color: var(--t1);
}
.tool-head .lede { margin: 0; max-width: 52ch; }

/* Form left, live result right; stacked on phones. */
.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--s-xxl);
  align-items: start;
  padding-bottom: var(--s-xxl);
}
@media (max-width: 820px) {
  .tool-layout { grid-template-columns: 1fr; gap: var(--s-xl); }
}

.tool-form { display: grid; gap: var(--s-lg); }
.tool-form label {
  display: block;
  margin-bottom: var(--s-xs);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t3);
}
.fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-md); }
.fieldrow.thirds { grid-template-columns: 1fr 1fr 1fr; }
.fieldrow > div { min-width: 0; }

/* The result is an ENTRY, not a panel: no fill, no border, no radius.
   On the stacked layout a rule separates it from the form; beside the
   form it needs no separator at all (LEDGER_SPEC §5). */
.tool-out {
  /* A div's padding is 0 by default, so the `padding: 0` that used to
     sit here said nothing — and this file loads after styles-12.css,
     where the callouts inside this column get their tick lane, so a
     shorthand reset at equal specificity is a trap waiting for the next
     person. Left out deliberately. */
  min-height: 200px;
}
@media (max-width: 820px) {
  .tool-out {
    border-top: 1px solid var(--border-sub);
    padding-top: var(--s-lg);
  }
}
.tool-out > .cap:only-child { color: var(--t3); }

/* The headline number, in the measurement face. */
.tool-figure {
  display: flex;
  align-items: baseline;
  gap: var(--s-sm);
  margin: var(--s-xxs) 0 var(--s-md);
  flex-wrap: wrap;
}
.tool-figure-n {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 56px;
  line-height: 1;
  color: var(--t1);
  letter-spacing: -0.5px;
}
@media (max-width: 480px) {
  .tool-figure-n { font-size: 44px; }
}

.tool-subhead {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t3);
  margin: var(--s-xl) 0 var(--s-sm);
  padding-top: var(--s-md);
  border-top: 1px solid var(--border-sub);
}
.tool-out > .tool-subhead:first-of-type { }

.tool-caveat { color: var(--t3); margin-top: var(--s-md); }

/* Wide content scrolls inside its own box, never the page body. */
.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.tool-table th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t3);
  padding: 0 0 var(--s-xs);
  border-bottom: 1px solid var(--border-sub);
}
.tool-table th:last-child, .tool-table td:last-child { text-align: right; }
.tool-table td {
  padding: var(--s-sm) 0;
  border-bottom: 1px solid var(--border-sub);
  color: var(--t2);
}
.tool-table tr:last-child td { border-bottom: 0; }
.tool-load {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--t1);
}

/* ── the Standard ──────────────────────────────────────────────────── */
.std-row { padding: var(--s-md) 0; border-bottom: 1px solid var(--border-sub); }
.std-row:last-of-type { border-bottom: 0; }
.std-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-md);
}
.std-lift {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--t1);
  flex-shrink: 1;
}
.std-level {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t2);
  flex: none;
}
.std-bar {
  height: 4px;
  background: var(--tick);
  margin: var(--s-sm) 0 var(--s-xs);
  overflow: hidden;
}
.std-bar-fill { display: block; height: 100%; background: var(--t1); }

/* ── plates ────────────────────────────────────────────────────────── */
.plate-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
  margin: var(--s-xs) 0 var(--s-lg);
}
.plate-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-xs);
  padding: var(--s-sm) var(--s-md);
  border: 1px solid var(--border);
  background: transparent;
}
.plate-chip-n {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--t1);
}
.plate-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
}
.plate-opt {
  display: inline-flex;
  align-items: center;
  gap: var(--s-xs);
  padding: var(--s-xs) var(--s-sm);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-sm);
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--t2);
  cursor: pointer;
  min-height: 40px;
}
.plate-opt input { accent-color: var(--t1); }

/* ── the bridge to the app ─────────────────────────────────────────── */
.tool-cta {
  margin: var(--s-xxl) 0;
  padding-top: var(--s-lg);
  border-top: 2px solid var(--border);
}
.tool-cta h2 {
  margin: 0 0 var(--s-xs);
  max-width: 34ch;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.1;
  color: var(--t1);
}
.tool-cta p { margin: 0 0 var(--s-lg); color: var(--t2); max-width: 56ch; }
.tool-cta .btn { margin-right: var(--s-sm); }

/* ── the /tools index ──────────────────────────────────────────────── */
.tool-grid {
  display: grid;
  /* min(260px, 100%), not 260px: the chassis takes ~68px out of a 320px
     viewport, so a hard 260px track pushed the row 8px past the page
     edge. `overflow-x: clip` on <html> HID that rather than showing a
     scrollbar, so it was invisible to a screenshot — it only turned up
     by measuring every element's right edge. */
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 0 var(--s-xxl);
  padding-bottom: var(--s-xxl);
}
/* Four tools fill a 2×2, not a 3+1 with a blank cell hanging off the
   end. auto-fill still handles the single column below 560px. */
@media (min-width: 761px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tool-card {
  display: block;
  padding: var(--s-lg) 0;
  border-top: 1px solid var(--border-sub);
  text-decoration: none;
  transition: border-color 120ms ease;
}
.tool-card:hover { border-top-color: var(--t1); }
.tool-card h2 {
  margin: var(--s-xs) 0 var(--s-xs);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
  color: var(--t1);
}
.tool-card p { margin: 0; color: var(--t3); font-size: 15px; }

/* Related tools, at the foot of each tool page. */
.tool-more { padding-bottom: var(--s-xxl); }
.tool-more-links { display: flex; flex-wrap: wrap; gap: var(--s-sm); }
