/* Capacity calculator (reference/capacity-calculator.md).
   Uses the Material theme variables so it follows the light / dark scheme. */

.mb-calc {
  --mb-pics: #e8912d;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  margin: 1.5em 0;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
  background: var(--md-default-bg-color);
  overflow: hidden;
}

.mb-calc__inputs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border-right: 1px solid var(--md-default-fg-color--lightest);
}

.mb-calc__group {
  padding-top: 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.mb-calc__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem;
  gap: 0.6rem;
  align-items: center;
}

.mb-calc__field label {
  font-size: 0.7rem;
  line-height: 1.35;
}

.mb-calc__field label small {
  display: block;
  font-size: 0.6rem;
  color: var(--md-default-fg-color--light);
}

.mb-calc__field input {
  width: 100%;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
  background: var(--md-code-bg-color);
  color: var(--md-default-fg-color);
  font-family: var(--md-code-font-family);
  font-size: 0.7rem;
  text-align: right;
}

.mb-calc__field input:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 1px;
}

.mb-calc__out {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1rem;
}

.mb-calc__kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.mb-calc__kpi {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.3rem;
}

.mb-calc__kpi--main {
  grid-column: 1 / -1;
  border-color: transparent;
  background: var(--md-accent-fg-color--transparent);
}

.mb-calc__l {
  font-size: 0.62rem;
  color: var(--md-default-fg-color--light);
}

.mb-calc__v {
  font-family: var(--md-code-font-family);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mb-calc__kpi--main .mb-calc__v {
  font-size: 1.5rem;
}

.mb-calc__gauge {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.65rem;
}

.mb-calc__row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--md-default-fg-color--light);
  font-variant-numeric: tabular-nums;
}

.mb-calc__track {
  position: relative;
  height: 0.9rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
  background: var(--md-code-bg-color);
  overflow: hidden;
}

.mb-calc__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--tf-deep-blue);
}

.mb-calc__fill--pics,
.mb-calc__sw--pics {
  background: var(--mb-pics);
}

.mb-calc__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--md-default-fg-color--light);
}

.mb-calc__sw {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--tf-deep-blue);
}

.md-typeset .mb-calc__note {
  margin: 0;
  font-size: 0.68rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .mb-calc .md-button {
  margin: 0;
  padding: 0.35em 1em;
  font-size: 0.65rem;
  cursor: pointer;
}

@media screen and (max-width: 44.9375em) {
  .mb-calc {
    grid-template-columns: 1fr;
  }

  .mb-calc__inputs {
    border-right: 0;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
  }
}
