:root {
  color-scheme: light;
  --ink: #19202c;
  --muted: #515e6b;
  --line: #cbd1d4;
  --paper: #f5f6f3;
  --lime: #beee7d;
  --mono:
    ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font:
    100%/1.5 Arial,
    Helvetica,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
  text-underline-offset: 0.22em;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #236cd6;
  outline-offset: 3px;
}
button {
  border: 0;
}
h1,
h2,
h3,
p,
pre {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.08;
  letter-spacing: -0.048em;
}
p {
  color: var(--muted);
}
.frame {
  width: min(100% - 4rem, 78rem);
  margin-inline: auto;
}
.top {
  background: #181e29;
  color: #fafbf8;
  border-bottom: 3px solid var(--lime);
}
.bar {
  height: 4.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 1.45rem;
  letter-spacing: -0.065em;
}
.brand strong {
  font-weight: 900;
}
.brand > span:last-child {
  color: #d2e0e0;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--lime);
  color: var(--ink);
  width: 2.15rem;
  height: 2rem;
  border-radius: 0.4rem;
  font: 900 1.6rem/1 var(--mono);
  margin-right: 0.35rem;
}
.library {
  font-size: 0.92rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
}
.library span {
  color: var(--lime);
}
.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin: 2.5rem 0 1.8rem;
}
.eyebrow,
.subject,
.hardware,
.mission small,
.hud,
.case-status {
  font: 700 0.77rem/1.35 var(--mono);
  letter-spacing: 0.065em;
  text-transform: uppercase;
}
.subject {
  color: #47545d;
  display: flex;
  gap: 0.62rem;
  align-items: center;
  flex-wrap: wrap;
}
.square {
  width: 0.58rem;
  height: 0.58rem;
  background: #4c6b33;
}
.sep {
  color: #839181;
}
.intro h1 {
  font-size: clamp(3.6rem, 6.3vw, 6.2rem);
  font-weight: 830;
  letter-spacing: -0.083em;
  margin: 0.42rem 0 0.55rem;
  line-height: 0.96;
}
.intro h1 span {
  color: #64853d;
}
.intro p {
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}
.progress-box {
  min-width: 11.5rem;
  padding: 0 0.2rem 0.25rem;
}
.progress-box .eyebrow {
  color: var(--muted);
}
.progress-box strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
  margin: 0.18rem 0 0.45rem;
}
#progress-bars {
  display: flex;
  gap: 0.28rem;
}
#progress-bars i {
  width: 2.8rem;
  height: 0.34rem;
  background: #d1d7cd;
}
#progress-bars i.lit {
  background: #568336;
}
.missions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.35rem;
}
.mission {
  --patch: #c3f28b;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  padding: 0.8rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  min-height: 4.7rem;
}
.mission.branch {
  --patch: #cec8fb;
}
.mission.repeat {
  --patch: #ffd3a4;
}
.mission:hover {
  border-color: #6e797c;
}
.mission[aria-pressed="true"] {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.mission small {
  display: block;
  color: #59646c;
  font-size: 0.73rem;
}
.mission[aria-pressed="true"] small {
  color: #c7d2d6;
}
.mission strong {
  display: block;
  font-size: 1.13rem;
  letter-spacing: -0.035em;
  margin: 0.13rem 0 0;
}
.patch {
  width: 2.65rem;
  height: 2.65rem;
  display: grid;
  place-content: center;
  background: var(--patch);
  border-radius: 0.38rem;
  flex-shrink: 0;
}
.pixel-icon {
  display: grid;
  grid-template-columns: repeat(7, 3px);
  grid-auto-rows: 3px;
}
.pixel-icon .on {
  background: #283033;
}
.marker {
  margin-left: auto;
  font-size: 0.85rem;
  color: #7d888b;
}
.mission[aria-pressed="true"] .marker {
  color: var(--patch);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.99fr) minmax(16rem, 0.91fr);
  gap: 1.1rem;
  align-items: start;
  scroll-margin: 1rem;
}
.console,
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.console {
  overflow: hidden;
}
.console-bar {
  background: #252c39;
  color: #e0e8ec;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.4rem;
}
.console-bar .eyebrow,
.hardware {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.led {
  background: var(--lime);
  width: 0.54rem;
  height: 0.54rem;
  border-radius: 50%;
}
.hardware {
  font-size: 0.72rem;
  color: #c1c9ce;
  gap: 0.22rem;
}
.hardware i {
  width: 2px;
  height: 0.66rem;
  background: #7e8995;
  transform: skew(-16deg);
}
.hardware i:first-child {
  margin-left: 0.3rem;
}
.panel-head {
  padding: 1.35rem 1.5rem 1rem;
}
.panel-head > .eyebrow {
  color: #596773;
}
.panel-head h2 {
  font-size: clamp(2rem, 3.1vw, 2.8rem);
  margin: 0.32rem 0 0.03rem;
}
.panel-head p {
  margin: 0.6rem 0 0;
  max-width: 66ch;
}
.screen {
  position: relative;
  margin: 0 1.45rem;
  border: 3px solid #202735;
  border-radius: 0.4rem;
  background: #202735;
  overflow: hidden;
}
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d2f6d1;
  background: #202735;
  padding: 0.36rem 0.7rem;
  font-size: 0.72rem;
}
.hud b {
  display: inline-block;
  background: #b4f685;
  width: 0.43rem;
  height: 0.43rem;
  margin-right: 0.35rem;
}
.screen canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.panel-pad {
  padding: 1.15rem 1.5rem 1.25rem;
  min-width: 0;
}
.action-row,
.test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.action-row .eyebrow {
  color: #53606b;
}
.action-row h3,
.test-head h3,
.trace-card h3 {
  font-size: 1.4rem;
  margin: 0.22rem 0;
}
.buttons {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.primary,
.secondary {
  border-radius: 0.42rem;
  min-height: 2.8rem;
  padding: 0.55rem 1rem;
  font-weight: 730;
  line-height: 1.25;
}
.primary {
  background: var(--lime);
  border: 1px solid #8db853;
  color: #17251a;
}
.primary:hover {
  background: #afde71;
}
.secondary {
  border: 1px solid #b7c0c6;
  background: #fff;
}
.secondary:hover {
  background: #f0f2ef;
}
.secondary:disabled {
  opacity: 0.48;
}
.divider {
  height: 1px;
  background: #dce0de;
  margin: 1rem 0;
}
.panel-pad > .eyebrow,
.brief .eyebrow {
  color: #4d5b63;
}
.log {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0;
  list-style: none;
  margin: 0.65rem 0 0;
}
.log li {
  min-width: 0;
  border: 1px solid #d5dada;
  border-radius: 0.32rem;
  background: #f7f8f5;
  padding: 0.48rem 0.52rem;
}
.log li.current {
  border-color: #709b44;
  background: #f0f8e7;
}
.log small,
.log span {
  display: block;
  font: 0.75rem/1.45 var(--mono);
  color: #56636a;
}
.log strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
  margin: 0.19rem 0;
  overflow-wrap: anywhere;
}
.text-btn,
.tools-row button {
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  background: transparent;
  min-height: 2.75rem;
  padding: 0.45rem 0.1rem;
}
.text-btn {
  margin: 0.4rem 0 -0.5rem;
}
.brief,
.code-card {
  padding: 1.3rem 1.42rem;
}
.brief h2 {
  font-size: 1.65rem;
  margin: 0.65rem 0 0.5rem;
}
.brief p {
  line-height: 1.5;
}
.tiny-icon {
  color: #52684c;
  margin-right: 0.36rem;
}
.brief #steps {
  display: grid;
  gap: 0.15rem;
  margin: 0.52rem 0 -0.4rem;
}
.brief #steps button {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  text-align: left;
  font-weight: 650;
  min-height: 2.55rem;
  border-radius: 0.3rem;
  background: none;
  padding: 0.24rem 0.5rem;
}
.brief #steps button span {
  font: 0.79rem var(--mono);
  color: #596975;
}
.brief #steps button[aria-current] {
  background: #edf4e7;
}
.brief #steps button[aria-current] span {
  color: #45642f;
}
.brief #steps button:disabled {
  color: #6a747e;
  font-weight: 400;
}
.code-card {
  margin-top: 1rem;
  border-radius: 0.7rem;
  background: #252d3b;
  color: #deeced;
}
.code-card .eyebrow {
  color: #bbc8d1;
}
.code-card .eyebrow span {
  color: var(--lime);
}
pre {
  font: 0.94rem/1.65 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.code-card pre {
  color: #c7f59e;
  margin: 0.7rem 0 0.45rem;
}
.code-card small {
  color: #c0c9cf;
}
.tools-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.75rem 0 1.5rem;
}
.tools-row button {
  color: #505c67;
  font-size: 0.88rem;
}
footer {
  border-top: 1px solid var(--line);
  padding: 1.3rem 0;
  color: #56616b;
}
footer .frame {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.87rem;
}
.sr,
.skip:not(:focus) {
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip:focus {
  position: absolute;
  z-index: 2;
  background: #fff;
  padding: 1rem;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
label {
  display: block;
  font-weight: 680;
  font-size: 0.95rem;
}
select,
input {
  background: #fff;
  border: 1px solid #9ca8b1;
  border-radius: 0.35rem;
  padding: 0.6rem;
  min-height: 2.8rem;
}
select {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0;
}
input {
  width: 7rem;
}
#predict-form {
  margin-top: 1.4rem;
}
#predict-form .buttons {
  margin-top: 0.4rem;
}
.trace-card,
.editor-code {
  background: #edf3ed;
  border: 1px solid #c9d7c8;
  border-radius: 0.5rem;
  padding: 1rem;
}
.trace-card p {
  margin: 0.5rem 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 1rem 0 0;
}
.metrics small,
.metrics strong {
  display: block;
}
.metrics small {
  font-size: 0.78rem;
  color: #4a5961;
}
.metrics strong {
  font: 700 1.55rem var(--mono);
}
.controls {
  margin: 0.85rem 0;
}
.notice {
  padding: 0.8rem 1rem;
  border-radius: 0.4rem;
  margin-top: 1rem;
  font-size: 0.97rem;
}
.notice.good {
  background: #ebf6df;
  color: #2e561a;
}
.notice.bad {
  background: #fff0dc;
  color: #723e10;
}
.editor-code {
  margin: 0.8rem 0 1.3rem;
}
.test-head {
  margin: 1rem 0 0.5rem;
}
.test-case {
  padding: 0.7rem 0.1rem;
  border-bottom: 1px solid #dce1df;
}
.case-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.case-status {
  color: #5a636c;
  background: #eff1ef;
  border-radius: 0.3rem;
  padding: 0.22rem 0.45rem;
  font-size: 0.71rem;
}
.case-status.ok {
  background: #e4f4cf;
  color: #2f601b;
}
.case-status.fail {
  background: #fce3d6;
  color: #8e371b;
}
.test-case p,
.muted {
  font-size: 0.93rem;
  margin: 0.25rem 0;
}
.test-case .feedback {
  color: #243b44;
  font-weight: 650;
}
details summary {
  font-size: 0.89rem;
  font-weight: 600;
  text-decoration: underline;
  padding: 0.45rem 0;
}
details pre {
  font-size: 0.85rem;
}
.body {
  max-width: 65rem;
  margin: 3rem auto;
  padding: 0 1.4rem;
}
.body h2 {
  margin-bottom: 1rem;
}
dialog {
  border: 1px solid #acb7bb;
  border-radius: 0.7rem;
  width: min(32rem, calc(100% - 2rem));
  padding: 1.5rem;
  color: var(--ink);
  max-height: 85dvh;
}
dialog::backdrop {
  background: #11182793;
}
dialog h2 {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
}
dialog h3 {
  font-size: 1.12rem;
  margin: 1rem 0 0.4rem;
}
dialog p {
  margin: 0.5rem 0 0.8rem;
}
dialog form {
  margin-top: 0.7rem;
}
#storage-alert:not(:empty) {
  color: #71380f;
  background: #fff2d8;
  padding: 0.8rem;
  margin-bottom: 1rem;
}
@media (max-width: 850px) {
  .frame {
    width: min(100% - 2.2rem, 65rem);
  }
  .workspace {
    grid-template-columns: minmax(0, 1.62fr) minmax(14rem, 1fr);
  }
  .mission {
    gap: 0.6rem;
    padding: 0.7rem;
  }
  .mission strong {
    font-size: 1.02rem;
  }
  .action-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .brief,
  .code-card,
  .panel-pad {
    padding: 1.05rem;
  }
  .panel-head {
    padding: 1.15rem 1.05rem 0.9rem;
  }
  .screen {
    margin: 0 1rem;
  }
  .intro {
    margin: 1.8rem 0 1.3rem;
  }
  .log {
    gap: 0.28rem;
  }
  .log li {
    padding: 0.4rem;
  }
}
@media (max-width: 665px) {
  .frame {
    width: calc(100% - 1.75rem);
  }
  .bar {
    height: 3.65rem;
  }
  .brand {
    font-size: 1.23rem;
  }
  .intro {
    display: block;
    margin: 1.6rem 0 1rem;
  }
  .intro h1 {
    font-size: clamp(3.5rem, 13vw, 5rem);
    margin: 0.4rem 0 0.5rem;
  }
  .intro p {
    max-width: 34rem;
  }
  .progress-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0 0;
    min-width: 0;
    padding: 0;
  }
  .progress-box .eyebrow {
    font-size: 0.67rem;
  }
  .progress-box strong {
    font-size: 0.88rem;
    margin: 0;
  }
  #progress-bars i {
    width: 0.9rem;
  }
  .missions {
    gap: 0.35rem;
    margin-bottom: 0.8rem;
  }
  .mission {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.45rem;
    padding: 0.6rem 0.45rem;
    border-radius: 0.5rem;
  }
  .mission .marker {
    position: absolute;
    right: 0.45rem;
    top: 0.55rem;
  }
  .mission small {
    font-size: 0.63rem;
  }
  .mission strong {
    font-size: 0.9rem;
    line-height: 1.15;
  }
  .patch {
    width: 1.75rem;
    height: 1.75rem;
  }
  .pixel-icon {
    grid-template-columns: repeat(7, 2px);
    grid-auto-rows: 2px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .workspace > * {
    width: 100%;
  }
  .console-bar {
    padding: 0.55rem 1rem;
  }
  .hud {
    font-size: 0.64rem;
  }
  .panel-head h2 {
    font-size: 2rem;
  }
  .console .panel-pad {
    padding: 1rem;
  }
  .subject {
    font-size: 0.69rem;
    gap: 0.45rem;
  }
  .log {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
  }
  .log li {
    display: grid;
    grid-template-columns: 1.5rem 1fr auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.6rem;
  }
  .log strong {
    margin: 0;
  }
  .action-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
  }
  .test-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .code-card {
    margin-top: 0.7rem;
  }
  .tools-row {
    margin: 0.3rem 0 0.8rem;
  }
  .tools-row button {
    font-size: 0.82rem;
  }
  footer .frame {
    flex-wrap: wrap;
  }
  .metrics {
    gap: 0.2rem;
  }
  .case-heading {
    flex-wrap: wrap;
  }
  .panel-head p,
  .brief p {
    font-size: 1rem;
  }
}
.flight-brief {
  display: none;
}
.prediction-rule {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-radius: 0.45rem;
  background: #eef3ed;
}
.prediction-rule pre {
  margin-top: 0.35rem;
}
@media (max-width: 665px) {
  .flight-brief {
    display: block;
    margin: 0 1rem 0.8rem;
  }
}
.tools-row {
  flex-wrap: wrap;
}
.notebook-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  border-radius: 0.55rem;
  border: 1px solid #c4d5c0;
  background: #f0f5ec;
  padding: 1rem;
}
.notebook-banner div {
  flex: 1 1 17rem;
}
.notebook-banner h3 {
  margin: 0.35rem 0;
  font-size: 1.4rem;
}
.notebook-banner small {
  flex-basis: 100%;
  color: var(--muted);
}
.flight-code {
  margin: 0.5rem 0;
}
.flight-code strong {
  font-family: var(--mono);
}
.flight-code button {
  margin: 0;
  min-height: 2rem;
}
.notebook-tabs {
  margin: 1rem 0;
}
.notebook-tabs [aria-pressed="true"] {
  background: var(--ink);
  color: white;
}
.author-step {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.7rem;
  min-width: 0;
}
.author-step + .author-step {
  margin-top: 0.65rem;
}
.author-step legend {
  font-weight: bold;
  padding: 0 0.3rem;
}
.author-step select,
.author-step input {
  width: 100%;
  display: block;
  margin: 0.3rem 0 0;
}
.remove-step {
  min-height: 2.8rem;
  background: transparent;
  text-decoration: underline;
}
.remove-step:disabled {
  color: #767676;
}
.scores {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 1rem 0;
}
.scores th,
.scores td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.28rem;
  text-align: right;
}
.scores th:first-child {
  text-align: left;
}
.scores thead {
  background: #edf3ed;
}
.scores td {
  font-family: var(--mono);
}
dialog:has(#author-form),
dialog:has(.scores) {
  width: min(42rem, calc(100% - 1rem));
}
#replay-code {
  width: 9rem;
}
#replay-error {
  color: #833b16;
}
.test-evidence {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
@media (max-width: 560px) {
  .author-step {
    grid-template-columns: 1fr 1fr;
  }
  .tools-row {
    gap: 0.2rem 0.8rem;
    justify-content: flex-start;
  }
  .scores {
    font-size: 0.78rem;
  }
  .scores th,
  .scores td {
    padding: 0.38rem 0.15rem;
  }
  dialog:has(.scores) {
    padding: 1rem 0.7rem;
  }
  .author-step select {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  dialog:has(.scores),
  dialog:has(#author-form) {
    max-width: calc(100% - 0.75rem);
  }
  .scores th {
    overflow-wrap: anywhere;
  }
}
.pack{display:flex;align-items:center;gap:.8rem;margin:0 0 .8rem;flex-wrap:wrap}.pack select{width:auto;max-width:100%;margin:0}.progress-box{max-width:15rem}#progress-bars i{min-width:0;flex:1}
