@import url("https://cdn.jsdelivr.net/npm/@fontsource/fusion-pixel-12px-monospaced-sc@5.3.0/index.css");

:root {
  color-scheme: light;
  font-family: "Fusion Pixel 12px Monospaced SC", monospace;
  color: #183a31;
  background: #0d2925;
  --ink: #112f29;
  --ink-deep: #081d1a;
  --forest: #19483a;
  --forest-light: #2f6750;
  --moss: #719a35;
  --leaf: #a7cc55;
  --gold: #e1bb4f;
  --gold-light: #ffe38a;
  --paper: #f4e8bd;
  --paper-light: #fff7d7;
  --paper-shadow: #b39a61;
  --wood: #7a4d2f;
  --wood-dark: #4a2b20;
  --coral: #d9664c;
  --sky: #7bc6be;
}

* {
  box-sizing: border-box;
  border-radius: 0;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #0d2925;
  background-image: url("/assets/pixel-greenhouse-interior.png");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  image-rendering: pixelated;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  content: "";
  pointer-events: none;
}

body::before {
  inset: 0;
  background: rgba(5, 22, 17, .34);
}

body::after {
  display: none;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

img,
svg,
canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid var(--gold-light);
  outline-offset: 3px;
}

.tutor-app {
  width: min(1500px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(17, 47, 41, .58);
  border-inline: 4px solid var(--ink-deep);
  box-shadow: 8px 0 0 rgba(8, 29, 26, .45), -8px 0 0 rgba(8, 29, 26, .45);
}

.tutor-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 10px 24px;
  color: var(--paper-light);
  background: rgba(17, 47, 41, .97);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 4px 0 var(--ink-deep);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-pixel {
  position: relative;
  display: block;
  width: 34px;
  height: 38px;
  background: var(--wood);
  border: 4px solid var(--wood-dark);
  box-shadow: 4px 4px 0 var(--ink-deep);
}

.brand-pixel::before,
.brand-pixel::after,
.brand-pixel span {
  position: absolute;
  content: "";
}

.brand-pixel::before {
  top: -14px;
  left: 3px;
  width: 12px;
  height: 18px;
  background: var(--leaf);
  border: 3px solid var(--ink);
}

.brand-pixel::after {
  top: -12px;
  right: 1px;
  width: 13px;
  height: 18px;
  background: var(--moss);
  border: 3px solid var(--ink);
}

.brand-pixel span {
  top: 0;
  left: 13px;
  width: 4px;
  height: 20px;
  background: var(--ink);
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-size: 18px;
  line-height: 1;
}

.brand-copy small {
  color: var(--leaf);
  font-size: 9px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.page-title span {
  color: var(--gold);
  font-size: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-height: 38px;
  padding: 7px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink-deep);
  box-shadow: 3px 3px 0 var(--paper-shadow);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink-deep);
  background: var(--gold-light);
}

.back-link:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.workshop-status {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 32px;
  padding: 4px 26px;
  color: #b9d5bd;
  background: rgba(35, 75, 62, .94);
  border-bottom: 4px solid var(--ink-deep);
  font-size: 9px;
}

.workshop-status span:last-child {
  text-align: right;
}

.workshop-status b {
  padding: 2px 20px;
  color: var(--ink-deep);
  background: var(--gold);
  border-inline: 3px solid var(--ink-deep);
  font-size: 10px;
}

.tutor-workspace {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  min-height: calc(100vh - 112px);
  background: rgba(22, 66, 52, .26);
}

.upload-panel {
  position: relative;
  z-index: 1;
  padding: 28px 24px 34px;
  background: var(--paper);
  border-right: 4px solid var(--ink-deep);
  box-shadow: inset -8px 0 0 var(--paper-shadow);
}

.upload-panel::before,
.upload-panel::after {
  position: absolute;
  left: 0;
  width: calc(100% - 8px);
  height: 8px;
  background: #e0c986;
  border-block: 2px solid #9d814d;
  content: "";
}

.upload-panel::before {
  top: 0;
}

.upload-panel::after {
  bottom: 0;
}

.section-heading h1,
.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading h1 {
  margin-top: 8px;
  color: var(--ink);
  font-size: 27px;
  line-height: 1.15;
}

.section-heading h2 {
  margin-top: 8px;
  color: var(--paper-light);
  font-size: 24px;
  line-height: 1.2;
}

