/* Free tools page (tools.html, assets/tools.js). Uses the landing page's look (landing.css). */
.tools main{gap:64px;padding-top:6vh}
.tl-intro h1{font-size:clamp(36px,6vw,64px);line-height:1.02;letter-spacing:-.045em;font-weight:600;margin:0}
html[lang="ar"] .tl-intro h1{line-height:1.3;letter-spacing:0}

/* the list of tools */
.tl-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:14px}
.tl-card{display:flex;flex-direction:column;gap:8px;padding:22px;border-radius:var(--lp-r);background:var(--lp-card);border:1px solid var(--lp-line);color:var(--lp-ink);text-decoration:none;
  transition:border-color .2s ease,transform .16s var(--lp-ease)}
.tl-card:active{transform:scale(.98)}
@media (hover:hover) and (pointer:fine){ .tl-card:hover{border-color:var(--lp-line-hi);transform:translateY(-2px)} }
.tl-card:focus-visible{outline:2px solid var(--lp-accent);outline-offset:3px}
.tl-card b{font-size:20px;letter-spacing:-.02em}
.tl-card span:last-child{color:var(--lp-muted);line-height:1.5}

/* a tool */
.tl-tool{padding:28px;border-radius:var(--lp-r-lg);background:var(--lp-card);border:1px solid var(--lp-line);scroll-margin-top:84px}
@media (max-width:560px){ .tl-tool{padding:20px 16px} }
.tl-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:14px}
.tl-field{display:flex;flex-direction:column;gap:8px;flex:1 1 160px;min-width:0}
.tl-field > span:first-child{font-size:14px;font-weight:600;color:var(--lp-muted)}
.tl-inp{position:relative;display:flex;align-items:center}
.tl-inp input{width:100%;min-height:64px;padding:0 18px;border-radius:18px;border:1px solid var(--lp-line-hi);background:color-mix(in srgb,var(--lp-bg) 60%,transparent);color:var(--lp-ink);
  font:600 28px/1 var(--body);font-variant-numeric:tabular-nums;text-align:left;direction:ltr}
