/* Derivatives of Trig, Exponential, and Log Functions: this page's layout.
   Colour comes from the course palette (lib/lesson-colors.css, lc-* classes, through alive/lesson-look.css); which meaning
   takes which role is planning/colour.md, and the page's macros in katex-macros.json write the lc-* classes:
     violet (\sn, \lnx)  sin x in section 1, ln x in section 5;   blue (\cs, \ex)  cos x in section 1, the exponential and its height;
     green (\sl)         a slope;   pink (\ng, \rn)  the minus a derivative brings (sections 1-2), the run of 1 (sections 3, 5);
     orange (\lk)        what a Key idea says to look for.
   No colour is set here. */
.fq .say,figcaption,.el>.lab .t,.lab .t,.kc .knote,.hint,.feedback-copy{color:var(--body)!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 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 (Trigonometric Substitution's tsx-wide / tsx-narrow). */
/* The hide wins over a card's own display (a centred card's rows are flex), so each width shows only its own break;
   the shown one keeps whatever display its card gives it. */
@media (min-width:641px){:root[data-alive-ui] body main.col .tl-narrow{display:none!important}}
@media (max-width:640px){:root[data-alive-ui] body main.col .tl-wide{display:none!important}}
/* a row after a gap in the card: a new step, or a new derivation in the same card (cot, then csc) */
:root[data-alive-ui] body main.col :is(.look-card,.look-rows) .row.tl-next{margin-top:22px}
:root[data-alive-ui] body main.col .look-card .row .katex-display{margin:0}

/* a one-line card (a reminder) and a result card (a rule the section arrives at): the maths centred, the card only as
   wide as the column, like every other card, so the lamp lights it the same way */
:root[data-alive-ui] body main.col .look-card:is(.tl-one,.tl-result) .row{display:flex;justify-content:center}

/* a figure beside the rows it explains, at its own size; the rows take what's left. On a phone it stacks. */
:root[data-alive-ui] body main.col .look-pair.tl-pair{grid-template-columns:auto minmax(0,1fr);gap:10px 26px}
:root[data-alive-ui] body main.col .look-pair.tl-pair>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto}
:root[data-alive-ui] body main.col .look-pair.tl-pair .look-rows{display:flex;flex-direction:column;align-items:center}
:root[data-alive-ui] body main.col .look-pair.tl-pair.tl-tight{gap:10px 16px;padding-right:18px}
:root[data-alive-ui] body main.col .look-pair.tl-tight .look-rows .katex{font-size:1em}
@media (max-width:640px){:root[data-alive-ui] body main.col .look-pair.tl-pair{grid-template-columns:1fr}}

/* fig-2 with the cycle it draws, one card: the four graphs, then the row of arrows under them */
:root[data-alive-ui] body main.col .tl-figcard>figure.diagram{margin:0 auto 14px;width:fit-content;max-width:100%}
:root[data-alive-ui] body main.col .tl-figcard>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block}
:root[data-alive-ui] body main.col .tl-figcard>.row{display:flex;justify-content:center}

/* a row with a short label beside it (section 4): the label on the left, the maths after it; above it on a phone */
:root[data-alive-ui] body main.col .look-card .row.tl-lab{display:flex;align-items:center;gap:6px 18px;flex-wrap:wrap}
:root[data-alive-ui] body main.col .tl-lab>.row-label{font:500 15px/1.4 var(--lf-label);color:var(--ink);min-width:150px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-card .row.tl-lab{display:block}
  :root[data-alive-ui] body main.col .tl-lab>.row-label{display:block;min-width:0;margin:0 0 2px}
  :root[data-alive-ui] body main.col .tl-lab>.row-label:empty{display:none}
  :root[data-alive-ui] body main.col .look-card .row.tl-lab+.row.tl-lab{margin-top:14px}
}

/* Key concepts: rows on the quiet sheet; a card with no rows starts with its sentence */
:root[data-alive-ui] body main.col .look-kgrid .look-krows .row+.row{margin-top:8px}
:root[data-alive-ui] body main.col .look-kgrid .look-krows .row.tl-next{margin-top:16px}
:root[data-alive-ui] body main.col .look-kgrid .knote.tl-kfirst{margin-top:0}

/* Practice: a derivative needs room in its field; Problem 11's two constants side by side */
:root[data-alive-ui] body main.col .prob .answer-fields input.wide{width:320px;max-width:100%}
:root[data-alive-ui] body main.col .prob .answer-fields.tl-two{display:flex;flex-wrap:wrap;gap:10px 28px}
:root[data-alive-ui] body main.col .prob .answer-fields.tl-two input{width:140px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .prob .answer-fields.tl-two input{width:120px}
}