.section-heading > p:last-child {
  margin-top: 12px;
  color: #5d654e;
  font-size: 12px;
  line-height: 1.8;
}

.candidate-workspace .section-heading > p:last-child {
  color: #b7cfb9;
}

.section-index {
  color: #97422f;
  font-size: 10px;
  font-weight: 700;
}

.section-index span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 24px;
  margin-right: 8px;
  color: var(--paper-light);
  background: var(--coral);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--paper-shadow);
}

.npc-briefing {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin: 22px 0 18px;
}

.npc-stage {
  display: grid;
  place-items: end center;
  width: 72px;
  height: 116px;
  overflow: hidden;
  background: var(--sky);
  border: 4px solid var(--ink);
  border-bottom-width: 10px;
  box-shadow: 4px 4px 0 var(--paper-shadow);
}

.npc-stage img {
  display: block;
  width: 52px;
  height: 104px;
  object-fit: contain;
}

.dialogue-box {
  position: relative;
  align-self: start;
  min-height: 96px;
  padding: 12px 13px;
  background: var(--paper-light);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--paper-shadow);
}

.dialogue-box::before {
  position: absolute;
  bottom: 12px;
  left: -11px;
  width: 8px;
  height: 16px;
  background: var(--paper-light);
  border-block: 3px solid var(--ink);
  content: "";
}

.dialogue-box span {
  display: block;
  color: var(--moss);
  font-size: 9px;
  font-weight: 700;
}

.dialogue-box p {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.65;
}

#tutor-upload-form {
  display: grid;
  gap: 14px;
}

.file-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #e9d69a;
  border: 4px solid var(--ink);
  box-shadow: inset 4px 4px 0 #c2a967, 4px 4px 0 var(--paper-shadow);
  cursor: pointer;
}

.field-label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.file-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px;
  color: #526c46;
  background: var(--paper-light);
  border: 3px dashed #60785a;
}

.file-slot b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--paper-light);
  background: var(--moss);
  border: 3px solid var(--ink);
  font-family: monospace;
  font-size: 20px;
  line-height: 1;
}

.file-slot em {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.file-field small {
  color: #6f674e;
  font-size: 9px;
  text-align: center;
}

.file-field input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: var(--paper-light);
  border: 3px solid var(--ink);
  font-size: 10px;
  cursor: pointer;
}

.file-field input::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  padding: 6px 10px;
  color: var(--paper-light);
  background: var(--forest-light);
  border: 0;
  border-right: 3px solid var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.rights-field {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  cursor: pointer;
}

.rights-field input {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  background: var(--paper-light);
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 var(--paper-shadow);
  cursor: pointer;
}

.rights-field input:checked {
  background: var(--leaf);
  box-shadow: inset 0 0 0 4px var(--paper-light), 2px 2px 0 var(--paper-shadow);
}

.privacy-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin: 0;
  padding: 9px 10px;
  color: #5f593f;
  background: #dfcf9c;
  border-left: 4px solid var(--gold);
  font-size: 10px;
  line-height: 1.65;
}

.privacy-note span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  font-family: monospace;
  font-weight: 900;
}

.primary-command,
.delete-command,
.action-switcher button {
  min-height: 42px;
  border: 3px solid var(--ink-deep);
  font-weight: 700;
  cursor: pointer;
}

.primary-command {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px 13px;
  color: var(--paper-light);
  background: var(--moss);
  border-width: 4px;
  box-shadow: 4px 4px 0 #47641e;
}

.primary-command:not(:disabled):hover {
  background: #85aa3b;
}

.primary-command:not(:disabled):active,
.delete-command:not(:disabled):active,
.action-switcher button:not(:disabled):active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.primary-command:disabled,
.delete-command:disabled,
.action-switcher button:disabled {
  cursor: not-allowed;
  filter: grayscale(.8);
  opacity: .55;
}

.system-log {
  margin-top: 20px;
  background: var(--ink);
  border: 4px solid var(--ink-deep);
  box-shadow: 4px 4px 0 var(--paper-shadow);
}

.log-label {
  display: block;
  padding: 5px 9px;
  color: var(--gold);
  border-bottom: 2px solid #426658;
  font-size: 8px;
}

.tutor-status {
  min-height: 58px;
  margin: 0;
  padding: 11px 12px 11px 28px;
  color: #d9edc4;
  background: var(--ink);
  font-size: 10px;
  line-height: 1.7;
}

