/* Integration by Parts: this page's own blocks. No colour is defined here: the meanings are in planning/colour.md and the
   values in the course palette (../lib/lesson-colors.css, through ../alive/lesson-look.css), for both themes.
     violet (\fd, lc-violet)  the factor we differentiate, and its derivative (x → 1, ln x → 1/x, f → f′, u → du);
     blue   (\gi, lc-blue)    the factor we integrate, and its antiderivative (eˣ → eˣ, x → x²/2, g′ → g, dv → v);
     green  (\I,  lc-green)   the integral that comes back, I, where it starts and where it returns.
   So fg − ∫ f′g dx shows by colour that the integrated factor is in both terms and the differentiated factor is itself in
   the first term and its derivative in the new integral. Goal rows, film problems and practice statements stay ink: the
   colour would make the choice before the student does. Every rule is scoped to main.col because the sheet styles
   outrank a plain page selector. */
.fq .say,figcaption,.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}

/* the choice: what gets differentiated and what gets integrated, the one decision of each worked step. Coloured maths on a
   white chip with a coloured outline, since coloured text on a tinted ground reads badly (Trigonometric Substitution) */
:root[data-alive-ui] body main.col .ibp-choice{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:10px 14px;margin:2px 0 16px}
:root[data-alive-ui] body main.col .ibp-choice:last-child{margin-bottom:2px}
:root[data-alive-ui] body main.col .ibp-choice>span{padding:6px 14px;border-radius:12px;background:var(--look-card);border:1.5px solid color-mix(in srgb,var(--lc-violet) 55%,var(--rule));white-space:nowrap}
:root[data-alive-ui] body main.col .ibp-choice>span.ibp-int{border-color:color-mix(in srgb,var(--lc-blue) 55%,var(--rule))}
:root[data-alive-ui] body main.col .ibp-choice .katex{font-size:1.06em}
:root[data-alive-ui] body main.col .look-case .ibp-choice{gap:8px 10px;margin-bottom:12px}
:root[data-alive-ui] body main.col .sol .ibp-choice{margin:10px 0 6px}
:root[data-alive-ui] body main.col .look-card .row.ibp-sep{margin-top:22px}
:root[data-alive-ui] body main.col .look-card .row.ibp-check .katex{font-size:1em}

/* a worked chain, one move per "=": two moves to a line on a wide screen, one on a phone, so nothing scrolls sideways */
:root[data-alive-ui] body main.col .ibp-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .ibp-wide{display:none}
  :root[data-alive-ui] body main.col .ibp-narrow{display:block}
}

/* a round of a repeated integration by parts: its name over its choice and its equation */
:root[data-alive-ui] body main.col .ibp-round+.ibp-round{margin-top:22px}
:root[data-alive-ui] body main.col .ibp-round>.ibp-head{font:500 17px/1.4 'STIX Two Text',Georgia,serif;color:var(--ink);margin:0 0 8px}

/* the tabular method: the signs, the derivatives down a violet-edged column, the antiderivatives down a blue-edged one,
   and an arrow for each diagonal, so the terms of the answer are read off the arrows */
:root[data-alive-ui] body main.col .ibp-tab{--rh:50px;display:grid;grid-template-columns:30px minmax(96px,auto) 128px minmax(96px,auto);grid-auto-rows:var(--rh);justify-content:center;align-items:stretch;margin:2px auto 4px;font-variant-numeric:tabular-nums}
:root[data-alive-ui] body main.col .ibp-tab>.s{grid-column:1;display:flex;align-items:center;justify-content:center;font:600 18px/1 var(--lf-label);color:var(--ink)}
:root[data-alive-ui] body main.col .ibp-tab>.d{grid-column:2}
:root[data-alive-ui] body main.col .ibp-tab>.i{grid-column:4}
:root[data-alive-ui] body main.col .ibp-tab>.h{display:flex;align-items:flex-end;justify-content:center;padding-bottom:6px}
:root[data-alive-ui] body main.col .ibp-tab>.c{display:flex;align-items:center;justify-content:center;padding:0 16px;background:var(--look-card);border:1.5px solid color-mix(in srgb,var(--lc-violet) 50%,var(--rule));border-top:0;border-bottom:0}
:root[data-alive-ui] body main.col .ibp-tab>.c.i{border-color:color-mix(in srgb,var(--lc-blue) 50%,var(--rule))}
:root[data-alive-ui] body main.col .ibp-tab>.c.ibp-first{border-top-width:1.5px;border-top-style:solid;border-radius:12px 12px 0 0}
:root[data-alive-ui] body main.col .ibp-tab>.c.ibp-last{border-bottom-width:1.5px;border-bottom-style:solid;border-radius:0 0 12px 12px}
:root[data-alive-ui] body main.col .ibp-tab .katex{font-size:1.12em}
/* the arrows are drawn 128 wide for 50 px rows, so the width stays 2.56 row heights at every size */
:root[data-alive-ui] body main.col .ibp-tab>svg{grid-column:3;grid-row:2/span 4;align-self:start;display:block;width:128px;height:auto;overflow:visible;color:var(--lc-mute)}
:root[data-alive-ui] body main.col .ibp-tabular>.row.ibp-sep{margin-top:18px}

