.common-tool {
  background: #ffffff;

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

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

  overflow: hidden;
}


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

  gap: 20px;

  padding: 25px 28px 20px;

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


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

  font-size: 30px;
}


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

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

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


.common-grade {
  flex: 0 0 auto;

  padding: 6px 9px;

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

  border-radius: 8px;

  color: #287a51;

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


.common-workspace {
  display: grid;

  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(320px, 0.8fr);

  gap: 0;
}


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

  padding: 25px 28px;

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


.common-input-panel h2 {
  margin: 0 0 20px;

  font-size: 16px;
}


.common-expression {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 24px;
}


.common-fraction-input {
  width: 110px;

  display: flex;
  flex-direction: column;
  align-items: stretch;
}


.common-fraction-input input {
  width: 100%;
  height: 48px;

  padding: 4px 8px;

  background: #ffffff;

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

  color: var(--math-text);

  text-align: center;

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

  outline: none;
}


.common-fraction-input input:focus {
  border-color: var(--math-primary);

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


.common-line {
  width: 100%;
  height: 2px;

  margin: 6px 0;

  background: var(--math-text);
}


.common-and {
  color: var(--math-text-soft);

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


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

  gap: 8px;

  margin-top: 22px;
}


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

  border: 0;
  border-radius: 9px;

  font-weight: 800;

  cursor: pointer;
}


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

  background: var(--math-primary);

  color: #ffffff;
}


.common-calculate:hover {
  filter: brightness(0.96);
}


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

  background: #eef1f6;

  color: #566176;
}


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

  color: #c0392b;

  text-align: center;

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


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

  min-height: 250px;

  padding: 24px;

  background: #f8faff;
}


.common-result-label {
  margin-bottom: 12px;

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

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


.common-result-row {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 14px;
}


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

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


.common-result-and {
  color: var(--math-text-soft);

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


.common-denominator-value {
  margin-top: 13px;

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

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


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

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


.common-steps-head {
  margin-bottom: 12px;
}


.common-steps-head h2 {
  margin: 0;

  font-size: 16px;
}


.common-steps-list {
  display: grid;

  gap: 7px;
}


.common-step {
  display: flex;

  gap: 12px;

  padding: 10px 12px;

  background: #f7f9fc;

  border-radius: 9px;
}


.common-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;
}


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

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


.common-info-grid {
  display: grid;

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

  gap: 10px;

  margin-top: 20px;
}


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

  background: #ffffff;

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


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

  font-size: 15px;
}


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

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

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


.common-related-link {
  display: inline-block;

  margin-top: 9px;

  color: var(--math-primary);

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


@media (max-width: 760px) {

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


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


  .common-input-panel {
    padding: 22px 18px;

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


  .common-result-panel {
    min-height: 170px;
  }


  .common-steps {
    padding: 20px 18px;
  }

}


@media (max-width: 520px) {

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


  .common-grade {
    display: none;
  }


  .common-input-panel {
    padding-left: 12px;
    padding-right: 12px;
  }


  .common-expression {
    gap: 12px;
  }


  .common-fraction-input {
    width: 95px;
  }


  .common-fraction-input input {
    height: 44px;

    font-size: 18px;
  }


  .common-and {
    font-size: 14px;
  }


  .common-result-value {
    font-size: 25px;
  }


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

}


@media (max-width: 380px) {

  .common-expression {
    gap: 8px;
  }


  .common-fraction-input {
    width: 82px;
  }


  .common-result-row {
    gap: 9px;
  }


  .common-result-value {
    font-size: 22px;
  }

}
