/* U-Substitution: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   The colour macros (katex-macros.json), one per meaning in planning/colour.md:
     \iu  pink    u, the inside it stands for, and the values u takes (the u-bounds)
     \dv  blue    the derivative factor and the du it becomes, in the integrand and under du where it cancels
     \lo  green   anything left over in x after substituting, and its u form while it stands as itself
     \nf  orange  the number (or sign) that comes out in front of the integral once the derivative has cancelled
   Every card that works a substitution opens with the substitution itself (u, du, dx) as chips in a quiet outlined
   box, then the chain that uses it, one move per "=", two to a line on a wide screen and one on a phone. */

/* a chain: the wide and the narrow break of the same maths, one shown per width */
:root[data-alive-ui] body main.col .usb-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .usb-wide{display:none}
  :root[data-alive-ui] body main.col .usb-narrow{display:block}
}

/* the substitution: its pieces as chips that wrap whole, in a neutral outline (coloured text on a neutral ground) */
:root[data-alive-ui] body main.col .usb-sub{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:6px 28px;width:fit-content;max-width:100%;margin:2px auto 16px;padding:8px 20px;border-radius:12px;border:1.5px solid var(--look-edge,var(--rule));background:var(--look-card)}
:root[data-alive-ui] body main.col .usb-sub .usb-break{flex-basis:100%;height:0}
:root[data-alive-ui] body main.col .usb-chip{white-space:nowrap}
:root[data-alive-ui] body main.col .usb-chip .katex{font-size:1.08em}
:root[data-alive-ui] body main.col .look-card>.usb-sub:last-child{margin-bottom:2px}
:root[data-alive-ui] body main.col .look-card .row.usb-gap{margin-top:18px}
:root[data-alive-ui] body main.col .look-krows .usb-sub{margin:0 0 10px;padding:6px 14px;gap:4px 20px}
:root[data-alive-ui] body main.col .look-krows .usb-chip .katex{font-size:1em}
:root[data-alive-ui] body main.col .sol .usb-sub{margin:8px 0 6px;justify-content:flex-start}

/* a one-line reminder or result that isn't a block of its own: centred, full size, not lit */
:root[data-alive-ui] body main.col .usb-line{margin:16px 0 20px;text-align:center}
:root[data-alive-ui] body main.col .usb-line .math-chain{justify-content:center}
:root[data-alive-ui] body main.col .usb-line .katex{font-size:1.1em}

/* an indefinite answer reads as one line: the integral, the box, then + C */
:root[data-alive-ui] body main.col .prob .answer-fields label{display:flex;flex-wrap:nowrap;align-items:center;gap:10px;max-width:100%}
:root[data-alive-ui] body main.col .prob .answer-fields label input{flex:0 1 auto;min-width:0}
:root[data-alive-ui] body main.col .prob .answer-fields label .katex{white-space:nowrap}
:root[data-alive-ui] body main.col .look-card .usb-sub.usb-mid{margin-top:16px}
:root[data-alive-ui] body main.col .look-card>.usb-sub:only-child{border:0;padding:0;margin:0 auto}

/* rows sit centred under their substitution box, the same axis as the goal rows and posters */
:root[data-alive-ui] body main.col .look-card>.row{text-align:center}
:root[data-alive-ui] body main.col .look-card>.row .math-chain{justify-content:center}
/* Key concepts title with maths in it: one run of text, not flex items (the shared .kn is a flex row) */
:root[data-alive-ui] body main.col .look-kgrid .kn>span{display:block}
/* Key concepts 7 on a phone: each case's result under its integral, so a result never breaks inside itself */
:root[data-alive-ui] body main.col .look-three-k .look-cell .katex{white-space:nowrap}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-three-k .look-col{flex-direction:column}
  :root[data-alive-ui] body main.col .look-three-k .look-head{flex:none;border-right:0;border-bottom:1px solid var(--look-edge)}
}
