/* 회로놀이터 lesson.css — 주인 40장(§4·§8-1). 강의 쪽 실험 칸 배치·조작 칸·읽음값·보기 전환·sticky.
   색은 site.css 토큰만 쓴다. 모양 값(간격·둥글기)은 3단계 견본 승인 뒤 DESIGN.md 에 고정한다. 간격은 4px 배수. */

/* ── §4-10 배치 ── */
.lab__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 720px) {
  .lab__form { grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    grid-template-areas: "help help" "display display" "stage stage" "descs descs" "ctl read" "act notes" "plots plots"; column-gap: 24px; }
  .lab__help{grid-area:help} .lab__display{grid-area:display} .lab__stage{grid-area:stage} .lab__descs{grid-area:descs}
  .lab__controls{grid-area:ctl} .lab__actions{grid-area:act} .lab__readings{grid-area:read} .lab__notes{grid-area:notes} .lab__plots{grid-area:plots}
}
@media (max-width: 719px) and (min-height: 600px) {          /* a11y-09: 세로 폰에서만 그림을 붙인다 */
  .lab--sticky .lab__stage { position: sticky; top: 66px; z-index: 1; max-height: 40vh; max-height: 40svh; background: var(--fb-bg); }
  .lab--sticky .lab-svg { max-height: calc(40vh - 56px); max-height: calc(40svh - 56px); }
  .lab--sticky .lab__controls :is(input, select, button) { scroll-margin-top: calc(40vh + 8px); scroll-margin-top: calc(40svh + 8px); }
}
.js-wait { visibility: hidden; }
.ctl__row { display: flex; align-items: center; gap: 8px; }
.ctl__range { flex: 1 1 auto; min-width: 0; }
.ctl__num { width: 6.5em; flex: 0 0 auto; }
.lab-svg, .plot { display: block; width: 100%; height: auto; }
.lab__readings, .reading--primary, .ctl__num { font-variant-numeric: tabular-nums; }
.reading:not([data-na]) .na-text { display: none; }
.formula { overflow-x: auto; }

/* ── §4-5 보기 전환 — 두 덩어리를 한 선택자 목록에 섞지 않는다(a11y-18) ── */
@media (max-width: 719px) {
  @supports selector(:has(*)) {
    .lab:has(#view-iso:checked) .lab__scene--two .lab-fig--schem,
    .lab:has(#view-schem:checked) .lab__scene--two .lab-fig--iso { display: none }
  }
  @supports not selector(:has(*)) {
    .lab--view-iso .lab__scene--two .lab-fig--schem,
    .lab--view-schem .lab__scene--two .lab-fig--iso { display: none }
  }
}
@media (min-width: 720px) {
  .lab__views { display: none }
  .lab__scene--two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px }
}

/* ── §4-3·§4-8 조작 칸·누르는 곳 44px ── */
.ctl { margin: 0 0 12px; padding: 0; border: 0; }
.ctl__label { font-weight: 700; }
.ctl__help { margin: 4px 0 0; color: var(--fb-muted); }
.ctl__opts { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ctl__opt, .ctl__switch, .lab__opt, .lab__still { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.ctl__num, .ctl__select { min-height: 44px; }
.ctl__range { min-height: 44px; }
.ctl__step { min-width: 44px; min-height: 44px; }
.lab__reset { min-height: 44px; display: inline-flex; align-items: center; }
.ctl__state { margin-left: 8px; color: var(--fb-muted); }
.sw { display: inline-block; width: 16px; height: 16px; border: 1px solid var(--ctl-border); border-radius: 4px; background: var(--sw, transparent); }
.lab__views { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.lab__display { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.lab__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

/* ── §4-2 읽음값·장면 ── */
.lab-fig { margin: 0; }
.lab-fig figcaption, .lab-plot figcaption { color: var(--fb-muted); font-size: 14px; }
.lab-plot { margin: 0; }
/* §7-10 그래프 크기(fix6, B2) — 화면 글자 = 13 × 그린 폭 ÷ 320. 384px 면 15.6px(본문 16px 이하), 좁은 폭은 좌우 8px 내어 360 에서 14px */
.lab-plot { max-width: 384px; }
@media (max-width: 719px) { .lab-plot .plot { width: calc(100% + 16px); margin-inline: -8px; } }
.plot-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 14px; }
.plot-key li { display: inline-flex; align-items: center; gap: 6px; }
.plot-key__line { display: block; width: 24px; height: 8px; flex: none; }
.reading--primary { margin: 16px 0 0; font-size: 20px; }   /* fix6(B4): 그림 설명 글과 8px → 16px */
.reading__k { color: var(--fb-muted); }
.reading__v { font-weight: 700; }
.lab__readings { margin: 0; }
.lab__readings .reading { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.lab__readings dt, .lab__readings dd { margin: 0; }
.lab-desc__k { font-weight: 700; }
.lab__flow-note { color: var(--fb-muted); font-size: 14px; }
