.calculator-page{
  padding:30px 0 70px;
}

.calculator-page-width{
  width:min(820px,calc(100% - 40px));
  margin:auto;
}

.breadcrumb{
  display:flex;
  gap:8px;

  margin-bottom:27px;

  color:var(--quiet);

  font-size:12px;
}

.breadcrumb a:hover{
  color:var(--accent);
}

.calculator-title{
  margin-bottom:22px;
}

.calculator-title h1{
  margin:0;

  font-size:clamp(30px,4vw,40px);
  line-height:1.05;

  font-weight:540;
  letter-spacing:-.045em;
}

.calculator-title p{
  margin:8px 0 0;

  color:var(--muted);

  font-size:13px;
}


/* TOOL */

.percentage-tool{
  overflow:hidden;

  border:1px solid var(--line);
  border-radius:14px;

  background:var(--surface);

  box-shadow:var(--shadow);
}

.percentage-tabs{
  padding:6px;

  display:grid;
  grid-template-columns:repeat(3,1fr);

  gap:5px;

  border-bottom:1px solid var(--line);

  background:var(--surface-soft);
}

.mode-tab{
  min-height:40px;

  padding:7px 10px;

  border:0;
  border-radius:8px;

  background:transparent;
  color:var(--muted);

  cursor:pointer;

  font-size:12px;
  font-weight:450;
}

.mode-tab.active{
  background:var(--surface);
  color:var(--text);

  box-shadow:0 1px 3px rgba(0,0,0,.06);
}

.percentage-body{
  padding:28px;
}

.calc-mode{
  display:none;
}

.calc-mode.active{
  display:block;
}

.question{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;

  gap:8px;

  font-size:18px;
}

.question input,
.change-fields input{
  height:46px;

  border:1px solid var(--line);
  border-radius:8px;

  outline:0;

  background:var(--bg);
  color:var(--text);

  font-weight:500;
}

.question input{
  width:95px;

  padding:0 9px;

  text-align:center;
}

.question input:focus,
.change-fields input:focus{
  border-color:var(--accent);

  box-shadow:
    0 0 0 3px
    color-mix(in srgb,var(--accent) 8%,transparent);
}


/* ANSWER */

.answer{
  margin-top:25px;
  padding:22px;

  border-left:3px solid var(--accent);

  background:var(--accent-soft);
}

.answer > span{
  display:block;

  margin-bottom:6px;

  color:var(--muted);

  font-size:12px;
}

.answer strong{
  display:block;

  font-size:42px;
  line-height:1;

  font-weight:520;
  letter-spacing:-.045em;
}

.answer p{
  margin:8px 0 0;

  color:var(--muted);

  font-size:12px;
}

.formula-line{
  margin-top:15px;

  display:flex;
  justify-content:space-between;

  gap:20px;

  color:var(--quiet);

  font-size:12px;
}

.formula-line code{
  color:var(--muted);
}


/* CHANGE */

.change-fields{
  display:grid;
  grid-template-columns:1fr auto 1fr;

  gap:14px;

  align-items:end;
}

.change-fields label > span{
  display:block;

  margin-bottom:6px;

  color:var(--muted);

  font-size:12px;
}

.change-fields input{
  width:100%;

  padding:0 12px;
}

.change-arrow{
  height:46px;

  display:grid;
  place-items:center;

  color:var(--quiet);
}


/* CONTENT */

.calculator-content{
  max-width:680px;

  margin:48px auto 0;
}

.calculator-content h2{
  margin:35px 0 9px;

  font-size:20px;
  font-weight:520;

  letter-spacing:-.025em;
}

.calculator-content p{
  margin:0;

  color:var(--muted);

  font-size:13px;
  line-height:1.7;
}

.example{
  margin-top:17px;
  padding:15px 0;

  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:20px;

  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}

.example span{
  color:var(--quiet);

  font-size:12px;
}

.example code{
  font-size:12px;
}


/* FEEDBACK */

.feedback-note{
  margin-top:42px;
  padding:20px;

  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:30px;

  border:1px solid var(--line);
  border-radius:11px;

  background:var(--surface);
}

.feedback-note strong{
  font-size:13px;
  font-weight:520;
}

.feedback-note p{
  max-width:430px;

  margin-top:4px;

  font-size:12px;
}

.feedback-note a{
  flex:0 0 auto;

  color:var(--accent);

  font-size:12px;
}


/* MOBILE */

@media(max-width:620px){

  .calculator-page{
    padding-top:20px;
  }

  .calculator-page-width{
    width:calc(100% - 24px);
  }

  .breadcrumb{
    margin:0 3px 20px;
  }

  .calculator-title{
    padding:0 3px;
  }

  .calculator-title h1{
    font-size:29px;
  }

  .percentage-tabs{
    display:flex;

    overflow-x:auto;

    padding:6px;

    scrollbar-width:none;
  }

  .percentage-tabs::-webkit-scrollbar{
    display:none;
  }

  .mode-tab{
    flex:0 0 auto;

    min-width:145px;
  }

  .percentage-body{
    padding:22px 15px;
  }

  .question{
    font-size:16px;
  }

  .question input{
    width:80px;
    height:44px;
  }

  .answer{
    margin-top:22px;
    padding:18px;
  }

  .answer strong{
    font-size:38px;
  }

  .formula-line{
    flex-direction:column;

    gap:4px;
  }

  .change-fields{
    grid-template-columns:1fr;
  }

  .change-arrow{
    display:none;
  }

  .calculator-content{
    padding:0 4px;

    margin-top:38px;
  }

  .feedback-note{
    align-items:flex-start;
    flex-direction:column;

    gap:12px;
  }

}


/* =========================================================
   FAQ
   ========================================================= */

.calculator-faq{
  margin-top:42px;
  padding-top:34px;

  border-top:1px solid var(--line);
}

.calculator-faq-kicker{
  display:block;
  margin-bottom:8px;

  color:var(--accent);

  font-size:12px;
  font-weight:700;
  letter-spacing:.12em;
}

.calculator-faq h2{
  margin:0 0 18px;

  font-size:22px;
  font-weight:520;
  letter-spacing:-.03em;
}

.calculator-faq details{
  border-top:1px solid var(--line);
}

.calculator-faq details:last-of-type{
  border-bottom:1px solid var(--line);
}

.calculator-faq summary{
  position:relative;

  padding:17px 34px 17px 0;

  cursor:pointer;
  list-style:none;

  font-size:13px;
  font-weight:520;
}

.calculator-faq summary::-webkit-details-marker{
  display:none;
}

.calculator-faq summary::after{
  content:"+";

  position:absolute;
  right:4px;
  top:50%;

  transform:translateY(-50%);

  color:var(--accent);

  font-size:20px;
  font-weight:300;
}

.calculator-faq details[open] summary::after{
  content:"−";
}

.calculator-faq details p{
  max-width:650px;

  margin:0 0 12px;
  padding-right:20px;

  color:var(--muted);

  font-size:12px;
  line-height:1.7;
}

.calculator-faq details code{
  display:inline-block;

  margin-bottom:18px;
  padding:7px 10px;

  border-radius:7px;

  background:var(--surface-soft);
  color:var(--text);

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;

  font-size:12px;
}

@media(max-width:620px){

  .calculator-faq{
    margin-top:34px;
    padding-top:28px;
  }

  .calculator-faq h2{
    font-size:20px;
  }

  .calculator-faq summary{
    padding-top:15px;
    padding-bottom:15px;

    font-size:12px;
  }

}
