/* Shared embedded Command Window UI. The transcript, result and next prompt live in one surface. */
.lab-code-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  min-width:0
}
.lab-mode-badge,.lab-command-layout-toggle{
  appearance:none;
  min-height:25px;
  border:1px solid rgba(255,255,255,.17);
  border-radius:999px;
  padding:3px 8px;
  background:rgba(255,255,255,.08);
  color:inherit;
  font:700 .68rem/1 ui-sans-serif,system-ui,sans-serif;
  letter-spacing:.055em;
  white-space:nowrap;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,transform .16s ease
}
.lab-mode-badge{min-width:72px}
.lab-command-layout-toggle{min-width:82px;color:#9fe6e1}
.lab-mode-badge:hover,.lab-command-layout-toggle:hover{
  background:rgba(101,221,214,.16);
  border-color:rgba(101,221,214,.5)
}
.lab-mode-badge:active,.lab-command-layout-toggle:active{transform:translateY(1px)}
.lab-mode-badge:focus-visible,.lab-command-layout-toggle:focus-visible{
  outline:2px solid #65ddd6;
  outline-offset:2px
}
.lab-editor-wrap{
  position:relative;
  display:flex;
  flex-direction:column;
  flex:1;
  min-height:0
}
.lab-editor{flex:1 1 auto;min-height:0}
.matlab-lab.is-command-mode:not(.is-command-window) .lab-editor{padding-left:47px}

.lab-command-terminal{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:var(--code,#0d1d21);
  color:#e7f6f5;
  font:650 .93rem/1.65 ui-monospace,Consolas,monospace
}
.lab-command-terminal[hidden]{display:none!important}
.lab-command-transcript{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:16px 18px 4px
}
.lab-command-record{margin:0 0 15px}
.lab-command-record-input{
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  align-items:start
}
.lab-command-record-prompt,.lab-command-prompt{
  color:#45c6f0;
  font-weight:850
}
.lab-command-record pre{
  min-width:0;
  margin:0;
  color:inherit;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font:inherit
}
.lab-command-record-output{
  padding-left:32px;
  margin-top:5px!important;
  color:#dff5f3!important
}
.lab-command-record.is-error .lab-command-record-output{color:#ff9a8e!important}
.lab-command-entry{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  align-items:start;
  padding:5px 18px 15px
}
.lab-command-prompt{padding-top:2px}
.lab-command-input{
  display:block;
  width:100%;
  min-height:28px;
  max-height:132px;
  resize:none;
  overflow:auto;
  border:0;
  outline:0;
  padding:0;
  background:transparent;
  color:#e7f6f5;
  caret-color:#65ddd6;
  font:inherit;
  line-height:1.65;
  tab-size:4
}
.lab-command-input::placeholder{color:#7f9da1;font-weight:500}
.lab-command-input:disabled{opacity:.68}

.matlab-lab.is-command-window .lab-code-pane{flex-basis:100%!important}
.matlab-lab.is-command-window .lab-result-pane,
.matlab-lab.is-command-window .lab-splitter{display:none!important}
.matlab-lab.is-command-window .lab-editor,
.matlab-lab.is-command-window .lab-prompt{display:none!important}
.matlab-lab.is-command-window .lab-body{
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr)!important
}

:root:not([data-theme="dark"]) .lab-mode-badge,
:root:not([data-theme="dark"]) .lab-command-layout-toggle,
html:not([data-theme="dark"]) .lab-mode-badge,
html:not([data-theme="dark"]) .lab-command-layout-toggle{
  background:#edf4f5!important;
  border-color:#d6e4e6!important;
  color:#49646a!important
}
:root:not([data-theme="dark"]) .lab-mode-badge:hover,
:root:not([data-theme="dark"]) .lab-command-layout-toggle:hover,
html:not([data-theme="dark"]) .lab-mode-badge:hover,
html:not([data-theme="dark"]) .lab-command-layout-toggle:hover{
  background:#e0f3f2!important;
  border-color:#8bc9c6!important;
  color:#126f76!important
}
:root:not([data-theme="dark"]) .lab-command-terminal,
html:not([data-theme="dark"]) .lab-command-terminal{
  background:#f7fbfb;
  color:#18333a
}
:root:not([data-theme="dark"]) .lab-command-record-output,
html:not([data-theme="dark"]) .lab-command-record-output{color:#18333a!important}
:root:not([data-theme="dark"]) .lab-command-input,
html:not([data-theme="dark"]) .lab-command-input{color:#18333a}
:root:not([data-theme="dark"]) .lab-command-input::placeholder,
html:not([data-theme="dark"]) .lab-command-input::placeholder{color:#78979b}

@media(max-width:520px){
  .lab-code-controls{gap:5px}
  .lab-mode-badge,.lab-command-layout-toggle{
    min-width:0;
    padding:3px 7px;
    font-size:.62rem;
    letter-spacing:.025em
  }
  .lab-command-transcript{padding:13px 12px 3px}
  .lab-command-entry{padding:4px 12px 13px}
  .lab-command-record-input,.lab-command-entry{grid-template-columns:28px minmax(0,1fr)}
  .lab-command-record-output{padding-left:28px}
}

/* Embedded lab scrolling: keep every fixed-height pane scrollable without a permanent chrome bar. */
.matlab-lab .lab-body,
.matlab-lab .lab-pane,
.matlab-lab .lab-code-pane,
.matlab-lab .lab-result-pane,
.matlab-lab .lab-editor-wrap,
.matlab-lab .lab-command-terminal{
  min-height:0!important
}
.matlab-lab .lab-pane,
.matlab-lab .lab-editor-wrap{
  overflow:hidden
}
.matlab-lab .lab-editor,
.matlab-lab .lab-output,
.matlab-lab .lab-command-transcript,
.matlab-lab .lab-command-input,
.matlab-lab .lab-workspace{
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:transparent transparent
}
.matlab-lab .lab-editor,
.matlab-lab .lab-output,
.matlab-lab .lab-command-transcript{
  min-height:0!important;
  overflow:auto!important
}
.matlab-lab .lab-editor{
  height:100%!important
}
.matlab-lab .lab-workspace{
  flex:0 0 auto;
  max-height:96px;
  overflow:auto
}
.matlab-lab :is(.lab-editor,.lab-output,.lab-command-transcript,.lab-command-input,.lab-workspace)::-webkit-scrollbar{
  width:6px;
  height:6px
}
.matlab-lab :is(.lab-editor,.lab-output,.lab-command-transcript,.lab-command-input,.lab-workspace)::-webkit-scrollbar-track{
  background:transparent
}
.matlab-lab :is(.lab-editor,.lab-output,.lab-command-transcript,.lab-command-input,.lab-workspace)::-webkit-scrollbar-thumb{
  border-radius:999px;
  background:transparent;
  transition:background .16s ease
}
.matlab-lab :is(.lab-editor,.lab-output,.lab-command-transcript,.lab-command-input,.lab-workspace).is-scroll-active{
  scrollbar-color:color-mix(in srgb,var(--course-accent,#0c8f96) 58%,transparent) transparent
}
.matlab-lab :is(.lab-editor,.lab-output,.lab-command-transcript,.lab-command-input,.lab-workspace).is-scroll-active::-webkit-scrollbar-thumb{
  background:color-mix(in srgb,var(--course-accent,#0c8f96) 58%,transparent)
}
:root[data-theme="dark"] .matlab-lab :is(.lab-editor,.lab-output,.lab-command-transcript,.lab-command-input,.lab-workspace).is-scroll-active::-webkit-scrollbar-thumb{
  background:rgba(101,221,214,.5)
}


/* v1.8.14: slightly larger default code text in embedded lesson practice panes. */
.matlab-lab .lab-editor,
.matlab-lab .lab-code-highlight,
.matlab-lab .lab-command-terminal{
  font-size:.98rem!important;
  line-height:1.68!important
}
@media(max-width:760px){
  .matlab-lab .lab-editor,
  .matlab-lab .lab-code-highlight,
  .matlab-lab .lab-command-terminal{font-size:1rem!important;line-height:1.62!important}
}
