/* =============================================================================
   BLACK SIGNAL — css/screens/labs.css (layout only)
   The working screens of the lab courses: Linux terminal, Python / C editors,
   SQL and Net+ terminals. Under the navigation frame: one compact band, then
   a three-zone row — left rail cells | the workspace | the right rail.
   ============================================================================= */
@layer screens {

/* Guided terminal: instruction strip above ONE scrolling terminal surface.
   The prompt is the final child of #linux-output, immediately after the last
   output line. Scrollback and prompt move together, as on a real terminal. */
.linux-lab-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  min-width: 0;
}
body.bs-has-chrome .linux-lab-screen {
  height: calc(100vh - var(--bs-topbar-h) - env(safe-area-inset-top, 0px));
  height: calc(100dvh - var(--bs-topbar-h) - env(safe-area-inset-top, 0px));
}
.linux-lab-screen > .bs-band { flex: 0 0 auto; }
.linux-lab-screen .linux-main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 56px;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
}
.linux-lab-screen .linux-terminal-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border-right: 0;
}
.linux-lab-screen .linux-step-banner {
  min-height: 0;
  min-width: 0;
  max-height: min(28dvh, 210px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.linux-lab-screen .linux-terminal-output {
  box-sizing: border-box;
  /* Flex column so a short session can bottom-anchor via .bs-term-spacer,
     filling the pane instead of leaving a void below the prompt. Whitespace-
     only text between lines is ignored in a flex container, so no blank rows. */
  display: flex;
  flex-direction: column;
  flex: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  scroll-padding-bottom: 8px;
  padding: 14px 16px 12px;
  position: relative;
  white-space: normal;
}
/* A real shell fills from the TOP: the first prompt sits just under the opening
   lines, output grows downward, and empty space falls below. No bottom-anchor. */
.linux-lab-screen .linux-terminal-output > .bs-term-spacer { display: none; }
/* Real terminal output can include very long commands, URLs and forensic file
   paths. Wrap the text inside its scrollback, never behind a fixed prompt. */
.linux-lab-screen .linux-terminal-output .tline {
  min-width: 0;
  max-width: 100%;
  align-items: flex-start;
}
.linux-lab-screen .linux-terminal-output .ttext {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
/* A real prompt is the NEXT line after output, not a fixed footer.
   This neutralizes old sticky positioning without creating an overlay. */
.linux-lab-screen .linux-terminal-output > .linux-input-row {
  display: flex;
  position: static;
  min-width: 0;
  min-height: 0;
  flex-shrink: 0;
  margin: 0;
  padding: 2px 0 6px;
  background: transparent;
  border: 0;
  font-size: inherit;
  line-height: inherit;
  z-index: auto;
}
/* The prompt is simply the next line of the terminal: the prompt label, then
   the caret, on the same baseline as output, flowing right after the last line.
   No frame, no footer bar, no "RUN" chip — exactly like a real shell. */
@media (min-width: 600px) {
  .linux-lab-screen .linux-terminal-output > .linux-input-row {
    align-items: baseline;
    gap: 8px;
  }
  .linux-lab-screen .linux-terminal-output > .linux-input-row--kali { align-items: stretch; }
}
/* The phone lab menu only exists in the compact layout (below); if it is left
   in the DOM after a rotation to a roomier layout, keep it out of sight. */
.linux-lab-screen .bs-mobile-cmdbar { display: none; }
/* COMPACT LAYOUT = phones, plus any screen ≤1023px wide that is short (a phone
   turned sideways): one column, the ACTIONS menu instead of side rails.
   16px keeps iOS from zooming the page when the field is focused. */
@media (max-width: 599px), (max-width: 1023px) and (max-height: 500px) {
  /* task strip · terminal surface. The ACTIONS key is positioned over the
     strip's progress row (see .bs-mobile-cmdbar), so it costs no row. */
  .linux-lab-screen .linux-terminal-panel { grid-template-rows: auto minmax(0, 1fr); position: relative; }
  .linux-lab-screen .linux-terminal-output > .linux-input-row { font-size: 16px; padding: 2px 0 6px; }
  .linux-lab-screen .linux-prompt-label { font-size: 15px; }
  .linux-lab-screen .linux-command-input { font-size: 16px; }

  /* Phone utility chips remain outside the scrollback. The input itself
     stays inside the scrolling terminal, directly after the last output. */
  .linux-lab-screen .linux-terminal-output > .linux-input-row {
    border: 0;
    background: transparent;
    align-items: center;
    gap: 10px;
  }
  /* ONE secondary hamburger, pinned to the top-right of the task strip on the
     same line as the step progress (near the top, never in the orange band).
     Every lab and screen action lives in the menu it drops down, so the phone
     carries no button rows at all. */
  .linux-lab-screen .bs-mobile-cmdbar {
    position: absolute;
    top: 10px;
    right: 16px;
    z-index: 6;
    display: block;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
  }
  /* The hamburger toggle itself: compact icon + short label. */
  .linux-lab-screen .bs-mobile-cmdbar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
    font-family: var(--sig-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--orange);
    background: color-mix(in srgb, var(--orange) 7%, transparent);
    border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent);
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
  }
  .linux-lab-screen .bs-mobile-cmdbar-ico {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 15px;
  }
  .linux-lab-screen .bs-mobile-cmdbar-ico i {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    transition: transform var(--dur-fast, .15s) var(--ease, ease),
                opacity var(--dur-fast, .15s) var(--ease, ease);
  }
  /* Hamburger morphs toward an X while the menu is open. */
  .linux-lab-screen .bs-mobile-cmdbar.is-open .bs-mobile-cmdbar-toggle {
    background: var(--orange);
    color: var(--accent-on-accent);
    border-color: var(--orange);
  }
  .linux-lab-screen .bs-mobile-cmdbar.is-open .bs-mobile-cmdbar-ico i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .linux-lab-screen .bs-mobile-cmdbar.is-open .bs-mobile-cmdbar-ico i:nth-child(2) { opacity: 0; }
  .linux-lab-screen .bs-mobile-cmdbar.is-open .bs-mobile-cmdbar-ico i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

  /* The pop-up menu drops DOWN from the strip, over the terminal, until open. */
  .linux-lab-screen .bs-mobile-cmdbar-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    display: none;
    flex-direction: column;
    min-width: 200px;
    /* Never past the bottom of the screen (the menu opens ~150px down). */
    max-height: min(70dvh, calc(100dvh - 160px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    gap: 2px;
    background: var(--sig-black);
    border: 1px solid color-mix(in srgb, var(--orange) 34%, transparent);
    box-shadow: 0 14px 28px -12px rgba(0, 0, 0, 0.92);
    z-index: 30;
  }
  .linux-lab-screen .bs-mobile-cmdbar.is-open .bs-mobile-cmdbar-menu { display: flex; }
  /* Thin rule between the lab-action group and the screen-navigation group. */
  .linux-lab-screen .bs-mobile-cmdbar-sep {
    height: 1px;
    margin: 4px 6px;
    background: color-mix(in srgb, var(--orange) 22%, transparent);
  }
  .linux-lab-screen .bs-mobile-cmdbar-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 12px;
    font-family: var(--sig-mono);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--orange);
    background: transparent;
    border: 0;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background var(--dur-fast, .15s) var(--ease, ease),
                color var(--dur-fast, .15s) var(--ease, ease);
  }
  .linux-lab-screen .bs-mobile-cmdbar-btn:active,
  .linux-lab-screen .bs-mobile-cmdbar-btn.is-active {
    background: var(--orange);
    color: var(--accent-on-accent);
  }

  /* While the terminal is on screen, the chrome bottom bar's actions are folded
     into the hamburger above: hide the bar and zero its reserved height so the
     terminal (and every calc that subtracts the bar) gets the full screen. */
  body:has(.linux-terminal-panel) { --bs-bottombar-h: 0px; padding-bottom: 0; }
  body:has(.linux-terminal-panel) #bs-chrome-bottom { display: none !important; }
}

