#protocol-calculator { scroll-margin-top: 6rem; }

.protocol-calculator {
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--white);
}

.protocol-calculator [hidden] { display: none; }
.protocol-grid { display: grid; gap: 1rem; }
.protocol-calculator .protocol-grid { margin-block: 1rem; }
.protocol-field { min-width: 0; }
.protocol-field label {
  display: block;
  margin-bottom: .35rem;
  color: var(--ink);
  font-weight: 600;
}
.protocol-field input {
  width: 100%;
  min-height: 44px;
  padding: .55rem .65rem;
  border: 1px solid var(--muted);
  border-radius: .3rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}
.protocol-field small { display: block; margin-top: .4rem; line-height: 1.5; }
.protocol-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.protocol-actions .button {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.protocol-actions .protocol-example {
  border-color: var(--teal);
  background: var(--white);
  color: var(--teal);
}
.protocol-results {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border-radius: .35rem;
  background: var(--pale);
}
.protocol-results h3 { margin: 0 0 .5rem; font-size: 1rem; }
.article-body .protocol-balance {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem .75rem;
  margin: .75rem 0 .5rem;
  padding: .65rem .75rem;
  border-radius: .25rem;
  background: var(--white);
  color: var(--ink);
}
.protocol-balance[data-state="remaining"] { background: #e5f4ea; color: #246345; }
.protocol-balance[data-state="over"] { background: #fff0e5; color: #a13d17; }
.protocol-balance strong { color: inherit; }
.protocol-results dl { margin: 0; }
.protocol-results dl > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .125rem .75rem;
  padding-block: .55rem;
  border-top: 1px solid var(--line);
}
.protocol-results dd { margin: 0; font-weight: 600; }
@media (min-width: 650px) {
  .protocol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .protocol-actions .button { width: 100%; }
}
