/* Foundation: reset, semantic structure, editor overlay, animation primitives. Feature visuals live in the sheets below. */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button[hidden],[hidden] {
  display: none !important;
}
header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand small {
  display: block;
  margin-top: 6px;
}
.chapter b {
  display: block;
  font-weight: 500;
}
.runtime {
  margin-left: auto;
}
main {
  margin: auto;
}
nav {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.layout {
  display: grid;
}
.mission-head {
  display: flex;
  justify-content: space-between;
}
.eyebrow {
  margin: 0 0 10px;
}
h1 {
  margin: 0;
}
h2 {
  font-weight: 600;
  margin: 0;
}
.sector {
  text-align: right;
  line-height: 1.7;
}
.sector b {
  font-weight: 400;
  color: #94a7ab;
}
.scene svg {
  display: block;
  width: 100%;
  height: auto;
}
.energy-bar {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #344c56;
  color: #a6b7b9;
}
.energy-bar b {
  color: var(--accent);
  margin-left: 7px;
}
.telemetry {
  display: grid;
}
.telemetry small {
  display: block;
}
.key-value {
  display: flex;
  justify-content: space-between;
  color: #b8c9cb;
}
.key-value b {
  font-weight: 400;
  overflow-wrap: anywhere;
}
.test-results {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.test-result {
  border: 1px solid #4a6861;
  background: #203d36;
  color: #a9d5bd;
  border-radius: 5px;
  font-size: 11px;
  padding: 7px;
}
.test-result.failed {
  border-color: #8a5e4b;
  background: #3e2d29;
  color: #edb6a4;
}
.next {
  background: #b88747;
  color: #101e25;
  border: 1px solid #e8b26a;
  font-weight: 650;
}
.code-panel {
  align-self: start;
}
.code-header {
  border-bottom: 1px solid #354951;
}
.code-header h2 span {
  font: 10px var(--font-code);
  border: 1px solid #567166;
  padding: 3px 5px;
  color: #95c7a7;
  margin-left: 8px;
}
.editor-wrap {
  position: relative;
  display: flex;
  overflow: hidden;
}
#gutter {
  width: 44px;
  flex-shrink: 0;
  text-align: right;
  padding: 18px 7px 18px 0;
  overflow: hidden;
  user-select: none;
}
#code {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  padding: 18px 14px;
  outline: none;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}