/* The instruction line: a ruled strip, not a band. Now a column so the
   segmented step progress sits above the current-task line. */
.bs-step-strip,
.linux-step-banner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 13px;
  min-height: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--sig-rule);
  background: transparent;
  flex-shrink: 0;
}
.linux-step-banner .bs-step-line {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

/* Segmented progress stepper (one node per step: done / current / upcoming). */
.linux-step-banner .bs-stepper { display: flex; align-items: center; gap: 12px; }
.linux-step-banner .bs-stepper-track { display: flex; flex: 1; gap: 4px; min-width: 0; }
.linux-step-banner .bs-stepseg {
  flex: 1 1 0;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--orange) 16%, transparent);
  transition: background .3s ease, box-shadow .3s ease;
}
.linux-step-banner .bs-stepseg--done { background: var(--orange); }
.linux-step-banner .bs-stepseg--current {
  background: var(--orange);
  box-shadow: 0 0 0 1px var(--orange), 0 0 10px color-mix(in srgb, var(--orange) 70%, transparent);
  animation: bsStepPulse 1.8s ease-in-out infinite;
}
.linux-step-banner .bs-stepper--compact .bs-stepseg { height: 5px; border-radius: 2px; }
/* Continuous bar variant (many steps). */
.linux-step-banner .bs-stepper-track--bar {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--orange) 16%, transparent);
  overflow: hidden;
}
.linux-step-banner .bs-stepper-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--orange);
  box-shadow: 0 0 10px color-mix(in srgb, var(--orange) 60%, transparent);
  transition: width .4s ease;
}
.linux-step-banner .bs-stepper-count {
  font-family: var(--sig-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--orange);
  white-space: nowrap;
  flex-shrink: 0;
}
@keyframes bsStepPulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .linux-step-banner .bs-stepseg--current { animation: none; } }
.linux-step-banner .rsb-label {
  flex: 0 0 auto;
  font-family: var(--sig-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  padding: 4px 8px;
  border: 1px solid var(--sig-rule-strong);
  white-space: nowrap;
}
.linux-step-banner .rsb-text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--sig-ink);
  max-width: var(--sig-measure);
}
.linux-step-banner .rsb-text.is-success { color: var(--orange); }
.linux-step-banner.is-complete { background: transparent; border-bottom-color: var(--orange); }
.linux-step-banner .es-banner-btn { margin-left: auto; }

/* The editor courses' tool strip and output tabs: ruled keys. */
.bsc-editor-controls, .bspy-editor-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--sig-rule);
  border-bottom: 1px solid var(--sig-rule);
  background: transparent;
}
.bsc-editor-controls .bsc-ctrl-btn--run, .bspy-editor-controls .bspy-ctrl-btn--run { margin-left: auto; }
/* Output tabs: css/components/tabs.css */

/* The lab's settings key sits in the band */
.linux-lab-band .bs-band-tools { margin-left: 8px; }

/* ── Exam-style practice test: tasks cell | terminal, under the band ───── */
.es-screen .es-main {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
  gap: 0;
  padding: 0;
}
.es-screen .es-tasks-panel { border: 0; border-right: 1px solid var(--sig-rule); padding: 18px 22px; overflow-y: auto; }
.es-screen .es-h { margin: 0 0 12px; font-family: var(--font-display); font-weight: 600; font-size: 11.5px; letter-spacing: var(--sig-eyebrow-track); color: var(--orange); }
.es-screen .es-tasks { font-family: var(--font-body); font-size: 15px; line-height: 1.5; color: var(--sig-ink); max-width: var(--sig-measure); }
.es-screen .es-term { border: 0; }
/* Same as the Linux terminal: no rule between the output and the prompt, so the
   command line continues the terminal surface instead of being fenced off. */
