/* MyGymGate free tools (web/tools, generated by scripts/tools/build.ts). Builds on site.css + blog.css tokens.
   Everything runs in the browser; nothing is saved or sent anywhere. */
.tool-page main { padding-top: 74px; }
.tool-hero { padding: clamp(40px, 6vw, 70px) 0 10px; }
.tool-hero h1 { font-size: clamp(34px, 4.8vw, 56px); font-weight: 700; margin: 10px 0 14px; line-height: 1.06; max-width: 20ch; }
.tool-hero .lead { max-width: 700px; }
.tool-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tool-badges span { font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--iron-2); box-shadow: inset 0 0 0 1px var(--line); }
.tool-badges span::before { content: "✓ "; color: var(--lime); }

/* App shell: inputs left, results right (stacked on phones) */
.tool-app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin: 30px 0 10px; align-items: start; }
.tool-app.wide { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .tool-app { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--graphite); border-radius: 24px; padding: clamp(20px, 3vw, 30px); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.panel.result { position: sticky; top: 96px; background: linear-gradient(160deg, rgba(200,255,46,.10), var(--graphite) 45%); box-shadow: inset 0 0 0 1px rgba(200,255,46,.22); }
@media (max-width: 900px) { .panel.result { position: static; } }
.panel-t { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 16px; }

/* Fields */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .lbl { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.field .hint { color: var(--dim); font-weight: 500; font-size: 13px; }
.field .val { color: var(--lime); font-family: var(--display); font-weight: 700; font-size: 18px; white-space: nowrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row3 { grid-template-columns: 1fr 1fr; } }
.inp { display: flex; align-items: center; background: var(--iron-2); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s; }
.inp:focus-within { box-shadow: inset 0 0 0 1.5px var(--lime); }
.inp input, .inp select { flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; outline: 0; color: var(--chalk); font: 600 17px Inter, sans-serif; padding: 13px 14px; -moz-appearance: textfield; }
.inp select { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
.inp select option { background: var(--graphite); color: var(--chalk); }
.inp input::-webkit-outer-spin-button, .inp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inp .u { padding: 0 14px 0 0; color: var(--dim); font-size: 14px; font-weight: 600; white-space: nowrap; }
.inp .pre { padding: 0 0 0 14px; color: var(--dim); font-weight: 600; }

/* Segmented control (radio group) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; background: var(--iron-2); padding: 5px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.seg label { flex: 1 1 auto; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; white-space: nowrap; }
.seg label:hover span { color: var(--chalk); }
.seg input:checked + span { background: var(--lime); color: var(--iron); }
.seg input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.seg.col { flex-direction: column; }
.seg.col span { text-align: left; white-space: normal; }
.seg.col span small { display: block; font-weight: 500; font-size: 12.5px; opacity: .75; }

/* Range slider */
input[type=range].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; outline: 0; cursor: pointer;
  background: linear-gradient(90deg, var(--lime) var(--p, 50%), var(--iron-2) var(--p, 50%)); box-shadow: inset 0 0 0 1px var(--line); }
input[type=range].rng::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--chalk); border: 4px solid var(--lime); box-shadow: 0 4px 14px rgba(0,0,0,.4); transition: transform .15s; }
input[type=range].rng::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--chalk); border: 4px solid var(--lime); }
input[type=range].rng:active::-webkit-slider-thumb { transform: scale(1.15); }
.rng-ends { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; margin-top: 6px; }

