.problembox,
.formulabox,
.widgetbox {
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.4rem 0;
}

.problembox {
  background: #f2f8ff;
  border: 1px solid #c8ddf2;
  border-left: 4px solid #2f78b7;
}

.formulabox {
  background: #fff8ef;
  border: 1px solid #ead2ad;
  border-left: 4px solid #c97828;
}

.widgetbox {
  background: #f8fbfe;
  border: 1px solid #d6e2ee;
}

/* Highlighted box for the original incorrect attempt (productive failure) */
.failbox {
  background: #fff5f5;
  border: 1px solid #f0c9c9;
  border-left: 4px solid #c0504d;
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.4rem 0;
}

/* Highlighted box for the corrected work */
.fixbox {
  background: #f3faf4;
  border: 1px solid #c9e4cd;
  border-left: 4px solid #4a9d5b;
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.4rem 0;
}

.box-label {
  display: block;
  margin-bottom: 0.4rem;
  color: #376f9f;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.formulabox .box-label {
  color: #a45d1c;
}

.widgetbox .box-label {
  color: #5f7284;
}

.failbox .box-label {
  color: #a83a37;
}

.fixbox .box-label {
  color: #3a7d49;
}

.problembox p:last-child,
.formulabox p:last-child,
.widgetbox p:last-child,
.failbox p:last-child,
.fixbox p:last-child {
  margin-bottom: 0;
}

.widgetbox input[type="range"] {
  accent-color: #2f78b7;
}

.js-plotly-plot,
svg.plot {
  max-width: 100%;
}

/* Let Observable Plot figures shrink to their flex containers so paired
   plots sit side by side instead of wrapping */
.widgetbox svg {
  max-width: 100%;
  height: auto;
}

/* Darker body text for readability against the light theme */
body {
  color: #1c2227;
}

body p,
body li,
body td,
main p,
main li {
  color: #1c2227;
}

/* Frame the main content column */
main#quarto-document-content,
main.content {
  border: 1px solid #d3dae1;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Landing page section cards */
.section-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.6rem 0;
}

.section-cards .card {
  flex: 1 1 240px;
  min-width: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d3dae1;
  border-left: 4px solid #2f78b7;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  background: #fbfdff;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.section-cards .card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.section-cards .card h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  color: #2f78b7;
  font-size: 1.1rem;
}

.section-cards .card p {
  margin-bottom: 0;
  font-size: 0.92rem;
}
