/* Average and Instantaneous Rate of Change: this page's layout. Its colours are the course palette's
   (../lib/lesson-colors.css, through alive/lesson-look.css); planning/colour.md says which meaning takes which role:
     pink   (\rise, lc-pink)   the rise: the top of every average, coloured whole while it is still the top;
     blue   (\run,  lc-blue)   the run: the bottom of every average, and h as the interval's length or given a value;
     violet (\pa,   lc-violet) the fixed point, where the rate is asked: (3, 9), (a, f(a)), s(3) = 9, f(2) = 1/2;
     orange (\pb,   lc-orange) the second point, the one that moves in, and its secant: (5, 25), (b, f(b)), (a + h, f(a + h));
     green  (\tng,  lc-green)  the tangent line only (figures, films, cards; no row or answer is green).
   Pink over blue is the page's relation (rise over run), so they are the far-apart pair. Answers, units and routine
   steps inside the top stay ink. */
.fq .say,figcaption,.el>.lab .t,.lab .t,.kc .knote,.hint,.feedback-copy{color:var(--body)!important}
figcaption{font-style:normal!important}
.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: beside the maths on a wide screen, above it on a phone */
:root[data-alive-ui] body main.col .look-card .row.rc-lab{display:flex;align-items:baseline;gap:4px 18px;flex-wrap:wrap}
:root[data-alive-ui] body main.col .rc-lab>.row-label{font:500 15px/1.4 var(--lf-label);color:var(--ink);min-width:0}
:root[data-alive-ui] body main.col .look-card .row.rc-gap{margin-top:20px}
/* a reminder row the next row uses ((3 + h)² expanded): the same card, a little quieter in size */
:root[data-alive-ui] body main.col .look-card .row.rc-remind .katex{font-size:1em}

/* a chain: as many "=" to a line as read as one move on a wide screen, one "=" to a line on a phone, so nothing
   scrolls sideways (Trigonometric Substitution's tsx-wide / tsx-narrow) */
/* !important: a labelled row's own display (flex) would otherwise outrank the switch and show both versions */
@media (min-width:761px){:root[data-alive-ui] body main.col .rc-narrow{display:none!important}}
@media (max-width:760px){:root[data-alive-ui] body main.col .rc-wide{display:none!important}}

/* a single statement the sentence before it leads to (0/0, the velocity at t = 3, the four values of 6 + h): on its own
   line, centred and quiet, not a block of its own, as a part's goal row is */
:root[data-alive-ui] body main.col .rc-eq{width:fit-content;max-width:100%;margin:18px auto 22px}
:root[data-alive-ui] body main.col .rc-eq .katex{font-size:1.1em}
@media (max-width:640px){:root[data-alive-ui] body main.col .rc-eq .katex{font-size:1em}}
/* the four values of 6 + h, two by two: the positive h on one row, the negative h under them */
:root[data-alive-ui] body main.col .rc-chips{display:grid;grid-template-columns:repeat(2,auto);justify-content:center;gap:8px 44px}
:root[data-alive-ui] body main.col .rc-chips>span{white-space:nowrap}

/* tables of data, in the page's serif: the averages near t = 3 (one small table on each side) and the given tables */
:root[data-alive-ui] body main.col .rc-tab{border-collapse:collapse;margin:0 auto;font:400 17px/1.4 'STIX Two Text',Georgia,serif;color:var(--ink)}
:root[data-alive-ui] body main.col .rc-tab th{font:500 15px/1.35 var(--lf-label);color:var(--ink);text-align:left;padding:6px 14px 6px 0;border-bottom:1px solid var(--look-edge)}
:root[data-alive-ui] body main.col .rc-tab td{padding:7px 14px 7px 0;border-bottom:1px solid color-mix(in srgb,var(--rule) 60%,transparent)}
:root[data-alive-ui] body main.col .rc-tab tr:last-child td{border-bottom:0}
:root[data-alive-ui] body main.col .rc-tab .katex{font-size:1.05em}
/* a given table read across: a heading column, then the values centred in their columns */
:root[data-alive-ui] body main.col .rc-tab.rc-across th{border-bottom:0;border-right:1px solid var(--look-edge);padding-right:16px;white-space:nowrap}
:root[data-alive-ui] body main.col .rc-tab.rc-across td{text-align:center;padding:7px 12px;min-width:34px}
:root[data-alive-ui] body main.col .rc-tab.rc-across tr:first-child :is(th,td){border-bottom:1px solid var(--look-edge)}
:root[data-alive-ui] body main.col .rc-tab.rc-across tr:last-child :is(th,td){border-bottom:0}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .rc-tab.rc-across td{padding:7px 9px;min-width:0}
  :root[data-alive-ui] body main.col .rc-tab.rc-across th{padding-right:8px;font-size:14px}
}
:root[data-alive-ui] body main.col .look-card:has(>.rc-tab){padding:14px 24px}
:root[data-alive-ui] body main.col .rc-tabwrap{overflow-x:auto}
/* the two sides near t = 3: one small table in each case card, each read toward t = 3 */
:root[data-alive-ui] body main.col .look-case>.look-q{font:500 15px/1.4 var(--lf-label);color:var(--ink);text-align:center;margin-bottom:8px}

/* the general limit with its picture under it: one card, the figure at its own size */
:root[data-alive-ui] body main.col .look-card>figure.diagram{margin:14px auto 0;width:fit-content;max-width:100%}
:root[data-alive-ui] body main.col .look-card>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block}
/* §1: the secant beside its slope, the figure at its own 360 px */
:root[data-alive-ui] body main.col .look-pair.rc-secant{grid-template-columns:auto minmax(0,1fr);gap:8px 20px}
@media (max-width:760px){:root[data-alive-ui] body main.col .look-pair.rc-secant{grid-template-columns:1fr}}
:root[data-alive-ui] body main.col .look-pair.rc-secant .look-rows{display:flex;justify-content:center}

/* Key concepts: a figure above its words, at its own size; a label above its row */
:root[data-alive-ui] body main.col .look-kgrid .rc-kfig{margin:0 auto 12px;width:fit-content;max-width:100%}
:root[data-alive-ui] body main.col .look-kgrid .rc-kfig>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block}
: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 .rc-lab>.row-label{display:block;font:500 14px/1.4 var(--lf-label);color:var(--ink);margin:0 0 2px}

/* practice: a given table or graph sits under the statement, in line with the answer row */
:root[data-alive-ui] body main.col .prob .rc-given{margin:14px 0 8px 44px;width:fit-content;max-width:calc(100% - 44px)}
:root[data-alive-ui] body main.col .prob .rc-given>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block}
:root[data-alive-ui] body main.col .prob .answer-fields label{display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .prob .rc-given{margin-left:0;max-width:100%}
  /* the part's name and its field stay on one line; the unit follows, or wraps under them (the shared phone rule made
     the field 100% wide, which left "(a)" alone on a line above it) */
  :root[data-alive-ui] body main.col .prob .answer-fields label{display:flex;width:100%}
  :root[data-alive-ui] body main.col .prob .answer-fields label>input{flex:1 1 100px;width:auto;min-width:0}
}