.tutor-status::before {
  margin-left: -16px;
  color: var(--leaf);
  content: ">";
}

.tutor-status[data-kind="error"] {
  color: #ffd4c7;
  background: #572e29;
}

.tutor-status[data-kind="error"]::before {
  color: #ff8b69;
}

.tutor-status[data-kind="success"] {
  color: #dff5b7;
  background: #234f34;
}

.tutor-status[data-kind="loading"] {
  color: #fff0a9;
  background: #4e4924;
}

.candidate-workspace {
  position: relative;
  min-width: 0;
  padding: 28px 30px 34px;
  overflow: hidden;
  background: rgba(30, 82, 64, .46);
}

.candidate-workspace::before,
.candidate-workspace::after {
  position: absolute;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.candidate-workspace::before {
  top: 42px;
  right: 32px;
  width: 96px;
  height: 72px;
  background: var(--sky);
  border: 8px solid var(--ink);
  box-shadow: inset 0 -8px 0 #4c8d78, -24px 26px 0 #36634e;
}

.candidate-workspace::after {
  right: 0;
  bottom: 0;
  left: 0;
  height: 31%;
  background: rgba(106, 67, 41, .68);
  border-top: 8px solid var(--wood-dark);
  box-shadow: inset 0 16px 0 #68402b;
}

.candidate-toolbar,
.candidate-list,
.record-commands {
  position: relative;
  z-index: 1;
}

.candidate-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 122px;
  padding: 18px 20px;
  background: var(--ink);
  border: 4px solid var(--ink-deep);
  box-shadow: 6px 6px 0 #173c31;
}

.section-heading.compact {
  max-width: 520px;
}

.candidate-toolbar .section-index {
  color: #f19070;
}

.candidate-toolbar .section-index span {
  box-shadow: 3px 3px 0 #071c18;
}

.action-console {
  display: grid;
  gap: 6px;
  min-width: 270px;
}

.action-console > span {
  color: var(--gold);
  font-size: 9px;
  text-align: right;
}

.action-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  border: 3px solid var(--paper-shadow);
  box-shadow: 4px 4px 0 #071c18;
}

.action-switcher button {
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  color: #bfd2bd;
  background: #305c49;
  border: 0;
  border-right: 3px solid var(--ink-deep);
  font-size: 10px;
}

.action-switcher button:last-child {
  border-right: 0;
}

.action-switcher button[aria-pressed="true"] {
  color: var(--ink-deep);
  background: var(--gold);
  box-shadow: inset 0 -5px 0 #a7832e;
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-height: 470px;
  padding-block: 28px 24px;
}

.empty-state {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  width: min(620px, calc(100% - 32px));
  min-height: 280px;
  margin: 0;
  padding: 184px 38px 28px;
  color: #d6e3bd;
  background: rgba(17, 47, 41, .92);
  border: 4px solid var(--gold);
  box-shadow: 6px 6px 0 var(--ink-deep), inset 0 0 0 4px #315b4a;
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}

.empty-state::before {
  display: block;
  width: 64px;
  height: 112px;
  margin: -150px auto 32px;
  background: #557361;
  border: 4px solid #76917a;
  box-shadow: -112px 0 0 #557361, -116px 0 0 #76917a, 112px 0 0 #557361, 116px 0 0 #76917a;
  content: "";
}

.empty-state::after {
  display: block;
  width: 200px;
  height: 4px;
  margin: 18px auto 0;
  background: var(--gold);
  box-shadow: 0 7px 0 #315b4a;
  content: "";
}

.candidate-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 160px 1fr auto;
  min-width: 0;
  padding: 14px;
  background: var(--paper);
  border: 4px solid var(--ink-deep);
  box-shadow: 6px 6px 0 #102b26, inset 0 0 0 3px #d5bd79;
}

.candidate-card::before,
.candidate-card::after {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border: 2px solid var(--ink);
  content: "";
}

.candidate-card::before {
  top: 6px;
  right: 6px;
}

.candidate-card::after {
  right: 6px;
  bottom: 6px;
}

.candidate-card[data-selection="selected"] {
  border-color: var(--gold-light);
  box-shadow: 6px 6px 0 var(--coral), inset 0 0 0 4px var(--gold);
}

.candidate-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding-right: 18px;
  border-bottom: 3px solid #b49350;
}

