/* Step-by-Step Result UI */
.step-result-panel {
  margin: 14px 0 22px;
  padding: 14px;
  border: 1px solid #d8e5e1;
  border-radius: 10px;
  background: #f8fcfa;
  color: #172522;
  font-family: inherit;
}

.step-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.step-actions-top {
  display: flex;
  gap: 9px;
  width: 100%;
  align-items: stretch;
}

.step-actions-bottom {
  display: flex;
  justify-content: center;
  width: 100%;
}

.step-actions-bottom .step-pdf {
  flex: 0 1 44%;
  width: 44% !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.step-actions button {
  border: 0;
  border-radius: var(--step-button-radius, 6px);
  padding: 7px 10px;
  background: var(--step-button-bg, #008080);
  color: var(--step-button-color, #fff);
  transition: background-color 0.2s, transform 0.2s;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  width: auto !important;
  margin: 0 !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

.step-actions button:hover {
  background: var(--step-button-hover-bg, var(--step-button-bg, #008080));
  transform: translateY(-2px);
}

.step-actions button:active {
  background: var(--step-button-active-bg, var(--step-button-hover-bg, #006666));
  transform: translateY(0);
}

.step-actions button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.step-content {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #d8e5e1;
  font-size: var(--step-text-size, 15px);
  line-height: var(--step-line-height, 1.65);
}

.step-content[hidden] {
  display: none;
}

.step-content h3 {
  margin: 12px 0 6px;
  color: var(--step-heading-color, #075b49);
  font-size: 17px;
}

.step-content ol {
  margin: 6px 0 12px;
  padding-left: 22px;
}

.step-content li,
.step-content p {
  margin: 5px 0;
  font-size: inherit;
  line-height: inherit;
}

@media (max-width: 600px) {
  .step-result-panel {
    padding: 11px;
  }

  .step-actions-top button {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 4px;
    min-height: 35px;
    width: auto !important;
    margin: 0 !important;
    font-size: 13px;
  }

  .step-actions-bottom .step-pdf {
    flex: 0 1 44%;
    width: 44% !important;
    margin: 0 !important;
    padding: 7px 4px;
    min-height: 35px;
    font-size: 13px;
  }
}

/* Preserve the existing collapsible Calculation Steps behavior. */
.result .steps {
  display: none !important;
}

#formula-display,
#formulaOutput,
#date-formula,
#days-formula {
  display: none !important;
}
