/* V07f: the mission page around the mission desktop (sim-bench.js). The V07c-V07e Bench (three.js robot views) is gone.
   >= 1024 px: lesson column (--sb-cw: 34 %, 38 % under 1440 px; scrolls on its own) | desktop (the rest, full height), a draggable
   splitter between them; body.sb-focus hides the lesson. < 1024 px (body.sb-narrow): the lesson first, the desktop below it, one
   window at a time under a sticky tab bar. body.sb-labreal (My ROS 2 PC chosen): the desktop is hidden, the 3-step panel shows;
   body.sb-real (connected): the page's own terminal shows under it. */
/* the lab choice at the top of the lesson */
.sb-lab { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: 0 0 1rem; }
.sb-labbtn { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; padding: .45rem .7rem; border: 2px solid var(--line, #D3DBE3); border-radius: 10px; background: #fff; color: var(--ink, #1B2733); font: inherit; cursor: pointer; }
.sb-labbtn b { font-size: .98rem; }
.sb-labbtn span { font-size: .78rem; color: var(--ink-2, #4F5F6D); line-height: 1.25; }
.sb-labbtn[aria-pressed="true"] { border-color: var(--teal, #0E8A7A); background: var(--teal-wash, #DDF3EF); }
.sb-labbtn[aria-pressed="true"] b::before { content: "● "; color: var(--teal, #0E8A7A); }
/* the desktop column */
.sb { display: flex; flex-direction: column; min-height: 0; margin: 0; }
.sb-bar { flex: none; display: flex; gap: .5rem; align-items: center; padding: 5px 10px 5px 14px; background: #1b2229; }
.sb-bar .btn { padding: .3rem .7rem; font-size: .88rem; }
.sb-bar .btn.quiet { color: #D9E2EA; border-color: #46535F; }
.sb-bar .btn.quiet:hover { background: #2A333D; }
.sb-state { flex: 1; margin: 0; min-width: 0; color: #B9C5D0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-tabs { display: none; }
.sb-frame { position: relative; flex: 1; min-height: 0; background: #2b2b2b; }
.sb-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.sb-realpanel { display: none; margin: .7rem 1rem; padding: .8rem 1rem; background: #2A333D; border-radius: 10px; color: #D9E2EA; font-size: .9rem; }
.sb-realpanel h3 { margin: 0 0 .3rem; color: #fff; font-size: 1.05rem; }
.sb-realpanel a { color: #9EC1FF; }
.sb-realpanel code { background: #141B21; padding: .05rem .35rem; border-radius: 4px; overflow-wrap: anywhere; }
.sb-rp-steps { margin: .4rem 0 .6rem 1.2rem; padding: 0; } .sb-rp-steps li { margin: .3rem 0; }
.sb-rp-state { margin: 0; color: #FFD36A; } .sb-rp-state.ok { color: #7FD9C6; }
.sb-rp-cmd { display: flex; gap: .5rem; align-items: center; margin: .25rem 0; } .sb-rp-cmd code { flex: 1; }
.sb-realpanel .btn { padding: .2rem .6rem; font-size: .85rem; }
.sb-realpanel .btn.quiet { color: #D9E2EA; border-color: #46535F; }
.sb-split { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; z-index: 30; cursor: col-resize; touch-action: none; }
.sb-split:hover, .sb-split:focus-visible, .sb-split.drag { background: rgba(233, 84, 32, .8); outline: none; }
body.sb-dragging, body.sb-dragging * { user-select: none; cursor: col-resize !important; }
body.sb-dragging .sb-frame iframe { pointer-events: none; }
/* the old bench parts (removed from the pages; kept hidden here in case a page still has one) */
body.sb-lab2 .bench > .head, body.sb-lab2 .bench > .view3d, body.sb-lab2 .bench > .note, body.sb-lab2 .bench .modebar, body.sb-lab2 .bench .realhelp { display: none !important; }
/* Browser Lab: the desktop's terminal replaces the page's own one */
body.sb-lab2:not(.sb-real) .bench .term { display: none; }
body.sb-labreal .sb-frame, body.sb-labreal .sb-open, body.sb-labreal .sb-tabs { display: none !important; }
body.sb-labreal .sb-realpanel { display: block; }
body.sb-labreal .sb { flex: none; }
/* >= 1024 px: lesson | desktop on one screen */
body.sb-lab2:not(.sb-narrow) { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.sb-lab2:not(.sb-narrow) > .rim2-bar { flex: none; }
body.sb-lab2:not(.sb-narrow) > .page { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--sb-cw, 34%) minmax(0, 1fr); }
body.sb-lab2:not(.sb-narrow) main.lesson { height: 100%; overflow: auto; max-width: none; min-width: 0; padding-top: .6rem; }
body.sb-lab2:not(.sb-narrow) .bench { position: relative; top: auto; height: 100%; min-width: 0; display: flex; flex-direction: column; overflow: visible; }
body.sb-lab2:not(.sb-narrow) .sb { flex: 1; }
body.sb-lab2:not(.sb-narrow).sb-labreal .sb { flex: none; }
body.sb-lab2:not(.sb-narrow).sb-real .bench .term { flex: 1; }
body.sb-focus:not(.sb-narrow) > .page { grid-template-columns: minmax(0, 1fr); }
body.sb-focus:not(.sb-narrow) main.lesson, body.sb-focus .sb-split { display: none; }
/* < 1024 px: the lesson first, then the desktop with a sticky tab bar */
body.sb-narrow > .page { display: block; }
body.sb-narrow .bench { position: relative; top: auto; height: auto; }
body.sb-narrow .sb-split, body.sb-narrow .sb-focusbtn { display: none; }
body.sb-narrow .sb-bar { flex-wrap: wrap; }   /* V07f: on phones the status line goes under the button, full width */
body.sb-narrow .sb-state { flex: 1 1 100%; white-space: normal; }
body.sb-narrow .sb-tabs { display: flex; position: sticky; top: 0; z-index: 25; gap: 4px; padding: 5px 8px; background: #1d1d1d; overflow-x: auto; }
body.sb-narrow .sb-tab { flex: 1 1 0; min-width: 0; background: #3a3a3a; color: #eee; border: 1px solid #555; border-radius: 4px; padding: 6px 6px; font: 600 .85rem system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
body.sb-narrow .sb-tab[aria-selected="true"] { background: #e95420; border-color: #e95420; color: #fff; }
body.sb-narrow .sb-frame { flex: none; height: calc(100svh - 46px); min-height: 420px; }
@media (max-width: 600px) { .sb-lab { grid-template-columns: 1fr 1fr; } .sb-labbtn span { display: none; } .sb-labbtn[aria-pressed="true"] span { display: block; } }
/* V10a R1: a CV mission (course-map.js tools start with CV) shows no desktop until "Try it in a terminal" */
body.sb-cv > .page { display: block; }
body.sb-cv .bench { display: none !important; }
body.sb-cv main.lesson { margin: 0 auto; max-width: 860px; }
.sb-try { border: 2px dashed var(--teal, #0E8A7A); }
.sb-try h3 { margin-top: 0; }
/* V10a: previous / next from course-map.js, the course home list, the first-aid box */
.cm-nav { margin: 1.6rem 0 0; padding: .8rem 1rem; border-top: 2px solid var(--line, #D3DBE3); }
.cm-nav p { margin: .25rem 0; }
.cm-coming, .cm-soon > .cm-coming { color: var(--ink-2, #4F5F6D); }
.cm-index { margin: 0 auto; max-width: 900px; padding: 1.4rem 1.2rem 4rem; }
.cm-list { list-style: none; padding: 0; margin: .2rem 0 1rem; }
.cm-list li { padding: .2rem 0; }
.cm-meta { font-size: .82rem; color: var(--ink-2, #4F5F6D); }
.cm-order { margin: .4rem 0 0; }
details.firstaid { margin: 1rem 0; border: 1px solid var(--line, #D3DBE3); border-left: 4px solid #C8412B; border-radius: 8px; padding: .5rem .8rem; background: #FFF8F5; }
details.firstaid summary { cursor: pointer; font-weight: 700; }
details.firstaid dl { margin: .5rem 0 0; }
details.firstaid dt { margin-top: .5rem; }
details.firstaid dt code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; background: #1B2229; color: #E8EEF3; padding: .3rem .5rem; border-radius: 5px; font-size: .8rem; }
details.firstaid dd { margin: .2rem 0 0 .2rem; font-size: .92rem; }
details.firstaid .src { font-size: .75rem; color: var(--ink-2, #4F5F6D); }