.candidate-heading span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  color: var(--paper-light);
  background: var(--coral);
  border: 2px solid var(--ink);
  font-size: 9px;
  font-weight: 700;
}

.candidate-heading h3 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
}

.candidate-stage {
  position: relative;
  display: grid;
  place-items: end center;
  width: 96px;
  height: 160px;
  margin: 12px auto 0;
  overflow: hidden;
  background: var(--sky);
  border: 4px solid var(--ink);
  border-bottom: 10px solid #567342;
  box-shadow: 4px 4px 0 var(--paper-shadow);
}

.candidate-stage::before,
.candidate-stage::after {
  position: absolute;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.candidate-stage::before {
  inset: 0 auto 0 29px;
  width: 4px;
  background: rgba(17, 47, 41, .35);
  box-shadow: 29px 0 0 rgba(17, 47, 41, .35);
}

.candidate-stage::after {
  right: 0;
  bottom: 0;
  left: 0;
  height: 22px;
  background: #668c4c;
  border-top: 4px solid var(--ink);
}

.candidate-sprite {
  position: relative;
  z-index: 1;
  display: block;
  width: 64px;
  height: 128px;
  object-fit: contain;
  image-rendering: pixelated;
}

.trait-list {
  display: grid;
  gap: 0;
  margin: 14px 0;
  padding: 0;
  border: 3px solid var(--ink);
  list-style: none;
}

.trait-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 29px;
  padding: 6px 7px;
  background: var(--paper-light);
  border-bottom: 2px solid #c4ad70;
  font-size: 9px;
}

.trait-list li:last-child {
  border-bottom: 0;
}

.trait-list span {
  color: #77705b;
}

.trait-list b {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-align: right;
}

.color-swatch {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border: 2px solid var(--ink);
}

.candidate-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px;
  color: var(--paper-light);
  background: var(--forest-light);
  border: 3px solid var(--ink-deep);
  box-shadow: 3px 3px 0 #152f28;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.candidate-choice:hover {
  background: var(--moss);
}

.candidate-choice:has(input:checked) {
  color: var(--ink-deep);
  background: var(--gold);
  box-shadow: 3px 3px 0 var(--coral);
}

.candidate-choice input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  background: var(--paper-light);
  border: 3px solid var(--ink);
}

.candidate-choice input:checked {
  background: var(--coral);
  box-shadow: inset 0 0 0 3px var(--paper-light);
}

.record-commands {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 10px 12px;
  background: var(--ink);
  border: 4px solid var(--ink-deep);
  box-shadow: 5px 5px 0 #40271f;
}

.record-commands p {
  margin: 0;
  color: #d4e2c2;
  font-size: 10px;
  font-weight: 700;
}

.record-commands p::before {
  margin-right: 8px;
  color: var(--gold);
  content: "◆";
}

.delete-command {
  min-height: 38px;
  padding: 7px 11px;
  color: #ffc4b2;
  background: #59322b;
  border-color: #b75b4c;
  box-shadow: 3px 3px 0 #071c18;
  font-size: 9px;
}

.delete-command:not(:disabled):hover {
  color: var(--paper-light);
  background: #793d32;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .tutor-app {
    width: 100%;
    border-inline: 0;
    box-shadow: none;
  }

  .tutor-workspace {
    grid-template-columns: minmax(310px, 350px) minmax(0, 1fr);
  }

  .candidate-workspace {
    padding-inline: 20px;
  }

  .candidate-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .action-console {
    width: 100%;
  }

  .action-console > span {
    text-align: left;
  }

  .candidate-list {
    gap: 10px;
  }

  .candidate-card {
    padding: 10px;
  }
}

@media (max-width: 820px) {
  .tutor-header {
    grid-template-columns: 1fr auto;
    padding-inline: 16px;
  }

  .page-title {
    display: none;
  }

  .tutor-workspace {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    padding: 28px max(18px, calc((100% - 640px) / 2)) 34px;
    border-right: 0;
    border-bottom: 6px solid var(--ink-deep);
    box-shadow: inset 0 -8px 0 var(--paper-shadow);
  }

  .candidate-workspace {
    padding: 24px 18px 30px;
  }

  .candidate-list {
    min-height: 430px;
  }
}