/* a function known only by its values: a small table of them beside what else is given */
:root[data-alive-ui] body main.col .ibp-given{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:14px 40px}
:root[data-alive-ui] body main.col .ibp-given .math-chain{margin:0}
.ibp-values{border-collapse:separate;border-spacing:0;font:400 18px/1.3 'STIX Two Text',Georgia,serif;font-variant-numeric:tabular-nums;border:1px solid var(--look-edge,var(--rule));border-radius:12px;overflow:hidden;margin:0}
.ibp-values th,.ibp-values td{padding:8px 16px;text-align:center;min-width:46px}
.ibp-values th{background:var(--look-tint);font-weight:400}
.ibp-values tr+tr>*{border-top:1px solid var(--look-edge,var(--rule))}
.ibp-values th+td,.ibp-values td+td{border-left:1px solid var(--look-edge,var(--rule))}

/* Key concepts: a row's name over its maths, not beside it, since the maths is wider than the 120 px name column leaves
   room for in a two-column grid; the name keeps its case, because these names hold maths (ln x would become LN X) */
:root[data-alive-ui] body main.col .look-kgrid .kr{grid-template-columns:minmax(0,1fr);gap:4px}
:root[data-alive-ui] body main.col .look-kgrid .kr+.kr{margin-top:10px}
:root[data-alive-ui] body main.col .look-kgrid .kh{text-transform:none;letter-spacing:0;font:500 15px/1.4 var(--lf-label);color:var(--ink)}
:root[data-alive-ui] body main.col .look-kgrid .kv .math-chain{margin:0}
:root[data-alive-ui] body main.col .look-kgrid .ibp-choice{margin:0;gap:8px}
:root[data-alive-ui] body main.col .look-kgrid .ibp-choice>span{padding:4px 10px}
:root[data-alive-ui] body main.col .look-kgrid .ibp-tab{--rh:37.5px;grid-template-columns:24px minmax(68px,auto) 96px minmax(68px,auto)}
:root[data-alive-ui] body main.col .look-kgrid .ibp-tab>svg{width:96px}
:root[data-alive-ui] body main.col .look-kgrid .ibp-tab>.c{padding:0 10px}
:root[data-alive-ui] body main.col .look-kgrid .ibp-tab .katex{font-size:1.02em}
:root[data-alive-ui] body main.col .ibp-ktab{display:flex;flex-direction:column;align-items:center;gap:12px}
:root[data-alive-ui] body main.col .ibp-ktab>.look-krows{align-self:stretch}

/* practice: the answer reads as one line, its integral, the box, then the + C already written */
:root[data-alive-ui] body main.col .prob .answer-fields label{color:var(--ink);flex-wrap:wrap;row-gap:8px}
:root[data-alive-ui] body main.col .sol .sol-pieces{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 34px;margin:6px 0}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .ibp-tab{--rh:43.75px;grid-template-columns:26px minmax(76px,auto) 112px minmax(76px,auto)}
  :root[data-alive-ui] body main.col .ibp-tab>svg{width:112px}
  :root[data-alive-ui] body main.col .ibp-tab>.c{padding:0 10px}
  :root[data-alive-ui] body main.col .look-kgrid .ibp-tab{--rh:37.5px;grid-template-columns:24px minmax(68px,auto) 96px minmax(68px,auto)}
  :root[data-alive-ui] body main.col .look-kgrid .ibp-tab>svg{width:96px}
  :root[data-alive-ui] body main.col .prob .answer-fields label>input{flex:1 1 150px}
}

/* definitions side by side (t = x², dt = 2x dx, …), each kept whole and wrapping as a whole, so a list is never split at
   one of its own "=" signs */
:root[data-alive-ui] body main.col .ibp-defs{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 30px}
:root[data-alive-ui] body main.col .ibp-defs .katex{white-space:nowrap;font-size:1.1em}
:root[data-alive-ui] body main.col .sol .ibp-defs{margin:10px 0}
@media (max-width:640px){:root[data-alive-ui] body main.col .ibp-defs .katex{font-size:1em}}
/* Key concepts rows: separated by space, not a rule (one sat above the first row of every sheet) */
:root[data-alive-ui] body main.col .look-kgrid .kr{border-top:0;padding-top:0}
:root[data-alive-ui] body main.col .look-kgrid .kr+.kr{margin-top:16px}
/* two cases whose heights differ a lot: each card at its own height rather than one stretched empty */
:root[data-alive-ui] body main.col .look-compare.ibp-top{align-items:start}
