/* The calculators in resources/. Builds on ../css/site.css. */

.tool-card {
  margin-bottom: 1.5rem;
  padding: clamp(1.35rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}

.tool-card label:last-of-type {
  margin-bottom: 1.25rem;
}

/* Dripper calculator: the three inputs side by side once there's room. */
@media (min-width: 760px) {
  .tool-inputs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .tool-inputs label,
  .tool-inputs label:last-of-type {
    margin: 0;
  }
}

.tool-totals {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 560px) {
  .tool-totals {
    grid-template-columns: 1fr 1fr;
  }
}

.tool-total {
  display: grid;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
}

.tool-total-label {
  font-size: 0.85rem;
  font-weight: 560;
}

.tool-total-value {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.tool-table th,
.tool-table td {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tool-table th:first-child,
.tool-table td:first-child {
  text-align: left;
}

.tool-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

/* Pump calculator: one narrow card. */
.tool-narrow {
  max-width: 30rem;
}

.tool-narrow .btn {
  font-family: inherit;
  cursor: pointer;
}

.tool-result {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
}

.tool-result p {
  margin: 0;
  color: var(--muted);
}

.tool-result .is-error {
  color: #b42318;
  font-weight: 560;
}

.tool-result-label {
  display: block;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 650;
}

.tool-result-value {
  display: block;
  color: var(--ink);
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