@media (max-width: 720px) {
  .workshop-status {
    padding-inline: 14px;
  }

  .workshop-status span {
    font-size: 8px;
  }

  .candidate-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .candidate-heading {
    align-items: start;
    min-height: 54px;
  }

  .candidate-heading h3 {
    font-size: 11px;
  }

  .trait-list li {
    align-items: start;
    flex-direction: column;
    gap: 3px;
  }

  .trait-list b {
    text-align: left;
  }

  .candidate-choice {
    min-height: 54px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .tutor-header {
    min-height: 68px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small {
    display: none;
  }

  .back-link {
    padding: 6px 8px;
    font-size: 10px;
  }

  .workshop-status {
    grid-template-columns: 1fr auto;
  }

  .workshop-status span:last-child {
    display: none;
  }

  .workshop-status b {
    padding-inline: 12px;
  }

  .candidate-toolbar {
    padding: 16px 14px;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .candidate-list {
    grid-template-columns: 1fr;
    min-height: 360px;
  }

  .candidate-card {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: auto 160px auto;
    column-gap: 12px;
    padding: 12px;
  }

  .candidate-heading {
    grid-column: 1 / -1;
    min-height: 38px;
  }

  .candidate-stage {
    grid-column: 1;
    grid-row: 2;
  }

  .trait-list {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    margin: 12px 0 0;
  }

  .candidate-choice {
    grid-column: 1 / -1;
  }

  .empty-state {
    width: 100%;
    min-height: 260px;
    padding-inline: 24px;
  }

  .empty-state::before {
    box-shadow: -80px 0 0 #557361, -84px 0 0 #76917a, 80px 0 0 #557361, 84px 0 0 #76917a;
  }
}

@media (max-width: 420px) {
  .tutor-header {
    padding-inline: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-pixel {
    width: 28px;
    height: 32px;
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .back-link span {
    display: none;
  }

  .upload-panel {
    padding-inline: 14px;
  }

  .npc-briefing {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .npc-stage {
    width: 64px;
  }

  .dialogue-box {
    padding: 10px;
  }

  .file-slot {
    align-items: center;
    flex-direction: column;
  }

  .candidate-workspace {
    padding-inline: 10px;
  }

  .action-console {
    min-width: 0;
  }

  .action-switcher {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .action-switcher button {
    padding-inline: 3px;
  }

  .candidate-card {
    grid-template-columns: 102px minmax(0, 1fr);
    column-gap: 8px;
  }

  .trait-list li {
    min-height: 27px;
    padding: 4px 5px;
  }

  .record-commands {
    align-items: stretch;
    flex-direction: column;
  }

  .delete-command {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* Scene-first layout, readable type, and one consolidated control skin. */
body.pixel-tutor {
  font-size: 13px;
}

body.pixel-tutor .tutor-workspace {
  grid-template-columns: minmax(304px, 356px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  min-height: calc(100vh - 112px);
  padding: 24px;
  background: transparent;
}

body.pixel-tutor .upload-panel {
  align-self: start;
  padding: 22px 20px 24px;
  border: 2px solid rgba(74, 43, 32, .82);
  background: rgba(255, 241, 200, .94);
  box-shadow: 0 12px 24px rgba(7, 27, 21, .18);
}

body.pixel-tutor .upload-panel::before,
body.pixel-tutor .upload-panel::after,
body.pixel-tutor .candidate-workspace::before,
body.pixel-tutor .candidate-workspace::after {
  content: none;
}

body.pixel-tutor .candidate-workspace {
  min-height: calc(100vh - 160px);
  padding: 0 0 28px;
  overflow: visible;
  background: transparent;
}

body.pixel-tutor .candidate-toolbar {
  min-height: 112px;
  padding: 17px 18px;
  border: 4px solid var(--ink-deep);
  background: rgba(9, 43, 35, .94);
  box-shadow: 5px 5px 0 rgba(7, 27, 21, .82), inset 0 0 0 2px #315b4a;
}

body.pixel-tutor .candidate-list {
  min-height: 320px;
  padding: 24px 0 20px;
}

body.pixel-tutor .empty-state {
  width: min(540px, calc(100% - 24px));
  min-height: 168px;
  padding: 104px 24px 20px;
  border: 1px solid rgba(229, 211, 150, .58);
  background: rgba(10, 43, 35, .68);
  box-shadow: none;
  color: #eef2d4;
  font-size: 13px;
  line-height: 1.65;
}

body.pixel-tutor .empty-state::before {
  width: 46px;
  height: 68px;
  margin: -82px auto 18px;
  border: 2px solid rgba(190, 211, 183, .56);
  background: rgba(143, 167, 146, .58);
  box-shadow: -76px 0 0 rgba(143, 167, 146, .36), 76px 0 0 rgba(143, 167, 146, .36);
}

body.pixel-tutor .empty-state::after {
  width: 120px;
  height: 2px;
  margin-top: 14px;
  background: rgba(241, 199, 91, .72);
  box-shadow: none;
}

body.pixel-tutor .npc-stage,
body.pixel-tutor .candidate-stage {
  background: #7b9368;
}

body.pixel-tutor .dialogue-box {
  min-width: 0;
  padding: 14px 16px;
  border: 4px solid #4b2d1d;
  background: #fff4c9;
  box-shadow: inset 0 0 0 3px #ead39a, inset 0 -4px 0 #d2aa68, 4px 5px 0 #352117;
}

body.pixel-tutor .dialogue-box::before {
  bottom: 13px;
  left: -13px;
  width: 10px;
  height: 15px;
  border-block: 4px solid #4b2d1d;
  background: #fff4c9;
  box-shadow: -3px 3px 0 #352117;
}

body.pixel-tutor .dialogue-box::after {
  content: none;
}

body.pixel-tutor .dialogue-box span {
  color: #315b48;
  font-size: 12px;
}

body.pixel-tutor .dialogue-box p,
body.pixel-tutor .section-heading > p:last-child,
body.pixel-tutor .rights-field,
body.pixel-tutor .privacy-note,
body.pixel-tutor .tutor-status,
body.pixel-tutor .record-commands p {
  font-size: 13px;
}

body.pixel-tutor .brand-copy small,
body.pixel-tutor .page-title,
body.pixel-tutor .workshop-status,
body.pixel-tutor .section-index,
body.pixel-tutor .field-label,
body.pixel-tutor .file-field small,
body.pixel-tutor .file-field input,
body.pixel-tutor .log-label,
body.pixel-tutor .action-console > span,
body.pixel-tutor .candidate-heading span,
body.pixel-tutor .delete-command {
  font-size: 12px;
}

body.pixel-tutor .back-link,
body.pixel-tutor .file-slot,
body.pixel-tutor .file-field input::file-selector-button,
body.pixel-tutor .action-switcher button,
body.pixel-tutor .candidate-choice {
  font-size: 13px;
}

body.pixel-tutor .section-index {
  color: #765036 !important;
}

body.pixel-tutor .section-index span {
  border-color: #4b2d1d;
  background: #765036;
  color: #fff4c9;
  box-shadow: 2px 2px 0 #9d814d;
}

body.pixel-tutor .file-field {
  gap: 9px;
  padding: 12px 0 4px;
  border: 0;
  border-top: 2px solid rgba(91, 67, 42, .56);
  background: transparent;
  box-shadow: none;
}

body.pixel-tutor .file-slot {
  min-height: 54px;
  border: 1px dashed #718066;
  background: rgba(255, 249, 229, .72);
}

body.pixel-tutor .file-field input {
  min-height: 42px;
  padding: 4px;
  border: 2px solid #78583c;
  background: #fff8dc;
  color: #3d2b20;
  box-shadow: inset 2px 2px 0 #dfc994;
}

body.pixel-tutor .file-field input::file-selector-button {
  min-height: 30px;
  border: 0;
  border-right: 2px solid #78583c;
  background: #ead7a2;
  color: #3d2b20;
  box-shadow: none;
}

body.pixel-tutor .file-field input:focus-visible {
  border-color: #8ed5cf;
  outline: 3px solid #8ed5cf;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(142, 213, 207, .24), inset 2px 2px 0 #dfc994;
}

body.pixel-tutor .rights-field {
  position: relative;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  padding: 8px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.pixel-tutor .rights-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.pixel-tutor .rights-field::before {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #4b2d1d;
  background: #fff8dc;
  color: #173a31;
  box-shadow: inset 2px 2px 0 #d6bd82;
  content: "";
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

body.pixel-tutor .rights-field:has(input:checked)::before {
  border-color: #173f35;
  background: #8ed5cf;
  content: "✓";
  box-shadow: inset 0 0 0 3px #fff4c9;
}

body.pixel-tutor .rights-field:has(input:focus-visible)::before {
  outline: 3px solid #8ed5cf;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(142, 213, 207, .24), inset 0 0 0 3px #fff4c9;
}

body.pixel-tutor .privacy-note {
  padding: 8px 0 8px 10px;
  border-left: 2px solid #8b7044;
  background: rgba(223, 207, 156, .42);
}

body.pixel-tutor .privacy-note span {
  background: #d6bd82;
  border-color: #6d5438;
}

body.pixel-tutor .primary-command {
  color: var(--ink-deep);
  background: var(--gold);
  border-color: #4b2d1d;
  box-shadow: 0 4px 0 #a56e2f, 0 7px 0 var(--ink-deep), inset 0 3px 0 #ffe49a;
  font-size: 14px;
}

body.pixel-tutor .primary-command:not(:disabled):hover {
  background: var(--gold-light);
}

body.pixel-tutor .action-switcher {
  gap: 4px;
  padding: 5px;
  border: 3px solid #4b2d1d;
  background: #765036;
  box-shadow: 3px 3px 0 #2f1c13;
}

body.pixel-tutor .action-switcher button {
  position: relative;
  min-height: 42px;
  padding: 8px 7px;
  border: 1px solid #68472f;
  background: #ead7a2;
  color: #3d2b20;
  box-shadow: none;
  filter: none;
}

body.pixel-tutor .action-switcher button:last-child {
  border-right: 1px solid #68472f;
}

body.pixel-tutor .action-switcher button[aria-pressed="true"] {
  border-color: #8ed5cf;
  background: #173f35;
  color: #fff4c9;
  box-shadow: inset 0 0 0 2px #4f8f80, 0 0 0 2px #8ed5cf;
}

body.pixel-tutor .action-switcher button[aria-pressed="true"]::after {
  content: none;
}

body.pixel-tutor .action-switcher button:focus-visible,
body.pixel-tutor .candidate-choice:has(input:focus-visible) {
  outline: 3px solid #8ed5cf;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(142, 213, 207, .28);
}

body.pixel-tutor .action-switcher button:not(:disabled):active,
body.pixel-tutor .candidate-choice:active {
  transform: translate(2px, 2px);
  box-shadow: none;
  filter: none;
}

body.pixel-tutor .candidate-card {
  border-width: 2px;
  box-shadow: 3px 3px 0 rgba(7, 27, 21, .7), inset 0 0 0 2px #d5bd79;
}

body.pixel-tutor .candidate-card[data-selection="selected"] {
  border-color: #8ed5cf;
  box-shadow: 0 0 0 3px #8ed5cf, 3px 3px 0 rgba(7, 27, 21, .7);
}

body.pixel-tutor .candidate-heading span {
  background: #765036;
  color: #fff4c9;
}

body.pixel-tutor .candidate-heading h3 {
  font-size: 15px;
}

body.pixel-tutor .trait-list {
  border: 0;
  border-top: 1px solid #b79e66;
}

body.pixel-tutor .trait-list li {
  min-height: 34px;
  padding: 7px 2px;
  border-bottom: 1px solid #c4ad70;
  background: transparent;
  font-size: 13px;
}

body.pixel-tutor .candidate-choice {
  position: relative;
  min-width: 0;
  min-height: 48px;
  padding: 9px 12px;
  border: 2px solid #6d5438;
  background: #ead7a2;
  color: #3d2b20;
  box-shadow: none;
  filter: none;
  transition: transform 70ms steps(1, end), box-shadow 70ms steps(1, end);
}

body.pixel-tutor .candidate-choice:hover {
  background: #fff0c4;
}

body.pixel-tutor .candidate-choice:has(input:checked) {
  border-color: #8ed5cf;
  background: #173f35;
  color: #fff4c9;
  box-shadow: inset 0 0 0 2px #4f8f80, 0 0 0 2px #8ed5cf;
  filter: none;
}

body.pixel-tutor .candidate-choice::after {
  content: none;
}

body.pixel-tutor .candidate-choice input {
  appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid #2c211a;
  background: #fff4c9;
  box-shadow: inset 0 0 0 3px #d8c18c;
}

body.pixel-tutor .candidate-choice input:checked {
  background: #8ed5cf;
  box-shadow: inset 0 0 0 3px #fff4c9, inset 0 0 0 6px #173a31;
}

body.pixel-tutor .record-commands {
  min-height: 54px;
  border: 1px solid rgba(190, 211, 183, .34);
  background: rgba(9, 43, 35, .74);
  box-shadow: none;
}

body.pixel-tutor .system-log {
  margin-top: 16px;
  border: 2px solid #28513f;
  background: #061a13;
  box-shadow: none;
  font-family: ui-monospace, "Cascadia Mono", "Courier New", monospace;
}

body.pixel-tutor .system-log .log-label {
  border-bottom: 1px solid #24593f;
  background: #0a241a;
  color: #88d26f;
  font-family: inherit;
  letter-spacing: 0;
}

body.pixel-tutor .system-log .tutor-status,
body.pixel-tutor .system-log .tutor-status[data-kind] {
  background: #061a13;
  color: #9ee879;
  font-family: inherit;
  text-shadow: none;
}

body.pixel-tutor .system-log .tutor-status::before {
  color: #5fe06e;
}

body.pixel-tutor .system-log .tutor-status[data-kind="error"],
body.pixel-tutor .system-log .tutor-status[data-kind="error"]::before {
  color: #ff735d;
}

body.pixel-tutor .system-log .tutor-status[data-kind="loading"] {
  color: #f5d66d;
}

body.pixel-tutor .system-log .tutor-status[data-kind="success"] {
  color: #9ee879;
}

@media (max-width: 1120px) {
  body.pixel-tutor .tutor-workspace {
    grid-template-columns: minmax(292px, 326px) minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }

  body.pixel-tutor .candidate-toolbar {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  body.pixel-tutor {
    overflow-x: clip;
  }

  body.pixel-tutor .tutor-app,
  body.pixel-tutor .tutor-header,
  body.pixel-tutor .tutor-workspace {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.pixel-tutor .tutor-app,
  body.pixel-tutor .tutor-workspace {
    overflow-x: clip;
  }

  body.pixel-tutor .tutor-header {
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  body.pixel-tutor :where(.brand, .brand-copy, .upload-panel, .npc-briefing, .dialogue-box, .candidate-workspace) {
    min-width: 0;
  }

  body.pixel-tutor .brand-copy {
    overflow: hidden;
  }

  body.pixel-tutor .brand-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.pixel-tutor .tutor-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 16px 0 0;
  }

  body.pixel-tutor .upload-panel {
    width: min(calc(100% - 28px), 680px);
    max-width: calc(100vw - 28px);
    margin: 0 auto 20px;
    padding: 20px 18px 22px;
    border: 1px solid rgba(74, 43, 32, .72);
    box-shadow: 0 10px 22px rgba(7, 27, 21, .16);
  }

  body.pixel-tutor .npc-briefing {
    grid-template-columns: 72px minmax(0, 1fr);
    width: 100%;
    margin: 18px -4px;
    padding: 10px 8px;
    border-block: 1px solid rgba(91, 67, 42, .34);
    background: rgba(123, 147, 104, .12);
  }

  body.pixel-tutor .candidate-workspace {
    width: 100%;
    max-width: 100%;
    min-height: 500px;
    padding: 0 14px 26px;
  }

  body.pixel-tutor .dialogue-box {
    width: 100%;
    max-width: 100%;
  }

  body.pixel-tutor .dialogue-box p {
    overflow-wrap: anywhere;
  }

  body.pixel-tutor .candidate-list {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  body.pixel-tutor .back-link,
  body.pixel-tutor .workshop-status span,
  body.pixel-tutor .workshop-status b {
    font-size: 12px;
  }

  body.pixel-tutor .candidate-list {
    min-height: 250px;
  }

  body.pixel-tutor .empty-state {
    min-height: 178px;
    padding: 108px 18px 18px;
  }

  body.pixel-tutor .candidate-card {
    grid-template-columns: 106px minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  body.pixel-tutor .upload-panel {
    width: min(calc(100% - 20px), 680px);
    max-width: calc(100vw - 20px);
    padding-inline: 14px;
  }

  body.pixel-tutor .npc-briefing {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  body.pixel-tutor .back-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.pixel-tutor .dialogue-box {
    padding: 12px;
  }

  body.pixel-tutor .file-field {
    padding-top: 10px;
  }

  body.pixel-tutor .rights-field {
    align-items: start;
  }

  body.pixel-tutor .action-switcher {
    gap: 3px;
    padding: 4px;
  }

  body.pixel-tutor .action-switcher button {
    padding-inline: 3px;
    font-size: 12px;
  }

  body.pixel-tutor .candidate-choice {
    min-height: 52px;
    padding-inline: 9px;
  }
}
