/* Lesson shell (viewer/lesson.js; DECISIONS O32 of 2026-11-20, layout A). Uses the style tokens of style.css and
   themes.json, so it follows Clinical / Scientific / Textbook. Explore mode (?explore=1) never loads these rules' effects:
   everything here is scoped to html.lesson-ui, which index.html sets before first paint and lesson.js removes for Explore. */
html:not(.lesson-ui) .lz { display: none; }
/* today's chrome is hidden inside lessons; its science renderings live in the Science tab */
.lesson-ui #topbar, .lesson-ui #chips, .lesson-ui #tourDock, .lesson-ui #fcBox, .lesson-ui #drawer, .lesson-ui #tabs,
.lesson-ui .stepcap, .lesson-ui #tip { display: none !important; }
.ui > .lz { position: absolute; inset: 0; pointer-events: none; }
.lz > * { pointer-events: auto; }
.lesson-home .lz-top, .lesson-home .lz-panel, .lesson-home .lz-bottom, .lesson-home .lz-unfold, .lesson-home .lz-menu { display: none !important; }
.lesson-mode .lz-home { display: none !important; }
.lz { --lz-panel-w: min(380px, 34vw); --lz-pad: 18px; font-family: var(--body); color: var(--fg); }

/* buttons */
.lz-btn { font: 600 14px var(--body); color: var(--fg); background: var(--panel); border: 1px solid var(--ov-line); border-radius: 8px;
  min-height: 38px; padding: 0 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lz-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 7%, var(--panel)); }
.lz-btn:disabled { opacity: .45; cursor: default; }
.lz-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--panel); }
.lz-btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.lz-btn.icon { min-width: 38px; justify-content: center; padding: 0 8px; font-size: 18px; }

/* top: way back, lesson title, menu */
.lz-top { position: absolute; top: var(--gap); left: var(--gap); right: var(--gap); display: flex; align-items: center; gap: 10px;
  background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
.lz-top > * { pointer-events: auto; box-shadow: var(--ov-shadow); }
.lz-title { margin-right: auto; display: flex; flex-direction: column; min-width: 0; background: var(--ov-bg); -webkit-backdrop-filter: blur(var(--ov-blur)); backdrop-filter: blur(var(--ov-blur));
  border: 1px solid var(--ov-line); border-radius: 8px; padding: 3px 12px 4px; }
.lz-title b { font: 650 15px/1.25 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lz-title span { font: 500 11.5px/1.3 var(--mono); color: var(--muted); letter-spacing: .02em; }

.lz-menu { position: absolute; top: calc(var(--gap) + 46px); right: var(--gap); width: 350px; max-width: calc(100vw - 2 * var(--gap)); padding: 6px 0; z-index: 14; display: flex; flex-direction: column; }
.lz-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; font: 500 14px var(--body); color: var(--fg); min-height: 24px; }
.lz-row + .lz-row { border-top: 1px solid var(--ov-line); }
button.lz-row { background: none; border-inline: 0; border-bottom: 0; text-align: left; cursor: pointer; width: 100%; }
button.lz-row:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); }
.lz-row input[type=range] { width: 130px; accent-color: var(--accent); }
.lz-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.lz-row kbd { font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--ov-line); border-radius: 4px; padding: 0 5px; }
.lz-seg { display: inline-flex; gap: 2px; }
.lz-seg button { font: 600 12px var(--body); color: var(--fg); background: transparent; border: 1px solid var(--ov-line); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.lz-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--panel); }

/* side panel: Explain | Science */
.lz-panel { position: absolute; top: calc(var(--gap) + 50px); right: var(--gap); bottom: var(--gap); width: var(--lz-panel-w); box-sizing: border-box;
  display: flex; flex-direction: column; overflow: hidden; }
.lz-tabs { display: flex; align-items: stretch; gap: 4px; padding: 0 var(--lz-pad); border-bottom: 1px solid var(--ov-line); flex: none; }
.lz-tabs [role=tab] { font: 600 14.5px var(--body); color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 13px 4px 10px; margin-right: 14px; cursor: pointer; }
.lz-tabs [role=tab][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.lz-fold { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; padding: 0 4px; }
.lz-fold:hover { color: var(--fg); }
.lz-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 14px var(--lz-pad) 20px; font-size: var(--text-size, 15px); line-height: var(--text-leading, 1.6); }
.lz-pane p { margin: 0 0 10px; }
.lz-step { font: 650 17px/1.25 var(--display); margin: 0 0 8px; text-wrap: balance; }
/* Explain: the whole lesson as one text. One row per step, edge to edge with a hairline between; the current step carries
   an accent bar; a click on another step shows it. */
