/* Definition of the Derivative: this page's layout. Colours come only from the course palette (../lib/lesson-colors.css,
   through ../alive/lesson-look.css); planning/colour.md says which meaning takes which role:
     pink   (\rise)  the rise, the top of the difference quotient, while it is still the rise;
     blue   (\hh)    h, the run, and its other name x − a;
     green  (\dv)    f′ in every name, the value a limit gives, and every tangent line;
     violet (\fc)    f itself: its formula, its graph, its points and its height f(a);
     orange (\inp)   the new input x + h in each slot where f(x + h) is written. */
.fq .say,figcaption,.el>.lab .t,.lab .t,.kc .knote,.hint,.feedback-copy{color:var(--body)!important}
figcaption{font-style:normal!important}
h3.sub{font:500 22px/1.3 'STIX Two Text',Georgia,serif;color:var(--ink);margin:40px 0 2px}
.sol .ln .step{display:block;font:500 17px/1.4 'STIX Two Text',Georgia,serif;letter-spacing:0;text-transform:none;color:var(--ink);margin:0 0 2px}
.sol .ln+.ln{margin-top:14px}

/* a row with a short label: the label beside the maths on a wide screen, above it on a phone */
:root[data-alive-ui] body main.col .look-card .row.dd-lab{display:flex;align-items:baseline;gap:6px 18px;flex-wrap:wrap}
:root[data-alive-ui] body main.col .dd-lab>.row-label{font:500 15px/1.4 var(--lf-label);color:var(--ink);min-width:132px}
:root[data-alive-ui] body main.col .look-card .row.dd-gap{margin-top:20px}
/* a reminder row the next row uses (a square, the conjugate, a cube): the same card, a little quieter in size */
:root[data-alive-ui] body main.col .look-card .row.dd-remind .katex{font-size:1em}

/* A chain: on a wide screen it holds as many "=" as read as one move; on a phone the same chain breaks one "=" to a
   line, so nothing scrolls sideways (the Trigonometric Substitution page's tsx-wide / tsx-narrow); the switch is at 760 px, where the wide √x chain stops fitting its card. */
:root[data-alive-ui] body main.col .dd-narrow{display:none}
@media (max-width:760px){
  :root[data-alive-ui] body main.col .dd-wide{display:none}
  :root[data-alive-ui] body main.col .dd-narrow{display:block}
}

/* the secant beside its rows (§1): the figure at its own 390 px, the rows in what's left (the shared pair's 0.9fr
   column scaled it to 264 px and its 17 px labels to 11 px) */
:root[data-alive-ui] body main.col .look-pair.dd-secant{grid-template-columns:auto minmax(0,1fr);gap:8px 16px;padding-right:18px}
@media (max-width:760px){:root[data-alive-ui] body main.col .look-pair.dd-secant{grid-template-columns:1fr}}
/* a Key concepts figure above its rows, at its own size */
:root[data-alive-ui] body main.col .look-kgrid .dd-kfig{margin:0 auto 12px;width:fit-content;max-width:100%}
:root[data-alive-ui] body main.col .look-kgrid .dd-kfig>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block}

/* §5 and Key concepts: the secant beside its two forms; the rows are narrower here, so each label sits above its row */
:root[data-alive-ui] body main.col .look-pair .look-rows .row.dd-lab{display:block}
:root[data-alive-ui] body main.col .look-pair .look-rows .dd-lab>.row-label{display:block;margin:0 0 2px}
:root[data-alive-ui] body main.col .look-pair .look-rows .row+.row{margin-top:20px}
:root[data-alive-ui] body main.col .look-kgrid .look-krows .row+.row{margin-top:10px}
:root[data-alive-ui] body main.col .look-kgrid .look-krows .dd-lab>.row-label{display:block;min-width:0;font-size:14px;margin:0 0 2px}

/* Practice 7: the graph of f, then the four candidate graphs of f′ as choices, two to a row */
:root[data-alive-ui] body main.col .prob .dd-given{margin:14px 0 6px 44px;width:fit-content;max-width:calc(100% - 44px)}
:root[data-alive-ui] body main.col .prob .dd-given>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block}
:root[data-alive-ui] body main.col .prob .choices.dd-graphs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:560px}
:root[data-alive-ui] body main.col .prob .choices.dd-graphs label{flex-direction:column;align-items:stretch;min-width:0;width:auto;margin:0;padding:8px 10px 6px}
:root[data-alive-ui] body main.col .prob .choices.dd-graphs .dd-choice-head{display:flex;align-items:center;gap:8px;font:500 16px/1.2 'STIX Two Text',Georgia,serif;color:var(--ink)}
:root[data-alive-ui] body main.col .prob .choices.dd-graphs svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .prob .dd-given{margin-left:0;max-width:100%}
  :root[data-alive-ui] body main.col .prob .choices.dd-graphs{grid-template-columns:1fr;gap:8px}
}
/* §5: the secant with both labels, then the two forms side by side under it (beside the 390 px figure each form had
   about 214 px and KaTeX broke it inside itself); on a phone the forms stack */
:root[data-alive-ui] body main.col .dd-forms>figure.diagram{margin:0 auto 10px;width:fit-content;max-width:100%}
:root[data-alive-ui] body main.col .dd-forms>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block}
:root[data-alive-ui] body main.col .dd-two{display:grid;grid-template-columns:1fr 1fr;gap:12px 24px}
:root[data-alive-ui] body main.col .dd-two>.row.dd-lab{display:block;margin:0}
:root[data-alive-ui] body main.col .dd-two>.row.dd-lab>.row-label{display:block;margin:0 0 4px}
@media (max-width:640px){:root[data-alive-ui] body main.col .dd-two{grid-template-columns:1fr}}
/* on a phone a Key concepts figure takes the card's side padding too, so the secant's 17 px labels stay above 13 px */
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-kgrid .dd-kfig{margin:0 -14px 12px;max-width:calc(100% + 28px)}
}