.es-screen .es-input-row { border: 0; }
.es-screen .es-timer.is-warning { color: var(--accent-on-accent); text-decoration: underline; text-underline-offset: 4px; }
.es-screen .es-result { flex: 1 1 auto; height: auto; max-width: calc(var(--sig-measure) + 200px); width: 100%; padding: 28px var(--sig-gutter) 48px; }
.es-screen .es-score { font-family: var(--font-display); font-weight: 900; font-size: clamp(34px, 3.6vw, 52px); line-height: 0.9; letter-spacing: -0.012em; margin: 0 0 10px; }
.es-screen .es-sub { font-family: var(--font-body); font-size: 15px; color: var(--sig-ink-dim); margin: 0 0 18px; }
.es-screen .es-result-row { padding: 12px 0; border-bottom: 1px solid var(--sig-rule); font-family: var(--font-body); font-size: 15px; }
.es-screen .es-actions { gap: 0; margin: 24px 0 0; }
.es-screen .es-actions .bs-key + .bs-key { margin-left: -1px; }
@media (max-width: 760px) {
  .es-screen .es-main { grid-template-columns: minmax(0, 1fr); }
  .es-screen .es-tasks-panel { border-right: 0; border-bottom: 1px solid var(--sig-rule); max-height: 36vh; }
  .es-screen .es-term { min-height: 50vh; }
}

/* ── Live system lab (bs_v86.js): a full-screen modal workspace ─────────────
   A fixed overlay above everything (incl. the app top bar): one compact band
   header, then a two-pane body — the console fills the width, a fixed rail
   carries the controls and the engine diagnostics. */
body.bs-vm-open { overflow: hidden; }
.bs-vm-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  background: var(--sig-black);
  overflow: hidden;
}

/* Header band — reuses .bs-band--compact; just pin it and center the meta. */
.bs-vm-topbar {
  flex: 0 0 auto;
  box-shadow: none;
  border-bottom: 1px solid var(--sig-rule);
}
.bs-vm-topbar .bs-band-meta { align-items: center; gap: 18px; }
.bs-vm-beta {
  margin-left: 8px; padding: 2px 6px 1px;
  font-family: var(--sig-mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.18em; vertical-align: middle;
  color: var(--accent-on-accent);
  border: 1px solid var(--accent-on-accent);
  opacity: 0.85; clip-path: none;
}
.bs-vm-status {
  margin: 0;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sig-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent-on-accent);
}
.bs-vm-dot {
  width: 7px; height: 7px; flex: 0 0 auto; margin: 0; border-radius: 50%; /* round */
  background: var(--accent-on-accent); opacity: 0.35;
  transition: opacity var(--dur-fast) var(--ease); clip-path: none;
}
.bs-vm-status.is-ready .bs-vm-dot { opacity: 1; }
/* When the readout is the elapsed timer, use tabular figures so the ticking
   MM:SS does not jitter the layout. */
.bs-vm-status--timer { font-variant-numeric: tabular-nums; letter-spacing: 0.1em; }

/* ── Body: console (flex) + rail (fixed) ───────────────────────────────── */
.bs-vm-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

/* The console: a scrolling monospace terminal that fills the pane. */
.bs-vm-screen {
  flex: 1 1 auto;
  min-width: 0; min-height: 0;
  margin: 0;
  padding: 18px 20px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sig-black);
  border-right: 1px solid var(--sig-rule);
  color: var(--sig-ink);
  font-family: var(--sig-mono);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bs-vm-screen:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }

/* Blinking block cursor: added (class-based) the moment the system is live, so
   the operator can see the console is ready for input. Not tied to :focus — it
   also reads as a "click here and type" invitation before they focus in. */
.bs-vm-screen.bs-vm-ready::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--orange);
  animation: bs-vm-caret-blink 1.06s steps(1) infinite;
}
@keyframes bs-vm-caret-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bs-vm-screen.bs-vm-ready::after { animation: none; opacity: 0.85; }
}

/* The rail: controls above, engine diagnostics below. */
.bs-vm-rail {
  flex: 0 0 320px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0; padding: 0;
  overflow-y: auto;
  background: var(--sig-black);
  border: 0;
}
.bs-vm-card {
  padding: 18px 20px 20px;
  border: 0; border-bottom: 1px solid var(--sig-rule);
  background: transparent; box-shadow: none; clip-path: none;
}
.bs-vm-rail .bs-vm-card:last-child { border-bottom: 0; }
.bs-vm-card h3 {
  margin: 0 0 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 11px;
  letter-spacing: var(--sig-eyebrow-track); text-transform: uppercase;
  color: var(--orange);
}
.bs-vm-card p {
  margin: 0 0 14px;
  font-family: var(--font-body); font-size: 13.5px; line-height: 1.55;
  color: var(--sig-ink-dim);
}
.bs-vm-card p:last-child { margin-bottom: 0; }
.bs-vm-note code {
  padding: 1px 5px;
  font-family: var(--sig-mono); font-size: 0.86em;
  color: var(--sig-ink);
  background: var(--acc-surf-1);
}

/* Control keys stack full-width; the disabled state reads as "not yet", not
   greyed-out — it keeps full opacity but loses interactivity. */
.bs-vm-btn { width: 100%; margin: 0 0 -1px; }
.bs-vm-card .bs-vm-btn:last-child { margin-bottom: 0; }
.bs-vm-btn:disabled { opacity: 0.5; cursor: default; pointer-events: none; }

/* Engine diagnostics: a small monospace checklist. */
.bs-vm-diag {
  font-family: var(--sig-mono); font-size: 11.5px; line-height: 1.9;
  letter-spacing: 0.02em;
}
.bs-vm-diag div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-vm-diag .ok { color: var(--orange); }
.bs-vm-diag .off { color: var(--sig-ink-dim); opacity: 0.7; }

/* ── Live-lab mode: a wider rail carries the mission + outcomes checklist ── */
.bs-vm-overlay--lab .bs-vm-rail { flex-basis: 380px; }
.bs-vm-tasks {
  list-style: none;
  counter-reset: bsvmtask;
  margin: 0; padding: 0;
}
.bs-vm-task {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sig-rule);
  counter-increment: bsvmtask;
}
.bs-vm-task:last-child { border-bottom: 0; padding-bottom: 0; }
.bs-vm-task-mark {
  flex: 0 0 auto;
  width: 16px;
  font-family: var(--sig-mono);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--sig-ink-dim);
}
.bs-vm-task-text {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--sig-ink-dim);
}
.bs-vm-task-text::before {
  content: counter(bsvmtask) ". ";
  font-family: var(--sig-mono);
  color: var(--sig-ink-dim);
}
.bs-vm-task-detail {
  display: block;
  margin-top: 4px;
  font-family: var(--sig-mono);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--orange);
}
/* Graded states: a satisfied outcome brightens to full ink with a filled mark;
   an unmet one is flagged in the accent and shows why. */
