.concept-explorer {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid #6d9387;
  border-radius: 16px;
  background: #f1f7f4;
  color: #102a43;
}

.concept-explorer h2 { margin: 0 0 .55rem; }
.concept-explorer p { margin: .35rem 0 1rem; }

.formula-box--stacked {
  display: grid;
  gap: .9rem;
  align-items: center;
}

.formula-box--stacked math {
  min-height: 2.2em;
  margin: 0;
  overflow: visible;
  line-height: 1.5;
}

.entry-content .formula-box {
  box-sizing: border-box;
  width: 100%;
  margin: 1.5rem 0;
  padding: 1.1rem 1.35rem;
  overflow: visible;
}

.entry-content .formula-box math {
  max-width: 100%;
  padding: .2rem 0;
  overflow: visible;
}

.entry-content .formula-box math + math {
  margin-top: .85rem;
}

.entry-content .formula-box--products mtr + mtr > mtd {
  padding-block-start: .9em;
}

.worked-solution {
  margin: 2rem 0;
}

.worked-solution ol {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.worked-solution li {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding-left: .35rem;
}

.worked-solution .formula-box {
  margin: .55rem 0 0;
  padding: .8rem 1rem;
  overflow-x: auto;
}

.worked-solution--extended {
  padding: 1.25rem 1.35rem;
  border-left: 5px solid #21835f;
  border-radius: 10px;
  background: #f1f7f4;
}

.worked-solution--extended h2,
.worked-solution--extended h3 {
  margin-top: 0;
}

@media (max-width: 600px) {
  .entry-content .formula-box {
    padding: 1rem;
  }
}

.concept-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, .8fr);
  gap: 1.25rem;
  align-items: start;
}

.concept-stage {
  display: flex;
  min-height: 330px;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  border: 2px solid #53796f;
  border-radius: 14px;
  background: #e5f0ec;
}

.concept-stage svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 310px;
}

.concept-controls {
  display: grid;
  gap: 1rem;
}

.concept-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
  font-weight: 700;
}

.concept-control output {
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.concept-control input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px;
}

.concept-result {
  margin-top: 1rem;
  padding: .85rem 1rem;
  overflow-wrap: anywhere;
  border-left: 5px solid #21835f;
  border-radius: 8px;
  background: #dbece5;
  font-weight: 700;
}

.concept-stage text { fill: #102a43; font: 600 16px system-ui, sans-serif; }
.concept-stage .line { fill: none; stroke: #163f35; stroke-width: 4; }
.concept-stage .accent { fill: none; stroke: #1769aa; stroke-width: 5; }
.concept-stage .fill { fill: #a9d3c4; stroke: #163f35; stroke-width: 3; }
.concept-stage .hot { fill: #f0a34a; stroke: #9a4b00; stroke-width: 2; }

.concept-truth {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.concept-truth th,
.concept-truth td {
  padding: .55rem;
  border: 1px solid #78958d;
  text-align: center;
}

.concept-truth th { background: #d3e8e0; }

.dark .concept-explorer { border-color: #79ad9e; background: #102f27; color: #f6fbf9; }
.dark .concept-stage { border-color: #79ad9e; background: #183e34; }
.dark .concept-stage text { fill: #f6fbf9; }
.dark .concept-stage .line { stroke: #d6eee7; }
.dark .concept-stage .fill { fill: #2e6f5d; stroke: #d6eee7; }
.dark .concept-result { background: #174c3e; color: #fff; }
.dark .concept-truth { background: #173d34; color: #fff; }
.dark .concept-truth th { background: #245b4c; }
.dark .worked-solution--extended { background: #102f27; color: #f6fbf9; }

@media (max-width: 760px) {
  .concept-grid { grid-template-columns: 1fr; }
  .concept-stage { min-height: 260px; }
  .concept-explorer { padding: 1rem; }
}
