/* Calculator tools — Fitelo rebrand. Tokens and chrome come from tokens.css and style.css. */

html:has(body .calc){scroll-behavior:smooth;scroll-padding-top:104px}
@media(prefers-reduced-motion:reduce){html:has(body .calc){scroll-behavior:auto}}

body:has(.calc){
  background:var(--ivory);
  color:var(--ink);
  font-family:var(--sans);
  font-size:16.5px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:clip;
}
body:has(.calc) .calc{box-sizing:border-box}
body:has(.calc) .calc *,
body:has(.calc) .calc *::before,
body:has(.calc) .calc *::after{box-sizing:border-box}
body:has(.calc) .calc :is(h1,h2,h3){
  font-family:var(--serif);
  font-weight:500;
  letter-spacing:-.035em;
  line-height:1.39;
  text-wrap:balance;
  color:var(--maroon);
  margin:0;
}
body:has(.calc) .calc :is(h1,h2) em{
  display:inline-block;
  font-style:italic;
  margin:0 .08em;
  padding:.07em .34em .12em;
  line-height:1.04;
  color:inherit;
  border:1.6px solid var(--orange);
  border-radius:999px;
  vertical-align:baseline;
  -webkit-box-decoration-break:clone;
  box-decoration-break:clone;
}
body:has(.calc) .calc :focus-visible{outline:2px solid var(--orange);outline-offset:3px}

.calc-wrap{width:100%;max-width:var(--max);margin:0 auto;padding-inline:var(--pad)}

.calc-cue{
  display:inline-flex;
  align-items:center;
  height:32px;
  padding:0 14px;
  margin:0 0 16px;
  border-radius:999px;
  font-family:var(--sans);
  font-size:13px;
  font-weight:500;
  color:var(--orangeD);
  border:1.2px solid rgba(255,71,57,.4);
  width:max-content;
  max-width:100%;
}

.calc-hero{
  position:relative;
  padding:calc(118px + env(safe-area-inset-top,0px)) 0 clamp(36px,5vw,64px);
  overflow:hidden;
}
.calc-ov{
  position:absolute;
  left:-8%;
  top:6%;
  width:min(420px,42vw);
  pointer-events:none;
  opacity:.45;
}
.calc-ov svg{display:block;width:100%;height:auto;overflow:visible}
.calc-ov ellipse{fill:none;stroke:rgba(79,7,22,.16);stroke-width:1;vector-effect:non-scaling-stroke}
.calc-shead{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  gap:16px 48px;
  align-items:end;
  margin-bottom:clamp(22px,3vw,36px);
}
.calc-shead:not(:has(.calc-lede)){grid-template-columns:1fr}
.calc-hero h1{
  font-size:clamp(40px,5.2vw,64px);
  letter-spacing:-.04em;
}
.calc-lede{
  justify-self:end;
  max-width:42ch;
  color:var(--ink2);
  font-size:clamp(16.5px,1.25vw,19px);
  line-height:1.55;
}
.calc-lede p{margin:0 0 12px}
.calc-lede p:last-child{margin-bottom:0}
.calc-lede ul{
  margin:0;
  padding-left:1.15em;
  list-style:disc;
}
.calc-lede li{margin:4px 0}