.bs-vm-task--pass .bs-vm-task-mark { color: var(--orange); }
.bs-vm-task--pass .bs-vm-task-text { color: var(--sig-ink); }
.bs-vm-task--fail .bs-vm-task-mark { color: var(--orange); }
.bs-vm-task--fail .bs-vm-task-text { color: var(--sig-ink); }

/* Result / status line under Submit (aria-live). */
.bs-vm-result {
  font-family: var(--sig-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--sig-ink-dim);
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--acc-surf-1);
  border-left: 2px solid var(--sig-rule);
}
.bs-vm-result--pass { color: var(--orange); border-left-color: var(--orange); }
.bs-vm-result--fail { color: var(--sig-ink); border-left-color: var(--orange); }

/* ── Phone / narrow: console on top, rail below ────────────────────────── */
@media (max-width: 760px) {
  .bs-vm-body { flex-direction: column; }
  .bs-vm-screen { flex: 1 1 auto; border-right: 0; border-bottom: 1px solid var(--sig-rule); }
  .bs-vm-rail { flex: 0 0 auto; max-height: 42vh; border-top: 0; }
  .bs-vm-overlay--lab .bs-vm-rail { flex-basis: auto; max-height: 50vh; }
}

/* ── Live lab IN PAGE: the guided lab chrome (band + terminal), with the real
   v86 console as the terminal and a single brief column for outcomes + the
   submit controls. No objective/docs/intel side buttons, step counter,
   progress % or countdown — none apply to an unguided live lab. ─────────── */
.linux-live-screen .linux-main { grid-template-columns: minmax(0, 1fr) 360px; }
.linux-live-screen .linux-terminal-panel { border-right: 1px solid var(--sig-rule); }
.linux-live-screen .bs-vm-screen {
  flex: 1 1 auto;
  min-height: 0;
  border-right: 0;
  border-bottom: 0;
}
.linux-live-brief {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--sig-black);
}
.llb-outcomes {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 18px;
}
.llb-head {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: var(--sig-eyebrow-track);
  text-transform: uppercase;
  color: var(--orange);
}
.llb-controls {
  flex: 0 0 auto;
  padding: 16px 20px;
  border-top: 1px solid var(--sig-rule);
}
.llb-controls .bs-key { margin: 0 0 -1px; }
.llb-controls .bs-key:last-child { margin-bottom: 0; }

/* Phone: the brief stacks under the console. */
@media (max-width: 760px) {
  .linux-live-screen .linux-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .linux-live-screen .linux-terminal-panel { border-right: 0; border-bottom: 1px solid var(--sig-rule); }
  .linux-live-brief { max-height: 46vh; }
}

/* ── Lab complete: the band names the lab, the body is the ceremony ────── */
.linux-completion-screen {
  min-height: 100vh;
  min-height: 100dvh;
  max-height: none;
  overflow: visible;
  background: transparent;
}
body.bs-has-chrome .linux-completion-screen { min-height: calc(100vh - var(--bs-topbar-h)); min-height: calc(100dvh - var(--bs-topbar-h)); }
.linux-completion-screen > .rcs-band { position: relative; z-index: 2; flex: 0 0 auto; }
.linux-completion-screen .rcs-body { overflow: visible; }
.linux-completion-screen .rcs-main { overflow: visible; padding: 48px 32px 40px; gap: 12px; }
.linux-completion-screen .rcs-actions { gap: 0; margin-top: 12px; }
.linux-completion-screen .rcs-actions .bs-key { min-width: 180px; gap: 0; }
.linux-completion-screen .rcs-actions .bs-key + .bs-key { margin-left: -1px; }
.linux-completion-screen .rcs-statusbar { display: none; }

/* ── Tablet: the left rail folds away; the band carries progress ───────── */
@media (min-width: 600px) and (max-width: 1023px) {
  .linux-lab-screen .linux-main { grid-template-columns: minmax(0, 1fr) 56px; }
  .linux-lab-screen .linux-left-rail { display: none; }
}
/* ── Compact (phones, short landscape): one column; the ACTIONS menu
      carries the tools ─────────────────────────────────────────────────── */
@media (max-width: 599px), (max-width: 1023px) and (max-height: 500px) {
  .linux-lab-screen .linux-main { grid-template-columns: minmax(0, 1fr); }
  .linux-lab-screen .linux-left-rail, .linux-lab-screen .linux-right-utility { display: none; }
  .linux-step-banner { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .linux-step-banner .rsb-text { font-size: 16px; }
  /* The prompt sits on the same 16px gutter as the output above it. */
  .linux-lab-screen .linux-input-row { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 599px) {
  body.bs-has-chrome .linux-lab-screen { height: calc(100vh - var(--bs-topbar-h) - var(--bs-bottombar-h)); height: calc(100dvh - var(--bs-topbar-h) - var(--bs-bottombar-h)); min-height: 0; }
  body.bs-has-chrome .linux-completion-screen { min-height: calc(100vh - var(--bs-topbar-h) - var(--bs-bottombar-h)); min-height: calc(100dvh - var(--bs-topbar-h) - var(--bs-bottombar-h)); }
  .linux-completion-screen .rcs-main { padding: 28px 16px 32px; }
  .linux-completion-screen .rcs-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .linux-completion-screen .rcs-actions .bs-key + .bs-key { margin-left: 0; margin-top: -1px; }
}
  /* Signature tiles otherwise retain their pre-animation opacity:0 when the
     user's accessibility preference disables card entrance animations. */
  @media (prefers-reduced-motion: reduce) {
    .linux-category-grid .linux-category-card {
      opacity: 1;
      transform: none;
    }
  }
}

/* Linux specialization hierarchy — uses EXACT Black Signal primitives:
   sig-hero / sig-section / linux-category-grid / course-card-v2 / bs-key.
   Only density and responsive placement are local to this page. */
@layer screens {
  .bs-linux-tracks-screen .linux-cat-body,
  .bs-linux-track-modules .linux-cat-body {
    gap: 0;
    padding-bottom: 80px;
    align-items: stretch;
  }
  .bs-linux-tracks-screen .sig-hero,
  .bs-linux-track-modules .sig-hero { flex: none; }
  .bs-linux-track-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
    align-content: start;
    flex: none;
  }
  .bs-track-shell { position: relative; min-width: 0; }
  .bs-linux-track-grid .bs-track-shell > .linux-category-card {
    display: flex;
    width: 100%;
    min-height: 184px;
    height: 100%;
    padding-right: 22px;
  }
  .bs-linux-track-grid .bs-track-shell .linux-cat-card-label {
    padding-right: 0;
    overflow-wrap: break-word;
    word-break: normal;
  }
  /* The compact numbered module tiles must wrap entire words wherever there is
     room, instead of cutting words after an arbitrary letter. */
  .bs-track-module-grid .linux-category-card .linux-cat-card-label {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: manual;
    font-size: 18px;
    line-height: 1.05;
  }
  @media (max-width: 359px) {
    .bs-track-module-grid { grid-template-columns: minmax(0, 1fr); }
  }
  .bs-track-brief { display: flex; flex-direction: column; }
  .bs-track-brief-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; }
  .bs-track-brief-actions .bs-key { min-height: 42px; padding: 10px 14px; }
  @media (max-width: 1023px) {
    .bs-linux-track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bs-track-module-grid .linux-category-card .linux-cat-card-label { font-size: 18px; }
  }
  @media (max-width: 599px) {
    .bs-linux-track-grid { grid-template-columns: 1fr; }
    .bs-linux-track-grid .bs-track-shell > .linux-category-card {
      min-height: 0;
      padding: 16px 16px 14px 16px;
    }
    .bs-linux-track-grid .bs-track-shell .linux-cat-card-label { padding-top: 14px; }
    .bs-track-module-grid .linux-category-card .linux-cat-card-label {
      font-size: 16px;
      letter-spacing: -.015em;
      line-height: 1.08;
    }
  }
}


