/* Calculus I pages: the slider panels and a few layout rules. Colours follow the site variables, light and dark. */
.cl-lab { min-width: 0; display: grid; gap: 10px; }
.cl-lab.cl-on { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 14px 12px; }
.cl-stage { display: grid; gap: 6px; min-width: 0; overflow: hidden; }
.cl-plot { display: block; width: 100%; height: auto; font-family: var(--body); }
.cl-plot.cl-drag { touch-action: pan-y; cursor: ew-resize; user-select: none; }
.cl-grid { stroke: var(--rule); stroke-width: 1; }
.cl-axis { stroke: var(--muted); stroke-width: 1.2; }
.cl-tick { fill: var(--muted); font-size: 12px; }
.cl-label { fill: var(--fg); font-size: 12.5px; }
.cl-curve { fill: none; stroke: var(--cm); stroke-width: 2.4; }
.cl-curve2 { fill: none; stroke: var(--diff); stroke-width: 2.4; }
.cl-bar { fill: var(--cm); fill-opacity: 0.2; stroke: var(--cm); stroke-width: 1; }
.cl-bar.cl-thin { stroke-width: 0.35; }
.cl-sample { fill: var(--cm); r: 2.6px; }
.cl-area { fill: var(--cm); fill-opacity: 0.25; stroke: none; }
.cl-mark { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 4; }
.cl-secant { stroke: var(--target); stroke-width: 2; stroke-dasharray: 8 4; }
.cl-tangent { stroke: var(--atom); stroke-width: 2.4; }
.cl-dot { fill: var(--atom); }
.cl-dot2 { fill: var(--target); }
.cl-controls { display: grid; gap: 10px; }
.cl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline; }
.cl-row label { font: 500 13.5px var(--body); }
.cl-value { font: 500 13px var(--mono); }
.cl-row input[type="range"] { grid-column: 1 / -1; width: 100%; min-width: 0; height: 32px; margin: 0; accent-color: var(--cm); }
.cl-choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; min-width: 0; }
.cl-choice legend { padding: 0 0 4px; font-weight: 500; }
.cl-choice label, .cl-check { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; font-size: 13.5px; }
.cl-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cl-button { font: 500 13.5px var(--body); color: var(--fg); background: var(--chip); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; min-height: 34px; cursor: pointer; }
.cl-lab input:focus-visible, .cl-button:focus-visible { outline: 3px solid var(--cm); outline-offset: 2px; }
.cl-readout { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.cl-readout div { background: var(--inset); border: 1px solid var(--rule); border-radius: 8px; padding: 7px 10px; }
.cl-readout dt { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.cl-readout dd { margin: 2px 0 0; font: 500 15px var(--mono); }
.cl-hint { font-size: 13.5px; color: var(--muted); }

.series { display: flex; flex-wrap: wrap; gap: 8px; max-width: none; padding: 0; margin: 0; list-style: none; }
.series li { flex: 1 1 200px; min-width: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; font-size: 14px; line-height: 1.4; }
.series li[aria-current="page"] { border-color: var(--cm); border-width: 2px; }
.exercise { display: grid; gap: 8px; }
.exercise details { background: var(--inset); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 14px; max-width: 78ch; min-width: 0; }
.exercise details > div { display: grid; gap: 8px; padding-top: 8px; min-width: 0; }
.exercise summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
.article .math-steps { grid-template-columns: minmax(0, 1fr); }
.article .math-steps li { min-width: 0; }
.article p, .article figcaption, .article .sx, .exercise details > div { min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 1px; }
.article math[display="block"] { padding: 2px 0; }
.eq-box { min-width: 0; }
@media print { .cl-controls { display: none; } }
.article th, .article td.num, .article th.num { overflow-wrap: normal; }
@media (max-width: 560px) {
  .article .tablewrap { padding: 8px 6px; }
  .article table { font-size: 12px; }
  .article th, .article td { padding: 6px 3px; }
  .article th { font-size: 11.5px; line-height: 1.35; }
  .article td.num, .article th.num { font-size: 11px; }
  .article th.num { white-space: normal; font-family: var(--display); }
  .article .eq-box { padding: 12px 10px; }
}
.article figure.diagram-box { margin: 0; }
@media (max-width: 560px) { .article figure.diagram-box { padding: 10px 6px; } }
