/* Moles and Mass Balance (CHE7403 refresher)
   Layout only - every colour comes from the model-shell palette at runtime.
   Same layout as squeeze-the-headspace.css. */

.mbl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.mbl-layout > * {
  min-width: 0;
}

/* Elements with their own display value would otherwise ignore the hidden attribute. */
.mbl-layout [hidden] {
  display: none !important;
}

.mbl-stage {
  display: block;
  width: 100%;
  height: 420px;
}

/* The verdict is the most important thing on the page, so it is the largest text. */
.mbl-verdict {
  margin: 0.5rem 0 0.4rem;
  padding: 0.5rem 0.8rem;
  border: 3px solid;
  border-radius: 10px;
}

.mbl-verdict-main {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}

.mbl-verdict-sub {
  display: block;
  font-size: 1.05rem;
  margin-top: 0.15rem;
}

.mbl-stats {
  list-style: none;
  margin: 0.2rem 0 0.4rem;
  padding: 0;
}

.mbl-stats li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0;
  font-size: 1.02rem;
}

.mbl-swatch {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid;
  border-radius: 3px;
}

.mbl-swatch--dot {
  border-radius: 50%;
}

.mbl-eq-scroll {
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.mbl-eq {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: auto auto auto;
  justify-content: start;
  align-items: center;
  column-gap: 0.55rem;
  row-gap: 0.15rem;
  width: max-content;
  margin-top: 0.3rem;
}

.mbl-eq:empty {
  display: none;
}

.mbl-eq-head {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  align-self: end;
}

.mbl-eq-sym {
  font-size: 1.3rem;
  text-align: center;
  white-space: nowrap;
}

.mbl-eq-val {
  font-size: 1.05rem;
  text-align: center;
  white-space: nowrap;
}

.mbl-eq-res {
  font-weight: 800;
}

.mbl-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
}

.mbl-frac > span:first-child {
  border-bottom: 1.5px solid currentColor;
  padding: 0 0.2rem;
}

.mbl-frac > span:last-child {
  padding: 0 0.2rem;
}

.mbl-foot {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
}

.mbl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.mbl-tab {
  flex: 1 1 8rem;
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.45rem 0.5rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.mbl-sub {
  margin: 0 0 0.3rem;
  font-weight: 700;
}

.mbl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.mbl-chip {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.3rem 0.65rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.mbl-slider {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) 8.6rem;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.mbl-slider label {
  font-weight: 800;
}

.mbl-slider input {
  width: 100%;
}

.mbl-val {
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.mbl-guide {
  margin: 0.4rem 0 0.6rem;
  line-height: 1.5;
}

.mbl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.mbl-go {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .mbl-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .mbl-verdict-main {
    font-size: 1.35rem;
  }
}

@media (max-width: 480px) {
  .mbl-slider {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "label value" "input input";
    row-gap: 0.2rem;
  }
  .mbl-slider label {
    grid-area: label;
  }
  .mbl-slider input {
    grid-area: input;
  }
  .mbl-val {
    grid-area: value;
  }
}