/* BLACK SIGNAL // TERMINAL R4 - full-width wrapping input and stable submitted-command ink. */
@layer screens {
 .linux-lab-screen .linux-terminal-output > .linux-input-row {
   box-sizing:border-box; display:flex; width:100%; max-width:100%; min-width:0;
   align-items:flex-start; gap:0; overflow:visible;
 }
 .linux-lab-screen .linux-input-row--kali .kali-input-wrapper {
   display:flex; flex-direction:column; flex:1 1 100%; width:100%; max-width:100%; min-width:0;
 }
 .linux-lab-screen .kali-input-bottom-line {
   display:flex; flex-flow:row nowrap; align-items:flex-start; width:100%; min-width:0;
 }
 .linux-lab-screen .kali-input-bottom-line > .kali-bracket,
 .linux-lab-screen .kali-input-bottom-line > .kali-dollar {flex:0 0 auto;}
 .linux-lab-screen .linux-command-input {
   display:block; box-sizing:border-box; flex:1 1 0; width:100%; max-width:100%; min-width:0;
   min-height:1.5em; max-height:min(36dvh, 12em);
   margin:0; padding:0; border:0; outline:none; border-radius:0;
   resize:none; overflow-x:hidden; overflow-y:auto;
   white-space:pre-wrap; overflow-wrap:anywhere; word-break:normal;
   color:var(--white); background:transparent;
   font-family:var(--sig-mono); font-weight:500; line-height:1.5;
   caret-color:var(--white);
 }
 .linux-lab-screen .linux-terminal-output .tline-cmd .ttext,
 .linux-lab-screen .linux-terminal-output .tline-cmd .kali-cmd-text,
 .linux-lab-screen .linux-terminal-output .kali-feed-bottom .kali-cmd-text,
 .linux-lab-screen .linux-terminal-output .kali-feed-bottom .ttext {
   color:var(--white); font-family:var(--sig-mono); font-weight:500;
   white-space:pre-wrap; overflow-wrap:anywhere; word-break:normal;
 }
}


/* BLACK SIGNAL // TERMINAL PROMPT SPACING R6.6
   The active prompt and the submitted command feed must have the same gap.
   Applies to the existing input OR R4.1's soft-wrapping textarea.
   Leave terminal theme, command color and wrapping intact. */