/* the example numbers are lighter and smaller than a typed one, so a visitor sees the box is still empty */
.tl-inp input::placeholder{color:var(--lp-faint);font-weight:400;font-size:22px}
.tl-inp input:focus{outline:none;border-color:var(--lp-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--lp-accent) 25%,transparent)}
.tl-inp i{position:absolute;right:18px;font-style:normal;color:var(--lp-muted);font-weight:600;pointer-events:none}
.tl-units{display:inline-flex;padding:4px;border-radius:999px;border:1px solid var(--lp-line-hi);background:var(--lp-card);min-height:52px;align-items:center}
.tl-units button{min-width:56px;min-height:44px;border:0;border-radius:999px;background:transparent;color:var(--lp-muted);font:600 15px/1 var(--body);cursor:pointer}
.tl-units button[aria-pressed="true"]{background:var(--lp-ink);color:var(--lp-bg)}
.tl-units button:focus-visible{outline:2px solid var(--lp-accent);outline-offset:2px}
.tl-note{margin:0;padding:12px 16px;border-radius:14px;font-size:15px;background:var(--lp-card);border:1px solid var(--lp-line)}
.tl-note.err{border-color:color-mix(in srgb,#ff5a5a 50%,transparent);color:#ff8f8f}
.tl-note.warn{border-color:color-mix(in srgb,#f0b84a 50%,transparent);color:#f0c46a}
[data-theme="light"] .tl-note.err{color:#b42318} [data-theme="light"] .tl-note.warn{color:#8a5a00}

/* results */
#rmOut{display:flex;flex-direction:column;gap:14px}
#rmOut[hidden]{display:none}
.tl-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tl-res{display:flex;flex-direction:column;gap:6px;padding:20px;border-radius:22px;border:1px solid var(--lp-line-hi);
  background:radial-gradient(120% 120% at 100% 0%,color-mix(in srgb,var(--lp-accent) 18%,transparent),transparent 60%),var(--lp-card-solid)}
.tl-res b{font-size:clamp(30px,6vw,46px);font-weight:700;letter-spacing:-.03em;line-height:1.05;text-align:start}
.tl-res small{color:var(--lp-muted);font-size:13px}
.tl-agree{margin:0}
#rmOut h3{margin-top:10px}
.tl-tablewrap{overflow-x:auto;border-radius:18px;border:1px solid var(--lp-line)}
.tl-table{width:100%;border-collapse:collapse;font-size:15px}
.tl-table th,.tl-table td{padding:12px 16px;text-align:start;border-bottom:1px solid var(--lp-line)}
.tl-table thead th{font-size:13px;font-weight:600;color:var(--lp-muted);background:color-mix(in srgb,var(--lp-ink) 4%,transparent)}
.tl-table tbody tr:last-child th,.tl-table tbody tr:last-child td{border-bottom:0}
.tl-table tbody th{font-weight:700;color:var(--lp-accent);width:1%;white-space:nowrap}
.tl-table td b{display:block;font-size:17px}
.tl-table td span{font-size:13px;color:var(--lp-muted)}
.tl-table tbody tr:first-child{background:color-mix(in srgb,var(--lp-accent) 8%,transparent)}

/* how it works */
.tl-how{border-top:1px solid var(--lp-line);padding-top:14px}
.tl-how summary{cursor:pointer;font-weight:600;color:var(--lp-ink)}
.tl-how p{color:var(--lp-muted);line-height:1.6;margin:10px 0 0}
/* phones: the two results one above the other, each number on one line */
.tl-res b{white-space:nowrap}
.tl-res small{overflow-wrap:anywhere}
@media (max-width:420px){ .tl-results{grid-template-columns:1fr} .tl-res{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:4px 12px} .tl-res .lp-tag{flex-basis:100%} }

/* BMI and FFMI */
#bfForm{flex-direction:column;align-items:stretch}
.tl-row{display:flex;flex-wrap:wrap;gap:14px}
.tl-sex{display:inline-flex;padding:4px;border-radius:999px;border:1px solid var(--lp-line-hi);background:var(--lp-card);align-self:flex-start}
.tl-sex button{min-width:84px;min-height:44px;border:0;border-radius:999px;background:transparent;color:var(--lp-muted);font:600 15px/1 var(--body);cursor:pointer}
.tl-sex button[aria-checked="true"]{background:var(--lp-ink);color:var(--lp-bg)}
.tl-sex button:focus-visible{outline:2px solid var(--lp-accent);outline-offset:2px}
#bfForm > .tl-sex,#bfForm > .tl-units{margin-bottom:-4px}
#bfForm > .tl-units{align-self:flex-start}
.tl-tape{border:1px dashed var(--lp-line-hi);border-radius:18px;padding:14px 16px;display:flex;flex-direction:column;gap:12px}
.tl-tape summary{cursor:pointer;font-weight:600;color:var(--lp-accent)}
.tl-tape[open]{gap:12px}
.tl-tape > p{margin:10px 0 0}
.tl-tape .tl-row{margin-top:12px}
.tl-est{margin:12px 0 0;padding:10px 14px;border-radius:12px;background:color-mix(in srgb,var(--lp-accent) 12%,transparent);font-size:14.5px}
.tl-field[hidden]{display:none}
#bfOut{display:flex;flex-direction:column;gap:14px}
#bfOut[hidden]{display:none}
.tl-res[hidden]{display:none}
.tl-cat{font-weight:600;font-size:15px}
.tl-cat.c0,.tl-cat.f0{color:#6aa8e8} .tl-cat.c1,.tl-cat.f2,.tl-cat.f3{color:#5fd08a} .tl-cat.f1{color:var(--lp-ink)} .tl-cat.c2,.tl-cat.f4{color:#f0b84a} .tl-cat.c3,.tl-cat.c4,.tl-cat.c5,.tl-cat.f5{color:#ff7a5c}
[data-theme="light"] .tl-cat.c0,[data-theme="light"] .tl-cat.f0{color:#2c6fb7} [data-theme="light"] .tl-cat.c1,[data-theme="light"] .tl-cat.f2,[data-theme="light"] .tl-cat.f3{color:#1f8a4c}
[data-theme="light"] .tl-cat.c2,[data-theme="light"] .tl-cat.f4{color:#9a6400} [data-theme="light"] .tl-cat.c3,[data-theme="light"] .tl-cat.c4,[data-theme="light"] .tl-cat.c5,[data-theme="light"] .tl-cat.f5{color:#c2391e}
.tl-scale{position:relative;display:flex;height:8px;border-radius:999px;overflow:visible;margin:8px 0 4px}
.tl-scale i{height:100%}
.tl-scale i:first-child{border-radius:999px 0 0 999px} .tl-scale i:nth-last-child(2){border-radius:0 999px 999px 0}
#bfBmiScale .b0{background:#6aa8e8} #bfBmiScale .b1{background:#5fd08a} #bfBmiScale .b2{background:#f0b84a} #bfBmiScale .b3{background:#ff9a5a} #bfBmiScale .b4{background:#ff7a5c} #bfBmiScale .b5{background:#e0503a}
#bfFfmiScale .b0{background:#6aa8e8} #bfFfmiScale .b1{background:#8a8f99} #bfFfmiScale .b2{background:#5fd08a} #bfFfmiScale .b3{background:#3fb874} #bfFfmiScale .b4{background:#f0b84a} #bfFfmiScale .b5{background:#ff7a5c}
.tl-scale u{position:absolute;top:50%;width:18px;height:18px;margin-left:-9px;margin-top:-9px;border-radius:50%;background:var(--lp-ink);border:3px solid var(--lp-card-solid);box-shadow:0 2px 8px rgba(0,0,0,.4)}
.tl-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:10px}
.tl-facts > div{display:flex;flex-direction:column;gap:4px;padding:14px 16px;border-radius:16px;border:1px solid var(--lp-line);background:var(--lp-card)}
.tl-facts span{font-size:13px;color:var(--lp-muted)}
.tl-facts b{font-size:18px}
@media (max-width:420px){ #bfOut .tl-res{flex-direction:column;flex-wrap:nowrap;align-items:stretch} #bfOut .tl-res .lp-tag{flex-basis:auto;align-self:flex-start} }
/* the unit sits at the end of the box, away from the number: right in English, left in Arabic (numbers start on the right there) */
.tl-inp i{right:auto;inset-inline-end:18px}
.tl-inp input{padding-inline-end:64px}

/* switched off in the control panel */
.tl-closed{display:flex;flex-direction:column;gap:14px;align-items:flex-start;padding:60px 0}
.tl-closed[hidden],.tl-tool[hidden],.tl-intro[hidden],.tl-card[hidden]{display:none}

/* 1RM: the unit switch on its own line above the two boxes, like the other tools */
#rmForm{flex-direction:column;align-items:stretch}
#rmForm > .tl-units{align-self:flex-start;margin-bottom:-4px}
/* in the column forms a field is as tall as its content (flex-basis would make it 160px tall) */
#bfForm > .tl-field,#tdForm > .tl-field{flex:0 0 auto}

/* TDEE */
#tdForm{flex-direction:column;align-items:stretch}
#tdForm > .tl-sex,#tdForm > .tl-units{align-self:flex-start;margin-bottom:-4px}
.tl-wide{flex:1 1 100%}
.tl-third{max-width:320px}
.tl-select{width:100%;min-height:56px;padding:0 16px;border-radius:18px;border:1px solid var(--lp-line-hi);background:color-mix(in srgb,var(--lp-bg) 60%,transparent);color:var(--lp-ink);font:500 16px/1.2 var(--body)}
.tl-select:focus{outline:none;border-color:var(--lp-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--lp-accent) 25%,transparent)}
.tl-select option{background:var(--lp-card-solid);color:var(--lp-ink)}
#tdOut{display:flex;flex-direction:column;gap:14px}
#tdOut[hidden]{display:none}
#tdRows th{color:var(--lp-ink);width:auto;white-space:normal}
#tdRows th b{display:block;font-size:16px}
#tdRows th span{font-size:13px;color:var(--lp-muted);font-weight:500}
#tdRows tr:nth-child(3){background:color-mix(in srgb,var(--lp-accent) 8%,transparent)}
#tdRows tr:first-child{background:none}
#tdKatTh[hidden]{display:none}
@media (max-width:420px){ #tdOut .tl-res{flex-direction:column;flex-wrap:nowrap;align-items:stretch} #tdOut .tl-res .lp-tag{flex-basis:auto;align-self:flex-start} }

/* "Send me my results" under each tool's results (assets/tool-results.js) */
.tr-box{display:flex;flex-direction:column;gap:12px;margin-top:18px;padding-top:18px;border-top:1px solid var(--lp-line)}
.tr-open{align-self:flex-start}
.tr-form{display:flex;flex-direction:column;gap:12px;max-width:520px}
.tr-form > b{font-size:17px}
.tr-field{display:flex;flex-direction:column;gap:6px}
.tr-field > span{font-size:14px;font-weight:600;color:var(--lp-muted)}
.tl-text{min-height:52px;padding:0 16px;border-radius:14px;border:1px solid var(--lp-line-hi);background:color-mix(in srgb,var(--lp-bg) 60%,transparent);color:var(--lp-ink);font:500 17px/1 var(--body)}
.tl-text.ltr{direction:ltr;text-align:left}
.tl-text:focus{outline:none;border-color:var(--lp-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--lp-accent) 25%,transparent)}
.tr-consent{display:flex;gap:10px;align-items:flex-start;line-height:1.6;cursor:pointer}
.tr-consent input{width:22px;height:22px;margin:2px 0 0;flex:0 0 auto;accent-color:var(--lp-accent)}
.tr-acts{display:flex;flex-wrap:wrap;gap:10px}
.tl-note.ok{border-color:color-mix(in srgb,#3fb950 50%,transparent);color:#7ee2a8}
[data-theme="light"] .tl-note.ok{color:#1a7f37}
