/* Unit reviews (short, medium, long) and the figures they use (js/figures.js). Loads after v6.css. */

/* length switch */
.rv-lens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--paper-2); padding: 6px; border-radius: 22px; margin: 6px 0 26px; max-width: 760px; }
.rv-lens a { text-decoration: none; border-radius: 17px; padding: 12px 16px; display: grid; gap: 2px; color: var(--ink-2); }
.rv-lens a b { font-size: 16px; font-weight: 650; color: var(--ink); }
.rv-lens a small { font-size: 12.5px; color: var(--ink-3); }
.rv-lens a:hover { background: rgba(255,255,255,.6); }
.rv-lens a.on { background: #fff; box-shadow: 0 1px 2px rgba(10,10,20,.06), 0 4px 14px rgba(10,10,20,.06); }
.rv-lens a.on small { color: var(--brand-2); }

/* layout: long review gets a contents rail */
.rv-wrap { display: block; }
.rv-wrap.has-toc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; align-items: start; }
.rv-toc { position: sticky; top: 84px; display: grid; gap: 2px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 6px; }
.rv-toc .kicker { margin-bottom: 6px; }
.rv-toc a { text-decoration: none; font-size: 14px; color: var(--ink-2); padding: 7px 10px; border-radius: 10px; line-height: 1.25; }
.rv-toc a:hover { background: var(--paper-2); color: var(--ink); }
@media (max-width: 920px) { .rv-wrap.has-toc { display: block; } .rv-toc { display: none; } }

.rvw { max-width: 820px; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
/* nothing inside a review may stretch the page wider than the screen: wide code and tables scroll inside their own box */
.rvw > *, .rv-ex > *, .rv-chk > *, .rv-cmp > *, .rv-traps > *, .rv-key > *, .rv-eqs > *, .fig > *, .rv-figs > * { min-width: 0; }
.rvw pre, .rvw .fig-code pre { max-width: 100%; overflow-x: auto; }
.rv-h { font-size: 28px; margin: 22px 0 0; scroll-margin-top: 90px; display: grid; gap: 4px; }
.rv-h:first-child { margin-top: 0; }
.rv-h .kicker { color: var(--brand-2); }
.rv-p { font-size: 17px; line-height: 1.6; color: var(--ink); margin: 0; }
.rvw h3 { font-size: 18px; margin: 0 0 10px; }

.rv-key { background: var(--brand-soft); border-radius: var(--r); padding: 20px 24px; }
.rv-key ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rv-key li { position: relative; padding-left: 30px; font-size: 16.5px; line-height: 1.5; }
.rv-key li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; margin-top: 2px; }

