.lf-tool {
  background: #ffffff;

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

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

  overflow: hidden;
}


.lf-tool-head {
  display: flex;
  align-items: start;
  justify-content: space-between;

  gap: 20px;

  padding: 25px 28px 20px;

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


.lf-tool-head h1 {
  margin: 0 0 7px;

  font-size: 30px;
}


.lf-tool-head p {
  margin: 0;

  color: var(--math-text-soft);

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


.lf-grade {
  flex: 0 0 auto;

  padding: 6px 9px;

  background: #fff2da;

  border-radius: 8px;

  color: #9b6416;

  font-size: 11px;
  font-weight: 800;
}


.lf-tabs {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  background: #f6f8fb;

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


.lf-tab {
  min-height: 50px;

  padding: 8px;

  background: transparent;

  border: 0;
  border-right: 1px solid var(--math-line);

  color: var(--math-text-soft);

  font-size: 12px;
  font-weight: 800;

  cursor: pointer;
}


.lf-tab:last-child {
  border-right: 0;
}


.lf-tab.is-active {
  background: #ffffff;

  color: var(--math-primary);

  box-shadow:
    inset 0 -3px 0
    var(--math-primary);
}


.lf-workspace {
  display: grid;

  grid-template-columns:
    minmax(0, 1.3fr)
    minmax(300px, 0.8fr);
}


.lf-input-panel {
  min-width: 0;

  padding: 25px 28px;

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


.lf-mode-panel {
  display: none;
}


.lf-mode-panel.is-active {
  display: block;
}


.lf-mode-panel h2 {
  margin: 0 0 8px;

  font-size: 16px;
}


.lf-formula {
  margin-bottom: 18px;

  padding: 9px 12px;

  background: var(--math-primary-soft);

  border-radius: 8px;

  color: var(--math-primary);

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


.lf-field {
  display: grid;

  grid-template-columns:
    90px minmax(0, 1fr);

  align-items: center;

  gap: 12px;

  margin-bottom: 11px;
}


.lf-field label {
  color: var(--math-text-soft);

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


.lf-field input,
.lf-mini-field input {
  width: 100%;
  height: 48px;

  padding: 0 12px;

  background: #ffffff;

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

  color: var(--math-text);

  font-size: 17px;
  font-weight: 700;

  outline: none;
}


.lf-field input:focus,
.lf-mini-field input:focus {
  border-color: var(--math-primary);

  box-shadow:
    0 0 0 3px
    rgba(47, 111, 237, 0.1);
}


.lf-point-title {
  margin: 15px 0 8px;

  color: var(--math-text-soft);

  font-size: 11px;
  font-weight: 800;
}


.lf-point-row {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 10px;
}


.lf-mini-field {
  display: grid;

  grid-template-columns:
    30px minmax(0, 1fr);

  align-items: center;

  gap: 6px;
}


.lf-mini-field label {
  color: var(--math-text-soft);

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


.lf-actions {
  display: flex;
  justify-content: center;

  gap: 8px;

  margin-top: 21px;
}


.lf-actions button {
  min-height: 44px;

  border: 0;
  border-radius: 9px;

  font-weight: 800;

  cursor: pointer;
}


.lf-calculate {
  min-width: 155px;

  background: var(--math-primary);

  color: #ffffff;
}


.lf-clear {
  min-width: 76px;

  background: #eef1f6;

  color: #566176;
}


.lf-error {
  margin: 14px 0 0;

  color: #c0392b;

  text-align: center;

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


.lf-result-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 270px;

  padding: 24px;

  background: #f8faff;

  text-align: center;
}


.lf-result-label {
  margin-bottom: 7px;

  color: var(--math-text-soft);

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


.lf-result {
  color: var(--math-primary);

  font-size: 38px;
  font-weight: 900;

  line-height: 1.35;
}


.lf-equation {
  margin-top: 9px;

  color: var(--math-text);

  font-size: 16px;
  font-weight: 800;
}


.lf-summary {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 8px;

  width: 100%;

  max-width: 280px;

  margin-top: 18px;
}


.lf-summary-item {
  padding: 9px 10px;

  background: #ffffff;

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


.lf-summary-item span {
  display: block;

  color: var(--math-text-soft);

  font-size: 10px;
  font-weight: 700;
}


.lf-summary-item strong {
  display: block;

  margin-top: 3px;

  color: var(--math-text);

  font-size: 15px;
}


.lf-steps {
  padding: 22px 28px 27px;

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


.lf-steps-head h2 {
  margin: 0 0 12px;

  font-size: 16px;
}


.lf-steps-list {
  display: grid;

  gap: 7px;
}


.lf-step {
  display: flex;

  gap: 12px;

  padding: 10px 12px;

  background: #f7f9fc;

  border-radius: 9px;
}


.lf-step-number {
  flex: 0 0 auto;

  width: 24px;
  height: 24px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--math-primary-soft);

  border-radius: 50%;

  color: var(--math-primary);

  font-size: 11px;
  font-weight: 900;
}


.lf-step-text {
  color: #43506a;

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


.lf-info-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 10px;

  margin-top: 20px;
}


.lf-info-card {
  padding: 18px;

  background: #ffffff;

  border: 1px solid var(--math-line);
  border-radius: 13px;
}


.lf-info-card h2 {
  margin: 0 0 8px;

  font-size: 15px;
}


.lf-info-card p {
  margin: 0;

  color: var(--math-text-soft);

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


@media (max-width: 760px) {

  .lf-workspace {
    grid-template-columns: 1fr;
  }


  .lf-input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--math-line);
  }


  .lf-result-panel {
    min-height: 190px;
  }

}


@media (max-width: 520px) {

  .lf-tool-head {
    padding: 20px 18px;
  }


  .lf-tool-head h1 {
    font-size: 26px;
  }


  .lf-grade {
    display: none;
  }


  .lf-input-panel {
    padding: 20px 14px;
  }


  .lf-field {
    grid-template-columns: 1fr;

    gap: 6px;
  }


  .lf-point-row {
    grid-template-columns: 1fr;
  }


  .lf-result {
    font-size: 32px;
  }


  .lf-info-grid {
    grid-template-columns: 1fr;
  }

}
