:root {
  --navy: #071b33;
  --navy-2: #0d2b50;
  --blue: #1261a6;
  --blue-light: #e9f3fc;
  --cyan: #20a4b8;
  --gold: #d6a720;
  --ink: #14243a;
  --muted: #62738a;
  --line: #dce5ef;
  --paper: #f4f7fb;
  --white: #fff;
  --green: #15815d;
  --red: #c74646;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 10% -10%, #e2f0ff 0, transparent 33rem), var(--paper); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
.topbar { height: 72px; padding: 0 clamp(20px, 4vw, 64px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; color: #fff; background: var(--navy); border-bottom: 3px solid var(--gold); }
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; color: #fff; text-decoration: none; }
.brand span { padding: 5px 8px; color: var(--navy); background: var(--gold); border-radius: 4px; font-size: 19px; font-weight: 900; letter-spacing: -.04em; }
.brand strong { font-size: 14px; letter-spacing: .03em; }
.task-context { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.task-context span { color: #b8cee6; }
.task-context b { padding: 7px 10px; border: 1px solid #3b5878; border-radius: 999px; font-size: 12px; }
.catalogue-link { justify-self: end; color: #d9e6f3; font-size: 13px; font-weight: 700; text-decoration: none; }
.catalogue-link:hover, .brand:hover { color: #fff; }
.app-shell { width: min(1440px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 58px); }
.screen { display: none; animation: appear .24s ease both; }
.screen.active { display: grid; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.start-screen { min-height: calc(100vh - 188px); grid-template-columns: minmax(0, 1fr) 330px; align-items: center; gap: clamp(38px, 8vw, 110px); max-width: 1160px; margin: auto; }
.start-copy { max-width: 730px; }
.start-copy h1 { max-width: 690px; margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: clamp(42px, 6vw, 78px); line-height: .99; letter-spacing: -.045em; }
.scenario { max-width: 690px; margin: 26px 0; color: #42566f; font-size: clamp(17px, 2vw, 21px); line-height: 1.65; }
.alignment { display: flex; gap: 13px; max-width: 680px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 8px; box-shadow: 0 8px 30px rgba(7, 27, 51, .05); }
.alignment > span { color: var(--cyan); font-size: 24px; }
.alignment p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.alignment strong { display: block; margin-bottom: 3px; color: var(--ink); }
.name-field { display: block; max-width: 560px; margin: 26px 0 17px; }
.name-field > span { display: block; margin-bottom: 8px; color: #3d5068; font-size: 13px; font-weight: 750; }
.name-field input { width: 100%; padding: 14px 15px; color: var(--ink); background: #fff; border: 1px solid #b9c8d9; border-radius: 7px; outline: none; box-shadow: 0 3px 8px rgba(7, 27, 51, .03); }
.name-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18, 97, 166, .13); }
.name-field small { display: block; min-height: 17px; margin-top: 5px; color: var(--red); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 18px; border: 1px solid transparent; border-radius: 6px; font-weight: 800; font-size: 13px; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 9px 22px rgba(18, 97, 166, .19); }
.button.primary:hover { background: #0b508f; box-shadow: 0 12px 26px rgba(18, 97, 166, .25); }
.button.secondary { color: var(--navy); background: #fff; border-color: #c7d4e2; }
.button.large { min-height: 50px; padding: 13px 22px; }
.button:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(32, 164, 184, .45); outline-offset: 3px; }
.task-brief { padding: 28px; color: #fff; background: linear-gradient(145deg, var(--navy), #103b68); border-radius: 10px; box-shadow: 0 24px 55px rgba(7, 27, 51, .22); }
.task-brief > p:first-child { margin: 0 0 20px; color: #9fbedc; font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.task-brief > div { display: flex; align-items: baseline; justify-content: space-between; padding: 17px 0; border-bottom: 1px solid rgba(255,255,255,.13); }
.task-brief strong { font-family: Georgia, serif; font-size: 32px; }
.task-brief span { color: #c2d4e6; font-size: 12px; }
.task-brief hr { margin: 24px 0 18px; border: 0; border-top: 2px solid var(--gold); }
.task-brief .brief-note { margin: 0; color: #bed0e2; font-size: 12px; line-height: 1.65; }
.lab-screen { gap: 24px; }
.lab-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.lab-head h1 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: clamp(31px, 4vw, 52px); letter-spacing: -.035em; }
.score-cluster { width: 180px; }
.score-cluster > span { display: block; margin-bottom: 8px; color: var(--muted); text-align: right; font-size: 14px; }
.score-cluster b { color: var(--navy); font-size: 27px; }
.score-track { height: 7px; overflow: hidden; background: #d5e0eb; border-radius: 99px; }
.score-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .3s ease; }
.workspace { min-height: 650px; display: grid; grid-template-columns: minmax(290px, 370px) minmax(0, 1fr); overflow: hidden; background: #fff; border: 1px solid #d7e1ec; border-radius: 10px; box-shadow: 0 16px 48px rgba(7, 27, 51, .1); }
.mission-panel { display: flex; flex-direction: column; padding: 25px; background: #f9fbfd; border-right: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; justify-content: space-between; color: var(--navy); font-size: 13px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.panel-title button, .terminal-bar button { padding: 5px 9px; color: var(--blue); background: #fff; border: 1px solid #cbd9e7; border-radius: 5px; font-size: 11px; font-weight: 800; }
.mission-scenario { margin: 18px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.mission-panel ol { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.objective { display: grid; grid-template-columns: 25px 1fr auto; gap: 11px; padding: 13px 11px; background: #fff; border: 1px solid var(--line); border-radius: 7px; transition: border-color .2s, background .2s; }
.objective-check { width: 22px; height: 22px; display: grid; place-items: center; color: transparent; background: #edf2f7; border: 1px solid #cfdae6; border-radius: 50%; font-size: 12px; font-weight: 900; }
.objective strong { display: block; color: #263b54; font-size: 12px; line-height: 1.35; }
.objective p { margin: 4px 0 0; color: #758399; font-size: 11px; line-height: 1.4; }
.objective b { color: #7890a9; font-size: 11px; }
.objective.complete { background: #f1fbf7; border-color: #a9dcca; }
.objective.complete .objective-check { color: #fff; background: var(--green); border-color: var(--green); }
.objective.complete b { color: var(--green); }
.mission-actions { display: grid; gap: 8px; margin-top: auto; padding-top: 22px; }
.text-button { padding: 7px; color: #6e7d90; background: transparent; border: 0; font-size: 12px; font-weight: 700; }
.text-button:hover { color: var(--red); }
.terminal-card { min-width: 0; display: grid; grid-template-rows: 47px minmax(480px, 1fr) 51px 36px; color: #c8d8e9; background: #071523; }
.terminal-bar { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 16px; padding: 0 16px; color: #91a8be; background: #0c2034; border-bottom: 1px solid #1e374e; font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.terminal-bar button { color: #adc1d5; background: #102a41; border-color: #29465e; }
.lights { display: flex; gap: 7px; }
.lights i { width: 9px; height: 9px; background: #dd6671; border-radius: 50%; }
.lights i:nth-child(2) { background: #d8ad42; }.lights i:nth-child(3) { background: #55b88a; }
.terminal-output { overflow: auto; padding: 20px 22px; scrollbar-color: #36526c #071523; }
.terminal-line { margin: 0 0 13px; white-space: pre-wrap; overflow-wrap: anywhere; color: #c2d1e1; font: 13px/1.58 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.terminal-line.command { margin-bottom: 4px; color: #78d5bf; }
.terminal-line.success { color: #8ce1bc; }.terminal-line.error { color: #ff9a9a; }.terminal-line.system { color: #9bc6ed; }
.command-line { display: flex; align-items: center; gap: 9px; padding: 0 22px; background: #091a2a; border-top: 1px solid #1b344a; }
.command-line label { flex: 0 0 auto; color: #72d5b8; font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.command-line input { min-width: 0; flex: 1; color: #f5f8fc; background: transparent; border: 0; outline: 0; font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.terminal-foot { display: flex; justify-content: space-between; padding: 9px 22px; color: #6f8aa3; background: #06121f; font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
kbd, code { padding: 2px 5px; color: #20517e; background: #e9f1f8; border-radius: 3px; font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.result-screen { grid-template-columns: minmax(300px, 430px) minmax(0, 1fr); align-items: start; gap: 30px; max-width: 1260px; margin: 0 auto; }
.result-summary, .certificate-panel { padding: clamp(24px, 4vw, 40px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 45px rgba(7, 27, 51, .09); }
.result-summary h1, .certificate-panel h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 38px; }
.result-summary > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.score-ring { width: 132px; height: 132px; display: grid; grid-template-columns: auto auto; place-content: center; align-items: baseline; margin: 28px auto; color: var(--blue); background: #eef6fd; border: 7px solid #c9e2f7; border-radius: 50%; }
.score-ring strong { font: 800 42px Georgia, serif; }.score-ring span { color: var(--muted); font-size: 14px; }
.result-objectives { display: grid; gap: 8px; }
.result-row { display: flex; gap: 11px; padding: 11px 13px; color: #7d8999; background: #f7f9fb; border-radius: 6px; }
.result-row > span { font-weight: 900; }.result-row p { flex: 1; margin: 0; }.result-row strong { display: block; color: #4d6075; font-size: 12px; }.result-row small { font-size: 10px; }
.result-row.complete { color: var(--green); background: #f0faf6; }.result-row.complete strong { color: #236b53; }
.result-buttons { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.certificate-panel { min-width: 0; }
.certificate-panel[hidden] { display: none; }
.certificate-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.certificate-head > span { padding: 7px 10px; color: #725700; background: #fff7d8; border: 1px solid #ead88a; border-radius: 99px; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.certificate-panel canvas { display: block; width: 100%; height: auto; background: #fff; border: 1px solid #d8e0e8; box-shadow: 0 8px 26px rgba(7, 27, 51, .08); }
.certificate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.certificate-panel > p { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
dialog { color: var(--ink); border: 0; border-radius: 10px; box-shadow: 0 28px 80px rgba(3, 18, 35, .35); }
dialog::backdrop { background: rgba(4, 17, 32, .68); backdrop-filter: blur(3px); }
.guide-dialog { width: min(670px, calc(100% - 30px)); max-height: 86vh; padding: 34px; }
.dialog-close { position: absolute; top: 13px; right: 15px; width: 34px; height: 34px; color: #68788c; background: #f2f5f8; border: 0; border-radius: 50%; font-size: 22px; }
.guide-dialog h2 { margin: 0 0 12px; color: var(--navy); font-family: Georgia, serif; font-size: 33px; }.guide-dialog h3 { margin-top: 26px; color: var(--navy); font-size: 15px; }.guide-dialog p, .guide-dialog li { color: #596a80; font-size: 13px; line-height: 1.65; }.guide-dialog li { margin-bottom: 9px; }
.guide-links { display: flex; flex-wrap: wrap; gap: 9px; }.guide-links a { padding: 9px 12px; color: var(--blue); background: var(--blue-light); border-radius: 5px; font-weight: 750; text-decoration: none; }
.editor-dialog { width: min(860px, calc(100% - 26px)); padding: 0; overflow: hidden; background: #071523; }
.editor-bar { height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; color: #b3c7d9; background: #0d2438; font: 12px ui-monospace, monospace; }
.editor-bar button { color: #b8cce0; background: transparent; border: 0; font-size: 24px; }
.editor-dialog textarea { display: block; width: 100%; min-height: min(55vh, 480px); resize: vertical; padding: 20px; color: #e0ebf4; background: #071523; border: 0; outline: 0; tab-size: 2; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.editor-actions { display: flex; align-items: center; justify-content: end; gap: 9px; padding: 13px 15px; background: #0a1e30; border-top: 1px solid #1f394f; }
.editor-actions > span { margin-right: auto; color: #75d2ba; font: 10px ui-monospace, monospace; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 340px; padding: 13px 17px; color: #fff; background: #133b61; border-left: 4px solid var(--gold); border-radius: 5px; box-shadow: 0 14px 35px rgba(7, 27, 51, .28); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translateY(0); }
noscript { display: block; padding: 20px; color: #fff; background: #7f1d1d; text-align: center; }
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }.task-context { display: none; }
  .start-screen, .result-screen { grid-template-columns: 1fr; }.task-brief { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.task-brief > p:first-child, .task-brief hr, .task-brief .brief-note { grid-column: 1 / -1; }.task-brief > div { display: block; border: 0; }.task-brief span { display: block; margin-top: 3px; }
  .workspace { grid-template-columns: 1fr; }.mission-panel { border-right: 0; border-bottom: 1px solid var(--line); }.mission-actions { margin-top: 10px; }.terminal-card { grid-template-rows: 47px minmax(420px, 56vh) 51px 36px; }
}
@media (max-width: 590px) {
  .topbar { height: 62px; padding: 0 16px; }.brand strong { display: none; }.app-shell { padding: 24px 14px; }
  .start-screen { min-height: auto; }.start-copy h1 { font-size: 43px; }.scenario { font-size: 17px; }.task-brief { grid-template-columns: 1fr 1fr; padding: 20px; }.task-brief > div:last-of-type { grid-column: 1 / -1; }
  .lab-head { align-items: start; }.lab-head h1 { font-size: 31px; }.score-cluster { width: 105px; flex: 0 0 auto; }
  .workspace { margin-inline: -5px; }.mission-panel { padding: 18px 15px; }.terminal-output, .command-line { padding-inline: 14px; }.terminal-bar { grid-template-columns: 64px 1fr auto; padding-inline: 10px; }.terminal-bar > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }.terminal-foot span:first-child { display: none; }.terminal-foot { justify-content: end; padding-inline: 14px; }
  .result-summary, .certificate-panel { padding: 22px 17px; }.result-summary h1, .certificate-panel h2 { font-size: 30px; }.certificate-head { align-items: start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