.rv-eqs { border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; }
.rv-eq { display: grid; grid-template-columns: minmax(180px, 38%) 1fr; gap: 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.rv-eqs h3 + .rv-eq, .rv-eq:first-child { border-top: 0; }
.rv-eq-f { font-size: 19px; }
.rv-eq b { font-weight: 600; display: block; line-height: 1.4; }
.rv-eq small { display: block; color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
@media (max-width: 640px) { .rv-eq { grid-template-columns: 1fr; gap: 6px; } }

.rv-ex { border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: var(--r); padding: 18px 22px; display: grid; gap: 10px; }
.rv-ex-q { font-weight: 600; font-size: 16.5px; line-height: 1.5; }
.rv-ex ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; line-height: 1.55; }
.rv-ex-a { display: flex; gap: 10px; align-items: flex-start; background: var(--green-soft); color: #0E5A2E; border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.rv-ex-a .i { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }

.rv-traps { border-radius: var(--r); background: var(--red-soft); padding: 18px 22px; }
.rv-trap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid rgba(226,71,95,.18); line-height: 1.45; }
.rv-traps h3 + .rv-trap { border-top: 0; }
.rv-trap .bad { color: #9B1C33; font-weight: 600; }
.rv-trap .good { color: var(--ink); }
@media (max-width: 640px) { .rv-trap { grid-template-columns: 1fr; gap: 4px; } }

.rv-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rv-cmp > div { background: var(--paper-2); border-radius: var(--r); padding: 16px 20px; }
.rv-cmp h4 { margin: 0 0 8px; font-size: 16px; }
.rv-cmp ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; }
@media (max-width: 640px) { .rv-cmp { grid-template-columns: 1fr; } }

.rv-tip { display: flex; gap: 16px; align-items: center; background: var(--orange-soft); border-radius: var(--r); padding: 14px 20px 14px 14px; }
.rv-tip img { width: 74px; height: 74px; object-fit: contain; flex: 0 0 auto; }
.rv-tip .kicker { color: #A4520F; }
.rv-tip p { margin: 4px 0 0; line-height: 1.5; }

.rv-list ul, .rv-list ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; line-height: 1.55; }

.rv-chk { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 18px 22px; display: grid; gap: 10px; }
.rv-chk-q { font-weight: 600; font-size: 16.5px; line-height: 1.5; }
.rv-chk-c { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rv-chk-c button { text-align: left; font: inherit; display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; line-height: 1.35; }
.rv-chk-c button > .rv-let { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; background: var(--paper-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.rv-chk-c button:hover:not(:disabled) { border-color: var(--ink); }
.rv-chk-c button.right { border-color: var(--green); background: var(--green-soft); }
.rv-chk-c button.right > .rv-let { background: var(--green); color: #fff; }
.rv-chk-c button > .rv-ans { min-width: 0; overflow-wrap: anywhere; }
.rv-chk-c button > .rv-ans .katex { white-space: nowrap; }
.rv-chk-c button.wrong { border-color: var(--red); background: var(--red-soft); }
.rv-chk-c button:disabled { cursor: default; }
.rv-chk-ex { background: var(--paper-2); border-radius: 12px; padding: 12px 14px; line-height: 1.5; }
@media (max-width: 640px) { .rv-chk-c { grid-template-columns: 1fr; } }

.rv-end { display: flex; gap: 18px; align-items: center; margin-top: 10px; }
.rv-end img { width: 92px; flex: 0 0 auto; }
.rv-end h3 { margin: 0 0 4px; }
.rv-end .row-actions { margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .rv-end { flex-direction: column; align-items: flex-start; } }

/* long review without Plus: the opening section fades into a Plus card */
.rv-lens a { position: relative; }
.rv-plus { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 750; letter-spacing: .02em; color: #fff; background: var(--ink); border-radius: 999px; padding: 2px 8px; }
.rv-toc a.locked { color: var(--ink-3); }
.rv-toc a.locked .i { width: 13px; height: 13px; vertical-align: -2px; }
.rv-lock { position: relative; display: flex; gap: 18px; align-items: flex-start; padding: 24px; border: 1.5px solid var(--ink); }
.rv-lock::before { content: ''; position: absolute; left: -1px; right: -1px; top: -150px; height: 148px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 85%); pointer-events: none; }
.rv-lock img { width: 84px; height: 84px; object-fit: contain; flex: 0 0 auto; }
.rv-lock h3 { margin: 4px 0 8px; }
.rv-lock p { line-height: 1.5; }
.rv-lock-list { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 6px; color: var(--ink-2); }
.rv-lock-list .i { width: 14px; height: 14px; vertical-align: -2px; color: var(--ink-3); }
@media (max-width: 640px) { .rv-lock { flex-direction: column; padding: 18px; } .rv-lock img { width: 64px; height: 64px; } }

/* answer choices never spill past the screen: long words (ArrayIndexOutOfBoundsException) break, code answers scroll in their box */
.choice > span:not(.L) { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.choice pre.code { max-width: 100%; overflow-x: auto; }
.q, .qcard, .choices, .choice { min-width: 0; }
.choices { grid-template-columns: minmax(0, 1fr); }
.cp .choices { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .cp .choices { grid-template-columns: minmax(0, 1fr); } }
.q pre.code { max-width: 100%; overflow-x: auto; }
@media (max-width: 640px) { .choice pre.code { font-size: 12px; } .q pre.code { font-size: 13px; padding: 12px; } }

/* question text that mixes sentences and code (app.js txt): sentences as text, code in its block */
.qp { margin: 0 0 10px; }
.qp:last-child { margin-bottom: 0; }
.choice .qp { margin: 0; }

/* figures */
.fig { margin: 0; background: #FDFCF8; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.fig figcaption { font-size: 14px; color: var(--ink-2); line-height: 1.45; text-align: center; }
.rv-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.fig-box { position: relative; width: 100%; max-height: 460px; margin: 0 auto; container-type: inline-size; }
.fig-fbd .fig-box { max-width: 380px; }
.fig-grid .fig-box { max-width: 520px; }
.fig-bars .fig-box { max-width: 640px; }
.fig-box svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* labels scale with their figure (cqw = % of the figure's width), so a phone shows the same layout as a laptop, never below 9-10px */
.fig-l { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-size: clamp(10px, 2.5cqw, 17px); line-height: 1.1; pointer-events: none; }
.fig-l.al-r { transform: translate(-100%, -50%); }
.fig-l.al-l { transform: translate(0, -50%); }
.fig-l.b { font-weight: 700; }
.fig-l.s { font-size: clamp(9px, 1.9cqw, 13px); }
.fig-l.h { font-size: clamp(10px, 2.35cqw, 16px); }
@media (max-width: 600px) { .fig { padding: 8px; } }
.fig-l.bgw { background: rgba(253,252,248,.9); padding: 0 4px; border-radius: 4px; }
.fig-table-w { overflow-x: auto; }
.fig-table { border-collapse: separate; border-spacing: 0; margin: 0 auto; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; min-width: 50%; }
.fig-table th { background: var(--brand-soft); color: var(--brand-2); font-weight: 700; padding: 8px 14px; font-size: 14px; }
.fig-table td { padding: 8px 14px; border-top: 1px solid var(--line); text-align: center; font-size: 15px; background: #fff; }
.fig-table.mono td { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.fig-table tr.hl td { background: #FFF6D6; font-weight: 700; }
.fig-code pre { margin: 0; background: #1E2235; color: #E9ECF5; border-radius: 14px; padding: 14px 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14.5px; line-height: 1.55; overflow-x: auto; }
.fig-code .ln { display: block; padding: 0 16px 0 10px; border-left: 4px solid transparent; white-space: pre; }
.fig-code .ln i { display: inline-block; width: 26px; color: #6E7591; font-style: normal; text-align: right; margin-right: 14px; user-select: none; }
.fig-code .ln.lit { background: rgba(255,224,122,.16); border-left-color: #FFE07A; }
.fig-code .mk { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #FFE07A; color: #1E2235; font-size: 11px; margin-left: 10px; vertical-align: 1px; }
.fig-code .kw { color: #C7A6FF; font-weight: 700; }
.fig-code .st { color: #8FE3A8; }
.fig-code .nu { color: #FFB561; }
.fig-code .cm { color: #8C93AD; font-style: italic; }
.fig-notes { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 4px; font-size: 14.5px; line-height: 1.45; }
.fig-notes .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--ink-3); margin-right: 6px; }
.fig-out { margin-top: 8px; background: #0F1222; color: #9BF0B8; border-radius: 10px; padding: 9px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; white-space: pre-wrap; }
.fig-out span { color: #6E7591; }

/* review link in the classes list */
.acc-review { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 14px 18px; text-decoration: none; }
.acc-review > span { flex: 1; display: grid; gap: 2px; }
.acc-review small { color: var(--ink-3); }
.acc-review .i { width: 20px; height: 20px; }

/* in-video check-in: the question's code sits under the question; code-style answers in monospace */
.cp-qw { min-width: 0; }
.cp-qw pre.code { font-size: 14px; margin: 8px 0 0; max-width: 100%; overflow-x: auto; }
.choice .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14.5px; font-weight: 600; }

/* unit notes: the reading column never grows wider than the screen */
.lesson-read { grid-template-columns: minmax(0, 1fr); }
.lesson-read > *, .lesson-read .card > * { min-width: 0; }
.lesson-read .card div { min-width: 0; }
.lesson-read .card { overflow-wrap: break-word; }
@media (max-width: 640px) { .bigidea { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; } .bigidea img { width: 64px; height: auto; } }
.lesson-read .codechip { white-space: normal; overflow-wrap: anywhere; }
.row-actions { flex-wrap: wrap; }
@media (max-width: 640px) { .page-head { flex-wrap: wrap; } .page-head > * { min-width: 0; } }

/* FRQ pages: code in a setup or a part scrolls inside its own box; the page never grows past the screen */
.frq { grid-template-columns: minmax(0, 1fr); }
.frq > *, .frq .card > *, .frq-part > *, .frq-q > div { min-width: 0; }
/* site-wide: no code block is ever wider than the box it sits in */
pre.code { max-width: 100%; }

/* Mr. Thompkins' class announcements (Quizzes page) and diagrams on FRQ pages */
.tpost { display: flex; gap: 18px; align-items: flex-start; border: 1.5px solid var(--ink); }
.tpost img { width: 80px; height: 80px; object-fit: contain; flex: 0 0 auto; }
.tpost > div { min-width: 0; }
.tpost h2 { margin: 4px 0 2px; font-size: 22px; }
.tpost .when-chip { display: inline-block; margin: 4px 0 8px; font-weight: 700; font-size: 13px; color: #A4520F; background: var(--orange-soft); border-radius: 999px; padding: 3px 10px; }
.tpost p { line-height: 1.5; }
.tpost-list { margin: 6px 0 14px; padding-left: 20px; display: grid; gap: 4px; line-height: 1.45; }
@media (max-width: 640px) { .tpost { flex-direction: column; } .tpost img { width: 60px; height: 60px; } }
.frq-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.frq-figs > *, .model .fig { min-width: 0; }
.model .fig { margin-top: 12px; max-width: 420px; }

/* unit page: Mr. Thompkins' practice FRQs for that unit */
.tfrqs { border: 1.5px solid var(--ink); }
.tfrq-list { display: grid; gap: 6px; margin-top: 8px; }
.tfrq-list .trow span { display: grid; gap: 2px; min-width: 0; }
.tfrq-list .trow small { color: var(--ink-3); font-size: 13px; }

/* class invite page (#/join/<code>) */
.join-wrap { max-width: 640px; margin: 0 auto; padding: 32px 16px 64px; }
.join-card { display: grid; gap: 10px; padding: 28px; border: 1.5px solid var(--ink); }
.join-mrt { width: 88px; height: 88px; object-fit: contain; }
.join-card h1 { margin: 2px 0 4px; font-size: clamp(26px, 5vw, 34px); line-height: 1.1; }
/* phones: tighter table cells, so a three-column table fits without swiping */
@media (max-width: 640px) { .fig-table th, .fig-table td { padding: 6px 8px; font-size: 13.5px; } .fig-table { min-width: 0; } }

/* ---------- unit lectures ---------- */
.lx-start { display: flex; gap: 16px; align-items: center; text-decoration: none; color: inherit; border: 1.5px solid var(--ink); padding: 16px 18px; }
.lx-start img { width: 72px; height: 72px; object-fit: contain; flex: 0 0 auto; }
.lx-start > span { display: grid; gap: 4px; flex: 1; min-width: 0; }
.lx-start b { font-size: 19px; }
.lx-start small { color: var(--ink-3); line-height: 1.4; }
.lx-head { display: grid; gap: 8px; margin-bottom: 14px; }
.lx-head h1 { margin: 0; }
.lx-prog { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-3); }
.lx-bar { flex: 1; max-width: 360px; height: 8px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.lx-bar i { display: block; height: 100%; background: var(--green, #1B8F5E); border-radius: 999px; }
.lx-toc summary { cursor: pointer; font-weight: 650; padding: 8px 12px; background: var(--paper-2); border-radius: 12px; }
.lx-toc ol { margin: 8px 0 0; padding-left: 24px; display: grid; gap: 4px; }
.lx-toc li.on a { font-weight: 700; color: var(--ink); }
.lx-toc a { text-decoration: none; color: var(--ink-2); }
.lx-toc small { color: var(--ink-3); }
.lx-goal { background: var(--brand-soft); border-radius: var(--r); padding: 12px 16px; line-height: 1.5; }
.lx-say { display: flex; gap: 12px; align-items: flex-end; }
.lx-say img { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.lx-say .bubble { position: relative; background: #fff; border: 1.5px solid var(--line-2); border-radius: 18px 18px 18px 4px; padding: 12px 16px; line-height: 1.5; min-width: 0; flex: 1; }
.lx-say .who { font-size: 12.5px; font-weight: 700; color: var(--brand-2, var(--ink-2)); margin-bottom: 2px; }
.lx-recall { border: 1.5px solid #E7D9FF; background: #FAF6FF; border-radius: 14px; }
.lx-recall summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: center; padding: 10px 14px; font-weight: 600; }
.lx-recall summary::-webkit-details-marker { display: none; }
.lx-recall .lx-ic { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: #7546D6; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.lx-recall[open] summary { border-bottom: 1px solid #E7D9FF; }
.lx-recall-a { padding: 10px 14px 12px 48px; line-height: 1.5; }
.lx-pause { border: 1.5px dashed #E8B04B; background: #FFFBF0; border-radius: var(--r); padding: 14px 18px; display: grid; gap: 8px; justify-items: start; }
.lx-pause .kicker { color: #A4520F; }
.lx-pause .lx-q { font-weight: 600; line-height: 1.5; }
.lx-pause .lx-a { line-height: 1.5; background: #fff; border-radius: 12px; padding: 10px 14px; justify-self: stretch; }
.lx-walk { border: 1.5px solid var(--line-2); border-left: 4px solid var(--brand); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 10px; }
.lx-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.lx-steps li { line-height: 1.5; }
.lx-why { margin-top: 4px; border: 0; background: none; color: var(--brand); font-weight: 650; cursor: pointer; padding: 0; font: inherit; font-weight: 650; }
.lx-why-a { margin-top: 6px; background: var(--paper-2); border-radius: 10px; padding: 8px 12px; line-height: 1.5; }
.lx-ans { background: var(--green-soft, #E8F6EF); border-radius: 12px; padding: 10px 14px; line-height: 1.5; }
.lx-stuck { display: grid; gap: 8px; justify-items: start; }
.lx-hints { margin: 0; padding-left: 22px; display: grid; gap: 6px; line-height: 1.5; }
.lx-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.lx-nav .btn.big { white-space: normal; text-align: center; }
.lx-steps > li > div, .lx-pause > *, .lx-walk > *, .lx-say .bubble > * { min-width: 0; }
@media (max-width: 640px) { .lx-say img { width: 48px; height: 48px; } .lx-nav .btn { flex: 1 1 100%; } }
