/* Layout: a shift in the network closet. Home is one cable run through seven ports, lit as you finish them. Each topic is one continuous shift (Read, Practice, Check) with a step rail beside it. Graphite chrome, one safety-orange accent, dark terminals carry the richness. */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --raised: #f4f4f5;
  --ink: #171717;
  --ink-2: #525252;
  --muted: #737373;
  --line: rgba(23, 23, 23, 0.08);
  --line-strong: rgba(23, 23, 23, 0.16);
  --accent: #c2410c;
  --on-accent: #ffffff;
  --ok: #15803d;
  --ok-bg: #e8f5ec;
  --bad: #c42b27;
  --bad-bg: #fbebea;
  --warn: #92560a;
  --warn-bg: #fbf1de;
  --term-bg: #18181b;
  --term-line: rgba(237, 237, 237, 0.08);
  --term-fg: #e4e4e7;
  --term-dim: #8a8a93;
  --term-ok: #86d6a3;
  --term-err: #f59a95;
  --term-prompt: #fdba74;
  --c-linux: #2f6fdc;
  --c-network: #c99700;
  --c-security: #c9372f;
  --c-cloud: #7a4cc8;
  --c-sql: #1f8a4f;
  --c-git: #d4652c;
  --c-helpdesk: #6b7280;
  --c-windows: #0e7490;
  --c-m365: #b45309;
  --c-scripting: #4d7c0f;
  --c-switching: #0369a1;
  --c-hardware: #9f1239;
  --c-ops: #475569;
  --c-containers: #be185d;
  --f-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #0e0e0f; --raised: #1a1a1c; --ink: #ededed; --ink-2: #a1a1a6; --muted: #85858b;
    --line: rgba(237, 237, 237, 0.08); --line-strong: rgba(237, 237, 237, 0.16);
    --accent: #fb8a3c; --on-accent: #141415;
    --ok: #4cc38a; --ok-bg: #15271e; --bad: #f07a7d; --bad-bg: #2c1718; --warn: #e6b052; --warn-bg: #2a2110;
    --term-bg: #0a0a0b;
    --c-linux: #5d92f0; --c-network: #e2b23a; --c-security: #e8625b; --c-cloud: #a283ee; --c-sql: #4ab878; --c-git: #ee8a55; --c-helpdesk: #9ca3af; --c-windows: #38b6cc; --c-m365: #e09a45; --c-scripting: #93bf4a; --c-switching: #4fb0e6; --c-hardware: #f0708e; --c-ops: #94a3b8; --c-containers: #ec74b0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #0e0e0f; --raised: #1a1a1c; --ink: #ededed; --ink-2: #a1a1a6; --muted: #85858b;
  --line: rgba(237, 237, 237, 0.08); --line-strong: rgba(237, 237, 237, 0.16);
  --accent: #fb8a3c; --on-accent: #141415;
  --ok: #4cc38a; --ok-bg: #15271e; --bad: #f07a7d; --bad-bg: #2c1718; --warn: #e6b052; --warn-bg: #2a2110;
  --term-bg: #0a0a0b;
  --c-linux: #5d92f0; --c-network: #e2b23a; --c-security: #e8625b; --c-cloud: #a283ee; --c-sql: #4ab878; --c-git: #ee8a55; --c-helpdesk: #9ca3af; --c-windows: #38b6cc; --c-m365: #e09a45; --c-scripting: #93bf4a; --c-switching: #4fb0e6; --c-hardware: #f0708e; --c-ops: #94a3b8; --c-containers: #ec74b0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 112px); }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--f-body); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
a { color: var(--accent); text-underline-offset: 2px; }
code, kbd, pre, .mono { font-family: var(--f-mono); }
code { font-size: 0.88em; background: var(--raised); padding: 0 4px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--f-body); font-weight: 500; line-height: 1.2; text-wrap: balance; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }

/* Header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 32px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: none; }
.brand svg { width: 20px; height: 20px; }
.brand b { font-weight: 600; font-size: 15px; }
.topnav { display: flex; gap: 4px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { flex: none; padding: 0 12px; height: 32px; display: flex; align-items: center; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-size: 14px; white-space: nowrap; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.topnav a:hover { background: var(--raised); color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--raised); font-weight: 500; }

main.wrap { padding-block: 64px 96px; }

/* Signature: Port label with a cable-colored jack */
.port-label { display: inline-flex; align-items: center; gap: 8px; font: 400 12px/16px var(--f-mono); color: var(--muted); white-space: nowrap; }
.jack { width: 12px; height: 8px; flex: none; background: var(--cable, var(--muted)); clip-path: polygon(0 0, 100% 0, 100% 62%, 75% 62%, 75% 100%, 25% 100%, 25% 62%, 0 62%); }

/* Buttons */
.btn { font: 500 14px/1 var(--f-body); height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease); }
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 20; height: 40px; padding: 0 16px; border-radius: var(--r); border: 0; background: var(--ink); color: var(--bg); font: 500 14px var(--f-body); cursor: pointer; }
.skip:focus { top: 8px; }
h1[tabindex="-1"]:focus { outline: none; }
.summary-text { min-height: 120px; }

