/* Mesolab free tools (/tools/*). Loaded after /guides/guide.css and uses its tokens. */
.calc { margin: 8px 0 28px; padding: 22px; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface); }
.calc fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.calc legend { font-family: var(--display); font-weight: 800; font-size: 22px; padding: 0; margin-bottom: 10px; }
.calc .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.calc .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.calc .field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.calc input[type="number"], .calc select {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--rule-light); background: var(--card); color: var(--ink);
  font: 600 18px/1.2 var(--font);
}
.calc select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; font-size: 16px; }
.calc input:focus-visible, .calc select:focus-visible { outline: 3px solid var(--volt); outline-offset: 2px; }
.seg { display: flex; border: 1px solid var(--rule-light); border-radius: 12px; overflow: hidden; min-height: 48px; }
.seg label { flex: 1; position: relative; display: flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { flex: 1; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-2); background: var(--card); }
.seg input:checked + span { background: var(--volt); color: var(--on-volt); }
.seg input:focus-visible + span { outline: 3px solid var(--volt); outline-offset: -3px; }
.result { display: block; margin: 0 0 22px; padding: 16px 18px; border-radius: 14px; background: var(--volt-dim); border: 1px solid rgba(198, 241, 53, 0.35); }
.result-label { display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); }
.result strong { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(40px, 9vw, 56px); line-height: 1.05; color: var(--volt); }
.result-note { display: block; font-size: 15px; color: var(--ink-2); }
.calc .error { color: #ffb4a8; font-weight: 600; margin: 0; }
.tool-cta { margin-top: 0; }
.formula { font-family: var(--display); font-size: 22px; font-weight: 700; background: var(--card); border: 1px solid var(--rule); padding: 12px 16px; border-radius: 12px; }
.table-scroll { overflow-x: auto; margin: 0 0 20px; }
.table-scroll table { margin: 0; min-width: 420px; }
table.pct td, table.pct th[scope="row"] { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.pct th[scope="row"] { color: var(--ink); font-size: 16px; letter-spacing: 0; text-transform: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 420px) { .calc { padding: 16px; } .calc .row { gap: 10px; } }
.calc .hint { font-size: 13px; line-height: 1.4; color: var(--muted); }
.result-zone { display: block; font-weight: 700; font-size: 18px; color: var(--ink); margin: 2px 0 4px; }
.scale { position: relative; display: flex; height: 10px; margin: 14px 0 4px; border-radius: 999px; overflow: visible; }
.scale .band { height: 100%; }
.scale .band-under { background: var(--rule-light); border-radius: 999px 0 0 999px; }
.scale .band-mev { background: rgba(198, 241, 53, 0.55); }
.scale .band-mav { background: rgba(198, 241, 53, 0.25); }
.scale .band-over { background: rgba(255, 180, 168, 0.35); border-radius: 0 999px 999px 0; }
.scale .marker { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
table.pct tr.selected th, table.pct tr.selected td { background: var(--volt-dim); color: var(--ink); }
/* Mesocycle generator */
.calc .field + .row { margin-top: 14px; }
.calc fieldset.focus { margin-bottom: 8px; }
.calc legend small { font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; display: flex; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule-light); background: var(--card); color: var(--ink-2); font-weight: 700; }
.chips input:checked + span { background: var(--volt); color: var(--on-volt); border-color: var(--volt); }
.chips input:disabled + span { opacity: .45; }
.chips input:focus-visible + span { outline: 3px solid var(--volt); outline-offset: 2px; }
.calc .status { margin: 0; min-height: 1.4em; font-size: 15px; color: var(--ink-2); }
.program { margin-bottom: 28px; }
.program[aria-busy="true"] #program, #program[aria-busy="true"] { opacity: .55; transition: opacity .2s; }
.program-summary { font-size: 18px; }
.program-h { margin-top: 26px; }
.program-note { font-size: 15px; color: var(--ink-2); }
table.day th[scope="row"] { white-space: normal; min-width: 180px; }
table.day .sub { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
table.day .tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--volt); color: var(--on-volt); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
table.day td.sets { letter-spacing: .02em; }
table.day .dl, table.weeks tr.deload th, table.weeks tr.deload td { color: var(--muted); }
table.weeks td:last-child { white-space: normal; }
.program .table-scroll table { min-width: 0; width: 100%; }
table.day td.sets, table.day td:nth-child(2) { white-space: nowrap; }
@media (max-width: 520px) {
  .program table th, .program table td { padding-left: 6px; padding-right: 6px; }
  .program table th[scope="col"] { font-size: 11px; }
  table.day th[scope="row"] { min-width: 0; }
}