/* Tool shell */
.calc-tool{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);
  gap:16px;
  align-items:start;
  margin:0;
  padding:0;
  background:transparent;
  border-radius:0;
}
.calc-tool + .calc-tool{margin-top:16px}
.calc-tool > .calcForm,
.calc-tool > .calcResultsOuter,
.calc-tool > .resultBarOuter{
  min-width:0;
  border-radius:var(--r-lg);
  background:var(--white);
  box-shadow:inset 0 0 0 1px var(--line),var(--shadowL);
}
.calc-tool > .calcForm,
.calc-tool > .calcResultsOuter{padding:clamp(24px,3vw,40px)}
.calc-tool > .resultBarOuter{
  grid-column:1 / -1;
  display:none;
  padding:clamp(20px,3vw,32px);
}
.calcForm form{
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  gap:16px 14px;
  margin:0;
}
.calcForm .col-50,
.calcForm .col-100{min-width:0}
.calcForm .col-50{flex:1 1 240px}
.calcForm .col-100{
  flex:1 1 100%;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
  align-items:end;
}
.calcForm .col-100 > :not(label){grid-column:1 / -1}
.calcForm .col-100:has(input[type="radio"]),
.calcForm .col-100:has(input[type="checkbox"]){grid-template-columns:1fr}
.calcForm h4,
.calcForm h5{
  margin:8px 0 0;
  font-family:var(--serif);
  font-weight:500;
  font-size:clamp(22px,2vw,28px);
  letter-spacing:-.03em;
  line-height:1.3;
  color:var(--maroon);
}
.calcForm p{
  margin:0;
  color:var(--ink2);
  font-size:15.5px;
  line-height:1.5;
}
.calcForm label{
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  gap:8px;
  min-width:0;
  color:var(--ink);
  font-size:14.5px;
  font-weight:600;
  line-height:1.3;
}
.calcForm label:has(input[type="radio"]),
.calcForm label:has(input[type="checkbox"]){
  flex-direction:row;
  align-items:center;
  justify-content:flex-start;
  font-weight:500;
}
.calcForm input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.calcForm select{
  width:100%;
  height:56px;
  padding:0 16px;
  border:1.5px solid var(--line);
  border-radius:16px;
  background:var(--ivory);
  color:var(--ink);
  font:inherit;
  font-size:16px;
}
.calcForm select{
  appearance:none;
  padding-right:42px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B4E48' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:18px;
}
.calcForm input[type="radio"],
.calcForm input[type="checkbox"]{
  width:20px;
  height:20px;
  margin:0;
  accent-color:var(--orange);
  flex:none;
}
.calcForm input:not([type="radio"]):not([type="checkbox"]):focus,
.calcForm select:focus{
  outline:none;
  border-color:var(--orange);
  background-color:#fff;
  box-shadow:0 0 0 4px rgba(255,71,57,.12);
}
.calcForm select:focus{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B4E48' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:18px;
}
.calcForm button,
.calcForm .submt_bttn,
.calcForm .primary-btn,
.calcForm .next-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:52px;
  padding:0 22px;
  border:0;
  border-radius:999px;
  background:var(--orange);
  color:#fff;
  font:inherit;
  font-size:15.5px;
  font-weight:600;
  letter-spacing:-.01em;
  cursor:pointer;
  box-shadow:0 10px 26px -8px rgba(255,71,57,.6);
}
.calcForm button:hover,
.calcForm .submt_bttn:hover{background:var(--orangeD);color:#fff}
.calc .error,
.calcForm .error{
  display:none;
  color:#9B2335;
  font-size:14.5px;
  font-weight:600;
  line-height:1.4;
}
.calcForm .neck-warning{color:#9B2335;font-weight:600}

.calcResultsOuter h5{
  margin:0 0 16px;
  font-family:var(--serif);
  font-weight:500;
  font-size:clamp(28px,3vw,36px);
  letter-spacing:-.03em;
  line-height:1.2;
  color:var(--maroon);
}
.calcResultsOuter p{
  margin:0 0 12px;
  color:var(--ink2);
  font-size:16px;
  line-height:1.55;
}
.calcResultsOuter p:has(> span){
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:baseline;
}
.calcResultsOuter p span{
  font-weight:650;
  color:var(--maroon);
  text-align:right;
}
.calcForm .calcResultsOuter{
  padding:16px 18px;
  border-radius:var(--r-md);
  background:var(--ivory);
  box-shadow:inset 0 0 0 1px var(--line);
}
.calcResultsOuter canvas,
.pieOuter canvas,
.donutChart canvas{
  display:block;
  width:100% !important;
  max-width:100%;
  height:auto !important;
  margin:12px auto 0;
  filter:none;
}
.pieOuter,.donutChart{width:100%;max-width:360px;margin:8px auto 0}

.resultBarOuter h5{
  margin:0 0 18px;
  text-align:center;
  font-family:var(--serif);
  font-weight:500;
  font-size:clamp(24px,2.4vw,32px);
  color:var(--maroon);
}
#result div#result-bar{
  margin:28px auto 12px;
  max-width:720px;
  width:100%;
  min-height:74px;
  background:linear-gradient(90deg,var(--ivory2),var(--orange));
  border-radius:999px;
  display:flex;
  align-items:center;
  padding:10px 16px;
  position:relative;
}
#result .result-inner.flex{display:flex;width:100%;align-items:center}
#result .bmi-steps{
  position:relative;
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:54px;
  text-align:center;
}
#result .bmi-steps:not(:last-child){box-shadow:inset -1px 0 0 rgba(255,255,255,.7)}
#result p.rating-title,
#result p.rating{margin:0;color:var(--ink);line-height:1.2}
#result p.rating-title{font-size:13px;font-weight:600}
#result p.rating{font-size:14px;font-weight:650}
.bmi-marker{position:absolute;left:50%;bottom:-6px;transition:opacity .3s var(--ease)}
.bmi-marker .marker-inner{display:none}
.bmi-marker.active .marker-inner{
  display:block;
  width:3px;
  height:78px;
  margin-left:-1px;
  background:var(--maroon);
  position:relative;
}
.bmi-marker.active .marker-inner:before{
  content:"";
  position:absolute;
  left:-4px;
  top:-8px;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-bottom:8px solid var(--maroon);
}

