/* 장면·실행·진행 체크를 같은 뷰포트에 유지하는 실험 작업 공간. */
body.lab-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.lab-app > .explorer-launcher { position: static; flex: none; }
.lab-app.has-explorer > main.lab-workspace { display: grid; flex: 1; grid-template-rows: auto auto minmax(0, 1fr); gap: 9px; min-height: 0; max-width: none; padding: 12px 18px; }
.lab-workspace .lab-head { position: relative; min-width: 0; padding: 0 145px 0 0; min-height: 42px; }
.lab-workspace .lab-head .crumb { margin: 0 0 3px; font-size: 10px; }
.lab-workspace .lab-head h1 { font-size: 20px; font-weight: 550; line-height: 1.4; letter-spacing: -.035em; }
.lab-workspace .lab-head > p { display: none; }
.workspace-help-button { position: absolute; top: 10px; right: 0; padding: 7px 10px; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-sub); font: inherit; font-size: 10px; cursor: pointer; }
.workspace-head-actions { position: absolute; top: 7px; right: 0; display: flex; align-items: center; gap: 8px; }
.workspace-head-actions > .workspace-help-button { position: static; }
.workspace-head-actions > .sfx-toggle { width: 32px; height: 32px; }
.workspace-export-button { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-sub); cursor: pointer; }
.workspace-export-button:hover { color: var(--text); border-color: var(--line-strong); }
.workspace-export .export-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.workspace-export .export-status { margin: 18px 0 0; font-size: 12px; }
.lab-workspace .stepper { gap: 5px; margin: 0; overflow: hidden; }
.lab-workspace .stepper button { justify-content: center; gap: 6px; height: 32px; min-width: 0; padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 500; }
.lab-workspace .stepper .ico { flex: none; width: 20px; height: 20px; border-radius: 4px; }
.lab-workspace .stepper .ico i { width: 13px; height: 13px; }
.lab-workspace .stepper .current button { border-color: #5d5d82; box-shadow: none; background: #20212c; }
.lab-workspace .stepper .current .ico { background: #44445e; color: #dedeea; }
.lab-workspace .lab-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr); grid-template-rows: minmax(0, 1fr); gap: 12px; min-width: 0; min-height: 0; align-items: stretch; }
.lab-workspace .bench { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; margin: 0; order: initial; border: 1px solid var(--line); border-radius: 9px; background: #111216; overflow: hidden; }
.lab-workspace .scene-head { flex: none; align-items: center; padding: 11px 14px; min-height: 34px; border-bottom: 1px solid var(--line); font-size: 10px; }
.lab-workspace .scene-head b { color: var(--text-sub); font-weight: 500; }
.lab-workspace .scene-head span { color: var(--text-mute); font-size: 10px; font-variant-numeric: tabular-nums; }
.workspace-viewport { container-type: size; display: flex; flex: 1; align-items: center; justify-content: center; min-width: 0; min-height: 0; overflow: hidden; background: #111216; }
.lab-workspace .workspace-viewport > #scene, .lab-workspace .workspace-viewport > #board, .lab-workspace .workspace-viewport > #circuit {
  display: block; flex: none; width: min(100cqw, calc(100cqh * var(--scene-ratio))); max-width: 100%; height: auto; max-height: 100%; aspect-ratio: var(--scene-ratio); margin: 0; background: #111216;
}
.lab-workspace .meters { flex: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; margin: 0; border-top: 1px solid var(--line); background: #121318; }
.lab-workspace .meter { display: flex; flex-direction: column; justify-content: center; padding: 8px 12px; min-height: 48px; border: 0; border-radius: 0; background: transparent; }
.lab-workspace .meter:nth-child(odd) { border-right: 1px solid var(--line); }
.lab-workspace .meter:nth-child(n+3) { border-top: 1px solid var(--line); }
.lab-workspace .meter span { font-size: 9px; color: var(--text-mute); }
.lab-workspace .meter b { font-size: 13px; line-height: 1.5; font-weight: 550; }
.workspace-panel { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #121318; }
.lab-workspace .guide { grid-row: 1; order: initial; min-height: 0; padding: 12px 14px; border: 0; border-radius: 0; background: transparent; }
.lab-workspace .guide > :not(.step-no, h2, .tasks, .feedback) { display: none; }
.lab-workspace .guide .step-no { display: inline; margin-right: 8px; color: var(--text-mute); font-size: 9px; font-weight: 400; }
.lab-workspace .guide h2 { display: inline; margin: 0; font-size: 12px; font-weight: 550; }
.lab-workspace .tasks { display: grid; grid-template-columns: 1fr; gap: 4px; max-height: 88px; margin-top: 8px; overflow-y: auto; }
.lab-workspace .tasks li { align-items: start; gap: 6px; font-size: 10px; line-height: 1.5; }
.lab-workspace .tasks li::before { width: 12px; height: 12px; margin-top: 2px; border-width: 1px; background-size: 9px; }
.lab-workspace .feedback { max-height: 60px; margin-top: 7px; padding: 6px 8px; border-radius: 5px; overflow-y: auto; font-size: 10px; line-height: 1.55; }
.workspace-tabs { display: flex; grid-row: 2; flex: none; gap: 18px; padding: 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.workspace-tabs button { position: relative; padding: 10px 1px; min-height: 34px; border: 0; background: transparent; color: var(--text-mute); font: inherit; font-size: 10px; cursor: pointer; }
.workspace-tabs button[aria-selected=true] { color: var(--text); }
.workspace-tabs button[aria-selected=true]::after { content: ''; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; border-radius: 2px; background: #c8c8d9; }
.workspace-content { display: flex; grid-row: 3; min-height: 0; min-width: 0; overflow: hidden; }
.lab-workspace .controls { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; overflow: hidden; }
.workspace-fields { flex: 1; min-height: 0; padding: 12px 14px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.workspace-fields > h3 { margin-bottom: 10px; font-size: 10px; color: var(--text-mute); font-weight: 500; }
.lab-workspace .param { grid-template-columns: minmax(0, 1fr) auto; margin: 0 0 10px; gap: 1px 8px; }
.lab-workspace .param label, .lab-workspace .param output { font-size: 11px; font-weight: 400; }
.lab-workspace .param output { justify-self: end; color: var(--text); }
.lab-workspace .param input[type=range] { height: 24px; min-height: 24px; }
.lab-workspace .param select { min-height: 32px; padding: 5px 8px; font-size: 11px; }
.lab-workspace .param input[type=number] { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.lab-workspace .workspace-fields > p, .lab-workspace .workspace-fields .small-note { font-size: 10px; line-height: 1.6; color: var(--text-mute); }
.lab-workspace .workspace-fields .presets { gap: 5px; margin-top: 10px; }
.lab-workspace .workspace-fields .btn { min-height: 30px; padding: 5px 8px; border-radius: 5px; font-size: 10px; }
.lab-workspace .controls > .actions { display: grid; flex: none; grid-template-columns: repeat(var(--workspace-actions, 4), minmax(0, 1fr)); gap: 6px; margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); background: #17181e; }
.lab-workspace .controls > .actions .btn { min-height: 34px; height: 34px; padding: 0 4px; font-size: 10px; border-radius: 6px; white-space: nowrap; }
.lab-workspace .confirm { gap: 8px; margin-top: 8px; padding: 10px; font-size: 11px; }
.lab-workspace .confirm input { width: 16px; height: 16px; margin-top: 2px; }
.lab-workspace .work, .workspace-notes { display: block; flex: 1; min-height: 0; min-width: 0; margin: 0; padding: 14px; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 0; background: transparent; scrollbar-width: thin; }
.lab-workspace .work > * + * { margin-top: 14px; }
.lab-workspace .work h3, .workspace-notes > h3 { margin-bottom: 10px; color: var(--text-sub); font-size: 12px; font-weight: 500; }
.lab-workspace .work p, .workspace-notes p { font-size: 11px; line-height: 1.8; }
.lab-workspace .options { gap: 7px; grid-template-columns: 1fr; }
.lab-workspace .option { min-height: 38px; padding: 10px 12px; border-radius: 6px; font-size: 11px; font-weight: 400; }
.lab-workspace .work .formula { padding: 16px; border-radius: 7px; }
.lab-workspace .formula b { font-size: 20px; }
.lab-workspace .formula span { font-size: 11px; }
.lab-workspace .graph svg { max-height: 250px; }
.lab-workspace .step-nav { display: flex; grid-row: 4; order: initial; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #17181e; }
.lab-workspace .step-nav .btn { height: 34px; min-height: 34px; padding: 0 12px; font-size: 11px; border-radius: 6px; }
.lab-workspace .tray { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lab-workspace .chip { min-width: 0; padding: 6px 4px; border-radius: 6px; font-size: 10px; }
.lab-workspace .chip img { max-width: 65px; }
.lab-workspace .ctrl-row { gap: 8px; }
.lab-workspace .ctrl-row + .ctrl-row { margin-top: 12px; }
.lab-workspace .ctrl-row label, .lab-workspace .toggle { min-width: 0; font-size: 11px; }
.lab-workspace .ctrl-row input[type=range] { min-width: 80px; }
.lab-workspace .readout { font-size: 14px; min-width: 50px; }
.lab-workspace .toggle { min-height: 34px; height: 34px; padding-inline: 10px; border-radius: 6px; }
.lab-workspace .slot rect { fill: #1a1b24; stroke: #4c4f62; }
.lab-workspace .cable.black { stroke: #9e9faa; }
.lab-app > .site-footer { position: relative; z-index: 10; flex: none; padding: 0; height: 42px; overflow: visible; background: var(--bg); }
.lab-app > .site-footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 8px; height: 100%; padding-inline: 18px; }
.lab-app > .site-footer > .container { max-width: none; padding-block: 0; }
.lab-app .footer-bottom { flex: 1; justify-content: flex-end; flex-wrap: nowrap; min-width: 0; margin: 0; padding: 0; border: 0; }
.lab-app .footer-bottom .footer-meta { display: none; }
.lab-app .footer-info > summary { display: flex; align-items: center; gap: 8px; padding: 7px 0; color: var(--text-sub); font-size: 10px; list-style: none; cursor: pointer; white-space: nowrap; }
.lab-app .footer-info > summary::-webkit-details-marker { display: none; }
.lab-app .footer-info[open] > summary { color: var(--text); }
.lab-app .footer-info[open] > summary span { transform: rotate(180deg); }
.lab-app .footer-details { position: absolute; right: 12px; bottom: calc(100% + 8px); left: 12px; max-height: min(440px, 70dvh); overflow-y: auto; overscroll-behavior: contain; padding: 24px; border: 1px solid var(--line-strong); border-radius: 10px; background: #14151a; box-shadow: 0 -16px 60px #0008; }
.lab-app > .site-footer .footer-links { width: 100%; gap: 10px 16px; font-size: 11px; }
.lab-app .site-footer .language-switcher { flex-wrap: nowrap; gap: 4px; margin: 0; padding: 0; border: 0; font-size: 10px; }
.lab-app .footer-bottom .language-switcher { order: initial; flex-basis: auto; }
.lab-app .language-switcher > svg { width: 12px; height: 12px; margin-right: 0; }
.lab-app .language-switcher a { padding: 4px 8px; }
.workspace-help { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: #17181e; color: var(--text); box-shadow: 0 30px 100px #0009; }
.workspace-help::backdrop { background: #000b; backdrop-filter: blur(4px); }
.workspace-help-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.workspace-help-head h2 { font-size: 15px; font-weight: 550; }
.workspace-help-head button { width: 32px; height: 32px; border: 0; border-radius: 5px; background: #25262e; color: var(--text); font-size: 22px; cursor: pointer; }
.workspace-help-body { padding: 22px; }
.workspace-help-body img, .workspace-help-body svg { display: block; max-width: 100%; height: auto; margin-block: 14px; }
.workspace-help-body h3, .workspace-help-body h2 { margin-bottom: 12px; font-size: 17px; }
.workspace-help-body p { margin-bottom: 16px; color: var(--text-sub); font-size: 14px; line-height: 1.9; }
.workspace-notes .details, .workspace-notes #live-graph, .workspace-notes .scene-note { padding: 0; margin-top: 14px; }
.workspace-notes .scene-note { min-height: 0; }

/* 해설은 HTML에 포함하고 실험 도구 안에서 읽는다. 스크립트가 없으면 본문 아래 표시한다. */
.experiment-guide { max-width: 760px; margin: 36px auto; padding: 28px; color: var(--text-sub); overflow-wrap: anywhere; }
.lab-workspace .experiment-guide { flex: 1; min-width: 0; min-height: 0; max-width: none; margin: 0; padding: 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.experiment-guide-head { margin-bottom: 20px; }
.experiment-guide-eyebrow { margin-bottom: 10px; color: var(--text-mute); font-size: 9px; letter-spacing: .06em; }
.experiment-guide h2 { margin-bottom: 14px; color: var(--text); font-size: 19px; font-weight: 550; line-height: 1.5; letter-spacing: -.035em; }
.experiment-guide h3 { margin-bottom: 12px; color: var(--text); font-size: 14px; font-weight: 550; line-height: 1.6; }
.experiment-guide p, .experiment-guide li { font-size: 13px; line-height: 1.95; }
.experiment-guide .experiment-guide-eyebrow { font-size: 9px; }
.experiment-guide .experiment-guide-intro { color: #c9c9d2; }
.experiment-guide-toc { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.experiment-guide-toc a { color: #b6b5e5; font-size: 11px; text-underline-offset: 4px; }
.experiment-guide a:hover { text-decoration: underline; }
.experiment-guide section, .experiment-guide-related { margin-top: 26px; scroll-margin-top: 18px; }
.experiment-guide ol { padding-left: 20px; }
.experiment-guide li { padding-left: 3px; }
.experiment-guide li + li { margin-top: 14px; }
.experiment-guide-formula { margin-top: 16px; padding: 14px 16px; border: 1px solid #353544; border-radius: 7px; background: #1b1b26; }
.experiment-guide-formula > span { color: var(--text-mute); font-size: 9px; }
.experiment-guide-formula > p { margin-top: 5px; color: #deddf7; font-size: 14px; }
.experiment-guide-question { margin-bottom: 10px; color: #dedee5; }
.experiment-guide-related { padding-top: 22px; border-top: 1px solid var(--line); }
.experiment-guide-related > a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.experiment-guide-related a > span { display: block; color: #c6c5f3; font-size: 12px; }
.experiment-guide-related small { display: block; margin-top: 3px; color: var(--text-mute); font-size: 11px; line-height: 1.7; }
.experiment-guide-related .experiment-guide-category { padding-bottom: 0; border: 0; color: var(--text-sub); font-size: 11px; }
@media (max-width: 700px) {
  .lab-workspace .experiment-guide { padding: 16px; }
  .experiment-guide h2 { font-size: 17px; }
  .experiment-guide p, .experiment-guide li { font-size: 13px; }
  .experiment-guide-toc { gap: 8px 14px; }
}
@media (max-width: 700px), (max-height: 550px) and (orientation: landscape) {
  .lab-workspace[data-workspace-panel="article"] .lab-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .lab-workspace[data-workspace-panel="article"] .bench { display: none; }
  .lab-workspace[data-workspace-panel="article"] .workspace-panel { grid-row: 1; }
}
@media (min-width: 1001px) and (max-width: 1280px) {
  .lab-workspace .stepper .label { display: none; }
  .lab-workspace .stepper .current .label { display: inline; }
}
@media (min-width: 701px) and (max-width: 1000px) {
  .lab-workspace .lab-grid { grid-template-columns: minmax(0, 1.2fr) minmax(290px, 1fr); }
}
@media (max-width: 700px) {
  .lab-app > .explorer-launcher { padding: 2px 12px; }
  .lab-app .explorer-open-button { min-height: 28px; }
  .lab-app.has-explorer > main.lab-workspace { gap: 6px; padding: 8px 10px; }
  .lab-workspace .lab-head { min-height: 28px; padding-right: 150px; }
  .lab-workspace .lab-head .crumb { display: none; }
  .lab-workspace .lab-head h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 28px; }
  .workspace-help-button { top: 0; min-height: 28px; padding: 5px 8px; font-size: 9px; }
  .workspace-head-actions { top: 0; gap: 6px; }
  .workspace-head-actions > .sfx-toggle { width: 28px; height: 28px; }
  .workspace-head-actions > .workspace-export-button { width: 28px; height: 28px; }
  .lab-workspace .stepper button { height: 28px; padding: 3px; gap: 3px; }
  .lab-workspace .stepper .label { display: none; }
  .lab-workspace .stepper .current .label { display: inline; font-size: 9px; }
  .lab-workspace .stepper .ico { width: 17px; height: 17px; }
  .lab-workspace .stepper .ico i { width: 12px; height: 12px; }
  .lab-workspace .lab-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(140px, 1.1fr) minmax(200px, 1fr); gap: 6px; }
  .lab-workspace .scene-head { min-height: 24px; padding: 5px 10px; font-size: 9px; }
  .lab-workspace .scene-head span { font-size: 9px; }
  .lab-workspace .meters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lab-workspace .meter { padding: 5px 7px; min-height: 38px; border: 0; }
  .lab-workspace .meter + .meter { border-left: 1px solid var(--line); }
  .lab-workspace .meter:nth-child(n+3) { border-top: 0; }
  .lab-workspace .meter span { font-size: 8px; line-height: 1.5; }
  .lab-workspace .meter b { font-size: 10px; }
  .lab-workspace .guide { padding: 7px 10px; }
  .lab-workspace .guide h2 { font-size: 11px; }
  .lab-workspace .guide .step-no { font-size: 8px; }
  .lab-workspace .tasks { max-height: 43px; margin-top: 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-workspace .tasks li:only-child { grid-column: 1 / -1; }
  .lab-workspace .tasks li { font-size: 9px; }
  .lab-workspace .tasks li::before { width: 10px; height: 10px; }
  .lab-workspace .feedback { margin-top: 4px; padding: 4px 7px; max-height: 35px; font-size: 9px; }
  .workspace-tabs { gap: 20px; padding-inline: 10px; }
  .workspace-tabs button { min-height: 30px; padding-block: 7px; font-size: 10px; }
  .workspace-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 0 12px; padding: 8px 10px; }
  .workspace-fields > :not(.param) { grid-column: 1 / -1; }
  .lab-workspace .controls > .actions { padding: 6px 10px; gap: 5px; }
  .lab-workspace .controls > .actions .btn { min-height: 32px; height: 32px; font-size: 10px; }
  .lab-workspace .param { margin-bottom: 8px; }
  .lab-workspace .work, .workspace-notes { padding: 10px; }
  .lab-workspace .work h3 { margin-bottom: 6px; font-size: 11px; }
  .lab-workspace .options { gap: 5px; }
  .lab-workspace .option { min-height: 34px; padding: 7px 9px; font-size: 11px; }
  .lab-workspace .step-nav { padding: 6px 10px; }
  .lab-workspace .step-nav .btn { height: 32px; min-height: 32px; font-size: 10px; }
  .lab-app > .site-footer .container { padding-inline: 10px; gap: 6px; }
  .lab-app .footer-info > summary { gap: 3px; font-size: 9px; }
  .lab-app .site-footer .language-switcher { gap: 3px; font-size: 9px; }
  .lab-app .language-switcher a { padding: 5px 6px; }
  .lab-app .footer-details { padding: 18px; }
}
@media (max-height: 600px) and (orientation: portrait) {
  .lab-workspace .lab-grid { grid-template-rows: minmax(90px, 1fr) minmax(170px, 1.1fr); }
  .lab-workspace .guide { padding-block: 5px; }
  .lab-workspace .tasks { max-height: 28px; }
  .lab-workspace .feedback { max-height: 25px; }
}
@media (max-height: 550px) and (orientation: landscape) {
  .lab-app .explorer-launcher { padding-block: 0; }
  .lab-app.has-explorer > main.lab-workspace { gap: 4px; padding-block: 5px; }
  .lab-workspace .lab-head { min-height: 24px; }
  .lab-workspace .lab-head .crumb { display: none; }
  .lab-workspace .lab-head h1 { font-size: 14px; line-height: 24px; }
  .workspace-help-button { top: 0; min-height: 24px; padding-block: 2px; }
  .workspace-head-actions { top: 0; }
  .workspace-head-actions > .sfx-toggle { width: 24px; height: 24px; }
  .workspace-head-actions > .workspace-export-button { width: 24px; height: 24px; }
  .lab-workspace .stepper button { height: 24px; }
  .lab-workspace .stepper .ico { width: 16px; height: 16px; }
  .lab-workspace .stepper .label { display: none; }
  .lab-workspace .lab-grid { grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr); grid-template-rows: minmax(0, 1fr); }
  .lab-workspace .guide { padding-block: 6px; }
  .lab-workspace .tasks { max-height: 30px; }
  .lab-workspace .meter { min-height: 30px; padding-block: 4px; }
}