#code:focus {
  box-shadow: inset 0 0 0 1px #647f79;
}
.line-status {
  border-top: 1px solid #2c414c;
}
.primary {
  font-weight: 700;
}
.primary:hover {
  background: #eab97a;
}
.playback {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.verify {
  width: calc(100% - 36px);
  margin: 0 18px 15px;
}
.console {
  border-top: 1px solid #34464f;
}
pre {
  font: 11px/1.7 var(--font-code);
  color: #94bfaf;
  margin: 0;
  min-height: 35px;
  max-height: 110px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
details {
  border-top: 1px solid #34464f;
  padding: 12px 18px;
  font-size: 11px;
  color: #9eb4b7;
  line-height: 1.7;
}
summary {
  color: #c0ccc9;
}
dl {
  margin: 10px 0 0;
}
dt {
  font-family: var(--font-code);
  color: #e7bb7f;
  margin-top: 8px;
}
dd {
  margin: 2px 0;
  color: #829da2;
}
footer {
  margin: auto;
  display: flex;
  justify-content: space-between;
}
.battery {
  cursor: pointer;
}
.battery:focus {
  outline: none;
}
.battery:focus rect:first-of-type {
  stroke: #fff;
  stroke-width: 3;
}
.battery:hover {
  filter: brightness(1.2);
}
.order-button {
  flex: 1;
}
.order-button.locked {
  cursor: not-allowed;
}
.learning-guide {
  margin: 0 0 18px;
}
.guide-tabs button {
  background: none;
}
#guide-content p {
  margin: 0 0 9px;
}
#guide-content ol {
  margin: 7px 0 0;
}
#guide-content li {
  padding-left: 3px;
}
#guide-content pre {
  color: #f0d39c;
  overflow: auto;
  margin: 10px 0;
}
#guide-content>button {
  font-weight: 650;
}
.code-toolbox {
  border-bottom: 1px solid #344b53;
}
#code-tokens {
  display: flex;
  flex-wrap: wrap;
}
.learning-guide button:disabled,#code-tokens button:disabled {
  opacity: .45;
}
.level-status {
  margin: 12px 0 0;
  border: 1px solid #826a43;
}
.inspector .key-value {
  flex-wrap: wrap;
}
.scene.powered {
  border-color: #79b38e;
  box-shadow: 0 0 22px #77cd9b18;
}
.scene.powered .energy-bar {
  background: #203c32;
  border-top-color: #518365;
}
.scene.powered .energy-bar b {
  color: #b2efc1;
}
.generator-wave {
  transform-box: fill-box;
  transform-origin: center;
}
.code-surface {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#code-highlight {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  width: max-content;
  max-height: none;
  min-height: 100%;
  margin: 0;
  padding: 18px 14px;
  border: 0;
  white-space: pre;
  overflow: visible;
  pointer-events: none;
  tab-size: 4;
  font-variant-ligatures: none;
}
#code {
  position: absolute;
  inset: 0;
  resize: none;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: transparent;
  font-variant-ligatures: none;
}
#code::selection {
  background: #5683ac66;
}
.py-operator {
  color: #f0a0a6;
}
body {
  background-attachment: fixed;
}
header {
  border-bottom-color: #30453d;
}
main {
  position: relative;
}
.welcome {
  margin: auto;
  display: grid;
  animation: panel-arrive .5s ease-out;
}
.welcome-copy>p:not(.eyebrow) {
  color: #9ab2ad;
  font-size: 15px;
  line-height: 1.9;
  max-width: 480px;
}
.entry-card input:not([type=checkbox]),.entry-card>select {
  background: #102427;
}
.entry-submit {
  padding: 14px;
}
.mode-switch {
  display: flex;
}
.dispatch {
  margin: 0 0 18px;
}
.order-controls button {
  border: 1px solid #a0d0a1;
  font-weight: 700;
}
.order-controls p {
  margin: 9px 0 0;
}
.order-report {
  margin-top: 10px;
  animation: panel-arrive .4s ease-out;
}
.report-metrics {
  display: grid;
}
.report-metrics b {
  display: block;
}
.report-metrics span {
  display: block;
}
.report-scroll {
  overflow-x: auto;
}
.order-report table {
  border-collapse: collapse;
  width: 100%;
}
.order-report th {
  text-align: left;
}
.order-report td,.order-report th {
  border-bottom: 1px solid #314c3e;
}
.order-report>p:last-child {
  margin-bottom: 0;
}
.level-status.passed {
  animation: status-light .6s ease-out;
}
.code-panel {
  animation: panel-arrive .35s ease-out;
}
@keyframes panel-arrive {
  from {
    opacity: .3;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes terminal-sweep {
  0%,100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(165%);
  }
}
@keyframes status-light {
  from {
    box-shadow: 0 0 14px #9edb9466;
  }
  to {
    box-shadow: none;
  }
}
@media(max-width:820px) {
  .chapter {
    display: none;
  }
  nav {
    gap: 5px;
    flex-wrap: wrap;
  }
  .code-panel {
    margin-top: 8px;
  }
}
@media(max-width:820px) {
  #orders {
    flex-wrap: wrap;
  }
  .order-button {
    flex-basis: 100%;
  }
}
@media(forced-colors:active) {
  #code-highlight {
    display: none;
  }
  #code {
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }
}
@media(max-width:1100px) {
  .header-actions #player-label {
    display: none;
  }
}
@media(max-width:820px) {
  .header-actions+.runtime {
    display: none;
  }
}
