/* Improper Integrals: this page's own layout on the shared lesson look (../alive/lesson-look.css). No colours here: the
   colour macros in katex-macros.json map each meaning to the course palette's class (../lib/lesson-colors.css), which
   paints both themes. Meanings (planning/colour.md):
     \edge   green   the moving end, b or a, everywhere it appears
     \fin    blue    a function whose area over the interval in question is finite
     \infa   pink    a function whose area over the interval in question is infinite
     \addp   orange  the part that is added, in a sum the page cancels or combines (y = x above the axis, ln(b − 1))
     \subp   violet  the part that is subtracted (y = x below the axis, ln(b + 1))
   Every rule is scoped :root[data-alive-ui] body main.col, since the sheet styles outrank a plain page selector. */

/* a figure beside its rows, drawn near its own size: the shared pair gives the figure .9fr of the card, which drew a
   400 px figure at about 300 px; here the figure's column is 320 px and the rows take the rest */
:root[data-alive-ui] body main.col .look-pair.ii-pair{grid-template-columns:minmax(0,320px) minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-pair.ii-pair-r{grid-template-columns:minmax(0,1fr) minmax(0,320px)}
:root[data-alive-ui] body main.col .look-pair .look-rows{display:flex;flex-direction:column;align-items:center;gap:18px}
:root[data-alive-ui] body main.col .look-pair .look-rows .row+.row{margin-top:0}

/* a figure standing on its own: its card is the shared one, and the drawing keeps about its own size instead of
   stretching to the column with its labels */
/* (the shared rule's :not(.katex svg) is repeated so this one, later, wins) */
:root[data-alive-ui] body main.col>section>figure.diagram>svg:not(.katex svg){width:100%;max-width:440px;height:auto;display:block;margin:0 auto}

/* displayed maths in a card sits centred, as displayed maths does in the text */
:root[data-alive-ui] body main.col :is(.look-card,.look-rows) .math-chain{justify-content:center}
:root[data-alive-ui] body main.col :is(.look-card,.look-rows) .katex-display>.katex{text-align:center}

/* a label that names what a group of rows is (the page's own words: Integral to infinity, The tail, What works) */
:root[data-alive-ui] body main.col .ii-lab{display:block;font:600 13px/1.4 var(--lf-label);letter-spacing:.06em;text-transform:uppercase;color:var(--ink);text-align:center;margin:0 0 6px}
:root[data-alive-ui] body main.col .look-card .ii-group+.ii-group{margin-top:20px}

/* the rules for 1/x^p: the tail and the part from 0 to 1 side by side, each case read down */
:root[data-alive-ui] body main.col .look-compare .look-case{display:flex;flex-direction:column;align-items:center;gap:10px}
:root[data-alive-ui] body main.col .look-compare .look-case .look-q{margin:0}

/* a chain that holds on a wide screen, and breaks one move per line on a phone */
:root[data-alive-ui] body main.col .ii-narrow{display:none}

/* Key concepts: each row's label above its maths, since a card here is half the column; the figure card keeps the
   figure at its own size */
:root[data-alive-ui] body main.col .look-kgrid .look-krows .kr{display:block;border-top:0;padding:4px 0}
:root[data-alive-ui] body main.col .look-kgrid .look-krows .kr+.kr{margin-top:10px}
:root[data-alive-ui] body main.col .look-kgrid .look-krows .kh{display:block;margin:0 0 4px}
:root[data-alive-ui] body main.col .look-kgrid .look-krows .kv{display:block;overflow:visible}
:root[data-alive-ui] body main.col .look-kgrid .look-krows .kv .katex-display{margin:.2em 0}
:root[data-alive-ui] body main.col .look-kpair.ii-kpair{grid-template-columns:minmax(0,300px) minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-kpair.ii-kpair .review-figure{margin:0;width:100%;max-width:300px}
:root[data-alive-ui] body main.col .look-kpair.ii-kpair .review-figure>svg{width:100%}

/* a solution line that joins several facts: each fact wraps as a whole */
:root[data-alive-ui] body main.col .sol .sol-pieces{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 34px;margin:6px 0}
:root[data-alive-ui] body main.col .sol .sol-pieces>span{min-width:0;max-width:100%}
:root[data-alive-ui] body main.col .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}
:root[data-alive-ui] body main.col .sol .ln+.ln{margin-top:14px}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .ii-wide{display:none}
  :root[data-alive-ui] body main.col .ii-narrow{display:block}
  :root[data-alive-ui] body main.col .look-pair.ii-pair,:root[data-alive-ui] body main.col .look-pair.ii-pair-r{grid-template-columns:1fr}
  :root[data-alive-ui] body main.col>section>figure.diagram{padding:12px 10px}
  :root[data-alive-ui] body main.col .look-kpair.ii-kpair{grid-template-columns:1fr}
}

/* section 3's card: the two integrals across the top, the figure beside the table under them */
:root[data-alive-ui] body main.col .look-pair>.ii-span{grid-column:1/-1;display:flex;flex-wrap:wrap;justify-content:center;gap:10px 44px}
:root[data-alive-ui] body main.col .look-pair>.ii-span>.row{margin:0}