.calc-about{padding:clamp(8px,2vw,16px) 0 clamp(56px,7vw,96px)}
.calc-updated{
  margin:0 0 12px;
  color:var(--ink3);
  font-size:14px;
}
body:has(.calc) .calc-about :is(h2,h3){margin-top:1.2em}
body:has(.calc) .calc-about .calc-wrap > :is(h2,h3):first-child{margin-top:0}
.calc-about h2{font-size:clamp(30px,3.6vw,48px)}
.calc-about h3{font-size:clamp(24px,2.4vw,32px)}
.calc-about p,
.calc-about li{
  color:var(--ink2);
  font-size:16.5px;
  line-height:1.6;
}
.calc-about p{margin:12px 0}
.calc-about ul,
.calc-about ol{margin:8px 0 16px;padding-left:1.2em}
.calc-about ul.content-ul-div,
.calc-about ul:not(.content-ul-div1){list-style:disc}
.calc-about ul.content-ul-div1,
.calc-about ol{list-style:decimal}
.calc-about li{margin:8px 0}
.calc-about table{
  width:100%;
  margin:16px 0 24px;
  border-collapse:collapse;
  background:var(--white);
  border-radius:16px;
  overflow:hidden;
  box-shadow:inset 0 0 0 1px var(--line);
}
.calc-about th,
.calc-about td{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
  color:var(--ink2);
  font-size:15.5px;
}
.calc-about th{
  background:var(--ivory2);
  color:var(--maroon);
  font-weight:650;
}
.calc-about tr:last-child td,
.calc-about tr:last-child th{border-bottom:0}

@media(max-width:980px){
  .calc-shead{grid-template-columns:1fr;gap:10px}
  .calc-lede{justify-self:start}
  .calc-tool{grid-template-columns:1fr}
}
@media(max-width:680px){
  .calc-hero{padding-top:calc(96px + env(safe-area-inset-top,0px))}
  .calc-hero h1{font-size:clamp(36px,10vw,48px)}
  .calcForm .col-100{grid-template-columns:1fr}
  .calc-about table{display:block;overflow-x:auto}
}
@media(prefers-reduced-motion:reduce){
  .calcForm button,.calcForm input,.calcForm select,.bmi-marker{transition:none}
}
