:root {
  --ink: #07110d;
  --paper: #f4f5ee;
  --panel: #ffffff;
  --green: #b8ff3e;
  --green-deep: #63d719;
  --teal: #1bd8a4;
  --muted: #6e756f;
  --line: #d9ddd5;
  --terminal: #06100c;
  --terminal-line: #163527;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(244,245,238,.94); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); letter-spacing: .08em; font-size: .88rem; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; background: var(--ink); color: var(--green); font-family: Georgia, serif; font-size: 1.25rem; border-radius: 3px; }
html:not([data-brand="shellwombat"]) .brand-sw, html[data-brand="shellwombat"] .brand-anu { display: none !important; }
.brand-logo { display: block; width: auto; height: 48px; }
.mascot { display: block; height: auto; }
.mascot-boot { width: 120px; margin-bottom: 4px; padding: 10px 14px; border-radius: 8px; background: #dfe7d9; }
.success-head { display: flex; align-items: center; gap: 26px; margin-bottom: 24px; }
.success-head .success-burst { margin-bottom: 0; }
.mascot-success { width: 120px; }
.mascot-dialog { width: 96px; margin-bottom: 14px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.vm-chip { display: inline-flex; align-items: center; gap: 8px; color: #57605a; font-size: .82rem; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 99px; background: #e8a52c; box-shadow: 0 0 0 4px rgba(232,165,44,.12); }
.status-dot.ready { background: var(--green-deep); box-shadow: 0 0 0 4px rgba(99,215,25,.12); }
.status-dot.error { background: #f05d5d; }
.ghost-button { border: 1px solid #cfd4cc; background: transparent; padding: 9px 12px; border-radius: 4px; font-weight: 750; color: #334038; }
.qa-button { color: var(--green); border-color: #34513f; background: var(--ink); }
.module-button { border-color: #8fa087; }
.shell { height: calc(100vh - 72px - 83px); height: calc(100dvh - 72px - 83px); min-height: 0; display: grid; grid-template-columns: minmax(330px, 40%) minmax(0, 60%); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.mission-panel { position: relative; width: 100%; height: 100%; min-height: 0; max-height: 100%; padding: clamp(30px, 5vw, 72px); border-right: 1px solid var(--line); overflow-x: hidden; overflow-y: scroll; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
.mission-panel:focus-visible { outline: 2px solid var(--green-deep); outline-offset: -2px; }
.mission-panel::-webkit-scrollbar { width: 11px; }
.mission-panel::-webkit-scrollbar-track { background: #e8ebe4; }
.mission-panel::-webkit-scrollbar-thumb { background: #aab2aa; border: 3px solid #e8ebe4; border-radius: 99px; }
.chapter-kicker, .level-row, .objective span, .lesson-card span, .command-card span, .success-kicker, .dialog-kicker, .tier-grid article > span { font-size: .7rem; letter-spacing: .17em; font-weight: 850; }
.chapter-kicker { margin-bottom: 14px; color: #303a34; }
.chapter-kicker span { color: #5c635e; margin-left: 12px; }
.chapter-kicker span:first-child { color: #303a34; margin-left: 0; }
.level-row { display: flex; justify-content: space-between; color: #5c635e; }
.progress-track { height: 5px; margin: 10px 0 clamp(34px, 6vh, 72px); background: #dfe3db; overflow: hidden; }
.progress-fill { width: 10%; height: 100%; background: var(--ink); transition: width .45s ease; }
.challenge-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 24px; border: 1px solid #a7afa7; background: #edf0e8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; font-size: 1.2rem; }
h1 { margin: 0 0 16px; max-width: 580px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 5vw, 4.8rem); line-height: .94; letter-spacing: -.04em; }
.mission-copy { max-width: 540px; margin: 0 0 32px; color: #4e5650; font-size: 1.05rem; line-height: 1.65; }
.lesson-card { max-width: 550px; margin-bottom: 14px; padding: 16px 18px; border: 1px solid #b7c1b8; background: #f9fbf5; }
.lesson-card span { display: block; color: #647067; }
.lesson-card code { display: block; margin-top: 8px; color: #305c19; font: 750 .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.lesson-card p { margin: 6px 0 0; color: #4f5952; line-height: 1.45; }
.objective { max-width: 550px; padding: 18px 20px; border-left: 3px solid var(--ink); background: #eaeee6; }
.objective p { margin: 6px 0 0; font-weight: 650; line-height: 1.45; }
.objective-steps { margin: 14px 0 0; padding-left: 1.4rem; line-height: 1.5; }
.objective-steps li + li { margin-top: 8px; }
.case-notebook { max-width: 550px; margin-top: 24px; padding: 18px; border: 1px solid #b7c1b8; background: #f9fbf5; }
.case-notebook h2 { font-size: 1.05rem; margin: 0 0 10px; }
.case-notebook p, .case-notebook li { font-size: .9rem; line-height: 1.5; color: #4f5952; }
.case-notebook ol { padding-left: 1.3rem; margin-bottom: 0; }
.case-notebook li + li { margin-top: 8px; }
.case-notebook h3 { font-size: .82rem; margin: 18px 0 8px; }
.case-guide summary { cursor: pointer; font-weight: 700; }
.case-guide dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 12px 0; font-size: .85rem; }
.case-guide dt { font-family: ui-monospace, monospace; font-weight: 700; }
.case-guide dd { margin: 0; color: #4f5952; }
.case-source { display: block; font-size: .78rem; color: #637267; overflow-wrap: anywhere; }
.command-card { width: 100%; max-width: 550px; margin: 18px 0 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; text-align: left; padding: 16px 18px; color: #dfffd4; background: var(--ink); border: 0; border-radius: 3px; }
.command-card span { grid-column: 1 / -1; color: #87978d; }
.command-card code { font-size: 1rem; color: var(--green); }
.command-card b { font-size: .78rem; align-self: center; color: #fff; }
.level-feedback { max-width: 550px; margin: 12px 0 0; padding: 12px 16px; border-left: 3px solid #c98a12; background: #fbf3e2; color: #4a3a12; font-weight: 650; line-height: 1.45; }
.hints { max-width: 550px; }
.hint-button { width: 100%; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: #59625b; font-weight: 700; }
.hint-button:before { content: "+"; display: inline-block; width: 24px; color: #1a241e; }
.hint-button.open:before { content: "−"; }
.hint-text { display: none; margin: 0; padding: 12px 24px 14px; color: #59625b; line-height: 1.5; border-bottom: 1px solid var(--line); }
.hint-text.open { display: block; }
.terminal-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: clamp(20px, 3.2vw, 48px); background: #dfe4dc; }
.terminal-bar { min-height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: #dce7df; background: #0a1711; border-bottom: 1px solid var(--terminal-line); }
.terminal-title { display: flex; align-items: center; gap: 10px; font-size: .72rem; letter-spacing: .14em; font-weight: 800; }
.terminal-glyph { color: var(--green); font: 800 1rem ui-monospace, monospace; }
.terminal-tools { display: flex; align-items: center; gap: 8px; }
.terminal-tools button { color: #b8c4bc; background: transparent; border: 0; padding: 7px; font-size: .75rem; }
.terminal-tools .interrupt-button { border: 1px solid #466151; border-radius: 3px; color: #dce7df; }
.real-badge { color: var(--green); border: 1px solid #355940; padding: 5px 7px; font: 700 .64rem ui-monospace, monospace; letter-spacing: .08em; }
.terminal-stage { position: relative; flex: 1 1 auto; min-height: 0; padding: 24px; overflow: auto; overscroll-behavior: contain; color: #d8e4dc; background: var(--terminal); box-shadow: 0 20px 50px rgba(13,28,19,.16); }
.terminal-banner { margin: 0 0 14px; font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; overflow: hidden; }
.terminal-banner[hidden] { display: none; }
/* The art is 14 rows of 12px plus its 14px margin, so the prompt stays in view. */
.terminal-banner:not([hidden]) + #terminalOutput { min-height: calc(100% - 40px - 182px); }
#terminalOutput { margin: 0; min-height: calc(100% - 40px); white-space: pre-wrap; word-break: break-word; font: 15px/1.62 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #c7d5cb; }
.command-line { display: flex; align-items: center; gap: 8px; font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.prompt { flex: none; color: var(--green); }
#commandInput { min-width: 0; flex: 1; color: #fff; background: transparent; border: 0; outline: 0; caret-color: var(--green); font: inherit; }
.boot-overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 30px; text-align: center; background: var(--terminal); }
.boot-overlay.hidden { display: none; }
.boot-overlay strong { color: white; font-size: 1.1rem; }
.boot-overlay span { color: #8da095; font-size: .85rem; }
.loader { width: 44px; height: 44px; border: 2px solid #254032; border-top-color: var(--green); border-radius: 99px; animation: spin 1s linear infinite; }
.boot-track { width: min(280px, 80%); height: 3px; margin-top: 8px; background: #1c3126; overflow: hidden; }
.boot-track div { height: 100%; width: 10%; background: var(--green); transition: width .5s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.terminal-footer { display: flex; justify-content: space-between; padding: 13px 4px 0; color: #4f5751; font-size: .72rem; }
kbd { padding: 2px 5px; border: 1px solid #bdc6be; background: #eef0ea; border-radius: 3px; font: inherit; }
.level-dock { min-height: 82px; display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; border-top: 1px solid var(--line); background: #fafbf7; }
.dock-levels { min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.chapter-nav { border: 0; border-right: 1px solid var(--line); background: #f0f3ec; color: #384139; font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.chapter-nav:last-child { border-right: 0; border-left: 1px solid var(--line); }
.chapter-nav:disabled { cursor: not-allowed; color: #a6aca7; background: #f7f8f4; }
.level-button { min-width: 0; min-height: 41px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 3px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #5c635e; background: transparent; font-weight: 800; }
.level-button:first-child { border-left: 1px solid var(--line); }
.level-button .number { display: grid; place-items: center; width: 25px; height: 25px; flex: none; border: 1px solid #bdc3bd; border-radius: 99px; font-size: .72rem; }
.level-button .label { display: none; }
.level-button.current { color: var(--ink); background: #eef1e9; }
.level-button.current .number { color: var(--green); background: var(--ink); border-color: var(--ink); }
.level-button.complete .number { color: var(--ink); background: var(--green); border-color: var(--green); }
.level-button:disabled { cursor: not-allowed; opacity: .42; }
.success-card { max-width: 560px; padding-top: 30px; }
.success-burst { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 24px; border-radius: 99px; color: var(--ink); background: var(--green); font-size: 2rem; font-weight: 900; box-shadow: 0 0 0 12px rgba(184,255,62,.18); }
.success-kicker { color: #3b6312; }
.success-card h2 { margin: 6px 0 10px; font: 700 clamp(2rem,4vw,3.6rem)/1 Georgia, serif; letter-spacing: -.03em; }
.success-card p:not(.success-kicker) { color: #4f5852; line-height: 1.6; }
.primary-button { margin-top: 18px; padding: 15px 20px; border: 0; background: var(--ink); color: white; font-weight: 800; border-radius: 3px; }
dialog { width: min(780px, calc(100% - 32px)); padding: 40px; border: 0; border-radius: 4px; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(4,13,8,.72); }
.dialog-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; font-size: 1.7rem; }
dialog h2 { max-width: 620px; margin: 8px 0 28px; font: 700 2.4rem/1.05 Georgia, serif; }
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tier-grid article { padding: 22px; background: #edf0e8; border-top: 4px solid var(--ink); }
.tier-grid article:last-child { border-top-color: var(--green-deep); }
.tier-grid h3 { margin: 10px 0 7px; }
.tier-grid p, .architecture-note { color: #566058; line-height: 1.55; }
.architecture-note { margin: 22px 0 0; }
.module-dialog { width: min(920px, calc(100% - 32px)); }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.module-card { position: relative; display: flex; min-height: 300px; flex-direction: column; align-items: flex-start; padding: 26px; text-align: left; border: 1px solid #c7cec6; border-top: 5px solid var(--ink); border-radius: 3px; background: #f8faf5; }
.module-card.active { border-top-color: var(--green-deep); box-shadow: inset 0 0 0 2px rgba(99,215,25,.14); }
.module-card:hover, .module-card:focus-visible { border-color: #637166; outline: 3px solid rgba(99,215,25,.24); outline-offset: 2px; }
.module-card-kicker { color: #567249; font-size: .68rem; font-weight: 900; letter-spacing: .14em; }
.module-card h3 { margin: 18px 0 10px; font: 700 2rem/1 Georgia, serif; letter-spacing: -.025em; }
.module-card p { margin: 0 0 24px; color: #525d55; line-height: 1.55; }
.module-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.module-meta span { padding: 6px 8px; border-radius: 2px; color: #4f5952; background: #e9ede6; font: 750 .68rem ui-monospace, monospace; }
.module-progress { width: 100%; height: 5px; margin: 18px 0 10px; overflow: hidden; background: #dce2d9; }
.module-progress span { display: block; height: 100%; background: var(--green-deep); }
.module-progress-copy { color: #566058; font-size: .76rem; font-weight: 750; }
.dialog-intro { margin: -14px 0 24px; color: #566058; line-height: 1.55; }
.feedback-dialog { width: min(660px, calc(100% - 32px)); }
.feedback-dialog form { display: grid; gap: 18px; }
.feedback-dialog label, .qa-select-label { display: grid; gap: 8px; color: #303a34; font-size: .88rem; font-weight: 800; }
.feedback-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.feedback-types legend { grid-column: 1 / -1; margin-bottom: 8px; color: #303a34; font-size: .88rem; font-weight: 800; }
.feedback-types label { position: relative; display: flex; align-items: center; cursor: pointer; }
.feedback-types input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-types span { width: 100%; min-height: 44px; display: flex; align-items: center; padding: 10px 12px; border: 1px solid #bdc5bd; border-radius: 3px; background: #f8faf5; font-weight: 700; }
.feedback-types input:checked + span { color: var(--ink); border-color: var(--green-deep); background: #eaffc9; box-shadow: inset 0 0 0 1px var(--green-deep); }
.feedback-types input:focus-visible + span { outline: 3px solid rgba(99,215,25,.35); outline-offset: 2px; }
.feedback-dialog select, .feedback-dialog textarea, .validation-dialog select { width: 100%; padding: 12px 13px; color: var(--ink); background: #f8faf5; border: 1px solid #b9c1b9; border-radius: 3px; }
.feedback-dialog textarea { resize: vertical; min-height: 120px; line-height: 1.45; }
.feedback-dialog .check-row { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 10px; font-weight: 600; }
.feedback-dialog input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green-deep); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dialog-actions .primary-button { margin-top: 0; }
.secondary-button { padding: 14px 18px; border: 1px solid #aeb7af; border-radius: 3px; color: #28342c; background: #f7f9f4; font-weight: 800; }
.secondary-button:disabled { cursor: not-allowed; opacity: .45; }
.form-status { min-height: 1.4em; margin: 0; color: #3d6142; font-weight: 700; }
.validation-dialog { width: min(820px, calc(100% - 32px)); }
.qa-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 22px; }
.qa-summary span { padding: 6px 9px; background: #edf0e8; border-radius: 3px; color: #49534c; font: 700 .76rem ui-monospace, monospace; }
.qa-select-label { margin-bottom: 8px; }
.qa-level-grid { display: grid; grid-template-columns: repeat(10, minmax(38px, 1fr)); gap: 6px; max-height: 188px; padding: 8px; overflow-y: auto; border: 1px solid #bdc5bd; background: #f5f7f1; }
.qa-level-button { min-height: 40px; padding: 4px; border: 1px solid #c2c9c2; border-radius: 3px; color: #384139; background: #fff; font: 800 .78rem ui-monospace, monospace; }
.qa-level-button:hover, .qa-level-button:focus-visible { border-color: #4b6151; outline: 2px solid rgba(99,215,25,.35); outline-offset: 1px; }
.qa-level-button.complete { background: #eaffc9; border-color: #a6d85a; }
.qa-level-button.current { color: var(--green); background: var(--ink); border-color: var(--ink); }
.qa-help { margin: 8px 0 0; color: #667069; font-size: .82rem; line-height: 1.45; }
.qa-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.qa-detail article { min-width: 0; padding: 14px; border: 1px solid var(--line); background: #f8faf5; }
.qa-detail span { display: block; margin-bottom: 7px; color: #6c756e; font-size: .68rem; font-weight: 850; letter-spacing: .12em; }
.qa-detail code, .qa-detail p { margin: 0; overflow-wrap: anywhere; font: 700 .82rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.qa-detail .wide { grid-column: 1 / -1; }
.qa-actions { margin-top: 8px; }
.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; }
@media (max-width: 860px) {
  body { height: auto; min-height: 100vh; min-height: 100dvh; overflow: auto; }
  .topbar { padding: 0 18px; }
  .vm-chip { display: none; }
  .top-actions { gap: 8px; }
  .shell { height: auto; min-height: 0; grid-template-columns: 1fr; overflow: visible; }
  .mission-panel { height: auto; max-height: none; border-right: 0; padding-bottom: 38px; overflow: visible; }
  .terminal-panel { min-height: 620px; overflow: visible; }
  .terminal-stage { min-height: 450px; }
  .level-dock { position: sticky; bottom: 0; z-index: 5; }
}
@media (max-width: 520px) {
  .brand { font-size: .74rem; }
  .brand-logo { height: 38px; }
  .ghost-button { font-size: .74rem; }
  #architectureButton { display: none; }
  .mission-panel { padding: 28px 20px; }
  .terminal-panel { padding: 0; }
  .terminal-stage { min-height: 450px; }
  .real-badge { display: none; }
  .terminal-footer { padding: 12px 16px; }
  .terminal-footer span:last-child { display: none; }
  .level-dock { grid-template-columns: 58px minmax(0, 1fr) 58px; }
  .chapter-nav { font-size: .62rem; }
  .tier-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .qa-detail { grid-template-columns: 1fr; }
  .qa-detail .wide { grid-column: auto; }
  .qa-level-grid { grid-template-columns: repeat(5, minmax(38px, 1fr)); }
  .feedback-types { grid-template-columns: 1fr; }
  dialog { padding: 30px 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