@layer screens {
  .linux-lab-screen .linux-terminal-output > .linux-input-row:not(.linux-input-row--kali) > .linux-prompt-label {
    margin-inline-end: .65ch;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .linux-lab-screen .linux-terminal-output .kali-input-bottom-line > .kali-dollar {
    margin-inline-end: .65ch;
  }
}



/* BLACK SIGNAL // COMMAND ECHO FIDELITY R6.9
   Preserve both dots in ../Documents (and every other entered character).
   Avoid clipped, condensed or ligature-merged characters in terminal scrollback. */
@layer screens {
  .linux-lab-screen .linux-terminal-output .tline-cmd .ttext,
  .linux-lab-screen .linux-terminal-output .tline-cmd .kali-cmd-text {
    display: inline-block;
    max-width: 100%;
    min-width: 0;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere;
    word-break: normal;
    letter-spacing: 0 !important;
    font-kerning: none;
    font-variant-ligatures: none !important;
    font-feature-settings: "liga" 0, "calt" 0;
    text-transform: none;
    flex-shrink: 1;
  }
}

/* BLACK SIGNAL // R6.9.3 TERMINAL COMMAND GLYPH FIX
   Explicitly keep typed command glyphs readable, with no ligature substitution.
   Never reinterpret or modify commands submitted to the validator. */
@layer screens {
 .linux-lab-screen .linux-terminal-output .tline-cmd .ttext,
 .linux-lab-screen .linux-terminal-output .tline-cmd .kali-cmd-text {
   font-family: var(--sig-mono, ui-monospace, monospace) !important;
   font-variant-ligatures: none !important;
   font-feature-settings: "liga" 0, "calt" 0 !important;
   letter-spacing: 0 !important;
   word-spacing: normal !important;
   white-space: pre-wrap !important;
   text-transform: none !important;
   text-rendering: auto;
 }
}

/* BLACK SIGNAL // TERMINAL LIVE + HISTORY PERIOD CLARITY R6.9.5
   Unlike earlier CSS patches, this reaches the EDITABLE command input itself.
   Use a normal, legible system monospace with separated glyph advances.
   This affects appearance only. It never rewrites the user's command. */
@layer screens {
  .linux-lab-screen .linux-terminal-output .linux-input-row #linux-command-input,
  .linux-lab-screen .linux-terminal-output .tline-cmd .ttext,
  .linux-lab-screen .linux-terminal-output .tline-cmd .kali-cmd-text,
  .linux-lab-screen .rhcsa-terminal-output .rhcsa-input-row #rhcsa-command-input,
  .linux-lab-screen .rhcsa-terminal-output .tline-cmd .ttext {
    font-family: "DejaVu Sans Mono", "Liberation Mono", ui-monospace, monospace !important;
    font-kerning: none !important;
    font-variant-ligatures: none !important;
    font-feature-settings: "kern" 0, "liga" 0, "calt" 0 !important;
    letter-spacing: 0.07em !important;
    word-spacing: normal !important;
    text-transform: none !important;
    text-rendering: geometricPrecision;
    font-style: normal !important;
  }
  .linux-lab-screen .linux-terminal-output .tline-cmd .ttext,
  .linux-lab-screen .linux-terminal-output .tline-cmd .kali-cmd-text,
  .linux-lab-screen .rhcsa-terminal-output .tline-cmd .ttext {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere;
  }
}


/* =============================================================================
   BLACK SIGNAL // R7 MOBILE-FIRST TERMINAL LABS
   Phones and tablets get the same lab as the web, laid out for the device:
   one compact band, a task strip whose first row carries progress + the lab
   menu, and a terminal that owns every remaining pixel. When the on-screen
   keyboard opens (iOS ignores interactive-widget=resizes-content), the lab
   pins itself to the visible area so the prompt is never under the keyboard.
   ============================================================================= */
@layer screens {

  /* ── Tablet: the right rail also carries Objective + Hints ─────────────── */
  .linux-lab-screen .linux-rail-tablet { display: none; }
  @media (min-width: 600px) and (max-width: 1023px) {
    /* A legacy tablet rule framed the whole shell in an orange border the
       desktop never had (it showed as a stray line down the left edge). */
    .bs-linux-shell { border: 0; }
    .linux-lab-screen .linux-right-utility .linux-rail-tablet { display: flex; }
    .linux-lab-screen .linux-right-utility .linux-rail-tablet--last,
    .linux-lab-screen .linux-right-utility .linux-rail-tablet:not(:has(+ .linux-rail-tablet)) {
      border-bottom: 1px solid var(--sig-rule-strong, var(--sig-rule));
    }
  }

  @media (max-width: 599px) {
    /* ── Band: eyebrow, a two-line title, one row of readouts ───────────── */
    .linux-lab-screen > .linux-lab-band {
      grid-template-columns: minmax(0, 1fr);
      gap: 10px;
      min-height: 0;
      padding: 12px 16px 13px;
    }
    .linux-lab-band .bs-band-main { gap: 6px; }
    .linux-lab-band .bs-band-title {
      font-size: 22px;
      line-height: 0.98;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .linux-lab-band .bs-band-meta {
      flex-direction: row;
      align-items: center;
      justify-content: flex-start;
      flex-wrap: wrap;
      gap: 8px 16px;
    }
    /* The task strip's progress row already says "step 3 / 6" — don't repeat it. */
    .linux-lab-band .bs-meta:has(#bs-r-obj-progress) { display: none; }
    .linux-lab-band .bs-meta { flex-direction: row; align-items: baseline; gap: 6px; }
    .linux-lab-band .bs-meta-num { font-size: 18px; }
    .linux-lab-band .bs-meta-lbl { font-size: 10px; }
  }

  /* Compact layout (phones + short landscape): the band above keeps its own
     shape per width; everything below it is the same. */
  @media (max-width: 599px), (max-width: 1023px) and (max-height: 500px) {
    /* ── Task strip: progress + menu on one row, then the task ──────────── */
    /* nowrap: an older phone rule set wrap, which — with the strip's column
       direction and a capped height (keyboard up) — flowed the task text into
       a second column beside the progress row. */
    .linux-lab-screen .linux-step-banner { padding: 10px 16px 14px; gap: 10px; flex-wrap: nowrap; }
    .linux-lab-screen .linux-step-banner .bs-stepper {
      min-height: 36px;
      align-items: center;
      margin-right: 124px;   /* clears the ACTIONS key pinned at the right */
    }
    /* The "STEP 3/6" chip repeats the progress row; keep it only for status. */
    .linux-lab-screen .bs-step-line:not(:has(.is-success)) > .rsb-label { display: none; }
    .linux-lab-screen .linux-step-banner .rsb-text { font-size: 16px; line-height: 1.42; }

    /* ── Terminal: lines wrap under their prefix like a real shell ──────── */
    .linux-lab-screen .linux-terminal-output {
      padding: 12px 16px 20px;
      font-size: 15px;
      line-height: 1.55;
      scroll-padding-bottom: 16px;
    }
    .linux-lab-screen .linux-terminal-output .tline { display: block; }
    .linux-lab-screen .linux-terminal-output .tline > :is(.tprefix, .tprompt) { margin-right: 0.65ch; }
    .linux-lab-screen .linux-terminal-output .tline .ttext { display: inline; }
    .linux-lab-screen .linux-terminal-output .tline + .tline { margin-top: 2px; }

  }

  /* ── On-screen keyboard (iOS/Android): focus mode ──────────────────────
     09-mobile.js sets html.keyboard-open plus --vvh/--vvt (the visible
     viewport's height and offset) while the keyboard is up. The lab screen
     pins itself to exactly that area, the band steps aside, and the terminal
     keeps the prompt — the last line of its scrollback — in view.
     Not width-gated: big iPads in landscape (~1366px) use the on-screen
     keyboard too, and desktop browsers never set .keyboard-open. */
  @media all {
    html.keyboard-open body:has(.linux-terminal-panel) .linux-lab-screen {
      position: fixed;
      left: 0;
      right: 0;
      top: var(--vvt, 0px);
      height: var(--vvh);
      z-index: calc(var(--z-chrome, 100) + 2);
      background: var(--sig-black);
    }
    html.keyboard-open .linux-lab-screen > .bs-band { display: none; }
    html.keyboard-open .linux-lab-screen .linux-step-banner {
      max-height: calc(var(--vvh) * 0.38);
      padding-bottom: 10px;
      gap: 8px;
    }
    /* While typing, the task itself matters more than the "STEP n/m" chip
       (the progress row already shows the count). */
    html.keyboard-open .linux-lab-screen .bs-step-line:not(:has(.is-success)) > .rsb-label { display: none; }
  }
}

@layer screens {
  /* Short landscape: height is scarce but width isn't, so the menu runs as a
     single row under the ACTIONS key instead of a column off the screen. */
  @media (max-width: 1023px) and (max-height: 500px) {
    .linux-lab-screen .bs-mobile-cmdbar-menu { flex-direction: row; max-height: none; overflow: visible; min-width: 0; }
    .linux-lab-screen .bs-mobile-cmdbar-btn { min-height: 40px; padding: 0 14px; }
    .linux-lab-screen .bs-mobile-cmdbar-sep { width: 1px; height: auto; margin: 6px 4px; }
    /* Keyboard up in landscape leaves ~230px: let the task strip take half so
       the full task stays readable, the terminal keeps the rest. */
    html.keyboard-open .linux-lab-screen .linux-step-banner { max-height: calc(var(--vvh) * 0.5); }
    html.keyboard-open .linux-lab-screen .linux-step-banner .rsb-text { font-size: 15px; line-height: 1.35; }
  }
}

/* =============================================================================
   BLACK SIGNAL // DEVICE DIALECTS (Cisco IOS console, PowerShell 7)
   The device courses look like the real thing: a Cisco console is plain
   light-grey text with the prompt glued to the command (R1#show run); a
   PowerShell 7 window uses the Campbell scheme and PSReadLine colours.
   Device output keeps its columns: tables never re-wrap at word boundaries,
   blank lines keep their height, and lines sit tight like a real terminal.
   The background stays the app's themed terminal black (no device override).
   ============================================================================= */
@layer screens {
  .linux-lab-screen[data-dialect] .linux-terminal-output { gap: 0; }
  .linux-lab-screen[data-dialect] .linux-terminal-output .tline { margin-bottom: 0; min-height: 1.55em; flex-shrink: 0; }
  .linux-lab-screen[data-dialect] .linux-terminal-output .tline-out,
  .linux-lab-screen[data-dialect] .linux-terminal-output .tline-out .ttext {
    white-space: pre-wrap !important;
    word-break: break-all;
    overflow-wrap: anywhere;
    letter-spacing: 0 !important;
  }
  .linux-lab-screen[data-dialect] .linux-terminal-output .tline-cmd { margin-top: 0; }
  /* Device questions are long ("Proceed with reload? [confirm]", the PowerShell
     [Y] Yes [A] Yes to All... line). Let the prompt wrap and keep room for the
     answer, so the input never gets squeezed off a narrow screen. */
  .linux-lab-screen[data-dialect] .linux-terminal-output > .linux-input-row:not(.linux-input-row--kali) { flex-wrap: wrap; }
  .linux-lab-screen[data-dialect] .linux-terminal-output > .linux-input-row:not(.linux-input-row--kali) > .linux-prompt-label {
    white-space: pre-wrap !important; overflow-wrap: anywhere; flex-shrink: 1; max-width: 100%;
  }
  .linux-lab-screen[data-dialect] .linux-terminal-output > .linux-input-row .linux-command-input { min-width: 6ch; flex: 1 1 6ch; }

  /* ── Cisco IOS console ─────────────────────────────────────────────── */
  .linux-lab-screen[data-dialect="ios"] .linux-terminal-output .tline-out .ttext,
  .linux-lab-screen[data-dialect="ios"] .linux-terminal-output .tline-cmd .ttext,
  .linux-lab-screen[data-dialect="ios"] .linux-terminal-output .tline-cmd .tprompt,
  .linux-lab-screen[data-dialect="ios"] .linux-prompt-label,
  .linux-lab-screen[data-dialect="ios"] .linux-command-input { color: #d4d4d4; caret-color: #d4d4d4; }
  .linux-lab-screen[data-dialect="ios"] .linux-terminal-output .tline-cmd { gap: 0; }
  .linux-lab-screen[data-dialect="ios"] .linux-terminal-output .tline-cmd .tprompt { margin-right: 0 !important; font-weight: 500; }
  .linux-lab-screen[data-dialect="ios"] .linux-terminal-output > .linux-input-row:not(.linux-input-row--kali) > .linux-prompt-label { margin-inline-end: 0; }
  .linux-lab-screen[data-dialect="ios"] .linux-terminal-output .tline-cmd .ttext,
  .linux-lab-screen[data-dialect="ios"] .linux-command-input,
  .linux-lab-screen[data-dialect="ios"] .linux-terminal-output .linux-input-row #linux-command-input { letter-spacing: 0 !important; }

  /* ── PowerShell 7 (Windows Terminal, Campbell) ─────────────────────── */
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-out .ttext,
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-cmd .tprompt,
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-cmd .ttext,
  .linux-lab-screen[data-dialect="pwsh"] .linux-prompt-label,
  .linux-lab-screen[data-dialect="pwsh"] .linux-command-input { color: #cccccc; caret-color: #cccccc; }
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-cmd { gap: 0; }
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-cmd .tprompt { margin-right: 1ch !important; font-weight: 500; }
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output > .linux-input-row:not(.linux-input-row--kali) > .linux-prompt-label { margin-inline-end: 1ch; }
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-cmd .ttext,
  .linux-lab-screen[data-dialect="pwsh"] .linux-command-input,
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .linux-input-row #linux-command-input { letter-spacing: 0 !important; }
  .linux-lab-screen[data-dialect="pwsh"] .ps-cmd { color: #f9f1a5; }
  .linux-lab-screen[data-dialect="pwsh"] .ps-param,
  .linux-lab-screen[data-dialect="pwsh"] .ps-op { color: #767676; }
  .linux-lab-screen[data-dialect="pwsh"] .ps-str { color: #3a96dd; }
  .linux-lab-screen[data-dialect="pwsh"] .ps-var,
  .linux-lab-screen[data-dialect="pwsh"] .ps-kw { color: #16c60c; }
  .linux-lab-screen[data-dialect="pwsh"] .ps-num { color: #f2f2f2; }
  .linux-lab-screen[data-dialect="pwsh"] .ps-com { color: #13a10e; }
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-deverr .ttext { color: #e74856; }
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-devok .ttext { color: #16c60c; }
  .linux-lab-screen[data-dialect="pwsh"] .linux-terminal-output .tline-devwarn .ttext { color: #f9f1a5; }
}

/* ── vim / nano inside the lab terminal (labs/17-editor.js) ─────────────────
   The editor covers the terminal pane, the step banner above stays visible so
   the current sub-step (press i, type the line, :wq) can be read while editing. */
.bs-ed {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--black, #000);
  color: var(--text, #e6e6e6);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 17px;
  line-height: 1.35;
  min-height: 0;
  min-width: 0;
}
.linux-lab-screen .linux-terminal-panel > .linux-step-banner { grid-row: 1; grid-column: 1; }
.linux-lab-screen .linux-terminal-panel > .linux-terminal-output { grid-row: 2; grid-column: 1; }
.linux-lab-screen .linux-terminal-panel > .bs-ed { position: relative; inset: auto; grid-row: 2; grid-column: 1; }
.es-term { position: relative; }
.bs-ed-screen {
  overflow: hidden;
  padding: 6px 8px 2px;
  white-space: pre;
  min-height: 0;
  cursor: text;
}
.bs-ed-row { height: 1.35em; overflow: hidden; white-space: pre; }
.bs-ed-tilde { color: #5f87ff; }
.bs-ed-nu { color: #a8a800; }
.bs-ed-inv { background: var(--text, #e6e6e6); color: var(--black, #000); }
.bs-ed-cur { background: var(--text, #e6e6e6); color: var(--black, #000); }
.bs-ed-cur--bar { background: transparent; color: inherit; box-shadow: inset 2px 0 0 var(--text, #e6e6e6); }
.bs-ed-err { background: #c00; color: #fff; }
.bs-ed-mode { font-weight: 700; }
.bs-ed-status { color: inherit; }
.bs-ed-input {
  position: absolute;
  left: 0; bottom: 0;
  width: 1px; height: 1px;
  opacity: 0;
  border: 0; padding: 0; margin: 0;
  resize: none;
  font-size: 16px; /* no zoom-on-focus on iOS */
}
.bs-ed-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px 8px;
  border-top: 1px solid color-mix(in srgb, var(--orange, #ff8c00) 35%, transparent);
}
.bs-ed-key {
  font: inherit;
  font-size: 14px;
  min-width: 40px;
  min-height: 34px;
  padding: 2px 10px;
  background: transparent;
  color: inherit;
  border: 1px solid color-mix(in srgb, var(--text, #e6e6e6) 35%, transparent);
  border-radius: 4px;
  cursor: pointer;
}
.bs-ed-key:focus-visible { outline: 2px solid var(--orange, #ff8c00); outline-offset: 1px; }
.bs-ed:focus-within .bs-ed-screen { outline: none; }
@media (max-width: 599px) {
  .bs-ed { font-size: 13px; }
  .bs-ed-key { font-size: 13px; min-width: 36px; min-height: 36px; padding: 2px 8px; }
}
.es-screen .es-sub.es-bootfail { color: var(--red, #ff5a5a); font-weight: 600; }
.bs-ed-sel { background: color-mix(in srgb, var(--text, #e6e6e6) 35%, transparent); }
/* End-of-lab reboot check (labs/18-editor-tasks.js bsSysCompletionReport) */
.rcs-reboot-sub { margin: 4px 0 8px; font-size: 14px; color: var(--sig-ink-dim, #b8b8b8); }
.rcs-reboot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rcs-reboot-item { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.4; }
.rcs-reboot-item.is-kept .rcs-reboot-mark { color: var(--green, #3ddc84); }
.rcs-reboot-item.is-lost .rcs-reboot-mark { color: var(--red, #ff5a5a); }

/* BLACK SIGNAL // ONE SIZE ON THE COMMAND LINE
   The live prompt (R1#, [user@host ~]$, PS C:\>), what you type, and the lines
   already in the scrollback are the same text in a real terminal, so they share
   one size, line height and weight. Phones use 16px for all of it: iOS zooms
   the page when an input is under 16px. */
@layer screens {
  .linux-lab-screen { --bs-term-fs: 15px; --bs-term-lh: 1.7; }
  @media (max-width: 599px), (max-width: 1023px) and (max-height: 500px) {
    .linux-lab-screen { --bs-term-fs: 16px; --bs-term-lh: 1.55; }
  }
  .linux-lab-screen .linux-terminal-output .tline,
  .linux-lab-screen .linux-terminal-output .tline .ttext,
  .linux-lab-screen .linux-terminal-output .tline .tprompt,
  .linux-lab-screen .linux-terminal-output .tline .tprefix,
  .linux-lab-screen .linux-terminal-output > .linux-input-row,
  .linux-lab-screen .linux-terminal-output > .linux-input-row > .linux-prompt-label,
  .linux-lab-screen .linux-terminal-output .linux-input-row #linux-command-input {
    font-size: var(--bs-term-fs) !important;
    line-height: var(--bs-term-lh) !important;
  }
  .linux-lab-screen .linux-terminal-output .tline-cmd .tprompt,
  .linux-lab-screen .linux-terminal-output > .linux-input-row > .linux-prompt-label { font-weight: 500 !important; }
  .linux-lab-screen .linux-terminal-output .linux-input-row #linux-command-input { min-height: calc(var(--bs-term-fs) * var(--bs-term-lh)); }
}

/* Hidden test badge (C and Python graders): the test runs, its input and
   expected value stay private so a lab cannot be passed by hard-coding. */
@layer screens {
  .bsc-hidden-badge {
    display: inline-block; margin-left: 8px; padding: 1px 6px; vertical-align: 1px;
    border: 1px solid var(--sig-rule-strong, var(--orange));
    font-family: var(--sig-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em;
    color: var(--sig-ink-dim);
  }
}