/* Home */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 64px; align-items: center; padding-bottom: 96px; }
.eyebrow { font: 400 13px/20px var(--f-mono); color: var(--muted); margin: 0 0 16px; }
.hero h1 { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -0.03em; }
.hero .lede { font-size: 18px; line-height: 28px; color: var(--ink-2); max-width: 34rem; margin: 20px 0 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-actions .btn.primary { max-width: 100%; }
.hero-actions .btn.primary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-term { margin: 0; display: grid; gap: 12px; min-width: 0; }
.hero-term figcaption { font-size: 13px; color: var(--muted); }
.term.static { height: auto; cursor: default; }
.term.static .term-out { padding-bottom: 16px; overflow: hidden; }
.term.static .term-out div { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.caret { display: inline-block; width: 8px; height: 16px; vertical-align: -3px; background: var(--term-prompt); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin: 0 0 24px; }
.section-head h2 { font-size: 28px; letter-spacing: -0.02em; }
.section-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; max-width: 52ch; }
.home-section + .home-section { margin-top: 96px; }
.progress-line { display: flex; align-items: center; gap: 12px; font: 400 13px var(--f-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.meter { width: 160px; height: 4px; background: var(--raised); border-radius: 2px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); }

/* The cable run */
.run { list-style: none; margin: 0; padding: 0; display: grid; }
.station { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 16px; }
.station::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--line-strong); }
.station:first-child::before { top: 36px; }
.station:last-child::before { bottom: auto; height: 36px; }
.station.done:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 36px; height: 100%; width: 2px; background: var(--accent); }
.node { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 29px; justify-self: center; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg); }
.station.started .node { border-color: var(--accent); }
.station.done .node { border-color: var(--accent); background: var(--accent); }
.station-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 240px) 40px; gap: 24px; align-items: center; padding: 20px; margin-block: 2px; border-radius: var(--r-lg); text-decoration: none; color: var(--ink); transition: background-color 150ms var(--ease); }
.station-card:hover { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.station-main { display: grid; gap: 2px; min-width: 0; }
.station-main b { font-weight: 500; font-size: 16px; }
.station-main span { font-size: 14px; color: var(--ink-2); }
.station-next { font-size: 13px; color: var(--ink); min-width: 0; }
.station-next small { display: block; font: 400 12px var(--f-mono); color: var(--muted); }
.station.done .station-next { color: var(--ok); }
.station-count { font: 400 12px var(--f-mono); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.career-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 240px) 40px; gap: 24px; align-items: center; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color 150ms var(--ease); }
.career-card:hover { border-color: var(--line-strong); }
.career-list { display: grid; gap: 8px; font-size: 16px; font-weight: 500; }
.career-list > span { display: flex; align-items: center; gap: 12px; }
.career-list > span.done { color: var(--ink-2); }
@media (max-width: 560px) { .career-card { grid-template-columns: minmax(0, 1fr) 40px; padding: 16px; } .career-card .station-next { grid-column: 1; } .career-card .station-count { grid-row: 1; grid-column: 2; } }
.paths-table td:first-child { font-weight: 500; white-space: nowrap; }
.paths-table td:nth-child(2) { color: var(--ink-2); }
.route a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.route a:hover { border-bottom-color: var(--ink); }
.route .sep { color: var(--muted); padding: 0 4px; }

/* Topic page */
.topic-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 64px; padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--line); }
.topic-head .port-label { margin-bottom: 16px; }
.topic-head h1 { font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -0.025em; line-height: 1.08; }
.topic-head .lede { font-size: 18px; line-height: 28px; color: var(--ink-2); margin: 16px 0 0; max-width: 58ch; }
.hire { margin: 0; display: grid; gap: 16px; align-self: end; }
.hire dt { font-size: 13px; color: var(--muted); }
.hire dd { margin: 2px 0 0; font-size: 14px; }

