/* Increasing, Decreasing, and the First Derivative Test: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   The page's own blocks, all in the lesson look (white card, data-lamp, space between parts):
   - fd-asks: a goal's questions under its function, wrapping whole on a phone.
   - fd-verdicts: the first derivative test's rows as columns (the point | the signs | the verdict), so the three line up
     down a card; on a phone the verdict drops under its point and signs instead of the row running off the edge.
   - fd-reasons: section 5's conclusions beside their reasons; on a phone each reason sits under its conclusion.
   - fd-chips: practice choices that are short values or intervals, laid out in a row. */
:root[data-alive-ui] body main.col .look-pair{grid-template-columns:auto minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-card>figure.diagram{margin:14px 0 0}
:root[data-alive-ui] body main.col .look-card>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}
:root[data-alive-ui] body main.col .look-rows .row.fd-gap{margin-top:22px}
:root[data-alive-ui] body main.col .look-card .row.fd-gap{margin-top:20px}

:root[data-alive-ui] body main.col .look-goal .fd-asks{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 36px;margin-top:6px}

:root[data-alive-ui] body main.col .fd-verdicts{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:14px 22px;align-items:baseline}
:root[data-alive-ui] body main.col .fd-verdicts>.fd-v{display:contents}
:root[data-alive-ui] body main.col .fd-verdicts .katex{font-size:1.1em;white-space:nowrap}
:root[data-alive-ui] body main.col .fd-verdicts+.row{margin-top:20px}

:root[data-alive-ui] body main.col .fd-reasons{display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px 26px;align-items:baseline}
:root[data-alive-ui] body main.col .fd-reasons>.fd-r{display:contents}
:root[data-alive-ui] body main.col .fd-reasons .katex{font-size:1em;white-space:nowrap}

:root[data-alive-ui] body main.col .prob .choices.fd-chips{display:flex;flex-wrap:wrap;gap:8px 10px;margin:8px 0 6px}
:root[data-alive-ui] body main.col .prob .choices.fd-chips label{min-width:0;margin:0}
:root[data-alive-ui] body main.col .prob .fd-ask{margin:14px 0 2px}
:root[data-alive-ui] body main.col .prob .answer-fields+.answer-fields{margin-top:10px}
:root[data-alive-ui] body main.col .prob figure.lean-given{margin:16px 0 8px 44px}
:root[data-alive-ui] body main.col .prob figure.lean-given>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-pair{grid-template-columns:1fr}
  :root[data-alive-ui] body main.col .fd-verdicts{grid-template-columns:auto minmax(0,1fr);gap:4px 16px}
  :root[data-alive-ui] body main.col .fd-verdicts .fd-out{grid-column:1/-1;padding-left:18px;margin-bottom:12px}
  :root[data-alive-ui] body main.col .fd-verdicts .katex{font-size:1em}
  :root[data-alive-ui] body main.col .fd-reasons{grid-template-columns:1fr;gap:4px}
  :root[data-alive-ui] body main.col .fd-reasons .fd-why{padding-left:18px;margin-bottom:12px}
  :root[data-alive-ui] body main.col .fd-reasons .katex{font-size:1em}
  :root[data-alive-ui] body main.col .prob figure.lean-given{margin-left:0}
}
/* a practice verdict per point: the point, then local max / local min / neither */
:root[data-alive-ui] body main.col .prob .fd-pick{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin:10px 0}
:root[data-alive-ui] body main.col .prob .fd-pick .fd-pt{min-width:4.2em}
:root[data-alive-ui] body main.col .prob .fd-pick .choices.fd-chips{margin:0}
:root[data-alive-ui] body main.col .fd-verdicts .fd-out .math-chain{justify-content:flex-start;margin:0}
:root[data-alive-ui] body main.col .fd-verdicts .fd-out .katex-display{margin:0}
:root[data-alive-ui] body main.col .fd-reasons .fd-why .katex{display:inline-block}
:root[data-alive-ui] body main.col .look-kpair{grid-template-columns:auto minmax(0,1fr)}
@media (max-width:640px){:root[data-alive-ui] body main.col .look-kpair{grid-template-columns:1fr}}
/* Problem 1's polynomial is the one statement too wide for a 360 px phone: there it may break after its "=" (the shared
   sheet keeps statement maths on one line) */
:root[data-alive-ui] body main.col #p1>.st .katex{white-space:normal}
/* figures inside a card sit centred under its rows */
:root[data-alive-ui] body main.col .look-card>figure.diagram{display:flex;justify-content:center}
/* a verdict's "=" keeps about the spacing it has inside a line */
:root[data-alive-ui] body main.col .fd-verdicts .fd-out .math-chain{column-gap:3px}
/* section 5: the reasons get the wider column, so each reads on one line where it can */
@media (min-width:641px){:root[data-alive-ui] body main.col .fd-reasons{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr)}}
/* practice: the prompts for choices at the size of the choices themselves */
:root[data-alive-ui] body main.col .prob :is(.fd-ask,.fd-pt){font-size:16px}
:root[data-alive-ui] body main.col .look-kgrid .krows .review-figure{margin-top:10px}
:root[data-alive-ui] body main.col .look-kgrid .krows .review-figure>svg{width:auto;max-width:100%;height:auto;display:block;margin:0 auto}
/* Key concepts: the maths and its words both start at the top of the card */
:root[data-alive-ui] body main.col .look-kgrid .look-kpair{align-items:start}
:root[data-alive-ui] body main.col .look-kgrid .look-kpair .knote:first-child{margin-top:0}
@media (max-width:640px){
  /* the three verdicts for a point stay on one row */
  :root[data-alive-ui] body main.col .prob .fd-pick .choices.fd-chips{flex-wrap:nowrap;gap:6px}
  :root[data-alive-ui] body main.col .prob .fd-pick .choices.fd-chips label{padding:6px 8px;gap:6px;font-size:15px}
}