/* Results */
.big { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 7vw, 76px); line-height: 1; letter-spacing: -.03em; color: var(--chalk); }
.big small { font-size: .32em; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: 6px; }
.big-l { color: var(--muted); font-size: 15px; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; margin-top: 14px; background: rgba(200,255,46,.14); color: var(--lime); }
.pill.warn { background: rgba(255,106,43,.14); color: var(--streak); }
.pill.bad { background: rgba(255,80,80,.14); color: #FF7A7A; }
.pill.info { background: rgba(120,170,255,.14); color: #9CC0FF; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 22px; }
.stat { background: var(--iron-2); border-radius: 16px; padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.stat b { display: block; font-family: var(--display); font-size: 21px; line-height: 1.1; color: var(--chalk); overflow-wrap: anywhere; }
.stat span { display: block; color: var(--dim); font-size: 13px; margin-top: 4px; }
.stat.hl { box-shadow: inset 0 0 0 1.5px rgba(200,255,46,.5); }
.stat.hl b { color: var(--lime); }
.note { color: var(--dim); font-size: 13px; line-height: 1.55; margin-top: 18px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }

/* Horizontal scale with a marker (BMI, body fat, etc.) */
.scale { margin-top: 26px; }
.scale-bar { position: relative; display: flex; height: 14px; border-radius: 99px; overflow: visible; }
.scale-bar i { flex: var(--w, 1); height: 100%; background: var(--c); }
.scale-bar i:first-child { border-radius: 99px 0 0 99px; }
.scale-bar i:last-child { border-radius: 0 99px 99px 0; }
.scale-mark { position: absolute; top: -9px; left: var(--x, 0%); width: 4px; height: 32px; margin-left: -2px; border-radius: 4px; background: var(--chalk); box-shadow: 0 0 0 3px var(--iron); transition: left .5s cubic-bezier(.2,.8,.2,1); }
.scale-labels { display: flex; margin-top: 10px; font-size: 12px; color: var(--muted); }
.scale-labels span { flex: var(--w, 1); text-align: center; }

/* Stacked bars (macros, zones) */
.bars { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.bar-row .t { color: var(--muted); font-weight: 600; }
.bar-row .v { font-weight: 700; white-space: nowrap; }
.bar-track { height: 12px; border-radius: 99px; background: var(--iron-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar-fill { height: 100%; width: var(--w, 0%); background: var(--c, var(--lime)); border-radius: 99px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
@media (max-width: 480px) { .bar-row { grid-template-columns: 84px minmax(0, 1fr) auto; } }
.stack { display: flex; height: 18px; border-radius: 99px; overflow: hidden; margin-top: 18px; }
.stack i { width: var(--w); background: var(--c); transition: width .5s; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }

/* Ring gauge */
.ring { position: relative; width: 190px; height: 190px; margin: 4px auto 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 14; }
.ring .bg { stroke: var(--iron-2); }
.ring .fg { stroke: var(--lime); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1), stroke .3s; }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .mid b { font-family: var(--display); font-size: 40px; line-height: 1; }
.ring .mid span { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Table inside tools */
.ttable { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 16px; }
.ttable th, .ttable td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ttable th { color: var(--dim); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.ttable td.n, .ttable th.n { text-align: right; font-variant-numeric: tabular-nums; }
.ttable tr.on td { background: rgba(200,255,46,.08); color: var(--lime); font-weight: 700; }
.ttable-wrap { overflow-x: auto; }

/* Small buttons */
.chip-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--iron-2); color: var(--chalk); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px;
  padding: 9px 15px; font: 600 14px Inter, sans-serif; cursor: pointer; transition: box-shadow .15s, color .15s; text-decoration: none; }
.chip-btn:hover { box-shadow: inset 0 0 0 1.5px var(--lime); color: var(--lime); }
.chip-btn.on { background: var(--lime); color: var(--iron); box-shadow: none; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; background: var(--chalk); color: var(--iron); padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; transition: .25s; z-index: 80; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Explainer + related */
.tool-body { margin-top: 50px; }
.tool-body .post-grid { margin-top: 0; }
.tool-body .post-faq { margin-left: 276px; }
@media (max-width: 960px) { .tool-body .post-faq { margin-left: 0; } }
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; background: var(--graphite); border-radius: 20px; padding: 22px; box-shadow: inset 0 0 0 1px var(--line); transition: transform .2s, box-shadow .2s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px rgba(200,255,46,.5); }
.tool-card .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(200,255,46,.12); color: var(--lime); font-size: 22px; }
.tool-card h3 { font-size: 19px; line-height: 1.2; }
.tool-card p { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.tool-more { margin-top: 56px; }
.tool-more h2 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 18px; }
.tools-group { padding: 26px 0 10px; }
.tools-group > h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 8px; }
.tools-group > p { color: var(--muted); margin-bottom: 20px; }
.disclaimer { margin-top: 18px; padding: 14px 18px; border-radius: 14px; background: var(--iron-2); color: var(--dim); font-size: 13.5px; line-height: 1.55; box-shadow: inset 0 0 0 1px var(--line); }

/* site.css styles the contact form's `.field input/label`; undo that inside the tools. */
.tool-app .field > label { display: flex; font-size: 15px; color: var(--chalk); margin-bottom: 8px; }
.tool-app .seg label { display: block; margin: 0; font-size: inherit; color: inherit; }
.tool-app .inp input, .tool-app .inp select { height: auto; border-radius: 0; background: transparent; box-shadow: none; padding: 13px 14px; font: 600 17px Inter, sans-serif; }
.tool-app .inp select { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.tool-app .inp input:focus, .tool-app .inp select:focus { box-shadow: none; }
.tool-app .field input[type=range] { height: 8px; padding: 0; border-radius: 99px; background: linear-gradient(90deg, var(--lime) var(--p, 50%), var(--iron-2) var(--p, 50%)); box-shadow: inset 0 0 0 1px var(--line); }
.tool-app .field input[type=radio], .tool-app .field input[type=checkbox] { width: auto; height: auto; }

/* A sticky result panel only works when it's the last row. When a full-width panel follows it in the same grid
   (GST, profit, churn, 1RM, protein), sticky would slide it over that panel, so keep it in place there. */
.tool-app:has(> div:nth-of-type(3)) > .panel.result { position: static; }
/* Solid base under the lime tint so nothing can show through a result panel. */
.panel.result { background: linear-gradient(160deg, rgba(200,255,46,.10), rgba(200,255,46,0) 45%), var(--graphite); }