.shift { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; }
.rail { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 120px); align-self: start; }
.rail > ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.rail-head { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 0; font: 500 14px var(--f-body); color: var(--ink); cursor: pointer; text-align: left; }
.rail-n { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); font: 500 12px var(--f-mono); display: grid; place-items: center; color: var(--ink-2); }
.rail-step.done .rail-n { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.rail-count { margin-left: auto; font: 400 12px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.sub { list-style: none; margin: 8px 0 0 9px; padding: 0 0 0 16px; border-left: 1px solid var(--line-strong); display: grid; gap: 2px; }
.sub button { text-align: left; width: 100%; background: none; border: 0; padding: 6px 8px; border-radius: var(--r-sm); font: 400 13px/20px var(--f-body); color: var(--ink-2); cursor: pointer; display: flex; gap: 8px; align-items: flex-start; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.sub button:hover { background: var(--raised); color: var(--ink); }
.sub button[aria-current="true"] { background: var(--raised); color: var(--ink); }
.sub .dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.sub button.done .dot { background: var(--ok); border-color: var(--ok); }

.step + .step { margin-top: 96px; padding-top: 48px; border-top: 1px solid var(--line); }
.step-head { margin-bottom: 32px; }
.step-n { font: 400 12px var(--f-mono); color: var(--accent); }
.step-head h2 { font-size: 32px; letter-spacing: -0.02em; margin-top: 4px; }
.step-head p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; max-width: 60ch; }

/* Readings */
.reading { max-width: 68ch; }
.reading + .reading { margin-top: 64px; }
.reading .meta { font: 400 12px/16px var(--f-mono); color: var(--muted); margin: 0 0 8px; }
.reading-title { font-size: 24px; letter-spacing: -0.015em; margin-bottom: 16px; }
.reading h3:not(.reading-title) { font-size: 18px; margin: 32px 0 8px; }
.reading p, .reading li { font-size: 16px; line-height: 1.7; }
.reading ul, .reading ol { padding-left: 20px; }
.reading li { margin: 4px 0; }
.reading-end { display: flex; align-items: center; gap: 8px; margin-top: 32px; font-size: 13px; color: var(--muted); }
.reading-end.done { color: var(--ok); }
.check { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.check.on { background: var(--ok); border-color: var(--ok); }
.check.on::after { content: ""; width: 4px; height: 7px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
pre { background: var(--term-bg); color: var(--term-fg); padding: 16px; border-radius: var(--r); overflow-x: auto; font-size: 13px; line-height: 1.6; border: 1px solid var(--term-line); }
pre .c { color: var(--term-dim); }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--ink-2); background: var(--raised); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.callout { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 24px 0; font-size: 15px; }
.callout b { display: block; font-weight: 500; font-size: 13px; color: var(--accent); margin-bottom: 4px; }

/* Labs */
.labs { display: grid; gap: 32px; }
.lab { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.lab-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.lab-head h3 { font-size: 20px; letter-spacing: -0.01em; }
.lab-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; max-width: 70ch; }
.lab-status { display: flex; align-items: center; gap: 12px; }
.badge { font: 400 12px/16px var(--f-mono); color: var(--muted); white-space: nowrap; }
.badge.done { color: var(--ok); }
.lab-body { padding: 24px; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
.tasks { display: grid; gap: 4px; align-content: start; }
.tasks h4 { font-size: 15px; margin-bottom: 8px; }
.tasks ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tasks li { display: flex; gap: 12px; font-size: 14px; line-height: 20px; }
.tasks li .check { margin-top: 2px; }
.tasks li .hint-cmd { display: inline-block; margin-top: 4px; }
.tasks li.done > div { color: var(--muted); }
.tasks details { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tasks summary { cursor: pointer; width: max-content; }
.small-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

.term { background: var(--term-bg); color: var(--term-fg); border: 1px solid var(--term-line); border-radius: var(--r-lg); font: 13px/1.6 var(--f-mono); height: 420px; display: flex; flex-direction: column; overflow: hidden; cursor: text; min-width: 0; }
.term-bar { display: flex; gap: 8px; align-items: center; height: 36px; padding: 0 16px; border-bottom: 1px solid var(--term-line); color: var(--term-dim); font-size: 12px; }
.term-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--term-line); box-shadow: inset 0 0 0 1px rgba(237, 237, 237, 0.14); }
.term-bar span { margin-left: 4px; }
.term-out { flex: 1; overflow-y: auto; padding: 12px 16px 0; white-space: pre-wrap; word-break: break-word; }
.term-out .p { color: var(--term-prompt); }
.term-out .err { color: var(--term-err); }
.term-out .ok { color: var(--term-ok); }
.term-out .dim { color: var(--term-dim); }
.term-out .dir { color: var(--term-prompt); font-weight: 500; }
.term-out .exe { color: var(--term-ok); font-weight: 500; }
.term-in { display: flex; gap: 8px; padding: 4px 16px 12px; }
.term-in .ps1 { color: var(--term-prompt); white-space: nowrap; }
.term-in input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--term-fg); font: inherit; outline: none; caret-color: var(--term-prompt); }

.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(192px, 1fr)); gap: 16px; }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
input.t, select.t, textarea.t { font: 14px var(--f-mono); height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--ink); width: 100%; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
textarea.t { height: auto; padding: 12px; font-size: 13px; line-height: 1.55; resize: vertical; }
input.t:focus, select.t:focus, textarea.t:focus { border-color: var(--ink-2); outline: none; }
input.t:focus-visible, select.t:focus-visible, textarea.t:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input.t.right, select.t.right { border-color: var(--ok); background: var(--ok-bg); }
input.t.wrong, select.t.wrong { border-color: var(--bad); background: var(--bad-bg); }
.problem { font: 500 clamp(24px, 3.6vw, 28px) var(--f-mono); margin: 0 0 20px; }
.problem small { font: 400 13px var(--f-body); color: var(--muted); display: block; margin-bottom: 4px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.feedback { font-size: 14px; padding: 12px 16px; border-radius: var(--r); margin-top: 16px; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback.info { background: var(--raised); color: var(--ink); }
.stat { font: 400 12px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.work { background: var(--bg); border: 1px dashed var(--line-strong); padding: 12px 16px; border-radius: var(--r); margin-top: 16px; font-size: 14px; }
.work ol { margin: 4px 0 0; padding-left: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }

.logview { background: var(--term-bg); color: var(--term-fg); border-radius: var(--r); font: 12px/1.65 var(--f-mono); max-height: 360px; overflow: auto; padding: 12px 0; border: 1px solid var(--term-line); }
.logview div { padding: 0 16px; white-space: pre; }
.logview mark { background: rgba(251, 138, 60, 0.32); color: inherit; border-radius: 2px; }

.email { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); font-size: 15px; }
.email-head { padding: 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; font-size: 14px; }
.email-head b { font-weight: 500; color: var(--ink-2); }
.email-body { padding: 16px; line-height: 1.7; }
.email-body p { margin: 0 0 12px; }
.sus { cursor: pointer; border-radius: 4px; padding: 1px 2px; transition: background-color 150ms var(--ease); }
.sus:hover { background: var(--warn-bg); }
.sus.found { background: var(--bad-bg); box-shadow: inset 0 -2px 0 var(--bad); }
.sus.safe-clicked { background: var(--raised); }
.fake-link { color: var(--accent); text-decoration: underline; }
.attach { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line-strong); background: var(--surface); padding: 4px 12px; border-radius: var(--r); font-size: 13px; }
.attach svg { width: 16px; height: 16px; color: var(--muted); }
.flags { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.flags li { font-size: 14px; padding: 8px 12px; background: var(--bg); border-radius: var(--r); border: 1px solid var(--line); }
.flags li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-right: 8px; }
.flags li.pending { color: var(--muted); }
.flags li.pending::before { background: var(--line-strong); }

.tests { display: grid; gap: 8px; }
.test { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; background: var(--bg); }
.test code { background: none; padding: 0; font-size: 12px; word-break: break-all; }
.test .res { font: 500 12px var(--f-mono); white-space: nowrap; }
.res.pass { color: var(--ok); }
.res.fail { color: var(--bad); }
.res.idle { color: var(--muted); }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--raised); border-radius: var(--r); flex-wrap: wrap; }
.seg button { font: 500 13px var(--f-body); border: 0; background: none; color: var(--ink-2); height: 32px; padding: 0 12px; border-radius: 4px; cursor: pointer; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }

.sql-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.schema { font: 12px/1.6 var(--f-mono); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; align-self: start; }
.schema b { color: var(--ink); font-weight: 500; display: block; margin-top: 8px; }
.schema b:first-child { margin-top: 0; }
.schema span { color: var(--muted); display: block; padding-left: 12px; }
.challenge-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.challenge-list button { font: 500 13px var(--f-mono); width: 36px; height: 32px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background-color 150ms var(--ease); }
.challenge-list button:hover { background: var(--raised); }
.challenge-list button[aria-current="true"] { border-color: var(--ink); color: var(--ink); }
.challenge-list button.solved { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.challenge-list button.solved[aria-current="true"] { border-color: var(--ok); }
.dx-opts { display: grid; gap: 8px; }
.dx-opt { text-align: left; font: 400 15px/1.45 var(--f-body); padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; transition: background-color 150ms var(--ease), border-color 150ms var(--ease); }
.dx-opt:hover { background: var(--raised); }
.dx-opt.right { background: var(--ok-bg); border-color: var(--ok); }
.dx-opt.wrong { background: var(--bad-bg); border-color: var(--bad); }
[data-art] { margin: 0; white-space: pre-wrap; }
.results { margin-top: 16px; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.results table { font: 12px var(--f-mono); }
.results td, .results th { padding: 4px 12px; white-space: nowrap; }

.graph { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; overflow-x: auto; margin-top: 16px; }
.graph svg text { font-family: var(--f-mono); font-size: 12px; fill: var(--ink); }
.graph svg text.dim { fill: var(--muted); }
.gstate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.gstate div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; font-size: 13px; min-width: 0; }
.gstate b { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.gstate span { font-family: var(--f-mono); word-break: break-all; }

.matrix { border-collapse: collapse; font-size: 13px; margin-bottom: 20px; width: auto; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 8px 12px; text-align: center; }
.matrix th { font-weight: 500; }
.matrix th .stat { display: block; }
.matrix td { font: 500 13px var(--f-mono); }
.p1 { color: var(--bad); } .p2 { color: var(--warn); } .p3 { color: var(--ink); } .p4 { color: var(--muted); }
.tickets { display: grid; gap: 8px; }
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) 148px 188px; gap: 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.ticket .tid { font: 400 12px var(--f-mono); color: var(--muted); }
.ticket p { margin: 2px 0 0; font-size: 14px; }
.ticket .explain { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); margin: 0; }

