/* v12 (Phase 7/8): Explorer + file editor in the Code pane */
.rx-explorer { flex: 0 0 auto; border-bottom: 1px solid var(--border); padding: 6px 10px; font-size: 12.5px; max-height: 38%; overflow: auto; background: var(--surface); }
.rx-ex-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.rx-explorer ul { list-style: none; margin: 0; padding: 0; }
.rx-ex-f { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.rx-ex-f:hover { background: var(--hover, rgba(0,0,0,.05)); }
.rx-ex-f.active { background: var(--accent-soft, rgba(59,130,246,.12)); }
.rx-ex-n { font-family: var(--mono, monospace); }
.rx-ex-f small { color: var(--muted); }
.rx-ex-a { margin-left: auto; display: inline-flex; gap: 2px; }
.rx-ex-a button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0 4px; }
.rx-ex-note { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.rx-file-editor { display: flex; flex-direction: column; flex: 1; min-height: 200px; }
.rx-file-editor[hidden] { display: none; }
.rx-fe-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.rx-fe-bar [data-fe-close] { margin-left: auto; }
.rx-fe-host { flex: 1; min-height: 0; position: relative; }
.rx-fe-plain { width: 100%; height: 100%; border: 0; resize: none; padding: 10px; font: 13px/1.5 var(--mono, monospace); background: var(--code-bg, #fbfbfd); color: inherit; box-sizing: border-box; }
/* v12.1 block ↔ code highlight */
.rx-cm-layer { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.rx-cm-layer i { position: absolute; left: 0; right: 0; background: rgba(243,122,51,.16); border-left: 3px solid #F37A33; }
#codeOutput { cursor: pointer; }
/* v12.1 text mode */
.rx-tm { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rx-tm-banner { padding: 6px 10px; background: #fff4d6; color: #5a4300; font-size: 12px; border-bottom: 1px solid #e8d38a; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rx-tm-acts { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.rx-tm-ed { flex: 1; min-height: 300px; position: relative; }
.rx-tm-ed .rx-fe-plain { width: 100%; height: 100%; min-height: 300px; font: 13px/1.45 monospace; }
#btnTextMode.active { background: #ffe9a8; }
.rx-tm-diff { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 9000; display: flex; align-items: center; justify-content: center; }
.rx-tm-diff[hidden] { display: none; }
.rx-tm-diff-box { background: var(--panel, #fff); width: min(900px, 92vw); max-height: 84vh; display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; }
.rx-tm-bar { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid #ddd; }
.rx-tm-bar [data-close] { margin-left: auto; }
.rx-tm-diff-box pre { margin: 0; overflow: auto; font: 12px/1.4 monospace; padding: 6px 0; }
.rx-tm-diff-box .da { background: #e3f8e3; } .rx-tm-diff-box .dd { background: #fde4e4; } .rx-tm-diff-box div { padding: 0 10px; white-space: pre; }
/* v12.1 serial plotter */
.rx-plot { border-bottom: 1px solid #e4e4e8; background: #fff; padding: 4px 6px; }
.rx-plot[hidden] { display: none; }
.rx-plot canvas { width: 100%; height: 180px; display: block; }
.rx-plot-leg { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: #444; }
.rx-plot-leg i { display: inline-block; width: 10px; height: 3px; margin-right: 4px; vertical-align: middle; }
#btnSerialPlot.active { background: #ffe9a8; }
/* v12.1 block search */
.rx-bsearch { width: calc(100% - 8px); margin: 4px 4px 2px; padding: 4px 8px; border: 1px solid #d9d9e0; border-radius: 6px; font-size: 12px; box-sizing: border-box; }
.rx-tb-head { flex-wrap: wrap; }
/* v12.1 lessons / teacher / share / power */
.rx-lesson { position: fixed; left: 16px; bottom: 16px; width: 340px; z-index: 8000; background: #fff; border: 1px solid #e3d3c6; border-left: 4px solid #F37A33; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.15); font-size: 13px; }
.rx-lesson[hidden] { display: none; }
.rx-ls-h { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eee; } .rx-ls-h b { flex: 1; }
.rx-lesson ol { margin: 6px 0; padding: 0 12px 0 30px; } .rx-lesson li { margin: 4px 0; color: #777; } .rx-lesson li.cur { color: #222; font-weight: 600; } .rx-lesson li.done { color: #1c7c3a; }
.rx-ls-f { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-top: 1px solid #eee; color: #666; }
.rx-ls-item { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #eee; } .rx-ls-item b { flex: 1; } .rx-ls-ok { color: #1c7c3a; }
.rx-x-box { width: min(620px, 94vw); }
.rx-teach-cats { columns: 2; margin: 8px 0; } .rx-teach-cats label { display: block; }
.rx-teacher-badge { position: fixed; right: 12px; bottom: 12px; z-index: 8000; background: #3b3b98; color: #fff; border: 0; border-radius: 14px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.rx-teacher-badge[hidden] { display: none; }
.rx-tm[hidden] { display: none; }