#lzExplain { position: relative; padding-top: 0; padding-bottom: 40vh; }
#lzExplain > .lz-flag { margin: 12px 0; }
.lz-sec { margin: 0 calc(-1 * var(--lz-pad)); padding: 14px var(--lz-pad) 6px calc(var(--lz-pad) - 3px); border-left: 3px solid transparent; cursor: pointer; }
.lz-sec + .lz-sec { border-top: 1px solid var(--ov-line); }
.lz-sec:not(.now):hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
.lz-sec.now { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); cursor: auto; }
.lz-sec[hidden] { display: none; }
.lz-jump { all: unset; display: flex; align-items: baseline; gap: 9px; cursor: pointer; }
.lz-jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.lz-jump .n { font: 600 11.5px var(--mono); color: var(--muted); min-width: 1.1em; }
.lz-sec.now .lz-jump { cursor: auto; }
.lz-sec.now .lz-jump .n { color: var(--accent); }
.lz-sent.now { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 2px; }
.lz-src { font-size: .87em; color: var(--muted); }
.lz-src a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent); text-underline-offset: 2px; cursor: pointer; }
.lz-src a:hover, .lz-src a:focus-visible { color: var(--accent); text-decoration-color: currentColor; }
.lz-pane p.lz-figsrc { margin: -2px 0 10px; }
.lz-figsrc .lz-src { margin-left: -.25em; }
.lz-endsec { cursor: auto; padding-bottom: 16px; }
.lz-pane h3 { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.lz-muted, .lz-note { color: var(--muted); font-size: 13px; }
.lz-flag { font: 500 12px var(--mono); color: var(--warn); border-left: 2px solid var(--warn); padding-left: 8px; }
#lzScience ul.tourflow { border-top: 0; padding-top: 0; }
#lzScience .fc { height: auto; overflow-x: auto; border: 1px solid var(--ov-line); border-radius: 8px; background: var(--panel); }
#lzScience .fc svg { width: auto; min-width: 640px; height: auto; }
#lzSciRefs { margin-top: 14px; }
.lz-unfold { position: absolute; top: calc(var(--gap) + 50px); right: var(--gap); }

/* bottom: one caption, three buttons, progress marks */
.lz-bottom { position: absolute; left: calc(var(--gap) + var(--inset-l)); right: calc(var(--gap) + var(--inset-r)); bottom: var(--gap);
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.lz-bottom > * { pointer-events: auto; }
.lz-cap { margin: 0; max-width: min(760px, 100%); box-sizing: border-box; padding: 9px 18px; font: 500 17px/1.4 var(--body); text-align: center; text-wrap: balance; }
.lz-cap:empty { display: none; }
.lz-trans { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 999px; }
.lz-trans .lz-btn { border-radius: 999px; min-width: 84px; justify-content: center; }
.lz-play { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--accent); color: var(--panel); font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lz-play:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.lz-play:disabled { opacity: .45; }
/* captions on / off: pressed = on */
.lz-trans .lz-btn.lz-cc { min-width: 46px; padding: 0 10px; font: 700 12.5px var(--mono); letter-spacing: .04em; color: var(--muted); }
.lz-trans .lz-btn.lz-cc[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.lz-trans .lz-btn.lz-cc[aria-pressed="false"] { text-decoration: line-through; }
.lesson-nocc .lz-cap { display: none !important; }
.lz-dots { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.lz-dots button { display: block; width: 28px; height: 16px; padding: 6px 0; background: none; border: 0; cursor: pointer; }
.lz-dots button::before { content: ""; display: block; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--fg) 28%, transparent); }
.lz-dots button.done::before { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.lz-dots button.now::before { background: var(--accent); height: 6px; margin-top: -1px; }

/* end of lesson: one unscored question, then where to go */
.lz-check { border-top: 1px solid var(--ov-line); border-bottom: 1px solid var(--ov-line); padding: 12px 0; margin-bottom: 14px; }
.lz-check .cq { font-weight: 600; }
.lz-check .co { display: grid; gap: 6px; }
.lz-opt { font: 500 14px/1.35 var(--body); text-align: left; color: var(--fg); background: var(--panel); border: 1px solid var(--ov-line); border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.lz-opt:hover:not(:disabled) { border-color: var(--accent); }
.lz-opt.right { border: 2px solid var(--accent); font-weight: 600; }
.lz-opt.right::after { content: "  ✓ right answer"; font: 500 11px var(--mono); color: var(--accent); }
.lz-opt.wrong { border-style: dashed; color: var(--muted); }
.lz-opt.wrong::after { content: "  ✕ your answer"; font: 500 11px var(--mono); }
.lz-check .cf { margin: 10px 0 0; }
.lz-go { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.lz-go .lz-btn { justify-content: center; white-space: normal; padding: 8px 14px; text-align: center; }

/* course screen */
.lz-home { position: absolute; top: var(--gap); left: var(--gap); bottom: var(--gap); width: min(460px, 42vw); box-sizing: border-box; overflow-y: auto; padding: 24px 0 20px; }
.lz-home h1 { font: 650 28px/1.15 var(--display); padding: 0 24px; }
.lz-lead { color: var(--muted); margin: 6px 0 16px; padding: 0 24px; font-size: 14.5px; }
.lz-start { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: calc(100% - 48px); margin: 0 24px 8px; box-sizing: border-box;
  background: var(--accent); color: var(--panel); border: 0; border-radius: 10px; padding: 13px 16px; font: 650 16px var(--body); cursor: pointer; text-align: left; }
.lz-start small { font: 400 13px/1.3 var(--body); opacity: .92; text-align: right; }
.lz-start:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.lz-home h2 { font: 650 15.5px/1.3 var(--display); margin: 18px 0 0; padding: 0 24px 7px; display: flex; flex-direction: column; }
.lz-home h2 .cn { font: 500 10.5px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.lz-lessons { list-style: none; margin: 0; padding: 0; }
.lz-lessons li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 24px; border-top: 1px solid var(--ov-line); }
.lz-lessons li:last-child { border-bottom: 1px solid var(--ov-line); }
.lz-lessons .lq { min-width: 0; display: flex; flex-direction: column; }
.lz-lessons .lq b { font: 600 14.5px/1.3 var(--body); }
.lz-lessons .lq span { font-size: 12.5px; color: var(--muted); }
.lz-lessons li.planned .lq b { font-weight: 500; color: var(--muted); }
.lz-lessons .ld { display: flex; gap: 4px; flex: none; }
.lz-depth { font: 600 12px var(--body); border: 1px solid var(--accent); color: var(--accent); background: var(--panel); border-radius: 6px; padding: 5px 9px; cursor: pointer; }
button.lz-depth:hover { background: var(--accent); color: var(--panel); }
.lz-depth.off { border: 1px dashed var(--ov-line); color: var(--muted); cursor: default; font-family: var(--mono); font-weight: 500; }
.lz-planned { font: 500 11px var(--mono); color: var(--muted); }
.lz-home .lz-note { padding: 14px 24px 0; margin: 0; }
.lz-homebtns { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 24px 0; }

/* phones: the model on top, one sheet below, the transport as a full-width bar. Edge to edge, no cards. */
@media (max-width: 767px) {
  .lz { --lz-bar: calc(66px + env(safe-area-inset-bottom, 0px)); --lz-sheet: 36vh; --lz-pad: 16px; }
  .lz.folded { --lz-sheet: 0px; }
  .lz-top { top: 0; left: 0; right: 0; padding: max(6px, env(safe-area-inset-top, 0px)) 8px 0; gap: 6px; }
  .lz-title { padding: 3px 9px 4px; }
  .lz-title b { font-size: 13.5px; }
  #lzHome { padding: 0 10px; }
  .lz-panel { top: auto; left: 0; right: 0; bottom: var(--lz-bar); width: auto; height: var(--lz-sheet); border-radius: 0; border-inline: 0; border-bottom: 0; box-shadow: none; }
  .lz-unfold { top: auto; right: 8px; bottom: calc(var(--lz-bar) + 8px); }
  .lz-menu { top: calc(max(6px, env(safe-area-inset-top, 0px)) + 44px); right: 8px; }
  .lz-bottom { left: 0; right: 0; bottom: 0; gap: 0; height: var(--lz-bar); box-sizing: border-box; flex-direction: column-reverse; justify-content: flex-start;
    background: var(--panel); border-top: 1px solid var(--ov-line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .lz-cap { position: absolute; left: 8px; right: 8px; bottom: calc(var(--lz-bar) + var(--lz-sheet) + 8px); margin-inline: auto; width: fit-content; max-width: calc(100% - 16px); font-size: 15px; padding: 7px 12px; }
  .lz.folded .lz-cap { right: 86px; }
  .lz-trans { width: 100%; box-sizing: border-box; justify-content: space-between; padding: 0 16px; flex: 1; background: none; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lz-trans .lz-btn { border: 0; background: none; min-width: 72px; font-size: 15px; }
  .lz-trans .lz-btn.primary { color: var(--accent); background: none; }
  .lz-trans { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 6px; }
  .lz-trans #lzBack { justify-self: start; grid-column: 1; }
  .lz-trans .lz-play { grid-column: 3; }
  .lz-trans #lzNext { justify-self: end; grid-column: 5; grid-row: 1; }
  .lz-trans .lz-btn.lz-cc { grid-column: 4; grid-row: 1; min-width: 44px; margin-left: 10px; }
  .lz-play { width: 46px; height: 46px; }
  .lz-dots { width: 100%; justify-content: center; gap: 3px; height: 12px; align-items: center; }
  .lz-dots button { width: 22px; height: 12px; padding: 4px 0; }
  .lz-home { inset: 0; width: auto; border-radius: 0; border: 0; padding: max(18px, env(safe-area-inset-top, 0px)) 0 calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--panel); }
  .lz-home h1, .lz-lead, .lz-home h2, .lz-lessons li, .lz-home .lz-note, .lz-homebtns { padding-inline: 16px; }
  .lz-start { width: 100%; margin: 0 0 4px; border-radius: 0; padding: 14px 16px; }
}

/* schematic body figure (viewer/figure.js): bottom left on desktop (data-inset="l" keeps the model out from under it),
   top left under the title on phones, flat and without a box there. A diagram, not anatomy. */
html.lesson-ui .lz > .lz-fig { position: absolute; left: var(--gap); bottom: var(--gap); width: 248px; box-sizing: border-box; margin: 0;
  padding: 10px 12px 12px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; pointer-events: none;
  background: var(--ov-bg); -webkit-backdrop-filter: blur(var(--ov-blur)); backdrop-filter: blur(var(--ov-blur));
  border: 1px solid var(--ov-line); border-radius: var(--ov-radius); --fig-sw: 1.8px; }
html.lesson-ui .lz > .lz-fig[hidden], html.lesson-ui.lesson-home .lz > .lz-fig { display: none !important; }
html.lesson-ui .lz-fig .fig-draw { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
html.lesson-ui .lz-fig .fig-side { display: flex; flex-direction: column; min-width: 0; }
html.lesson-ui .lz-fig .fig-svg { display: block; overflow: visible; max-width: 100%; }
/* inverted pendulum over the figure (model: pendulum) */
html.lesson-ui .lz-fig .f-pend { stroke: var(--accent); stroke-width: calc(var(--fig-sw) * 1.5); stroke-linecap: round; fill: none; }
html.lesson-ui .lz-fig .f-pend-fill { fill: var(--accent); }
html.lesson-ui .lz-fig .f-ref { stroke: var(--muted); stroke-width: calc(var(--fig-sw) * .55); stroke-dasharray: 3 3; fill: none; }
html.lesson-ui .lz-fig .f-dim { stroke: var(--muted); stroke-width: calc(var(--fig-sw) * .6); fill: none; }
/* formula beside the drawing */
html.lesson-ui .lz-fig .lz-fig-math .mt { font: 600 11px/1.35 var(--mono); letter-spacing: .03em; color: var(--muted); margin-bottom: 8px; text-wrap: balance; }
html.lesson-ui .lz-fig .lz-fig-math .mf { font: 400 20px/1.15 "STIX Two Math", "Cambria Math", Cambria, "Times New Roman", serif; display: flex; align-items: center; gap: .38em; margin-bottom: 10px; color: var(--fg); }
html.lesson-ui .lz-fig .lz-fig-math .fr { display: inline-flex; flex-direction: column; align-items: stretch; text-align: center; white-space: nowrap; }
html.lesson-ui .lz-fig .lz-fig-math .mf > span:first-child { white-space: nowrap; }
html.lesson-ui .lz-fig .lz-fig-math .fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .45em 2px; }
html.lesson-ui .lz-fig .lz-fig-math .fr > span:last-child { padding: 3px .3em 0; }
html.lesson-ui .lz-fig .lz-fig-math sup { font-size: .68em; line-height: 0; }
html.lesson-ui .lz-fig .lz-fig-math dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font: 400 13px/1.35 var(--body); }
html.lesson-ui .lz-fig .lz-fig-math dt { font: italic 400 15px/1.2 "STIX Two Math", "Cambria Math", Cambria, "Times New Roman", serif; }
html.lesson-ui .lz-fig .lz-fig-math dd { margin: 0; }
html.lesson-ui .lz-fig .lz-fig-cap + .lz-fig-math { margin-top: 12px; }
/* on the stage: in the centre of the free area, in place of the 3D model, which fades out for the step */
html.lesson-ui #c, html.lesson-ui .labels { transition: opacity .45s ease; }
html.lesson-figstage #c, html.lesson-figstage .labels { opacity: 0; pointer-events: none; }
html.lesson-ui .lz > .lz-fig.stage { left: var(--gap); right: calc(var(--gap) + var(--inset-r, 0px)); top: calc(var(--lz-top-b, 50px) + 16px); bottom: calc(var(--gap) + var(--lz-bot-h, 150px) + 12px);
  width: auto; flex-direction: row; align-items: center; justify-content: center; gap: 40px; padding: 0; background: none; border: 0; border-radius: 0;
  -webkit-backdrop-filter: none; backdrop-filter: none; --fig-sw: 2.3px; }
html.lesson-ui .lz-fig.stage .fig-side { flex: 0 1 320px; max-width: 46%; }
html.lesson-ui .lz-fig.stage text { stroke: var(--stage); }
html.lesson-ui .lz-fig.stage .f-head, html.lesson-ui .lz-fig.stage .f-ring, html.lesson-ui .lz-fig.stage .f-task-box { fill: var(--stage); }
html.lesson-ui .lz-fig.stage .lz-fig-note { font-size: 11.5px; margin-top: 6px; }
html.lesson-ui .lz-fig.stage .lz-fig-cap { font-size: 17px; line-height: 1.4; text-align: left; margin-top: 0; }
html.lesson-ui .lz-fig.stage .lz-fig-bars { margin-top: 0; padding-top: 0; border-top: 0; gap: 10px; }
html.lesson-ui .lz-fig.stage .lz-fig-cap + .lz-fig-bars { margin-top: 14px; }
html.lesson-ui .lz-fig.stage .bt { font-size: 12px; }
html.lesson-ui .lz-fig.stage .br { font-size: 15px; row-gap: 4px; }
html.lesson-ui .lz-fig.stage .bv { font-size: 14px; }
html.lesson-ui .lz-fig.stage .bk { height: 10px; }
html.lesson-ui .lz-fig.stage .lz-fig-math .mt { font-size: 12px; }
html.lesson-ui .lz-fig.stage .lz-fig-math .mf { font-size: 27px; margin-bottom: 14px; }
html.lesson-ui .lz-fig.stage .lz-fig-math dl { font-size: 14.5px; gap: 5px 12px; }
html.lesson-ui .lz-fig.stage .lz-fig-math dt { font-size: 18px; }
/* inside the Explain text: the drawing with its numbers and formula beside it */
html.lesson-ui .lz-figin { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; margin: 2px 0 12px; pointer-events: none; --fig-sw: 1.5px; }
html.lesson-ui .lz-figin[hidden] { display: none; }
html.lesson-ui .lz-fig.inline .fig-side { flex: 1 1 150px; }
html.lesson-ui .lz-fig.inline .lz-fig-cap { text-align: left; margin-top: 0; }
html.lesson-ui .lz-fig.inline .lz-fig-bars { margin-top: 0; padding-top: 0; border-top: 0; }
html.lesson-ui .lz-fig.inline .lz-fig-cap + .lz-fig-bars { margin-top: 8px; }
html.lesson-ui .lz-fig.inline .lz-fig-math .mf { font-size: 18px; }
html.lesson-ui .lz-fig.inline .lz-fig-math dl { font-size: 12.5px; }
html.lesson-ui .lz-fig .f-body { fill: none; stroke: var(--fg); stroke-width: var(--fig-sw); stroke-linecap: round; stroke-linejoin: round; }
html.lesson-ui .lz-fig .f-foot { fill: var(--fg); }
html.lesson-ui .lz-fig .f-trunk { stroke-width: calc(var(--fig-sw) * 3.4); }
html.lesson-ui .lz-fig .f-leg { stroke-width: calc(var(--fig-sw) * 2); }
html.lesson-ui .lz-fig .f-arm { stroke-width: calc(var(--fig-sw) * 1.4); }
html.lesson-ui .lz-fig .f-head { fill: var(--panel); }
html.lesson-ui .lz-fig .f-eye { fill: var(--fg); }
html.lesson-ui .lz-fig .f-band { stroke: var(--fg); stroke-width: calc(var(--fig-sw) * 2.4); stroke-linecap: butt; }
html.lesson-ui .lz-fig .f-ground { fill: none; stroke: var(--muted); stroke-width: calc(var(--fig-sw) * .8); stroke-linejoin: round; }
html.lesson-ui .lz-fig .f-ground.f-fill { fill: color-mix(in srgb, var(--muted) 22%, var(--panel)); }
html.lesson-ui .lz-fig .f-hint, html.lesson-ui .lz-fig .f-att, html.lesson-ui .lz-fig .f-lead { fill: none; stroke: var(--accent); stroke-width: calc(var(--fig-sw) * .75); stroke-linecap: round; }
html.lesson-ui .lz-fig .f-att { stroke-dasharray: 3 3; }
html.lesson-ui .lz-fig .f-hint-fill, html.lesson-ui .lz-fig .f-att-fill { fill: var(--accent); }
html.lesson-ui .lz-fig .f-dots { fill: var(--muted); }
html.lesson-ui .lz-fig .f-task-box { fill: var(--panel); stroke: var(--accent); stroke-width: calc(var(--fig-sw) * .75); }
html.lesson-ui .lz-fig .f-ring { fill: var(--panel); stroke: var(--accent); stroke-width: calc(var(--fig-sw) * .9); }
html.lesson-ui .lz-fig text { font-family: var(--body); font-weight: 600; fill: var(--fg); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
html.lesson-ui .lz-fig .f-task text { fill: var(--accent); stroke: none; }
html.lesson-ui .lz-fig p { margin: 0; }
html.lesson-ui .lz-fig .lz-fig-note { font: 500 10.5px/1.3 var(--mono); color: var(--muted); letter-spacing: .04em; text-align: center; }
html.lesson-ui .lz-fig .lz-fig-cap { font: 500 13px/1.35 var(--body); color: var(--fg); text-align: center; margin-top: 4px; text-wrap: balance; }
html.lesson-ui .lz-fig .lz-fig-bars { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ov-line); display: flex; flex-direction: column; gap: 6px; }
html.lesson-ui .lz-fig .lz-fig-bars[hidden], html.lesson-ui .lz-fig .br[hidden], html.lesson-ui .lz-fig [hidden] { display: none; }
html.lesson-ui .lz-fig .bt { font: 600 11px/1.3 var(--mono); letter-spacing: .04em; color: var(--muted); }
html.lesson-ui .lz-fig .br { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l v" "k k"; column-gap: 8px; row-gap: 2px; font: 500 13px/1.25 var(--body); }
html.lesson-ui .lz-fig .bl { grid-area: l; min-width: 0; overflow-wrap: anywhere; }
html.lesson-ui .lz-fig .bv { grid-area: v; font: 600 12.5px/1.25 var(--mono); font-variant-numeric: tabular-nums; }
html.lesson-ui .lz-fig .bk { grid-area: k; height: 7px; border-radius: 2px; background: color-mix(in srgb, var(--fg) 12%, transparent); overflow: hidden; }
html.lesson-ui .lz-fig .bf { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s cubic-bezier(.65, 0, .35, 1); }
@media (max-width: 767px) {
  /* flush with the left screen edge, no border and no rounding: a plain backdrop keeps the bars readable over the model */
  html.lesson-ui .lz > .lz-fig { left: 0; top: calc(var(--lz-top-b, 50px) + 6px); bottom: auto; width: auto; max-width: 166px; min-width: 112px;
    padding: 6px 8px 8px max(8px, env(safe-area-inset-left, 0px)); background: var(--ov-bg); -webkit-backdrop-filter: blur(var(--ov-blur)); backdrop-filter: blur(var(--ov-blur));
    border: 0; border-radius: 0; box-shadow: none; --fig-sw: 1.5px; }
  html.lesson-ui .lz > .lz-fig:not(.stage) .fig-draw { align-items: flex-start; }
  /* stage on phones: the drawing above the sheet with its caption; numbers and formula stand in the Explain text below */
  html.lesson-ui .lz > .lz-fig.stage { left: 0; right: 0; top: calc(var(--lz-top-b, 50px) + 8px); bottom: calc(var(--lz-bar) + var(--lz-sheet) + var(--lz-cap-h, 0px) + 18px);
    max-width: none; min-width: 0; flex-direction: column; gap: 4px; padding: 0 16px; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; --fig-sw: 1.9px; }
  html.lesson-ui .lz-fig.stage .fig-side { flex: none; max-width: none; align-self: stretch; }
  html.lesson-ui .lz-fig.stage .lz-fig-math, html.lesson-ui .lz-fig.stage .lz-fig-bars { display: none; }
  html.lesson-ui .lz-fig.stage .lz-fig-cap { font-size: 13.5px; text-align: center; }
  html.lesson-ui .lz-fig.stage .lz-fig-note, html.lesson-ui .lz-fig.stage .lz-fig-cap { text-shadow: none; }
  html.lesson-ui .lz-fig.stage .lz-fig-note { font-size: 9.5px; text-align: center; }
  /* in the Explain sheet the drawing is not repeated (it stands above the sheet): numbers and formula only */
  html.lesson-ui .lz-fig.inline .fig-draw { display: none; }
  html.lesson-ui .lz-figin:not(.has-side) { display: none; }
  html.lesson-ui .lz-fig.inline .lz-fig-cap, html.lesson-ui .lz-fig.inline .br, html.lesson-ui .lz-fig.inline .bt { text-shadow: none; }
  html.lesson-ui .lz-fig.inline .lz-fig-cap { font-size: 13px; }
  html.lesson-ui .lz-fig.inline .br { font-size: 13px; }
  html.lesson-ui .lz-fig.inline .bv { font-size: 12.5px; }
  html.lesson-ui .lz-fig.inline .bt { font-size: 10.5px; }
  html.lesson-ui .lz-fig.inline .bk { height: 7px; }
  html.lesson-ui .lz-fig .lz-fig-note { font-size: 9px; text-align: left; }
  html.lesson-ui .lz-fig .lz-fig-cap { font-size: 11px; text-align: left; margin-top: 2px; }
  html.lesson-ui .lz-fig .lz-fig-bars { margin-top: 4px; padding-top: 0; border-top: 0; gap: 3px; }
  html.lesson-ui .lz-fig .bt { font-size: 9px; }
  html.lesson-ui .lz-fig .br { font-size: 10.5px; column-gap: 4px; row-gap: 1px; }
  html.lesson-ui .lz-fig .bv { font-size: 10px; }
  html.lesson-ui .lz-fig .bk { height: 5px; }
  html.lesson-ui .lz-fig .lz-fig-cap, html.lesson-ui .lz-fig .br, html.lesson-ui .lz-fig .bt, html.lesson-ui .lz-fig .lz-fig-note {
    text-shadow: 0 0 2px var(--panel), 0 0 2px var(--panel), 0 0 3px var(--panel); }
}