/* Quiz */
.quiz { max-width: 720px; display: grid; gap: 16px; }
fieldset.q { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); padding: 20px 20px 12px; margin: 0; }
fieldset.q legend { font-weight: 500; font-size: 16px; padding: 0; float: left; width: 100%; margin-bottom: 12px; }
fieldset.q legend + * { clear: both; }
.qn { font: 400 12px var(--f-mono); color: var(--muted); margin-right: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border-radius: var(--r); cursor: pointer; font-size: 15px; transition: background-color 150ms var(--ease); }
.opt:hover { background: var(--bg); }
.opt input { margin-top: 5px; accent-color: var(--ink); }
.opt.right { background: var(--ok-bg); }
.opt.wrong { background: var(--bad-bg); }
fieldset.q .why { font-size: 14px; color: var(--ink-2); margin: 8px 12px 4px; }
.quiz-foot { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

.footer { border-top: 1px solid var(--line); padding-block: 24px; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .hero, .topic-head { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .shift { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .rail { position: static; }
  .rail > ol { display: flex; gap: 8px; flex-wrap: wrap; }
  .rail-step { flex: 1 1 120px; min-width: 0; }
  .rail-head { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
  .sub { display: none; }
  .lab-grid, .split, .sql-grid { grid-template-columns: minmax(0, 1fr); }
  .ticket { grid-template-columns: 1fr 1fr; }
  .ticket > div:first-child { grid-column: 1 / -1; }
  .term { height: 360px; }
  .station-card { grid-template-columns: 64px minmax(0, 1fr) 40px; }
  .station-next { grid-column: 2 / 3; }
  .station-count { grid-row: 1; grid-column: 3; }
}
@media (max-width: 560px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  main.wrap { padding-block: 32px 64px; }
  .top .wrap { flex-wrap: wrap; gap: 4px; padding-block: 8px; }
  .topnav { width: 100%; margin-left: -12px; }
  .hero { padding-bottom: 64px; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .home-section + .home-section { margin-top: 64px; }
  .station-card { grid-template-columns: minmax(0, 1fr) 40px; gap: 8px 16px; padding: 16px 12px; }
  .station-card .port-label { grid-column: 1; }
  .station-main, .station-next { grid-column: 1; }
  .station-count { grid-row: 1; grid-column: 2; }
  .gstate { grid-template-columns: 1fr; }
  .lab-body, .lab-head { padding: 16px; }
  .step + .step { margin-top: 64px; padding-top: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto !important; } }

/* Step rail toggle */
.rail-toggle { margin-bottom: 16px; }
.shift.collapsed { grid-template-columns: minmax(0, 1fr); gap: 0; }
.shift.collapsed .rail { position: static; }
.shift.collapsed .rail > ol { display: none; }

/* Lab focus mode: one lab fills the window */
.lab-status .btn.small { flex: none; }
.lab.focus { position: fixed; inset: 0; z-index: 50; margin: 0; border: 0; border-radius: 0; overflow: auto; padding-top: env(safe-area-inset-top, 0px); }
.lab.focus .lab-head { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.lab.focus .lab-body { max-width: 1440px; margin: 0 auto; }
.lab.focus .term { height: calc(100vh - 200px); min-height: 360px; }
.lab.focus .logview, .lab.focus .results { max-height: calc(100vh - 320px); }
body.lab-open { overflow: hidden; }

/* Lab building blocks (replaces one-off inline styles) */
.split > *, .lab-grid > * { min-width: 0; }
.row-end { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.field-narrow { width: 160px; }
.fb-action { margin-left: 8px; }
.gap-top { margin-top: 12px; }
.stack { display: grid; gap: 12px; }
.lab-title { margin: 0 0 12px; font-size: 16px; font-weight: 500; }
.lab-prompt { margin: 0 0 12px; font-size: 15px; }
.lab-q { margin: 16px 0 12px; font-size: 15px; }
.lab-brief { margin: 16px 0; max-width: 75ch; }
.lab-h { font-size: 15px; margin-bottom: 8px; }
.lab-pre { margin: 0 0 16px; }
.lab-list { margin: 0; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }
.fb-pre { margin: 8px 0 0; }
.results-empty { padding: 12px 16px; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.scroll-x { overflow-x: auto; }
.term.term-short { height: 300px; }
.topic-head.single { grid-template-columns: minmax(0, 1fr); }

/* Loading and entrance */
.spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 800ms linear infinite; }
.skeleton { display: grid; gap: 8px; margin-top: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); }
.skeleton i { display: block; height: 12px; border-radius: 4px; background: var(--raised); animation: pulse 1200ms var(--ease) infinite alternate; }
.skeleton i:nth-child(1) { width: 40%; } .skeleton i:nth-child(2) { width: 85%; } .skeleton i:nth-child(3) { width: 70%; } .skeleton i:nth-child(4) { width: 55%; }
.enter { animation: enter 200ms var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }
@keyframes enter { from { opacity: 0.4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .enter, .skeleton i { animation: none; } .spinner { animation-duration: 2400ms; } }

/* Order-the-steps lab */
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.order-item.right { border-color: var(--ok); background: var(--ok-bg); }
.order-item.wrong { border-color: var(--bad); background: var(--bad-bg); }
.order-n { font: 400 12px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.order-text { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.order-text.mono { font: 13px/1.5 var(--f-mono); white-space: pre-wrap; }
.order-move { display: flex; gap: 4px; }
.order-move .btn.small { width: 32px; padding: 0; justify-content: center; }

/* Admin console lab */
.admin td { vertical-align: middle; }
.admin td b { font-weight: 500; display: block; }
.admin-sub { display: block; font-size: 12px; color: var(--muted); }
.admin-select { height: 32px; min-width: 132px; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Top bar: grouped topic menus */
.topnav { overflow: visible; flex-wrap: wrap; gap: 4px; }
.navgroup { position: relative; }
.navbtn { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 12px; border: 0; border-radius: var(--r); background: none; color: var(--ink-2); font: 400 14px var(--f-body); white-space: nowrap; cursor: pointer; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.navbtn:hover, .navbtn[aria-expanded="true"] { background: var(--raised); color: var(--ink); }
.navbtn[aria-current="true"] { color: var(--ink); font-weight: 500; }
.navbtn svg { width: 16px; height: 16px; color: var(--muted); transition: transform 150ms var(--ease); }
.navbtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 288px; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); animation: menu-in 140ms var(--ease); }
.navgroup:nth-last-of-type(-n+2) .menu { left: auto; right: 0; }
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.topnav .menu a { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--r); color: var(--ink); font-size: 14px; }
.topnav .menu a:hover { background: var(--raised); }
.menu-count { font: 400 12px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .menu { animation: none; } }
@media (max-width: 560px) { .menu { min-width: 0; width: calc(100vw - 32px); max-width: 320px; } }

/* Top bar v2: one Topics panel showing every group, plus a sub-bar of sibling topics */
.top .wrap { position: relative; }
.topnav { flex: 1; align-items: center; }
.topics-nav { position: static; }
.top .topics-nav .menu.mega { left: 24px; right: 24px; min-width: 0; padding: 16px 12px; }
.mega-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 12px; }
.mega-h { font: 500 12px/16px var(--f-body); color: var(--muted); margin: 0 0 4px; padding: 0 12px; }
.nav-progress { margin-left: auto; font: 400 12px var(--f-mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.navlink { flex: none; padding: 0 12px; height: 32px; display: flex; align-items: center; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-size: 14px; }
.subbar { border-top: 1px solid var(--line); }
.subbar[hidden] { display: none; }
.subbar .wrap { display: flex; align-items: center; gap: 4px; min-height: 40px; overflow-x: auto; scrollbar-width: none; }
.subbar .wrap::-webkit-scrollbar { display: none; }
.subbar-h { flex: none; font-size: 13px; color: var(--muted); margin-right: 8px; white-space: nowrap; }
.subbar a { flex: none; display: flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-size: 13px; white-space: nowrap; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.subbar a:hover { background: var(--raised); color: var(--ink); }
.subbar a[aria-current="page"] { background: var(--raised); color: var(--ink); font-weight: 500; }
@media (max-width: 1040px) { .mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mega-grid { grid-template-columns: minmax(0, 1fr); } .top .topics-nav .menu.mega { left: 16px; right: 16px; width: auto; max-width: none; max-height: 70vh; overflow-y: auto; } .nav-progress { display: none; } }
.topnav .menu.mega a { white-space: normal; height: auto; min-height: 36px; padding: 8px 12px; line-height: 20px; }

/* Start here: goal picker and your path */
.station-card { grid-template-columns: 136px minmax(0, 1fr) minmax(0, 240px) 40px; }
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.goal { display: grid; gap: 4px; text-align: left; padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.goal:hover { border-color: var(--accent); }
.goal b { font-weight: 500; font-size: 16px; }
.goal span { font-size: 14px; color: var(--ink-2); }
.goal small { font: 400 12px var(--f-mono); color: var(--muted); margin-top: 4px; }
.path-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.path-steps a { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 240px) 40px; gap: 20px; align-items: center; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 150ms var(--ease); }
.path-steps a:hover { border-color: var(--line-strong); }
.path-n { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font: 500 13px var(--f-mono); color: var(--ink-2); }
.path-steps li.done .path-n { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.path-steps li.done .station-next { color: var(--ok); }
a.nav-progress { text-decoration: none; }
a.nav-progress:hover { color: var(--ink); }

/* Feedback and poll */
.lab-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 24px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.lab-feedback label.f, .lab-feedback textarea { width: 100%; }
.lab-feedback .row-actions { margin-top: 0; }
.fb-thanks { margin: 0; font-size: 14px; color: var(--ink-2); }
.poll { display: flex; flex-wrap: wrap; gap: 8px; }

/* Interview prep and go further */
.iv { display: grid; gap: 8px; max-width: 72ch; }
.iv-q { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.iv-q summary { cursor: pointer; padding: 16px 20px; font-weight: 500; font-size: 15px; list-style-position: inside; }
.iv-q[open] summary { border-bottom: 1px solid var(--line); }
.iv-q p { margin: 0; padding: 16px 20px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.further-h { font-size: 20px; margin: 40px 0 4px; }
.further-p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.further { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 72ch; }
.further li { display: grid; gap: 2px; padding: 12px 16px; border-left: 2px solid var(--line-strong); }
.further a { font-weight: 500; }
.further span { font-size: 14px; color: var(--ink-2); }

/* Glossary terms in readings and the glossary page */
.gterm { position: relative; border-bottom: 1px dotted var(--muted); cursor: help; }
.gterm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.term-def { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gterm:hover .term-def, .gterm:focus .term-def { width: min(280px, 70vw); height: auto; clip: auto; overflow: visible; white-space: normal; left: 0; bottom: calc(100% + 8px); z-index: 15; padding: 8px 12px; border-radius: var(--r); background: var(--ink); color: var(--bg); font: 400 13px/1.5 var(--f-body); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.glossary { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 32px; }
.glossary div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.glossary dt { font-weight: 500; }
.glossary dd { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }

/* Phones */
.mobile-note { display: none; }
@media (max-width: 960px) { .path-steps a { grid-template-columns: 32px minmax(0, 1fr) 40px; } .path-steps .station-next { grid-column: 2; } .path-steps .station-count { grid-row: 1; grid-column: 3; } .station-card { grid-template-columns: 112px minmax(0, 1fr) 40px; } }
@media (max-width: 560px) {
  .mobile-note { display: block; margin: 0 0 12px; padding: 8px 12px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn); font-size: 13px; }
  input.t, select.t, textarea.t, .term-in input { font-size: 16px; }
  .subbar a { height: 36px; }
  .order-move .btn.small { width: 40px; height: 40px; }
  .goals { grid-template-columns: minmax(0, 1fr); }
  .path-steps a { padding: 12px; gap: 12px; }
  .lab-feedback { padding: 12px 16px; }
  .gterm:hover .term-def, .gterm:focus .term-def { left: auto; right: auto; position: fixed; bottom: 16px; left: 16px; right: 16px; width: auto; }
  .hero-term figcaption { display: none; }
  .topnav { gap: 2px; flex-wrap: nowrap; }
  .navlink, .navbtn { padding: 0 8px; }
  .top .subbar .wrap { flex-wrap: nowrap; padding-block: 2px; }
  .sus { padding-block: 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
}

/* Review fixes */
.goal-unsure { margin: 16px 0 0; font-size: 14px; color: var(--ink-2); }
.further { gap: 0; border-top: 1px solid var(--line); }
.further li { border-left: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }

/* Topic rows: level and time above the title, no separate label column */
.station-card { grid-template-columns: minmax(0, 1fr) minmax(0, 240px) 40px; }
.station-main .port-label { margin-bottom: 4px; }
@media (max-width: 960px) { .station-card { grid-template-columns: minmax(0, 1fr) 40px; } .station-card .station-next { grid-column: 1; } .station-card .station-count { grid-row: 1; grid-column: 2; } }

/* PC workbench labs */
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
.bench-main { min-width: 0; display: grid; gap: 12px; align-content: start; }
.bench-stage { border-radius: var(--r-lg); background: #14181b; border: 1px solid #262c31; padding: 8px; }
.bench-no3d { margin: 0; padding: 16px; color: #c9d1d9; font-size: 14px; }
/* Workbench 3D view (bench3d.js) */
.bench-viewbar { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.bench-status { margin-right: auto; font-size: 13px; color: var(--muted); }
.bench-viewbar [hidden], .bench-chips[hidden], .bench-stage [hidden] { display: none; }
.bench-canvas { display: block; width: 100%; height: clamp(380px, 52vw, 620px); border-radius: var(--r); touch-action: none; }
.bench-stage, .bench-3d { position: relative; }
.bench-hint { margin: 0; font-size: 12px; color: var(--muted); }
/* In 3D the scene is the interface; these lists stay for keyboard and screen reader users and appear when focused */
.bench.is3d .bench-a11y:not(:focus-within) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bench-tip { position: absolute; left: var(--x, 0); top: var(--y, 0); z-index: 4; display: grid; gap: 2px; max-width: 260px; padding: 8px 12px; border-radius: var(--r); background: rgba(12, 14, 16, 0.92); color: #e9edf0; font-size: 12px; line-height: 1.45; pointer-events: none; }
.bench-tip b { font-size: 13px; font-weight: 500; }
.bench-tip[hidden], .bench-pop[hidden] { display: none; }
.bench-pop { position: absolute; left: var(--x, 16px); top: var(--y, 16px); z-index: 5; width: min(300px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow-y: auto; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.bench-pop h4 { margin: 0 0 4px; padding-right: 28px; font-size: 15px; }
.bench-pop .row-actions { margin-top: 12px; gap: 8px; }
.bench-pop-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: var(--r); background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.bench-pop-x:hover { color: var(--ink); }
.bench-desc { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.bench-canvas.pick { cursor: pointer; }
.bench-canvas.grab { cursor: grab; }
.bench-canvas.dragging { cursor: grabbing; }
.bench-canvas.driver, .bench-canvas.driver.pick { cursor: crosshair; }
.bench-tip.warn { background: rgba(60, 20, 12, 0.94); color: #ffd9c7; }
.bench-note { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--r); background: var(--raised); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.bench-next { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--accent); }
/* Over the 3D bench: the step bar (top left), camera views (bottom), messages, the tour, the hold ring and the loading cover */
.bench.is3d .bench-side .tasks { display: none; }
.bench-guide { position: relative; margin-bottom: 8px; padding: 12px 16px; border-radius: var(--r-lg); background: rgba(12, 14, 16, 0.88); color: #e9edf0; }
.bench-guide[hidden], .bench-toast[hidden], .bench-tour[hidden], .bench-poster[hidden], .bench-hold[hidden], .bench-progress[hidden] { display: none; }
.bench-guide-n { margin: 0; font: 500 12px var(--f-mono); color: #9aa4ad; }
.bench-guide-t { margin: 4px 0 0; font-size: 14px; font-weight: 500; line-height: 1.45; }
.bench-guide-do { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: #fb8a3c; }
.bench-guide-do:empty { display: none; }
.bench-guide-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.bench-steps > summary { font-size: 12px; color: #c9d1d9; cursor: pointer; }
.bench-steps-list { position: absolute; left: 16px; top: calc(100% - 4px); z-index: 6; width: min(440px, calc(100% - 32px)); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); max-height: min(360px, 50vh); overflow-y: auto; padding: 12px; border-radius: var(--r); background: var(--surface); color: var(--ink); }
.bench-views { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; width: fit-content; margin: 0 auto; padding: 4px; border-radius: var(--r-lg); background: rgba(12, 14, 16, 0.7); }
.bench-toast { position: absolute; top: 16px; right: 16px; z-index: 4; max-width: min(360px, calc(100% - 32px)); padding: 8px 16px; border-radius: var(--r); background: rgba(12, 14, 16, 0.92); color: #e9edf0; font-size: 13px; line-height: 1.5; pointer-events: none; }
.bench-toast.ok { color: #86efac; }
.bench-toast.err { color: #ffb59a; }
.bench-tour { position: absolute; top: 16px; right: 16px; z-index: 6; width: min(320px, calc(100% - 32px)); padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.bench-tour p { margin: 0; font-size: 14px; line-height: 1.5; }
.bench-tour .row-actions { margin-top: 12px; justify-content: flex-end; }
.bench-hold { position: absolute; left: var(--x, 0); top: var(--y, 0); z-index: 4; width: 44px; height: 44px; border: 3px solid #fb8a3c; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
.bench-hold.go { animation: bench-hold 650ms linear forwards; }
@keyframes bench-hold { 25% { opacity: 1; } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.bench-poster { position: relative; display: grid; place-items: center; height: clamp(380px, 52vw, 620px); overflow: hidden; border-radius: var(--r); background: #14181b; }
.bench-poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.bench-poster-card { position: relative; width: min(380px, calc(100% - 32px)); padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); }
.bench-poster-card h4 { margin: 0; font-size: 16px; }
.bench-poster-card .row-actions { margin-top: 16px; align-items: center; gap: 12px; }
.bench-progress { height: 4px; margin-top: 16px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bench-progress i { display: block; width: calc(var(--p, 0.05) * 100%); height: 100%; background: var(--accent); transition: width 200ms var(--ease); }
.bench-history > summary { margin-bottom: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.lab.focus .bench-poster { height: max(420px, calc(100vh - 216px)); }
/* Full screen: the step bar and the 3D view share the window height */
.lab.focus .bench.is3d .bench-stage { display: flex; flex-direction: column; height: max(480px, calc(100vh - 216px)); }
.lab.focus .bench.is3d .bench-3d { flex: 1; min-height: 0; }
.lab.focus .bench.is3d .bench-canvas { height: 100%; }
@media (max-width: 560px) { .bench-guide { padding: 8px 12px; } .bench-toast { top: auto; bottom: 96px; left: 8px; right: 8px; max-width: none; } .bench-tour { top: auto; bottom: 8px; right: 8px; width: calc(100% - 16px); } }
@media (prefers-reduced-motion: reduce) { .bench-hold.go { animation: none; opacity: 1; transform: translate(-50%, -50%); } }
.bench-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bench-chip { height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 400 13px var(--f-body); cursor: pointer; transition: border-color 150ms var(--ease); }
.bench-chip.empty { color: var(--muted); border-style: dashed; }
.bench-chip:hover, .bench-chip[aria-pressed="true"] { border-color: var(--accent); }
.bench-chip[aria-pressed="true"] { font-weight: 500; }
.bench-credits { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.bench-credits a { color: inherit; }
@media (max-width: 560px) { .bench-canvas { height: 340px; } .bench-chip { height: 40px; } }
.bench-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.bench-controls [aria-pressed="false"] { color: var(--ink-2); }
.bench-tools { display: inline-flex; gap: 4px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); }
.bench-tools .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); }
.bench-fasteners { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.bench-fasteners li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.bench-fasteners em { font-style: normal; color: var(--muted); }
.bench-fasteners .btn { flex: none; }
.bench-log { height: 128px; overflow-y: auto; padding: 12px 16px; border-radius: var(--r); background: var(--term-bg); border: 1px solid var(--term-line); font: 13px/1.6 var(--f-mono); color: var(--term-fg); }
.bench-line.ok { color: var(--term-ok); }
.bench-line.err { color: var(--term-err); }
.bench-line.dim { color: var(--term-dim); }
.bench-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.bench-panel { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
.bench-panel h4, .bench-tray h4 { font-size: 15px; margin: 0 0 4px; }
.bench-panel .row-actions { margin-top: 8px; }
.bench-spec { margin: 0; font-size: 13px; color: var(--muted); }
.bench-tray > div { display: grid; gap: 8px; }
.tray-item { display: grid; gap: 2px; text-align: left; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color 150ms var(--ease); }
.tray-item b { font-weight: 500; font-size: 14px; }
.tray-item span { font-size: 12px; color: var(--muted); }
.tray-item:hover, .tray-item.sel { border-color: var(--accent); }
@media (max-width: 960px) { .bench { grid-template-columns: minmax(0, 1fr); } }
/* Workbench: the machine gets the full width, tools sit underneath */
.bench { grid-template-columns: minmax(0, 1fr); }
.bench-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.bench-side .tasks { grid-row: span 2; }
@media (max-width: 700px) { .bench-side { grid-template-columns: minmax(0, 1fr); } .bench-side .tasks { grid-row: auto; } }

/* Help desk chat lab */
.chat-lab { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
.chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 560px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); overflow: hidden; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); font: 500 13px var(--f-mono); color: var(--ink-2); }
.chat-who { display: grid; min-width: 0; }
.chat-who b { font-weight: 500; font-size: 15px; }
.chat-who span { font-size: 12px; color: var(--muted); }
.chat-mood { margin-left: auto; display: grid; justify-items: end; gap: 4px; font-size: 12px; color: var(--ink-2); }
.mood-bar { display: flex; gap: 2px; }
.mood-bar i { width: 12px; height: 4px; border-radius: 2px; background: var(--raised); }
.mood-bar i.on { background: var(--accent); }
.chat-log { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: grid; gap: 2px; max-width: 80%; }
.msg-who { font: 400 11px var(--f-mono); color: var(--muted); }
.msg-body { padding: 8px 12px; border-radius: var(--r-lg); font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.msg.them { align-self: flex-start; }
.msg.them .msg-body { background: var(--raised); color: var(--ink); border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; justify-items: end; }
.msg.me .msg-body { background: var(--ink); color: var(--bg); border-top-right-radius: 4px; }
.msg.sys { align-self: stretch; max-width: none; }
.msg.sys .msg-body { background: var(--term-bg); color: var(--term-fg); border: 1px solid var(--term-line); border-radius: var(--r); font: 12px/1.6 var(--f-mono); }
.chat-reply { display: grid; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--surface); max-height: 300px; overflow-y: auto; }
.chat-prompt { margin: 0; font-size: 12px; color: var(--muted); }
.chat-opt { text-align: left; font: 400 14px/1.45 var(--f-body); padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--ink); cursor: pointer; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.chat-opt:hover { border-color: var(--accent); }
.chat-lab .tasks .btn { margin-top: 12px; justify-self: start; }
@media (max-width: 1180px) { .chat-lab { grid-template-columns: minmax(0, 1fr); } .chat { height: 520px; } }
/* Phones: the reply options would squeeze the conversation, so let the call grow instead */
@media (max-width: 560px) { .chat { height: auto; grid-template-rows: auto 340px auto; } .chat-reply { max-height: none; } }

/* Active Directory labs: Users and Computers (GUI) and PowerShell on one simulated domain */
.ad-main { display: grid; gap: 8px; min-width: 0; align-content: start; }
.ad-main > [hidden] { display: none; }
.ad-tabs { display: inline-flex; gap: 4px; padding: 2px; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r); }
.ad-tabs button { height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font: 500 13px var(--f-body); cursor: pointer; }
.ad-tabs button[aria-selected="true"] { background: var(--raised); color: var(--ink); }
.hint-gui { display: block; margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.aduc { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 460px; min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); font-size: 13px; }
.aduc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.aduc-title { margin-right: auto; font-weight: 500; }
.aduc-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 0; }
.aduc-tree { display: grid; align-content: start; gap: 2px; padding: 8px; overflow-y: auto; border-right: 1px solid var(--line); }
.aduc-node { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 13px var(--f-body); text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aduc-node.lvl1 { padding-left: 28px; }
.aduc-node:hover { background: var(--raised); }
.aduc-node.on { background: var(--raised); font-weight: 500; }
.aduc-node .tw { width: 10px; color: var(--muted); }
.aduc-pane { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.aduc-head, .aduc-row { display: grid; grid-template-columns: 18px minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 12px; }
.aduc-head { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr); padding-left: 38px; height: 30px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.aduc-rows { overflow-y: auto; padding: 4px 0; }
.aduc-row { width: 100%; height: 32px; border: 0; background: none; color: var(--ink); font: 13px var(--f-body); text-align: left; cursor: default; }
.aduc-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aduc-row:hover { background: var(--raised); }
.aduc-row.sel { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.aduc-st { color: var(--muted); }
.aduc-empty { margin: 16px; color: var(--muted); }
.aduc-status { padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.aduc-status code { font: 12px var(--f-mono); color: var(--ink-2); }
.aduc-ok { color: var(--ok); }
/* Small object icons drawn in CSS: domain, folder, user, group; a locked or disabled user gets a badge */
.ico { position: relative; display: inline-block; flex: none; width: 16px; height: 14px; border-radius: 3px; }
.ico.dom { background: var(--ink-2); }
.ico.ou { background: #d8a83a; border-radius: 2px 6px 3px 3px; }
.ico.user { width: 10px; height: 14px; margin: 0 3px; border-radius: 5px 5px 2px 2px; background: #5b8fd6; }
.ico.grp { background: #5b8fd6; box-shadow: 5px -3px 0 -1px #8db3e6; width: 12px; }
.ico.user.locked::after, .ico.user.off::after { content: ''; position: absolute; right: -5px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); }
.ico.user.locked::after { background: var(--warn); }
.ico.user.off::after { background: var(--bad); }
.aduc-menu { position: absolute; left: var(--x, 0); top: var(--y, 0); z-index: 5; display: grid; min-width: 180px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.aduc-menu button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 13px var(--f-body); text-align: left; cursor: pointer; }
.aduc-menu button:hover, .aduc-menu button:focus-visible { background: var(--raised); }
.aduc-shade { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.35); }
.aduc-dlg { display: grid; width: min(360px, 100%); max-height: 100%; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); }
.aduc-dlg.wide { width: min(440px, 100%); }
.aduc-dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); font-weight: 500; }
.aduc-x { width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.aduc-dlg-b { display: grid; gap: 8px; padding: 12px 16px; overflow-y: auto; }
.aduc-dlg-b p { margin: 0; }
.aduc-dlg-f { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 16px 12px; }
.aduc-f { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.aduc-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.aduc-c { display: flex; align-items: flex-start; gap: 8px; line-height: 1.45; }
.aduc-c input { margin-top: 3px; accent-color: var(--accent); }
.aduc-hint { color: var(--muted); font-size: 12px; }
.aduc-sub { margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.aduc-err { padding: 8px 12px; border-radius: var(--r); background: var(--bad-bg); color: var(--bad); line-height: 1.45; }
.aduc-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.aduc-dl dt { color: var(--muted); }
.aduc-dl dd { margin: 0; overflow-wrap: anywhere; }
.aduc-ptabs { display: flex; gap: 4px; padding: 8px 16px 0; border-bottom: 1px solid var(--line); }
.aduc-ptabs button { height: 30px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font: 13px var(--f-body); cursor: pointer; }
.aduc-ptabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); }
.aduc-list { list-style: none; display: grid; gap: 4px; margin: 0; padding: 0; }
.aduc-list li { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.aduc-list .linkbtn:last-child, .aduc-list .aduc-st { margin-left: auto; }
.aduc-add { display: flex; gap: 8px; margin-top: 4px; }
.aduc-add select { flex: 1; min-width: 0; }
.aduc-pick { display: grid; gap: 4px; }
.lab.focus .aduc { height: calc(100vh - 240px); min-height: 420px; }
@media (max-width: 640px) {
  .aduc { height: 560px; }
  .aduc-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .aduc-tree { max-height: 150px; border-right: 0; border-bottom: 1px solid var(--line); }
  .aduc-head { display: none; }
  .aduc-row { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .aduc-row > span:nth-child(3) { display: none; }
}
/* The console window needs width: the task list goes underneath on narrower screens */
@media (max-width: 1100px) { .lab-grid:has(.ad-main) { grid-template-columns: minmax(0, 1fr); } }
